[PATCH v2 03/20] drm/bridge-connector: Attach max bpc for non-HDMI bridges
Dmitry Baryshkov
dmitry.baryshkov at oss.qualcomm.com
Mon Oct 12 05:40:02 PDT 2026
On Fri, Oct 09, 2026 at 11:15:55AM +0800, Xilin Wu wrote:
> Allow non-HDMI bridges to advertise their output bit-depth limit through
> max_bpc. Attach the max bpc property when the lowest reported limit in the
> chain exceeds 8, ignoring bridges that do not report a limit. This lets
> DP drivers expose deep-color support without attaching the property in
> their connector initialization code.
>
> Use a lower bound of 6 for DP and eDP, which support 6 bpc RGB output, and
> 8 for other connector types. Keep the existing HDMI registration path.
> The property can be attached before connector state allocation; the
> atomic state helper initializes its default when state is created.
>
> Assisted-by: LLM
> Signed-off-by: Xilin Wu <sophon at radxa.com>
> ---
> drivers/gpu/drm/display/drm_bridge_connector.c | 18 ++++++++++++++++++
> include/drm/drm_bridge.h | 11 ++++++++---
> 2 files changed, 26 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c
> index 8b54069fa53a..be2e08a3694a 100644
> --- a/drivers/gpu/drm/display/drm_bridge_connector.c
> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c
> @@ -825,6 +825,7 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> struct drm_bridge *panel_bridge __free(drm_bridge_put) = NULL;
> unsigned int supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
> unsigned int max_bpc = 8;
> + unsigned int chain_max_bpc = 0;
UINT_MAX?
> bool support_hdcp = false;
> int connector_type;
> int ret;
> @@ -985,6 +986,10 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> panel_bridge = drm_bridge_get(bridge);
> }
>
> + if (bridge->max_bpc)
> + chain_max_bpc = chain_max_bpc ?
> + min(chain_max_bpc, bridge->max_bpc) : bridge->max_bpc;
> +
> if (bridge->support_hdcp)
> support_hdcp = true;
> }
> @@ -1026,6 +1031,19 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,
> connector_type, ddc);
> if (ret)
> return ERR_PTR(ret);
> +
> + if (chain_max_bpc > 8) {
> + unsigned int min_bpc = 8;
> +
> + if (connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
> + connector_type == DRM_MODE_CONNECTOR_eDP)
> + min_bpc = 6;
This opens a can of worms. Consider having host -> DP -> HDMI chain of
bridges. DP would support 6bpc. HDMI would not output 6bpc, but would
the chain be able to negotiate 6bpc, feed that to HDMI and let it output
8bpc? What is the resulting bpc?
> +
> + ret = drm_connector_attach_max_bpc_property(connector, min_bpc,
> + chain_max_bpc);
> + if (ret)
> + return ERR_PTR(ret);
> + }
> }
>
> if (bridge_connector->bridge_hdmi_audio ||
--
With best wishes
Dmitry
More information about the linux-amlogic
mailing list