1 #ifndef __NOUVEAU_GEM_H__ 2 #define __NOUVEAU_GEM_H__ 3 4 #include <drm/drmP.h> 5 6 #include "nouveau_drm.h" 7 #include "nouveau_bo.h" 8 9 #define nouveau_bo_tile_layout(nvbo) \ 10 ((nvbo)->tile_flags & NOUVEAU_GEM_TILE_LAYOUT_MASK) 11 12 static inline struct nouveau_bo * 13 nouveau_gem_object(struct drm_gem_object *gem) 14 { 15 return gem ? gem->driver_private : NULL; 16 } 17 18 /* nouveau_gem.c */ 19 extern int nouveau_gem_new(struct drm_device *, int size, int align, 20 uint32_t domain, uint32_t tile_mode, 21 uint32_t tile_flags, struct nouveau_bo **); 22 extern int nouveau_gem_object_new(struct drm_gem_object *); 23 extern void nouveau_gem_object_del(struct drm_gem_object *); 24 extern int nouveau_gem_object_open(struct drm_gem_object *, struct drm_file *); 25 extern void nouveau_gem_object_close(struct drm_gem_object *, 26 struct drm_file *); 27 extern int nouveau_gem_ioctl_new(struct drm_device *, void *, 28 struct drm_file *); 29 extern int nouveau_gem_ioctl_pushbuf(struct drm_device *, void *, 30 struct drm_file *); 31 extern int nouveau_gem_ioctl_cpu_prep(struct drm_device *, void *, 32 struct drm_file *); 33 extern int nouveau_gem_ioctl_cpu_fini(struct drm_device *, void *, 34 struct drm_file *); 35 extern int nouveau_gem_ioctl_info(struct drm_device *, void *, 36 struct drm_file *); 37 38 extern struct dma_buf *nouveau_gem_prime_export(struct drm_device *dev, 39 struct drm_gem_object *obj, int flags); 40 extern struct drm_gem_object *nouveau_gem_prime_import(struct drm_device *dev, 41 struct dma_buf *dma_buf); 42 43 #endif 44