Skip to content

Commit

Permalink
Revert "drm/i915/display: Fix glitches when moving cursor with PSR2 s…
Browse files Browse the repository at this point in the history
…elective fetch enabled"

This reverts commit 28f862f.

Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
  • Loading branch information
Timo Aaltonen committed Jun 27, 2022
1 parent 0de48cf commit 6ebf5ef
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/display/intel_cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ intel_legacy_cursor_update(struct drm_plane *_plane,
goto out_free;

intel_frontbuffer_flush(to_intel_frontbuffer(new_plane_state->hw.fb),
ORIGIN_CURSOR_UPDATE);
ORIGIN_FLIP);
intel_frontbuffer_track(to_intel_frontbuffer(old_plane_state->hw.fb),
to_intel_frontbuffer(new_plane_state->hw.fb),
plane->frontbuffer_bit);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/display/intel_fbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ void intel_fbc_invalidate(struct drm_i915_private *dev_priv,
if (!HAS_FBC(dev_priv))
return;

if (origin == ORIGIN_FLIP || origin == ORIGIN_CURSOR_UPDATE)
if (origin == ORIGIN_FLIP)
return;

mutex_lock(&fbc->lock);
Expand All @@ -1161,7 +1161,7 @@ void intel_fbc_flush(struct drm_i915_private *dev_priv,

fbc->busy_bits &= ~frontbuffer_bits;

if (origin == ORIGIN_FLIP || origin == ORIGIN_CURSOR_UPDATE)
if (origin == ORIGIN_FLIP)
goto out;

if (!fbc->busy_bits && fbc->crtc &&
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/i915/display/intel_frontbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ enum fb_op_origin {
ORIGIN_CS,
ORIGIN_FLIP,
ORIGIN_DIRTYFB,
ORIGIN_CURSOR_UPDATE,
};

struct intel_frontbuffer {
Expand Down
34 changes: 19 additions & 15 deletions drivers/gpu/drm/i915/display/intel_psr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2045,28 +2045,35 @@ void intel_psr_invalidate(struct drm_i915_private *dev_priv,
/*
* When we will be completely rely on PSR2 S/W tracking in future,
* intel_psr_flush() will invalidate and flush the PSR for ORIGIN_FLIP
* event also therefore tgl_dc3co_flush_locked() require to be changed
* event also therefore tgl_dc3co_flush() require to be changed
* accordingly in future.
*/
static void
tgl_dc3co_flush_locked(struct intel_dp *intel_dp, unsigned int frontbuffer_bits,
enum fb_op_origin origin)
tgl_dc3co_flush(struct intel_dp *intel_dp, unsigned int frontbuffer_bits,
enum fb_op_origin origin)
{
if (!intel_dp->psr.dc3co_exitline || !intel_dp->psr.psr2_enabled ||
!intel_dp->psr.active)
return;
mutex_lock(&intel_dp->psr.lock);

if (!intel_dp->psr.dc3co_exitline)
goto unlock;

if (!intel_dp->psr.psr2_enabled || !intel_dp->psr.active)
goto unlock;

/*
* At every frontbuffer flush flip event modified delay of delayed work,
* when delayed work schedules that means display has been idle.
*/
if (!(frontbuffer_bits &
INTEL_FRONTBUFFER_ALL_MASK(intel_dp->psr.pipe)))
return;
goto unlock;

tgl_psr2_enable_dc3co(intel_dp);
mod_delayed_work(system_wq, &intel_dp->psr.dc3co_work,
intel_dp->psr.dc3co_exit_delay);

unlock:
mutex_unlock(&intel_dp->psr.lock);
}

/**
Expand All @@ -2091,6 +2098,11 @@ void intel_psr_flush(struct drm_i915_private *dev_priv,
unsigned int pipe_frontbuffer_bits = frontbuffer_bits;
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);

if (origin == ORIGIN_FLIP) {
tgl_dc3co_flush(intel_dp, frontbuffer_bits, origin);
continue;
}

mutex_lock(&intel_dp->psr.lock);
if (!intel_dp->psr.enabled) {
mutex_unlock(&intel_dp->psr.lock);
Expand All @@ -2111,14 +2123,6 @@ void intel_psr_flush(struct drm_i915_private *dev_priv,
continue;
}

if (origin == ORIGIN_FLIP ||
(origin == ORIGIN_CURSOR_UPDATE &&
!intel_dp->psr.psr2_sel_fetch_enabled)) {
tgl_dc3co_flush_locked(intel_dp, frontbuffer_bits, origin);
mutex_unlock(&intel_dp->psr.lock);
continue;
}

/* By definition flush = invalidate + flush */
if (pipe_frontbuffer_bits)
psr_force_hw_tracking_exit(intel_dp);
Expand Down

0 comments on commit 6ebf5ef

Please sign in to comment.