[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20221019061936.3599965-1-hsinyi@chromium.org>
Date: Wed, 19 Oct 2022 14:19:37 +0800
From: Hsin-Yi Wang <hsinyi@...omium.org>
To: Chun-Kuang Hu <chunkuang.hu@...nel.org>,
Sean Paul <seanpaul@...omium.org>
Cc: Philipp Zabel <p.zabel@...gutronix.de>,
Daniel Vetter <daniel@...ll.ch>,
Matthias Brugger <matthias.bgg@...il.com>,
dri-devel@...ts.freedesktop.org,
linux-mediatek@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] drm/mediatek: mtk-dpi: register content protect property
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@...omium.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
Powered by blists - more mailing lists