[Intel-gfx] [RFC i-g-t v3] tests/gem_exec_pad_to_size: Test object padding at execbuf

Chris Wilson chris at chris-wilson.co.uk
Wed Apr 1 09:39:54 PDT 2015


On Wed, Apr 01, 2015 at 05:31:16PM +0100, Chris Wilson wrote:
> On Wed, Apr 01, 2015 at 05:07:25PM +0100, Tvrtko Ursulin wrote:
> > 
> > On 04/01/2015 04:42 PM, Chris Wilson wrote:
> > >On Wed, Apr 01, 2015 at 04:14:52PM +0100, Tvrtko Ursulin wrote:
> > >>+	/* Re-exec with padding set. */
> > >>+	igt_assert(exec(fd, eb_handles, pad_to_size, offsets) == 0);
> > >
> > >The crux of the test is that we generate two objects such that
> > >
> > >B_offset = A_offset + A_size
> > >
> > >and then tell the kernel that A is actually 2*size (A_pad_to_size)
> > >
> > >>+	if (offsets[1] > offsets[0])
> > >>+		distance = offsets[1] - offsets[0];
> > >>+	else
> > >>+		distance = offsets[0] - offsets[1];
> > >
> > >The assertion I feel should only be that
> > >
> > >B_offset + B_size <= A_offset && B_offset >= A_offset + A_pad_to_size
> > 
> > I don't get this. B starts after A + padding, but B ends before A?
> 
> s/&&/||/ 

Sorry &&. Gah, must be time for a coffee break.

The assertion is that the objects do not overlap based on the pad_to_size we
expect the kernel to apply, rather than their natural size. If the
kernel doesn't move the objects, they would it would fail.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list