All of lore.kernel.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: [CI 3/5] igt/gem_workarounds: Also test new fd	(implicit default context)
Date: Wed, 04 Oct 2017 16:42:53 +0300	[thread overview]
Message-ID: <877ewb2fmq.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20171003134045.7600-3-chris@chris-wilson.co.uk>

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

> To complete the picture also test a new fd with its implicit default
> context. Now we have a test for a longstanding fd, new client, new
> context.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

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

> ---
>  tests/gem_workarounds.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>
> diff --git a/tests/gem_workarounds.c b/tests/gem_workarounds.c
> index c252133f..1c514a62 100644
> --- a/tests/gem_workarounds.c
> +++ b/tests/gem_workarounds.c
> @@ -164,11 +164,25 @@ static int workaround_fail_count(int fd)
>  	return fail_count;
>  }
>  
> +static int reopen(int fd)
> +{
> +	char path[256];
> +
> +	snprintf(path, sizeof(path), "/proc/self/fd/%d", fd);
> +	fd = open(path, O_RDWR);
> +	igt_assert_lte(0, fd);
> +
> +	return fd;
> +}
> +
>  #define CONTEXT 0x1
> +#define FDS 0x2
>  static void check_workarounds(int fd, enum operation op, unsigned int flags)
>  {
>  	uint32_t ctx = 0;
>  
> +	if (flags & FDS)
> +		fd = reopen(fd);
>  	if (flags & CONTEXT)
>  		ctx = gem_context_create(fd);
>  
> @@ -194,6 +208,8 @@ static void check_workarounds(int fd, enum operation op, unsigned int flags)
>  
>  	if (ctx)
>  		gem_context_destroy(fd, ctx);
> +	if (flags & FDS)
> +		close(fd);
>  }
>  
>  igt_main
> @@ -244,15 +260,24 @@ igt_main
>  	igt_subtest("basic-read-context")
>  		check_workarounds(device, SIMPLE_READ, CONTEXT);
>  
> +	igt_subtest("basic-read-fd")
> +		check_workarounds(device, SIMPLE_READ, FDS);
> +
>  	igt_subtest("reset")
>  		check_workarounds(device, GPU_RESET, 0);
>  
>  	igt_subtest("reset-context")
>  		check_workarounds(device, GPU_RESET, CONTEXT);
>  
> +	igt_subtest("reset-fd")
> +		check_workarounds(device, GPU_RESET, FDS);
> +
>  	igt_subtest("suspend-resume")
>  		check_workarounds(device, SUSPEND_RESUME, 0);
>  
>  	igt_subtest("suspend-resume-context")
>  		check_workarounds(device, SUSPEND_RESUME, CONTEXT);
> +
> +	igt_subtest("suspend-resume-fd")
> +		check_workarounds(device, SUSPEND_RESUME, FDS);
>  }
> -- 
> 2.14.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-10-04 13:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 13:40 [CI 1/5] igt/gem_workarounds: Read the workaround registers from the active context Chris Wilson
2017-10-03 13:40 ` [CI 2/5] igt/gem_workarounds: Also exercise fresh contexts not the persistent default Chris Wilson
2017-10-04 13:13   ` Mika Kuoppala
2017-10-04 13:22     ` Chris Wilson
2017-10-03 13:40 ` [CI 3/5] igt/gem_workarounds: Also test new fd (implicit default context) Chris Wilson
2017-10-04 13:42   ` Mika Kuoppala [this message]
2017-10-03 13:40 ` [CI 4/5] igt/gem_workarounds: Reduce manual list to combinatorial loops Chris Wilson
2017-10-04 13:47   ` Mika Kuoppala
2017-10-03 13:40 ` [CI 5/5] igt/gem_workarounds: Add hibernation coverage Chris Wilson
2017-10-04 13:48   ` Mika Kuoppala
2017-10-03 15:19 ` [CI 1/5] igt/gem_workarounds: Read the workaround registers from the active context Mika Kuoppala
2017-10-03 15:32   ` Chris Wilson
2017-10-04 13:53     ` Mika Kuoppala

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=877ewb2fmq.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.