Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v6.15-rc4 47 lines 1.5 kB view raw
1/* SPDX-License-Identifier: MIT */ 2/* 3 * Copyright © 2024 Intel Corporation 4 */ 5 6#ifndef _XE_GUC_BUF_H_ 7#define _XE_GUC_BUF_H_ 8 9#include <linux/cleanup.h> 10#include <linux/err.h> 11 12#include "xe_guc_buf_types.h" 13 14int xe_guc_buf_cache_init(struct xe_guc_buf_cache *cache); 15u32 xe_guc_buf_cache_dwords(struct xe_guc_buf_cache *cache); 16struct xe_guc_buf xe_guc_buf_reserve(struct xe_guc_buf_cache *cache, u32 dwords); 17struct xe_guc_buf xe_guc_buf_from_data(struct xe_guc_buf_cache *cache, 18 const void *data, size_t size); 19void xe_guc_buf_release(const struct xe_guc_buf buf); 20 21/** 22 * xe_guc_buf_is_valid() - Check if a buffer reference is valid. 23 * @buf: the &xe_guc_buf reference to check 24 * 25 * Return: true if @ref represents a valid sub-allication. 26 */ 27static inline bool xe_guc_buf_is_valid(const struct xe_guc_buf buf) 28{ 29 return !IS_ERR_OR_NULL(buf.sa); 30} 31 32void *xe_guc_buf_cpu_ptr(const struct xe_guc_buf buf); 33u64 xe_guc_buf_flush(const struct xe_guc_buf buf); 34u64 xe_guc_buf_gpu_addr(const struct xe_guc_buf buf); 35u64 xe_guc_cache_gpu_addr_from_ptr(struct xe_guc_buf_cache *cache, const void *ptr, u32 size); 36 37DEFINE_CLASS(xe_guc_buf, struct xe_guc_buf, 38 xe_guc_buf_release(_T), 39 xe_guc_buf_reserve(cache, num), 40 struct xe_guc_buf_cache *cache, u32 num); 41 42DEFINE_CLASS(xe_guc_buf_from_data, struct xe_guc_buf, 43 xe_guc_buf_release(_T), 44 xe_guc_buf_from_data(cache, data, size), 45 struct xe_guc_buf_cache *cache, const void *data, size_t size); 46 47#endif