DRI2: truncate OML values to 32 bits

We can only handle 32 bit values unless we totally virtualize the count,
since the kernel only handles 32 bits itself.  Rather than adding all
that overhead, just tolerate the occasional missed event everytime the
counter runs over.

Reported-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
Jesse Barnes 2010-03-08 15:33:20 -08:00
parent c66d57080d
commit 6df74e61af
1 changed files with 12 additions and 0 deletions

View File

@ -645,6 +645,12 @@ I830DRI2ScheduleSwap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
BoxRec box;
RegionRec region;
/* Truncate to match kernel interfaces; means occasional overflow
* misses, but that's generally not a big deal */
*target_msc &= 0xffffffff;
divisor &= 0xffffffff;
remainder &= 0xffffffff;
swap_info = xcalloc(1, sizeof(DRI2FrameEventRec));
/* Drawable not displayed... just complete the swap */
@ -849,6 +855,12 @@ I830DRI2ScheduleWaitMSC(ClientPtr client, DrawablePtr draw, CARD64 target_msc,
int ret, pipe = I830DRI2DrawablePipe(draw);
CARD64 current_msc;
/* Truncate to match kernel interfaces; means occasional overflow
* misses, but that's generally not a big deal */
target_msc &= 0xffffffff;
divisor &= 0xffffffff;
remainder &= 0xffffffff;
/* Drawable not visible, return immediately */
if (pipe == -1) {
DRI2WaitMSCComplete(client, draw, target_msc, 0, 0);