The state tracker doesn't have to directly call winsys->wait_idle() anymore.
glFlush and glFinish both go through pipe->flush() now.
assert(intel); /* should never be null */
if (intel) {
- st_flush(intel->st);
+ st_flush(intel->st, PIPE_FLUSH_WAIT);
intel_batchbuffer_free(intel->batch);
intelUnbindContext(__DRIcontextPrivate * driContextPriv)
{
struct intel_context *intel = intel_context(driContextPriv);
- st_flush(intel->st);
+ st_flush(intel->st, 0x0);
/* XXX make_current(NULL)? */
return GL_TRUE;
}
/* Do we need to emit an MI_FLUSH command to flush the hardware
* caches?
*/
- if (flags) {
+ if (flags & (PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_TEXTURE_CACHE)) {
unsigned flush = MI_FLUSH;
if (!(flags & PIPE_FLUSH_RENDER_CACHE))
/* If there are no flags, just flush pending commands to hardware:
*/
FLUSH_BATCH();
+
+ if (flags & PIPE_FLUSH_WAIT) {
+ i915->pipe.winsys->wait_idle(i915->pipe.winsys, i915->pipe.private);
+ }
}
/**
* Flush types:
*/
-#define PIPE_FLUSH_RENDER_CACHE 0x1
+#define PIPE_FLUSH_RENDER_CACHE 0x1
#define PIPE_FLUSH_TEXTURE_CACHE 0x2
+#define PIPE_FLUSH_WAIT 0x4
/**
#include "pipe/p_winsys.h"
-void st_flush( struct st_context *st )
+void st_flush( struct st_context *st, uint pipeFlushFlags )
{
GLframebuffer *fb = st->ctx->DrawBuffer;
* short-circuiting this, or perhaps pass an "optional" flag down
* to the driver so that it can make the decision.
*/
- st->pipe->flush( st->pipe, 0 );
+ st->pipe->flush( st->pipe, pipeFlushFlags );
if (!fb)
return;
*/
static void st_Flush(GLcontext *ctx)
{
- st_flush(ctx->st);
+ st_flush(ctx->st, 0x0);
}
*/
static void st_Finish(GLcontext *ctx)
{
- struct st_context *st = ctx->st;
-
- st_flush( st );
- st->pipe->winsys->wait_idle( st->pipe->winsys, st->pipe->private );
+ st_flush(ctx->st, PIPE_FLUSH_WAIT);
}
GET_CURRENT_CONTEXT(ctx);
if (ctx && ctx->DrawBuffer == &stfb->Base) {
- st_flush(ctx->st);
+ st_flush(ctx->st, 0x0);
}
}
struct st_framebuffer *draw,
struct st_framebuffer *read);
-void st_flush( struct st_context *st );
+void st_flush( struct st_context *st, uint pipeFlushFlags );
void st_notify_swapbuffers(struct st_framebuffer *stfb);