Skip to contentSkip to conversation

drm/amd/display: Skip create new stream if crtc state doesn't change

PATCH In review Jerry (Fangzhi) Zuo 2 participants 2 messages Jan 14, 2019 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
index 987095ccd2c5..31ac44b56eaf 100644
@@ -5611,6 +5611,9 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
 		dm_new_conn_state = to_dm_connector_state(drm_new_conn_state);
 		dm_old_conn_state = to_dm_connector_state(drm_old_conn_state);
 
+		if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
+			goto skip_modeset;
+
 		new_stream = create_stream_for_sink(aconnector,
 						     &new_crtc_state->mode,
 						    dm_new_conn_state,
@@ -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]

Reviewed-by Nicholas Kazlauskas
#2 lore raw
Quoted 9 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.

Maybe in the future we should look into cleaning up the disable/enable codepath into a single function that does both.

This looks fine to me for now at least.

Nicholas Kazlauskas

Quoted 20 lines
---
  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 +3 -0
index 987095ccd2c5..31ac44b56eaf 100644
@@ -5611,6 +5611,9 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
  		dm_new_conn_state = to_dm_connector_state(drm_new_conn_state);
  		dm_old_conn_state = to_dm_connector_state(drm_old_conn_state);
 
+		if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
+			goto skip_modeset;
+
  		new_stream = create_stream_for_sink(aconnector,
  						     &new_crtc_state->mode,
  						    dm_new_conn_state,

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int dm_update_crtc_state(struct amdgpu_display_manager *dm, · line 5649

Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -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