Re: [PATCH i-g-t v7 29/48] lib/unigraf: Add connector and EDID configuration

Kory Maincent
2026-02-23T15:03:11Z

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

> As multiple connectors can be present on the DUT, add a configuration to
> tell which connector is used by the Unigraf and which EDID to use on the
> Unigraf.
>
> Complete list of EDID name supported can be found in
> lib/monitor_edids/{dp,hdmi}_edids.h
>
> The configuration will look like:
>
> [Unigraf]
> Device=UCD-500 [2434C620]
> Role=DisplayPort Source and Sink
> Input=DP RX
> Connector=DP-4
> EDID=DEL_16543_DELL_P2314T_DP
>
> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
> ---
> lib/unigraf/unigraf.c | 125
> +++++++++++++++++++++++++++++++++++++++++++++++++- lib/unigraf/unigraf.h |
> 3 ++ 2 files changed, 126 insertions(+), 2 deletions(-)
>
> diff --git a/lib/unigraf/unigraf.c b/lib/unigraf/unigraf.c
> index 796848dd8fc7..549196bb90bd 100644
> --- a/lib/unigraf/unigraf.c
> +++ b/lib/unigraf/unigraf.c
> @@ -13,7 +13,10 @@
> #include "unigraf.h"
> #include "TSI_types.h"
> #include "TSI.h"
> +#include "igt_edid.h"
> +#include "igt_kms.h"
> #include "igt_rc.h"
> +#include "monitor_edids/monitor_edids_helper.h"
>
> #define unigraf_debug(fmt, ...) igt_debug("TSI:%p: " fmt,
> unigraf_device, ##__VA_ARGS__)
> @@ -46,6 +49,16 @@ static char *unigraf_connector_name;
> */
> #define UNIGRAF_CONFIG_INPUT_NAME "Input"
>
> +/**
> + * UNIGRAF_CONFIG_CONNECTOR_NAME - Key of the connector name in the
> configuration file
> + */
> +#define UNIGRAF_CONFIG_CONNECTOR_NAME "Connector"
> +
> +/**
> + * UNIGRAF_CONFIG_EDID_NAME - Key of the EDID name in the configuration file
> + */
> +#define UNIGRAF_CONFIG_EDID_NAME "EDID"
> +
> /**
> * UNIGRAF_DEFAULT_ROLE_NAME - Default role name to search on the unigraf
> device */
> @@ -200,6 +213,82 @@ static int unigraf_find_input(const char *request)
> return -ENODEV;
> }
>
> +static void unigraf_load_default_edid(void)
> +{
> + struct edid *edid = get_edid_by_name(unigraf_default_edid);
> +
> + if (edid) {
> + for (int i = unigraf_get_mst_stream_max_count(); i > 0; i--)
> + unigraf_write_edid(i - 1, edid, edid_get_size(edid));
> + } else {
> + igt_warn("Impossible to find an edid named \"%s\"",
> unigraf_default_edid);
> + list_edid_names(IGT_LOG_WARN);
> + }

I am nitpicking but separating the check from the action improve code clarity:

if (!edid){
igt_warn("Impossible to find an edid named \"%s\"",
unigraf_default_edid); list_edid_names(IGT_LOG_WARN);
return;
}

for(...)

With this fixed:
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>

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