[Intel-gfx] [PATCH v2 14/38] drm/i915: Simple selftest to exercise live requests

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Wed Feb 1 08:14:28 UTC 2017


On to, 2017-01-19 at 11:41 +0000, Chris Wilson wrote:
> Just create several batches of requests and expect it to not fall over!
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

<SNIP>

> +static int live_nop_request(void *arg)
> +{

<SNIP>

> +		for_each_prime_number_from(prime, 1, 8192) {

#define MAGIC_PRIME_2 8192

> +			times[1] = ktime_get_raw();
> +
> +			for (n = 0; n < prime; n++) {
> +				request = i915_gem_request_alloc(engine,
> +								 i915->kernel_context);
> +				if (IS_ERR(request)) {
> +					err = PTR_ERR(request);
> +					goto out_unlock;
> +				}

Emitting even a single MI_NOOP or making a comment that the request
will contain instructions even if we do nothing here, might help a
newcomer.

> +
> +				i915_add_request(request);
> +			}
> +			i915_wait_request(request,
> +					  I915_WAIT_LOCKED,
> +					  MAX_SCHEDULE_TIMEOUT);
> +
> +			times[1] = ktime_sub(ktime_get_raw(), times[1]);
> +			if (prime == 1)
> +				times[0] = times[1];

Having this as an array is just hiding names and gaining nothing, how
about calling them just time_first, time_last?

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list