summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_uvmm.c
diff options
context:
space:
mode:
authorDanilo Krummrich <dakr@redhat.com>2023-08-07 18:32:26 +0200
committerDanilo Krummrich <dakr@redhat.com>2023-08-08 04:47:19 +0200
commita3540b46e92549092a9a4f70197ac6b95a0d4e71 (patch)
treef75aaf3877384d7f165a9727bceef8e8b42b3b99 /drivers/gpu/drm/nouveau/nouveau_uvmm.c
parentdrm/nouveau: uvmm: remove incorrect calls to mas_unlock() (diff)
downloadlinux-a3540b46e92549092a9a4f70197ac6b95a0d4e71.tar.xz
linux-a3540b46e92549092a9a4f70197ac6b95a0d4e71.zip
drm/nouveau: uvmm: remove dedicated VM pointer from VMAs
VMAs can find their corresponding VM through their embedded struct drm_gpuva which already carries a pointer to a struct drm_gpuva_manager which the VM is based on. Hence, remove the struct nouveau_uvmm pointer from struct nouveau_uvma to save a couple of bytes per mapping. Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Danilo Krummrich <dakr@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230807163238.2091-6-dakr@redhat.com
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_uvmm.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_uvmm.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.c b/drivers/gpu/drm/nouveau/nouveau_uvmm.c
index 91b964ef98b1..3a1e8538f205 100644
--- a/drivers/gpu/drm/nouveau/nouveau_uvmm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.c
@@ -181,7 +181,7 @@ nouveau_uvma_vmm_put(struct nouveau_uvma *uvma)
u64 addr = uvma->va.va.addr;
u64 range = uvma->va.va.range;
- return nouveau_uvmm_vmm_put(uvma->uvmm, addr, range);
+ return nouveau_uvmm_vmm_put(to_uvmm(uvma), addr, range);
}
static int
@@ -192,7 +192,7 @@ nouveau_uvma_map(struct nouveau_uvma *uvma,
u64 offset = uvma->va.gem.offset;
u64 range = uvma->va.va.range;
- return nouveau_uvmm_vmm_map(uvma->uvmm, addr, range,
+ return nouveau_uvmm_vmm_map(to_uvmm(uvma), addr, range,
offset, uvma->kind, mem);
}
@@ -206,7 +206,7 @@ nouveau_uvma_unmap(struct nouveau_uvma *uvma)
if (drm_gpuva_invalidated(&uvma->va))
return 0;
- return nouveau_uvmm_vmm_unmap(uvma->uvmm, addr, range, sparse);
+ return nouveau_uvmm_vmm_unmap(to_uvmm(uvma), addr, range, sparse);
}
static int
@@ -586,7 +586,6 @@ op_map_prepare(struct nouveau_uvmm *uvmm,
if (ret)
return ret;
- uvma->uvmm = uvmm;
uvma->region = args->region;
uvma->kind = args->kind;
@@ -794,7 +793,7 @@ op_unmap_range(struct drm_gpuva_op_unmap *u,
bool sparse = !!uvma->region;
if (!drm_gpuva_invalidated(u->va))
- nouveau_uvmm_vmm_unmap(uvma->uvmm, addr, range, sparse);
+ nouveau_uvmm_vmm_unmap(to_uvmm(uvma), addr, range, sparse);
}
static void