drm/i915/display: Add a disable_tiling() for skl planes

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>
This commit is contained in:
Jocelyn Falempe 2025-06-24 11:01:13 +02:00 committed by Maarten Lankhorst
parent 32e2450a89
commit 796f437d7b

View 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;