ST_FLUSH_FRONT may call driThrottle, which is implemented with dri_flush.
This prevents double flush as well as fence leaks caused by a recursion
in the middle of throttling.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58839
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
return;
}
- if (!drawable) {
+ if (drawable) {
+ /* prevent recursion */
+ if (drawable->flushing)
+ return;
+
+ drawable->flushing = TRUE;
+ }
+ else {
flags &= ~__DRI2_FLUSH_DRAWABLE;
}
else if (flags & (__DRI2_FLUSH_DRAWABLE | __DRI2_FLUSH_CONTEXT)) {
ctx->st->flush(ctx->st, flush_flags, NULL);
}
+
+ if (drawable) {
+ drawable->flushing = FALSE;
+ }
}
/**
unsigned int head;
unsigned int tail;
unsigned int desired_fences;
+ boolean flushing; /* prevents recursion in dri_flush */
/* used only by DRISW */
struct pipe_surface *drisw_surface;