xref: /OK3568_Linux_fs/kernel/drivers/gpu/drm/nouveau/nouveau_ttm.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: MIT */
2*4882a593Smuzhiyun #ifndef __NOUVEAU_TTM_H__
3*4882a593Smuzhiyun #define __NOUVEAU_TTM_H__
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun static inline struct nouveau_drm *
nouveau_bdev(struct ttm_bo_device * bd)6*4882a593Smuzhiyun nouveau_bdev(struct ttm_bo_device *bd)
7*4882a593Smuzhiyun {
8*4882a593Smuzhiyun 	return container_of(bd, struct nouveau_drm, ttm.bdev);
9*4882a593Smuzhiyun }
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun extern const struct ttm_resource_manager_func nouveau_vram_manager;
12*4882a593Smuzhiyun extern const struct ttm_resource_manager_func nouveau_gart_manager;
13*4882a593Smuzhiyun extern const struct ttm_resource_manager_func nv04_gart_manager;
14*4882a593Smuzhiyun 
15*4882a593Smuzhiyun struct ttm_tt *nouveau_sgdma_create_ttm(struct ttm_buffer_object *bo,
16*4882a593Smuzhiyun 					u32 page_flags);
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun int  nouveau_ttm_init(struct nouveau_drm *drm);
19*4882a593Smuzhiyun void nouveau_ttm_fini(struct nouveau_drm *drm);
20*4882a593Smuzhiyun int  nouveau_ttm_mmap(struct file *, struct vm_area_struct *);
21*4882a593Smuzhiyun 
22*4882a593Smuzhiyun int  nouveau_ttm_global_init(struct nouveau_drm *);
23*4882a593Smuzhiyun void nouveau_ttm_global_release(struct nouveau_drm *);
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun int nouveau_sgdma_bind(struct ttm_bo_device *bdev, struct ttm_tt *ttm, struct ttm_resource *reg);
26*4882a593Smuzhiyun void nouveau_sgdma_unbind(struct ttm_bo_device *bdev, struct ttm_tt *ttm);
27*4882a593Smuzhiyun void nouveau_sgdma_destroy(struct ttm_bo_device *bdev, struct ttm_tt *ttm);
28*4882a593Smuzhiyun #endif
29