Skip to contentSkip to conversation

drm/vc4: Use newer fence API properly to fix build errors

PATCH In review Javier Martinez Canillas 1 participant 2 messages Apr 7, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/vc4: Use newer fence API properly to fix build errors

The commit 73511edf8b19 ("dma-buf: specify usage while adding fences to dma_resv obj v7") ported all the DRM drivers to use the newer fence API that specifies the usage with the enum dma_resv_usage rather than doing an explicit shared / exclusive distinction.

But the commit didn't do it properly in two callers of the vc4 driver, leading to build errors.

Fixes 73511edf8b19 ("dma-buf: specify usage while adding fences to dma_resv obj v7")

---

 drivers/gpu/drm/vc4/vc4_gem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/vc4/vc4_gem.c +4 -2
index 38550317e025..9eaf304fc20d 100644
@@ -546,7 +546,8 @@ vc4_update_bo_seqnos(struct vc4_exec_info *exec, uint64_t seqno)
 		bo = to_vc4_bo(&exec->bo[i]->base);
 		bo->seqno = seqno;
 
-		dma_resv_add_fence(bo->base.base.resv, exec->fence);
+		dma_resv_add_fence(bo->base.base.resv, exec->fence,
+				   DMA_RESV_USAGE_READ);
 	}
 
 	list_for_each_entry(bo, &exec->unref_list, unref_head) {
@@ -557,7 +558,8 @@ vc4_update_bo_seqnos(struct vc4_exec_info *exec, uint64_t seqno)
 		bo = to_vc4_bo(&exec->rcl_write_bo[i]->base);
 		bo->write_seqno = seqno;
 
-		dma_resv_add_excl_fence(bo->base.base.resv, exec->fence);
+		dma_resv_add_fence(bo->base.base.resv, exec->fence,
+				   DMA_RESV_USAGE_WRITE);
 	}
 }
 
Signature · 1 line
2.35.1
#1 lore raw
Quoted 5 lines · Javier Martinez Canillas

The commit 73511edf8b19 ("dma-buf: specify usage while adding fences to dma_resv obj v7") ported all the DRM drivers to use the newer fence API that specifies the usage with the enum dma_resv_usage rather than doing an explicit shared / exclusive distinction.

Quoted 7 lines

But the commit didn't do it properly in two callers of the vc4 driver, leading to build errors.

Fixes 73511edf8b19 ("dma-buf: specify usage while adding fences to dma_resv obj v7")

---

Pushed to drm-misc (drm-misc-next) since this fixes a build error and Christian already reviewed it.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat