Lines Matching refs:hwsp
52 struct intel_timeline_hwsp *hwsp; in hwsp_alloc() local
59 hwsp = list_first_entry_or_null(>->hwsp_free_list, in hwsp_alloc()
60 typeof(*hwsp), free_link); in hwsp_alloc()
61 if (!hwsp) { in hwsp_alloc()
66 hwsp = kmalloc(sizeof(*hwsp), GFP_KERNEL); in hwsp_alloc()
67 if (!hwsp) in hwsp_alloc()
72 kfree(hwsp); in hwsp_alloc()
78 vma->private = hwsp; in hwsp_alloc()
79 hwsp->gt = timeline->gt; in hwsp_alloc()
80 hwsp->vma = vma; in hwsp_alloc()
81 hwsp->free_bitmap = ~0ull; in hwsp_alloc()
82 hwsp->gt_timelines = gt; in hwsp_alloc()
85 list_add(&hwsp->free_link, >->hwsp_free_list); in hwsp_alloc()
88 GEM_BUG_ON(!hwsp->free_bitmap); in hwsp_alloc()
89 *cacheline = __ffs64(hwsp->free_bitmap); in hwsp_alloc()
90 hwsp->free_bitmap &= ~BIT_ULL(*cacheline); in hwsp_alloc()
91 if (!hwsp->free_bitmap) in hwsp_alloc()
92 list_del(&hwsp->free_link); in hwsp_alloc()
96 GEM_BUG_ON(hwsp->vma->private != hwsp); in hwsp_alloc()
97 return hwsp->vma; in hwsp_alloc()
100 static void __idle_hwsp_free(struct intel_timeline_hwsp *hwsp, int cacheline) in __idle_hwsp_free() argument
102 struct intel_gt_timelines *gt = hwsp->gt_timelines; in __idle_hwsp_free()
108 if (!hwsp->free_bitmap) in __idle_hwsp_free()
109 list_add_tail(&hwsp->free_link, >->hwsp_free_list); in __idle_hwsp_free()
111 GEM_BUG_ON(cacheline >= BITS_PER_TYPE(hwsp->free_bitmap)); in __idle_hwsp_free()
112 hwsp->free_bitmap |= BIT_ULL(cacheline); in __idle_hwsp_free()
115 if (hwsp->free_bitmap == ~0ull) { in __idle_hwsp_free()
116 i915_vma_put(hwsp->vma); in __idle_hwsp_free()
117 list_del(&hwsp->free_link); in __idle_hwsp_free()
118 kfree(hwsp); in __idle_hwsp_free()
137 i915_gem_object_unpin_map(cl->hwsp->vma->obj); in __idle_cacheline_free()
138 i915_vma_put(cl->hwsp->vma); in __idle_cacheline_free()
139 __idle_hwsp_free(cl->hwsp, ptr_unmask_bits(cl->vaddr, CACHELINE_BITS)); in __idle_cacheline_free()
150 i915_vma_unpin(cl->hwsp->vma); in __cacheline_retire()
160 __i915_vma_pin(cl->hwsp->vma); in __cacheline_active()
165 cacheline_alloc(struct intel_timeline_hwsp *hwsp, unsigned int cacheline) in cacheline_alloc() argument
176 vaddr = i915_gem_object_pin_map(hwsp->vma->obj, I915_MAP_WB); in cacheline_alloc()
182 i915_vma_get(hwsp->vma); in cacheline_alloc()
183 cl->hwsp = hwsp; in cacheline_alloc()
222 struct i915_vma *hwsp, in intel_timeline_init() argument
232 timeline->has_initial_breadcrumb = !hwsp; in intel_timeline_init()
235 if (!hwsp) { in intel_timeline_init()
239 hwsp = hwsp_alloc(timeline, &cacheline); in intel_timeline_init()
240 if (IS_ERR(hwsp)) in intel_timeline_init()
241 return PTR_ERR(hwsp); in intel_timeline_init()
243 cl = cacheline_alloc(hwsp->private, cacheline); in intel_timeline_init()
245 __idle_hwsp_free(hwsp->private, cacheline); in intel_timeline_init()
255 vaddr = i915_gem_object_pin_map(hwsp->obj, I915_MAP_WB); in intel_timeline_init()
263 timeline->hwsp_ggtt = i915_vma_get(hwsp); in intel_timeline_init()
264 GEM_BUG_ON(timeline->hwsp_offset >= hwsp->size); in intel_timeline_init()
492 GEM_BUG_ON(cl->hwsp->vma != vma); in __intel_timeline_get_seqno()
559 u32 *hwsp) in intel_timeline_read_hwsp() argument
580 *hwsp = cl->ggtt_offset; in intel_timeline_read_hwsp()