drm/i915: Skip wm/ddb readout for disabled pipes
authorjsg <jsg@openbsd.org>
Fri, 9 Sep 2022 04:42:06 +0000 (04:42 +0000)
committerjsg <jsg@openbsd.org>
Fri, 9 Sep 2022 04:42:06 +0000 (04:42 +0000)
From Ville Syrjala
1787ec7dcc3761e040d0cd9896d3a40b4efac4cf in linux 5.15.y/5.15.66
0211c2a0ea600e25db3044daaeff4fe41c3ed6d9 in mainline linux

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

index e678740..2b5c740 100644 (file)
@@ -6640,7 +6640,10 @@ void skl_wm_get_hw_state(struct drm_i915_private *dev_priv)
                enum plane_id plane_id;
                u8 slices;
 
-               skl_pipe_wm_get_hw_state(crtc, &crtc_state->wm.skl.optimal);
+               memset(&crtc_state->wm.skl.optimal, 0,
+                      sizeof(crtc_state->wm.skl.optimal));
+               if (crtc_state->hw.active)
+                       skl_pipe_wm_get_hw_state(crtc, &crtc_state->wm.skl.optimal);
                crtc_state->wm.skl.raw = crtc_state->wm.skl.optimal;
 
                memset(&dbuf_state->ddb[pipe], 0, sizeof(dbuf_state->ddb[pipe]));
@@ -6651,6 +6654,9 @@ void skl_wm_get_hw_state(struct drm_i915_private *dev_priv)
                        struct skl_ddb_entry *ddb_uv =
                                &crtc_state->wm.skl.plane_ddb_uv[plane_id];
 
+                       if (!crtc_state->hw.active)
+                               continue;
+
                        skl_ddb_get_hw_plane_state(dev_priv, crtc->pipe,
                                                   plane_id, ddb_y, ddb_uv);