[igt-dev] [PATCH i-g-t v2 2/9] lib/intel_compute: Add compatibility flags for running compute

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Fri Sep 8 11:29:12 UTC 2023


On Fri, 8 Sep 2023 11:03:14 +0200
Francois Dugast <francois.dugast at intel.com> wrote:

> On Tue, Sep 05, 2023 at 03:33:02PM +0200, Zbigniew Kempczyński wrote:
> > Allow selectively turn on/off compute tests on both i915 and xe
> > drivers.
> > 
> > Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> > Cc: Christoph Manszewski <christoph.manszewski at intel.com>
> > Cc: Francois Dugast <francois.dugast at intel.com>
> > Cc: Mauro Carvalho Chehab <mchehab at kernel.org>
> > ---
> >  lib/intel_compute.c | 19 ++++++++++++++++++-
> >  1 file changed, 18 insertions(+), 1 deletion(-)
> > 
> > diff --git a/lib/intel_compute.c b/lib/intel_compute.c
> > index 647bce0e43..dd9f686d0c 100644
> > --- a/lib/intel_compute.c
> > +++ b/lib/intel_compute.c
> > @@ -446,17 +446,27 @@ static void tgl_compute_exec(int fd, const unsigned char *kernel,
> >  }
> >  
> >  /*
> > - * Generic code
> > + * Compatibility flags.
> > + *
> > + * There will be some time period in which both drivers (i915 and xe)
> > + * will support compute runtime tests. Lets define compat flags to allow
> > + * the code to be shared between two drivers allowing disabling this in
> > + * the future.
> >   */
> > +#define COMPAT_FLAG(f) (1 << (f))
> > +#define COMPAT_I915 COMPAT_FLAG(INTEL_DRIVER_I915)
> > +#define COMPAT_XE   COMPAT_FLAG(INTEL_DRIVER_XE)  
> 
> This approach allows solving the issue of unsupported combinations of
> platforms and drivers. I cannot think of something better but my concern
> is there could be some confusion if the test is skipped on a platform
> that appears to be supported because it is listed in the compute_batches.
> 
> s/COMPAT_I915/COMPAT_DRIVER_I915/ and s/COMPAT_XE/COMPAT_DRIVER_XE/ can
> help make it not ambiguous.
> 
> It would be good to get ack from someone else on the compat flag
> approach, Mauro maybe?

This approach looks sane to me, as, if we add support for < 12,
this will only be supported by i915 driver. The same will be true
in the future when we add support for newer generations, as it
is unlikely that those will be added for both drivers.

Acked-by: Mauro Carvalho Chehab <mchehab at kernel.org>


More information about the igt-dev mailing list