Commit 407a2fab authored by Hsin-Yi Wang's avatar Hsin-Yi Wang Committed by Douglas Anderson
Browse files

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: default avatarHsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: default avatarSean Paul <seanpaul@chromium.org>
Signed-off-by: default avatarFei Shao <fshao@chromium.org>
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20250812082135.3351172-2-fshao@chromium.org
parent 2f44bb65
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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);
+4 −0
Original line number Diff line number Diff line
@@ -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.
	 */