Re: [Intel-gfx] [PATCH 1/2] drm: report dp downstream port type as a subconnector property

2019-07-03 Thread Emil Velikov
On Wed, 3 Jul 2019 at 09:19, Vasilev, Oleg  wrote:
>
> On Tue, 2019-07-02 at 14:38 +0100, Emil Velikov wrote:
> > Hi Oleg,
> >
> > On Mon, 1 Jul 2019 at 09:00, Oleg Vasilev 
> > wrote:
> > > 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 
> > > ---
> > >  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.
>
> 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
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [Intel-gfx] [PATCH 1/2] drm: report dp downstream port type as a subconnector property

2019-07-03 Thread Vasilev, Oleg
On Tue, 2019-07-02 at 14:38 +0100, Emil Velikov wrote:
> Hi Oleg,
> 
> On Mon, 1 Jul 2019 at 09:00, Oleg Vasilev 
> wrote:
> > 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 
> > ---
> >  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.

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

> 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


smime.p7s
Description: S/MIME cryptographic signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [Intel-gfx] [PATCH 1/2] drm: report dp downstream port type as a subconnector property

2019-07-02 Thread Emil Velikov
Hi Oleg,

On Mon, 1 Jul 2019 at 09:00, Oleg Vasilev  wrote:
>
> 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 
> ---
>  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
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [Intel-gfx] [PATCH 1/2] drm: report dp downstream port type as a subconnector property

2019-07-02 Thread Ville Syrjälä
On Mon, Jul 01, 2019 at 11:00:21AM +0300, Oleg Vasilev wrote:
> 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 
> ---
>  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(-)
> 
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 068d4b05f1be..95cd51254be6 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -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
>   *
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index 0b994d083a89..63d8f0b8492c 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -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