aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/xe/xe_exec_queue.c
diff options
context:
space:
mode:
authorPriyanka Dandamudi <priyanka.dandamudi@intel.com>2023-10-27 10:55:07 +0530
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 11:43:31 -0500
commitb8d70702def26d7597eded092fe43cc584c0d064 (patch)
treee3379c1476308aeca0844eb4e04b62e8b0021273 /drivers/gpu/drm/xe/xe_exec_queue.c
parentdrm/xe: Fix WA 14010918519 write to wrong register (diff)
downloadlinux-b8d70702def26d7597eded092fe43cc584c0d064.tar.gz
linux-b8d70702def26d7597eded092fe43cc584c0d064.zip
drm/xe/xe_exec_queue: Add check for access counter granularity
Add conditional check for access counter granularity. This check will return -EINVAL if granularity is beyond 64M which is a hardware limitation. v2: Defined XE_ACC_GRANULARITY_128K 0 XE_ACC_GRANULARITY_2M 1 XE_ACC_GRANULARITY_16M 2 XE_ACC_GRANULARITY_64M 3 as part of uAPI. So, that user can also use it.(Oak) v3: Move uAPI to proper location and give proper documentation.(Brian, Oak) Cc: Oak Zeng <oak.zeng@intel.com> Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com> Cc: Brian Welty <brian.welty@intel.com> Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi@intel.com> Reviewed-by: Oak Zeng <oak.zeng@intel.com> Reviewed-by: Oak Zeng <oak.zeng@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_exec_queue.c')
-rw-r--r--drivers/gpu/drm/xe/xe_exec_queue.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
index 8e0620cb89e5..f67a6dee4a6f 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue.c
+++ b/drivers/gpu/drm/xe/xe_exec_queue.c
@@ -393,6 +393,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 > XE_ACC_GRANULARITY_64M)
+ return -EINVAL;
+
q->usm.acc_granularity = value;
return 0;