mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
drm/ttm: remove special handling for non GEM drivers
vmwgfx is the only driver actually using this. Move the handling into the driver instead. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Zack Rusin <zackr@vmware.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210419092853.1605-1-christian.koenig@amd.com
This commit is contained in:
@@ -460,6 +460,7 @@ void vmw_bo_bo_free(struct ttm_buffer_object *bo)
|
||||
WARN_ON(vmw_bo->dirty);
|
||||
WARN_ON(!RB_EMPTY_ROOT(&vmw_bo->res_tree));
|
||||
vmw_bo_unmap(vmw_bo);
|
||||
dma_resv_fini(&bo->base._resv);
|
||||
kfree(vmw_bo);
|
||||
}
|
||||
|
||||
@@ -512,6 +513,11 @@ int vmw_bo_create_kernel(struct vmw_private *dev_priv, unsigned long size,
|
||||
if (unlikely(ret))
|
||||
goto error_free;
|
||||
|
||||
|
||||
bo->base.size = size;
|
||||
dma_resv_init(&bo->base._resv);
|
||||
drm_vma_node_reset(&bo->base.vma_node);
|
||||
|
||||
ret = ttm_bo_init_reserved(&dev_priv->bdev, bo, size,
|
||||
ttm_bo_type_device, placement, 0,
|
||||
&ctx, NULL, NULL, NULL);
|
||||
@@ -570,6 +576,10 @@ int vmw_bo_init(struct vmw_private *dev_priv,
|
||||
if (unlikely(ret))
|
||||
return ret;
|
||||
|
||||
vmw_bo->base.base.size = size;
|
||||
dma_resv_init(&vmw_bo->base.base._resv);
|
||||
drm_vma_node_reset(&vmw_bo->base.base.vma_node);
|
||||
|
||||
ret = ttm_bo_init_reserved(bdev, &vmw_bo->base, size,
|
||||
ttm_bo_type_device, placement,
|
||||
0, &ctx, NULL, NULL, bo_free);
|
||||
|
||||
Reference in New Issue
Block a user