Commit fb4ae6e6 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Don't cancel/schedule drrs work if the pipe wasn't affected

Skip all the DRRS work cancel/schedule stuff if the pipe's
frontbuffer bits were not among those affected by the frontbuffer
rendering.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-6-ville.syrjala@linux.intel.comReviewed-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
parent 70e10a2b
...@@ -278,32 +278,31 @@ static void intel_drrs_frontbuffer_update(struct drm_i915_private *dev_priv, ...@@ -278,32 +278,31 @@ static void intel_drrs_frontbuffer_update(struct drm_i915_private *dev_priv,
for_each_intel_crtc(&dev_priv->drm, crtc) { for_each_intel_crtc(&dev_priv->drm, crtc) {
unsigned int frontbuffer_bits; unsigned int frontbuffer_bits;
cancel_delayed_work(&crtc->drrs.work);
mutex_lock(&crtc->drrs.mutex); mutex_lock(&crtc->drrs.mutex);
if (!intel_drrs_is_enabled(crtc)) { frontbuffer_bits = all_frontbuffer_bits & crtc->drrs.frontbuffer_bits;
if (!frontbuffer_bits) {
mutex_unlock(&crtc->drrs.mutex); mutex_unlock(&crtc->drrs.mutex);
continue; continue;
} }
frontbuffer_bits = all_frontbuffer_bits & crtc->drrs.frontbuffer_bits;
if (invalidate) if (invalidate)
crtc->drrs.busy_frontbuffer_bits |= frontbuffer_bits; crtc->drrs.busy_frontbuffer_bits |= frontbuffer_bits;
else else
crtc->drrs.busy_frontbuffer_bits &= ~frontbuffer_bits; crtc->drrs.busy_frontbuffer_bits &= ~frontbuffer_bits;
/* flush/invalidate means busy screen hence upclock */ /* flush/invalidate means busy screen hence upclock */
if (frontbuffer_bits) intel_drrs_set_state(crtc, DRRS_REFRESH_RATE_HIGH);
intel_drrs_set_state(crtc, DRRS_REFRESH_RATE_HIGH);
/* /*
* flush also means no more activity hence schedule downclock, if all * flush also means no more activity hence schedule downclock, if all
* other fbs are quiescent too * other fbs are quiescent too
*/ */
if (!invalidate && !crtc->drrs.busy_frontbuffer_bits) if (!crtc->drrs.busy_frontbuffer_bits)
schedule_delayed_work(&crtc->drrs.work, mod_delayed_work(system_wq, &crtc->drrs.work,
msecs_to_jiffies(1000)); msecs_to_jiffies(1000));
else
cancel_delayed_work(&crtc->drrs.work);
mutex_unlock(&crtc->drrs.mutex); mutex_unlock(&crtc->drrs.mutex);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment