drm/bridge-connector: handle subconnector types
Subsystems (5)
PATCH v3 1/1 drm/bridge-connector: handle subconnector types
If the created connector type supports subconnector type property, create and attach corresponding it. The default subtype value is 0, which maps to the DRM_MODE_SUBCONNECTOR_Unknown type. Also remove subconnector creation from the msm_dp driver to prevent having duplicate properties on the DP connectors.
---
This is a leftover of my previous attempt to implement USB-C DisplayPort uABI. The idea was dropped, but I consider this part still to be useful,
as it allows one to register corresponding subconnector properties and
also to export the subconnector type.
---
Changes in v3:
- Rebased on top of linux-next
- Drop subconnector property from msm_dp driver
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Dropped all DP and USB-related patches
- Dropped the patch adding default subtype to drm_connector_attach_dp_subconnector_property()
- Replaced creation of TV subconnector property with the check that it
was created beforehand (Neil, Laurent)
- Link to v1: https://lore.kernel.org/r/[email protected]/
--- drivers/gpu/drm/display/drm_bridge_connector.c | 28 +++++++++++++++++++++++++- drivers/gpu/drm/msm/dp/dp_drm.c | 3 --- include/drm/drm_bridge.h | 4 ++++ 3 files changed, 31 insertions(+), 4 deletions(-)
drivers/gpu/drm/display/drm_bridge_connector.c +27 -1
@@ -523,6 +523,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 ; +enum drm_mode_subconnector subconnector;int connector_type;int ret;
@@ -576,8 +577,10 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, max_bpc = bridge->max_bpc; } -if (!drm_bridge_get_next_bridge (bridge)) +if (!drm_bridge_get_next_bridge (bridge)) { connector_type = bridge->type; + subconnector = bridge->subtype; + }#ifdef CONFIG_OF if (!drm_bridge_get_next_bridge(bridge) &&
@@ -643,6 +646,29 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm,if (panel_bridge)drm_panel_bridge_set_orientation (connector, panel_bridge); +if (connector_type == DRM_MODE_CONNECTOR_DisplayPort) { +drm_connector_attach_dp_subconnector_property (connector); + }else if (connector_type ==DRM_MODE_CONNECTOR_DVII ) { + ret =drm_mode_create_dvi_i_properties (drm); +if (ret) +return ERR_PTR (ret); + +drm_object_attach_property (&connector->base, + drm->mode_config.dvi_i_subconnector_property, + subconnector); + }else if (connector_type ==DRM_MODE_CONNECTOR_TV ) { +/* +* We do not know which modes are supported by the HW, so the +* property should be created in advance. +*/ +if (!drm->mode_config.tv_subconnector_property) +return ERR_PTR (-EINVAL ); + +drm_object_attach_property (&connector->base, + drm->mode_config.tv_subconnector_property, + subconnector); + } +return connector; }EXPORT_SYMBOL_GPL (drm_bridge_connector_init);
drivers/gpu/drm/msm/dp/dp_drm.c +0 -3
@@ -361,9 +361,6 @@ struct drm_connector *msm_dp_drm_connector_init(struct msm_dp *msm_dp_display,if (IS_ERR (connector))return connector; -if (!msm_dp_display->is_edp) -drm_connector_attach_dp_subconnector_property (connector); -drm_connector_attach_encoder (connector, encoder);return connector;
include/drm/drm_bridge.h +4 -0
@@ -850,6 +850,10 @@ struct drm_bridge {* identifies the type of connected display. */ int type; +/** +* @subtype: the subtype of the connector for the DP/TV/DVI-I cases. +*/ +enum drm_mode_subconnector subtype;/** * @interlace_allowed: Indicate that the bridge can handle interlaced * modes.
---
base-commit: 8defad9f57376a89914d16757717a27b567de04e
change-id: 20250117-subconnector-246b6fe49488
Best regards,
Signature · 1 line
Dmitry Baryshkov <[email protected]>
Quoted 25 lines · Dmitry Baryshkov
If the created connector type supports subconnector type property, create and attach corresponding it. The default subtype value is 0, which maps to the
DRM_MODE_SUBCONNECTOR_Unknowntype. Also remove subconnector creation from themsm_dpdriver to prevent having duplicate properties on the DP connectors.Signed-off-by Dmitry Baryshkov <[email protected]>---
This is a leftover of my previous attempt to implement USB-C DisplayPort uABI. The idea was dropped, but I consider this part still to be useful,
as it allows one to register corresponding subconnector properties and
also to export the subconnector type.
---
Changes in v3:
- Rebased on top of linux-next
- Drop subconnector property frommsm_dpdriver
- Link to v2: https://lore.kernel.org/r/[email protected]Changes in v2:
- Dropped all DP and USB-related patches
- Dropped the patch adding default subtype todrm_connector_attach_dp_subconnector_property()
- Replaced creation of TV subconnector property with the check that it
was created beforehand (Neil, Laurent)
- Link to v1: https://lore.kernel.org/r/[email protected]/
Quoted 5 lines
--- drivers/gpu/drm/display/drm_bridge_connector.c | 28 +++++++++++++++++++++++++- drivers/gpu/drm/msm/dp/dp_drm.c | 3 --- include/drm/drm_bridge.h | 4 ++++ 3 files changed, 31 insertions(+), 4 deletions(-)
It seems this isn't getting any response. Also we don't have (and don't expect) DVI-I and TV bridges. Let me merge DP part to [1] and drop other parts.
https://lore.kernel.org/linux-arm-msm/[email protected]
Signature · 2 lines
With best wishes Dmitry