diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2017-11-01 03:56:19 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2017-11-02 13:32:31 +1000 |
commit | c83c4097eba8950bc7028f0846c21f9718dd8697 (patch) | |
tree | 43991784ded74f12e8d7f8f1a1142fbfdcb2ba46 /drivers/gpu/drm/nouveau/include | |
parent | drm/nouveau/mmu: define user interfaces to mmu (diff) | |
download | linux-dev-c83c4097eba8950bc7028f0846c21f9718dd8697.tar.xz linux-dev-c83c4097eba8950bc7028f0846c21f9718dd8697.zip |
drm/nouveau/mmu: define user interfaces to mmu memory allocation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/include')
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvif/if000a.h | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvif/mem.h | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/core/client.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h | 1 |
4 files changed, 31 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvif/if000a.h b/drivers/gpu/drm/nouveau/include/nvif/if000a.h index e6e8764abf4a..88d0938fbd5a 100644 --- a/drivers/gpu/drm/nouveau/include/nvif/if000a.h +++ b/drivers/gpu/drm/nouveau/include/nvif/if000a.h @@ -1,5 +1,14 @@ #ifndef __NVIF_IF000A_H__ #define __NVIF_IF000A_H__ +struct nvif_mem_v0 { + __u8 version; + __u8 type; + __u8 page; + __u8 pad03[5]; + __u64 size; + __u64 addr; + __u8 data[]; +}; struct nvif_mem_ram_vn { }; diff --git a/drivers/gpu/drm/nouveau/include/nvif/mem.h b/drivers/gpu/drm/nouveau/include/nvif/mem.h new file mode 100644 index 000000000000..b542fe38398e --- /dev/null +++ b/drivers/gpu/drm/nouveau/include/nvif/mem.h @@ -0,0 +1,18 @@ +#ifndef __NVIF_MEM_H__ +#define __NVIF_MEM_H__ +#include "mmu.h" + +struct nvif_mem { + struct nvif_object object; + u8 type; + u8 page; + u64 addr; + u64 size; +}; + +int nvif_mem_init_type(struct nvif_mmu *mmu, s32 oclass, int type, u8 page, + u64 size, void *argv, u32 argc, struct nvif_mem *); +int nvif_mem_init(struct nvif_mmu *mmu, s32 oclass, u8 type, u8 page, + u64 size, void *argv, u32 argc, struct nvif_mem *); +void nvif_mem_fini(struct nvif_mem *); +#endif diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/client.h b/drivers/gpu/drm/nouveau/include/nvkm/core/client.h index e876634da10a..fa58efb0d42a 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/client.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/client.h @@ -17,6 +17,9 @@ struct nvkm_client { int (*ntfy)(const void *, u32, const void *, u32); struct nvkm_vm *vm; + + struct list_head umem; + spinlock_t lock; }; int nvkm_client_new(const char *name, u64 device, const char *cfg, diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h index c58394baeb7c..0de5f8b7096a 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h @@ -98,6 +98,7 @@ int nvkm_vmm_map(struct nvkm_vmm *, struct nvkm_vma *, void *argv, u32 argc, struct nvkm_vmm_map *); void nvkm_vmm_unmap(struct nvkm_vmm *, struct nvkm_vma *); +struct nvkm_memory *nvkm_umem_search(struct nvkm_client *, u64); struct nvkm_vmm *nvkm_uvmm_search(struct nvkm_client *, u64 handle); struct nvkm_mmu { |