]> Git Repo - linux.git/commitdiff
drm/ttm: revert "stop allocating dummy resources during BO creation"
authorChristian König <[email protected]>
Wed, 25 Jan 2023 15:49:02 +0000 (16:49 +0100)
committerChristian König <[email protected]>
Wed, 25 Jan 2023 16:27:51 +0000 (17:27 +0100)
This reverts commit 00984ad39599bb2a1e6ec5d4e9c75a749f7f45c9.

It seems to still breka i915.

Signed-off-by: Christian König <[email protected]>
Acked-by: Matthew Auld <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/ttm/ttm_bo.c

index bb0c21c8caac790ebad0fe66d896387491332743..326a3d13a82956846a428ac2e395bab48297a486 100644 (file)
@@ -953,6 +953,7 @@ int ttm_bo_init_reserved(struct ttm_device *bdev, struct ttm_buffer_object *bo,
                         struct sg_table *sg, struct dma_resv *resv,
                         void (*destroy) (struct ttm_buffer_object *))
 {
+       static const struct ttm_place sys_mem = { .mem_type = TTM_PL_SYSTEM };
        int ret;
 
        kref_init(&bo->kref);
@@ -969,6 +970,12 @@ int ttm_bo_init_reserved(struct ttm_device *bdev, struct ttm_buffer_object *bo,
                bo->base.resv = &bo->base._resv;
        atomic_inc(&ttm_glob.bo_count);
 
+       ret = ttm_resource_alloc(bo, &sys_mem, &bo->resource);
+       if (unlikely(ret)) {
+               ttm_bo_put(bo);
+               return ret;
+       }
+
        /*
         * For ttm_bo_type_device buffers, allocate
         * address space from the device.
This page took 0.06007 seconds and 4 git commands to generate.