Commit 0c8fb246 authored by Christian König's avatar Christian König

drm/ttm: revert "stop allocating dummy resources during BO creation"

This reverts commit 00984ad3.

It seems to still breka i915.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Acked-by: default avatarMatthew Auld <matthew.william.auld@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230125155023.105584-1-christian.koenig@amd.com
parent fc113707
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment