Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: MIT */
0002 #ifndef __NOUVEAU_GEM_H__
0003 #define __NOUVEAU_GEM_H__
0004 
0005 #include "nouveau_drv.h"
0006 #include "nouveau_bo.h"
0007 
0008 extern const struct drm_gem_object_funcs nouveau_gem_object_funcs;
0009 
0010 static inline struct nouveau_bo *
0011 nouveau_gem_object(struct drm_gem_object *gem)
0012 {
0013     return gem ? container_of(gem, struct nouveau_bo, bo.base) : NULL;
0014 }
0015 
0016 /* nouveau_gem.c */
0017 extern int nouveau_gem_new(struct nouveau_cli *, u64 size, int align,
0018                uint32_t domain, uint32_t tile_mode,
0019                uint32_t tile_flags, struct nouveau_bo **);
0020 extern void nouveau_gem_object_del(struct drm_gem_object *);
0021 extern int nouveau_gem_object_open(struct drm_gem_object *, struct drm_file *);
0022 extern void nouveau_gem_object_close(struct drm_gem_object *,
0023                      struct drm_file *);
0024 extern int nouveau_gem_ioctl_new(struct drm_device *, void *,
0025                  struct drm_file *);
0026 extern int nouveau_gem_ioctl_pushbuf(struct drm_device *, void *,
0027                      struct drm_file *);
0028 extern int nouveau_gem_ioctl_cpu_prep(struct drm_device *, void *,
0029                       struct drm_file *);
0030 extern int nouveau_gem_ioctl_cpu_fini(struct drm_device *, void *,
0031                       struct drm_file *);
0032 extern int nouveau_gem_ioctl_info(struct drm_device *, void *,
0033                   struct drm_file *);
0034 
0035 extern int nouveau_gem_prime_pin(struct drm_gem_object *);
0036 extern void nouveau_gem_prime_unpin(struct drm_gem_object *);
0037 extern struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object *);
0038 extern struct drm_gem_object *nouveau_gem_prime_import_sg_table(
0039     struct drm_device *, struct dma_buf_attachment *, struct sg_table *);
0040 
0041 #endif