]> git.ipfire.org Git - thirdparty/kernel/linux.git/blame - drivers/gpu/drm/nouveau/nouveau_gem.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[thirdparty/kernel/linux.git] / drivers / gpu / drm / nouveau / nouveau_gem.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
66f24723
BS
2#ifndef __NOUVEAU_GEM_H__
3#define __NOUVEAU_GEM_H__
4
612a9aab 5#include <drm/drmP.h>
66f24723 6
4dc28134 7#include "nouveau_drv.h"
66f24723
BS
8#include "nouveau_bo.h"
9
10#define nouveau_bo_tile_layout(nvbo) \
11 ((nvbo)->tile_flags & NOUVEAU_GEM_TILE_LAYOUT_MASK)
12
13static inline struct nouveau_bo *
14nouveau_gem_object(struct drm_gem_object *gem)
15{
55fb74ad 16 return gem ? container_of(gem, struct nouveau_bo, gem) : NULL;
66f24723
BS
17}
18
19/* nouveau_gem.c */
4d8b3d34 20extern int nouveau_gem_new(struct nouveau_cli *, u64 size, int align,
66f24723
BS
21 uint32_t domain, uint32_t tile_mode,
22 uint32_t tile_flags, struct nouveau_bo **);
66f24723
BS
23extern void nouveau_gem_object_del(struct drm_gem_object *);
24extern int nouveau_gem_object_open(struct drm_gem_object *, struct drm_file *);
25extern void nouveau_gem_object_close(struct drm_gem_object *,
26 struct drm_file *);
27extern int nouveau_gem_ioctl_new(struct drm_device *, void *,
28 struct drm_file *);
29extern int nouveau_gem_ioctl_pushbuf(struct drm_device *, void *,
30 struct drm_file *);
31extern int nouveau_gem_ioctl_cpu_prep(struct drm_device *, void *,
32 struct drm_file *);
33extern int nouveau_gem_ioctl_cpu_fini(struct drm_device *, void *,
34 struct drm_file *);
35extern int nouveau_gem_ioctl_info(struct drm_device *, void *,
36 struct drm_file *);
37
ab9ccb96 38extern int nouveau_gem_prime_pin(struct drm_gem_object *);
3aac4502 39struct reservation_object *nouveau_gem_prime_res_obj(struct drm_gem_object *);
1af7c7dd 40extern void nouveau_gem_prime_unpin(struct drm_gem_object *);
ab9ccb96
AP
41extern struct sg_table *nouveau_gem_prime_get_sg_table(struct drm_gem_object *);
42extern struct drm_gem_object *nouveau_gem_prime_import_sg_table(
b5e9c1a2 43 struct drm_device *, struct dma_buf_attachment *, struct sg_table *);
ab9ccb96
AP
44extern void *nouveau_gem_prime_vmap(struct drm_gem_object *);
45extern void nouveau_gem_prime_vunmap(struct drm_gem_object *, void *);
66f24723
BS
46
47#endif