Lines Matching refs:oa_buffer
459 ((__s)->oa_buffer.format->header == HDR_64_BIT)
543 u32 gtt_offset = i915_ggtt_offset(stream->oa_buffer.vma); in oa_buffer_check_unlocked()
544 int report_size = stream->oa_buffer.format->size; in oa_buffer_check_unlocked()
555 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in oa_buffer_check_unlocked()
563 partial_report_size = OA_TAKEN(hw_tail, stream->oa_buffer.tail); in oa_buffer_check_unlocked()
573 head = stream->oa_buffer.head - gtt_offset; in oa_buffer_check_unlocked()
574 read_tail = stream->oa_buffer.tail - gtt_offset; in oa_buffer_check_unlocked()
590 void *report = stream->oa_buffer.vaddr + tail; in oa_buffer_check_unlocked()
605 stream->oa_buffer.tail = gtt_offset + tail; in oa_buffer_check_unlocked()
607 pollin = OA_TAKEN(stream->oa_buffer.tail, in oa_buffer_check_unlocked()
608 stream->oa_buffer.head) >= report_size; in oa_buffer_check_unlocked()
610 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in oa_buffer_check_unlocked()
672 int report_size = stream->oa_buffer.format->size; in append_oa_sample()
689 oa_buf_end = stream->oa_buffer.vaddr + OA_BUFFER_SIZE; in append_oa_sample()
697 if (copy_to_user(buf, stream->oa_buffer.vaddr, in append_oa_sample()
736 int report_size = stream->oa_buffer.format->size; in gen8_append_oa_reports()
737 u8 *oa_buf_base = stream->oa_buffer.vaddr; in gen8_append_oa_reports()
738 u32 gtt_offset = i915_ggtt_offset(stream->oa_buffer.vma); in gen8_append_oa_reports()
748 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in gen8_append_oa_reports()
750 head = stream->oa_buffer.head; in gen8_append_oa_reports()
751 tail = stream->oa_buffer.tail; in gen8_append_oa_reports()
753 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in gen8_append_oa_reports()
842 stream->oa_buffer.last_ctx_id == stream->specific_ctx_id || in gen8_append_oa_reports()
859 stream->oa_buffer.last_ctx_id = ctx_id; in gen8_append_oa_reports()
870 u8 *oa_buf_end = stream->oa_buffer.vaddr + in gen8_append_oa_reports()
891 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in gen8_append_oa_reports()
900 stream->oa_buffer.head = head; in gen8_append_oa_reports()
902 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in gen8_append_oa_reports()
938 if (drm_WARN_ON(&uncore->i915->drm, !stream->oa_buffer.vaddr)) in gen8_oa_read()
1025 int report_size = stream->oa_buffer.format->size; in gen7_append_oa_reports()
1026 u8 *oa_buf_base = stream->oa_buffer.vaddr; in gen7_append_oa_reports()
1027 u32 gtt_offset = i915_ggtt_offset(stream->oa_buffer.vma); in gen7_append_oa_reports()
1037 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in gen7_append_oa_reports()
1039 head = stream->oa_buffer.head; in gen7_append_oa_reports()
1040 tail = stream->oa_buffer.tail; in gen7_append_oa_reports()
1042 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in gen7_append_oa_reports()
1110 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in gen7_append_oa_reports()
1120 stream->oa_buffer.head = head; in gen7_append_oa_reports()
1122 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in gen7_append_oa_reports()
1153 if (drm_WARN_ON(&uncore->i915->drm, !stream->oa_buffer.vaddr)) in gen7_oa_read()
1625 i915_vma_unpin_and_release(&stream->oa_buffer.vma, in free_oa_buffer()
1628 stream->oa_buffer.vaddr = NULL; in free_oa_buffer()
1703 u32 gtt_offset = i915_ggtt_offset(stream->oa_buffer.vma); in gen7_init_oa_buffer()
1706 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in gen7_init_oa_buffer()
1713 stream->oa_buffer.head = gtt_offset; in gen7_init_oa_buffer()
1721 stream->oa_buffer.tail = gtt_offset; in gen7_init_oa_buffer()
1723 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in gen7_init_oa_buffer()
1742 memset(stream->oa_buffer.vaddr, 0, OA_BUFFER_SIZE); in gen7_init_oa_buffer()
1748 u32 gtt_offset = i915_ggtt_offset(stream->oa_buffer.vma); in gen8_init_oa_buffer()
1751 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in gen8_init_oa_buffer()
1755 stream->oa_buffer.head = gtt_offset; in gen8_init_oa_buffer()
1772 stream->oa_buffer.tail = gtt_offset; in gen8_init_oa_buffer()
1779 stream->oa_buffer.last_ctx_id = INVALID_CTX_ID; in gen8_init_oa_buffer()
1781 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in gen8_init_oa_buffer()
1795 memset(stream->oa_buffer.vaddr, 0, OA_BUFFER_SIZE); in gen8_init_oa_buffer()
1801 u32 gtt_offset = i915_ggtt_offset(stream->oa_buffer.vma); in gen12_init_oa_buffer()
1804 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); in gen12_init_oa_buffer()
1809 stream->oa_buffer.head = gtt_offset; in gen12_init_oa_buffer()
1819 intel_uncore_write(uncore, __oa_regs(stream)->oa_buffer, gtt_offset | in gen12_init_oa_buffer()
1825 stream->oa_buffer.tail = gtt_offset; in gen12_init_oa_buffer()
1832 stream->oa_buffer.last_ctx_id = INVALID_CTX_ID; in gen12_init_oa_buffer()
1834 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); in gen12_init_oa_buffer()
1848 memset(stream->oa_buffer.vaddr, 0, in gen12_init_oa_buffer()
1849 stream->oa_buffer.vma->size); in gen12_init_oa_buffer()
1860 if (drm_WARN_ON(&i915->drm, stream->oa_buffer.vma)) in alloc_oa_buffer()
1891 stream->oa_buffer.vma = vma; in alloc_oa_buffer()
1893 stream->oa_buffer.vaddr = in alloc_oa_buffer()
1895 if (IS_ERR(stream->oa_buffer.vaddr)) { in alloc_oa_buffer()
1896 ret = PTR_ERR(stream->oa_buffer.vaddr); in alloc_oa_buffer()
1908 stream->oa_buffer.vaddr = NULL; in alloc_oa_buffer()
1909 stream->oa_buffer.vma = NULL; in alloc_oa_buffer()
2615 u32 format = stream->oa_buffer.format->format; in gen12_configure_oar_context()
3012 u32 report_format = stream->oa_buffer.format->format; in gen7_oa_enable()
3038 u32 report_format = stream->oa_buffer.format->format; in gen8_oa_enable()
3076 val = (stream->oa_buffer.format->format << regs->oa_ctrl_counter_format_shift) | in gen12_oa_enable()
3331 stream->oa_buffer.format = &perf->oa_formats[props->oa_format]; in i915_oa_stream_init()
3332 if (drm_WARN_ON(&i915->drm, stream->oa_buffer.format->size == 0)) in i915_oa_stream_init()
3336 stream->sample_size += stream->oa_buffer.format->size; in i915_oa_stream_init()
3426 spin_lock_init(&stream->oa_buffer.ptr_lock); in i915_oa_stream_init()