drm: report dp downstream port type as a subconnector property
Subsystems (6)
PATCH 1/2 drm: report dp downstream port type as a subconnector property
Currently, downstream port type is only reported in debugfs. This information should be considered important since it reflects the actual physical connector type. Some userspace (e.g. window compositors) may want to show this info to a user.
The 'subconnector' property is already utilized for DVI-I and TV-out for reporting connector subtype.
The initial motivation for this feature came from i2c test [1]. It is supposed to be skipped on VGA connectors, but it cannot detect VGA over DP and fails instead.
[1]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
--- drivers/gpu/drm/drm_connector.c | 38 +++++++++++++++++++++++++++++++-- drivers/gpu/drm/drm_dp_helper.c | 36 +++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 2 ++ include/drm/drm_dp_helper.h | 3 +++ include/drm/drm_mode_config.h | 6 ++++++ include/uapi/drm/drm_mode.h | 22 ++++++++++++------- 6 files changed, 97 insertions(+), 10 deletions(-)
drivers/gpu/drm/drm_connector.c +36 -2
@@ -793,7 +793,7 @@ static const struct drm_prop_enum_list drm_dvi_i_select_enum_list[] = { DRM_ENUM_NAME_FN(drm_get_dvi_i_select_name, drm_dvi_i_select_enum_list)static const struct drm_prop_enum_list drm_dvi_i_subconnector_enum_list[] = { - { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I and TV-out */ + { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I, TV-out and DP */ {DRM_MODE_SUBCONNECTOR_DVID ,"DVI-D" },/* DVI-I */ {DRM_MODE_SUBCONNECTOR_DVIA ,"DVI-A" },/* DVI-I */ };
@@ -810,7 +810,7 @@ static const struct drm_prop_enum_list drm_tv_select_enum_list[] = { DRM_ENUM_NAME_FN(drm_get_tv_select_name, drm_tv_select_enum_list)static const struct drm_prop_enum_list drm_tv_subconnector_enum_list[] = { - { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I and TV-out */ + { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I, TV-out and DP */ { DRM_MODE_SUBCONNECTOR_Composite,"Composite" },/* TV-out */ {DRM_MODE_SUBCONNECTOR_SVIDEO ,"SVIDEO" },/* TV-out */ { DRM_MODE_SUBCONNECTOR_Component,"Component" },/* TV-out */
@@ -819,6 +819,19 @@ static const struct drm_prop_enum_list drm_tv_subconnector_enum_list[] = {DRM_ENUM_NAME_FN (drm_get_tv_subconnector_name, drm_tv_subconnector_enum_list) +static const struct drm_prop_enum_list drm_dp_subconnector_enum_list[] = { + { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I, TV-out and DP */ + {DRM_MODE_SUBCONNECTOR_VGA ,"VGA" },/* DP */ + {DRM_MODE_SUBCONNECTOR_DVI ,"DVI" },/* DP */ + {DRM_MODE_SUBCONNECTOR_HDMI ,"HDMI" },/* DP */ + {DRM_MODE_SUBCONNECTOR_DP ,"DP" },/* DP */ + { DRM_MODE_SUBCONNECTOR_Wireless,"Wireless" },/* DP */ + { DRM_MODE_SUBCONNECTOR_Native,"Native" },/* DP */ +}; + +DRM_ENUM_NAME_FN (drm_get_dp_subconnector_name, + drm_dp_subconnector_enum_list) +static const struct drm_prop_enum_list hdmi_colorspaces[] = {/* For Default case, driver will set the colorspace */ {DRM_MODE_COLORIMETRY_DEFAULT ,"Default" },
@@ -1128,6 +1141,27 @@ int drm_mode_create_dvi_i_properties(struct drm_device *dev) }EXPORT_SYMBOL (drm_mode_create_dvi_i_properties); +/** +* drm_mode_create_dp_properties - create DP specific connector properties +* @dev: DRM device +* +* Called by a driver the first time a DP connector is made. +*/ +void drm_mode_create_dp_properties (struct drm_device *dev) +{ +struct drm_property *dp_subconnector; + +if (dev->mode_config.dp_subconnector_property) +return ; + + dp_subconnector =drm_property_create_enum (dev,DRM_MODE_PROP_IMMUTABLE , +"subconnector" , + drm_dp_subconnector_enum_list, +ARRAY_SIZE (drm_dp_subconnector_enum_list)); + dev->mode_config.dp_subconnector_property = dp_subconnector; +} +EXPORT_SYMBOL (drm_mode_create_dp_properties); +/** * DOC: HDMI connector properties *
drivers/gpu/drm/drm_dp_helper.c +36 -0
@@ -662,6 +662,42 @@ void drm_dp_downstream_debug(struct seq_file *m, }EXPORT_SYMBOL (drm_dp_downstream_debug); +/** +* drm_dp_downstream_subconnector_type() - get DP branch device type +* @dpcd: DisplayPort configuration data +* @port_cap: port capabilities +* +*/ +enum drm_mode_subconnector +drm_dp_downstream_subconnector_type (const u8 dpcd[DP_RECEIVER_CAP_SIZE ], +const u8 port_cap[4 ]) +{ +int type = port_cap[0 ] &DP_DS_PORT_TYPE_MASK ; +bool branch_device_present = dpcd[DP_DOWNSTREAMPORT_PRESENT ] & +DP_DWN_STRM_PORT_PRESENT ; + +if (!branch_device_present) +return DRM_MODE_SUBCONNECTOR_Native; + +switch (type) { +case DP_DS_PORT_TYPE_DP : +case DP_DS_PORT_TYPE_DP_DUALMODE : +return DRM_MODE_SUBCONNECTOR_DP ; +case DP_DS_PORT_TYPE_VGA : +return DRM_MODE_SUBCONNECTOR_VGA ; +case DP_DS_PORT_TYPE_DVI : +return DRM_MODE_SUBCONNECTOR_DVI ; +case DP_DS_PORT_TYPE_HDMI : +return DRM_MODE_SUBCONNECTOR_HDMI ; +case DP_DS_PORT_TYPE_WIRELESS : +return DRM_MODE_SUBCONNECTOR_Wireless; +case DP_DS_PORT_TYPE_NON_EDID : +default : +return DRM_MODE_SUBCONNECTOR_Unknown; + } +} +EXPORT_SYMBOL (drm_dp_downstream_subconnector_type); +/* * I2C-over-AUX implementation */
include/drm/drm_connector.h +2 -0
@@ -1483,9 +1483,11 @@ const char *drm_get_dvi_i_subconnector_name(int val);const char *drm_get_dvi_i_select_name (int val);const char *drm_get_tv_subconnector_name (int val);const char *drm_get_tv_select_name (int val); +const char *drm_get_dp_subconnector_name (int val);const char *drm_get_content_protection_name (int val);int drm_mode_create_dvi_i_properties (struct drm_device *dev); +void drm_mode_create_dp_properties (struct drm_device *dev);int drm_mode_create_tv_margin_properties (struct drm_device *dev); int drm_mode_create_tv_properties(struct drm_device *dev, unsigned int num_modes,
include/drm/drm_dp_helper.h +3 -0
@@ -1372,6 +1372,9 @@ int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],int drm_dp_downstream_id (struct drm_dp_aux *aux,char id[6 ]);void drm_dp_downstream_debug (struct seq_file *m,const u8 dpcd[DP_RECEIVER_CAP_SIZE ],const u8 port_cap[4 ],struct drm_dp_aux *aux); +enum drm_mode_subconnector +drm_dp_downstream_subconnector_type (const u8 dpcd[DP_RECEIVER_CAP_SIZE ], +const u8 port_cap[4 ]);void drm_dp_aux_init (struct drm_dp_aux *aux);int drm_dp_aux_register (struct drm_dp_aux *aux);
include/drm/drm_mode_config.h +6 -0
@@ -680,6 +680,12 @@ struct drm_mode_config {*/ struct drm_property *dvi_i_select_subconnector_property; +/** +* @dp_subconnector_property: Optional DP property to differentiate +* between different DP downstream port types. +*/ +struct drm_property *dp_subconnector_property; +/** * @tv_subconnector_property: Optional TV property to differentiate * between different TV connector types.
include/uapi/drm/drm_mode.h +14 -8
@@ -332,14 +332,20 @@ struct drm_mode_get_encoder {/* This is for connectors with multiple signal types. */ /* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */ enum drm_mode_subconnector { - DRM_MODE_SUBCONNECTOR_Automatic =0 , - DRM_MODE_SUBCONNECTOR_Unknown =0 , -DRM_MODE_SUBCONNECTOR_DVID =3 , -DRM_MODE_SUBCONNECTOR_DVIA =4 , - DRM_MODE_SUBCONNECTOR_Composite =5 , -DRM_MODE_SUBCONNECTOR_SVIDEO =6 , - DRM_MODE_SUBCONNECTOR_Component =8 , -DRM_MODE_SUBCONNECTOR_SCART =9 , + DRM_MODE_SUBCONNECTOR_Automatic =0 ,/* DVI-I, TV */ + DRM_MODE_SUBCONNECTOR_Unknown =0 ,/* DVI-I, TV, DP */ +DRM_MODE_SUBCONNECTOR_VGA =1 ,/* DP */ +DRM_MODE_SUBCONNECTOR_DVI =2 ,/* DP */ +DRM_MODE_SUBCONNECTOR_DVID =3 ,/* DVI-I */ +DRM_MODE_SUBCONNECTOR_DVIA =4 ,/* DVI-I */ + DRM_MODE_SUBCONNECTOR_Composite =5 ,/* TV */ +DRM_MODE_SUBCONNECTOR_SVIDEO =6 ,/* TV */ + DRM_MODE_SUBCONNECTOR_Component =8 ,/* TV */ +DRM_MODE_SUBCONNECTOR_SCART =9 ,/* TV */ +DRM_MODE_SUBCONNECTOR_DP =10 ,/* DP */ +DRM_MODE_SUBCONNECTOR_HDMI =11 ,/* DP */ + DRM_MODE_SUBCONNECTOR_Native =15 ,/* DP */ + DRM_MODE_SUBCONNECTOR_Wireless =19 ,/* DP */ };#define DRM_MODE_CONNECTOR_Unknown 0
Signature · 6 lines
2.22.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/2 drm/i915: utilize subconnector property for DP
Since DP-specific information is stored in driver's structures, every driver needs to implement subconnector property by itself.
--- drivers/gpu/drm/i915/display/intel_dp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/gpu/drm/i915/display/intel_dp.c +15 -0
@@ -5532,6 +5532,7 @@ intel_dp_unset_edid(struct intel_dp *intel_dp) intel_dp->has_audio = false; } + static int intel_dp_detect(struct drm_connector *connector, struct drm_modeset_acquire_ctx *ctx,
@@ -5542,6 +5543,7 @@ intel_dp_detect(struct drm_connector *connector,struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp);struct intel_encoder *encoder = &dig_port->base;enum drm_connector_status status; +enum drm_mode_subconnector subconnector = DRM_MODE_SUBCONNECTOR_Unknown;DRM_DEBUG_KMS ("[CONNECTOR:%d:%s]\n" , connector->base.id, connector->name);
@@ -5633,6 +5635,14 @@ intel_dp_detect(struct drm_connector *connector,if (status != connector_status_connected && !intel_dp->is_mst)intel_dp_unset_edid (intel_dp); +if (status == connector_status_connected) + subconnector =drm_dp_downstream_subconnector_type ( + intel_dp->dpcd, intel_dp->downstream_ports); + +drm_object_property_set_value (&connector->base, + connector->dev-> + mode_config.dp_subconnector_property, + subconnector);return status; }
@@ -6529,6 +6539,11 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connectstruct drm_i915_private *dev_priv =to_i915 (connector->dev);enum port port =dp_to_dig_port (intel_dp)->base.port; +drm_mode_create_dp_properties (connector->dev); +drm_object_attach_property (&connector->base, + connector->dev->mode_config.dp_subconnector_property, + DRM_MODE_SUBCONNECTOR_Unknown); +if (!IS_G4X (dev_priv) && port !=PORT_A )intel_attach_force_audio_property (connector);
Signature · 6 lines
2.22.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm: report dp downstream port type as a subconnector property
In reply to Oleg Vasilev== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm: report dp downstream port type as a subconnector property
URL : https://patchwork.freedesktop.org/series/63026/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
e4c5221b85cd drm: report dp downstream port type as a subconnector property
-:31: CHECK:CAMELCASE: Avoid CamelCase: <DRM_MODE_SUBCONNECTOR_Unknown>
#31: FILE: drivers/gpu/drm/drm_connector.c:796:
+ { DRM_MODE_SUBCONNECTOR_Unknown, "Unknown" }, /* DVI-I, TV-out and DP */-:54: CHECK:CAMELCASE: Avoid CamelCase: <DRM_MODE_SUBCONNECTOR_Wireless> #54: FILE: drivers/gpu/drm/drm_connector.c:828:
+ { DRM_MODE_SUBCONNECTOR_Wireless, "Wireless" }, /* DP */
-:55: CHECK:CAMELCASE: Avoid CamelCase: <DRM_MODE_SUBCONNECTOR_Native> #55: FILE: drivers/gpu/drm/drm_connector.c:829:
+ { DRM_MODE_SUBCONNECTOR_Native, "Native" }, /* DP */
-:202: CHECK:CAMELCASE: Avoid CamelCase: <DRM_MODE_SUBCONNECTOR_Automatic> #202: FILE: include/uapi/drm/drm_mode.h:335:
+ DRM_MODE_SUBCONNECTOR_Automatic = 0, /* DVI-I, TV */
-:208: CHECK:CAMELCASE: Avoid CamelCase: <DRM_MODE_SUBCONNECTOR_Composite> #208: FILE: include/uapi/drm/drm_mode.h:341:
+ DRM_MODE_SUBCONNECTOR_Composite = 5, /* TV */
-:210: CHECK:CAMELCASE: Avoid CamelCase: <DRM_MODE_SUBCONNECTOR_Component> #210: FILE: include/uapi/drm/drm_mode.h:343:
+ DRM_MODE_SUBCONNECTOR_Component = 8, /* TV */
total: 0 errors, 0 warnings, 6 checks, 164 lines checked eafc29b760a7 drm/i915: utilize subconnector property for DP -:19: CHECK:LINE_SPACING: Please don't use multiple blank lines #19: FILE: drivers/gpu/drm/i915/display/intel_dp.c:5535:
+
-:27: CHECK:CAMELCASE: Avoid CamelCase: <DRM_MODE_SUBCONNECTOR_Unknown> #27: FILE: drivers/gpu/drm/i915/display/intel_dp.c:5546:
+ enum drm_mode_subconnector subconnector = DRM_MODE_SUBCONNECTOR_Unknown;
-:36: CHECK:OPEN_ENDED_LINE: Lines should not end with a '(' #36: FILE: drivers/gpu/drm/i915/display/intel_dp.c:5639:
+ subconnector = drm_dp_downstream_subconnector_type(
-:41: WARNING:MULTILINE_DEREFERENCE: Avoid multiple line dereference - prefer 'connector->dev->mode_config.dp_subconnector_property' #41: FILE: drivers/gpu/drm/i915/display/intel_dp.c:5644:
+ connector->dev->
+ mode_config.dp_subconnector_property,
total: 0 errors, 1 warnings, 3 checks, 39 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for series starting with [1/2] drm: report dp downstream port type as a subconnector property
In reply to Oleg Vasilev== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm: report dp downstream port type as a subconnector property
URL : https://patchwork.freedesktop.org/series/63026/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Sparse version: v0.5.2 Commit: drm: report dp downstream port type as a subconnector property +drivers/gpu/drm/drm_dp_helper.c:1009:36: warning: expression using sizeof(void) +drivers/gpu/drm/drm_dp_helper.c:1009:36: warning: expression using sizeof(void) -drivers/gpu/drm/drm_dp_helper.c:1009:36: warning: expression using sizeof(void) -drivers/gpu/drm/drm_dp_helper.c:1009:36: warning: expression using sizeof(void)
Commit: drm/i915: utilize subconnector property for DP Okay!
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [1/2] drm: report dp downstream port type as a subconnector property
In reply to Oleg Vasilev== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm: report dp downstream port type as a subconnector property
URL : https://patchwork.freedesktop.org/series/63026/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6389 -> Patchwork_13477
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/
Known issues
------------
Here are the changes found in Patchwork_13477 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_basic@create-fd-close:
- fi-icl-u3: [PASS][1] -> [DMESG-WARN][2] ([fdo#107724])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/fi-icl-u3/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/fi-icl-u3/igt@[email protected]
* igt@gem_ctx_create@basic-files:
- fi-cml-u: [PASS][3] -> [INCOMPLETE][4] ([fdo#110566])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/fi-cml-u/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/fi-cml-u/igt@[email protected]
* igt@i915_module_load@reload:
- fi-blb-e6850: [PASS][5] -> [INCOMPLETE][6] ([fdo#107718])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/fi-blb-e6850/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/fi-blb-e6850/igt@[email protected]
- fi-icl-dsi: [PASS][7] -> [INCOMPLETE][8] ([fdo#107713])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/fi-icl-dsi/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/fi-icl-dsi/igt@[email protected]
* igt@i915_pm_rpm@basic-rte:
- fi-kbl-r: [PASS][9] -> [DMESG-WARN][10] ([fdo#111012])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/fi-kbl-r/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/fi-kbl-r/igt@[email protected]
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7567u: [PASS][11] -> [FAIL][12] ([fdo#109485])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/fi-kbl-7567u/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/fi-kbl-7567u/igt@[email protected]
#### Possible fixes ####
* igt@core_auth@basic-auth:
- fi-icl-u3: [DMESG-WARN][13] ([fdo#107724]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/fi-icl-u3/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/fi-icl-u3/igt@[email protected]
* igt@kms_frontbuffer_tracking@basic:
- fi-icl-dsi: [FAIL][15] ([fdo#103167]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/fi-icl-dsi/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/fi-icl-dsi/igt@[email protected]
#### Warnings ####
* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-kbl-guc: [SKIP][17] ([fdo#109271]) -> [FAIL][18] ([fdo#110829])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/fi-kbl-guc/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/fi-kbl-guc/igt@[email protected]
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109485]: https://bugs.freedesktop.org/show_bug.cgi?id=109485
[fdo#110566]: https://bugs.freedesktop.org/show_bug.cgi?id=110566
[fdo#110829]: https://bugs.freedesktop.org/show_bug.cgi?id=110829
[fdo#111012]: https://bugs.freedesktop.org/show_bug.cgi?id=111012
Participating hosts (53 -> 45)
------------------------------
Additional (1): fi-ivb-3770
Missing (9): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-icl-y fi-byt-clapper fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_6389 -> Patchwork_13477
CI_DRM_6389: db54e37c5fdaea0878a79c0a747f53c3297bc47f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5075: 03779dd3de8a57544f124d9952a6d2b3e34e34ca @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13477: eafc29b760a77e64c12a19c81bea9d75921d921f @ git://anongit.freedesktop.org/gfx-ci/linux
== Kernel 32bit build ==
Warning: Kernel 32bit buildtest failed:
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/build_32bit.log
CALL scripts/checksyscalls.sh CALL scripts/atomic/check-atomics.sh CHK include/generated/compile.h
Kernel: arch/x86/boot/bzImage is ready (#1)
Building modules, stage 2.
MODPOST 112 modules
ERROR: "__udivdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: "__divdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! scripts/Makefile.modpost:91: recipe for target '__modpost' failed make[1]: *** [__modpost] Error 1
Makefile:1287: recipe for target 'modules' failed
make: *** [modules] Error 2
== Linux commits ==
eafc29b760a7 drm/i915: utilize subconnector property for DP e4c5221b85cd drm: report dp downstream port type as a subconnector property
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for series starting with [1/2] drm: report dp downstream port type as a subconnector property
In reply to Oleg Vasilev== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm: report dp downstream port type as a subconnector property
URL : https://patchwork.freedesktop.org/series/63026/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6389_full -> Patchwork_13477_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_13477_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_pm_rpm@universal-planes:
- shard-apl: [PASS][1] -> [INCOMPLETE][2] ([fdo#103927]) +1 similar issue
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-apl5/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-apl5/igt@[email protected]
- shard-iclb: [PASS][3] -> [INCOMPLETE][4] ([fdo#107713] / [fdo#108840])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-iclb5/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-iclb2/igt@[email protected]
* igt@i915_selftest@mock_requests:
- shard-skl: [PASS][5] -> [INCOMPLETE][6] ([fdo#110550])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-skl1/igt@i915_selftest@mock_requests.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-skl7/igt@i915_selftest@mock_requests.html
* igt@i915_suspend@fence-restore-tiled2untiled:
- shard-apl: [PASS][7] -> [DMESG-WARN][8] ([fdo#108566])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-apl4/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-apl6/igt@[email protected]
* igt@kms_flip@flip-vs-expired-vblank:
- shard-skl: [PASS][9] -> [FAIL][10] ([fdo#105363])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-skl5/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-skl5/igt@[email protected]
* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-glk: [PASS][11] -> [FAIL][12] ([fdo#105363])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-glk2/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-glk5/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-mmap-gtt:
- shard-iclb: [PASS][13] -> [FAIL][14] ([fdo#103167]) +1 similar issue
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-iclb8/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-mmap-gtt.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-iclb8/igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-shrfb-draw-mmap-gtt.html
* igt@kms_lease@atomic_implicit_crtc:
- shard-snb: [PASS][15] -> [SKIP][16] ([fdo#109271])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-snb6/igt@kms_lease@atomic_implicit_crtc.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-snb5/igt@kms_lease@atomic_implicit_crtc.html
* igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
- shard-skl: [PASS][17] -> [FAIL][18] ([fdo#108145])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-skl9/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-skl7/igt@[email protected]
* igt@kms_psr@psr2_no_drrs:
- shard-iclb: [PASS][19] -> [SKIP][20] ([fdo#109441]) +3 similar issues
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-iclb2/igt@kms_psr@psr2_no_drrs.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-iclb5/igt@kms_psr@psr2_no_drrs.html
* igt@kms_setmode@basic:
- shard-apl: [PASS][21] -> [FAIL][22] ([fdo#99912])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-apl1/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-apl3/igt@[email protected]
#### Possible fixes ####
* igt@gem_tiled_swapping@non-threaded:
- shard-glk: [DMESG-WARN][23] ([fdo#108686]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-glk8/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-glk3/igt@[email protected]
* igt@i915_pm_rpm@i2c:
- shard-hsw: [FAIL][25] ([fdo#104097]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-hsw8/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-hsw1/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-apl: [DMESG-WARN][27] ([fdo#108566]) -> [PASS][28] +1 similar issue
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-apl1/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-apl3/igt@[email protected]
* igt@kms_flip@flip-vs-suspend:
- shard-skl: [INCOMPLETE][29] ([fdo#109507]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-skl9/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-skl1/igt@[email protected]
- shard-snb: [INCOMPLETE][31] ([fdo#105411]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-snb1/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-snb2/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render:
- shard-iclb: [FAIL][33] ([fdo#103167]) -> [PASS][34] +3 similar issues
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-iclb7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-iclb2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render.html
* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-spr-indfb-draw-mmap-gtt:
- shard-hsw: [SKIP][35] ([fdo#109271]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-hsw2/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-spr-indfb-draw-mmap-gtt.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-hsw8/igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-spr-indfb-draw-mmap-gtt.html
* igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min:
- shard-skl: [FAIL][37] ([fdo#108145]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-skl5/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-skl10/igt@[email protected]
* igt@kms_plane_lowres@pipe-a-tiling-x:
- shard-iclb: [FAIL][39] ([fdo#103166]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-iclb4/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-iclb7/igt@[email protected]
* igt@kms_psr2_su@frontbuffer:
- shard-iclb: [SKIP][41] ([fdo#109642]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-iclb8/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-iclb2/igt@[email protected]
* igt@kms_psr@psr2_cursor_plane_move:
- shard-iclb: [SKIP][43] ([fdo#109441]) -> [PASS][44] +1 similar issue
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6389/shard-iclb3/igt@kms_psr@psr2_cursor_plane_move.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/shard-iclb2/igt@kms_psr@psr2_cursor_plane_move.html
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104097]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
[fdo#108840]: https://bugs.freedesktop.org/show_bug.cgi?id=108840
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109507]: https://bugs.freedesktop.org/show_bug.cgi?id=109507
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110550]: https://bugs.freedesktop.org/show_bug.cgi?id=110550
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (10 -> 10)
------------------------------
No changes in participating hosts
Build changes
-------------
* Linux: CI_DRM_6389 -> Patchwork_13477
CI_DRM_6389: db54e37c5fdaea0878a79c0a747f53c3297bc47f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5075: 03779dd3de8a57544f124d9952a6d2b3e34e34ca @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13477: eafc29b760a77e64c12a19c81bea9d75921d921f @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13477/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 104 lines · Oleg Vasilev
Currently, downstream port type is only reported in debugfs. This information should be considered important since it reflects the actual physical connector type. Some userspace (e.g. window compositors) may want to show this info to a user.
The 'subconnector' property is already utilized for DVI-I and TV-out for reporting connector subtype.
The initial motivation for this feature came from i2c test [1]. It is supposed to be skipped on VGA connectors, but it cannot detect VGA over DP and fails instead.
[1]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
Signed-off-by Oleg Vasilev <[email protected]>--- drivers/gpu/drm/drm_connector.c | 38 +++++++++++++++++++++++++++++++-- drivers/gpu/drm/drm_dp_helper.c | 36 +++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 2 ++ include/drm/drm_dp_helper.h | 3 +++ include/drm/drm_mode_config.h | 6 ++++++ include/uapi/drm/drm_mode.h | 22 ++++++++++++------- 6 files changed, 97 insertions(+), 10 deletions(-)drivers/gpu/drm/drm_connector.c +36
-2@@ -793,7 +793,7 @@ static const struct drm_prop_enum_list drm_dvi_i_select_enum_list[] = { DRM_ENUM_NAME_FN(drm_get_dvi_i_select_name, drm_dvi_i_select_enum_list)static const struct drm_prop_enum_list drm_dvi_i_subconnector_enum_list[] = { - { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I and TV-out */ + { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I, TV-out and DP */ {DRM_MODE_SUBCONNECTOR_DVID ,"DVI-D" },/* DVI-I */ {DRM_MODE_SUBCONNECTOR_DVIA ,"DVI-A" },/* DVI-I */ };@@ -810,7 +810,7 @@ static const struct drm_prop_enum_list drm_tv_select_enum_list[] = { DRM_ENUM_NAME_FN(drm_get_tv_select_name, drm_tv_select_enum_list)static const struct drm_prop_enum_list drm_tv_subconnector_enum_list[] = { - { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I and TV-out */ + { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I, TV-out and DP */ { DRM_MODE_SUBCONNECTOR_Composite,"Composite" },/* TV-out */ {DRM_MODE_SUBCONNECTOR_SVIDEO ,"SVIDEO" },/* TV-out */ { DRM_MODE_SUBCONNECTOR_Component,"Component" },/* TV-out */ @@ -819,6 +819,19 @@ static const struct drm_prop_enum_list drm_tv_subconnector_enum_list[] = {DRM_ENUM_NAME_FN (drm_get_tv_subconnector_name, drm_tv_subconnector_enum_list) +static const struct drm_prop_enum_list drm_dp_subconnector_enum_list[] = { + { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I, TV-out and DP */ + {DRM_MODE_SUBCONNECTOR_VGA ,"VGA" },/* DP */ + {DRM_MODE_SUBCONNECTOR_DVI ,"DVI" },/* DP */ + {DRM_MODE_SUBCONNECTOR_HDMI ,"HDMI" },/* DP */ + {DRM_MODE_SUBCONNECTOR_DP ,"DP" },/* DP */ + { DRM_MODE_SUBCONNECTOR_Wireless,"Wireless" },/* DP */ + { DRM_MODE_SUBCONNECTOR_Native,"Native" },/* DP */ +}; + +DRM_ENUM_NAME_FN (drm_get_dp_subconnector_name, + drm_dp_subconnector_enum_list) +static const struct drm_prop_enum_list hdmi_colorspaces[] = {/* For Default case, driver will set the colorspace */ {DRM_MODE_COLORIMETRY_DEFAULT ,"Default" },@@ -1128,6 +1141,27 @@ int drm_mode_create_dvi_i_properties(struct drm_device *dev) }EXPORT_SYMBOL (drm_mode_create_dvi_i_properties); +/** +* drm_mode_create_dp_properties - create DP specific connector properties +* @dev: DRM device +* +* Called by a driver the first time a DP connector is made. +*/ +void drm_mode_create_dp_properties (struct drm_device *dev) +{ +struct drm_property *dp_subconnector; + +if (dev->mode_config.dp_subconnector_property) +return ; + + dp_subconnector =drm_property_create_enum (dev,DRM_MODE_PROP_IMMUTABLE , +"subconnector" , + drm_dp_subconnector_enum_list, +ARRAY_SIZE (drm_dp_subconnector_enum_list)); + dev->mode_config.dp_subconnector_property = dp_subconnector; +} +EXPORT_SYMBOL (drm_mode_create_dp_properties); +/** * DOC: HDMI connector properties * drivers/gpu/drm/drm_dp_helper.c +3
-0@@ -662,6 +662,42 @@ void drm_dp_downstream_debug(struct seq_file *m, }EXPORT_SYMBOL (drm_dp_downstream_debug); +/** +* drm_dp_downstream_subconnector_type() - get DP branch device type +* @dpcd: DisplayPort configuration data
drivers/gpu/drm/drm_dp_helper.c void drm_dp_downstream_debug(struct seq_file *m, · line 677
Quoted 10 lines
drivers/gpu/drm/drm_dp_helper.c +10
-0+* @port_cap: port capabilities +* +*/ +enum drm_mode_subconnector +drm_dp_downstream_subconnector_type (const u8 dpcd[DP_RECEIVER_CAP_SIZE ], +const u8 port_cap[4 ]) +{ +int type = port_cap[0 ] &DP_DS_PORT_TYPE_MASK ; +bool branch_device_present = dpcd[DP_DOWNSTREAMPORT_PRESENT ] & +DP_DWN_STRM_PORT_PRESENT ;
drm_dp_is_branch()
Quoted 10 lines
drivers/gpu/drm/drm_dp_helper.c +10
-0+ +if (!branch_device_present) +return DRM_MODE_SUBCONNECTOR_Native; + +switch (type) { +case DP_DS_PORT_TYPE_DP : +case DP_DS_PORT_TYPE_DP_DUALMODE : +return DRM_MODE_SUBCONNECTOR_DP ; +case DP_DS_PORT_TYPE_VGA : +return DRM_MODE_SUBCONNECTOR_VGA ;
drivers/gpu/drm/drm_dp_helper.c void drm_dp_downstream_debug(struct seq_file *m, · line 697
Quoted 10 lines
drivers/gpu/drm/drm_dp_helper.c +10
-0+case DP_DS_PORT_TYPE_DVI : +return DRM_MODE_SUBCONNECTOR_DVI ; +case DP_DS_PORT_TYPE_HDMI : +return DRM_MODE_SUBCONNECTOR_HDMI ; +case DP_DS_PORT_TYPE_WIRELESS : +return DRM_MODE_SUBCONNECTOR_Wireless; +case DP_DS_PORT_TYPE_NON_EDID : +default : +return DRM_MODE_SUBCONNECTOR_Unknown; + }
DPCD 1.0 doesn't have the downstream port information at 0x80. For those you have to rely on DP_DWN_STRM_PORT_TYPE_MASK & co.
Quoted 93 lines
drivers/gpu/drm/drm_dp_helper.c +3
-0+} +EXPORT_SYMBOL (drm_dp_downstream_subconnector_type); +/* * I2C-over-AUX implementation */ include/drm/drm_connector.h +2
-0@@ -1483,9 +1483,11 @@ const char *drm_get_dvi_i_subconnector_name(int val);const char *drm_get_dvi_i_select_name (int val);const char *drm_get_tv_subconnector_name (int val);const char *drm_get_tv_select_name (int val); +const char *drm_get_dp_subconnector_name (int val);const char *drm_get_content_protection_name (int val);int drm_mode_create_dvi_i_properties (struct drm_device *dev); +void drm_mode_create_dp_properties (struct drm_device *dev);int drm_mode_create_tv_margin_properties (struct drm_device *dev); int drm_mode_create_tv_properties(struct drm_device *dev, unsigned int num_modes,include/drm/drm_dp_helper.h +3
-0@@ -1372,6 +1372,9 @@ int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],int drm_dp_downstream_id (struct drm_dp_aux *aux,char id[6 ]);void drm_dp_downstream_debug (struct seq_file *m,const u8 dpcd[DP_RECEIVER_CAP_SIZE ],const u8 port_cap[4 ],struct drm_dp_aux *aux); +enum drm_mode_subconnector +drm_dp_downstream_subconnector_type (const u8 dpcd[DP_RECEIVER_CAP_SIZE ], +const u8 port_cap[4 ]);void drm_dp_aux_init (struct drm_dp_aux *aux);int drm_dp_aux_register (struct drm_dp_aux *aux);include/drm/drm_mode_config.h +6
-0@@ -680,6 +680,12 @@ struct drm_mode_config {*/ struct drm_property *dvi_i_select_subconnector_property; +/** +* @dp_subconnector_property: Optional DP property to differentiate +* between different DP downstream port types. +*/ +struct drm_property *dp_subconnector_property; +/** * @tv_subconnector_property: Optional TV property to differentiate * between different TV connector types. include/uapi/drm/drm_mode.h +14
-8@@ -332,14 +332,20 @@ struct drm_mode_get_encoder {/* This is for connectors with multiple signal types. */ /* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */ enum drm_mode_subconnector { - DRM_MODE_SUBCONNECTOR_Automatic =0 , - DRM_MODE_SUBCONNECTOR_Unknown =0 , -DRM_MODE_SUBCONNECTOR_DVID =3 , -DRM_MODE_SUBCONNECTOR_DVIA =4 , - DRM_MODE_SUBCONNECTOR_Composite =5 , -DRM_MODE_SUBCONNECTOR_SVIDEO =6 , - DRM_MODE_SUBCONNECTOR_Component =8 , -DRM_MODE_SUBCONNECTOR_SCART =9 , + DRM_MODE_SUBCONNECTOR_Automatic =0 ,/* DVI-I, TV */ + DRM_MODE_SUBCONNECTOR_Unknown =0 ,/* DVI-I, TV, DP */ +DRM_MODE_SUBCONNECTOR_VGA =1 ,/* DP */ +DRM_MODE_SUBCONNECTOR_DVI =2 ,/* DP */ +DRM_MODE_SUBCONNECTOR_DVID =3 ,/* DVI-I */ +DRM_MODE_SUBCONNECTOR_DVIA =4 ,/* DVI-I */ + DRM_MODE_SUBCONNECTOR_Composite =5 ,/* TV */ +DRM_MODE_SUBCONNECTOR_SVIDEO =6 ,/* TV */ + DRM_MODE_SUBCONNECTOR_Component =8 ,/* TV */ +DRM_MODE_SUBCONNECTOR_SCART =9 ,/* TV */ +DRM_MODE_SUBCONNECTOR_DP =10 ,/* DP */ +DRM_MODE_SUBCONNECTOR_HDMI =11 ,/* DP */ + DRM_MODE_SUBCONNECTOR_Native =15 ,/* DP */ + DRM_MODE_SUBCONNECTOR_Wireless =19 ,/* DP */ };#define DRM_MODE_CONNECTOR_Unknown 0Signature · 6 lines
2.22.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Oleg,
Quoted 15 lines · Oleg Vasilev
Currently, downstream port type is only reported in debugfs. This information should be considered important since it reflects the actual physical connector type. Some userspace (e.g. window compositors) may want to show this info to a user.
The 'subconnector' property is already utilized for DVI-I and TV-out for reporting connector subtype.
The initial motivation for this feature came from i2c test [1]. It is supposed to be skipped on VGA connectors, but it cannot detect VGA over DP and fails instead.
[1]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
Signed-off-by Oleg Vasilev <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/drm_connector.c | 38 +++++++++++++++++++++++++++++++-- drivers/gpu/drm/drm_dp_helper.c | 36 +++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 2 ++ include/drm/drm_dp_helper.h | 3 +++ include/drm/drm_mode_config.h | 6 ++++++ include/uapi/drm/drm_mode.h | 22 ++++++++++++------- 6 files changed, 97 insertions(+), 10 deletions(-)
Can you please update other drivers to make use of this - quick grep shows 5-10 in total.
if only i915 does this, then the point of making this uAPI is very meh.
Think user-space having per-vendor quirks for KMS. While KMS should be vendor agnostic.
-Emil
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 31 lines · Emil Velikov
Hi Oleg,
Quoted 16 lines · Oleg Vasilev
Currently, downstream port type is only reported in debugfs. This information should be considered important since it reflects the actual
physical connector type. Some userspace (e.g. window compositors) may want to show this info to a user.The 'subconnector' property is already utilized for DVI-I and TV- out for
reporting connector subtype.The initial motivation for this feature came from i2c test [1]. It is supposed to be skipped on VGA connectors, but it cannot detect VGA over DP and fails instead.
[1]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
Signed-off-by Oleg Vasilev <[email protected]>Quoted 11 lines
--- drivers/gpu/drm/drm_connector.c | 38 +++++++++++++++++++++++++++++++-- drivers/gpu/drm/drm_dp_helper.c | 36 +++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 2 ++ include/drm/drm_dp_helper.h | 3 +++ include/drm/drm_mode_config.h | 6 ++++++ include/uapi/drm/drm_mode.h | 22 ++++++++++++------- 6 files changed, 97 insertions(+), 10 deletions(-)
Quoted 2 lines
Can you please update other drivers to make use of this - quick grep shows 5-10 in total.
Hi,
Sure, I can do this. Should I do this is a part of this series or better first get it merged, and then add support for other drivers?
Oleg
Quoted 8 lines
if only i915 does this, then the point of making this uAPI is very meh.
Think user-space having per-vendor quirks for KMS. While KMS should be
vendor agnostic.-Emil
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 33 lines · Oleg
Quoted 31 lines · Emil Velikov
Hi Oleg,
Quoted 27 lines · Oleg Vasilev
Currently, downstream port type is only reported in debugfs. This information should be considered important since it reflects the actual
physical connector type. Some userspace (e.g. window compositors) may want to show this info to a user.The 'subconnector' property is already utilized for DVI-I and TV- out for
reporting connector subtype.The initial motivation for this feature came from i2c test [1]. It is supposed to be skipped on VGA connectors, but it cannot detect VGA over DP and fails instead.
[1]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
Signed-off-by Oleg Vasilev <[email protected]>--- drivers/gpu/drm/drm_connector.c | 38 +++++++++++++++++++++++++++++++-- drivers/gpu/drm/drm_dp_helper.c | 36 +++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 2 ++ include/drm/drm_dp_helper.h | 3 +++ include/drm/drm_mode_config.h | 6 ++++++ include/uapi/drm/drm_mode.h | 22 ++++++++++++------- 6 files changed, 97 insertions(+), 10 deletions(-)
Quoted 8 lines
Quoted 2 lines
Can you please update other drivers to make use of this - quick grep shows 5-10 in total.
Hi,
Sure, I can do this. Should I do this is a part of this series or better first get it merged, and then add support for other drivers?
Since it's a very small list, personally I'd go with part of this series. If others feel differently go with that.
Please don't forget to address Ville feedback.
Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Subconnector property for DP downstream type
In reply to Oleg VasilevUnfortunately, I don't have any nvidia hardware to test a patch. As of amd, it seems that current DP implementation in drm-tip is corrupted with an unrelated DP aux issue.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 1/6 drm: move DP_MAX_DOWNSTREAM_PORTS from i915 to drm core
DP_MAX_DOWNSTREAM_PORTS=0x10 is a vendor-independent constant.
--- drivers/gpu/drm/i915/intel_drv.h | 2 -- include/drm/drm_dp_helper.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_drv.h +0 -2
@@ -1083,8 +1083,6 @@ struct intel_hdmi { };struct intel_dp_mst_encoder ; -#define DP_MAX_DOWNSTREAM_PORTS 0x10 -/* * enum link_m_n_set: * When platform provides two set of M_N registers for dp, we can
include/drm/drm_dp_helper.h +2 -0
@@ -349,6 +349,8 @@# define DP_DS_12BPC 2# define DP_DS_16BPC 3 +#define DP_MAX_DOWNSTREAM_PORTS 0x10 +/* DP Forward error Correction Registers */ #define DP_FEC_CAPABILITY 0x090/* 1.4 */ # define DP_FEC_CAPABLE (1 << 0)
Signature · 6 lines
2.22.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 2/6 drm: always determine branch device with drm_dp_is_branch()
In reply to Oleg VasilevThe helper should always be used.
--- drivers/gpu/drm/drm_dp_helper.c | 3 +-- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_dp_helper.c +1 -2
@@ -596,8 +596,7 @@ void drm_dp_downstream_debug(struct seq_file *m,int len;uint8_t rev[2 ];int type = port_cap[0 ] &DP_DS_PORT_TYPE_MASK ; -bool branch_device = dpcd[DP_DOWNSTREAMPORT_PRESENT ] & -DP_DWN_STRM_PORT_PRESENT ; +bool branch_device =drm_dp_is_branch (dpcd);seq_printf (m,"\tDP branch device present: %s\n" , branch_device ?"yes" :"no" );
drivers/gpu/drm/i915/display/intel_dp.c +1 -1
@@ -2916,7 +2916,7 @@ static bool downstream_hpd_needs_d0(struct intel_dp *intel_dp)* FIXME should really check all downstream ports... */ return intel_dp->dpcd[DP_DPCD_REV ] ==0x11 && - intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT ] &DP_DWN_STRM_PORT_PRESENT && +drm_dp_is_branch (intel_dp->dpcd) && intel_dp->downstream_ports[0 ] &DP_DS_PORT_HPD ; }
Signature · 6 lines
2.22.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
A message that is not in the archive (sent off-list or not yet received): 20190715112408.20114-1-oleg.vasilev-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
PATCH v2 6/6 drm/amdgpu: utilize subconnector property for DP
Since DP-specific information is stored in driver's structures, every driver needs to implement subconnector property by itself.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 12 ++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 1 + drivers/gpu/drm/amd/amdgpu/atombios_dp.c | 18 +++++++++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +12 -0
@@ -26,6 +26,7 @@#include <drm/drm_edid.h> #include <drm/drm_fb_helper.h> +#include <drm/drm_dp_helper.h> #include <drm/drm_probe_helper.h> #include <drm/amdgpu_drm.h> #include "amdgpu.h"
@@ -1407,6 +1408,10 @@ amdgpu_connector_dp_detect(struct drm_connector *connector, bool force)pm_runtime_put_autosuspend (connector->dev->dev); } +drm_dp_set_subconnector_property (&amdgpu_connector->base, + ret, + amdgpu_dig_connector->dpcd, + amdgpu_dig_connector->downstream_ports);return ret; }
@@ -1567,6 +1572,13 @@ amdgpu_connector_add(struct amdgpu_device *adev,DRM_ERROR ("Failed to assign router i2c bus! Check dmesg for i2c errors.\n" ); } +if ((connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) || + (connector->connector_type == DRM_MODE_CONNECTOR_eDP)) + { +drm_mode_add_dp_subconnector_property (&amdgpu_connector->base); + } + +if (is_dp_bridge) { amdgpu_dig_connector =kzalloc (sizeof (struct amdgpu_connector_atom_dig ),GFP_KERNEL );if (!amdgpu_dig_connector)
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +1 -0
@@ -469,6 +469,7 @@ struct amdgpu_encoder {struct amdgpu_connector_atom_dig {/* displayport */ u8 dpcd[DP_RECEIVER_CAP_SIZE ]; +u8 downstream_ports[DP_MAX_DOWNSTREAM_PORTS ];u8 dp_sink_type;int dp_clock;int dp_lane_count;
drivers/gpu/drm/amd/amdgpu/atombios_dp.c +17 -1
@@ -334,6 +334,22 @@ static void amdgpu_atombios_dp_probe_oui(struct amdgpu_connector *amdgpu_connect buf[0], buf[1], buf[2]); } +static void amdgpu_atombios_dp_ds_ports (struct amdgpu_connector *amdgpu_connector) +{ +struct amdgpu_connector_atom_dig *dig_connector = amdgpu_connector->con_priv; +int ret; + +if (dig_connector->dpcd[DP_DPCD_REV ] >0x10 ) { + ret =drm_dp_dpcd_read (&amdgpu_connector->ddc_bus->aux, +DP_DOWNSTREAM_PORT_0 , + dig_connector->downstream_ports, +DP_MAX_DOWNSTREAM_PORTS ); +if (ret) +memset (dig_connector->downstream_ports,0 , +DP_MAX_DOWNSTREAM_PORTS ); + } +} +int amdgpu_atombios_dp_get_dpcd (struct amdgpu_connector *amdgpu_connector) {struct amdgpu_connector_atom_dig *dig_connector = amdgpu_connector->con_priv;
@@ -349,7 +365,7 @@ int amdgpu_atombios_dp_get_dpcd(struct amdgpu_connector *amdgpu_connector) dig_connector->dpcd);amdgpu_atombios_dp_probe_oui (amdgpu_connector); - +amdgpu_atombios_dp_ds_ports (amdgpu_connector);return 0 ; }
Signature · 6 lines
2.22.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH v2 3/6 drm: report dp downstream port type as a subconnector property
In reply to Oleg VasilevCurrently, downstream port type is only reported in debugfs. This information should be considered important since it reflects the actual physical connector type. Some userspace (e.g. window compositors) may want to show this info to a user.
The 'subconnector' property is already utilized for DVI-I and TV-out for reporting connector subtype.
The initial motivation for this feature came from i2c test [1]. It is supposed to be skipped on VGA connectors, but it cannot detect VGA over DP and fails instead.
v2:
- Ville: utilized drm_dp_is_branch()
- Ville: implement DP 1.0 downstream type info
- Replaced create_dp_properties with add_dp_subconnector_property
- Added dp_set_subconnector_property helper
[1]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
--- drivers/gpu/drm/drm_connector.c | 49 +++++++++++++++++++++++- drivers/gpu/drm/drm_dp_helper.c | 68 +++++++++++++++++++++++++++++++++ include/drm/drm_connector.h | 3 ++ include/drm/drm_dp_helper.h | 8 ++++ include/drm/drm_mode_config.h | 6 +++ include/uapi/drm/drm_mode.h | 22 +++++++---- 6 files changed, 146 insertions(+), 10 deletions(-)
drivers/gpu/drm/drm_connector.c +47 -2
@@ -793,7 +793,7 @@ static const struct drm_prop_enum_list drm_dvi_i_select_enum_list[] = { DRM_ENUM_NAME_FN(drm_get_dvi_i_select_name, drm_dvi_i_select_enum_list)static const struct drm_prop_enum_list drm_dvi_i_subconnector_enum_list[] = { - { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I and TV-out */ + { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I, TV-out and DP */ {DRM_MODE_SUBCONNECTOR_DVID ,"DVI-D" },/* DVI-I */ {DRM_MODE_SUBCONNECTOR_DVIA ,"DVI-A" },/* DVI-I */ };
@@ -810,7 +810,7 @@ static const struct drm_prop_enum_list drm_tv_select_enum_list[] = { DRM_ENUM_NAME_FN(drm_get_tv_select_name, drm_tv_select_enum_list)static const struct drm_prop_enum_list drm_tv_subconnector_enum_list[] = { - { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I and TV-out */ + { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I, TV-out and DP */ { DRM_MODE_SUBCONNECTOR_Composite,"Composite" },/* TV-out */ {DRM_MODE_SUBCONNECTOR_SVIDEO ,"SVIDEO" },/* TV-out */ { DRM_MODE_SUBCONNECTOR_Component,"Component" },/* TV-out */
@@ -819,6 +819,19 @@ static const struct drm_prop_enum_list drm_tv_subconnector_enum_list[] = {DRM_ENUM_NAME_FN (drm_get_tv_subconnector_name, drm_tv_subconnector_enum_list) +static const struct drm_prop_enum_list drm_dp_subconnector_enum_list[] = { + { DRM_MODE_SUBCONNECTOR_Unknown,"Unknown" },/* DVI-I, TV-out and DP */ + {DRM_MODE_SUBCONNECTOR_VGA ,"VGA" },/* DP */ + {DRM_MODE_SUBCONNECTOR_DVI ,"DVI" },/* DP */ + {DRM_MODE_SUBCONNECTOR_HDMI ,"HDMI" },/* DP */ + {DRM_MODE_SUBCONNECTOR_DP ,"DP" },/* DP */ + { DRM_MODE_SUBCONNECTOR_Wireless,"Wireless" },/* DP */ + { DRM_MODE_SUBCONNECTOR_Native,"Native" },/* DP */ +}; + +DRM_ENUM_NAME_FN (drm_get_dp_subconnector_name, + drm_dp_subconnector_enum_list) +static const struct drm_prop_enum_list hdmi_colorspaces[] = {/* For Default case, driver will set the colorspace */ {DRM_MODE_COLORIMETRY_DEFAULT ,"Default" },
@@ -1040,6 +1053,14 @@ static const struct drm_prop_enum_list hdmi_colorspaces[] = {* can also expose this property to external outputs, in which case they * must support "None", which should be the default (since external screens * have a built-in scaler). +* +* subconnector: +* This property is used by DVI-I, TVout and DisplayPort to indicate different +* connector subtypes. Enum values more or less match with those from main +* connector types. +* For DVI-I and TVout there is also a matching property "select subconnector" +* allowing to switch between signal types. +* DP subconnector corresponds to a downstream port. */ int drm_connector_create_standard_properties (struct drm_device *dev)
@@ -1128,6 +1149,30 @@ int drm_mode_create_dvi_i_properties(struct drm_device *dev) }EXPORT_SYMBOL (drm_mode_create_dvi_i_properties); +/** +* drm_mode_add_dp_subconnector_property - create subconnector property for DP +* @connector: drm_connector to attach property +* +* Called by a driver when DP connector is created. +*/ +void drm_mode_add_dp_subconnector_property (struct drm_connector *connector) +{ +struct drm_mode_config *mode_config = &connector->dev->mode_config; + +if (!mode_config->dp_subconnector_property) + mode_config->dp_subconnector_property = +drm_property_create_enum (connector->dev, +DRM_MODE_PROP_IMMUTABLE , +"subconnector" , + drm_dp_subconnector_enum_list, +ARRAY_SIZE (drm_dp_subconnector_enum_list)); + +drm_object_attach_property (&connector->base, + mode_config->dp_subconnector_property, + DRM_MODE_SUBCONNECTOR_Unknown); +} +EXPORT_SYMBOL (drm_mode_add_dp_subconnector_property); +/** * DOC: HDMI connector properties *
drivers/gpu/drm/drm_dp_helper.c +68 -0
74 lines not on this page · raw message
include/drm/drm_connector.h +3 -0
@@ -1483,9 +1483,12 @@ const char *drm_get_dvi_i_subconnector_name(int val);const char *drm_get_dvi_i_select_name (int val);const char *drm_get_tv_subconnector_name (int val);const char *drm_get_tv_select_name (int val); +const char *drm_get_dp_subconnector_name (int val);const char *drm_get_content_protection_name (int val);int drm_mode_create_dvi_i_properties (struct drm_device *dev); +void drm_mode_add_dp_subconnector_property (struct drm_connector *connector); +int drm_mode_create_tv_margin_properties (struct drm_device *dev); int drm_mode_create_tv_properties(struct drm_device *dev, unsigned int num_modes,
include/drm/drm_dp_helper.h +8 -0
@@ -26,6 +26,7 @@#include <linux/types.h> #include <linux/i2c.h> #include <linux/delay.h> +#include <drm/drm_connector.h> /* * Unless otherwise noted, all values are from the DP 1.1a spec. Note that
@@ -1374,6 +1375,13 @@ int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],int drm_dp_downstream_id (struct drm_dp_aux *aux,char id[6 ]);void drm_dp_downstream_debug (struct seq_file *m,const u8 dpcd[DP_RECEIVER_CAP_SIZE ],const u8 port_cap[4 ],struct drm_dp_aux *aux); +enum drm_mode_subconnector +drm_dp_subconnector_type (const u8 dpcd[DP_RECEIVER_CAP_SIZE ], +const u8 port_cap[4 ]); +void drm_dp_set_subconnector_property (struct drm_connector *connector, +enum drm_connector_status status, +const u8 *dpcd, +const u8 port_cap[4 ]);void drm_dp_aux_init (struct drm_dp_aux *aux);int drm_dp_aux_register (struct drm_dp_aux *aux);
include/drm/drm_mode_config.h +6 -0
@@ -680,6 +680,12 @@ struct drm_mode_config {*/ struct drm_property *dvi_i_select_subconnector_property; +/** +* @dp_subconnector_property: Optional DP property to differentiate +* between different DP downstream port types. +*/ +struct drm_property *dp_subconnector_property; +/** * @tv_subconnector_property: Optional TV property to differentiate * between different TV connector types.
include/uapi/drm/drm_mode.h +14 -8
@@ -332,14 +332,20 @@ struct drm_mode_get_encoder {/* This is for connectors with multiple signal types. */ /* Try to match DRM_MODE_CONNECTOR_X as closely as possible. */ enum drm_mode_subconnector { - DRM_MODE_SUBCONNECTOR_Automatic =0 , - DRM_MODE_SUBCONNECTOR_Unknown =0 , -DRM_MODE_SUBCONNECTOR_DVID =3 , -DRM_MODE_SUBCONNECTOR_DVIA =4 , - DRM_MODE_SUBCONNECTOR_Composite =5 , -DRM_MODE_SUBCONNECTOR_SVIDEO =6 , - DRM_MODE_SUBCONNECTOR_Component =8 , -DRM_MODE_SUBCONNECTOR_SCART =9 , + DRM_MODE_SUBCONNECTOR_Automatic =0 ,/* DVI-I, TV */ + DRM_MODE_SUBCONNECTOR_Unknown =0 ,/* DVI-I, TV, DP */ +DRM_MODE_SUBCONNECTOR_VGA =1 ,/* DP */ +DRM_MODE_SUBCONNECTOR_DVI =2 ,/* DP */ +DRM_MODE_SUBCONNECTOR_DVID =3 ,/* DVI-I */ +DRM_MODE_SUBCONNECTOR_DVIA =4 ,/* DVI-I */ + DRM_MODE_SUBCONNECTOR_Composite =5 ,/* TV */ +DRM_MODE_SUBCONNECTOR_SVIDEO =6 ,/* TV */ + DRM_MODE_SUBCONNECTOR_Component =8 ,/* TV */ +DRM_MODE_SUBCONNECTOR_SCART =9 ,/* TV */ +DRM_MODE_SUBCONNECTOR_DP =10 ,/* DP */ +DRM_MODE_SUBCONNECTOR_HDMI =11 ,/* DP */ + DRM_MODE_SUBCONNECTOR_Native =15 ,/* DP */ + DRM_MODE_SUBCONNECTOR_Wireless =19 ,/* DP */ };#define DRM_MODE_CONNECTOR_Unknown 0
Signature · 6 lines
2.22.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 4/6 drm/i915: utilize subconnector property for DP
In reply to Oleg VasilevSince DP-specific information is stored in driver's structures, every driver needs to implement subconnector property by itself.
v2: updates to match previous commit changes
--- drivers/gpu/drm/i915/display/intel_dp.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/display/intel_dp.c +6 -0
@@ -5421,6 +5421,10 @@ intel_dp_detect(struct drm_connector *connector,if (status != connector_status_connected && !intel_dp->is_mst)intel_dp_unset_edid (intel_dp); +drm_dp_set_subconnector_property (connector, + status, + intel_dp->dpcd, + intel_dp->downstream_ports);return status; }
@@ -6317,6 +6321,8 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connectstruct drm_i915_private *dev_priv =to_i915 (connector->dev);enum port port =dp_to_dig_port (intel_dp)->base.port; +drm_mode_add_dp_subconnector_property (connector); +if (!IS_G4X (dev_priv) && port !=PORT_A )intel_attach_force_audio_property (connector);
Signature · 6 lines
2.22.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 5/6 drm/nouveau: utilize subconnector property for DP
In reply to Oleg VasilevSince DP-specific information is stored in driver's structures, every driver needs to implement subconnector property by itself.
--- drivers/gpu/drm/nouveau/nouveau_connector.c | 13 +++++++++++++ drivers/gpu/drm/nouveau/nouveau_dp.c | 9 +++++++++ drivers/gpu/drm/nouveau/nouveau_encoder.h | 1 + 3 files changed, 23 insertions(+)
drivers/gpu/drm/nouveau/nouveau_connector.c +13 -0
@@ -636,6 +636,17 @@ nouveau_connector_detect(struct drm_connector *connector, bool force)pm_runtime_mark_last_busy (dev->dev);pm_runtime_put_autosuspend (dev->dev); +if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || + connector->connector_type == DRM_MODE_CONNECTOR_eDP) { +enum drm_mode_subconnector subconnector = DRM_MODE_SUBCONNECTOR_Unknown; + +if (conn_status == connector_status_connected && nv_encoder) + subconnector = nv_encoder->dp.subconnector; +drm_object_property_set_value (&connector->base, + connector->dev->mode_config.dp_subconnector_property, + subconnector); + } +return conn_status; }
@@ -1357,6 +1368,8 @@ nouveau_connector_create(struct drm_device *dev,kfree (nv_connector);return ERR_PTR (ret); } + +drm_mode_add_dp_subconnector_property (connector); funcs = &nouveau_connector_funcs;break ;default :
drivers/gpu/drm/nouveau/nouveau_dp.c +9 -0
@@ -63,6 +63,7 @@ nouveau_dp_detect(struct nouveau_encoder *nv_encoder)struct nouveau_drm *drm =nouveau_drm (dev);struct nvkm_i2c_aux *aux;u8 dpcd[8 ]; +u8 port_cap[DP_MAX_DOWNSTREAM_PORTS ] = {0 };int ret; aux = nv_encoder->aux;
@@ -73,6 +74,14 @@ nouveau_dp_detect(struct nouveau_encoder *nv_encoder)if (ret)return ret; +if (dpcd[DP_DPCD_REV ] >0x10 ) { + ret =nvkm_rdaux (aux,DP_DOWNSTREAM_PORT_0 , + port_cap,DP_MAX_DOWNSTREAM_PORTS ); +if (ret) +memset (port_cap,0 ,DP_MAX_DOWNSTREAM_PORTS ); + } + nv_encoder->dp.subconnector =drm_dp_subconnector_type (dpcd, port_cap); + nv_encoder->dp.link_bw =27000 * dpcd[1 ]; nv_encoder->dp.link_nr = dpcd[2 ] &DP_MAX_LANE_COUNT_MASK ;
drivers/gpu/drm/nouveau/nouveau_encoder.h +1 -0
@@ -63,6 +63,7 @@ struct nouveau_encoder {struct nv50_mstm *mstm;int link_nr;int link_bw; +enum drm_mode_subconnector subconnector; } dp; };
Signature · 6 lines
2.22.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 5/6] drm/nouveau: utilize subconnector property for DP
Hi Oleg,
Quoted 47 lines · Oleg Vasilev
Since DP-specific information is stored in driver's structures, every driver needs to implement subconnector property by itself.
Signed-off-by Oleg Vasilev <[email protected]>--- drivers/gpu/drm/nouveau/nouveau_connector.c | 13 +++++++++++++ drivers/gpu/drm/nouveau/nouveau_dp.c | 9 +++++++++ drivers/gpu/drm/nouveau/nouveau_encoder.h | 1 + 3 files changed, 23 insertions(+)drivers/gpu/drm/nouveau/nouveau_connector.c +13
-0@@ -636,6 +636,17 @@ nouveau_connector_detect(struct drm_connector *connector, bool force)pm_runtime_mark_last_busy (dev->dev);pm_runtime_put_autosuspend (dev->dev); +if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || + connector->connector_type == DRM_MODE_CONNECTOR_eDP) { +enum drm_mode_subconnector subconnector = DRM_MODE_SUBCONNECTOR_Unknown; + +if (conn_status == connector_status_connected && nv_encoder) + subconnector = nv_encoder->dp.subconnector; +drm_object_property_set_value (&connector->base, + connector->dev->mode_config.dp_subconnector_property, + subconnector); + } +return conn_status; }@@ -1357,6 +1368,8 @@ nouveau_connector_create(struct drm_device *dev,kfree (nv_connector);return ERR_PTR (ret); } + +drm_mode_add_dp_subconnector_property (connector); funcs = &nouveau_connector_funcs;break ;default :drivers/gpu/drm/nouveau/nouveau_dp.c +0
-0
drivers/gpu/drm/nouveau/nouveau_dp.c nouveau_dp_detect(struct nouveau_encoder *nv_encoder) · line 66
Quoted 4 lines
drivers/gpu/drm/nouveau/nouveau_dp.c +1
-0@@ -63,6 +63,7 @@ nouveau_dp_detect(struct nouveau_encoder *nv_encoder)struct nouveau_drm *drm =nouveau_drm (dev);struct nvkm_i2c_aux *aux;u8 dpcd[8 ]; +u8 port_cap[DP_MAX_DOWNSTREAM_PORTS ] = {0 };
IIRC clang will complain about {0}. How about we make this a {}.
Regardless of the above nitpick, the series is:
Thanks for the follow-up :-)
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel