aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/4929-drm-amd-display-Read-AUX-channel-even-if-only-status.patch
blob: 290ce36fa56172ff636ba994c4b67acbffee7096 (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
From aa030c7b66c1ea84ed86779ca7891b86b1616eb8 Mon Sep 17 00:00:00 2001
From: "Leo (Sunpeng) Li" <sunpeng.li@amd.com>
Date: Tue, 26 Jun 2018 10:50:16 -0400
Subject: [PATCH 4929/5725] drm/amd/display: Read AUX channel even if only
 status byte is returned

[Why]
get_channel_status() can return 0 in returned_bytes, and report a
successful operation result. This is because it prunes the first status
byte out. This was preventing read_channel_reply() from being called
(due to the faulty condition), and consequently preventing the AUX
reply status from being set.

[How]
Fix the conditional so that it accounts for when get_channel_status()
returns 0 bytes read.

[Fixes]
Fixes possible edid read failures during S3 resume, where we are now
relying on DRM's DP AUX handling. This was an regression introduced by:

    Author: Harry Wentland <harry.wentland@amd.com>
        drm/amd/display: Return aux replies directly to DRM

Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
index d108ccf..08c9d73 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
@@ -671,7 +671,7 @@ int dc_link_aux_transfer(struct ddc_service *ddc,
 	case AUX_CHANNEL_OPERATION_SUCCEEDED:
 		res = returned_bytes;
 
-		if (res <= size && res > 0)
+		if (res <= size && res >= 0)
 			res = engine->funcs->read_channel_reply(engine, size,
 								buffer, reply,
 								&status);
-- 
2.7.4