Skip to content

Commit 37a0cff

Browse files
en4bzzackr
authored andcommitted
drm/vmwgfx: Merge vmw_bo_release and vmw_bo_free functions
Some of the warnings need to be reordered between these two functions in order to be correct. This has happened multiple times. Merging them solves this problem once and for all. Fixes: d6667f0 ("drm/vmwgfx: Fix handling of dumb buffers") Signed-off-by: Ian Forbes <ian.forbes@broadcom.com> Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Link: https://patch.msgid.link/20260107152059.3048329-1-ian.forbes@broadcom.com
1 parent d9186fa commit 37a0cff

1 file changed

Lines changed: 8 additions & 14 deletions

File tree

drivers/gpu/drm/vmwgfx/vmwgfx_bo.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@
3232

3333
#include <drm/ttm/ttm_placement.h>
3434

35-
static void vmw_bo_release(struct vmw_bo *vbo)
35+
/**
36+
* vmw_bo_free - vmw_bo destructor
37+
*
38+
* @bo: Pointer to the embedded struct ttm_buffer_object
39+
*/
40+
static void vmw_bo_free(struct ttm_buffer_object *bo)
3641
{
3742
struct vmw_resource *res;
43+
struct vmw_bo *vbo = to_vmw_bo(&bo->base);
3844

3945
WARN_ON(kref_read(&vbo->tbo.base.refcount) != 0);
4046
vmw_bo_unmap(vbo);
@@ -62,20 +68,8 @@ static void vmw_bo_release(struct vmw_bo *vbo)
6268
}
6369
vmw_surface_unreference(&vbo->dumb_surface);
6470
}
65-
drm_gem_object_release(&vbo->tbo.base);
66-
}
67-
68-
/**
69-
* vmw_bo_free - vmw_bo destructor
70-
*
71-
* @bo: Pointer to the embedded struct ttm_buffer_object
72-
*/
73-
static void vmw_bo_free(struct ttm_buffer_object *bo)
74-
{
75-
struct vmw_bo *vbo = to_vmw_bo(&bo->base);
76-
7771
WARN_ON(!RB_EMPTY_ROOT(&vbo->res_tree));
78-
vmw_bo_release(vbo);
72+
drm_gem_object_release(&vbo->tbo.base);
7973
WARN_ON(vbo->dirty);
8074
kfree(vbo);
8175
}

0 commit comments

Comments
 (0)