Skip to content

Commit

Permalink
drm/i915/psr: Add intel_psr_needs_block_dc_vblank for blocking dc entry
Browse files Browse the repository at this point in the history
We need to block DC6 entry in case of Panel Replay as enabling VBI doesn't
prevent it in case of Panel Replay. Panel Replay switches main link off on
DC entry. This means vblank interrupts are not fired and is a problem if
user-space is polling for vblank events. For this purpose add new function
to query need for dc entry blocking on.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240920062340.1333777-2-jouni.hogander@intel.com
  • Loading branch information
Jouni Högander committed Sep 23, 2024
1 parent 66b281f commit 1007610
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions drivers/gpu/drm/i915/display/intel_psr.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "intel_cursor_regs.h"
#include "intel_ddi.h"
#include "intel_de.h"
#include "intel_display_irq.h"
#include "intel_display_types.h"
#include "intel_dp.h"
#include "intel_dp_aux.h"
Expand Down Expand Up @@ -2229,6 +2230,36 @@ void intel_psr_resume(struct intel_dp *intel_dp)
mutex_unlock(&psr->lock);
}

/**
* intel_psr_needs_block_dc_vblank - Check if block dc entry is needed
* @crtc_state: CRTC status
*
* We need to block DC6 entry in case of Panel Replay as enabling VBI doesn't
* prevent it in case of Panel Replay. Panel Replay switches main link off on
* DC entry. This means vblank interrupts are not fired and is a problem if
* user-space is polling for vblank events.
*/
bool intel_psr_needs_block_dc_vblank(const struct intel_crtc_state *crtc_state)
{
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
struct intel_encoder *encoder;

for_each_encoder_on_crtc(crtc->base.dev, &crtc->base, encoder) {
struct intel_dp *intel_dp;

if (!intel_encoder_is_dp(encoder))
continue;

intel_dp = enc_to_intel_dp(encoder);

if (intel_dp_is_edp(intel_dp) &&
CAN_PANEL_REPLAY(intel_dp))
return true;
}

return false;
}

static u32 man_trk_ctl_enable_bit_get(struct intel_display *display)
{
struct drm_i915_private *dev_priv = to_i915(display->drm);
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/display/intel_psr.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
void intel_psr2_program_trans_man_trk_ctl(const struct intel_crtc_state *crtc_state);
void intel_psr_pause(struct intel_dp *intel_dp);
void intel_psr_resume(struct intel_dp *intel_dp);
bool intel_psr_needs_block_dc_vblank(const struct intel_crtc_state *crtc_state);

void intel_psr_lock(const struct intel_crtc_state *crtc_state);
void intel_psr_unlock(const struct intel_crtc_state *crtc_state);
Expand Down

0 comments on commit 1007610

Please sign in to comment.