struct nouveau_pushbuf_priv {
struct nouveau_pushbuf base;
+ struct nouveau_fence *fence;
+
unsigned nop_jump;
unsigned start;
unsigned size;
extern int
nouveau_bo_validate(struct nouveau_channel *, struct nouveau_bo *,
- struct nouveau_fence *fence, uint32_t flags);
+ uint32_t flags);
extern int
nouveau_resource_init(struct nouveau_resource **heap, unsigned start,
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;
}
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)
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));
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 &&
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);