Skip to content

Commit 0941a4e

Browse files
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 <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Lucas Stach <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Russell King <[email protected]> Cc: Christian Gmeiner <[email protected]> Cc: [email protected] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e0fd83d commit 0941a4e

File tree

3 files changed

+14
-29
lines changed

3 files changed

+14
-29
lines changed

drivers/gpu/drm/etnaviv/etnaviv_gem.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,8 @@ struct etnaviv_gem_submit_bo {
8080
u64 va;
8181
struct etnaviv_gem_object *obj;
8282
struct etnaviv_vram_mapping *mapping;
83-
struct dma_fence *excl;
84-
unsigned int nr_shared;
85-
struct dma_fence **shared;
83+
unsigned int nr_fences;
84+
struct dma_fence **fences;
8685
};
8786

8887
/* Created per submit-ioctl, to track bo's and cmdstream bufs, etc,

drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,11 @@ static int submit_fence_sync(struct etnaviv_gem_submit *submit)
188188
if (submit->flags & ETNA_SUBMIT_NO_IMPLICIT)
189189
continue;
190190

191-
if (bo->flags & ETNA_SUBMIT_BO_WRITE) {
192-
ret = dma_resv_get_fences(robj, true, &bo->nr_shared,
193-
&bo->shared);
194-
if (ret)
195-
return ret;
196-
} else {
197-
bo->excl = dma_fence_get(dma_resv_excl_fence(robj));
198-
}
199-
191+
ret = dma_resv_get_fences(robj,
192+
bo->flags & ETNA_SUBMIT_BO_WRITE,
193+
&bo->nr_fences, &bo->fences);
194+
if (ret)
195+
return ret;
200196
}
201197

202198
return ret;

drivers/gpu/drm/etnaviv/etnaviv_sched.c

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,31 +39,21 @@ etnaviv_sched_dependency(struct drm_sched_job *sched_job,
3939
struct etnaviv_gem_submit_bo *bo = &submit->bos[i];
4040
int j;
4141

42-
if (bo->excl) {
43-
fence = bo->excl;
44-
bo->excl = NULL;
45-
46-
if (!dma_fence_is_signaled(fence))
47-
return fence;
48-
49-
dma_fence_put(fence);
50-
}
51-
52-
for (j = 0; j < bo->nr_shared; j++) {
53-
if (!bo->shared[j])
42+
for (j = 0; j < bo->nr_fences; j++) {
43+
if (!bo->fences[j])
5444
continue;
5545

56-
fence = bo->shared[j];
57-
bo->shared[j] = NULL;
46+
fence = bo->fences[j];
47+
bo->fences[j] = NULL;
5848

5949
if (!dma_fence_is_signaled(fence))
6050
return fence;
6151

6252
dma_fence_put(fence);
6353
}
64-
kfree(bo->shared);
65-
bo->nr_shared = 0;
66-
bo->shared = NULL;
54+
kfree(bo->fences);
55+
bo->nr_fences = 0;
56+
bo->fences = NULL;
6757
}
6858

6959
return NULL;

0 commit comments

Comments
 (0)