OSDN Git Service

drm/i915: Fix DRRS frontbuffer_bits handling
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 15 Mar 2022 13:27:46 +0000 (15:27 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 16 Mar 2022 11:25:39 +0000 (13:25 +0200)
Now that DRRS can operate on multiple pipes we need to make sure
one pipe doesn't throw away the other pipe's frontbuffer_bits before
said pipe can handle them.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220315132752.11849-4-ville.syrjala@linux.intel.com
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
drivers/gpu/drm/i915/display/intel_drrs.c

index e1b41b7..e9d622f 100644 (file)
@@ -258,7 +258,7 @@ static void intel_drrs_downclock_work(struct work_struct *work)
 }
 
 static void intel_drrs_frontbuffer_update(struct drm_i915_private *dev_priv,
-                                         unsigned int frontbuffer_bits,
+                                         unsigned int all_frontbuffer_bits,
                                          bool invalidate)
 {
        struct intel_crtc *crtc;
@@ -267,6 +267,8 @@ static void intel_drrs_frontbuffer_update(struct drm_i915_private *dev_priv,
                return;
 
        for_each_intel_crtc(&dev_priv->drm, crtc) {
+               unsigned int frontbuffer_bits;
+
                cancel_delayed_work(&crtc->drrs.work);
 
                mutex_lock(&crtc->drrs.mutex);
@@ -276,7 +278,7 @@ static void intel_drrs_frontbuffer_update(struct drm_i915_private *dev_priv,
                        continue;
                }
 
-               frontbuffer_bits &= INTEL_FRONTBUFFER_ALL_MASK(crtc->pipe);
+               frontbuffer_bits = all_frontbuffer_bits & INTEL_FRONTBUFFER_ALL_MASK(crtc->pipe);
                if (invalidate)
                        crtc->drrs.busy_frontbuffer_bits |= frontbuffer_bits;
                else