summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJi Soo Shin <jisshin@google.com>2023-11-14 14:54:32 +0000
committerJi Soo Shin <jisshin@google.com>2023-11-15 13:40:46 +0000
commitbd67e25c0d20765b93a17848fd5f5c455bac960c (patch)
tree5d8ad5341bd8f0994852baf79c007821d6bc5c1c
parent8d76b40134f582aeda3673bdc5e960a0a516b3a1 (diff)
downloadsamsung-android-gs-shusky-5.15-android14-qpr2-beta.tar.gz
Bug: 307592398 Change-Id: Ie3a7c3f690db74c59dfcca449b8d19f2b5c5ab63 Signed-off-by: Ji Soo Shin <jisshin@google.com>
-rw-r--r--dpcd.c8
-rw-r--r--dpcd.h5
-rw-r--r--teeif.c20
3 files changed, 28 insertions, 5 deletions
diff --git a/dpcd.c b/dpcd.c
index 0c29913..fc75bdc 100644
--- a/dpcd.c
+++ b/dpcd.c
@@ -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;
}
diff --git a/dpcd.h b/dpcd.h
index ccbdb12..fb8cacb 100644
--- a/dpcd.h
+++ b/dpcd.h
@@ -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);
diff --git a/teeif.c b/teeif.c
index 4ed2a81..f439b02 100644
--- a/teeif.c
+++ b/teeif.c
@@ -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);
}