[PATCH i-g-t v2 3/5] lib/monitor_edids: Add helper to print all available EDID names

Louis Chauvet louis.chauvet at bootlin.com
Fri Nov 8 22:38:26 UTC 2024


On 31/10/24 - 20:04, Kamil Konieczny wrote:
> Hi Louis,
> On 2024-10-22 at 14:53:12 +0200, Louis Chauvet wrote:
> > During the chamelium v3 configuration, it may be required to know the list
> > of supported EDID names, so add an helper to print them.
> > 
> > Signed-off-by: Louis Chauvet <louis.chauvet at bootlin.com>
> > ---
> >  lib/monitor_edids/monitor_edids_helper.c | 10 ++++++++++
> >  lib/monitor_edids/monitor_edids_helper.h |  2 ++
> >  2 files changed, 12 insertions(+)
> > 
> > diff --git a/lib/monitor_edids/monitor_edids_helper.c b/lib/monitor_edids/monitor_edids_helper.c
> > index 0f92ced64d06..ca2f5006eada 100644
> > --- a/lib/monitor_edids/monitor_edids_helper.c
> > +++ b/lib/monitor_edids/monitor_edids_helper.c
> > @@ -170,3 +170,13 @@ struct edid *get_edid_by_name(char *name)
> >  	}
> >  	return NULL;
> >  }
> > +
> 
> Add description.
> 
> > +void list_edid_names(enum igt_log_level level)
> > +{
> > +	for (int i = 0; i < ARRAY_SIZE(ALL_EDIDS); i++) {
> > +		for (int j = 0; j < ALL_EDIDS[i].list_size; j++) {
> > +			igt_log(IGT_LOG_DOMAIN, level, " - \"%s\"\n",
> > +				ALL_EDIDS[i].edid_list[j].name);
> > +		}
> > +	}
> > +}
> > diff --git a/lib/monitor_edids/monitor_edids_helper.h b/lib/monitor_edids/monitor_edids_helper.h
> > index cd0e5a7b2645..50b08530826a 100644
> > --- a/lib/monitor_edids/monitor_edids_helper.h
> > +++ b/lib/monitor_edids/monitor_edids_helper.h
> > @@ -15,6 +15,7 @@
> >  #include <stddef.h>
> >  #include <stdbool.h>
> >  
> > +#include "igt_core.h"
> 
> And now it returns... Why not make this a first patch?

Because I did some cleanup on the first patch to avoid useless dependency, 
but now I need igt_log_level and igt_log... You are right, I will not 
remove it on the first patch.

> >  #include "igt_chamelium.h"
> >  
> >  /* Max Length can be increased as needed, when new EDIDs are added. */
> > @@ -35,5 +36,6 @@ void free_chamelium_edid_from_monitor_edid(struct chamelium_edid *edid);
> >  struct edid *edid_from_monitor_edid(const monitor_edid *monitor_edid);
> >  struct monitor_edid *get_edids_for_connector_type(uint32_t type, size_t *count, bool four_k);
> >  struct edid *get_edid_by_name(char *name);
> > +void list_edid_names(enum igt_log_level level);
> >  
> >  #endif /* TESTS_CHAMELIUM_MONITOR_EDIDS_MONITOR_EDIDS_HELPER_H_ */
> > \ No newline at end of file
> 
> Add newline.
> 
> Regards,
> Kamil
> > 
> > -- 
> > 2.46.2
> > 


More information about the igt-dev mailing list