Lines Matching refs:oa_buffer

149 		tail + stream->oa_buffer.circ_size - head;  in xe_oa_circ_diff()
154 return ptr + n >= stream->oa_buffer.circ_size ? in xe_oa_circ_incr()
155 ptr + n - stream->oa_buffer.circ_size : ptr + n; in xe_oa_circ_incr()
213 ((__s)->oa_buffer.format->header == HDR_64_BIT)
245 u32 gtt_offset = xe_bo_ggtt_addr(stream->oa_buffer.bo); in xe_oa_buffer_check_unlocked()
247 int report_size = stream->oa_buffer.format->size; in xe_oa_buffer_check_unlocked()
250 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in xe_oa_buffer_check_unlocked()
260 partial_report_size = xe_oa_circ_diff(stream, hw_tail, stream->oa_buffer.tail); in xe_oa_buffer_check_unlocked()
276 while (xe_oa_circ_diff(stream, tail, stream->oa_buffer.tail) >= report_size) { in xe_oa_buffer_check_unlocked()
277 void *report = stream->oa_buffer.vaddr + tail; in xe_oa_buffer_check_unlocked()
288 stream->oa_buffer.head, tail, hw_tail); in xe_oa_buffer_check_unlocked()
290 stream->oa_buffer.tail = tail; in xe_oa_buffer_check_unlocked()
292 available = xe_oa_circ_diff(stream, stream->oa_buffer.tail, stream->oa_buffer.head); in xe_oa_buffer_check_unlocked()
295 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in xe_oa_buffer_check_unlocked()
316 int report_size = stream->oa_buffer.format->size; in xe_oa_append_report()
325 oa_buf_end = stream->oa_buffer.vaddr + stream->oa_buffer.circ_size; in xe_oa_append_report()
333 if (copy_to_user(buf, stream->oa_buffer.vaddr, in xe_oa_append_report()
348 int report_size = stream->oa_buffer.format->size; in xe_oa_append_reports()
349 u8 *oa_buf_base = stream->oa_buffer.vaddr; in xe_oa_append_reports()
350 u32 gtt_offset = xe_bo_ggtt_addr(stream->oa_buffer.bo); in xe_oa_append_reports()
356 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in xe_oa_append_reports()
357 head = stream->oa_buffer.head; in xe_oa_append_reports()
358 tail = stream->oa_buffer.tail; in xe_oa_append_reports()
359 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in xe_oa_append_reports()
362 head < stream->oa_buffer.circ_size && tail < stream->oa_buffer.circ_size); in xe_oa_append_reports()
372 if (!(stream->oa_buffer.circ_size % report_size)) { in xe_oa_append_reports()
377 u8 *oa_buf_end = stream->oa_buffer.vaddr + stream->oa_buffer.circ_size; in xe_oa_append_reports()
393 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in xe_oa_append_reports()
396 stream->oa_buffer.head = head; in xe_oa_append_reports()
397 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in xe_oa_append_reports()
405 u32 gtt_offset = xe_bo_ggtt_addr(stream->oa_buffer.bo); in xe_oa_init_oa_buffer()
406 int size_exponent = __ffs(xe_bo_size(stream->oa_buffer.bo)); in xe_oa_init_oa_buffer()
418 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in xe_oa_init_oa_buffer()
423 stream->oa_buffer.head = 0; in xe_oa_init_oa_buffer()
428 xe_mmio_write32(mmio, __oa_regs(stream)->oa_buffer, oa_buf); in xe_oa_init_oa_buffer()
433 stream->oa_buffer.tail = 0; in xe_oa_init_oa_buffer()
435 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in xe_oa_init_oa_buffer()
438 memset(stream->oa_buffer.vaddr, 0, xe_bo_size(stream->oa_buffer.bo)); in xe_oa_init_oa_buffer()
469 const struct xe_oa_format *format = stream->oa_buffer.format; in xe_oa_enable()
701 xe_bo_unpin_map_no_vm(stream->oa_buffer.bo); in xe_oa_free_oa_buffer()
745 const struct xe_oa_format *format = stream->oa_buffer.format; in xe_oa_configure_oar_context()
770 const struct xe_oa_format *format = stream->oa_buffer.format; in xe_oa_configure_oac_context()
892 stream->oa_buffer.bo = bo; in xe_oa_alloc_oa_buffer()
895 stream->oa_buffer.vaddr = bo->vmap.vaddr; in xe_oa_alloc_oa_buffer()
1068 xe_bo_size(stream->oa_buffer.bo) > SZ_16M ? in oag_buf_size_select()
1585 struct drm_xe_oa_stream_info info = { .oa_buf_size = xe_bo_size(stream->oa_buffer.bo), }; in xe_oa_info_locked()
1661 struct xe_bo *bo = stream->oa_buffer.bo; in xe_oa_mmap()
1671 if (vma->vm_end - vma->vm_start != xe_bo_size(stream->oa_buffer.bo)) { in xe_oa_mmap()
1721 stream->oa_buffer.format = &stream->oa->oa_formats[param->oa_format]; in xe_oa_stream_init()
1740 stream->oa_buffer.circ_size = in xe_oa_stream_init()
1742 param->oa_buffer_size % stream->oa_buffer.format->size; in xe_oa_stream_init()
1744 stream->oa_buffer.circ_size = param->oa_buffer_size; in xe_oa_stream_init()
1803 spin_lock_init(&stream->oa_buffer.ptr_lock); in xe_oa_stream_init()