diff options
author | Imre Deak <imre.deak@intel.com> | 2021-03-25 23:48:03 +0200 |
---|---|---|
committer | Imre Deak <imre.deak@intel.com> | 2021-03-29 22:58:12 +0300 |
commit | 1b6b032aa46f6c0749555dd67f6e576504018252 (patch) | |
tree | ea94640c192f1d1db4f7ca411aeedbbdfbfb6910 /drivers/gpu/drm/i915/i915_vma_types.h | |
parent | drm/i915/intel_fb: Factor out calc_plane_remap_info() (diff) | |
download | linux-dev-1b6b032aa46f6c0749555dd67f6e576504018252.tar.xz linux-dev-1b6b032aa46f6c0749555dd67f6e576504018252.zip |
drm/i915: Shrink the size of intel_remapped_plane_info struct
Save some place in the GTT VMAs by using a u16 instead of unsigned int
to store the view dimensions. The maximum FB stride is 256kB which is
4096 tiles in the worst case (yf-tiles), the maximum FB height is 16k
pixels, which is 16384 tiles in the worst case (linear 4x1 tiled FB).
v2:
- Fix worst case tile height formula in commit log. (Ville)
- Add an assign_chk_ovf helper to simplify the related assignments.
v3:
- Enclose params of the assign_chk_ovf macro in parentheses.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210325214808.2071517-21-imre.deak@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_vma_types.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_vma_types.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_vma_types.h b/drivers/gpu/drm/i915/i915_vma_types.h index f5cb848b7a7e..358b4306fc00 100644 --- a/drivers/gpu/drm/i915/i915_vma_types.h +++ b/drivers/gpu/drm/i915/i915_vma_types.h @@ -97,12 +97,16 @@ enum i915_cache_level; struct intel_remapped_plane_info { /* in gtt pages */ - unsigned int width, height, stride, offset; + u32 offset; + u16 width; + u16 height; + u16 stride; + u16 unused_mbz; } __packed; struct intel_remapped_info { struct intel_remapped_plane_info plane[2]; - unsigned int unused_mbz; + u32 unused_mbz; } __packed; struct intel_rotation_info { @@ -123,9 +127,9 @@ enum i915_ggtt_view_type { static inline void assert_i915_gem_gtt_types(void) { - BUILD_BUG_ON(sizeof(struct intel_rotation_info) != 8*sizeof(unsigned int)); + BUILD_BUG_ON(sizeof(struct intel_rotation_info) != 2 * sizeof(u32) + 8 * sizeof(u16)); BUILD_BUG_ON(sizeof(struct intel_partial_info) != sizeof(u64) + sizeof(unsigned int)); - BUILD_BUG_ON(sizeof(struct intel_remapped_info) != 9*sizeof(unsigned int)); + BUILD_BUG_ON(sizeof(struct intel_remapped_info) != 3 * sizeof(u32) + 8 * sizeof(u16)); /* Check that rotation/remapped shares offsets for simplicity */ BUILD_BUG_ON(offsetof(struct intel_remapped_info, plane[0]) != |