aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_resource.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2021-02-16 18:03:52 +0000
committerChristian König <[email protected]>2021-05-03 10:50:41 +0000
commitd79025c7f5e376413780f547e3a31b16575b83d7 (patch)
tree2a62cc58ed5248d4ef9dbada12c5b5a198c9ce2c /drivers/gpu/drm/ttm/ttm_resource.c
parentdrm/ttm: add ttm_sys_manager v3 (diff)
downloadkernel-d79025c7f5e376413780f547e3a31b16575b83d7.tar.gz
kernel-d79025c7f5e376413780f547e3a31b16575b83d7.zip
drm/ttm: always initialize the full ttm_resource v2
Init all fields in ttm_resource_alloc() when we create a new resource. v2: use place->mem_type instead of res->mem_type Signed-off-by: Christian König <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_resource.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_resource.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c
index fc351700d035..59e2b7157e41 100644
--- a/drivers/gpu/drm/ttm/ttm_resource.c
+++ b/drivers/gpu/drm/ttm/ttm_resource.c
@@ -30,9 +30,18 @@ int ttm_resource_alloc(struct ttm_buffer_object *bo,
struct ttm_resource *res)
{
struct ttm_resource_manager *man =
- ttm_manager_type(bo->bdev, res->mem_type);
+ ttm_manager_type(bo->bdev, place->mem_type);
res->mm_node = NULL;
+ res->start = 0;
+ res->num_pages = PFN_UP(bo->base.size);
+ res->mem_type = place->mem_type;
+ res->placement = place->flags;
+ res->bus.addr = NULL;
+ res->bus.offset = 0;
+ res->bus.is_iomem = false;
+ res->bus.caching = ttm_cached;
+
return man->func->alloc(man, bo, place, res);
}