From: Michel Dänzer <mdaen...@redhat.com>

drm_atomic_crtc_check enforces that ::active can only be true if
::enable is as well.

Signed-off-by: Michel Dänzer <mdaen...@redhat.com>
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c    | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 312c543b258f..dabef307a74f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -3415,21 +3415,12 @@ static bool modeset_required(struct drm_crtc_state 
*crtc_state,
                             struct dc_stream_state *new_stream,
                             struct dc_stream_state *old_stream)
 {
-       if (!drm_atomic_crtc_needs_modeset(crtc_state))
-               return false;
-
-       if (!crtc_state->enable)
-               return false;
-
-       return crtc_state->active;
+       return crtc_state->active && drm_atomic_crtc_needs_modeset(crtc_state);
 }
 
 static bool modereset_required(struct drm_crtc_state *crtc_state)
 {
-       if (!drm_atomic_crtc_needs_modeset(crtc_state))
-               return false;
-
-       return !crtc_state->enable || !crtc_state->active;
+       return !crtc_state->active && drm_atomic_crtc_needs_modeset(crtc_state);
 }
 
 static void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder)
@@ -8108,8 +8099,7 @@ static int dm_update_crtc_state(struct 
amdgpu_display_manager *dm,
         * We want to do dc stream updates that do not require a
         * full modeset below.
         */
-       if (!(enable && aconnector && new_crtc_state->enable &&
-             new_crtc_state->active))
+       if (!(enable && aconnector && new_crtc_state->active))
                return 0;
        /*
         * Given above conditions, the dc state cannot be NULL because:
-- 
2.28.0.rc0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to