drm/i915: Correctly populate use_sagv_wm for all pipes
authorjsg <jsg@openbsd.org>
Wed, 2 Mar 2022 13:04:05 +0000 (13:04 +0000)
committerjsg <jsg@openbsd.org>
Wed, 2 Mar 2022 13:04:05 +0000 (13:04 +0000)
From Ville Syrjala
1b4445e09df83c397343ef8ab6b3ab560a4831ff in linux 5.15.y/5.15.26
afc189df6bcc6be65961deb54e15ec60e7f85337 in mainline linux

sys/dev/pci/drm/i915/intel_pm.c

index d367dde..8752a2a 100644 (file)
@@ -4022,6 +4022,17 @@ static int intel_compute_sagv_mask(struct intel_atomic_state *state)
                        return ret;
        }
 
+       if (intel_can_enable_sagv(dev_priv, new_bw_state) !=
+           intel_can_enable_sagv(dev_priv, old_bw_state)) {
+               ret = intel_atomic_serialize_global_state(&new_bw_state->base);
+               if (ret)
+                       return ret;
+       } else if (new_bw_state->pipe_sagv_reject != old_bw_state->pipe_sagv_reject) {
+               ret = intel_atomic_lock_global_state(&new_bw_state->base);
+               if (ret)
+                       return ret;
+       }
+
        for_each_new_intel_crtc_in_state(state, crtc,
                                         new_crtc_state, i) {
                struct skl_pipe_wm *pipe_wm = &new_crtc_state->wm.skl.optimal;
@@ -4037,17 +4048,6 @@ static int intel_compute_sagv_mask(struct intel_atomic_state *state)
                        intel_can_enable_sagv(dev_priv, new_bw_state);
        }
 
-       if (intel_can_enable_sagv(dev_priv, new_bw_state) !=
-           intel_can_enable_sagv(dev_priv, old_bw_state)) {
-               ret = intel_atomic_serialize_global_state(&new_bw_state->base);
-               if (ret)
-                       return ret;
-       } else if (new_bw_state->pipe_sagv_reject != old_bw_state->pipe_sagv_reject) {
-               ret = intel_atomic_lock_global_state(&new_bw_state->base);
-               if (ret)
-                       return ret;
-       }
-
        return 0;
 }