tc: serialization race with flush timing
piglit's glx-multi-context-single-window test case has an uncommon usage: in a single thread it does (more or less):
for (i = 0; i < 8; i++) {
makeCurrent(ctx[i]);
drawRect(rect[i]);
}
makeCurrent(ctx[0]);
for (i = 0; i < 8; i++) {
verifyRect(rect[i]);
}
The problem here is that each context has its own tc queue thread, and so each makeCurrent call, which triggers pipe_context::flush
, enqueues a flush call after the draw, but the flushes have no enforcement of serialization, which means that it unlikely but possible for the flushes to reach the driver out of order, which breaks the test.
Zink is able to reliably trigger this behavior if I put the system under heavy load, but as of yet I haven't been able to trigger it on other tc-powered drivers, I assume just due to luck or a sample size that isn't large enough. I'm not sure what can be done about this since I've never seen such behavior in a real world scenario, but I figured I'd make a ticket.