intel: Replace wraparound test logic in bufmgr_fake. Again.
authorEric Anholt <eric@anholt.net>
Tue, 23 Sep 2008 17:48:39 +0000 (10:48 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 24 Sep 2008 00:10:04 +0000 (17:10 -0700)
commit0dccf017ab629d69fce91e18b013882ecb45f55d
tree12fbf92d5b9d896f23fb7df4396d4a64dcd0241a
parent1b3abe62b5751d0514d57aa850e584dca7dfc23e
intel: Replace wraparound test logic in bufmgr_fake.  Again.

I'd swapped the operands, so if we weren't in lockstep with the hardware we
said the sequence was always passed.  Additionally, a race was available that
we might have failed at recovering from.  Instead, I've replaced the logic
with new stuff that should be more robust and not rely on all the parties in
userland following the same IRQ_EMIT() == 1 protocol.  Also, in a radical
departure from past efforts, include a long comment describing the failure
modes and how we're working around them.

Thanks to haihao for catching the original issue.
libdrm/intel/intel_bufmgr_fake.c