summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/etnaviv
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2021-11-03 11:34:29 +0300
committerChristian König <christian.koenig@amd.com>2022-03-24 12:09:20 +0300
commit0941a4e3c629c902e7d229218dbc36a146ca699c (patch)
treec9e054463f91b24d5fabcf9db2bf8b42c14de71d /drivers/gpu/drm/etnaviv
parente0fd83dbe92426e4f09b01111d260d2a7dc72fdb (diff)
downloadlinux-0941a4e3c629c902e7d229218dbc36a146ca699c.tar.xz
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: Christian König <christian.koenig@amd.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Lucas 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
Diffstat (limited to 'drivers/gpu/drm/etnaviv')
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gem.h5
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c14
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_sched.c24
3 files changed, 14 insertions, 29 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.h b/drivers/gpu/drm/etnaviv/etnaviv_gem.h
index 98e60df882b6..8983a0ef383e 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem.h
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.h
@@ -80,9 +80,8 @@ struct etnaviv_gem_submit_bo {
u64 va;
struct etnaviv_gem_object *obj;
struct etnaviv_vram_mapping *mapping;
- struct dma_fence *excl;
- unsigned int nr_shared;
- struct dma_fence **shared;
+ unsigned int nr_fences;
+ struct dma_fence **fences;
};
/* Created per submit-ioctl, to track bo's and cmdstream bufs, etc,
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
index 4eb00a0cb650..592cbb38609a 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c
@@ -188,15 +188,11 @@ static int submit_fence_sync(struct etnaviv_gem_submit *submit)
if (submit->flags & ETNA_SUBMIT_NO_IMPLICIT)
continue;
- if (bo->flags & ETNA_SUBMIT_BO_WRITE) {
- ret = dma_resv_get_fences(robj, true, &bo->nr_shared,
- &bo->shared);
- if (ret)
- return ret;
- } else {
- bo->excl = dma_fence_get(dma_resv_excl_fence(robj));
- }
-
+ ret = dma_resv_get_fences(robj,
+ bo->flags & ETNA_SUBMIT_BO_WRITE,
+ &bo->nr_fences, &bo->fences);
+ if (ret)
+ return ret;
}
return ret;
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_sched.c b/drivers/gpu/drm/etnaviv/etnaviv_sched.c
index 35e5ef7dbdcc..a8452ce10e3a 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_sched.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_sched.c
@@ -39,31 +39,21 @@ etnaviv_sched_dependency(struct drm_sched_job *sched_job,
struct etnaviv_gem_submit_bo *bo = &submit->bos[i];
int j;
- if (bo->excl) {
- fence = bo->excl;
- 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])
+ for (j = 0; j < bo->nr_fences; j++) {
+ if (!bo->fences[j])
continue;
- fence = bo->shared[j];
- bo->shared[j] = NULL;
+ fence = bo->fences[j];
+ bo->fences[j] = NULL;
if (!dma_fence_is_signaled(fence))
return fence;
dma_fence_put(fence);
}
- kfree(bo->shared);
- bo->nr_shared = 0;
- bo->shared = NULL;
+ kfree(bo->fences);
+ bo->nr_fences = 0;
+ bo->fences = NULL;
}
return NULL;