diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3864-drm-amd-display-Create-dpcd-and-i2c-packing-function.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3864-drm-amd-display-Create-dpcd-and-i2c-packing-function.patch | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3864-drm-amd-display-Create-dpcd-and-i2c-packing-function.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3864-drm-amd-display-Create-dpcd-and-i2c-packing-function.patch new file mode 100644 index 00000000..3299f973 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3864-drm-amd-display-Create-dpcd-and-i2c-packing-function.patch @@ -0,0 +1,80 @@ +From 215e72a5c23f7d3a9dd5400fa0b05ed423828ab6 Mon Sep 17 00:00:00 2001 +From: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> +Date: Thu, 16 May 2019 11:57:52 -0400 +Subject: [PATCH 3864/4256] drm/amd/display: Create dpcd and i2c packing + functions + +[Why] +We need to read and write specific i2c and dpcd messages. + +[How] +Created static functions for packing the dpcd and i2c messages for hdcp. + +Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> +Reviewed-by: Harry Wentland <harry.wentland@amd.com> +Signed-off-by: Alex Deucher <alexander.deucher@amd.com> +--- + .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 40 ++++++++++++++++++- + 1 file changed, 39 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +index 004b6e8e9ed5..9d11d7695508 100644 +--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c ++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +@@ -26,6 +26,41 @@ + #include "amdgpu_dm_hdcp.h" + #include "amdgpu.h" + #include "amdgpu_dm.h" ++#include "dm_helpers.h" ++ ++bool lp_write_i2c(void *handle, uint32_t address, const uint8_t *data, uint32_t size) ++{ ++ ++ struct dc_link *link = handle; ++ struct i2c_payload i2c_payloads[] = {{true, address, size, (void *)data} }; ++ struct i2c_command cmd = {i2c_payloads, 1, I2C_COMMAND_ENGINE_HW, link->dc->caps.i2c_speed_in_khz}; ++ ++ return dm_helpers_submit_i2c(link->ctx, link, &cmd); ++} ++ ++bool lp_read_i2c(void *handle, uint32_t address, uint8_t offset, uint8_t *data, uint32_t size) ++{ ++ struct dc_link *link = handle; ++ ++ struct i2c_payload i2c_payloads[] = {{true, address, 1, &offset}, {false, address, size, data} }; ++ struct i2c_command cmd = {i2c_payloads, 2, I2C_COMMAND_ENGINE_HW, link->dc->caps.i2c_speed_in_khz}; ++ ++ return dm_helpers_submit_i2c(link->ctx, link, &cmd); ++} ++ ++bool lp_write_dpcd(void *handle, uint32_t address, const uint8_t *data, uint32_t size) ++{ ++ struct dc_link *link = handle; ++ ++ return dm_helpers_dp_write_dpcd(link->ctx, link, address, data, size); ++} ++ ++bool lp_read_dpcd(void *handle, uint32_t address, uint8_t *data, uint32_t size) ++{ ++ struct dc_link *link = handle; ++ ++ return dm_helpers_dp_read_dpcd(link->ctx, link, address, data, size); ++} + + static void process_output(struct hdcp_workqueue *hdcp_work) + { +@@ -220,7 +255,10 @@ struct hdcp_workqueue *hdcp_create_workqueue(void *psp_context, struct cp_psp *c + + hdcp_work[i].hdcp.config.psp.handle = psp_context; + hdcp_work[i].hdcp.config.ddc.handle = dc_get_link_at_index(dc, i); +- ++ hdcp_work[i].hdcp.config.ddc.funcs.write_i2c = lp_write_i2c; ++ hdcp_work[i].hdcp.config.ddc.funcs.read_i2c = lp_read_i2c; ++ hdcp_work[i].hdcp.config.ddc.funcs.write_dpcd = lp_write_dpcd; ++ hdcp_work[i].hdcp.config.ddc.funcs.read_dpcd = lp_read_dpcd; + } + + cp_psp->funcs.update_stream_config = update_config; +-- +2.17.1 + |