[Intel-xe] [PATCH] drm/xe/xe_exec_queue: Add check for access counter granularity

Zeng, Oak oak.zeng at intel.com
Fri Oct 20 02:38:04 UTC 2023



Thanks,
Oak

> -----Original Message-----
> From: Dandamudi, Priyanka <priyanka.dandamudi at intel.com>
> Sent: Thursday, October 19, 2023 9:41 PM
> To: Dandamudi, Priyanka <priyanka.dandamudi at intel.com>; Zeng, Oak
> <oak.zeng at intel.com>; intel-xe at lists.freedesktop.org; Kumar, Janga Rahul
> <janga.rahul.kumar at intel.com>
> Subject: [PATCH] drm/xe/xe_exec_queue: Add check for access counter
> granularity
> 
> From: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
> 
> Add conditional check for access counter granularity.
> This check will return -EINVAL if granularity is beyond 64M
> which is a hardware limitation.
> 
> Cc: Oak Zeng <oak.zeng at intel.com>
> Cc: Janga Rahul Kumar <janga.rahul.kumar at intel.com>
> Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_exec_queue.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c
> b/drivers/gpu/drm/xe/xe_exec_queue.c
> index dd61c4267e24..03dedcc39732 100644
> --- a/drivers/gpu/drm/xe/xe_exec_queue.c
> +++ b/drivers/gpu/drm/xe/xe_exec_queue.c
> @@ -23,6 +23,8 @@
>  #include "xe_trace.h"
>  #include "xe_vm.h"
> 
> +#define GRANULARITY_SZ_64M 3

Please define this in xe_drm.h so user can use it as part of uAPI:

#define XE_ACC_GRANULARITY_128K 0
#define XE_ACC_GRANULARITY_2M 1
#define XE_ACC_GRANULARITY_16M 2
#define XE_ACC_GRANULARITY_64M 3

With this addressed, patch is Reviewed-by: Oak Zeng <oak.zeng at intel.com>

Oak
> +
>  enum xe_exec_queue_sched_prop {
>  	XE_EXEC_QUEUE_JOB_TIMEOUT = 0,
>  	XE_EXEC_QUEUE_TIMESLICE = 1,
> @@ -393,6 +395,9 @@ static int exec_queue_set_acc_granularity(struct
> xe_device *xe, struct xe_exec_q
>  	if (XE_IOCTL_DBG(xe, !xe->info.supports_usm))
>  		return -EINVAL;
> 
> +	if (value > GRANULARITY_SZ_64M)
> +		return -EINVAL;
> +
>  	q->usm.acc_granularity = value;
> 
>  	return 0;
> --
> 2.25.1



More information about the Intel-xe mailing list