summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2008-05-30 11:00:59 +1000
committerBen Skeggs <[email protected]>2008-05-30 11:00:59 +1000
commit8b31d5fc8a5425b01adf80f4873cb816925ee0d1 (patch)
tree4332e5457c7f9027ff6e10d901ee2f990a48eff9
parent524408f1a5b39c8c25a277e41e4eee54fd726b84 (diff)
nouveau: flush pending pushbuf if buffer on validate list at map/del
-rw-r--r--src/gallium/winsys/dri/nouveau/nouveau_bo.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/winsys/dri/nouveau/nouveau_bo.c b/src/gallium/winsys/dri/nouveau/nouveau_bo.c
index aca16a8b127..57f5b7d1ae1 100644
--- a/src/gallium/winsys/dri/nouveau/nouveau_bo.c
+++ b/src/gallium/winsys/dri/nouveau/nouveau_bo.c
@@ -256,6 +256,9 @@ nouveau_bo_del(struct nouveau_bo **bo)
if (--nvbo->refcount)
return;
+ if (nvbo->pending)
+ nouveau_pushbuf_flush(nvbo->pending->channel, 0);
+
if (nvbo->fence)
nouveau_fence_signal_cb(nvbo->fence, nouveau_bo_del_cb, nvbo);
else
@@ -270,6 +273,11 @@ nouveau_bo_map(struct nouveau_bo *bo, uint32_t flags)
if (!nvbo)
return -EINVAL;
+ if (nvbo->pending &&
+ (nvbo->pending->flags & NOUVEAU_BO_WR || flags & NOUVEAU_BO_WR)) {
+ nouveau_pushbuf_flush(nvbo->pending->channel, 0);
+ }
+
if (flags & NOUVEAU_BO_WR)
nouveau_fence_wait(&nvbo->fence);
else