drm/atomic: Allow vblank-enabled + self-refresh "disable"
authorjsg <jsg@openbsd.org>
Wed, 26 Jul 2023 06:22:43 +0000 (06:22 +0000)
committerjsg <jsg@openbsd.org>
Wed, 26 Jul 2023 06:22:43 +0000 (06:22 +0000)
From Brian Norris
db0a9a29912cdc1834214fe35101a4917f8b9907 in linux-6.1.y/6.1.40
9d0e3cac3517942a6e00eeecfe583a98715edb16 in mainline linux

sys/dev/pci/drm/drm_atomic_helper.c

index 9343908..801ebd6 100644 (file)
@@ -1231,7 +1231,16 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state)
                        continue;
 
                ret = drm_crtc_vblank_get(crtc);
-               WARN_ONCE(ret != -EINVAL, "driver forgot to call drm_crtc_vblank_off()\n");
+               /*
+                * Self-refresh is not a true "disable"; ensure vblank remains
+                * enabled.
+                */
+               if (new_crtc_state->self_refresh_active)
+                       WARN_ONCE(ret != 0,
+                                 "driver disabled vblank in self-refresh\n");
+               else
+                       WARN_ONCE(ret != -EINVAL,
+                                 "driver forgot to call drm_crtc_vblank_off()\n");
                if (ret == 0)
                        drm_crtc_vblank_put(crtc);
        }