1 #ifndef __NVKM_GPUOBJ_H__
2 #define __NVKM_GPUOBJ_H__
3 #include <core/object.h>
4 #include <core/memory.h>
9 #define NVOBJ_FLAG_ZERO_ALLOC 0x00000001
10 #define NVOBJ_FLAG_HEAP 0x00000004
13 struct nvkm_object object;
14 const struct nvkm_gpuobj_func *func;
15 struct nvkm_gpuobj *parent;
16 struct nvkm_memory *memory;
17 struct nvkm_mm_node *node;
26 struct nvkm_gpuobj_func {
27 void *(*acquire)(struct nvkm_gpuobj *);
28 void (*release)(struct nvkm_gpuobj *);
29 u32 (*rd32)(struct nvkm_gpuobj *, u32 offset);
30 void (*wr32)(struct nvkm_gpuobj *, u32 offset, u32 data);
33 int nvkm_gpuobj_new(struct nvkm_device *, u32 size, int align, bool zero,
34 struct nvkm_gpuobj *parent, struct nvkm_gpuobj **);
35 void nvkm_gpuobj_del(struct nvkm_gpuobj **);
36 int nvkm_gpuobj_wrap(struct nvkm_memory *, struct nvkm_gpuobj **);
37 int nvkm_gpuobj_map(struct nvkm_gpuobj *, struct nvkm_vm *, u32 access,
39 void nvkm_gpuobj_unmap(struct nvkm_vma *);