]> Git Repo - linux.git/commitdiff
drm/nouveau: init the base GEM fields for internal BOs
authorChristian König <[email protected]>
Wed, 9 Jun 2021 17:25:56 +0000 (19:25 +0200)
committerChristian König <[email protected]>
Thu, 10 Jun 2021 10:05:21 +0000 (12:05 +0200)
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]
drivers/gpu/drm/nouveau/nouveau_bo.c

index 520b1ea9d16c7fb5cf6f8748b9bddde2e9a88654..085023624fb0d79efd08920114fed1964d0e7e58 100644 (file)
@@ -149,6 +149,8 @@ nouveau_bo_del_ttm(struct ttm_buffer_object *bo)
         */
        if (bo->base.dev)
                drm_gem_object_release(&bo->base);
+       else
+               dma_resv_fini(&bo->base._resv);
 
        kfree(nvbo);
 }
@@ -330,6 +332,10 @@ nouveau_bo_new(struct nouveau_cli *cli, u64 size, int align,
        if (IS_ERR(nvbo))
                return PTR_ERR(nvbo);
 
+       nvbo->bo.base.size = size;
+       dma_resv_init(&nvbo->bo.base._resv);
+       drm_vma_node_reset(&nvbo->bo.base.vma_node);
+
        ret = nouveau_bo_init(nvbo, size, align, domain, sg, robj);
        if (ret)
                return ret;
This page took 0.060273 seconds and 4 git commands to generate.