Re: [PATCH RFC 00/12] Add support for DisplayPort link training information report

Jani Nikula
2026-04-13T13:30:13Z

On Mon, 13 Apr 2026, Kory Maincent <kory.maincent@bootlin.com> wrote:
> On Fri, 10 Apr 2026 00:36:09 +0300
> Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> wrote:
>
>> On Thu, Apr 09, 2026 at 11:36:21PM +0300, Ville Syrjälä wrote:
>> > On Thu, Apr 09, 2026 at 07:08:16PM +0200, Kory Maincent wrote:
>> > > DisplayPort link training negotiates the physical-layer parameters needed
>> > > for a reliable connection: lane count, link rate, voltage swing,
>> > > pre-emphasis, and optionally Display Stream Compression (DSC). Currently,
>> > > each driver exposes this state in its own way, often through
>> > > driver-specific debugfs entries, with no standard interface for userspace
>> > > diagnostic and monitoring tools.
>> > >
>> > > This series introduces a generic, DRM-managed framework for exposing DP
>> > > link training state as standard connector properties, modeled after the
>> > > existing HDMI helper drmm_connector_hdmi_init().
>> > >
>> > > The new drmm_connector_dp_init() helper initializes a DP connector and
>> > > registers the following connector properties to expose the negotiated link
>> > > state to userspace:
>> > >
>> > > - num_lanes: negotiated lane count (1, 2 or 4)
>> > > - link_rate: negotiated link rate
>> > > - dsc_en: whether Display Stream Compression is active
>> > > - voltage_swingN: per-lane voltage swing level (lanes 0-3)
>> > > - pre_emphasisN: per-lane pre-emphasis level (lanes 0-3)
>> >
>> > I don't see why any real userspace would be interested in those (apart
>> > from maybe DSC). If this is just for diagnostics and whatnot then I
>> > think sysfs/debugfs could be a better fit.
>>
>> I'd agree here. Please consider implementing it as a debugfs interface,
>> possibly reusing the Intel's format.
>
> Sorry, I completely forgot to include a paragraph explaining the rationale
> behind using DRM properties.
>
> This DisplayPort link information report was requested by OSes to allow them to
> assess the capabilities of each DisplayPort connector on the system, and to
> guide users from the most to least capable ones. It will also enable the OS to
> warn the user when a cable is too long or experiencing noise (indicated by high
> voltage swing and pre-emphasis levels).

The selection of the number of lanes or link rate are at the discretion
of the driver, or link policy manager in DP spec terms. It does not
really convey the capabilities of the *connectors* but rather the
current *link*. Ditto for enabling DSC.

I don't think the voltage swing and pre-emphasis are really diagnostic
measures either, but a response to measuring and adapting to the
link. And if the link training failed, the driver may have already
reduced the number of lanes and link rate to compensate. So you could
appear to have the perfect link only because it was so bad at high link
rate that it was reduced already.

The policies may also vary from driver to driver, and possibly depending
on what makes sense for the hardware (e.g. power consumption with or
without DSC).

I think "link information report ... requested by OSs" is vague, and I
don't think the concept has been completely thought through. I can't see
how you could present reliable and actionable information to the user
with what the patch at hand provides. Or how it could work in a generic
manner across drivers.

Overall sounds like an XY problem [1]. We should focus on what you're
trying to achieve first, in userspace, and only then think about what
the appropriate kernel mechanism should be.

I don't think this is it.

BR,
Jani.

[1] https://en.wikipedia.org/wiki/XY_problem

>
> Since this is information that OSes will consume on a regular basis, exposing
> it directly as DRM properties seems the most appropriate approach.

--
Jani Nikula, Intel