Lines Matching refs:cache
16 static struct xe_guc *cache_to_guc(struct xe_guc_buf_cache *cache) in cache_to_guc() argument
18 return container_of(cache, struct xe_guc, buf); in cache_to_guc()
21 static struct xe_gt *cache_to_gt(struct xe_guc_buf_cache *cache) in cache_to_gt() argument
23 return guc_to_gt(cache_to_guc(cache)); in cache_to_gt()
35 int xe_guc_buf_cache_init(struct xe_guc_buf_cache *cache) in xe_guc_buf_cache_init() argument
37 struct xe_gt *gt = cache_to_gt(cache); in xe_guc_buf_cache_init()
43 cache->sam = sam; in xe_guc_buf_cache_init()
46 xe_guc_buf_cache_dwords(cache), xe_bo_ggtt_addr(sam->bo), in xe_guc_buf_cache_init()
57 u32 xe_guc_buf_cache_dwords(struct xe_guc_buf_cache *cache) in xe_guc_buf_cache_dwords() argument
59 return cache->sam ? cache->sam->base.size / sizeof(u32) : 0; in xe_guc_buf_cache_dwords()
72 struct xe_guc_buf xe_guc_buf_reserve(struct xe_guc_buf_cache *cache, u32 dwords) in xe_guc_buf_reserve() argument
76 if (cache->sam) in xe_guc_buf_reserve()
77 sa = __xe_sa_bo_new(cache->sam, dwords * sizeof(u32), GFP_ATOMIC); in xe_guc_buf_reserve()
94 struct xe_guc_buf xe_guc_buf_from_data(struct xe_guc_buf_cache *cache, in xe_guc_buf_from_data() argument
99 sa = __xe_sa_bo_new(cache->sam, size, GFP_ATOMIC); in xe_guc_buf_from_data()
160 u64 xe_guc_cache_gpu_addr_from_ptr(struct xe_guc_buf_cache *cache, const void *ptr, u32 size) in xe_guc_cache_gpu_addr_from_ptr() argument
162 ptrdiff_t offset = ptr - cache->sam->cpu_ptr; in xe_guc_cache_gpu_addr_from_ptr()
164 if (offset < 0 || offset + size > cache->sam->base.size) in xe_guc_cache_gpu_addr_from_ptr()
167 return cache->sam->gpu_addr + offset; in xe_guc_cache_gpu_addr_from_ptr()