]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/display: Move remapped plane loop out of __xe_pin_fb_vma_dpt
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Tue, 24 Mar 2026 08:40:14 +0000 (08:40 +0000)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 24 Mar 2026 13:29:11 +0000 (09:29 -0400)
In preparation for adding support for the auxccs plane lets move the
plane iteration loop to its own function.

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-9-tvrtko.ursulin@igalia.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/display/xe_fb_pin.c

index df7d305c6fcd9e45e64c6852375accd16cbe59dd..845e28efce61b3c0249f50473e3037f384ea459f 100644 (file)
@@ -50,9 +50,9 @@ write_dpt_rotated(struct xe_bo *bo, struct iosys_map *map, u32 *dpt_ofs, u32 bo_
 }
 
 static void
-write_dpt_remapped(struct xe_bo *bo, struct iosys_map *map, u32 *dpt_ofs,
-                  u32 bo_ofs, u32 width, u32 height, u32 src_stride,
-                  u32 dst_stride)
+write_dpt_remapped_tiled(struct xe_bo *bo, struct iosys_map *map, u32 *dpt_ofs,
+                        u32 bo_ofs, u32 width, u32 height, u32 src_stride,
+                        u32 dst_stride)
 {
        struct xe_device *xe = xe_bo_device(bo);
        struct xe_ggtt *ggtt = xe_device_get_root_tile(xe)->mem.ggtt;
@@ -78,6 +78,22 @@ write_dpt_remapped(struct xe_bo *bo, struct iosys_map *map, u32 *dpt_ofs,
        *dpt_ofs = ALIGN(*dpt_ofs, 4096);
 }
 
+static void
+write_dpt_remapped(struct xe_bo *bo,
+                  const struct intel_remapped_info *remap_info,
+                  struct iosys_map *map)
+{
+       u32 i, dpt_ofs = 0;
+
+       for (i = 0; i < ARRAY_SIZE(remap_info->plane); i++)
+               write_dpt_remapped_tiled(bo, map, &dpt_ofs,
+                                        remap_info->plane[i].offset,
+                                        remap_info->plane[i].width,
+                                        remap_info->plane[i].height,
+                                        remap_info->plane[i].src_stride,
+                                        sremap_info->plane[i].dst_stride);
+}
+
 static int __xe_pin_fb_vma_dpt(const struct intel_framebuffer *fb,
                               const struct i915_gtt_view *view,
                               struct i915_vma *vma,
@@ -138,17 +154,7 @@ static int __xe_pin_fb_vma_dpt(const struct intel_framebuffer *fb,
                        iosys_map_wr(&dpt->vmap, x * 8, u64, pte | addr);
                }
        } else if (view->type == I915_GTT_VIEW_REMAPPED) {
-               const struct intel_remapped_info *remap_info = &view->remapped;
-               u32 i, dpt_ofs = 0;
-
-               for (i = 0; i < ARRAY_SIZE(remap_info->plane); i++)
-                       write_dpt_remapped(bo, &dpt->vmap, &dpt_ofs,
-                                          remap_info->plane[i].offset,
-                                          remap_info->plane[i].width,
-                                          remap_info->plane[i].height,
-                                          remap_info->plane[i].src_stride,
-                                          remap_info->plane[i].dst_stride);
-
+               write_dpt_remapped(bo, &view->remapped, &dpt->vmap);
        } else {
                const struct intel_rotation_info *rot_info = &view->rotated;
                u32 i, dpt_ofs = 0;