mirror of
https://github.com/torvalds/linux.git
synced 2026-05-03 14:02:43 -04:00
drm/amd/display: Return drm_connector from find_first_crtc_matching_connector
[WHY] We will be dealing with two types of connector: amdgpu_dm_connector and drm_writeback_connector. [HOW] We want to find both and then cast to the appriopriate type afterwards. Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
4ff91f2185
commit
ca2b37a1c2
@@ -2699,7 +2699,7 @@ static int dm_suspend(void *handle)
|
||||
return dm_set_power_state(dm->dc, DC_ACPI_CM_POWER_STATE_D3);
|
||||
}
|
||||
|
||||
struct amdgpu_dm_connector *
|
||||
struct drm_connector *
|
||||
amdgpu_dm_find_first_crtc_matching_connector(struct drm_atomic_state *state,
|
||||
struct drm_crtc *crtc)
|
||||
{
|
||||
@@ -2712,7 +2712,7 @@ amdgpu_dm_find_first_crtc_matching_connector(struct drm_atomic_state *state,
|
||||
crtc_from_state = new_con_state->crtc;
|
||||
|
||||
if (crtc_from_state == crtc)
|
||||
return to_amdgpu_dm_connector(connector);
|
||||
return connector;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -9439,6 +9439,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
|
||||
* update changed items
|
||||
*/
|
||||
struct amdgpu_crtc *acrtc = NULL;
|
||||
struct drm_connector *connector = NULL;
|
||||
struct amdgpu_dm_connector *aconnector = NULL;
|
||||
struct drm_connector_state *drm_new_conn_state = NULL, *drm_old_conn_state = NULL;
|
||||
struct dm_connector_state *dm_new_conn_state = NULL, *dm_old_conn_state = NULL;
|
||||
@@ -9448,7 +9449,8 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
|
||||
dm_old_crtc_state = to_dm_crtc_state(old_crtc_state);
|
||||
dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
|
||||
acrtc = to_amdgpu_crtc(crtc);
|
||||
aconnector = amdgpu_dm_find_first_crtc_matching_connector(state, crtc);
|
||||
connector = amdgpu_dm_find_first_crtc_matching_connector(state, crtc);
|
||||
aconnector = to_amdgpu_dm_connector(connector);
|
||||
|
||||
/* TODO This hack should go away */
|
||||
if (aconnector && enable) {
|
||||
|
||||
Reference in New Issue
Block a user