aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/1071-drm-amd-dal-change-default-to-use-SW-i2c.patch
blob: 04202d6b0d0816792dbc4626444067ff14eb4234 (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
From 53638aa2435972cf5beaa818b623f02de111bd97 Mon Sep 17 00:00:00 2001
From: Eric Yang <eric.yang2@amd.com>
Date: Thu, 17 Mar 2016 16:05:47 -0400
Subject: [PATCH 1071/1110] drm/amd/dal: change default to use SW i2c

Make SW i2c engine the default. However, since all dces except
dce80 do not create sw i2c engine, they will still use hw i2c.
This allow enabling/disabling of sw i2c through the feature flag
FEATURE_RESTORE_USAGE_I2C_SW_ENGINE. DCE80 is the only dce that
has sw i2c engine enabled right now due to bug in hw i2c. This
fixes EDID read failure on bonaire. No behaviour change on other
dces.

Signed-off-by: Eric Yang <eric.yang2@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.c b/drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.c
index 2d394cf..a84901e 100644
--- a/drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.c
+++ b/drivers/gpu/drm/amd/dal/dc/i2caux/i2caux.c
@@ -122,7 +122,15 @@ bool dal_i2caux_submit_i2c_command(
 		return false;
 	}
 
+	/*
+	 * default will be SW, however there is a feature flag in adapter
+	 * service that determines whether SW i2c_engine will be available or
+	 * not, if sw i2c is not available we will fallback to hw. This feature
+	 * flag is set to not creating sw i2c engine for every dce except dce80
+	 * currently
+	 */
 	switch (cmd->engine) {
+	case I2C_COMMAND_ENGINE_DEFAULT:
 	case I2C_COMMAND_ENGINE_SW:
 		/* try to acquire SW engine first,
 		 * acquire HW engine if SW engine not available */
@@ -133,7 +141,6 @@ bool dal_i2caux_submit_i2c_command(
 				i2caux, ddc);
 	break;
 	case I2C_COMMAND_ENGINE_HW:
-	case I2C_COMMAND_ENGINE_DEFAULT:
 	default:
 		/* try to acquire HW engine first,
 		 * acquire SW engine if HW engine not available */
-- 
2.7.4