[PATCH i-g-t v3 3/4] tests/intel/xe_exec_atomic: Use new vm bind flag

Kumar, Janga Rahul janga.rahul.kumar at intel.com
Tue Apr 16 09:39:05 UTC 2024



> -----Original Message-----
> From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Nirmoy
> Das
> Sent: Monday, April 15, 2024 8:05 PM
> To: igt-dev at lists.freedesktop.org
> Cc: Das, Nirmoy <nirmoy.das at intel.com>
> Subject: [PATCH i-g-t v3 3/4] tests/intel/xe_exec_atomic: Use new vm bind flag
> 
> Use new vm bind flag to probe device atomics support.
> 
> Signed-off-by: Nirmoy Das <nirmoy.das at intel.com>
> ---
>  tests/intel/xe_exec_atomic.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/intel/xe_exec_atomic.c b/tests/intel/xe_exec_atomic.c index
> d9790da78..458539335 100644
> --- a/tests/intel/xe_exec_atomic.c
> +++ b/tests/intel/xe_exec_atomic.c
> @@ -85,7 +85,8 @@ static void basic_inst(int fd, int inst_type, struct
> drm_xe_engine_class_instanc
> 
>  	exec_queue = xe_exec_queue_create(fd, vm, eci, 0);
>  	bind_engine = xe_bind_exec_queue_create(fd, vm, 0);
> -	xe_vm_bind_async(fd, vm, bind_engine, bo, 0, addr, bo_size, &sync, 1);
> +	xe_vm_bind_async_flags(fd, vm, bind_engine, bo, 0, addr, bo_size,
> +			       &sync, 1,
> DRM_XE_VM_BIND_FLAG_DEVICE_ATOMICS);
>  	data = xe_bo_mmap_ext(fd, bo, bo_size, PROT_READ|PROT_WRITE);
>  	data->data = value;
> 
> @@ -112,8 +113,11 @@ static void basic_inst(int fd, int inst_type, struct
> drm_xe_engine_class_instanc
> 
>  static bool has_atomics(int fd, uint32_t region)  {
> -	/* System memory atomics on dGPU is not functional as of now */
> -	if (region == system_memory(fd) && xe_has_vram(fd))
> +	struct drm_xe_query_config *config = xe_config(fd);
> +
> +	if (region == system_memory(fd) &&
> +	    !(config->info[DRM_XE_QUERY_CONFIG_FLAGS] &
> +	     DRM_XE_QUERY_CONFIG_FLAG_HAS_DEV_ATOMIC_ON_SMEM))
>  		return false;
> 
>  	return true;
> --
> 2.42.0

LGTM,
Reviewed-by: Janga Rahul Kumar <janga.rahul.kumar at intel.com>


More information about the igt-dev mailing list