Skip to content

Commit 1f9910b

Browse files
airliedDanilo Krummrich
authored andcommitted
nouveau/fence: handle cross device fences properly
The fence sync logic doesn't handle a fence sync across devices as it tries to write to a channel offset from one device into the fence bo from a different device, which won't work so well. This patch fixes that to avoid using the sync path in the case where the fences come from different nouveau drm devices. This works fine on a single device as the fence bo is shared across the devices, and mapped into each channels vma space, the channel offsets are therefore okay to pass between sides, so one channel can sync on the seqnos from the other by using the offset into it's vma. Signed-off-by: Dave Airlie <[email protected]> Cc: [email protected] Reviewed-by: Ben Skeggs <[email protected]> [ Fix compilation issue; remove version log from commit messsage. - Danilo ] Signed-off-by: Danilo Krummrich <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 93801b8 commit 1f9910b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/nouveau/nouveau_fence.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,13 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan,
387387
if (f) {
388388
struct nouveau_channel *prev;
389389
bool must_wait = true;
390+
bool local;
390391

391392
rcu_read_lock();
392393
prev = rcu_dereference(f->channel);
393-
if (prev && (prev == chan ||
394-
fctx->sync(f, prev, chan) == 0))
394+
local = prev && prev->cli->drm == chan->cli->drm;
395+
if (local && (prev == chan ||
396+
fctx->sync(f, prev, chan) == 0))
395397
must_wait = false;
396398
rcu_read_unlock();
397399
if (!must_wait)

0 commit comments

Comments
 (0)