Skip to content

Commit 407a2fa

Browse files
hsinyi527dianders
authored andcommitted
drm_bridge: register content protect property
Some bridges can update HDCP status based on userspace requests if they support HDCP. The HDCP property is created after connector initialization and before registration, just like other connector properties. Add the content protection property to the connector if a bridge supports HDCP. Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Fei Shao <fshao@chromium.org> Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20250812082135.3351172-2-fshao@chromium.org
1 parent 2f44bb6 commit 407a2fa

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

drivers/gpu/drm/display/drm_bridge_connector.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <drm/drm_modeset_helper_vtables.h>
2121
#include <drm/drm_print.h>
2222
#include <drm/drm_probe_helper.h>
23+
#include <drm/display/drm_hdcp_helper.h>
2324
#include <drm/display/drm_hdmi_audio_helper.h>
2425
#include <drm/display/drm_hdmi_cec_helper.h>
2526
#include <drm/display/drm_hdmi_helper.h>
@@ -641,6 +642,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
641642
struct drm_bridge *bridge, *panel_bridge = NULL;
642643
unsigned int supported_formats = BIT(HDMI_COLORSPACE_RGB);
643644
unsigned int max_bpc = 8;
645+
bool support_hdcp = false;
644646
int connector_type;
645647
int ret;
646648

@@ -763,6 +765,9 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
763765

764766
if (drm_bridge_is_panel(bridge))
765767
panel_bridge = bridge;
768+
769+
if (bridge->support_hdcp)
770+
support_hdcp = true;
766771
}
767772

768773
if (connector_type == DRM_MODE_CONNECTOR_Unknown)
@@ -849,6 +854,10 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
849854
if (panel_bridge)
850855
drm_panel_bridge_set_orientation(connector, panel_bridge);
851856

857+
if (support_hdcp && IS_REACHABLE(CONFIG_DRM_DISPLAY_HELPER) &&
858+
IS_ENABLED(CONFIG_DRM_DISPLAY_HDCP_HELPER))
859+
drm_connector_attach_content_protection_property(connector, true);
860+
852861
return connector;
853862
}
854863
EXPORT_SYMBOL_GPL(drm_bridge_connector_init);

include/drm/drm_bridge.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,10 @@ struct drm_bridge {
11711171
* before the peripheral.
11721172
*/
11731173
bool pre_enable_prev_first;
1174+
/**
1175+
* @support_hdcp: Indicate that the bridge supports HDCP.
1176+
*/
1177+
bool support_hdcp;
11741178
/**
11751179
* @ddc: Associated I2C adapter for DDC access, if any.
11761180
*/

0 commit comments

Comments
 (0)