Lines Matching refs:oa_buffer

120 		tail + stream->oa_buffer.circ_size - head;  in xe_oa_circ_diff()
125 return ptr + n >= stream->oa_buffer.circ_size ? in xe_oa_circ_incr()
126 ptr + n - stream->oa_buffer.circ_size : ptr + n; in xe_oa_circ_incr()
184 ((__s)->oa_buffer.format->header == HDR_64_BIT)
216 u32 gtt_offset = xe_bo_ggtt_addr(stream->oa_buffer.bo); in xe_oa_buffer_check_unlocked()
217 int report_size = stream->oa_buffer.format->size; in xe_oa_buffer_check_unlocked()
223 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in xe_oa_buffer_check_unlocked()
233 partial_report_size = xe_oa_circ_diff(stream, hw_tail, stream->oa_buffer.tail); in xe_oa_buffer_check_unlocked()
249 while (xe_oa_circ_diff(stream, tail, stream->oa_buffer.tail) >= report_size) { in xe_oa_buffer_check_unlocked()
250 void *report = stream->oa_buffer.vaddr + tail; in xe_oa_buffer_check_unlocked()
261 stream->oa_buffer.head, tail, hw_tail); in xe_oa_buffer_check_unlocked()
263 stream->oa_buffer.tail = tail; in xe_oa_buffer_check_unlocked()
265 pollin = xe_oa_circ_diff(stream, stream->oa_buffer.tail, in xe_oa_buffer_check_unlocked()
266 stream->oa_buffer.head) >= report_size; in xe_oa_buffer_check_unlocked()
268 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in xe_oa_buffer_check_unlocked()
291 int report_size = stream->oa_buffer.format->size; in xe_oa_append_report()
300 oa_buf_end = stream->oa_buffer.vaddr + stream->oa_buffer.circ_size; in xe_oa_append_report()
308 if (copy_to_user(buf, stream->oa_buffer.vaddr, in xe_oa_append_report()
323 int report_size = stream->oa_buffer.format->size; in xe_oa_append_reports()
324 u8 *oa_buf_base = stream->oa_buffer.vaddr; in xe_oa_append_reports()
325 u32 gtt_offset = xe_bo_ggtt_addr(stream->oa_buffer.bo); in xe_oa_append_reports()
331 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in xe_oa_append_reports()
332 head = stream->oa_buffer.head; in xe_oa_append_reports()
333 tail = stream->oa_buffer.tail; in xe_oa_append_reports()
334 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in xe_oa_append_reports()
337 head < stream->oa_buffer.circ_size && tail < stream->oa_buffer.circ_size); in xe_oa_append_reports()
347 if (!(stream->oa_buffer.circ_size % report_size)) { in xe_oa_append_reports()
352 u8 *oa_buf_end = stream->oa_buffer.vaddr + stream->oa_buffer.circ_size; in xe_oa_append_reports()
368 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in xe_oa_append_reports()
371 stream->oa_buffer.head = head; in xe_oa_append_reports()
372 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in xe_oa_append_reports()
380 u32 gtt_offset = xe_bo_ggtt_addr(stream->oa_buffer.bo); in xe_oa_init_oa_buffer()
384 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in xe_oa_init_oa_buffer()
389 stream->oa_buffer.head = 0; in xe_oa_init_oa_buffer()
394 xe_mmio_write32(stream->gt, __oa_regs(stream)->oa_buffer, oa_buf); in xe_oa_init_oa_buffer()
399 stream->oa_buffer.tail = 0; in xe_oa_init_oa_buffer()
401 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in xe_oa_init_oa_buffer()
404 memset(stream->oa_buffer.vaddr, 0, stream->oa_buffer.bo->size); in xe_oa_init_oa_buffer()
429 const struct xe_oa_format *format = stream->oa_buffer.format; in xe_oa_enable()
630 xe_bo_unpin_map_no_vm(stream->oa_buffer.bo); in xe_oa_free_oa_buffer()
697 const struct xe_oa_format *format = stream->oa_buffer.format; in xe_oa_configure_oar_context()
730 const struct xe_oa_format *format = stream->oa_buffer.format; in xe_oa_configure_oac_context()
858 stream->oa_buffer.bo = bo; in xe_oa_alloc_oa_buffer()
861 stream->oa_buffer.vaddr = bo->vmap.vaddr; in xe_oa_alloc_oa_buffer()
1224 struct xe_bo *bo = stream->oa_buffer.bo; in xe_oa_mmap()
1358 stream->oa_buffer.format = &stream->oa->oa_formats[param->oa_format]; in xe_oa_stream_init()
1372 stream->oa_buffer.circ_size = in xe_oa_stream_init()
1373 XE_OA_BUFFER_SIZE - XE_OA_BUFFER_SIZE % stream->oa_buffer.format->size; in xe_oa_stream_init()
1375 stream->oa_buffer.circ_size = XE_OA_BUFFER_SIZE; in xe_oa_stream_init()
1443 spin_lock_init(&stream->oa_buffer.ptr_lock); in xe_oa_stream_init()