drm/qxl: clean up qxl_bo_move_notify
Subsystems (5)
PATCH 1/3 drm/qxl: clean up qxl_bo_move_notify
Remove the unused evict parameter and drop swapping bo->mem.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/qxl/qxl_ttm.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/gpu/drm/qxl/qxl_ttm.c +4 -12
@@ -121,7 +121,6 @@ static struct ttm_tt *qxl_ttm_tt_create(struct ttm_buffer_object *bo, }static void qxl_bo_move_notify (struct ttm_buffer_object *bo, -bool evict,struct ttm_resource *new_mem) {struct qxl_bo *qbo;
@@ -144,29 +143,22 @@ static int qxl_bo_move(struct ttm_buffer_object *bo, bool evict,struct ttm_resource *old_mem = &bo->mem;int ret; -qxl_bo_move_notify (bo, evict, new_mem); +qxl_bo_move_notify (bo, new_mem); ret =ttm_bo_wait_ctx (bo, ctx);if (ret) - goto out; +return ret;if (old_mem->mem_type ==TTM_PL_SYSTEM && bo->ttm ==NULL ) {ttm_bo_move_null (bo, new_mem);return 0 ; } - ret =ttm_bo_move_memcpy (bo, ctx, new_mem); -out: -if (ret) { -swap (*new_mem, bo->mem); -qxl_bo_move_notify (bo, false, new_mem); -swap (*new_mem, bo->mem); - } -return ret; +return ttm_bo_move_memcpy (bo, ctx, new_mem); }static void qxl_bo_delete_mem_notify (struct ttm_buffer_object *bo) { -qxl_bo_move_notify (bo, false,NULL ); +qxl_bo_move_notify (bo,NULL ); }static struct ttm_device_funcs qxl_bo_driver = {
Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/3 drm/nouveau: clean up nouveau_bo_move_ntfy
Just another leftover from a TTM cleanup.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/nouveau/nouveau_bo.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +5 -8
@@ -861,9 +861,8 @@ nouveau_bo_move_init(struct nouveau_drm *drm)NV_INFO (drm,"MM: using %s for buffer copies\n" , name); } -static void -nouveau_bo_move_ntfy (struct ttm_buffer_object *bo,bool evict, -struct ttm_resource *new_reg) +static void nouveau_bo_move_ntfy (struct ttm_buffer_object *bo, +struct ttm_resource *new_reg) {struct nouveau_mem *mem = new_reg ?nouveau_mem (new_reg) :NULL ;struct nouveau_bo *nvbo =nouveau_bo (bo);
@@ -949,7 +948,7 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict,return ret; } -nouveau_bo_move_ntfy (bo, evict, new_reg); +nouveau_bo_move_ntfy (bo, new_reg); ret =ttm_bo_wait_ctx (bo, ctx);if (ret) goto out_ntfy;
@@ -1014,9 +1013,7 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, } out_ntfy:if (ret) { -swap (*new_reg, bo->mem); -nouveau_bo_move_ntfy (bo, false, new_reg); -swap (*new_reg, bo->mem); +nouveau_bo_move_ntfy (bo, &bo->mem); }return ret; }
@@ -1290,7 +1287,7 @@ nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence, bool exclstatic void nouveau_bo_delete_mem_notify (struct ttm_buffer_object *bo) { -nouveau_bo_move_ntfy (bo, false,NULL ); +nouveau_bo_move_ntfy (bo,NULL ); }struct ttm_device_funcs nouveau_bo_driver = {
Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/3 drm/vmwgfx: clean up vmw_move_notify v2
In reply to Christian KönigInstead of swapping bo->mem just give old and new as parameters.
Also drop unused parameters and code.
v2: cleanup stale documentation as well.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 9 +++++--- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 27 +++++++--------------- 3 files changed, 16 insertions(+), 23 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +2 -1
@@ -775,7 +775,8 @@ extern void vmw_resource_unreserve(struct vmw_resource *res,struct vmw_buffer_object *new_backup, unsigned long new_backup_offset);extern void vmw_query_move_notify (struct ttm_buffer_object *bo, -struct ttm_resource *mem); +struct ttm_resource *old_mem, +struct ttm_resource *new_mem);extern int vmw_query_readback_all (struct vmw_buffer_object *dx_query_mob);extern void vmw_resource_evict_all (struct vmw_private *dev_priv);extern void vmw_resource_unbind_list (struct vmw_buffer_object *vbo);
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +6 -3
@@ -847,13 +847,15 @@ int vmw_query_readback_all(struct vmw_buffer_object *dx_query_mob)* vmw_query_move_notify - Read back cached query states * * @bo: The TTM buffer object about to move. -* @mem: The memory region @bo is moving to. +* @old_mem: The memory region @bo is moving from. +* @new_mem: The memory region @bo is moving to. * * Called before the query MOB is swapped out to read back cached query * states from the device. */ void vmw_query_move_notify (struct ttm_buffer_object *bo, -struct ttm_resource *mem) +struct ttm_resource *old_mem, +struct ttm_resource *new_mem) {struct vmw_buffer_object *dx_query_mob;struct ttm_device *bdev = bo->bdev;
@@ -871,7 +873,8 @@ void vmw_query_move_notify(struct ttm_buffer_object *bo, }/* If BO is being moved from MOB to system memory */ -if (mem->mem_type ==TTM_PL_SYSTEM && bo->mem.mem_type ==VMW_PL_MOB ) { +if (new_mem->mem_type ==TTM_PL_SYSTEM && + old_mem->mem_type ==VMW_PL_MOB ) {struct vmw_fence_obj *fence; (void )vmw_query_readback_all (dx_query_mob);
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +8 -19
@@ -691,21 +691,19 @@ static int vmw_ttm_io_mem_reserve(struct ttm_device *bdev, struct ttm_resource ** vmw_move_notify - TTM move_notify_callback * * @bo: The TTM buffer object about to move. -* @evict: Unused -* @mem: The struct ttm_resource indicating to what memory +* @old_mem: The old memory where we move from +* @new_mem: The struct ttm_resource indicating to what memory * region the move is taking place. * * Calls move_notify for all subsystems needing it. * (currently only resources). */ static void vmw_move_notify (struct ttm_buffer_object *bo, -bool evict, -struct ttm_resource *mem) +struct ttm_resource *old_mem, +struct ttm_resource *new_mem) { -if (!mem) -return ; -vmw_bo_move_notify (bo, mem); -vmw_query_move_notify (bo, mem); +vmw_bo_move_notify (bo, new_mem); +vmw_query_move_notify (bo, old_mem, new_mem); }
@@ -736,7 +734,7 @@ static int vmw_move(struct ttm_buffer_object *bo,return ret; } -vmw_move_notify (bo, evict, new_mem); +vmw_move_notify (bo, &bo->mem, new_mem);if (old_man->use_tt && new_man->use_tt) {if (bo->mem.mem_type ==TTM_PL_SYSTEM ) {
@@ -758,18 +756,10 @@ static int vmw_move(struct ttm_buffer_object *bo, }return 0 ; fail: -swap (*new_mem, bo->mem); -vmw_move_notify (bo, false, new_mem); -swap (*new_mem, bo->mem); +vmw_move_notify (bo, new_mem, &bo->mem);return ret; } -static void -vmw_delete_mem_notify (struct ttm_buffer_object *bo) -{ -vmw_move_notify (bo, false,NULL ); -} -struct ttm_device_funcs vmw_bo_driver = { .ttm_tt_create = &vmw_ttm_tt_create, .ttm_tt_populate = &vmw_ttm_populate,
@@ -779,7 +769,6 @@ struct ttm_device_funcs vmw_bo_driver = { .evict_flags = vmw_evict_flags, .move = vmw_move, .verify_access = vmw_verify_access, - .delete_mem_notify = vmw_delete_mem_notify, .swap_notify = vmw_swap_notify, .io_mem_reserve = &vmw_ttm_io_mem_reserve, };
Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines · Christian König
Remove the unused evict parameter and drop swapping
bo->mem.Signed-off-by Christian König <[email protected]>
For the series,
Reviewed-by Matthew Auld <[email protected]>
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel