[PATCH 4/8] drm/amd/display: Add query_ddc_data function

Harry Wentland harry.wentland at amd.com
Thu Feb 23 16:33:39 UTC 2017


From: Zeyu Fan <Zeyu.Fan at amd.com>

Change-Id: I4743f6e829cb9d1c0086f44e505b620f2228d4d8
Signed-off-by: Zeyu Fan <Zeyu.Fan at amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 25 +++++++++++++++++++++++++
 drivers/gpu/drm/amd/display/dc/dc.h      | 11 ++++++++++-
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 84412e752017..6516c275e0c7 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1725,6 +1725,31 @@ bool dc_read_dpcd(
 	return r == DDC_RESULT_SUCESSFULL;
 }
 
+bool dc_query_ddc_data(
+		struct dc *dc,
+		uint32_t link_index,
+		uint32_t address,
+		uint8_t *write_buf,
+		uint32_t write_size,
+		uint8_t *read_buf,
+		uint32_t read_size) {
+
+	struct core_dc *core_dc = DC_TO_CORE(dc);
+
+	struct core_link *link = core_dc->links[link_index];
+
+	bool result = dal_ddc_service_query_ddc_data(
+			link->ddc,
+			address,
+			write_buf,
+			write_size,
+			read_buf,
+			read_size);
+
+	return result;
+}
+
+
 bool dc_write_dpcd(
 		struct dc *dc,
 		uint32_t link_index,
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 71d7dde79ae0..2d84b18f48b0 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -720,7 +720,16 @@ bool dc_write_dpcd(
 		uint32_t link_index,
 		uint32_t address,
 		const uint8_t *data,
-	uint32_t size);
+		uint32_t size);
+
+bool dc_query_ddc_data(
+		struct dc *dc,
+		uint32_t link_index,
+		uint32_t address,
+		uint8_t *write_buf,
+		uint32_t write_size,
+		uint8_t *read_buf,
+		uint32_t read_size);
 
 bool dc_submit_i2c(
 		struct dc *dc,
-- 
2.9.3



More information about the amd-gfx mailing list