diff mbox series

drm/doc: describe PATH format for DP MST

Message ID 20231023203629.198109-1-contact@emersion.fr (mailing list archive)
State New, archived
Headers show
Series drm/doc: describe PATH format for DP MST | expand

Commit Message

Simon Ser Oct. 23, 2023, 8:36 p.m. UTC
This is already uAPI, xserver parses it. It's useful to document
since user-space might want to lookup the parent connector.

Additionally, people (me included) have misunderstood the PATH
property for being stable across reboots, but since a KMS object
ID is baked in there that's not the case. So PATH shouldn't be
used as-is in config files and such.

Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Pekka Paalanen <pekka.paalanen@collabora.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/drm_connector.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Dmitry Baryshkov Oct. 23, 2023, 9:32 p.m. UTC | #1
On Mon, 23 Oct 2023 at 23:37, Simon Ser <contact@emersion.fr> wrote:
>
> This is already uAPI, xserver parses it. It's useful to document
> since user-space might want to lookup the parent connector.
>
> Additionally, people (me included) have misunderstood the PATH
> property for being stable across reboots, but since a KMS object
> ID is baked in there that's not the case. So PATH shouldn't be
> used as-is in config files and such.
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Pekka Paalanen <pekka.paalanen@collabora.com>
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
>  drivers/gpu/drm/drm_connector.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index c3725086f413..392bec1355a3 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -1198,6 +1198,11 @@ static const u32 dp_colorspaces =
>   *     drm_connector_set_path_property(), in the case of DP MST with the
>   *     path property the MST manager created. Userspace cannot change this
>   *     property.
> + *
> + *     In the case of DP MST, the property has the format
> + *     ``mst:<parent>-<ports>`` where ``<parent>`` is the KMS object ID of the
> + *     parent connector and ``<ports>`` is a hyphen-separated list of DP MST
> + *     port numbers. Note, KMS object IDs are not stable across reboots.

Nit:  maybe `... is not guaranteed to be stable...'

>   * TILE:
>   *     Connector tile group property to indicate how a set of DRM connector
>   *     compose together into one logical screen. This is used by both high-res
> --
> 2.42.0
>
>
Pekka Paalanen Oct. 24, 2023, 7:36 a.m. UTC | #2
On Mon, 23 Oct 2023 20:36:39 +0000
Simon Ser <contact@emersion.fr> wrote:

> This is already uAPI, xserver parses it. It's useful to document
> since user-space might want to lookup the parent connector.
> 
> Additionally, people (me included) have misunderstood the PATH
> property for being stable across reboots, but since a KMS object
> ID is baked in there that's not the case. So PATH shouldn't be
> used as-is in config files and such.
> 
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Pekka Paalanen <pekka.paalanen@collabora.com>
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/drm_connector.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index c3725086f413..392bec1355a3 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -1198,6 +1198,11 @@ static const u32 dp_colorspaces =
>   * 	drm_connector_set_path_property(), in the case of DP MST with the
>   * 	path property the MST manager created. Userspace cannot change this
>   * 	property.
> + *
> + * 	In the case of DP MST, the property has the format
> + * 	``mst:<parent>-<ports>`` where ``<parent>`` is the KMS object ID of the
> + * 	parent connector and ``<ports>`` is a hyphen-separated list of DP MST
> + * 	port numbers. Note, KMS object IDs are not stable across reboots.
>   * TILE:
>   * 	Connector tile group property to indicate how a set of DRM connector
>   * 	compose together into one logical screen. This is used by both high-res

Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>

with or without the suggested "guaranteed" wording.

Are DP MST port numbers guaranteed to be tied to the physical hardware
configuration (e.g. how cables are connected) and therefore stable
across reboots? What about stable across kernel upgrades?

If I knew that, I could perhaps manufacture a stable identifier in
userspace by replacing the parent connector ID with a stable connector
designator.


Thanks,
pq
Simon Ser Oct. 24, 2023, 9:03 a.m. UTC | #3
On Tuesday, October 24th, 2023 at 09:36, Pekka Paalanen <ppaalanen@gmail.com> wrote:

> Are DP MST port numbers guaranteed to be tied to the physical hardware
> configuration (e.g. how cables are connected) and therefore stable
> across reboots? What about stable across kernel upgrades?
> 
> If I knew that, I could perhaps manufacture a stable identifier in
> userspace by replacing the parent connector ID with a stable connector
> designator.

Hm, my assumption is that these are stable, but maybe that's also wrong?
Ville, Dmitry, do you know whether the DP MST port numbers are
guaranteed stable across reboots when retaining the exact same hardware
configuration (not the software, maybe the user upgraded the kernel)?
Ville Syrjälä Oct. 24, 2023, 1:03 p.m. UTC | #4
On Tue, Oct 24, 2023 at 09:03:22AM +0000, Simon Ser wrote:
> On Tuesday, October 24th, 2023 at 09:36, Pekka Paalanen <ppaalanen@gmail.com> wrote:
> 
> > Are DP MST port numbers guaranteed to be tied to the physical hardware
> > configuration (e.g. how cables are connected) and therefore stable
> > across reboots? What about stable across kernel upgrades?
> > 
> > If I knew that, I could perhaps manufacture a stable identifier in
> > userspace by replacing the parent connector ID with a stable connector
> > designator.
> 
> Hm, my assumption is that these are stable, but maybe that's also wrong?
> Ville, Dmitry, do you know whether the DP MST port numbers are
> guaranteed stable across reboots when retaining the exact same hardware
> configuration (not the software, maybe the user upgraded the kernel)?

I suspect in practice those should remain the same as long as the
topology didn't change, but I don't think there's anything in the
DP spec that actually guarantees that (eg. some branch device
could in theory reshuffle its port numbers on a whim).

But there is no stable identifier for the corresponding SST
connector anyway so I don't know what you would even do with
stable port numbers.
Pekka Paalanen Oct. 24, 2023, 1:12 p.m. UTC | #5
On Tue, 24 Oct 2023 16:03:27 +0300
Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:

> On Tue, Oct 24, 2023 at 09:03:22AM +0000, Simon Ser wrote:
> > On Tuesday, October 24th, 2023 at 09:36, Pekka Paalanen <ppaalanen@gmail.com> wrote:
> >   
> > > Are DP MST port numbers guaranteed to be tied to the physical hardware
> > > configuration (e.g. how cables are connected) and therefore stable
> > > across reboots? What about stable across kernel upgrades?
> > > 
> > > If I knew that, I could perhaps manufacture a stable identifier in
> > > userspace by replacing the parent connector ID with a stable connector
> > > designator.  
> > 
> > Hm, my assumption is that these are stable, but maybe that's also wrong?
> > Ville, Dmitry, do you know whether the DP MST port numbers are
> > guaranteed stable across reboots when retaining the exact same hardware
> > configuration (not the software, maybe the user upgraded the kernel)?  
> 
> I suspect in practice those should remain the same as long as the
> topology didn't change, but I don't think there's anything in the
> DP spec that actually guarantees that (eg. some branch device
> could in theory reshuffle its port numbers on a whim).
> 
> But there is no stable identifier for the corresponding SST
> connector anyway so I don't know what you would even do with
> stable port numbers.

You mean the index in the array of connectors exposed to userspace is
not stable either for the root DP connector?

KMS device bus path + connector array index for hardwired connectors is
what I've been imagining as stable enough for all end users.


Thanks,
pq
Ville Syrjälä Oct. 24, 2023, 1:37 p.m. UTC | #6
On Tue, Oct 24, 2023 at 04:12:34PM +0300, Pekka Paalanen wrote:
> On Tue, 24 Oct 2023 16:03:27 +0300
> Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> 
> > On Tue, Oct 24, 2023 at 09:03:22AM +0000, Simon Ser wrote:
> > > On Tuesday, October 24th, 2023 at 09:36, Pekka Paalanen <ppaalanen@gmail.com> wrote:
> > >   
> > > > Are DP MST port numbers guaranteed to be tied to the physical hardware
> > > > configuration (e.g. how cables are connected) and therefore stable
> > > > across reboots? What about stable across kernel upgrades?
> > > > 
> > > > If I knew that, I could perhaps manufacture a stable identifier in
> > > > userspace by replacing the parent connector ID with a stable connector
> > > > designator.  
> > > 
> > > Hm, my assumption is that these are stable, but maybe that's also wrong?
> > > Ville, Dmitry, do you know whether the DP MST port numbers are
> > > guaranteed stable across reboots when retaining the exact same hardware
> > > configuration (not the software, maybe the user upgraded the kernel)?  
> > 
> > I suspect in practice those should remain the same as long as the
> > topology didn't change, but I don't think there's anything in the
> > DP spec that actually guarantees that (eg. some branch device
> > could in theory reshuffle its port numbers on a whim).
> > 
> > But there is no stable identifier for the corresponding SST
> > connector anyway so I don't know what you would even do with
> > stable port numbers.
> 
> You mean the index in the array of connectors exposed to userspace is
> not stable either for the root DP connector?

It just depends on the order the driver probes the outputs, which
could change when the code changes (or perhaps even across reboots
with the same kernel due to randomness in deferred probe?).

> 
> KMS device bus path + connector array index for hardwired connectors is
> what I've been imagining as stable enough for all end users.

I once posted a patch to add a path property to all connector
which could give you a more stable identifier. But IIRC the
discussion didn't really end in any kind of useful conclusion.

Seems to be this one:
https://lore.kernel.org/all/20190613184335.7970-1-ville.syrjala@linux.intel.com/
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index c3725086f413..392bec1355a3 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -1198,6 +1198,11 @@  static const u32 dp_colorspaces =
  * 	drm_connector_set_path_property(), in the case of DP MST with the
  * 	path property the MST manager created. Userspace cannot change this
  * 	property.
+ *
+ * 	In the case of DP MST, the property has the format
+ * 	``mst:<parent>-<ports>`` where ``<parent>`` is the KMS object ID of the
+ * 	parent connector and ``<ports>`` is a hyphen-separated list of DP MST
+ * 	port numbers. Note, KMS object IDs are not stable across reboots.
  * TILE:
  * 	Connector tile group property to indicate how a set of DRM connector
  * 	compose together into one logical screen. This is used by both high-res