1 /* SPDX-License-Identifier: MIT */
2 #ifndef __NOUVEAU_GEM_H__
3 #define __NOUVEAU_GEM_H__
5 #include "nouveau_drv.h"
6 #include "nouveau_bo.h"
8 static inline struct nouveau_bo
*
9 nouveau_gem_object(struct drm_gem_object
*gem
)
11 return gem
? container_of(gem
, struct nouveau_bo
, bo
.base
) : NULL
;
15 extern int nouveau_gem_new(struct nouveau_cli
*, u64 size
, int align
,
16 uint32_t domain
, uint32_t tile_mode
,
17 uint32_t tile_flags
, struct nouveau_bo
**);
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
*,
22 extern int nouveau_gem_ioctl_new(struct drm_device
*, void *,
24 extern int nouveau_gem_ioctl_pushbuf(struct drm_device
*, void *,
26 extern int nouveau_gem_ioctl_cpu_prep(struct drm_device
*, void *,
28 extern int nouveau_gem_ioctl_cpu_fini(struct drm_device
*, void *,
30 extern int nouveau_gem_ioctl_info(struct drm_device
*, void *,
33 extern int nouveau_gem_prime_pin(struct drm_gem_object
*);
34 extern void nouveau_gem_prime_unpin(struct drm_gem_object
*);
35 extern struct sg_table
*nouveau_gem_prime_get_sg_table(struct drm_gem_object
*);
36 extern struct drm_gem_object
*nouveau_gem_prime_import_sg_table(
37 struct drm_device
*, struct dma_buf_attachment
*, struct sg_table
*);
38 extern void *nouveau_gem_prime_vmap(struct drm_gem_object
*);
39 extern void nouveau_gem_prime_vunmap(struct drm_gem_object
*, void *);