drm/amd/display: Add query_ddc_data function
authorZeyu Fan <Zeyu.Fan@amd.com>
Thu, 16 Feb 2017 21:15:30 +0000 (16:15 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:15:22 +0000 (17:15 -0400)
Signed-off-by: Zeyu Fan <Zeyu.Fan@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/dc.h

index 84412e752017b5d2ca73cf25c807859aacbc33f6..6516c275e0c71bb2f8889d495453fa92a1ec1500 100644 (file)
@@ -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,
index 71d7dde79ae0d6169cb15d7afe53ef627b09e432..2d84b18f48b07644b72c2e3b65d9518e089548fd 100644 (file)
@@ -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,