Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Antonio Argenziano <antonio.argenziano@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 2/3] igt/gem_blits: Check for blitter support before use
Date: Thu, 17 May 2018 10:58:14 -0700	[thread overview]
Message-ID: <5d88ee1d-4fdf-8f05-03bc-169c32f05cb6@intel.com> (raw)
In-Reply-To: <20180517082330.32760-2-chris@chris-wilson.co.uk>



On 17/05/18 01:23, Chris Wilson wrote:
> Not all HW supports XY blitter commands, so check before use.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   lib/i915/gem_submission.c     | 16 ++++++++++++++++
>   lib/i915/gem_submission.h     |  3 +++
>   tests/gem_linear_blits.c      |  1 +
>   tests/gem_tiled_blits.c       |  1 +
>   tests/gem_tiled_fence_blits.c |  1 +
>   5 files changed, 22 insertions(+)
> 
> diff --git a/lib/i915/gem_submission.c b/lib/i915/gem_submission.c
> index 2fd460d5e..1d1adcf6f 100644
> --- a/lib/i915/gem_submission.c
> +++ b/lib/i915/gem_submission.c
> @@ -229,3 +229,19 @@ void gem_test_engine(int i915, unsigned int engine)
>   	igt_assert(!is_wedged(i915));
>   	close(i915);
>   }
> +
> +bool gem_has_blitter(int i915)
> +{
> +	unsigned int blt;
> +
> +	blt = 0;
> +	if (intel_gen(intel_get_drm_devid(i915)) >= 6)

Looks like we have a "HAS_BLT_RING" macro we use in other places. Also, 
we have a gem_has_blt() function which is slightly different. Which is 
making things quite confusing for me... I wish I had a better name but I 
think we should add at least a comment to differentiate the two.

With that:
Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>

Thanks,
Antonio

> +		blt = I915_EXEC_BLT; > +
> +	return gem_has_ring(i915, blt);
> +}
> +
> +void gem_require_blitter(int i915)
> +{
> +	igt_require(gem_has_blitter(i915));
> +}
> diff --git a/lib/i915/gem_submission.h b/lib/i915/gem_submission.h
> index f94eabb20..f2b18d9dc 100644
> --- a/lib/i915/gem_submission.h
> +++ b/lib/i915/gem_submission.h
> @@ -33,6 +33,9 @@ bool gem_has_semaphores(int fd);
>   bool gem_has_execlists(int fd);
>   bool gem_has_guc_submission(int fd);
>   
> +bool gem_has_blitter(int i915);
> +void gem_require_blitter(int i915);
> +
>   void gem_test_engine(int fd, unsigned int engine);
>   
>   int gem_reopen_driver(int fd);
> diff --git a/tests/gem_linear_blits.c b/tests/gem_linear_blits.c
> index 8297416c0..7d05fa865 100644
> --- a/tests/gem_linear_blits.c
> +++ b/tests/gem_linear_blits.c
> @@ -226,6 +226,7 @@ int main(int argc, char **argv)
>   	igt_fixture {
>   		fd = drm_open_driver(DRIVER_INTEL);
>   		igt_require_gem(fd);
> +		gem_require_blitter(fd);
>   	}
>   
>   	igt_subtest("basic")
> diff --git a/tests/gem_tiled_blits.c b/tests/gem_tiled_blits.c
> index a81226a15..0d472e3a1 100644
> --- a/tests/gem_tiled_blits.c
> +++ b/tests/gem_tiled_blits.c
> @@ -203,6 +203,7 @@ int main(int argc, char **argv)
>   	igt_fixture {
>   		fd = drm_open_driver(DRIVER_INTEL);
>   		igt_require_gem(fd);
> +		gem_require_blitter(fd);
>   
>   		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
>   		drm_intel_bufmgr_gem_enable_reuse(bufmgr);
> diff --git a/tests/gem_tiled_fence_blits.c b/tests/gem_tiled_fence_blits.c
> index 693e96cec..9ab58b5d6 100644
> --- a/tests/gem_tiled_fence_blits.c
> +++ b/tests/gem_tiled_fence_blits.c
> @@ -176,6 +176,7 @@ igt_main
>   	igt_fixture {
>   		fd = drm_open_driver(DRIVER_INTEL);
>   		igt_require_gem(fd);
> +		gem_require_blitter(fd);
>   	}
>   
>   	igt_subtest("basic") {
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-05-17 17:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17  8:23 [PATCH i-g-t 1/3] igt/gem_cpu_reloc: Check HW exists before attempting to use it Chris Wilson
2018-05-17  8:23 ` [PATCH i-g-t 2/3] igt/gem_blits: Check for blitter support before use Chris Wilson
2018-05-17 17:58   ` Antonio Argenziano [this message]
2018-05-17  8:23 ` [PATCH i-g-t 3/3] igt/kms_frontbuffer_tracking: Skip over IGT_DRAW_BLT when there's no BLT Chris Wilson
2018-05-17  9:56   ` [PATCH i-g-t] " Chris Wilson
2018-05-17 23:16     ` Antonio Argenziano
2018-05-17  9:28 ` ✗ Fi.CI.BAT: failure for series starting with [1/3] igt/gem_cpu_reloc: Check HW exists before attempting to use it Patchwork
2018-05-17 10:38 ` ✓ Fi.CI.BAT: success for series starting with [1/3] igt/gem_cpu_reloc: Check HW exists before attempting to use it (rev2) Patchwork
2018-05-17 13:43 ` ✓ Fi.CI.IGT: " Patchwork
2018-05-17 15:08 ` [PATCH i-g-t 1/3] igt/gem_cpu_reloc: Check HW exists before attempting to use it Antonio Argenziano
2018-05-17 15:37   ` Chris Wilson
2018-05-17 16:29     ` Antonio Argenziano
2018-05-17 16:52       ` Chris Wilson
2018-05-17 17:01         ` Antonio Argenziano

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=5d88ee1d-4fdf-8f05-03bc-169c32f05cb6@intel.com \
    --to=antonio.argenziano@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