mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
drm/gem_vram/ttm: move to driver backend destroy function.
Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Christian König <christian.koenig@amd.com> Acked-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200907204630.1406528-10-airlied@gmail.com
This commit is contained in:
parent
5d26eba988
commit
84693830aa
@ -967,16 +967,12 @@ static const struct drm_gem_object_funcs drm_gem_vram_object_funcs = {
|
|||||||
* TTM TT
|
* TTM TT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void backend_func_destroy(struct ttm_bo_device *bdev, struct ttm_tt *tt)
|
static void bo_driver_ttm_tt_destroy(struct ttm_bo_device *bdev, struct ttm_tt *tt)
|
||||||
{
|
{
|
||||||
ttm_tt_fini(tt);
|
ttm_tt_fini(tt);
|
||||||
kfree(tt);
|
kfree(tt);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ttm_backend_func backend_func = {
|
|
||||||
.destroy = backend_func_destroy
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TTM BO device
|
* TTM BO device
|
||||||
*/
|
*/
|
||||||
@ -991,8 +987,6 @@ static struct ttm_tt *bo_driver_ttm_tt_create(struct ttm_buffer_object *bo,
|
|||||||
if (!tt)
|
if (!tt)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
tt->func = &backend_func;
|
|
||||||
|
|
||||||
ret = ttm_tt_init(tt, bo, page_flags);
|
ret = ttm_tt_init(tt, bo, page_flags);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err_ttm_tt_init;
|
goto err_ttm_tt_init;
|
||||||
@ -1054,6 +1048,7 @@ static int bo_driver_io_mem_reserve(struct ttm_bo_device *bdev,
|
|||||||
|
|
||||||
static struct ttm_bo_driver bo_driver = {
|
static struct ttm_bo_driver bo_driver = {
|
||||||
.ttm_tt_create = bo_driver_ttm_tt_create,
|
.ttm_tt_create = bo_driver_ttm_tt_create,
|
||||||
|
.ttm_tt_destroy = bo_driver_ttm_tt_destroy,
|
||||||
.eviction_valuable = ttm_bo_eviction_valuable,
|
.eviction_valuable = ttm_bo_eviction_valuable,
|
||||||
.evict_flags = bo_driver_evict_flags,
|
.evict_flags = bo_driver_evict_flags,
|
||||||
.move_notify = bo_driver_move_notify,
|
.move_notify = bo_driver_move_notify,
|
||||||
|
Loading…
Reference in New Issue
Block a user