drm/amd/display: Skip create new stream if crtc state doesn't change
Subsystems (3)
PATCH 1/1 drm/amd/display: Skip create new stream if crtc state doesn't change
Need to check if crtc state is changed so that mode set is required before trying to create new stream.
It deals with the MST hotplug use case when plug back to the same connector where the failure to create new stream for the inactive crtc state. Simply skip the check for the old connector and go through the new one.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -0
@@ -5593,6 +5593,9 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm, goto fail; } +if (!drm_atomic_crtc_needs_modeset (new_crtc_state)) +return 0 ; + aconnector =amdgpu_dm_find_first_crtc_matching_connector (state, crtc);/* TODO This hack should go away */
@@ -5640,6 +5643,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm, } } +/* mode_changed flag may get updated above, need to check again */ if (!drm_atomic_crtc_needs_modeset (new_crtc_state)) goto skip_modeset;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 18 lines · Jerry (Fangzhi) Zuo
Need to check if crtc state is changed so that mode set is required before trying to create new stream.
It deals with the MST hotplug use case when plug back to the same connector where the failure to create new stream for the inactive crtc state. Simply skip the check for the old connector and go through the new one.
Signed-off-by Jerry (Fangzhi) Zuo <[email protected]>--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int dm_update_crtc_state(struct amdgpu_display_manager *dm, · line 5597
Quoted 5 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-0@@ -5593,6 +5593,9 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm, goto fail; } +if (!drm_atomic_crtc_needs_modeset (new_crtc_state)) +return 0 ;
I had thought this was okay at first, but this will skip stream updates when needs_modeset = false.
Changing this line to just goto skip_modeset isn't sufficient either, we need drm_new_conn_state and drm_old_conn_state I believe below.
This check should probably be placed within the
if (aconnector && enable) block directly before the
new_stream = create_stream_for_sink(aconnector,
line. This should give you the behavior you're looking for.
Nicholas Kazlauskas
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int dm_update_crtc_state(struct amdgpu_display_manager *dm, · line 5649
Quoted 13 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-0+ aconnector =amdgpu_dm_find_first_crtc_matching_connector (state, crtc);/* TODO This hack should go away */ @@ -5640,6 +5643,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm, } } +/* mode_changed flag may get updated above, need to check again */ if (!drm_atomic_crtc_needs_modeset (new_crtc_state)) goto skip_modeset;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx