]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/display: Add a disable_tiling() for skl planes
authorJocelyn Falempe <jfalempe@redhat.com>
Tue, 24 Jun 2025 09:01:13 +0000 (11:01 +0200)
committerMaarten Lankhorst <dev@lankhorst.se>
Fri, 27 Jun 2025 09:48:22 +0000 (11:48 +0200)
drm_panic draws in linear framebuffer, so it's easier to re-use the
current framebuffer, and disable tiling in the panic handler, to show
the panic screen.

This assumes that the alignment restriction is always smaller in
linear than in tiled.
It also assumes that the linear framebuffer size is always smaller
than the tiled.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250624091501.257661-5-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
drivers/gpu/drm/i915/display/skl_universal_plane.c

index 68f18f18bacd293185328c3688e4870757abc3d1..1ba04f1b3ec05a685000c9de47bf4e4abe8ca373 100644 (file)
@@ -2791,6 +2791,25 @@ static u8 tgl_plane_caps(struct intel_display *display,
        return caps;
 }
 
+static void skl_disable_tiling(struct intel_plane *plane)
+{
+       struct intel_plane_state *state = to_intel_plane_state(plane->base.state);
+       struct intel_display *display = to_intel_display(plane);
+       u32 stride = state->view.color_plane[0].scanout_stride / 64;
+       u32 plane_ctl;
+
+       plane_ctl = intel_de_read(display, PLANE_CTL(plane->pipe, plane->id));
+       plane_ctl &= ~PLANE_CTL_TILED_MASK;
+
+       intel_de_write_fw(display, PLANE_STRIDE(plane->pipe, plane->id),
+                         PLANE_STRIDE_(stride));
+
+       intel_de_write_fw(display, PLANE_CTL(plane->pipe, plane->id), plane_ctl);
+
+       intel_de_write_fw(display, PLANE_SURF(plane->pipe, plane->id),
+                         skl_plane_surf(state, 0));
+}
+
 struct intel_plane *
 skl_universal_plane_create(struct intel_display *display,
                           enum pipe pipe, enum plane_id plane_id)
@@ -2837,6 +2856,7 @@ skl_universal_plane_create(struct intel_display *display,
                plane->max_height = skl_plane_max_height;
                plane->min_cdclk = skl_plane_min_cdclk;
        }
+       plane->disable_tiling = skl_disable_tiling;
 
        if (DISPLAY_VER(display) >= 13)
                plane->max_stride = adl_plane_max_stride;