From 53638aa2435972cf5beaa818b623f02de111bd97 Mon Sep 17 00:00:00 2001 From: Eric Yang 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 Reviewed-by: Harry Wentland --- 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