Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/psr: Add intel_psr2_panic_force_full_update

When the panic handler is called, configure the psr to send the full
framebuffer to the monitor, otherwise the panic screen is only
partially visible.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250624091501.257661-12-jfalempe@redhat.com
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>

authored by

Jocelyn Falempe and committed by
Maarten Lankhorst
98910fa0 0cc88243

+29
+7
drivers/gpu/drm/i915/display/intel_plane.c
··· 58 58 #include "intel_fb_pin.h" 59 59 #include "intel_fbdev.h" 60 60 #include "intel_plane.h" 61 + #include "intel_psr.h" 61 62 #include "skl_scaler.h" 62 63 #include "skl_universal_plane.h" 63 64 #include "skl_watermark.h" ··· 1321 1320 static void intel_panic_flush(struct drm_plane *plane) 1322 1321 { 1323 1322 struct intel_plane_state *plane_state = to_intel_plane_state(plane->state); 1323 + struct intel_crtc_state *crtc_state = to_intel_crtc_state(plane->state->crtc->state); 1324 1324 struct intel_plane *iplane = to_intel_plane(plane); 1325 1325 struct intel_display *display = to_intel_display(iplane); 1326 1326 struct drm_framebuffer *fb = plane_state->hw.fb; 1327 1327 struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb); 1328 1328 1329 1329 intel_bo_panic_finish(intel_fb); 1330 + 1331 + if (crtc_state->enable_psr2_sel_fetch) { 1332 + /* Force a full update for psr2 */ 1333 + intel_psr2_panic_force_full_update(display, crtc_state); 1334 + } 1330 1335 1331 1336 /* Flush the cache and don't disable tiling if it's the fbdev framebuffer.*/ 1332 1337 if (intel_fb == intel_fbdev_framebuffer(display->fbdev.fbdev)) {
+20
drivers/gpu/drm/i915/display/intel_psr.c
··· 2888 2888 return 0; 2889 2889 } 2890 2890 2891 + void intel_psr2_panic_force_full_update(struct intel_display *display, 2892 + struct intel_crtc_state *crtc_state) 2893 + { 2894 + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); 2895 + enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; 2896 + u32 val = man_trk_ctl_enable_bit_get(display); 2897 + 2898 + /* SF partial frame enable has to be set even on full update */ 2899 + val |= man_trk_ctl_partial_frame_bit_get(display); 2900 + val |= man_trk_ctl_continuos_full_frame(display); 2901 + 2902 + /* Directly write the register */ 2903 + intel_de_write_fw(display, PSR2_MAN_TRK_CTL(display, cpu_transcoder), val); 2904 + 2905 + if (!crtc_state->enable_psr2_su_region_et) 2906 + return; 2907 + 2908 + intel_de_write_fw(display, PIPE_SRCSZ_ERLY_TPT(crtc->pipe), 0); 2909 + } 2910 + 2891 2911 void intel_psr_pre_plane_update(struct intel_atomic_state *state, 2892 2912 struct intel_crtc *crtc) 2893 2913 {
+2
drivers/gpu/drm/i915/display/intel_psr.h
··· 57 57 struct intel_crtc *crtc); 58 58 void intel_psr2_program_trans_man_trk_ctl(struct intel_dsb *dsb, 59 59 const struct intel_crtc_state *crtc_state); 60 + void intel_psr2_panic_force_full_update(struct intel_display *display, 61 + struct intel_crtc_state *crtc_state); 60 62 void intel_psr_pause(struct intel_dp *intel_dp); 61 63 void intel_psr_resume(struct intel_dp *intel_dp); 62 64 bool intel_psr_needs_vblank_notification(const struct intel_crtc_state *crtc_state);