Commit 0941a4e3 authored by Christian König's avatar Christian König

drm/etnaviv: stop using dma_resv_excl_fence v2

We can get the excl fence together with the shared ones as well.

v2: rename the member to fences as well
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: default avatarLucas Stach <l.stach@pengutronix.de>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Russell King <linux+etnaviv@armlinux.org.uk>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: etnaviv@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-5-christian.koenig@amd.com
parent e0fd83db
...@@ -80,9 +80,8 @@ struct etnaviv_gem_submit_bo { ...@@ -80,9 +80,8 @@ struct etnaviv_gem_submit_bo {
u64 va; u64 va;
struct etnaviv_gem_object *obj; struct etnaviv_gem_object *obj;
struct etnaviv_vram_mapping *mapping; struct etnaviv_vram_mapping *mapping;
struct dma_fence *excl; unsigned int nr_fences;
unsigned int nr_shared; struct dma_fence **fences;
struct dma_fence **shared;
}; };
/* Created per submit-ioctl, to track bo's and cmdstream bufs, etc, /* Created per submit-ioctl, to track bo's and cmdstream bufs, etc,
......
...@@ -188,15 +188,11 @@ static int submit_fence_sync(struct etnaviv_gem_submit *submit) ...@@ -188,15 +188,11 @@ static int submit_fence_sync(struct etnaviv_gem_submit *submit)
if (submit->flags & ETNA_SUBMIT_NO_IMPLICIT) if (submit->flags & ETNA_SUBMIT_NO_IMPLICIT)
continue; continue;
if (bo->flags & ETNA_SUBMIT_BO_WRITE) { ret = dma_resv_get_fences(robj,
ret = dma_resv_get_fences(robj, true, &bo->nr_shared, bo->flags & ETNA_SUBMIT_BO_WRITE,
&bo->shared); &bo->nr_fences, &bo->fences);
if (ret) if (ret)
return ret; return ret;
} else {
bo->excl = dma_fence_get(dma_resv_excl_fence(robj));
}
} }
return ret; return ret;
......
...@@ -39,31 +39,21 @@ etnaviv_sched_dependency(struct drm_sched_job *sched_job, ...@@ -39,31 +39,21 @@ etnaviv_sched_dependency(struct drm_sched_job *sched_job,
struct etnaviv_gem_submit_bo *bo = &submit->bos[i]; struct etnaviv_gem_submit_bo *bo = &submit->bos[i];
int j; int j;
if (bo->excl) { for (j = 0; j < bo->nr_fences; j++) {
fence = bo->excl; if (!bo->fences[j])
bo->excl = NULL;
if (!dma_fence_is_signaled(fence))
return fence;
dma_fence_put(fence);
}
for (j = 0; j < bo->nr_shared; j++) {
if (!bo->shared[j])
continue; continue;
fence = bo->shared[j]; fence = bo->fences[j];
bo->shared[j] = NULL; bo->fences[j] = NULL;
if (!dma_fence_is_signaled(fence)) if (!dma_fence_is_signaled(fence))
return fence; return fence;
dma_fence_put(fence); dma_fence_put(fence);
} }
kfree(bo->shared); kfree(bo->fences);
bo->nr_shared = 0; bo->nr_fences = 0;
bo->shared = NULL; bo->fences = NULL;
} }
return NULL; return 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