Skip to contentSkip to conversation

drm/vmwgfx: Reserve fence slots on buffer objects in cotables

PATCH In review Zack Rusin 2 participants 2 messages Apr 22, 2022

Subsystems (3)
lore
Share & tools
lore

Zack Rusin

author
#0 lore raw

PATCH 1/1 drm/vmwgfx: Reserve fence slots on buffer objects in cotables

From: Zack Rusin <[email protected]>

The buffer objects created by cotables were missing fence reservations. They are created from vmw_validation_res_validate which makes them miss the ttm_eu_reserve_buffers which is called from vmw_validation_bo_reserve.

Cotables are the only resources which create a buffer object in the create callback so make sure the code also reserves the slots.

Fixes c8d4c18bfbc4 ("dma-buf/drivers: make reserving a shared slot mandatory v4")
---
 drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c +4 -0
index 16f986b6cbea..79b30dc9d825 100644
@@ -478,6 +478,10 @@ static int vmw_cotable_resize(struct vmw_resource *res, size_t new_size)
 	vmw_bo_unreference(&old_buf);
 	res->id = vcotbl->type;
 
+	ret = dma_resv_reserve_fences(bo->base.resv, 1);
+	if (unlikely(ret))
+		goto out_wait;
+
 	/* Release the pin acquired in vmw_bo_init */
 	ttm_bo_unpin(bo);
 
Signature · 1 line
2.32.0
Reviewed-by on v1 1/1
#1 lore raw

Am 22.04.22 um 18:13 schrieb Zack Rusin:

Quoted 11 lines

From: Zack Rusin <[email protected]>

The buffer objects created by cotables were missing fence reservations. They are created from vmw_validation_res_validate which makes them miss the ttm_eu_reserve_buffers which is called from vmw_validation_bo_reserve.

Cotables are the only resources which create a buffer object in the create callback so make sure the code also reserves the slots.

Fixes c8d4c18bfbc4 ("dma-buf/drivers: make reserving a shared slot mandatory v4")
Quoted 19 lines
---
  drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c +4 -0
index 16f986b6cbea..79b30dc9d825 100644
@@ -478,6 +478,10 @@ static int vmw_cotable_resize(struct vmw_resource *res, size_t new_size)
  	vmw_bo_unreference(&old_buf);
  	res->id = vcotbl->type;
 
+	ret = dma_resv_reserve_fences(bo->base.resv, 1);
+	if (unlikely(ret))
+		goto out_wait;
+
  	/* Release the pin acquired in vmw_bo_init */
  	ttm_bo_unpin(bo);