summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJi Soo Shin <jisshin@google.com>2023-11-13 18:11:21 +0000
committerTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2023-11-16 23:09:00 +0000
commit69340bf0c423d1fab820cafe0dbf3e6858fd2eda (patch)
tree1950999df77b42110aa92480bdd050a9439bdda8
parent89b3baf4264f46ddf9544617f335f9330c688459 (diff)
downloaddisplay-69340bf0c423d1fab820cafe0dbf3e6858fd2eda.tar.gz
drm: samsung: update drm hdcp property
Bug: 307592398 Change-Id: I8d628936708ed737331cc5992c0f743840177145 Signed-off-by: Ji Soo Shin <jisshin@google.com>
-rw-r--r--samsung/exynos_drm_dp.c19
-rw-r--r--samsung/exynos_drm_dp.h7
2 files changed, 20 insertions, 6 deletions
diff --git a/samsung/exynos_drm_dp.c b/samsung/exynos_drm_dp.c
index 8d9ccf3..7b1ac18 100644
--- a/samsung/exynos_drm_dp.c
+++ b/samsung/exynos_drm_dp.c
@@ -20,6 +20,7 @@
#include <linux/hdmi.h>
#include <video/videomode.h>
+#include <drm/drm_hdcp.h>
#include <drm/drm_modes.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_atomic_state_helper.h>
@@ -1999,12 +2000,18 @@ int dp_audio_config(struct dp_audio_config *audio_config)
EXPORT_SYMBOL(dp_audio_config);
/* HDCP Driver Handshaking Functions */
-void dp_hdcp22_enable(u32 en)
+void dp_hdcp_update_cp(u32 drm_cp_status)
{
- dp_hw_set_hdcp22_function(en);
- dp_hw_set_hdcp22_encryption(en);
+ struct dp_device *dp = get_dp_drvdata();
+ struct drm_connector *connector = &dp->connector;
+
+ dp_info(dp, "dp_hdcp_update_cp to %d\n", drm_cp_status);
+
+ drm_modeset_lock(&connector->dev->mode_config.connection_mutex, NULL);
+ drm_hdcp_update_content_protection(connector, drm_cp_status);
+ drm_modeset_unlock(&connector->dev->mode_config.connection_mutex);
}
-EXPORT_SYMBOL(dp_hdcp22_enable);
+EXPORT_SYMBOL(dp_hdcp_update_cp);
int dp_dpcd_read_for_hdcp22(u32 address, u32 length, u8 *data)
{
@@ -2395,6 +2402,8 @@ static int dp_bind(struct device *dev, struct device *master, void *data)
drm_atomic_helper_connector_reset(&dp->connector);
drm_connector_attach_max_bpc_property(&dp->connector, 6, dp->host.max_bpc);
+ drm_connector_attach_content_protection_property(&dp->connector,
+ DRM_MODE_HDCP_CONTENT_TYPE0);
dp_info(dp, "DP Driver has been binded\n");
@@ -2756,7 +2765,7 @@ static int dp_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
/* Register callback to HDCP */
- dp_register_func_for_hdcp22(dp_hdcp22_enable, dp_dpcd_read_for_hdcp22,
+ dp_register_func_for_hdcp22(dp_hdcp_update_cp, dp_dpcd_read_for_hdcp22,
dp_dpcd_write_for_hdcp22);
dp_info(dp, "DP Driver has been probed.\n");
diff --git a/samsung/exynos_drm_dp.h b/samsung/exynos_drm_dp.h
index 7548f7e..6604ab2 100644
--- a/samsung/exynos_drm_dp.h
+++ b/samsung/exynos_drm_dp.h
@@ -218,7 +218,12 @@ static inline struct dp_device *get_dp_drvdata(void)
int dp_audio_config(struct dp_audio_config *audio_config);
/* HDCP 2.2 Prototype */
-void dp_hdcp22_enable(u32 en);
+
+/* Used to update the current authentication status through uevent.
+ * pass in either DRM_MODE_CONTENT_PROTECTION_ENABLED or
+ * DRM_MODE_CONTENT_PROTECTION_DESIRED */
+void dp_hdcp_update_cp(u32 drm_cp_status);
+
int dp_dpcd_read_for_hdcp22(u32 address, u32 length, u8 *data);
int dp_dpcd_write_for_hdcp22(u32 address, u32 length, u8 *data);