Ben Skeggs | 66f2472 | 2012-07-18 22:15:33 +1000 | [diff] [blame] | 1 | #ifndef __NOUVEAU_GEM_H__ |
| 2 | #define __NOUVEAU_GEM_H__ |
| 3 | |
Linus Torvalds | 612a9aa | 2012-10-03 23:29:23 -0700 | [diff] [blame] | 4 | #include <drm/drmP.h> |
Ben Skeggs | 66f2472 | 2012-07-18 22:15:33 +1000 | [diff] [blame] | 5 | |
Linus Torvalds | 612a9aa | 2012-10-03 23:29:23 -0700 | [diff] [blame] | 6 | #include "nouveau_drm.h" |
Ben Skeggs | 66f2472 | 2012-07-18 22:15:33 +1000 | [diff] [blame] | 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 | { |
David Herrmann | 55fb74a | 2013-10-02 10:15:17 +0200 | [diff] [blame] | 15 | return gem ? container_of(gem, struct nouveau_bo, gem) : NULL; |
Ben Skeggs | 66f2472 | 2012-07-18 22:15:33 +1000 | [diff] [blame] | 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 **); |
Ben Skeggs | 66f2472 | 2012-07-18 22:15:33 +1000 | [diff] [blame] | 22 | extern void nouveau_gem_object_del(struct drm_gem_object *); |
| 23 | extern int nouveau_gem_object_open(struct drm_gem_object *, struct drm_file *); |
| 24 | extern void nouveau_gem_object_close(struct drm_gem_object *, |
| 25 | struct drm_file *); |
| 26 | extern int nouveau_gem_ioctl_new(struct drm_device *, void *, |
| 27 | struct drm_file *); |
| 28 | extern int nouveau_gem_ioctl_pushbuf(struct drm_device *, void *, |
| 29 | struct drm_file *); |
| 30 | extern int nouveau_gem_ioctl_cpu_prep(struct drm_device *, void *, |
| 31 | struct drm_file *); |
| 32 | extern int nouveau_gem_ioctl_cpu_fini(struct drm_device *, void *, |
| 33 | struct drm_file *); |
| 34 | extern int nouveau_gem_ioctl_info(struct drm_device *, void *, |
| 35 | struct drm_file *); |
| 36 | |
Aaron Plattner | ab9ccb9 | 2013-01-15 20:47:43 +0000 | [diff] [blame] | 37 | extern int nouveau_gem_prime_pin(struct drm_gem_object *); |
Maarten Lankhorst | 3aac450 | 2014-07-01 12:57:26 +0200 | [diff] [blame] | 38 | struct reservation_object *nouveau_gem_prime_res_obj(struct drm_gem_object *); |
Maarten Lankhorst | 1af7c7d | 2013-06-27 13:38:19 +0200 | [diff] [blame] | 39 | extern void nouveau_gem_prime_unpin(struct drm_gem_object *); |
Aaron Plattner | ab9ccb9 | 2013-01-15 20:47:43 +0000 | [diff] [blame] | 40 | extern struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object *); |
| 41 | extern struct drm_gem_object *nouveau_gem_prime_import_sg_table( |
Maarten Lankhorst | b5e9c1a | 2014-01-09 11:03:14 +0100 | [diff] [blame] | 42 | struct drm_device *, struct dma_buf_attachment *, struct sg_table *); |
Aaron Plattner | ab9ccb9 | 2013-01-15 20:47:43 +0000 | [diff] [blame] | 43 | extern void *nouveau_gem_prime_vmap(struct drm_gem_object *); |
| 44 | extern void nouveau_gem_prime_vunmap(struct drm_gem_object *, void *); |
Ben Skeggs | 66f2472 | 2012-07-18 22:15:33 +1000 | [diff] [blame] | 45 | |
| 46 | #endif |