public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH igt v2 2/5] igt/gem_workarounds: Also exercise fresh contexts not the persistent default
Date: Thu, 05 Oct 2017 11:18:03 +0300	[thread overview]
Message-ID: <87vaju1004.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20171004142514.26818-2-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> v2: Actually exercise the new context
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  tests/gem_workarounds.c | 35 +++++++++++++++++++++++++++--------
>  1 file changed, 27 insertions(+), 8 deletions(-)
>
> diff --git a/tests/gem_workarounds.c b/tests/gem_workarounds.c
> index c669a5cd..234fef0a 100644
> --- a/tests/gem_workarounds.c
> +++ b/tests/gem_workarounds.c
> @@ -87,7 +87,7 @@ static bool write_only(const uint32_t addr)
>  
>  #define MI_STORE_REGISTER_MEM (0x24 << 23)
>  
> -static int workaround_fail_count(int fd)
> +static int workaround_fail_count(int fd, uint32_t ctx)
>  {
>  	struct drm_i915_gem_exec_object2 obj[2];
>  	struct drm_i915_gem_relocation_entry *reloc;
> @@ -131,6 +131,7 @@ static int workaround_fail_count(int fd)
>  	memset(&execbuf, 0, sizeof(execbuf));
>  	execbuf.buffers_ptr = to_user_pointer(obj);
>  	execbuf.buffer_count = 2;
> +	execbuf.rsvd1 = ctx;
>  	gem_execbuf(fd, &execbuf);
>  
>  	gem_set_domain(fd, obj[0].handle, I915_GEM_DOMAIN_CPU, 0);
> @@ -167,9 +168,15 @@ static int workaround_fail_count(int fd)
>  	return fail_count;
>  }
>  
> -static void check_workarounds(int fd, enum operation op)
> +#define CONTEXT 0x1
> +static void check_workarounds(int fd, enum operation op, unsigned int flags)
>  {
> -	igt_assert_eq(workaround_fail_count(fd), 0);
> +	uint32_t ctx = 0;
> +
> +	if (flags & CONTEXT)
> +		ctx = gem_context_create(fd);
> +
> +	igt_assert_eq(workaround_fail_count(fd, ctx), 0);
>  
>  	switch (op) {
>  	case GPU_RESET:
> @@ -181,13 +188,16 @@ static void check_workarounds(int fd, enum operation op)
>  		break;
>  
>  	case SIMPLE_READ:
> -		return;
> +		break;
>  
>  	default:
>  		igt_assert(0);
>  	}
>  
> -	igt_assert_eq(workaround_fail_count(fd), 0);
> +	igt_assert_eq(workaround_fail_count(fd, ctx), 0);
> +
> +	if (ctx)
> +		gem_context_destroy(fd, ctx);
>  }
>  
>  igt_main
> @@ -233,11 +243,20 @@ igt_main
>  	}
>  
>  	igt_subtest("basic-read")
> -		check_workarounds(device, SIMPLE_READ);
> +		check_workarounds(device, SIMPLE_READ, 0);
> +
> +	igt_subtest("basic-read-context")
> +		check_workarounds(device, SIMPLE_READ, CONTEXT);
>  
>  	igt_subtest("reset")
> -		check_workarounds(device, GPU_RESET);
> +		check_workarounds(device, GPU_RESET, 0);
> +
> +	igt_subtest("reset-context")
> +		check_workarounds(device, GPU_RESET, CONTEXT);
>  
>  	igt_subtest("suspend-resume")
> -		check_workarounds(device, SUSPEND_RESUME);
> +		check_workarounds(device, SUSPEND_RESUME, 0);
> +
> +	igt_subtest("suspend-resume-context")
> +		check_workarounds(device, SUSPEND_RESUME, CONTEXT);
>  }
> -- 
> 2.14.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-10-05  8:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04 14:25 [PATCH igt v2 1/5] igt/gem_workarounds: Read the workaround registers from the active context Chris Wilson
2017-10-04 14:25 ` [PATCH igt v2 2/5] igt/gem_workarounds: Also exercise fresh contexts not the persistent default Chris Wilson
2017-10-05  8:18   ` Mika Kuoppala [this message]
2017-10-04 14:25 ` [PATCH igt v2 3/5] igt/gem_workarounds: Also test new fd (implicit default context) Chris Wilson
2017-10-04 14:25 ` [PATCH igt v2 4/5] igt/gem_workarounds: Reduce manual list to combinatorial loops Chris Wilson
2017-10-04 14:25 ` [PATCH igt v2 5/5] igt/gem_workarounds: Add hibernation coverage Chris Wilson
2017-10-04 18:21 ` ✗ Fi.CI.BAT: warning for series starting with [v2,1/5] igt/gem_workarounds: Read the workaround registers from the active context Patchwork
2017-10-05 11:47 ` ✗ Fi.CI.IGT: " Patchwork
2017-10-05 11:57   ` Chris Wilson

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=87vaju1004.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@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