summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorBrian Welty <brian.welty@intel.com>2023-11-01 00:12:16 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 19:43:33 +0300
commit74a6c6438ee7b53e7711fc0b7000ed42edd7dad5 (patch)
treedcc1ca0ba97305f15be1bb5b34e9d419f75789ee /drivers/gpu/drm
parent81d11b9d6625d3c2a9ecf68f41f3575e653c0ac7 (diff)
downloadlinux-74a6c6438ee7b53e7711fc0b7000ed42edd7dad5.tar.xz
drm/xe: Fix dequeue of access counter work item
The access counters worker function is fixed to advance the head pointer when dequeuing from the acc_queue. This now matches the similar logic in get_pagefault(). Signed-off-by: Bruce Chang <yu.bruce.chang@intel.com> Signed-off-by: Brian Welty <brian.welty@intel.com> Reviewed-by: Stuart Summers <stuart.summers@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/xe/xe_gt_pagefault.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.c b/drivers/gpu/drm/xe/xe_gt_pagefault.c
index 4e33ef8c9d6a..018edf731ae5 100644
--- a/drivers/gpu/drm/xe/xe_gt_pagefault.c
+++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c
@@ -542,6 +542,8 @@ unlock_vm:
#define make_u64(hi__, low__) ((u64)(hi__) << 32 | (u64)(low__))
+#define ACC_MSG_LEN_DW 4
+
static int get_acc(struct acc_queue *acc_queue, struct acc *acc)
{
const struct xe_guc_acc_desc *desc;
@@ -562,6 +564,9 @@ static int get_acc(struct acc_queue *acc_queue, struct acc *acc)
acc->access_type = FIELD_GET(ACC_TYPE, desc->dw0);
acc->va_range_base = make_u64(desc->dw3 & ACC_VIRTUAL_ADDR_RANGE_HI,
desc->dw2 & ACC_VIRTUAL_ADDR_RANGE_LO);
+
+ acc_queue->head = (acc_queue->head + ACC_MSG_LEN_DW) %
+ ACC_QUEUE_NUM_DW;
} else {
ret = -1;
}
@@ -589,8 +594,6 @@ static void acc_queue_work_func(struct work_struct *w)
}
}
-#define ACC_MSG_LEN_DW 4
-
static bool acc_queue_full(struct acc_queue *acc_queue)
{
lockdep_assert_held(&acc_queue->lock);