Re: [PATCH i-g-t v3 30/31] lib/igt_core: move igt_load_igtrc to igt_device_scan

Kamil Konieczny <[email protected]> Thu, 23 Jul 2026 17:08:23 +0200
Newsgroups org.freedesktop.lists.igt-dev
Message-ID <[email protected]>
Hi Sebastian,
On 2026-07-20 at 13:30:04 +0200, Sebastian Brzezinka wrote:
> Hi Kamil,
> 
> On Thu Jul 16, 2026 at 4:08 PM CEST, Kamil Konieczny wrote:
> > Hi Sebastian,
> > On 2026-07-15 at 14:15:40 +0200, Sebastian Brzezinka wrote:
> >> igt_load_igtrc() is used exclusively by igt_device_scan internals to read
> >> per-device configuration from the igtrc file.  Moving it from igt_core.c
> >> to igt_device_scan.c co-locates the function with its primary user and
> >> makes it possible for lsgpu to link against lib_igt_device_scan without
> >> needing the rest of libigt.
> >> 
> >> Update the declaration accordingly: remove from igt_core.h and add to
> >> igt_device_scan.h where the implementation now lives.
> >> 
> >> Signed-off-by: Sebastian Brzezinka <[email protected]>
> >> Acked-by: Ashutosh Dixit <[email protected]>
> >> ---
> >>  lib/igt_core.c        | 47 ------------------------------------------
> >>  lib/igt_core.h        |  2 --
> >>  lib/igt_device_scan.c | 48 +++++++++++++++++++++++++++++++++++++++++++
> >>  lib/igt_device_scan.h |  2 ++
> >>  runner/executor.c     |  1 +
> >
> > If this is used by igt_runner, maybe more proper solution
> > would be to move it to separate lib/igt_igtrc.[c|h]?
> Somehow, I don't like the idea of a file that holds a single function.
> 

There is already lib/igt_rc.h so just add implementation
to lib/igt_rc.c

Btw I don't like idea of loading .igtrc file in igt_device_scan.c.

Regards,
Kamil

> -- 
> Best regards,
> Sebastian
>