drm: report dp downstream port type as a subconnector property
authorOleg Vasilev <oleg.vasilev@intel.com>
Fri, 24 Apr 2020 12:50:51 +0000 (18:20 +0530)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Tue, 11 Aug 2020 12:06:04 +0000 (14:06 +0200)
commite5b92773287c3eb3108a44785986a6c997866df8
tree5010ee93d3f78062e0513c9e6f9985df209dcc68
parenta343160235f59b5baacaecba7b7ee14abe8ae034
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.

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

v4:
 - Ville: add DP1.0 best assumption about subconnector
 - Ville: assume DVI is DVI-D
 - Ville: reuse Writeback enum value for Virtual subconnector
 - Renamed #defines: HDMI -> HDMIA, DP -> DisplayPort

v5: rebase

v6:
 - Jani Nikula: renamed a function name
 - Jani Nikula: addressed the issues with documentation

[1]: https://bugs.freedesktop.org/show_bug.cgi?id=104097

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Signed-off-by: Jeevan B <jeevan.b@intel.com>
Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1587732655-17544-1-git-send-email-jeevan.b@intel.com
drivers/gpu/drm/drm_connector.c
drivers/gpu/drm/drm_dp_helper.c
include/drm/drm_connector.h
include/drm/drm_dp_helper.h
include/drm/drm_mode_config.h
include/uapi/drm/drm_mode.h