summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/dri/nouveau/nouveau_pushbuf.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-03-17 14:22:36 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-03-17 14:45:19 +1100
commitf93386de0fb281e79633c3bf57060f660abdfade (patch)
tree13b33883fdb61c6b56c257c1a69894fe03729b12 /src/gallium/winsys/dri/nouveau/nouveau_pushbuf.c
parent767cd2ed6e97ae09526b15728495f361d5e22cb2 (diff)
nouveau: create fence object when allocating pushbuf, instead of submit
Diffstat (limited to 'src/gallium/winsys/dri/nouveau/nouveau_pushbuf.c')
-rw-r--r--src/gallium/winsys/dri/nouveau/nouveau_pushbuf.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/gallium/winsys/dri/nouveau/nouveau_pushbuf.c b/src/gallium/winsys/dri/nouveau/nouveau_pushbuf.c
index fd9a5c5a96..a2b9321b15 100644
--- a/src/gallium/winsys/dri/nouveau/nouveau_pushbuf.c
+++ b/src/gallium/winsys/dri/nouveau/nouveau_pushbuf.c
@@ -56,6 +56,10 @@ nouveau_pushbuf_space(struct nouveau_channel *chan, unsigned min)
nvpb->base.remaining = nvpb->size;
nvpb->base.cur = &nvchan->pushbuf[nvpb->start];
+ /* Create a new fence object for this "frame" */
+ nouveau_fence_ref(NULL, &nvpb->fence);
+ nouveau_fence_new(chan, &nvpb->fence);
+
return 0;
}
@@ -128,7 +132,6 @@ nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
struct nouveau_channel_priv *nvchan = nouveau_channel(chan);
struct nouveau_pushbuf_priv *nvpb = &nvchan->pb;
struct nouveau_pushbuf_bo *pbbo;
- struct nouveau_fence *fence = NULL;
int ret;
if (nvpb->base.remaining == nvpb->size)
@@ -139,10 +142,6 @@ nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
nvchan->dma->free -= nvpb->size;
assert(nvchan->dma->cur <= nvchan->dma->max);
- ret = nouveau_fence_new(chan, &fence);
- if (ret)
- return ret;
-
nvchan->dma = &nvchan->dma_bufmgr;
nvchan->pushbuf[nvpb->nop_jump] = 0x20000000 |
(nvchan->dma->base + (nvchan->dma->cur << 2));
@@ -153,7 +152,7 @@ nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
struct nouveau_pushbuf_reloc *r;
struct nouveau_bo *bo = &ptr_to_bo(pbbo->handle)->base;
- ret = nouveau_bo_validate(chan, bo, fence, pbbo->flags);
+ ret = nouveau_bo_validate(chan, bo, pbbo->flags);
assert (ret == 0);
if (bo->offset == nouveau_bo(bo)->offset &&
@@ -188,9 +187,8 @@ nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
nvchan->dma = &nvchan->dma_master;
/* Fence + kickoff */
- nouveau_fence_emit(fence);
+ nouveau_fence_emit(nvpb->fence);
FIRE_RING_CH(chan);
- nouveau_fence_ref(NULL, &fence);
/* Allocate space for next push buffer */
ret = nouveau_pushbuf_space(chan, min);