]> git.cworth.org Git - cworth.org/blob - src/exa/i965/synchronous_composite/0001-Elminate-gettimeofday-as-a-hotspot-in-I830WaitLpRing.patch
Add synchronous composite blog entry
[cworth.org] / src / exa / i965 / synchronous_composite / 0001-Elminate-gettimeofday-as-a-hotspot-in-I830WaitLpRing.patch
1 From e8c946cb56a9789ce707888a8198a8dd092cca85 Mon Sep 17 00:00:00 2001
2 From: Carl Worth <cworth@cworth.org>
3 Date: Tue, 10 Jul 2007 00:45:55 -0700
4 Subject: [PATCH] Elminate gettimeofday as a hotspot in I830WaitLpRing
5
6 ---
7  src/i830_accel.c |   47 ++++++++++++++++++++++++-----------------------
8  1 files changed, 24 insertions(+), 23 deletions(-)
9
10 diff --git a/src/i830_accel.c b/src/i830_accel.c
11 index 5cbad44..714af5a 100644
12 --- a/src/i830_accel.c
13 +++ b/src/i830_accel.c
14 @@ -120,36 +120,37 @@ I830WaitLpRing(ScrnInfoPtr pScrn, int n, int timeout_millis)
15          ring->space += ring->mem->size;
16  
17        iters++;
18 -      now = GetTimeInMillis();
19 -      if (start == 0 || now < start || ring->head != last_head) {
20 -        if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
21 -           if (now > start)
22 -              ErrorF("space: %d wanted %d\n", ring->space, n);
23 -        start = now;
24 -        last_head = ring->head;
25 -      } else if (now - start > timeout_millis) {
26 -        ErrorF("Error in I830WaitLpRing(), timeout for %d seconds\n",
27 -               timeout_millis/1000);
28 -        if (IS_I965G(pI830))
29 -            i965_dump_error_state(pScrn);
30 -        else
31 -            i830_dump_error_state(pScrn);
32 -        ErrorF("space: %d wanted %d\n", ring->space, n);
33 +      if ((iters & 0xfff) == 0) {
34 +         now = GetTimeInMillis();
35 +         if (start == 0 || now < start || ring->head != last_head) {
36 +             if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
37 +                 if (now > start)
38 +                     ErrorF("space: %d wanted %d\n", ring->space, n);
39 +             start = now;
40 +             last_head = ring->head;
41 +         } else if (now - start > timeout_millis) {
42 +             ErrorF("Error in I830WaitLpRing(), timeout for %d seconds\n",
43 +                    timeout_millis/1000);
44 +             if (IS_I965G(pI830))
45 +                 i965_dump_error_state(pScrn);
46 +             else
47 +                 i830_dump_error_state(pScrn);
48 +             ErrorF("space: %d wanted %d\n", ring->space, n);
49  #ifdef XF86DRI
50 -        if (pI830->directRenderingEnabled) {
51 -           DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
52 -           DRICloseScreen(screenInfo.screens[pScrn->scrnIndex]);
53 -        }
54 +             if (pI830->directRenderingEnabled) {
55 +                 DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
56 +                 DRICloseScreen(screenInfo.screens[pScrn->scrnIndex]);
57 +             }
58  #endif
59  #ifdef I830_USE_XAA
60 -        pI830->AccelInfoRec = NULL;    /* Stops recursive behavior */
61 +             pI830->AccelInfoRec = NULL;       /* Stops recursive behavior */
62  #endif
63  #ifdef I830_USE_EXA
64 -        pI830->EXADriverPtr = NULL;
65 +             pI830->EXADriverPtr = NULL;
66  #endif
67 -        FatalError("lockup\n");
68 +             FatalError("lockup\n");
69 +         }
70        }
71 -
72        DELAY(10);
73     }
74  
75 -- 
76 1.5.2
77