[Intel-gfx] [PATCH i-g-t 19/19] i915/gem_exec_balancer: Exercise bonded pairs
Chris Wilson
chris at chris-wilson.co.uk
Mon Mar 11 10:39:52 UTC 2019
Quoting Andi Shyti (2019-03-11 10:30:23)
> Hi again,
>
> I was thinking...
>
> > +static void bonded(int i915, unsigned int flags)
> > +#define CORK 0x1
> > +{
> > + struct class_instance *master_engines;
>
> ... shall we just make 'struct class_instance' generic in the
> uapi? I do not expect every test that uses class and instance to
> define its own structure.
But this test is defining its own struct ;)
> Besides we can avoid a good load of 'offsetof' and make the whole
> thing more readable.
Maybe stop using uAPI structs for library structs -- it's not a good
strategy long term. (We only need the uAPI for interfacing, but for the
library we tend to want other details such as mmio_base, name, etc)
Using offsetof to define the size is reasonably common practice for
variable length arrays (except unless you are paranoid about overflow in
every step of the computation).
-Chris
More information about the Intel-gfx
mailing list