Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 098d7d53 authored by Thomas Hellstrom's avatar Thomas Hellstrom
Browse files

drm/vmwgfx: Optimize the buffer object swap_notify callback somewhat.



Only try to unmap cached maps when the buffer is moved into or out from
vram. Otherwise the underlying pages stay the same.

Also when unbinding resources from MOBs about to move, make sure we're
really moving out of MOB memory.

Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: default avatarBrian Paul <brianp@vmware.com>
Reviewed-by: default avatarSinclair Yeh <syeh@vmware.com>
Reviewed-by: default avatarDeepak Rawat <drawat@vmware.com>
parent e9431ea5
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -1105,9 +1105,11 @@ void vmw_bo_move_notify(struct ttm_buffer_object *bo,
	vbo = container_of(bo, struct vmw_buffer_object, base);
	vbo = container_of(bo, struct vmw_buffer_object, base);


	/*
	/*
	 * Kill any cached kernel maps before move. An optimization could
	 * Kill any cached kernel maps before move to or from VRAM.
	 * be to do this iff source or destination memory type is in VRAM.
	 * With other types of moves, the underlying pages stay the same,
	 * and the map can be kept.
	 */
	 */
	if (mem->mem_type == TTM_PL_VRAM || bo->mem.mem_type == TTM_PL_VRAM)
		vmw_bo_unmap(vbo);
		vmw_bo_unmap(vbo);


	/*
	/*
@@ -1115,6 +1117,6 @@ void vmw_bo_move_notify(struct ttm_buffer_object *bo,
	 * read back all resource content first, and unbind the MOB from
	 * read back all resource content first, and unbind the MOB from
	 * the resource.
	 * the resource.
	 */
	 */
	if (mem->mem_type != VMW_PL_MOB)
	if (mem->mem_type != VMW_PL_MOB && bo->mem.mem_type == VMW_PL_MOB)
		vmw_resource_unbind_list(vbo);
		vmw_resource_unbind_list(vbo);
}
}