accel/ivpu: Test for imported buffers with drm_gem_is_imported()
PATCH 1/1 accel/ivpu: Test for imported buffers with drm_gem_is_imported()
Instead of testing import_attach for imported GEM buffers, invoke drm_gem_is_imported() to do the test. The test itself does not change.
--- drivers/accel/ivpu/ivpu_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/accel/ivpu/ivpu_gem.c +1 -1
@@ -157,7 +157,7 @@ static void ivpu_bo_unbind_locked(struct ivpu_bo *bo) }if (bo->base.sgt) { -if (bo->base.base.import_attach) { +if (drm_gem_is_imported (&bo->base.base)) {dma_buf_unmap_attachment (bo->base.base.import_attach, bo->base.sgt,DMA_BIDIRECTIONAL ); }else {
Signature · 1 line
2.52.0
Quoted 2 lines · Thomas Zimmermann
Instead of testing
import_attachfor imported GEM buffers, invokedrm_gem_is_imported()to do the test. The test itself does not change.
Thank you for spotting this.
There's also another place in drivers/accel/ivpu/ivpu_gem.c:51 drm_WARN_ON(&vdev->drm, !bo->base.base.import_attach);
We will push a patch for that.
Quoted 14 lines
Signed-off-by Thomas Zimmermann <[email protected]>Cc Maciej Falkowski <[email protected]>Cc Karol Wachowski <[email protected]>Cc Oded Gabbay <[email protected]>--- drivers/accel/ivpu/ivpu_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/accel/ivpu/ivpu_gem.c +0
-0
drivers/accel/ivpu/ivpu_gem.c static void ivpu_bo_unbind_locked(struct ivpu_bo *bo) · line 163
Quoted 8 lines
drivers/accel/ivpu/ivpu_gem.c +1
-1@@ -157,7 +157,7 @@ static void ivpu_bo_unbind_locked(struct ivpu_bo *bo) }if (bo->base.sgt) { -if (bo->base.base.import_attach) { +if (drm_gem_is_imported (&bo->base.base)) {dma_buf_unmap_attachment (bo->base.base.import_attach, bo->base.sgt,DMA_BIDIRECTIONAL ); }else {
Karol Wachowski
maintainerQuoted 10 lines · Karol Wachowski
Quoted 2 lines · Thomas Zimmermann
Instead of testing
import_attachfor imported GEM buffers, invokedrm_gem_is_imported()to do the test. The test itself does not change.Thank you for spotting this.
There's also another place in
drivers/accel/ivpu/ivpu_gem.c:51drm_WARN_ON(&vdev->drm, !bo->base.base.import_attach);We will push a patch for that.
I've sent a patch that covers both cases in a single commit. Thanks. Karol
Quoted 24 lines
Quoted 15 lines
Signed-off-by Thomas Zimmermann <[email protected]>Cc Maciej Falkowski <[email protected]>Cc Karol Wachowski <[email protected]>Cc Oded Gabbay <[email protected]>--- drivers/accel/ivpu/ivpu_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/accel/ivpu/ivpu_gem.c +0
-0drivers/accel/ivpu/ivpu_gem.c static void ivpu_bo_unbind_locked(struct ivpu_bo *bo) · line 163
Quoted 8 lines
drivers/accel/ivpu/ivpu_gem.c +1
-1@@ -157,7 +157,7 @@ static void ivpu_bo_unbind_locked(struct ivpu_bo *bo) }if (bo->base.sgt) { -if (bo->base.base.import_attach) { +if (drm_gem_is_imported (&bo->base.base)) {dma_buf_unmap_attachment (bo->base.base.import_attach, bo->base.sgt,DMA_BIDIRECTIONAL ); }else {Reviewed-by Karol Wachowski <[email protected]>