1 /* $NetBSD: nouveau_gem.h,v 1.2 2018/08/27 04:58:24 riastradh Exp $ */ 2 3 #ifndef __NOUVEAU_GEM_H__ 4 #define __NOUVEAU_GEM_H__ 5 6 #include <drm/drmP.h> 7 8 #include "nouveau_drm.h" 9 #include "nouveau_bo.h" 10 11 #define nouveau_bo_tile_layout(nvbo) \ 12 ((nvbo)->tile_flags & NOUVEAU_GEM_TILE_LAYOUT_MASK) 13 14 static inline struct nouveau_bo * 15 nouveau_gem_object(struct drm_gem_object *gem) 16 { 17 return gem ? container_of(gem, struct nouveau_bo, gem) : NULL; 18 } 19 20 /* nouveau_gem.c */ 21 extern int nouveau_gem_new(struct drm_device *, int size, int align, 22 uint32_t domain, uint32_t tile_mode, 23 uint32_t tile_flags, struct nouveau_bo **); 24 extern void nouveau_gem_object_del(struct drm_gem_object *); 25 extern int nouveau_gem_object_open(struct drm_gem_object *, struct drm_file *); 26 extern void nouveau_gem_object_close(struct drm_gem_object *, 27 struct drm_file *); 28 extern int nouveau_gem_ioctl_new(struct drm_device *, void *, 29 struct drm_file *); 30 extern int nouveau_gem_ioctl_pushbuf(struct drm_device *, void *, 31 struct drm_file *); 32 extern int nouveau_gem_ioctl_cpu_prep(struct drm_device *, void *, 33 struct drm_file *); 34 extern int nouveau_gem_ioctl_cpu_fini(struct drm_device *, void *, 35 struct drm_file *); 36 extern int nouveau_gem_ioctl_info(struct drm_device *, void *, 37 struct drm_file *); 38 39 extern int nouveau_gem_prime_pin(struct drm_gem_object *); 40 struct reservation_object *nouveau_gem_prime_res_obj(struct drm_gem_object *); 41 extern void nouveau_gem_prime_unpin(struct drm_gem_object *); 42 extern struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object *); 43 extern struct drm_gem_object *nouveau_gem_prime_import_sg_table( 44 struct drm_device *, struct dma_buf_attachment *, struct sg_table *); 45 extern void *nouveau_gem_prime_vmap(struct drm_gem_object *); 46 extern void nouveau_gem_prime_vunmap(struct drm_gem_object *, void *); 47 48 #endif 49