lkml.org 
[lkml]   [2022]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drm/mediatek: mtk-dpi: register content protect property
Date
Register content protect property in drm so that bridge can update
the property from userspace request.

HDCP property needs to be created after the connecter is initialized
and before the connector is registered. Since some bridge may be
attached without connector, register this property in drm driver if
CONFIG_DRM_DISPLAY_HDCP_HELPER is defined.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
---
Context: https://lore.kernel.org/lkml/20221012042030.573466-1-hsinyi@chromium.org/T/
---
drivers/gpu/drm/mediatek/mtk_dpi.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c
index 508a6d994e831..3374ebe82aeb2 100644
--- a/drivers/gpu/drm/mediatek/mtk_dpi.c
+++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
@@ -18,6 +18,7 @@

#include <video/videomode.h>

+#include <drm/display/drm_hdcp_helper.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_bridge_connector.h>
@@ -799,6 +800,15 @@ static int mtk_dpi_bind(struct device *dev, struct device *master, void *data)
ret = PTR_ERR(dpi->connector);
goto err_cleanup;
}
+
+#if defined(CONFIG_DRM_DISPLAY_HDCP_HELPER)
+ ret = drm_connector_attach_content_protection_property(dpi->connector, true);
+ if (ret) {
+ dev_err(dev, "attach content protection: %d\n", ret);
+ return ret;
+ }
+#endif
+
drm_connector_attach_encoder(dpi->connector, &dpi->encoder);

return 0;
--
2.38.0.413.g74048e4d9e-goog
\
 
 \ /
  Last update: 2022-10-19 08:22    [W:0.026 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site