Re: [igt-dev] [PATCH i-g-t v2] Add Arm drivers as supported drivers by igt.

Petri Latvala
2019-06-20T10:50:25Z

On Thu, Jun 20, 2019 at 10:28:42AM +0100, Liviu Dudau wrote:
> On Thu, Jun 20, 2019 at 11:00:24AM +0300, Petri Latvala wrote:
> > On Wed, Jun 19, 2019 at 04:13:58PM +0100, Liviu Dudau wrote:
> > > Add the drivers maintained by Arm developers to the igt.
> > >
> > > v2: Order the modules array entries alphabetically, as per
> > > Petri Latvala's suggestion.
> > >
> > > Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
> > > ---
> > > lib/drmtest.c | 3 +++
> > > lib/drmtest.h | 4 ++++
> > > 2 files changed, 7 insertions(+)
> > >
> > > diff --git a/lib/drmtest.c b/lib/drmtest.c
> > > index 25f203530..17bb87d1f 100644
> > > --- a/lib/drmtest.c
> > > +++ b/lib/drmtest.c
> > > @@ -205,7 +205,10 @@ static const struct module {
> > > void (*modprobe)(const char *name);
> > > } modules[] = {
> > > { DRIVER_AMDGPU, "amdgpu" },
> > > + { DRIVER_HDLCD, "hdlcd" },
> > > { DRIVER_INTEL, "i915", modprobe_i915 },
> > > + { DRIVER_KOMEDA, "komeda" },
> > > + { DRIVER_MALIDP, "mali_dp" },
> >
>
> Hi Petri,
>
> >
> > Should this be "mali-dp" instead?
> >
>
> insmod/modprobe places some equivalence between dashes and underscores. The
> platform driver structure in the kernel is called "mali-dp", but the module
> is called "mali_dp" (confusing, I know, but at least that is what lsmod shows
> after inserting "mali-dp" module).
>
> Not sure what the correct answer is here, I thought we're using module names.

It's both :P

The string is compared to the driver_name field (or what was the name)
to see if the device is DRIVER_MALIDP, and if the function pointer is
not set, the string is also used for modprobe().

So the string should be the device's driver_name, and the function
pointer set to a function that loads the .ko if the module name is
different.

--
Petri Latvala