From 906c033e276877c1374c9159976b05746af3c86d Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 4 May 2012 16:25:47 +1000 Subject: drm/nouveau/fence: fix a race where fence->channel can disappear Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nvc0_fence.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/drm/nouveau/nvc0_fence.c') diff --git a/drivers/gpu/drm/nouveau/nvc0_fence.c b/drivers/gpu/drm/nouveau/nvc0_fence.c index 41545f15c4d0..817228cd1a95 100644 --- a/drivers/gpu/drm/nouveau/nvc0_fence.c +++ b/drivers/gpu/drm/nouveau/nvc0_fence.c @@ -60,10 +60,11 @@ nvc0_fence_emit(struct nouveau_fence *fence) } static int -nvc0_fence_sync(struct nouveau_fence *fence, struct nouveau_channel *chan) +nvc0_fence_sync(struct nouveau_fence *fence, + struct nouveau_channel *prev, struct nouveau_channel *chan) { struct nvc0_fence_chan *fctx = chan->engctx[NVOBJ_ENGINE_FENCE]; - u64 addr = fctx->vma.offset + fence->channel->id * 16; + u64 addr = fctx->vma.offset + prev->id * 16; int ret; ret = RING_SPACE(chan, 5); -- cgit v1.2.3