From 7809a270928e40a4dd06bc0036cf6a6b210f194d Mon Sep 17 00:00:00 2001 From: Eric Yang Date: Thu, 14 Apr 2016 17:54:08 -0400 Subject: [PATCH 1035/1110] drm/amd/dal: fix S3 wake up to headless state Previously only the following headless case was tested: 1 display->headless->suspend->1 display->resume The following case was not working: 1 display->Suspend->headless->resume->1 display This change fixes the second headless scenario. This change also fixes an intermittent black screen on resume without topology change which was caused by detection detecting a false HPD low at resume, turning it into the same use case as second case above Signed-off-by: Eric Yang Acked-by: Harry Wentland Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c | 17 ----------------- drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c | 6 ++++-- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c index 35cecbc..a989fc2 100644 --- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c @@ -512,9 +512,6 @@ static int dm_display_resume(struct drm_device *ddev) ret = PTR_ERR_OR_ZERO(conn_state); if (ret) goto err; - - if (!aconnector->dc_sink) - conn_state->crtc = NULL; } /* Attach crtcs to drm_atomic_state*/ @@ -526,20 +523,6 @@ static int dm_display_resume(struct drm_device *ddev) if (ret) goto err; - aconnector = - amdgpu_dm_find_first_crct_matching_connector( - state, - crtc, - true); - - /* - * this is the case when display disappear during sleep - */ - if (!aconnector) { - crtc_state->active = false; - crtc_state->enable = false; - } - /* force a restore */ crtc_state->mode_changed = true; } diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c index 3e5c85d..205d4a4 100644 --- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c +++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c @@ -2185,8 +2185,11 @@ int amdgpu_dm_atomic_commit( * * This can also happen when unplug is done * during resume sequence ended + * + * In this case, we want to pretend we still + * have a sink to keep the pipe running so that + * hw state is consistent with the sw state */ - new_state->planes_changed = false; DRM_DEBUG_KMS("%s: Failed to create new target for crtc %d\n", __func__, acrtc->base.base.id); break; @@ -2372,7 +2375,6 @@ void dm_restore_drm_connector_state(struct drm_device *dev, struct drm_connector struct dc_target *current_target; uint32_t commit_targets_count = 0; - if (!aconnector->dc_sink || !connector->state || !connector->encoder) return; -- 2.7.4