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

priyanka.dandamudi at intel.com priyanka.dandamudi at intel.com
Fri Oct 20 01:41:26 UTC 2023


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
+
 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