Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: daniele.ceraolospurio@intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t] tests/gem_exec_params: test all valid execution flags
Date: Wed, 10 Feb 2016 09:16:44 +0100	[thread overview]
Message-ID: <20160210081644.GO11240@phenom.ffwll.local> (raw)
In-Reply-To: <1454336677-34165-1-git-send-email-daniele.ceraolospurio@intel.com>

On Mon, Feb 01, 2016 at 02:24:37PM +0000, daniele.ceraolospurio@intel.com wrote:
> From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> 
> The control subtest has been extended to check the execution flags for
> all the rings that are present in the HW.
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

Applied, thanks.
-Daniel

> ---
>  tests/gem_exec_params.c | 39 ++++++++++++++++++++++++++++++++-------
>  1 file changed, 32 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/gem_exec_params.c b/tests/gem_exec_params.c
> index 06dfd63..e192150 100644
> --- a/tests/gem_exec_params.c
> +++ b/tests/gem_exec_params.c
> @@ -46,6 +46,30 @@
>  #define LOCAL_I915_EXEC_BSD_RING2 (2<<13)
>  #define LOCAL_I915_EXEC_RESOURCE_STREAMER (1<<15)
>  
> +static bool has_ring(int fd, unsigned ring_exec_flags)
> +{
> +	switch (ring_exec_flags & I915_EXEC_RING_MASK) {
> +	case 0:
> +	case I915_EXEC_RENDER:
> +		return true;
> +
> +	case I915_EXEC_BSD:
> +		if (ring_exec_flags & LOCAL_I915_EXEC_BSD_MASK)
> +			return gem_has_bsd2(fd);
> +		else
> +			return gem_has_bsd(fd);
> +
> +	case I915_EXEC_BLT:
> +		return gem_has_blt(fd);
> +
> +	case I915_EXEC_VEBOX:
> +		return gem_has_vebox(fd);
> +	}
> +
> +	igt_assert_f(0, "invalid exec flag 0x%x\n", ring_exec_flags);
> +	return false;
> +}
> +
>  struct drm_i915_gem_execbuffer2 execbuf;
>  struct drm_i915_gem_exec_object2 gem_exec[1];
>  uint32_t batch[2] = {MI_BATCH_BUFFER_END};
> @@ -54,6 +78,8 @@ int fd;
>  
>  igt_main
>  {
> +	const struct intel_execution_engine *e;
> +
>  	igt_fixture {
>  		fd = drm_open_driver(DRIVER_INTEL);
>  
> @@ -85,13 +111,12 @@ igt_main
>  	}
>  
>  	igt_subtest("control") {
> -		igt_assert(drmIoctl(fd,
> -				    DRM_IOCTL_I915_GEM_EXECBUFFER2,
> -				    &execbuf) == 0);
> -		execbuf.flags = I915_EXEC_RENDER;
> -		igt_assert(drmIoctl(fd,
> -				    DRM_IOCTL_I915_GEM_EXECBUFFER2,
> -				    &execbuf) == 0);
> +		for (e = intel_execution_engines; e->name; e++) {
> +			if (has_ring(fd, e->exec_id | e->flags)) {
> +				execbuf.flags = e->exec_id | e->flags;
> +				gem_execbuf(fd, &execbuf);
> +			}
> +		}
>  	}
>  
>  #define RUN_FAIL(expected_errno) do { \
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2016-02-10  8:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29  9:21 [PATCH i-g-t] tests/gem_exec_basic: don't use gem_require_ring to check ring availability daniele.ceraolospurio
2016-01-29 10:58 ` Chris Wilson
2016-01-29 11:16   ` Daniele Ceraolo Spurio
2016-01-29 11:35     ` Chris Wilson
2016-01-29 11:58       ` Daniele Ceraolo Spurio
2016-01-29 12:11         ` Chris Wilson
2016-02-01 14:24 ` [PATCH i-g-t] tests/gem_exec_params: test all valid execution flags daniele.ceraolospurio
2016-02-10  8:16   ` Daniel Vetter [this message]

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=20160210081644.GO11240@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniele.ceraolospurio@intel.com \
    --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