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

Chris Wilson chris at chris-wilson.co.uk
Thu Apr 2 04:02:25 PDT 2015


On Thu, Apr 02, 2015 at 11:45:59AM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> This tests the new EXEC_OBJECT_PAD_TO_SIZE exec_object2 flag.
> 
> Similar to some other tests, it uses knowledge of the DRM
> allocation policy in order to get two objects mapped adjacent
> to each other. It is then possible to verify that the pad to
> size flag will move them apart.
> 
> v2: Correct commit message. (Chris Wilson)
> v3: Changes after code review by Chris Wilson.
>      * No need for gem_sync after execbuf.
>      * Drop caches before running.
>      * Allocate one additional bo per iteration.
>      * Don't explicitly set unused execbuf fields to zero.
>      * One improved comment.
> v4: Require simpler object ordering and fixed overlap test. (Chris Wilson)
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>

Thanks, that reads really well.
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

Hah, just thought of one minor tweak I would do though:

		if ((offsets[1] - offsets[0]) == PAGE_SIZE) {
			neighbours = true;
			break;
		}
		....
	}

	/* Otherwise test can't confidently run. */
	if (neighbours) {
		/* Check the object don't move by themselves */
		igt_assert(exec(fd, eb_handles, pad_to_size, offsets) == 0);
		igt_assert(offsets[1] - offset[0] == PAGE_SIZE);

		/* Then re-exec with padding set, and now they should move. */
		pad_to_size[0] = 2*PAGE_SIZE;
		igt_assert(exec(fd, eb_handles, pad_to_size, offsets) == 0);

		/* Check that objects with padding do not overlap. */
		igt_assert(offsets[0] >= offsets[1] + PAGE_SIZE ||
			   offsets[0] + 2 * PAGE_SIZE <= offsets[1]);
	}

-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list