Skip to content

Commit ade4a1f

Browse files
ideakrodrigovivi
authored andcommitted
drm/i915/adlp/fb: Prevent the mapping of redundant trailing padding NULL pages
So far the remapped view size in GTT/DPT was padded to the next aligned offset unnecessarily after the last color plane with an unaligned size. Remove the unnecessary padding. Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Fixes: 3d1adc3 ("drm/i915/adlp: Add support for remapping CCS FBs") Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-3-imre.deak@intel.com (cherry picked from commit 6b6636e) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent 90ab96f commit ade4a1f

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,9 +848,16 @@ unsigned int intel_remapped_info_size(const struct intel_remapped_info *rem_info
848848
int i;
849849

850850
for (i = 0 ; i < ARRAY_SIZE(rem_info->plane); i++) {
851+
unsigned int plane_size;
852+
853+
plane_size = rem_info->plane[i].dst_stride * rem_info->plane[i].height;
854+
if (plane_size == 0)
855+
continue;
856+
851857
if (rem_info->plane_alignment)
852858
size = ALIGN(size, rem_info->plane_alignment);
853-
size += rem_info->plane[i].dst_stride * rem_info->plane[i].height;
859+
860+
size += plane_size;
854861
}
855862

856863
return size;

drivers/gpu/drm/i915/gt/intel_ggtt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,9 @@ remap_pages(struct drm_i915_gem_object *obj,
13961396
{
13971397
unsigned int row;
13981398

1399+
if (!width || !height)
1400+
return sg;
1401+
13991402
if (alignment_pad) {
14001403
st->nents++;
14011404

0 commit comments

Comments
 (0)