aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Lai <[email protected]>2019-08-23 11:44:53 -0500
committerAlex Deucher <[email protected]>2019-08-23 11:45:34 -0500
commit9a00d0ff92f4c718054b5c068e255ecc61ef48bb (patch)
treeacdc93f29c31b59ec76e8566dbb045a0947fa3d9
parent470e2ca569bf780f832e3020ceb5afdef16a9084 (diff)
drm/amd/display: Use res_cap to acquire i2c instead of pipe count
[Why] We should be using the ddc_num from res_caps. As the pipe count != number of i2c resources. [How] Use ddc_num from res_cap instead of pipe count. Signed-off-by: Derek Lai <[email protected]> Reviewed-by: Charlene Liu <[email protected]> Acked-by: Bhawanpreet Lakha <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c b/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c
index 420b18f99ce9..aad7b52165be 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c
@@ -25,6 +25,7 @@
#include <linux/delay.h>
+#include "resource.h"
#include "dce_i2c.h"
#include "dce_i2c_hw.h"
#include "reg_helper.h"
@@ -390,7 +391,7 @@ struct dce_i2c_hw *acquire_i2c_hw_engine(
if (ddc->hw_info.hw_supported) {
enum gpio_ddc_line line = dal_ddc_get_line(ddc);
- if (line < pool->pipe_count)
+ if (line < pool->res_cap->num_ddc)
dce_i2c_hw = pool->hw_i2cs[line];
}