Skip to content

Commit 1ff6631

Browse files
Fangzhi Zuoalexdeucher
authored andcommitted
drm/amd/display: Prevent IPX From Link Detect and Set Mode
IPX involvment proven to affect LT, causing link loss. Need to prevent IPX enabled in LT process in which link detect and set mode are main procedures that have LT taken place. Reviewed-by: Roman Li <[email protected]> Acked-by: Zaeem Mohamed <[email protected]> Signed-off-by: Fangzhi Zuo <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 7f7f43f commit 1ff6631

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3097,6 +3097,7 @@ static int dm_resume(void *handle)
30973097

30983098
commit_params.streams = dc_state->streams;
30993099
commit_params.stream_count = dc_state->stream_count;
3100+
dc_exit_ips_for_hw_access(dm->dc);
31003101
WARN_ON(!dc_commit_streams(dm->dc, &commit_params));
31013102

31023103
dm_gpureset_commit_state(dm->cached_dc_state, dm);
@@ -3169,6 +3170,7 @@ static int dm_resume(void *handle)
31693170
emulated_link_detect(aconnector->dc_link);
31703171
} else {
31713172
mutex_lock(&dm->dc_lock);
3173+
dc_exit_ips_for_hw_access(dm->dc);
31723174
dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD);
31733175
mutex_unlock(&dm->dc_lock);
31743176
}
@@ -3505,6 +3507,7 @@ static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector)
35053507
enum dc_connection_type new_connection_type = dc_connection_none;
35063508
struct amdgpu_device *adev = drm_to_adev(dev);
35073509
struct dm_connector_state *dm_con_state = to_dm_connector_state(connector->state);
3510+
struct dc *dc = aconnector->dc_link->ctx->dc;
35083511
bool ret = false;
35093512

35103513
if (adev->dm.disable_hpd_irq)
@@ -3539,6 +3542,7 @@ static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector)
35393542
drm_kms_helper_connector_hotplug_event(connector);
35403543
} else {
35413544
mutex_lock(&adev->dm.dc_lock);
3545+
dc_exit_ips_for_hw_access(dc);
35423546
ret = dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD);
35433547
mutex_unlock(&adev->dm.dc_lock);
35443548
if (ret) {
@@ -3598,6 +3602,7 @@ static void handle_hpd_rx_irq(void *param)
35983602
bool has_left_work = false;
35993603
int idx = dc_link->link_index;
36003604
struct hpd_rx_irq_offload_work_queue *offload_wq = &adev->dm.hpd_rx_offload_wq[idx];
3605+
struct dc *dc = aconnector->dc_link->ctx->dc;
36013606

36023607
memset(&hpd_irq_data, 0, sizeof(hpd_irq_data));
36033608

@@ -3687,6 +3692,7 @@ static void handle_hpd_rx_irq(void *param)
36873692
bool ret = false;
36883693

36893694
mutex_lock(&adev->dm.dc_lock);
3695+
dc_exit_ips_for_hw_access(dc);
36903696
ret = dc_link_detect(dc_link, DETECT_REASON_HPDRX);
36913697
mutex_unlock(&adev->dm.dc_lock);
36923698

@@ -4888,6 +4894,7 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
48884894
bool ret = false;
48894895

48904896
mutex_lock(&dm->dc_lock);
4897+
dc_exit_ips_for_hw_access(dm->dc);
48914898
ret = dc_link_detect(link, DETECT_REASON_BOOT);
48924899
mutex_unlock(&dm->dc_lock);
48934900

@@ -9298,6 +9305,7 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,
92989305

92999306
memset(&position, 0, sizeof(position));
93009307
mutex_lock(&dm->dc_lock);
9308+
dc_exit_ips_for_hw_access(dm->dc);
93019309
dc_stream_program_cursor_position(dm_old_crtc_state->stream, &position);
93029310
mutex_unlock(&dm->dc_lock);
93039311
}
@@ -9372,6 +9380,7 @@ static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,
93729380

93739381
dm_enable_per_frame_crtc_master_sync(dc_state);
93749382
mutex_lock(&dm->dc_lock);
9383+
dc_exit_ips_for_hw_access(dm->dc);
93759384
WARN_ON(!dc_commit_streams(dm->dc, &params));
93769385

93779386
/* Allow idle optimization when vblank count is 0 for display off */
@@ -9737,6 +9746,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
97379746

97389747

97399748
mutex_lock(&dm->dc_lock);
9749+
dc_exit_ips_for_hw_access(dm->dc);
97409750
dc_update_planes_and_stream(dm->dc,
97419751
dummy_updates,
97429752
status->plane_count,

0 commit comments

Comments
 (0)