diff options
| author | Danilo Krummrich <dakr@redhat.com> | 2023-08-04 20:23:50 +0200 |
|---|---|---|
| committer | Danilo Krummrich <dakr@redhat.com> | 2023-08-04 20:34:39 +0200 |
| commit | 6b252cf42281045a9f803d2198023500cfa6ebd2 (patch) | |
| tree | f3c5d3ad01638a449b6b41e7ef7e15e05f941654 /drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h | |
| parent | drm/nouveau: chan: provide nouveau_channel_kill() (diff) | |
| download | linux-6b252cf42281045a9f803d2198023500cfa6ebd2.tar.gz linux-6b252cf42281045a9f803d2198023500cfa6ebd2.zip | |
drm/nouveau: nvkm/vmm: implement raw ops to manage uvmm
The new VM_BIND UAPI uses the DRM GPU VA manager to manage the VA space.
Hence, we a need a way to manipulate the MMUs page tables without going
through the internal range allocator implemented by nvkm/vmm.
This patch adds a raw interface for nvkm/vmm to pass the resposibility
for managing the address space and the corresponding map/unmap/sparse
operations to the upper layers.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230804182406.5222-11-dakr@redhat.com
Diffstat (limited to 'drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h')
| -rw-r--r-- | drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h index 70e7887ef4b4..2fd2f2433fc7 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h @@ -17,6 +17,7 @@ struct nvkm_vma { bool part:1; /* Region was split from an allocated region by map(). */ bool busy:1; /* Region busy (for temporarily preventing user access). */ bool mapped:1; /* Region contains valid pages. */ + bool no_comp:1; /* Force no memory compression. */ struct nvkm_memory *memory; /* Memory currently mapped into VMA. */ struct nvkm_tags *tags; /* Compression tag reference. */ }; @@ -27,10 +28,26 @@ struct nvkm_vmm { const char *name; u32 debug; struct kref kref; - struct mutex mutex; + + struct { + struct mutex vmm; + struct mutex ref; + struct mutex map; + } mutex; u64 start; u64 limit; + struct { + struct { + u64 addr; + u64 size; + } p; + struct { + u64 addr; + u64 size; + } n; + bool raw; + } managed; struct nvkm_vmm_pt *pd; struct list_head join; @@ -70,6 +87,7 @@ struct nvkm_vmm_map { const struct nvkm_vmm_page *page; + bool no_comp; struct nvkm_tags *tags; u64 next; u64 type; |
