Skip to content

Commit 796f437

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

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2791,6 +2791,25 @@ static u8 tgl_plane_caps(struct intel_display *display,
27912791
return caps;
27922792
}
27932793

2794+
static void skl_disable_tiling(struct intel_plane *plane)
2795+
{
2796+
struct intel_plane_state *state = to_intel_plane_state(plane->base.state);
2797+
struct intel_display *display = to_intel_display(plane);
2798+
u32 stride = state->view.color_plane[0].scanout_stride / 64;
2799+
u32 plane_ctl;
2800+
2801+
plane_ctl = intel_de_read(display, PLANE_CTL(plane->pipe, plane->id));
2802+
plane_ctl &= ~PLANE_CTL_TILED_MASK;
2803+
2804+
intel_de_write_fw(display, PLANE_STRIDE(plane->pipe, plane->id),
2805+
PLANE_STRIDE_(stride));
2806+
2807+
intel_de_write_fw(display, PLANE_CTL(plane->pipe, plane->id), plane_ctl);
2808+
2809+
intel_de_write_fw(display, PLANE_SURF(plane->pipe, plane->id),
2810+
skl_plane_surf(state, 0));
2811+
}
2812+
27942813
struct intel_plane *
27952814
skl_universal_plane_create(struct intel_display *display,
27962815
enum pipe pipe, enum plane_id plane_id)
@@ -2837,6 +2856,7 @@ skl_universal_plane_create(struct intel_display *display,
28372856
plane->max_height = skl_plane_max_height;
28382857
plane->min_cdclk = skl_plane_min_cdclk;
28392858
}
2859+
plane->disable_tiling = skl_disable_tiling;
28402860

28412861
if (DISPLAY_VER(display) >= 13)
28422862
plane->max_stride = adl_plane_max_stride;

0 commit comments

Comments
 (0)