Skip to content

Commit 32e2450

Browse files
Jocelyn FalempeMaarten Lankhorst
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maarten Lankhorst <[email protected]>
1 parent d2782a0 commit 32e2450

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

drivers/gpu/drm/i915/display/i9xx_plane.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,27 @@ static const struct drm_plane_funcs i8xx_plane_funcs = {
905905
.format_mod_supported_async = intel_plane_format_mod_supported_async,
906906
};
907907

908+
static void i9xx_disable_tiling(struct intel_plane *plane)
909+
{
910+
struct intel_display *display = to_intel_display(plane);
911+
enum i9xx_plane_id i9xx_plane = plane->i9xx_plane;
912+
u32 dspcntr;
913+
u32 reg;
914+
915+
dspcntr = intel_de_read_fw(display, DSPCNTR(display, i9xx_plane));
916+
dspcntr &= ~DISP_TILED;
917+
intel_de_write_fw(display, DSPCNTR(display, i9xx_plane), dspcntr);
918+
919+
if (DISPLAY_VER(display) >= 4) {
920+
reg = intel_de_read_fw(display, DSPSURF(display, i9xx_plane));
921+
intel_de_write_fw(display, DSPSURF(display, i9xx_plane), reg);
922+
923+
} else {
924+
reg = intel_de_read_fw(display, DSPADDR(display, i9xx_plane));
925+
intel_de_write_fw(display, DSPADDR(display, i9xx_plane), reg);
926+
}
927+
}
928+
908929
struct intel_plane *
909930
intel_primary_plane_create(struct intel_display *display, enum pipe pipe)
910931
{
@@ -1047,6 +1068,8 @@ intel_primary_plane_create(struct intel_display *display, enum pipe pipe)
10471068
}
10481069
}
10491070

1071+
plane->disable_tiling = i9xx_disable_tiling;
1072+
10501073
modifiers = intel_fb_plane_get_modifiers(display, INTEL_PLANE_CAP_TILING_X);
10511074

10521075
if (DISPLAY_VER(display) >= 5 || display->platform.g4x)

drivers/gpu/drm/i915/display/intel_display_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,8 @@ struct intel_plane {
15211521
bool async_flip);
15221522
void (*enable_flip_done)(struct intel_plane *plane);
15231523
void (*disable_flip_done)(struct intel_plane *plane);
1524+
/* For drm_panic */
1525+
void (*disable_tiling)(struct intel_plane *plane);
15241526
};
15251527

15261528
#define to_intel_atomic_state(x) container_of(x, struct intel_atomic_state, base)

0 commit comments

Comments
 (0)