Commit d20a8f40 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Jacek Lawrynowicz

accel/ivpu: Fix old dma_buf api usage

Update according to new dma-buf locking scheme.

Remove redundant WARN_ON()'s, dma_buf functions internally
have the same warnings already.

Fixes: 647371a6 ("accel/ivpu: Add GEM buffer object management")
Signed-off-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: default avatarJeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: default avatarJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230202092114.2637452-5-stanislaw.gruszka@linux.intel.com
(cherry picked from commit ec6ec9c6)
Signed-off-by: default avatarJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
parent 62079b6f
......@@ -42,9 +42,7 @@ static int prime_map_pages_locked(struct ivpu_bo *bo)
struct ivpu_device *vdev = ivpu_bo_to_vdev(bo);
struct sg_table *sgt;
WARN_ON(!bo->base.import_attach);
sgt = dma_buf_map_attachment(bo->base.import_attach, DMA_BIDIRECTIONAL);
sgt = dma_buf_map_attachment_unlocked(bo->base.import_attach, DMA_BIDIRECTIONAL);
if (IS_ERR(sgt)) {
ivpu_err(vdev, "Failed to map attachment: %ld\n", PTR_ERR(sgt));
return PTR_ERR(sgt);
......@@ -56,9 +54,7 @@ static int prime_map_pages_locked(struct ivpu_bo *bo)
static void prime_unmap_pages_locked(struct ivpu_bo *bo)
{
WARN_ON(!bo->base.import_attach);
dma_buf_unmap_attachment(bo->base.import_attach, bo->sgt, DMA_BIDIRECTIONAL);
dma_buf_unmap_attachment_unlocked(bo->base.import_attach, bo->sgt, DMA_BIDIRECTIONAL);
bo->sgt = NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment