nouveau_gem.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 ? container_of(gem, struct nouveau_bo, gem) : 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 void nouveau_gem_object_del(struct drm_gem_object *);
  18. extern int nouveau_gem_object_open(struct drm_gem_object *, struct drm_file *);
  19. extern void nouveau_gem_object_close(struct drm_gem_object *,
  20. struct drm_file *);
  21. extern int nouveau_gem_ioctl_new(struct drm_device *, void *,
  22. struct drm_file *);
  23. extern int nouveau_gem_ioctl_pushbuf(struct drm_device *, void *,
  24. struct drm_file *);
  25. extern int nouveau_gem_ioctl_cpu_prep(struct drm_device *, void *,
  26. struct drm_file *);
  27. extern int nouveau_gem_ioctl_cpu_fini(struct drm_device *, void *,
  28. struct drm_file *);
  29. extern int nouveau_gem_ioctl_info(struct drm_device *, void *,
  30. struct drm_file *);
  31. extern int nouveau_gem_prime_pin(struct drm_gem_object *);
  32. struct reservation_object *nouveau_gem_prime_res_obj(struct drm_gem_object *);
  33. extern void nouveau_gem_prime_unpin(struct drm_gem_object *);
  34. extern struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object *);
  35. extern struct drm_gem_object *nouveau_gem_prime_import_sg_table(
  36. struct drm_device *, struct dma_buf_attachment *, struct sg_table *);
  37. extern void *nouveau_gem_prime_vmap(struct drm_gem_object *);
  38. extern void nouveau_gem_prime_vunmap(struct drm_gem_object *, void *);
  39. #endif