drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
authorjsg <jsg@openbsd.org>
Wed, 2 Feb 2022 02:51:53 +0000 (02:51 +0000)
committerjsg <jsg@openbsd.org>
Wed, 2 Feb 2022 02:51:53 +0000 (02:51 +0000)
From Manasi Navare
73740f948252e424a01465155d8737bceae23653 in linux 5.15.y/5.15.19
5ec1cebd59300ddd26dbaa96c17c508764eef911 in mainline linux

sys/dev/pci/drm/drm_atomic.c

index 4978839..126ad24 100644 (file)
@@ -1329,8 +1329,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
 
        DRM_DEBUG_ATOMIC("checking %p\n", state);
 
-       for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
-               requested_crtc |= drm_crtc_mask(crtc);
+       for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
+               if (new_crtc_state->enable)
+                       requested_crtc |= drm_crtc_mask(crtc);
+       }
 
        for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
                ret = drm_atomic_plane_check(old_plane_state, new_plane_state);
@@ -1379,8 +1381,10 @@ int drm_atomic_check_only(struct drm_atomic_state *state)
                }
        }
 
-       for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
-               affected_crtc |= drm_crtc_mask(crtc);
+       for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
+               if (new_crtc_state->enable)
+                       affected_crtc |= drm_crtc_mask(crtc);
+       }
 
        /*
         * For commits that allow modesets drivers can add other CRTCs to the