diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-03-08 15:33:20 -0800 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-03-08 15:33:20 -0800 |
commit | 6df74e61afb7831ebf3fbab8782f46ddccbe262b (patch) | |
tree | fa13b7fd6c65361a9ba94db95d54dff5bba38522 | |
parent | c66d57080dc034aa7877f47612065e388bbc38a2 (diff) |
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>
-rw-r--r-- | src/i830_dri.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c index e8f24247..fc178076 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -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); |