166f24723SBen Skeggs #ifndef __NOUVEAU_GEM_H__ 266f24723SBen Skeggs #define __NOUVEAU_GEM_H__ 366f24723SBen Skeggs 4612a9aabSLinus Torvalds #include <drm/drmP.h> 566f24723SBen Skeggs 6612a9aabSLinus Torvalds #include "nouveau_drm.h" 766f24723SBen Skeggs #include "nouveau_bo.h" 866f24723SBen Skeggs 966f24723SBen Skeggs #define nouveau_bo_tile_layout(nvbo) \ 1066f24723SBen Skeggs ((nvbo)->tile_flags & NOUVEAU_GEM_TILE_LAYOUT_MASK) 1166f24723SBen Skeggs 1266f24723SBen Skeggs static inline struct nouveau_bo * 1366f24723SBen Skeggs nouveau_gem_object(struct drm_gem_object *gem) 1466f24723SBen Skeggs { 1566f24723SBen Skeggs return gem ? gem->driver_private : NULL; 1666f24723SBen Skeggs } 1766f24723SBen Skeggs 1866f24723SBen Skeggs /* nouveau_gem.c */ 1966f24723SBen Skeggs extern int nouveau_gem_new(struct drm_device *, int size, int align, 2066f24723SBen Skeggs uint32_t domain, uint32_t tile_mode, 2166f24723SBen Skeggs uint32_t tile_flags, struct nouveau_bo **); 2266f24723SBen Skeggs extern int nouveau_gem_object_new(struct drm_gem_object *); 2366f24723SBen Skeggs extern void nouveau_gem_object_del(struct drm_gem_object *); 2466f24723SBen Skeggs extern int nouveau_gem_object_open(struct drm_gem_object *, struct drm_file *); 2566f24723SBen Skeggs extern void nouveau_gem_object_close(struct drm_gem_object *, 2666f24723SBen Skeggs struct drm_file *); 2766f24723SBen Skeggs extern int nouveau_gem_ioctl_new(struct drm_device *, void *, 2866f24723SBen Skeggs struct drm_file *); 2966f24723SBen Skeggs extern int nouveau_gem_ioctl_pushbuf(struct drm_device *, void *, 3066f24723SBen Skeggs struct drm_file *); 3166f24723SBen Skeggs extern int nouveau_gem_ioctl_cpu_prep(struct drm_device *, void *, 3266f24723SBen Skeggs struct drm_file *); 3366f24723SBen Skeggs extern int nouveau_gem_ioctl_cpu_fini(struct drm_device *, void *, 3466f24723SBen Skeggs struct drm_file *); 3566f24723SBen Skeggs extern int nouveau_gem_ioctl_info(struct drm_device *, void *, 3666f24723SBen Skeggs struct drm_file *); 3766f24723SBen Skeggs 38ab9ccb96SAaron Plattner extern int nouveau_gem_prime_pin(struct drm_gem_object *); 39*1af7c7ddSMaarten Lankhorst extern void nouveau_gem_prime_unpin(struct drm_gem_object *); 40ab9ccb96SAaron Plattner extern struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object *); 41ab9ccb96SAaron Plattner extern struct drm_gem_object *nouveau_gem_prime_import_sg_table( 42ab9ccb96SAaron Plattner struct drm_device *, size_t size, struct sg_table *); 43ab9ccb96SAaron Plattner extern void *nouveau_gem_prime_vmap(struct drm_gem_object *); 44ab9ccb96SAaron Plattner extern void nouveau_gem_prime_vunmap(struct drm_gem_object *, void *); 4566f24723SBen Skeggs 4666f24723SBen Skeggs #endif 47