aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c
index ec2904a0e9fc..1a254e69fece 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/nv50.c
@@ -196,9 +196,11 @@ nv50_instobj_acquire(struct nvkm_memory *memory)
}
/* Attempt to get a direct CPU mapping of the object. */
- if (!iobj->map && (vmm = nvkm_bar_bar2_vmm(imem->subdev.device)))
- nv50_instobj_kmap(iobj, vmm);
- map = iobj->map;
+ if ((vmm = nvkm_bar_bar2_vmm(imem->subdev.device))) {
+ if (!iobj->map)
+ nv50_instobj_kmap(iobj, vmm);
+ map = iobj->map;
+ }
if (!refcount_inc_not_zero(&iobj->maps)) {
if (map)