Re: [PATCH i-g-t v7 46/48] lib/unigraf: Add helpers to set maximum link rate

Kory Maincent
2026-02-23T16:14:18Z

On Mon, 23 Feb 2026 13:09:53 +0100
Louis Chauvet <louis.chauvet@bootlin.com> wrote:

> As link rate can vary on a display port link, add a way
> to change advertised link rate from unigraf.
>
> Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
> ---
> lib/unigraf/unigraf.c | 53
> +++++++++++++++++++++++++++++++++++++++++++++++++++ lib/unigraf/unigraf.h |
> 14 ++++++++++++++ 2 files changed, 67 insertions(+)
>
> diff --git a/lib/unigraf/unigraf.c b/lib/unigraf/unigraf.c
> index 038188182bc5..a18a90caad56 100644
> --- a/lib/unigraf/unigraf.c
> +++ b/lib/unigraf/unigraf.c
> @@ -544,6 +544,7 @@ void unigraf_reset(void)
> unigraf_load_default_edid();
> unigraf_hpd_assert();
> unigraf_set_max_lane_count(4);
> + unigraf_set_max_link_rate(UNIGRAF_RATE_8_10_GHZ);
> }
>
> /**
> @@ -832,3 +833,55 @@ int unigraf_get_max_lane_count(void)
> &max_lanes, sizeof(max_lanes)));
> return max_lanes;
> }
> +
> +/**
> + * unigraf_set_max_link_rate() - Set the maximum link rate advertised to the
> DUT
> + * @rate: The maximum link rate to configure on the device. Actual value is
> + * @rate * 270000 kHz. Common values can be found in enum unigraf_rate

There is a parameter name error here.

> + *
> + * This function sets the maximum link rate that the device will advertise
> on the DP link.
> + * The actual link rate used may be less than the requested value if the DUT
> does not
> + * support/use it.
> + */
> +void unigraf_set_max_link_rate(int bandwidth)
> +{
> + unigraf_write_u32(TSI_DPRX_MAX_LINK_RATE, bandwidth);
> +}

--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering