Re: [PATCH] tests/gem_userptr_blits: Expanded userptr test cases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Not your fault, just exposed under recent testing

On Wed, Jan 29, 2014 at 01:30:54PM +0000, Tvrtko Ursulin wrote:
> +int igt_minor_evictions(int fd, struct igt_eviction_test_ops *ops,
> +			int surface_size, int nr_surfaces)
> +{
> +	uint32_t *bo, *sel;
> +	int n, m, pass, fail;
> +
> +	igt_require((uint64_t)nr_surfaces * surface_size / (1024 * 1024)
> +			< intel_get_total_ram_mb() * 9 / 10);
> +
> +	bo = malloc(3*nr_surfaces*sizeof(*bo));
> +	igt_assert(bo);
> +
> +	for (n = 0; n < 2*nr_surfaces; n++)
> +		bo[n] = ops->create(fd, surface_size);
> +
> +	sel = bo + n;
> +	for (fail = 0, m = 0; fail < 10; fail++) {
> +		for (pass = 0; pass < 100; pass++) {
> +			for (n = 0; n < nr_surfaces; n++, m += 7)

The issue I found was that I had a nr_surface that was divisible by 7...

So we can either keep a table of prime numbers (may come in useful
elsewhere) and pick the prime closest to nr_surfaces, or we can just
tweak nr_surfaces not to be divisible by 7...

So something like:

/* Fudge to avoid duplicate bo during execbuffer */
nr_surfaces /= 7;
nr_surfaces *= 7;
nr_surfaces += 1;

should paper over the mistake.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux