1 1.2 riastrad /* $NetBSD: nouveau_gem.h,v 1.3 2021/12/18 23:45:32 riastradh Exp $ */ 2 1.2 riastrad 3 1.3 riastrad /* SPDX-License-Identifier: MIT */ 4 1.1 riastrad #ifndef __NOUVEAU_GEM_H__ 5 1.1 riastrad #define __NOUVEAU_GEM_H__ 6 1.1 riastrad 7 1.3 riastrad #include "nouveau_drv.h" 8 1.1 riastrad #include "nouveau_bo.h" 9 1.1 riastrad 10 1.1 riastrad static inline struct nouveau_bo * 11 1.1 riastrad nouveau_gem_object(struct drm_gem_object *gem) 12 1.1 riastrad { 13 1.3 riastrad return gem ? container_of(gem, struct nouveau_bo, bo.base) : NULL; 14 1.1 riastrad } 15 1.1 riastrad 16 1.1 riastrad /* nouveau_gem.c */ 17 1.3 riastrad extern int nouveau_gem_new(struct nouveau_cli *, u64 size, int align, 18 1.1 riastrad uint32_t domain, uint32_t tile_mode, 19 1.1 riastrad uint32_t tile_flags, struct nouveau_bo **); 20 1.1 riastrad extern void nouveau_gem_object_del(struct drm_gem_object *); 21 1.1 riastrad extern int nouveau_gem_object_open(struct drm_gem_object *, struct drm_file *); 22 1.1 riastrad extern void nouveau_gem_object_close(struct drm_gem_object *, 23 1.1 riastrad struct drm_file *); 24 1.1 riastrad extern int nouveau_gem_ioctl_new(struct drm_device *, void *, 25 1.1 riastrad struct drm_file *); 26 1.1 riastrad extern int nouveau_gem_ioctl_pushbuf(struct drm_device *, void *, 27 1.1 riastrad struct drm_file *); 28 1.1 riastrad extern int nouveau_gem_ioctl_cpu_prep(struct drm_device *, void *, 29 1.1 riastrad struct drm_file *); 30 1.1 riastrad extern int nouveau_gem_ioctl_cpu_fini(struct drm_device *, void *, 31 1.1 riastrad struct drm_file *); 32 1.1 riastrad extern int nouveau_gem_ioctl_info(struct drm_device *, void *, 33 1.1 riastrad struct drm_file *); 34 1.1 riastrad 35 1.1 riastrad extern int nouveau_gem_prime_pin(struct drm_gem_object *); 36 1.1 riastrad extern void nouveau_gem_prime_unpin(struct drm_gem_object *); 37 1.1 riastrad extern struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object *); 38 1.1 riastrad extern struct drm_gem_object *nouveau_gem_prime_import_sg_table( 39 1.2 riastrad struct drm_device *, struct dma_buf_attachment *, struct sg_table *); 40 1.1 riastrad extern void *nouveau_gem_prime_vmap(struct drm_gem_object *); 41 1.1 riastrad extern void nouveau_gem_prime_vunmap(struct drm_gem_object *, void *); 42 1.1 riastrad 43 1.1 riastrad #endif 44