Skip to content

Commit 98910fa

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

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#include "intel_fb_pin.h"
5959
#include "intel_fbdev.h"
6060
#include "intel_plane.h"
61+
#include "intel_psr.h"
6162
#include "skl_scaler.h"
6263
#include "skl_universal_plane.h"
6364
#include "skl_watermark.h"
@@ -1320,13 +1321,19 @@ static unsigned int intel_4tile_get_offset(unsigned int width, unsigned int x, u
13201321
static void intel_panic_flush(struct drm_plane *plane)
13211322
{
13221323
struct intel_plane_state *plane_state = to_intel_plane_state(plane->state);
1324+
struct intel_crtc_state *crtc_state = to_intel_crtc_state(plane->state->crtc->state);
13231325
struct intel_plane *iplane = to_intel_plane(plane);
13241326
struct intel_display *display = to_intel_display(iplane);
13251327
struct drm_framebuffer *fb = plane_state->hw.fb;
13261328
struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
13271329

13281330
intel_bo_panic_finish(intel_fb);
13291331

1332+
if (crtc_state->enable_psr2_sel_fetch) {
1333+
/* Force a full update for psr2 */
1334+
intel_psr2_panic_force_full_update(display, crtc_state);
1335+
}
1336+
13301337
/* Flush the cache and don't disable tiling if it's the fbdev framebuffer.*/
13311338
if (intel_fb == intel_fbdev_framebuffer(display->fbdev.fbdev)) {
13321339
struct iosys_map map;

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2888,6 +2888,26 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
28882888
return 0;
28892889
}
28902890

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+
28912911
void intel_psr_pre_plane_update(struct intel_atomic_state *state,
28922912
struct intel_crtc *crtc)
28932913
{

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
5757
struct intel_crtc *crtc);
5858
void intel_psr2_program_trans_man_trk_ctl(struct intel_dsb *dsb,
5959
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);
6062
void intel_psr_pause(struct intel_dp *intel_dp);
6163
void intel_psr_resume(struct intel_dp *intel_dp);
6264
bool intel_psr_needs_vblank_notification(const struct intel_crtc_state *crtc_state);

0 commit comments

Comments
 (0)