]>
git.proxmox.com Git - mirror_ubuntu-kernels.git/blob - drivers/gpu/drm/nouveau/include/nvkm/core/gpuobj.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NVKM_GPUOBJ_H__
3 #define __NVKM_GPUOBJ_H__
4 #include <core/object.h>
5 #include <core/memory.h>
10 #define NVOBJ_FLAG_ZERO_ALLOC 0x00000001
11 #define NVOBJ_FLAG_HEAP 0x00000004
14 struct nvkm_object object
;
15 const struct nvkm_gpuobj_func
*func
;
16 struct nvkm_gpuobj
*parent
;
17 struct nvkm_memory
*memory
;
18 struct nvkm_mm_node
*node
;
27 struct nvkm_gpuobj_func
{
28 void *(*acquire
)(struct nvkm_gpuobj
*);
29 void (*release
)(struct nvkm_gpuobj
*);
30 u32 (*rd32
)(struct nvkm_gpuobj
*, u32 offset
);
31 void (*wr32
)(struct nvkm_gpuobj
*, u32 offset
, u32 data
);
34 int nvkm_gpuobj_new(struct nvkm_device
*, u32 size
, int align
, bool zero
,
35 struct nvkm_gpuobj
*parent
, struct nvkm_gpuobj
**);
36 void nvkm_gpuobj_del(struct nvkm_gpuobj
**);
37 int nvkm_gpuobj_wrap(struct nvkm_memory
*, struct nvkm_gpuobj
**);
38 int nvkm_gpuobj_map(struct nvkm_gpuobj
*, struct nvkm_vm
*, u32 access
,
40 void nvkm_gpuobj_unmap(struct nvkm_vma
*);
41 void nvkm_gpuobj_memcpy_to(struct nvkm_gpuobj
*dst
, u32 dstoffset
, void *src
,
43 void nvkm_gpuobj_memcpy_from(void *dst
, struct nvkm_gpuobj
*src
, u32 srcoffset
,