-
- Downloads
drm/vmwgfx: Fix dumb buffer leak
Dumb buffers were not being freed because the GEM reference that was acquired in gb_surface_define was not dropped like it is in the 2D case. Dropping this ref uncovered a few additional issues with freeing the resources associated with dirty tracking in vmw_bo_free/release. Additionally the TTM object associated with the surface were also leaking which meant that when the ttm_object_file was closed at process exit the destructor unreferenced an already destroyed surface. The solution is to remove the destructor from the vmw_user_surface associated with the dumb_buffer and immediately unreferencing the TTM object which his removes it from the ttm_object_file. This also allows the early return in vmw_user_surface_base_release for the dumb buffer case to be removed as it should no longer occur. The chain of references now has the GEM handle(s) owning the dumb buffer. The GEM handles have a singular GEM reference to the vmw_bo which is dropped when all handles are closed. When the GEM reference count hits zero the vmw_bo is freed which then unreferences the surface via vmw_resource_release in vmw_bo_release. Fixes: d6667f0d ("drm/vmwgfx: Fix handling of dumb buffers") Signed-off-by:Ian Forbes <ian.forbes@broadcom.com> Reviewed-by:
Zack Rusin <zack.rusin@broadcom.com> Signed-off-by:
Zack Rusin <zack.rusin@broadcom.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250123204424.836896-1-ian.forbes@broadcom.com
Showing
- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c 4 additions, 2 deletionsdrivers/gpu/drm/vmwgfx/vmwgfx_bo.c
- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c 1 addition, 1 deletiondrivers/gpu/drm/vmwgfx/vmwgfx_resource.c
- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c 12 additions, 6 deletionsdrivers/gpu/drm/vmwgfx/vmwgfx_surface.c
Loading
Please register or sign in to comment