[igt-dev] [PATCH i-g-t 24/25] gem_wsim: Discover engines

Andi Shyti andi.shyti at intel.com
Fri May 17 13:02:21 UTC 2019


> > > +static void query_engines(void)
> > > +{
> > > +	struct i915_engine_class_instance *engines;
> > > +	unsigned int num;
> > > +
> > > +	if (__engines_queried)
> > > +		return;
> > > +
> > > +	__engines_queried = true;
> > > +
> > > +	if (!has_query(fd) || !has_engine_query(fd)) {

[...]

> > > +		unsigned int num_bsd = gem_has_bsd(fd) + gem_has_bsd2(fd);
> > > +		unsigned int i = 0;
> > > +
> > > +		igt_assert(num);
> > > +
> > > +		num = 1 + num_bsd;
> > 
> > did you mean the above two lines swapped?
> 
> No, I want to avoid running on platforms with no vcs engines since no one
> ever tested gem_wsim there.

but you are asserting on 'num' while num is not initialized.

so that I guess it should first be

	num = 1 + num_bsd;

and then

	igt_assert(num);

right?

Andi


More information about the igt-dev mailing list