Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Bernatowicz, Marcin" <marcin.bernatowicz@linux.intel.com>
To: Lukasz Laguna <lukasz.laguna@intel.com>, igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v2 1/2] lib/xe/xe_ioctl: add __xe_exec_sync() helper
Date: Wed, 13 Dec 2023 13:00:45 +0100	[thread overview]
Message-ID: <84082d79-28fd-46f8-aa94-315f61c393c5@linux.intel.com> (raw)
In-Reply-To: <20231212174816.5292-2-lukasz.laguna@intel.com>

Hi,

On 12/12/2023 6:48 PM, Lukasz Laguna wrote:
> Add non-asserting variant of xe_exec_sync().
> 
> Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
> ---
>   lib/xe/xe_ioctl.c | 12 +++++++++---
>   lib/xe/xe_ioctl.h |  2 ++
>   2 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/xe/xe_ioctl.c b/lib/xe/xe_ioctl.c
> index cdad3d7e2..b5cd3ae35 100644
> --- a/lib/xe/xe_ioctl.c
> +++ b/lib/xe/xe_ioctl.c
> @@ -448,8 +448,8 @@ void xe_exec(int fd, struct drm_xe_exec *exec)
>   	igt_assert_eq(__xe_exec(fd, exec), 0);
>   }
>   
> -void xe_exec_sync(int fd, uint32_t exec_queue, uint64_t addr,
> -		  struct drm_xe_sync *sync, uint32_t num_syncs)
> +int __xe_exec_sync(int fd, uint32_t exec_queue, uint64_t addr,
> +		   struct drm_xe_sync *sync, uint32_t num_syncs)
>   {
>   	struct drm_xe_exec exec = {
>   		.exec_queue_id = exec_queue,
> @@ -459,7 +459,13 @@ void xe_exec_sync(int fd, uint32_t exec_queue, uint64_t addr,
>   		.num_batch_buffer = 1,
>   	};
>   
> -	igt_assert_eq(__xe_exec(fd, &exec), 0);
> +	return __xe_exec(fd, &exec);
> +}
> +
> +void xe_exec_sync(int fd, uint32_t exec_queue, uint64_t addr,
> +		    struct drm_xe_sync *sync, uint32_t num_syncs)
> +{
> +	igt_assert_eq(__xe_exec_sync(fd, exec_queue, addr, sync, num_syncs), 0);
>   }

To be honest, I'm a bit confused with the xe_exec_sync naming.

sync typically refers to synchronous operations, which are operations 
that block further execution until they have finished, so I would
actually expect the xe_exec_wait behavior.

>   
>   void xe_exec_wait(int fd, uint32_t exec_queue, uint64_t addr)
> diff --git a/lib/xe/xe_ioctl.h b/lib/xe/xe_ioctl.h
> index c8d46fb29..3679ce66b 100644
> --- a/lib/xe/xe_ioctl.h
> +++ b/lib/xe/xe_ioctl.h
> @@ -88,6 +88,8 @@ void *xe_bo_map(int fd, uint32_t bo, size_t size);
>   void *xe_bo_mmap_ext(int fd, uint32_t bo, size_t size, int prot);
>   int __xe_exec(int fd, struct drm_xe_exec *exec);
>   void xe_exec(int fd, struct drm_xe_exec *exec);
> +int __xe_exec_sync(int fd, uint32_t exec_queue, uint64_t addr,
> +		   struct drm_xe_sync *sync, uint32_t num_syncs);
>   void xe_exec_sync(int fd, uint32_t exec_queue, uint64_t addr,
>   		  struct drm_xe_sync *sync, uint32_t num_syncs);
>   void xe_exec_wait(int fd, uint32_t exec_queue, uint64_t addr);

  reply	other threads:[~2023-12-13 12:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 17:48 [PATCH i-g-t v2 0/2] Add create-contexts subtest Lukasz Laguna
2023-12-12 17:48 ` [PATCH i-g-t v2 1/2] lib/xe/xe_ioctl: add __xe_exec_sync() helper Lukasz Laguna
2023-12-13 12:00   ` Bernatowicz, Marcin [this message]
2023-12-12 17:48 ` [PATCH i-g-t v2 2/2] tests/intel/xe_create: create-contexts subtest Lukasz Laguna
2023-12-12 19:15 ` ✗ Fi.CI.BAT: failure for Add " Patchwork
2023-12-12 20:26 ` ✓ CI.xeBAT: success " Patchwork

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=84082d79-28fd-46f8-aa94-315f61c393c5@linux.intel.com \
    --to=marcin.bernatowicz@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lukasz.laguna@intel.com \
    /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