Lines Matching refs:acc_queue

448 		gt->usm.acc_queue[i].gt = gt;  in xe_gt_pagefault_init()
449 spin_lock_init(&gt->usm.acc_queue[i].lock); in xe_gt_pagefault_init()
450 INIT_WORK(&gt->usm.acc_queue[i].worker, acc_queue_work_func); in xe_gt_pagefault_init()
485 spin_lock(&gt->usm.acc_queue[i].lock); in xe_gt_pagefault_reset()
486 gt->usm.acc_queue[i].head = 0; in xe_gt_pagefault_reset()
487 gt->usm.acc_queue[i].tail = 0; in xe_gt_pagefault_reset()
488 spin_unlock(&gt->usm.acc_queue[i].lock); in xe_gt_pagefault_reset()
596 static bool get_acc(struct acc_queue *acc_queue, struct acc *acc) in get_acc() argument
601 spin_lock(&acc_queue->lock); in get_acc()
602 if (acc_queue->tail != acc_queue->head) { in get_acc()
604 (acc_queue->data + acc_queue->tail); in get_acc()
617 acc_queue->tail = (acc_queue->tail + ACC_MSG_LEN_DW) % in get_acc()
621 spin_unlock(&acc_queue->lock); in get_acc()
628 struct acc_queue *acc_queue = container_of(w, struct acc_queue, worker); in acc_queue_work_func() local
629 struct xe_gt *gt = acc_queue->gt; in acc_queue_work_func()
637 while (get_acc(acc_queue, &acc)) { in acc_queue_work_func()
645 acc_queue->tail != acc_queue->head) { in acc_queue_work_func()
652 static bool acc_queue_full(struct acc_queue *acc_queue) in acc_queue_full() argument
654 lockdep_assert_held(&acc_queue->lock); in acc_queue_full()
656 return CIRC_SPACE(acc_queue->head, acc_queue->tail, ACC_QUEUE_NUM_DW) <= in acc_queue_full()
663 struct acc_queue *acc_queue; in xe_guc_access_counter_notify_handler() local
676 acc_queue = &gt->usm.acc_queue[asid % NUM_ACC_QUEUE]; in xe_guc_access_counter_notify_handler()
678 spin_lock(&acc_queue->lock); in xe_guc_access_counter_notify_handler()
679 full = acc_queue_full(acc_queue); in xe_guc_access_counter_notify_handler()
681 memcpy(acc_queue->data + acc_queue->head, msg, in xe_guc_access_counter_notify_handler()
683 acc_queue->head = (acc_queue->head + len) % ACC_QUEUE_NUM_DW; in xe_guc_access_counter_notify_handler()
684 queue_work(gt->usm.acc_wq, &acc_queue->worker); in xe_guc_access_counter_notify_handler()
688 spin_unlock(&acc_queue->lock); in xe_guc_access_counter_notify_handler()