Skip to content

Commit cc43156

Browse files
airliedsmb49
authored andcommitted
nouveau/fence: handle cross device fences properly
BugLink: https://bugs.launchpad.net/bugs/2100328 commit 1f9910b upstream. 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] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Noah Wager <[email protected]> Signed-off-by: Koichiro Den <[email protected]>
1 parent e4c3a09 commit cc43156

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
@@ -386,11 +386,13 @@ nouveau_fence_sync(struct nouveau_bo *nvbo, struct nouveau_channel *chan,
386386
if (f) {
387387
struct nouveau_channel *prev;
388388
bool must_wait = true;
389+
bool local;
389390

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

0 commit comments

Comments
 (0)