public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915: Live testing for context execution
Date: Mon, 13 Feb 2017 16:20:41 +0200	[thread overview]
Message-ID: <1486995641.3223.36.camel@linux.intel.com> (raw)
In-Reply-To: <20170213120655.23590-2-chris@chris-wilson.co.uk>

On ma, 2017-02-13 at 12:06 +0000, Chris Wilson wrote:
> Check we can create and execution within a context.
> 
> v2: Write one set of dwords through each context/engine to exercise more
> contexts within the same time period.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

<SNIP>

> +static struct i915_vma *
> +gpu_fill_dw(struct i915_vma *vma, u64 offset, unsigned long count, u32 value)
> +{
> +	struct drm_i915_gem_object *obj;
> +	const int gen = INTEL_GEN(vma->vm->i915);
> +	unsigned long n;
> +	u32 *cmd;
> +	int err;
> +
> +	GEM_BUG_ON(!igt_can_mi_store_dword_imm(vma->vm->i915));
> +
> +	n = (4*count + 1)*sizeof(u32);
> +	obj = i915_gem_object_create_internal(vma->vm->i915,
> +					      round_up(n, PAGE_SIZE));

Reuse of variable "n" purpose later.

> +static int cpu_check(struct drm_i915_gem_object *obj, unsigned int max)
> +{
> +	unsigned int n, m, needs_flush;
> +	int err;
> +
> +	err = i915_gem_obj_prepare_shmem_read(obj, &needs_flush);
> +	if (err)
> +		return err;
> +
> +	for (n = 0; !err && n < real_page_count(obj); n++) {
> +		u32 *map;
> +
> +		map = kmap_atomic(i915_gem_object_get_page(obj, n));
> +		if (needs_flush & CLFLUSH_BEFORE)
> +			drm_clflush_virt_range(map, PAGE_SIZE);
> +
> +		for (m = 0; !err && m < max; m++) {
> +			if (map[m] != m) {
> +				pr_err("Invalid value at page %d, offset %d: found %x expected %x\n",
> +				       n, m, map[m], m);
> +				err = -EINVAL;
> +			}
> +		}

Use breaks or gotos to avoid cluttering the loop conditions.

<SNIP>

> +				pr_err("Failed to fill dword %lu [%lu/%lu] with gpu (%s) in ctx %u [full-ppgtt? %d], err=%d\n",
> +				       ndwords, dw, max_dwords(obj),
> +				       engine->name, ctx->hw_id, !!ctx->ppgtt,

yesno(!!ctx->ppgtt)

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

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-02-13 14:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13 12:06 Some unreviewed selftests Chris Wilson
2017-02-13 12:06 ` [PATCH 1/3] drm/i915: Live testing for context execution Chris Wilson
2017-02-13 14:20   ` Joonas Lahtinen [this message]
2017-02-13 12:06 ` [PATCH 2/3] drm/i915: Extract aliasing ppgtt setup Chris Wilson
2017-02-13 12:06 ` [PATCH 3/3] drm/i915: Force an aliasing_ppgtt test for context execution Chris Wilson
2017-02-13 13:06   ` Joonas Lahtinen
2017-02-13 12:10 ` [PATCH] drm/i915: Add unit tests for the breadcrumb rbtree, wakeups Chris Wilson
2017-02-13 14:39   ` Tvrtko Ursulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486995641.3223.36.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox