nouveau_gem.h 1.5 KB

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