return GL_FALSE;
}
+ if (nouveau_bo_new(context_dev(ctx), NOUVEAU_BO_VRAM, 0, 4096,
+ NULL, &nctx->fence)) {
+ nouveau_context_destroy(dri_ctx);
+ *error = __DRI_CTX_ERROR_NO_MEMORY;
+ return GL_FALSE;
+ }
+
*error = __DRI_CTX_ERROR_SUCCESS;
return GL_TRUE;
}
struct nouveau_context *nctx = dri_ctx->driverPrivate;
struct gl_context *ctx = &nctx->base;
+ nouveau_bo_ref(NULL, &nctx->fence);
context_drv(ctx)->context_destroy(ctx);
}
BITSET_DECLARE(dirty, MAX_NOUVEAU_STATE);
enum nouveau_fallback fallback;
+ struct nouveau_bo *fence;
+
struct nouveau_hw_state hw;
struct nouveau_render_state render;
struct nouveau_scratch_state scratch;
static void
nouveau_finish(struct gl_context *ctx)
{
+ struct nouveau_context *nctx = to_nouveau_context(ctx);
+ struct nouveau_pushbuf *push = context_push(ctx);
+ struct nouveau_pushbuf_refn refn =
+ { nctx->fence, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR };
+
nouveau_flush(ctx);
+
+ if (!nouveau_pushbuf_space(push, 16, 0, 0) &&
+ !nouveau_pushbuf_refn(push, &refn, 1)) {
+ PUSH_DATA(push, 0);
+ PUSH_KICK(push);
+ }
+
+ nouveau_bo_wait(nctx->fence, NOUVEAU_BO_RDWR, context_client(ctx));
}
void