Re: [PATCH 6/6] drm/ttm: revert "add optional LRU removal callback v2"
Pathces 1, 2, 5, 6: Reviewed-by: Sinclair YehOn Fri, Jan 13, 2017 at 10:51:11AM +0100, Christian König wrote: > From: Christian König > > Without the custom LRU management the callback is not used any more. > > Signed-off-by: Christian König > --- > drivers/gpu/drm/ttm/ttm_bo.c| 12 +--- > include/drm/ttm/ttm_bo_driver.h | 6 -- > 2 files changed, 5 insertions(+), 13 deletions(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c > index 59fac2f..dfaeac4 100644 > --- a/drivers/gpu/drm/ttm/ttm_bo.c > +++ b/drivers/gpu/drm/ttm/ttm_bo.c > @@ -186,12 +186,8 @@ EXPORT_SYMBOL(ttm_bo_add_to_lru); > > int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) > { > - struct ttm_bo_device *bdev = bo->bdev; > int put_count = 0; > > - if (bdev->driver->lru_removal) > - bdev->driver->lru_removal(bo); > - > if (!list_empty(>swap)) { > list_del_init(>swap); > ++put_count; > @@ -201,6 +197,11 @@ int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) > ++put_count; > } > > + /* > + * TODO: Add a driver hook to delete from > + * driver-specific LRU's here. > + */ > + > return put_count; > } > > @@ -234,9 +235,6 @@ void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo) > > lockdep_assert_held(>resv->lock.base); > > - if (bdev->driver->lru_removal) > - bdev->driver->lru_removal(bo); > - > put_count = ttm_bo_del_from_lru(bo); > ttm_bo_list_ref_sub(bo, put_count, true); > ttm_bo_add_to_lru(bo); > diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h > index a1235fa..4395db1 100644 > --- a/include/drm/ttm/ttm_bo_driver.h > +++ b/include/drm/ttm/ttm_bo_driver.h > @@ -462,12 +462,6 @@ struct ttm_bo_driver { > struct ttm_mem_reg *mem); > void (*io_mem_free)(struct ttm_bo_device *bdev, > struct ttm_mem_reg *mem); > - > - /** > - * Optional driver callback for when BO is removed from the LRU. > - * Called with LRU lock held immediately before the removal. > - */ > - void (*lru_removal)(struct ttm_buffer_object *bo); > }; > > /** > -- > 2.7.4 > > ___ > dri-devel mailing list > dri-de...@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH 6/6] drm/ttm: revert "add optional LRU removal callback v2"
Good way to keep original idea and remove CPU overhead. Reviewed-by: Roger.He <hongbo...@amd.com> and Test-by Roger.He <hongbo...@amd.com> -Original Message- From: Christian König [mailto:deathsim...@vodafone.de] Sent: Friday, January 13, 2017 5:51 PM To: He, Hongbo <hongbo...@amd.com> Cc: amd-gfx@lists.freedesktop.org; dri-de...@lists.freedesktop.org Subject: [PATCH 6/6] drm/ttm: revert "add optional LRU removal callback v2" From: Christian König <christian.koe...@amd.com> Without the custom LRU management the callback is not used any more. Signed-off-by: Christian König <christian.koe...@amd.com> --- drivers/gpu/drm/ttm/ttm_bo.c| 12 +--- include/drm/ttm/ttm_bo_driver.h | 6 -- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 59fac2f..dfaeac4 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -186,12 +186,8 @@ EXPORT_SYMBOL(ttm_bo_add_to_lru); int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) { - struct ttm_bo_device *bdev = bo->bdev; int put_count = 0; - if (bdev->driver->lru_removal) - bdev->driver->lru_removal(bo); - if (!list_empty(>swap)) { list_del_init(>swap); ++put_count; @@ -201,6 +197,11 @@ int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) ++put_count; } + /* +* TODO: Add a driver hook to delete from +* driver-specific LRU's here. +*/ + return put_count; } @@ -234,9 +235,6 @@ void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo) lockdep_assert_held(>resv->lock.base); - if (bdev->driver->lru_removal) - bdev->driver->lru_removal(bo); - put_count = ttm_bo_del_from_lru(bo); ttm_bo_list_ref_sub(bo, put_count, true); ttm_bo_add_to_lru(bo); diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index a1235fa..4395db1 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -462,12 +462,6 @@ struct ttm_bo_driver { struct ttm_mem_reg *mem); void (*io_mem_free)(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem); - - /** -* Optional driver callback for when BO is removed from the LRU. -* Called with LRU lock held immediately before the removal. -*/ - void (*lru_removal)(struct ttm_buffer_object *bo); }; /** -- 2.7.4 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH 6/6] drm/ttm: revert "add optional LRU removal callback v2"
From: Christian KönigWithout the custom LRU management the callback is not used any more. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c| 12 +--- include/drm/ttm/ttm_bo_driver.h | 6 -- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 59fac2f..dfaeac4 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -186,12 +186,8 @@ EXPORT_SYMBOL(ttm_bo_add_to_lru); int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) { - struct ttm_bo_device *bdev = bo->bdev; int put_count = 0; - if (bdev->driver->lru_removal) - bdev->driver->lru_removal(bo); - if (!list_empty(>swap)) { list_del_init(>swap); ++put_count; @@ -201,6 +197,11 @@ int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) ++put_count; } + /* +* TODO: Add a driver hook to delete from +* driver-specific LRU's here. +*/ + return put_count; } @@ -234,9 +235,6 @@ void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo) lockdep_assert_held(>resv->lock.base); - if (bdev->driver->lru_removal) - bdev->driver->lru_removal(bo); - put_count = ttm_bo_del_from_lru(bo); ttm_bo_list_ref_sub(bo, put_count, true); ttm_bo_add_to_lru(bo); diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index a1235fa..4395db1 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -462,12 +462,6 @@ struct ttm_bo_driver { struct ttm_mem_reg *mem); void (*io_mem_free)(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem); - - /** -* Optional driver callback for when BO is removed from the LRU. -* Called with LRU lock held immediately before the removal. -*/ - void (*lru_removal)(struct ttm_buffer_object *bo); }; /** -- 2.7.4 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx