Skip to content

Commit a7f7d13

Browse files
committed
drm/nouveau: bo: initialize GEM GPU VA interface
Initialize the GEM's DRM GPU VA manager interface in preparation for the (u)vmm implementation, provided by subsequent commits, to make use of it. Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Danilo Krummrich <dakr@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230804182406.5222-6-dakr@redhat.com
1 parent 7b05a7c commit a7f7d13

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/gpu/drm/nouveau/nouveau_bo.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ nouveau_bo_alloc(struct nouveau_cli *cli, u64 *size, int *align, u32 domain,
215215
nvbo = kzalloc(sizeof(struct nouveau_bo), GFP_KERNEL);
216216
if (!nvbo)
217217
return ERR_PTR(-ENOMEM);
218+
218219
INIT_LIST_HEAD(&nvbo->head);
219220
INIT_LIST_HEAD(&nvbo->entry);
220221
INIT_LIST_HEAD(&nvbo->vma_list);
@@ -339,6 +340,11 @@ nouveau_bo_new(struct nouveau_cli *cli, u64 size, int align,
339340
dma_resv_init(&nvbo->bo.base._resv);
340341
drm_vma_node_reset(&nvbo->bo.base.vma_node);
341342

343+
/* This must be called before ttm_bo_init_reserved(). Subsequent
344+
* bo_move() callbacks might already iterate the GEMs GPUVA list.
345+
*/
346+
drm_gem_gpuva_init(&nvbo->bo.base);
347+
342348
ret = nouveau_bo_init(nvbo, size, align, domain, sg, robj);
343349
if (ret)
344350
return ret;

0 commit comments

Comments
 (0)