Skip to content

Commit 196107e

Browse files
Roman Lialexdeucher
authored andcommitted
drm/amd/display: Add IPS checks before dcn register access
[Why] With IPS enabled a system hangs once PSR is active. PSR active triggers transition to IPS2 state. While in IPS2 an access to dcn registers results in hard hang. Existing check doesn't cover for PSR sequence. [How] Safeguard register access by disabling idle optimization in atomic commit and crtc scanout. It will be re-enabled on next vblank. Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Acked-by: Roman Li <roman.li@amd.com> Signed-off-by: Roman Li <roman.li@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 955406e commit 196107e

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ static int dm_crtc_get_scanoutpos(struct amdgpu_device *adev, int crtc,
272272
{
273273
u32 v_blank_start, v_blank_end, h_position, v_position;
274274
struct amdgpu_crtc *acrtc = NULL;
275+
struct dc *dc = adev->dm.dc;
275276

276277
if ((crtc < 0) || (crtc >= adev->mode_info.num_crtc))
277278
return -EINVAL;
@@ -284,6 +285,9 @@ static int dm_crtc_get_scanoutpos(struct amdgpu_device *adev, int crtc,
284285
return 0;
285286
}
286287

288+
if (dc && dc->caps.ips_support && dc->idle_optimizations_allowed)
289+
dc_allow_idle_optimizations(dc, false);
290+
287291
/*
288292
* TODO rework base driver to use values directly.
289293
* for now parse it back into reg-format
@@ -8978,16 +8982,8 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
89788982

89798983
trace_amdgpu_dm_atomic_commit_tail_begin(state);
89808984

8981-
if (dm->dc->caps.ips_support) {
8982-
for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) {
8983-
if (new_con_state->crtc &&
8984-
new_con_state->crtc->state->active &&
8985-
drm_atomic_crtc_needs_modeset(new_con_state->crtc->state)) {
8986-
dc_dmub_srv_apply_idle_power_optimizations(dm->dc, false);
8987-
break;
8988-
}
8989-
}
8990-
}
8985+
if (dm->dc->caps.ips_support && dm->dc->idle_optimizations_allowed)
8986+
dc_allow_idle_optimizations(dm->dc, false);
89918987

89928988
drm_atomic_helper_update_legacy_modeset_state(dev, state);
89938989
drm_dp_mst_atomic_wait_for_dependencies(state);

0 commit comments

Comments
 (0)