[igt-dev] [PATCH i-g-t v4 07/10] tests/xe_intel_bb: Check if intel-bb Xe support correctness

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Fri Apr 21 18:56:44 UTC 2023


On Fri, Apr 21, 2023 at 08:26:56PM +0200, Zbigniew Kempczyński wrote:

<cut>

> > > +	/* We'll fail on src <-> final compare so just warn */
> > > +	if (tiling == I915_TILING_NONE) {
> > > +		if (compare_bufs(&src, &dst, false) > 0)
> > > +			igt_warn("none->none blit failed!");
> > > +	} else {
> > > +		if (compare_bufs(&src, &dst, false) == 0)
> > > +			igt_warn("none->tiled blit failed!");
> > > +	}
> > 
> > Maybe:
> > 
> > 	if (tiling == I915_TILING_NONE && compare_bufs(&src, &dst, false) > 0)
> > 		igt_warn("none->none blit failed!");
> > 	else if (compare_bufs(&src, &dst, false) == 0)
> > 		igt_warn("none->tiled blit failed!");
> 
> This is not the same. In your case if tiling == NONE and compare() == 0
> we enter second condition and perform compare() one more time as first
> condition failed. I'm not compiler expert so I'm not able to answer
> the question will it handle this situation and evaluate function
> only once.
> 

I've google'd a bit and it seems __attribute__((pure)) might help but
I would try this and verify.

--
Zbigniew



More information about the igt-dev mailing list