]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/display: Add support for AuxCCS
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Tue, 24 Mar 2026 08:40:17 +0000 (08:40 +0000)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 24 Mar 2026 13:29:11 +0000 (09:29 -0400)
Add support for mapping the auxiliary CCS buffer into the DPT page tables.

This will allow for better power efficiency by enabling the render
compression frame buffer modifiers such as
I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS in a following patch.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: Michael J. Ruhl <michael.j.ruhl@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patch.msgid.link/20260324084018.20353-12-tvrtko.ursulin@igalia.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/display/xe_fb_pin.c

index 23a7ec41f01d958c8f5bc55181c2a2069c9be6c2..e45a1e7a4670ed51859ab57b8e64c6996df8067a 100644 (file)
@@ -56,6 +56,29 @@ write_dpt_padding(struct iosys_map *map, unsigned int dest, unsigned int pad)
        return dest + pad * sizeof(u64);
 }
 
+static unsigned int
+write_dpt_remapped_linear(struct xe_bo *bo, struct iosys_map *map,
+                         unsigned int dest,
+                         const struct intel_remapped_plane_info *plane)
+{
+       struct xe_device *xe = xe_bo_device(bo);
+       struct xe_ggtt *ggtt = xe_device_get_root_tile(xe)->mem.ggtt;
+       const u64 pte = xe_ggtt_encode_pte_flags(ggtt, bo,
+                                                xe->pat.idx[XE_CACHE_NONE]);
+       unsigned int offset = plane->offset * XE_PAGE_SIZE;
+       unsigned int size = plane->size;
+
+       while (size--) {
+               u64 addr = xe_bo_addr(bo, offset, XE_PAGE_SIZE);
+
+               iosys_map_wr(map, dest, u64, addr | pte);
+               dest += sizeof(u64);
+               offset += XE_PAGE_SIZE;
+       }
+
+       return dest;
+}
+
 static unsigned int
 write_dpt_remapped_tiled(struct xe_bo *bo, struct iosys_map *map,
                         unsigned int dest,
@@ -109,7 +132,10 @@ write_dpt_remapped(struct xe_bo *bo,
                        dest = write_dpt_padding(map, dest, pad);
                }
 
-               dest = write_dpt_remapped_tiled(bo, map, dest, plane);
+               if (plane->linear)
+                       dest = write_dpt_remapped_linear(bo, map, dest, plane);
+               else
+                       dest = write_dpt_remapped_tiled(bo, map, dest, plane);
        }
 }