drm/i915/display/i9xx: Add a disable_tiling() for i9xx 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-4-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
This commit is contained in:
Jocelyn Falempe 2025-06-24 11:01:12 +02:00 committed by Maarten Lankhorst
parent d2782a0d8f
commit 32e2450a89
2 changed files with 25 additions and 0 deletions

View File

@ -905,6 +905,27 @@ static const struct drm_plane_funcs i8xx_plane_funcs = {
.format_mod_supported_async = intel_plane_format_mod_supported_async,
};
static void i9xx_disable_tiling(struct intel_plane *plane)
{
struct intel_display *display = to_intel_display(plane);
enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
u32 dspcntr;
u32 reg;
dspcntr = intel_de_read_fw(display, DSPCNTR(display, i9xx_plane));
dspcntr &= ~DISP_TILED;
intel_de_write_fw(display, DSPCNTR(display, i9xx_plane), dspcntr);
if (DISPLAY_VER(display) >= 4) {
reg = intel_de_read_fw(display, DSPSURF(display, i9xx_plane));
intel_de_write_fw(display, DSPSURF(display, i9xx_plane), reg);
} else {
reg = intel_de_read_fw(display, DSPADDR(display, i9xx_plane));
intel_de_write_fw(display, DSPADDR(display, i9xx_plane), reg);
}
}
struct intel_plane *
intel_primary_plane_create(struct intel_display *display, enum pipe pipe)
{
@ -1047,6 +1068,8 @@ intel_primary_plane_create(struct intel_display *display, enum pipe pipe)
}
}
plane->disable_tiling = i9xx_disable_tiling;
modifiers = intel_fb_plane_get_modifiers(display, INTEL_PLANE_CAP_TILING_X);
if (DISPLAY_VER(display) >= 5 || display->platform.g4x)

View File

@ -1521,6 +1521,8 @@ struct intel_plane {
bool async_flip);
void (*enable_flip_done)(struct intel_plane *plane);
void (*disable_flip_done)(struct intel_plane *plane);
/* For drm_panic */
void (*disable_tiling)(struct intel_plane *plane);
};
#define to_intel_atomic_state(x) container_of(x, struct intel_atomic_state, base)