diff options
author | Danilo Krummrich <dakr@redhat.com> | 2023-08-07 19:32:26 +0300 |
---|---|---|
committer | Danilo Krummrich <dakr@redhat.com> | 2023-08-08 05:47:19 +0300 |
commit | a3540b46e92549092a9a4f70197ac6b95a0d4e71 (patch) | |
tree | f75aaf3877384d7f165a9727bceef8e8b42b3b99 /drivers/gpu/drm/nouveau/nouveau_uvmm.h | |
parent | 3cbc772107af4d57a2e2a7eb7fe711c334fd008a (diff) | |
download | linux-a3540b46e92549092a9a4f70197ac6b95a0d4e71.tar.xz |
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.h')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_uvmm.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_uvmm.h b/drivers/gpu/drm/nouveau/nouveau_uvmm.h index 534baadc3bf7..fc7f6fd2a4e1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_uvmm.h +++ b/drivers/gpu/drm/nouveau/nouveau_uvmm.h @@ -37,12 +37,15 @@ struct nouveau_uvma_region { struct nouveau_uvma { struct drm_gpuva va; - struct nouveau_uvmm *uvmm; struct nouveau_uvma_region *region; - u8 kind; }; +#define uvmm_from_mgr(x) container_of((x), struct nouveau_uvmm, umgr) +#define uvma_from_va(x) container_of((x), struct nouveau_uvma, va) + +#define to_uvmm(x) uvmm_from_mgr((x)->va.mgr) + struct nouveau_uvmm_bind_job { struct nouveau_job base; @@ -79,9 +82,6 @@ struct nouveau_uvmm_bind_job_args { #define to_uvmm_bind_job(job) container_of((job), struct nouveau_uvmm_bind_job, base) -#define uvmm_from_mgr(x) container_of((x), struct nouveau_uvmm, umgr) -#define uvma_from_va(x) container_of((x), struct nouveau_uvma, va) - int nouveau_uvmm_init(struct nouveau_uvmm *uvmm, struct nouveau_cli *cli, u64 kernel_managed_addr, u64 kernel_managed_size); void nouveau_uvmm_fini(struct nouveau_uvmm *uvmm); |