drm/amdgpu/dc: Simplify drm_crtc_state::active checks
Subsystems (3)
PATCH 1/1 drm/amdgpu/dc: Simplify drm_crtc_state::active checks
From: Michel Dänzer <[email protected]>
drm_atomic_crtc_check enforces that ::active can only be true if ::enable is as well.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -13
@@ -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:
Signature · 6 lines
2.28.0.rc0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 7 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
drm_atomic_crtc_checkenforces that ::active can only be true if ::enable is as well.Signed-off-by Michel Dänzer <[email protected]>
modeset vs modereset is a bit an inglorious name choice ... since this seems to be glue code and not part of core dc, maybe rename to enable_required/disable_required to keep it consistent with the wording atomic helpers use? DC also seems to use reset for a lot of other things already (state reset, like atomic, or gpu reset like drm/scheduler's td_r_), so I think this would also help clarity from a DC perspective.
Patch itself is good, above just an idea for another patch on top.
Quoted 49 lines
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3
-14@@ -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
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Kazlauskas, Nicholas
Reviewed-byQuoted 8 lines · Daniel Vetter
Quoted 7 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
drm_atomic_crtc_checkenforces that ::active can only be true if ::enable is as well.Signed-off-by Michel Dänzer <[email protected]>
Looks fine to me. The check is sufficiently old enough that I don't mind relying on the core for this either.
Quoted 9 lines
modeset vs modereset is a bit an inglorious name choice ... since this seems to be glue code and not part of core dc, maybe rename to enable_required/disable_required to keep it consistent with the wording atomic helpers use? DC also seems to use reset for a lot of other things already (state reset, like atomic, or gpu reset like drm/scheduler's
td_r_), so I think this would also help clarity from a DC perspective.
Quoted 3 lines
Patch itself is good, above just an idea for another patch on top.
Reviewed-by Daniel Vetter <[email protected]>
That sounds like a reasonable idea to me. These are used more as a stream_changed / stream_removed flag, but I don't think these helpers really need to exist at all.
That could come as a follow up patch.
Regards,
Nicholas Kazlauskas
Quoted 45 lines
Quoted 45 lines
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3
-14@@ -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
Quoted 7 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 8 lines · Nicholas
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
drm_atomic_crtc_checkenforces that ::active can only be true if ::enable is as well.
Quoted 19 lines
Quoted 1 line
Quoted 1 line
Signed-off-by Michel Dänzer <[email protected]>Looks fine to me. The check is sufficiently old enough that I don't mind relying on the core for this either.
Reviewed-by Nicholas Kazlauskas <[email protected]>Quoted 12 lines
modeset vs modereset is a bit an inglorious name choice ... since this seems to be glue code and not part of core dc, maybe rename to enable_required/disable_required to keep it consistent with the wording atomic helpers use? DC also seems to use reset for a lot of other things already (state reset, like atomic, or gpu reset like drm/scheduler's
td_r_), so I think this would also help clarity from a DC perspective.Patch itself is good, above just an idea for another patch on top.
Reviewed-by Daniel Vetter <[email protected]>
Thanks for the reviews! I assume this will get picked up by a DC developer or Alex/Christian.
Quoted 5 lines
That sounds like a reasonable idea to me. These are used more as a
stream_changed/stream_removedflag, but I don't think these helpers really need to exist at all.That could come as a follow up patch.
Yeah, I'm leaving that to you guys. :)
Signature · 6 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 7 lines · Michel Dänzer
Quoted 5 lines · Nicholas
Quoted 4 lines · Daniel Vetter
Quoted 3 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
drm_atomic_crtc_checkenforces that ::active can only be true if ::enable is as well.Signed-off-by Michel Dänzer <[email protected]>Looks fine to me. The check is sufficiently old enough that I don't mind relying on the core for this either.
"active implies enabled" has been a hard assumption of atomic from day
1. So should work anywhere you have atomic.
-Daniel
Quoted 31 lines
Quoted 14 lines
Reviewed-by Nicholas Kazlauskas <[email protected]>Quoted 12 lines
modeset vs modereset is a bit an inglorious name choice ... since this seems to be glue code and not part of core dc, maybe rename to enable_required/disable_required to keep it consistent with the wording atomic helpers use? DC also seems to use reset for a lot of other things already (state reset, like atomic, or gpu reset like drm/scheduler's
td_r_), so I think this would also help clarity from a DC perspective.Patch itself is good, above just an idea for another patch on top.
Reviewed-by Daniel Vetter <[email protected]>Thanks for the reviews! I assume this will get picked up by a DC developer or Alex/Christian.
Quoted 5 lines
That sounds like a reasonable idea to me. These are used more as a
stream_changed/stream_removedflag, but I don't think these helpers really need to exist at all.That could come as a follow up patch.
Yeah, I'm leaving that to you guys. :)
--
Earthling Michel Dänzer | https://redhat.com
Libre software enthusiast | Mesa and X developer
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Alex Deucher
AppliedQuoted 26 lines · Michel Dänzer
Quoted 24 lines · Nicholas
Quoted 8 lines · Daniel Vetter
Quoted 7 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
drm_atomic_crtc_checkenforces that ::active can only be true if ::enable is as well.Signed-off-by Michel Dänzer <[email protected]>Looks fine to me. The check is sufficiently old enough that I don't mind relying on the core for this either.
Reviewed-by Nicholas Kazlauskas <[email protected]>Quoted 9 lines
modeset vs modereset is a bit an inglorious name choice ... since this seems to be glue code and not part of core dc, maybe rename to enable_required/disable_required to keep it consistent with the wording atomic helpers use? DC also seems to use reset for a lot of other things already (state reset, like atomic, or gpu reset like drm/scheduler's
td_r_), so I think this would also help clarity from a DC perspective.
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Patch itself is good, above just an idea for another patch on top.
Reviewed-by Daniel Vetter <[email protected]>Thanks for the reviews! I assume this will get picked up by a DC developer or Alex/Christian.
Applied. Thanks!
Alex
Quoted 11 lines
Quoted 7 lines
That sounds like a reasonable idea to me. These are used more as a
stream_changed/stream_removedflag, but I don't think these helpers really need to exist at all.That could come as a follow up patch.
Yeah, I'm leaving that to you guys. :)
Quoted 7 lines
--
Earthling Michel Dänzer | https://redhat.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 26 lines · Alex Deucher
Quoted 25 lines · Michel Dänzer
Quoted 24 lines · Nicholas
Quoted 8 lines · Daniel Vetter
Quoted 7 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
drm_atomic_crtc_checkenforces that ::active can only be true if ::enable is as well.Signed-off-by Michel Dänzer <[email protected]>Looks fine to me. The check is sufficiently old enough that I don't mind relying on the core for this either.
Reviewed-by Nicholas Kazlauskas <[email protected]>Quoted 9 lines
modeset vs modereset is a bit an inglorious name choice ... since this seems to be glue code and not part of core dc, maybe rename to enable_required/disable_required to keep it consistent with the wording atomic helpers use? DC also seems to use reset for a lot of other things already (state reset, like atomic, or gpu reset like drm/scheduler's
td_r_), so I think this would also help clarity from a DC perspective.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Patch itself is good, above just an idea for another patch on top.
Reviewed-by Daniel Vetter <[email protected]>Thanks for the reviews! I assume this will get picked up by a DC developer or Alex/Christian.
Applied. Thanks!
Thank you. Can't see it in the DRM changes for 5.9 though.
Signature · 6 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 30 lines · Michel Dänzer
Quoted 28 lines · Alex Deucher
Quoted 27 lines · Michel Dänzer
Quoted 26 lines · Nicholas
Quoted 8 lines · Daniel Vetter
Quoted 7 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
drm_atomic_crtc_checkenforces that ::active can only be true if ::enable is as well.Signed-off-by Michel Dänzer <[email protected]>Looks fine to me. The check is sufficiently old enough that I don't mind relying on the core for this either.
Reviewed-by Nicholas Kazlauskas <[email protected]>Quoted 11 lines
modeset vs modereset is a bit an inglorious name choice ... since this seems to be glue code and not part of core dc, maybe rename to enable_required/disable_required to keep it consistent with the wording atomic helpers use? DC also seems to use reset for a lot of other things already (state reset, like atomic, or gpu reset like drm/scheduler's
td_r_), so I think this would also help clarity from a DC perspective.Patch itself is good, above just an idea for another patch on top.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Reviewed-by Daniel Vetter <[email protected]>Thanks for the reviews! I assume this will get picked up by a DC developer or Alex/Christian.
Applied. Thanks!
Thank you. Can't see it in the DRM changes for 5.9 though.
Will show up for 5.10 as it didn't seem critical for 5.9.
Alex
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx