[PATCH] drm/mediatek: mtk-dpi: register content protect property

Hsin-Yi Wang hsinyi at chromium.org
Wed Oct 19 06:19:37 UTC 2022


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 at 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



More information about the dri-devel mailing list