Lines Matching refs:hwsp
28 struct intel_timeline_hwsp *hwsp; member
57 struct intel_timeline_hwsp *hwsp; in hwsp_alloc() local
64 hwsp = list_first_entry_or_null(>->hwsp_free_list, in hwsp_alloc()
65 typeof(*hwsp), free_link); in hwsp_alloc()
66 if (!hwsp) { in hwsp_alloc()
71 hwsp = kmalloc(sizeof(*hwsp), GFP_KERNEL); in hwsp_alloc()
72 if (!hwsp) in hwsp_alloc()
77 kfree(hwsp); in hwsp_alloc()
81 vma->private = hwsp; in hwsp_alloc()
82 hwsp->gt = timeline->gt; in hwsp_alloc()
83 hwsp->vma = vma; in hwsp_alloc()
84 hwsp->free_bitmap = ~0ull; in hwsp_alloc()
85 hwsp->gt_timelines = gt; in hwsp_alloc()
88 list_add(&hwsp->free_link, >->hwsp_free_list); in hwsp_alloc()
91 GEM_BUG_ON(!hwsp->free_bitmap); in hwsp_alloc()
92 *cacheline = __ffs64(hwsp->free_bitmap); in hwsp_alloc()
93 hwsp->free_bitmap &= ~BIT_ULL(*cacheline); in hwsp_alloc()
94 if (!hwsp->free_bitmap) in hwsp_alloc()
95 list_del(&hwsp->free_link); in hwsp_alloc()
99 GEM_BUG_ON(hwsp->vma->private != hwsp); in hwsp_alloc()
100 return hwsp->vma; in hwsp_alloc()
103 static void __idle_hwsp_free(struct intel_timeline_hwsp *hwsp, int cacheline) in __idle_hwsp_free() argument
105 struct intel_gt_timelines *gt = hwsp->gt_timelines; in __idle_hwsp_free()
111 if (!hwsp->free_bitmap) in __idle_hwsp_free()
112 list_add_tail(&hwsp->free_link, >->hwsp_free_list); in __idle_hwsp_free()
114 GEM_BUG_ON(cacheline >= BITS_PER_TYPE(hwsp->free_bitmap)); in __idle_hwsp_free()
115 hwsp->free_bitmap |= BIT_ULL(cacheline); in __idle_hwsp_free()
118 if (hwsp->free_bitmap == ~0ull) { in __idle_hwsp_free()
119 i915_vma_put(hwsp->vma); in __idle_hwsp_free()
120 list_del(&hwsp->free_link); in __idle_hwsp_free()
121 kfree(hwsp); in __idle_hwsp_free()
131 i915_gem_object_unpin_map(cl->hwsp->vma->obj); in __idle_cacheline_free()
132 i915_vma_put(cl->hwsp->vma); in __idle_cacheline_free()
133 __idle_hwsp_free(cl->hwsp, ptr_unmask_bits(cl->vaddr, CACHELINE_BITS)); in __idle_cacheline_free()
144 i915_vma_unpin(cl->hwsp->vma); in __cacheline_retire()
154 __i915_vma_pin(cl->hwsp->vma); in __cacheline_active()
159 cacheline_alloc(struct intel_timeline_hwsp *hwsp, unsigned int cacheline) in cacheline_alloc() argument
170 vaddr = i915_gem_object_pin_map(hwsp->vma->obj, I915_MAP_WB); in cacheline_alloc()
176 i915_vma_get(hwsp->vma); in cacheline_alloc()
177 cl->hwsp = hwsp; in cacheline_alloc()
180 i915_active_init(hwsp->gt->i915, &cl->active, in cacheline_alloc()
209 struct i915_vma *hwsp) in intel_timeline_init() argument
218 timeline->has_initial_breadcrumb = !hwsp; in intel_timeline_init()
221 if (!hwsp) { in intel_timeline_init()
225 hwsp = hwsp_alloc(timeline, &cacheline); in intel_timeline_init()
226 if (IS_ERR(hwsp)) in intel_timeline_init()
227 return PTR_ERR(hwsp); in intel_timeline_init()
229 cl = cacheline_alloc(hwsp->private, cacheline); in intel_timeline_init()
231 __idle_hwsp_free(hwsp->private, cacheline); in intel_timeline_init()
242 vaddr = i915_gem_object_pin_map(hwsp->obj, I915_MAP_WB); in intel_timeline_init()
250 timeline->hwsp_ggtt = i915_vma_get(hwsp); in intel_timeline_init()
251 GEM_BUG_ON(timeline->hwsp_offset >= hwsp->size); in intel_timeline_init()
438 GEM_BUG_ON(cl->hwsp->vma != vma); in __intel_timeline_get_seqno()
501 u32 *hwsp) in intel_timeline_read_hwsp() argument
515 *hwsp = tl->hwsp_offset; in intel_timeline_read_hwsp()
517 *hwsp = i915_ggtt_offset(cl->hwsp->vma) + in intel_timeline_read_hwsp()