]> Git Repo - linux.git/commitdiff
drm/i915/adlp/fb: Prevent the mapping of redundant trailing padding NULL pages
authorImre Deak <[email protected]>
Tue, 26 Oct 2021 22:51:00 +0000 (01:51 +0300)
committerRodrigo Vivi <[email protected]>
Tue, 9 Nov 2021 15:02:48 +0000 (10:02 -0500)
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 <[email protected]>
Fixes: 3d1adc3d64cf ("drm/i915/adlp: Add support for remapping CCS FBs")
Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Juha-Pekka Heikkila <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit 6b6636e17649d75b4d0cc55d3dff9e44511a442a)
Signed-off-by: Rodrigo Vivi <[email protected]>
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/gt/intel_ggtt.c

index ff598b6cd953034ae2bf10a2570b5fd00eb9b949..ec403e46a32881b33ab028dced7335a1ee7c37a0 100644 (file)
@@ -848,9 +848,16 @@ unsigned int intel_remapped_info_size(const struct intel_remapped_info *rem_info
        int i;
 
        for (i = 0 ; i < ARRAY_SIZE(rem_info->plane); i++) {
+               unsigned int plane_size;
+
+               plane_size = rem_info->plane[i].dst_stride * rem_info->plane[i].height;
+               if (plane_size == 0)
+                       continue;
+
                if (rem_info->plane_alignment)
                        size = ALIGN(size, rem_info->plane_alignment);
-               size += rem_info->plane[i].dst_stride * rem_info->plane[i].height;
+
+               size += plane_size;
        }
 
        return size;
index f17383e76eb719d89d192942c7950099200afcb4..57c97554393b9a8942c114cf6e96980267c4cfe9 100644 (file)
@@ -1396,6 +1396,9 @@ remap_pages(struct drm_i915_gem_object *obj,
 {
        unsigned int row;
 
+       if (!width || !height)
+               return sg;
+
        if (alignment_pad) {
                st->nents++;
 
This page took 0.074556 seconds and 4 git commands to generate.