All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: <sai.gowtham.ch@intel.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t 3/3] tests/intel/xe_pm: Tests vm-unbind all flag functionality with S&R
Date: Tue, 16 Apr 2024 16:58:34 -0400	[thread overview]
Message-ID: <Zh7meoKXHlocCgtx@intel.com> (raw)
In-Reply-To: <20240415084035.2603-4-sai.gowtham.ch@intel.com>

On Mon, Apr 15, 2024 at 02:10:35PM +0530, sai.gowtham.ch@intel.com wrote:
> From: Sai Gowtham Ch <sai.gowtham.ch@intel.com>
> 
> Test validates vm unbind all flag functionality with suspend and resume.
> 
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Sai Gowtham Ch <sai.gowtham.ch@intel.com>
> ---
>  tests/intel/xe_pm.c | 22 ++++++++++++++++------
>  1 file changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/intel/xe_pm.c b/tests/intel/xe_pm.c
> index 8857265a9..0598bd4c4 100644
> --- a/tests/intel/xe_pm.c
> +++ b/tests/intel/xe_pm.c
> @@ -35,6 +35,7 @@
>  
>  #define USERPTR (0x1 << 0)
>  #define PREFETCH (0x1 << 2)
> +#define UNBIND_ALL (0x1 << 3)

adjust this and feel free to use:

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>


>  
>  typedef struct {
>  	int fd_xe;
> @@ -219,6 +220,7 @@ static void close_fw_handle(int sig)
>  	close(fw_handle);
>  }
>  
> +#define MAX_VMAS 2
>  /**
>   * SUBTEST: %s-basic
>   * Description: set GPU state to %arg[1] and test suspend/autoresume
> @@ -291,6 +293,7 @@ static void close_fw_handle(int sig)
>   *
>   * @usrptr:	usrptr
>   * @prefetch:	prefetch
> + * @unbind-all: unbind-all
>   */
>  static void
>  test_exec(device_t device, struct drm_xe_engine_class_instance *eci,
> @@ -308,6 +311,7 @@ test_exec(device_t device, struct drm_xe_engine_class_instance *eci,
>  		.num_syncs = 2,
>  		.syncs = to_user_pointer(sync),
>  	};
> +	int n_vmas = flags & UNBIND_ALL ? MAX_VMAS : 1;
>  	uint32_t exec_queues[MAX_N_EXEC_QUEUES];
>  	uint32_t bind_exec_queues[MAX_N_EXEC_QUEUES];
>  	uint32_t syncobjs[MAX_N_EXEC_QUEUES];
> @@ -363,12 +367,14 @@ test_exec(device_t device, struct drm_xe_engine_class_instance *eci,
>  
>  	sync[0].handle = syncobj_create(device.fd_xe, 0);
>  
> -	if (bo)
> -		xe_vm_bind_async(device.fd_xe, vm, bind_exec_queues[0], bo, 0, addr,
> -				 bo_size, sync, 1);
> -	else
> +	if (bo) {
> +		for (i = 0; i < n_vmas; i++)
> +			xe_vm_bind_async(device.fd_xe, vm, bind_exec_queues[0], bo, 0,
> +					 addr + i * bo_size, bo_size, sync, 1);
> +	} else {
>  		xe_vm_bind_userptr_async(device.fd_xe, vm, bind_exec_queues[0],
>  					 to_user_pointer(data), addr, bo_size, sync, 1);
> +	}
>  
>  	if (flags & PREFETCH)
>  		xe_vm_prefetch_async(device.fd_xe, vm, bind_exec_queues[0], 0, addr,
> @@ -420,8 +426,11 @@ test_exec(device_t device, struct drm_xe_engine_class_instance *eci,
>  		rpm_usage = igt_pm_get_runtime_usage(device.pci_xe);
>  
>  	sync[0].flags |= DRM_XE_SYNC_FLAG_SIGNAL;
> -	xe_vm_unbind_async(device.fd_xe, vm, bind_exec_queues[0], 0, addr,
> -			   bo_size, sync, 1);
> +	if (n_vmas > 1)
> +		xe_vm_unbind_all_async(device.fd_xe, vm, 0, bo, sync, 1);
> +	else
> +		xe_vm_unbind_async(device.fd_xe, vm, bind_exec_queues[0], 0, addr,
> +				   bo_size, sync, 1);
>  	igt_assert(syncobj_wait(device.fd_xe, &sync[0].handle, 1, INT64_MAX, 0,
>  NULL));
>  
> @@ -630,6 +639,7 @@ igt_main
>  	} vm_op[] = {
>  		{ "usrptr", USERPTR },
>  		{ "prefetch", PREFETCH },
> +		{ "unbind-all", UNBIND_ALL },
>  		{ NULL },
>  	};
>  
> -- 
> 2.39.1
> 

  reply	other threads:[~2024-04-16 20:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15  8:40 [PATCH i-g-t 0/3] tests/intel/xe_pm: Tests to validate vm-bind with S&R sai.gowtham.ch
2024-04-15  8:40 ` [PATCH i-g-t 1/3] tests/intel/xe_pm: Test validates vm-bind userptr flag with suspend and resume sai.gowtham.ch
2024-04-16  1:22   ` Rodrigo Vivi
2024-04-15  8:40 ` [PATCH i-g-t 2/3] tests/intel/xe_pm: Validate vm-bind prefetch " sai.gowtham.ch
2024-04-16  1:29   ` Rodrigo Vivi
2024-04-16 20:58     ` Rodrigo Vivi
2024-04-15  8:40 ` [PATCH i-g-t 3/3] tests/intel/xe_pm: Tests vm-unbind all flag functionality with S&R sai.gowtham.ch
2024-04-16 20:58   ` Rodrigo Vivi [this message]
2024-04-16  6:37 ` ✓ CI.xeBAT: success for tests/intel/xe_pm: Tests to validate vm-bind with S&R (rev2) Patchwork
2024-04-16  6:46 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-04-19 14:20   ` Kamil Konieczny
2024-04-17  1:24 ` ✗ CI.xeFULL: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-04-01 18:46 [PATCH i-g-t 0/3] tests/intel/xe_pm: Tests to validate vm-bind with S&R sai.gowtham.ch
2024-04-01 18:46 ` [PATCH i-g-t 3/3] tests/intel/xe_pm: Tests vm-unbind all flag functionality " sai.gowtham.ch
2024-04-03 20:28   ` Rodrigo Vivi
2024-03-25 20:10 [PATCH i-g-t 0/3] tests/intel/xe_pm: Tests to validate vm-bind sai.gowtham.ch
2024-03-25 20:10 ` [PATCH i-g-t 3/3] tests/intel/xe_pm: Tests vm-unbind all flag functionality with s&R sai.gowtham.ch
2024-03-28 18:16   ` Rodrigo Vivi

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=Zh7meoKXHlocCgtx@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=sai.gowtham.ch@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 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.