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
This commit is contained in:
Hsin-Yi Wang 2025-08-12 16:17:58 +08:00 committed by Douglas Anderson
parent 2f44bb65f2
commit 407a2fab3c
2 changed files with 13 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include <drm/drm_modeset_helper_vtables.h>
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
#include <drm/display/drm_hdcp_helper.h>
#include <drm/display/drm_hdmi_audio_helper.h>
#include <drm/display/drm_hdmi_cec_helper.h>
#include <drm/display/drm_hdmi_helper.h>
@ -641,6 +642,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
struct drm_bridge *bridge, *panel_bridge = NULL;
unsigned int supported_formats = BIT(HDMI_COLORSPACE_RGB);
unsigned int max_bpc = 8;
bool support_hdcp = false;
int connector_type;
int ret;
@ -763,6 +765,9 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
if (drm_bridge_is_panel(bridge))
panel_bridge = bridge;
if (bridge->support_hdcp)
support_hdcp = true;
}
if (connector_type == DRM_MODE_CONNECTOR_Unknown)
@ -849,6 +854,10 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
if (panel_bridge)
drm_panel_bridge_set_orientation(connector, panel_bridge);
if (support_hdcp && IS_REACHABLE(CONFIG_DRM_DISPLAY_HELPER) &&
IS_ENABLED(CONFIG_DRM_DISPLAY_HDCP_HELPER))
drm_connector_attach_content_protection_property(connector, true);
return connector;
}
EXPORT_SYMBOL_GPL(drm_bridge_connector_init);

View File

@ -1171,6 +1171,10 @@ struct drm_bridge {
* before the peripheral.
*/
bool pre_enable_prev_first;
/**
* @support_hdcp: Indicate that the bridge supports HDCP.
*/
bool support_hdcp;
/**
* @ddc: Associated I2C adapter for DDC access, if any.
*/