aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/1035-drm-amd-dal-fix-S3-wake-up-to-headless-state.patch
blob: c54aa23cc99d374da770c424826ec181011038c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
From 7809a270928e40a4dd06bc0036cf6a6b210f194d Mon Sep 17 00:00:00 2001
From: Eric Yang <eric.yang2@amd.com>
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 <eric.yang2@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 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