Skip to content

Commit a3a9ee4

Browse files
drm/nouveau: init the base GEM fields for internal BOs
TTMs buffer objects are based on GEM objects for quite a while and rely on initializing those fields before initializing the TTM BO. Nouveau now doesn't init the GEM object for internally allocated BOs, so make sure that we at least initialize some necessary fields. Signed-off-by: Christian König <[email protected]> Tested-by: Mikko Perttunen <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Reviewed-by: Huang Rui <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent fa5239f commit a3a9ee4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/gpu/drm/nouveau/nouveau_bo.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ nouveau_bo_del_ttm(struct ttm_buffer_object *bo)
149149
*/
150150
if (bo->base.dev)
151151
drm_gem_object_release(&bo->base);
152+
else
153+
dma_resv_fini(&bo->base._resv);
152154

153155
kfree(nvbo);
154156
}
@@ -330,6 +332,10 @@ nouveau_bo_new(struct nouveau_cli *cli, u64 size, int align,
330332
if (IS_ERR(nvbo))
331333
return PTR_ERR(nvbo);
332334

335+
nvbo->bo.base.size = size;
336+
dma_resv_init(&nvbo->bo.base._resv);
337+
drm_vma_node_reset(&nvbo->bo.base.vma_node);
338+
333339
ret = nouveau_bo_init(nvbo, size, align, domain, sg, robj);
334340
if (ret)
335341
return ret;

0 commit comments

Comments
 (0)