diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2022-03-15 15:27:48 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2022-03-16 14:45:48 +0200 |
commit | fb4ae6e6500a7ca70b41a765eb4189740b7725f0 (patch) | |
tree | 96d071607ef2e500e8392559dc106b2bf165f138 /drivers/gpu | |
parent | 70e10a2b7e989d1e1069f701c4159c20f52a1dac (diff) |
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: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-6-ville.syrjala@linux.intel.com
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_drrs.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_drrs.c b/drivers/gpu/drm/i915/display/intel_drrs.c index 91aab77c495c..f36394fd85be 100644 --- a/drivers/gpu/drm/i915/display/intel_drrs.c +++ b/drivers/gpu/drm/i915/display/intel_drrs.c @@ -278,32 +278,31 @@ static void intel_drrs_frontbuffer_update(struct drm_i915_private *dev_priv, for_each_intel_crtc(&dev_priv->drm, crtc) { unsigned int frontbuffer_bits; - cancel_delayed_work(&crtc->drrs.work); - 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); continue; } - frontbuffer_bits = all_frontbuffer_bits & crtc->drrs.frontbuffer_bits; if (invalidate) crtc->drrs.busy_frontbuffer_bits |= frontbuffer_bits; else crtc->drrs.busy_frontbuffer_bits &= ~frontbuffer_bits; /* 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 * other fbs are quiescent too */ - if (!invalidate && !crtc->drrs.busy_frontbuffer_bits) - schedule_delayed_work(&crtc->drrs.work, - msecs_to_jiffies(1000)); + if (!crtc->drrs.busy_frontbuffer_bits) + mod_delayed_work(system_wq, &crtc->drrs.work, + msecs_to_jiffies(1000)); + else + cancel_delayed_work(&crtc->drrs.work); mutex_unlock(&crtc->drrs.mutex); } |