FILE
xe_ttm_vram_mgr.h
File preview with syntax highlighting.
linux-6.19.14/drivers/gpu/drm/xe/xe_ttm_vram_mgr.h
1/* SPDX-License-Identifier: MIT */ 2/* 3 * Copyright © 2022 Intel Corporation 4 */ 5 6#ifndef _XE_TTM_VRAM_MGR_H_ 7#define _XE_TTM_VRAM_MGR_H_ 8 9#include "xe_ttm_vram_mgr_types.h" 10 11enum dma_data_direction; 12struct xe_device; 13struct xe_tile; 14struct xe_vram_region; 15 16int __xe_ttm_vram_mgr_init(struct xe_device *xe, struct xe_ttm_vram_mgr *mgr, 17 u32 mem_type, u64 size, u64 io_size, 18 u64 default_page_size); 19int xe_ttm_vram_mgr_init(struct xe_device *xe, struct xe_vram_region *vram); 20int xe_ttm_vram_mgr_alloc_sgt(struct xe_device *xe, 21 struct ttm_resource *res, 22 u64 offset, u64 length, 23 struct device *dev, 24 enum dma_data_direction dir, 25 struct sg_table **sgt); 26void xe_ttm_vram_mgr_free_sgt(struct device *dev, enum dma_data_direction dir, 27 struct sg_table *sgt); 28 29u64 xe_ttm_vram_get_avail(struct ttm_resource_manager *man); 30u64 xe_ttm_vram_get_cpu_visible_size(struct ttm_resource_manager *man); 31void xe_ttm_vram_get_used(struct ttm_resource_manager *man, 32 u64 *used, u64 *used_visible); 33 34static inline struct xe_ttm_vram_mgr_resource * 35to_xe_ttm_vram_mgr_resource(struct ttm_resource *res) 36{ 37 return container_of(res, struct xe_ttm_vram_mgr_resource, base); 38} 39 40static inline struct xe_ttm_vram_mgr * 41to_xe_ttm_vram_mgr(struct ttm_resource_manager *man) 42{ 43 return container_of(man, struct xe_ttm_vram_mgr, manager); 44} 45 46#endif
~/
Read-only file preview.