diff options
author | Ji Soo Shin <jisshin@google.com> | 2023-11-14 14:54:32 +0000 |
---|---|---|
committer | Ji Soo Shin <jisshin@google.com> | 2023-11-15 13:40:46 +0000 |
commit | bd67e25c0d20765b93a17848fd5f5c455bac960c (patch) | |
tree | 5d8ad5341bd8f0994852baf79c007821d6bc5c1c | |
parent | 8d76b40134f582aeda3673bdc5e960a0a516b3a1 (diff) | |
download | samsung-android-gs-shusky-5.15-android14-qpr2-beta.tar.gz |
hdcp: update protection level to drm connectorandroid-u-qpr2-beta-3_r0.8android-u-qpr2-beta-3.1_r0.8android-14.0.0_r0.77android-14.0.0_r0.67android-14.0.0_r0.57android-gs-shusky-5.15-android14-qpr2-betaandroid-gs-shusky-5.15-android14-qpr2
Bug: 307592398
Change-Id: Ie3a7c3f690db74c59dfcca449b8d19f2b5c5ab63
Signed-off-by: Ji Soo Shin <jisshin@google.com>
-rw-r--r-- | dpcd.c | 8 | ||||
-rw-r--r-- | dpcd.h | 5 | ||||
-rw-r--r-- | teeif.c | 20 |
3 files changed, 28 insertions, 5 deletions
@@ -19,10 +19,14 @@ #include "dpcd.h" #include "hdcp-log.h" -static void (*pdp_hdcp22_enable)(u32 en); +static void (*pdp_hdcp_update_cp)(u32 drm_cp_status); static int (*pdp_dpcd_read_for_hdcp22)(u32 address, u32 length, u8 *data); static int (*pdp_dpcd_write_for_hdcp22)(u32 address, u32 length, u8 *data); +void hdcp_dplink_update_cp(uint32_t drm_cp_status) { + pdp_hdcp_update_cp(drm_cp_status); +} + int hdcp_dplink_recv(uint32_t addr, uint8_t *data, uint32_t size) { return pdp_dpcd_read_for_hdcp22(addr, size, data); @@ -35,7 +39,7 @@ int hdcp_dplink_send(uint32_t addr, uint8_t *data, uint32_t size) void dp_register_func_for_hdcp22(void (*func0)(u32 en), int (*func1)(u32 address, u32 length, u8 *data), int (*func2)(u32 address, u32 length, u8 *data)) { - pdp_hdcp22_enable = func0; + pdp_hdcp_update_cp = func0; pdp_dpcd_read_for_hdcp22 = func1; pdp_dpcd_write_for_hdcp22 = func2; } @@ -11,6 +11,11 @@ #ifndef __EXYNOS_HDCP_DPCD_H__ #define __EXYNOS_HDCP_DPCD_H__ +/* Used to update the current authentication status through uevent. + * pass in either DRM_MODE_CONTENT_PROTECTION_ENABLED or + * DRM_MODE_CONTENT_PROTECTION_DESIRED */ +void hdcp_dplink_update_cp(uint32_t drm_cp_status); + int hdcp_dplink_recv(uint32_t msg_name, uint8_t *data, uint32_t size); int hdcp_dplink_send(uint32_t msg_name, uint8_t *data, uint32_t size); @@ -16,7 +16,9 @@ #include <linux/module.h> #include <asm/cacheflush.h> #include <linux/dma-mapping.h> +#include <drm/drm_mode.h> +#include "dpcd.h" #include "teeif.h" #include "hdcp-log.h" @@ -249,15 +251,27 @@ int hdcp_tee_send_cmd(uint32_t cmd) { } int hdcp_tee_enable_enc_22(void) { - return hdcp_tee_comm_xchg(HDCP_CMD_ENCRYPTION_SET, HDCP_V2_3, NULL, - NULL); + int ret = hdcp_tee_comm_xchg(HDCP_CMD_ENCRYPTION_SET, HDCP_V2_3, NULL, + NULL); + if (ret) + return ret; + + hdcp_dplink_update_cp(DRM_MODE_CONTENT_PROTECTION_ENABLED); + return 0; } int hdcp_tee_enable_enc_13(void) { - return hdcp_tee_comm_xchg(HDCP_CMD_ENCRYPTION_SET, HDCP_V1, NULL, NULL); + int ret = hdcp_tee_comm_xchg(HDCP_CMD_ENCRYPTION_SET, HDCP_V1, NULL, + NULL); + if (ret) + return ret; + + hdcp_dplink_update_cp(DRM_MODE_CONTENT_PROTECTION_ENABLED); + return 0; } int hdcp_tee_disable_enc(void) { + hdcp_dplink_update_cp(DRM_MODE_CONTENT_PROTECTION_DESIRED); return hdcp_tee_comm_xchg(HDCP_CMD_ENCRYPTION_SET, HDCP_NONE, NULL, NULL); } |