RE: [PATCH 04/11] drm/ttm: move default BO destructor into VMWGFX

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>-----Original Message-----
>From: dri-devel <dri-devel-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of
>Christian König
>Sent: Thursday, May 19, 2022 5:55 AM
>To: intel-gfx@xxxxxxxxxxxxxxxxxxxxx
>Cc: matthew.william.auld@xxxxxxxxx; Christian König
><christian.koenig@xxxxxxx>; dri-devel@xxxxxxxxxxxxxxxxxxxxx
>Subject: [PATCH 04/11] drm/ttm: move default BO destructor into VMWGFX
>
>It's the only driver using this.
>
>Signed-off-by: Christian König <christian.koenig@xxxxxxx>
>---
> drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
>b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
>index 85a66014c2b6..c4f376d5e1d0 100644
>--- a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
>+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c
>@@ -462,6 +462,9 @@ int vmw_bo_create(struct vmw_private *vmw,
> 		return -ENOMEM;
> 	}
>
>+	if (!bo_free)
>+		bo_free = vmw_bo_default_destroy;
>+

vmw_bo_init has a WARN_ON if this is NULL.

Also, all of the callers use vmw_bo_bo_free() or vmw_gem_destroy().

Both of those unmap, release and then free the object.

It doesn't look like vmw_bo_default_destroy does this work.

Is this the right "default" path?  Or should the WARN_ON be used to check
for this?

M

> 	ret = vmw_bo_init(vmw, *p_bo, size,
> 			  placement, interruptible, pin,
> 			  bo_free);
>--
>2.25.1





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux