diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3228-drm-ttm-Add-release_notify-callback-to-ttm_bo_driver.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3228-drm-ttm-Add-release_notify-callback-to-ttm_bo_driver.patch | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3228-drm-ttm-Add-release_notify-callback-to-ttm_bo_driver.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3228-drm-ttm-Add-release_notify-callback-to-ttm_bo_driver.patch new file mode 100644 index 00000000..5d5c14f1 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3228-drm-ttm-Add-release_notify-callback-to-ttm_bo_driver.patch @@ -0,0 +1,68 @@ +From 4c54c6afe906f0f39ea8a677623f621a81d0eae6 Mon Sep 17 00:00:00 2001 +From: Felix Kuehling <Felix.Kuehling@amd.com> +Date: Tue, 9 Jul 2019 19:09:42 -0400 +Subject: [PATCH 3228/4256] drm/ttm: Add release_notify callback to + ttm_bo_driver +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This notifies the driver that a BO is about to be released. + +Releasing a BO also invokes the move_notify callback from +ttm_bo_cleanup_memtype_use, but that happens too late for anything +that would add fences to the BO and require a delayed delete. + +Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> +Reviewed-by: Christian König <christian.koenig@amd.com> +--- + drivers/gpu/drm/ttm/ttm_bo.c | 3 +++ + include/drm/ttm/ttm_bo_driver.h | 18 ++++++++++++++++++ + 2 files changed, 21 insertions(+) + +diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c +index 5692eb0ce888..19fe14514e4c 100644 +--- a/drivers/gpu/drm/ttm/ttm_bo.c ++++ b/drivers/gpu/drm/ttm/ttm_bo.c +@@ -668,6 +668,9 @@ static void ttm_bo_release(struct kref *kref) + struct ttm_bo_device *bdev = bo->bdev; + struct ttm_mem_type_manager *man = &bdev->man[bo->mem.mem_type]; + ++ if (bo->bdev->driver->release_notify) ++ bo->bdev->driver->release_notify(bo); ++ + drm_vma_offset_remove(&bdev->vma_manager, &bo->vma_node); + ttm_mem_io_lock(man, false); + ttm_mem_io_free_vm(bo); +diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h +index 6652c155902d..27782b3c44a6 100644 +--- a/include/drm/ttm/ttm_bo_driver.h ++++ b/include/drm/ttm/ttm_bo_driver.h +@@ -384,6 +384,24 @@ struct ttm_bo_driver { + */ + int (*access_memory)(struct ttm_buffer_object *bo, unsigned long offset, + void *buf, int len, int write); ++ /** ++ * struct ttm_bo_driver member del_from_lru_notify ++ * ++ * @bo: the buffer object deleted from lru ++ * ++ * notify driver that a BO was deleted from LRU. ++ */ ++ void (*del_from_lru_notify)(struct ttm_buffer_object *bo); ++ ++ /** ++ * Notify the driver that we're about to release a BO ++ * ++ * @bo: BO that is about to be released ++ * ++ * Gives the driver a chance to do any cleanup, including ++ * adding fences that may force a delayed delete ++ */ ++ void (*release_notify)(struct ttm_buffer_object *bo); + }; + + /** +-- +2.17.1 + |