Skip to content

Commit

Permalink
drm/nouveau/drm/nouveau: Pass the proper arguments to nvif_object_map…
Browse files Browse the repository at this point in the history
…_handle()

This is obviously wrong in the current code. Make sure to record the
correct size of the arguments and pass the actual arguments to the
nvif_object_map_handle() function.

Suggested-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Thierry Reding authored and Ben Skeggs committed Jan 19, 2018
1 parent 1b5c7ef commit b554b12
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/nouveau/nouveau_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1447,19 +1447,21 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *reg)
args.nv50.ro = 0;
args.nv50.kind = mem->kind;
args.nv50.comp = mem->comp;
argc = sizeof(args.nv50);
break;
case NVIF_CLASS_MEM_GF100:
args.gf100.version = 0;
args.gf100.ro = 0;
args.gf100.kind = mem->kind;
argc = sizeof(args.gf100);
break;
default:
WARN_ON(1);
break;
}

ret = nvif_object_map_handle(&mem->mem.object,
&argc, argc,
&args, argc,
&handle, &length);
if (ret != 1)
return ret ? ret : -EINVAL;
Expand Down

0 comments on commit b554b12

Please sign in to comment.