From 92ba8135a6f959c78d04aa893abf04756031d409 Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 2 Feb 2022 02:51:53 +0000 Subject: [PATCH] drm/atomic: Add the crtc to affected crtc only if uapi.enable = true From Manasi Navare 73740f948252e424a01465155d8737bceae23653 in linux 5.15.y/5.15.19 5ec1cebd59300ddd26dbaa96c17c508764eef911 in mainline linux --- sys/dev/pci/drm/drm_atomic.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/dev/pci/drm/drm_atomic.c b/sys/dev/pci/drm/drm_atomic.c index 497883931a8..126ad24368f 100644 --- a/sys/dev/pci/drm/drm_atomic.c +++ b/sys/dev/pci/drm/drm_atomic.c @@ -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 -- 2.20.1