xserver: Branch 'master' - 3 commits
Keith Packard
keithp at kemper.freedesktop.org
Mon Dec 27 09:46:32 PST 2010
miext/sync/misync.c | 1 -
os/utils.c | 16 +++++++++++++++-
render/render.c | 6 ++++--
3 files changed, 19 insertions(+), 4 deletions(-)
New commits:
commit efcb63d0ce43f96d0ac02b6f4a480dfd2374fc84
Author: Daniel Stone <daniel at fooishbar.org>
Date: Thu Dec 23 13:33:00 2010 +0000
Render: Fix 'comparing between distinct pointer types' warning
Add the appropriate casts so that gcc shuts up, even if it doesn't
matter.
Signed-off-by: Daniel Stone <daniel at fooishbar.org>
Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
diff --git a/render/render.c b/render/render.c
index 0bbbae8..7029558 100644
--- a/render/render.c
+++ b/render/render.c
@@ -1084,8 +1084,10 @@ ProcRenderAddGlyphs (ClientPtr client)
remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs;
/* protect against bad nglyphs */
- if (gi < stuff || gi > ((CARD32 *)stuff + client->req_len) ||
- bits < stuff || bits > ((CARD32 *)stuff + client->req_len)) {
+ if (gi < ((xGlyphInfo *)stuff) ||
+ gi > ((xGlyphInfo *)((CARD32 *)stuff + client->req_len)) ||
+ bits < ((CARD8 *)stuff) ||
+ bits > ((CARD8 *)((CARD32 *)stuff + client->req_len))) {
err = BadLength;
goto bail;
}
commit 469d5bf8b75038631c27edbb0f9cdf7d737fa233
Author: Daniel Stone <daniel at fooishbar.org>
Date: Fri Dec 17 16:48:45 2010 +0000
mi: Sync: Don't free managed screen private
misync allocates space for its screen private with
dixRegisterPrivateKey, which means it doesn't have to free it at
CloseScreen time; doing so will, in fact, result in a crash.
Signed-off-by: Daniel Stone <daniel at fooishbar.org>
Reviewed-by: James Jones <jajones at nvidia.com>
Acked-by: Tiago Vignatti <tiago.vignatti at nokia.com>
diff --git a/miext/sync/misync.c b/miext/sync/misync.c
index bcc68a2..50226d9 100644
--- a/miext/sync/misync.c
+++ b/miext/sync/misync.c
@@ -167,7 +167,6 @@ SyncCloseScreen (int i, ScreenPtr pScreen)
SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
- free(pScreenPriv);
return (*pScreen->CloseScreen) (i, pScreen);
}
commit 44adb31bfece29260a9bbd9075c9212ebf00d24d
Author: Daniel Stone <daniel at fooishbar.org>
Date: Fri Aug 27 20:36:37 2010 +1000
GetTimeInMillis: Use CLOCK_MONOTONIC_COARSE where available
On some systems, using CLOCK_MONOTONIC forces a readback of HPET or some
similarly expensive timer. CLOCK_MONOTONIC_COARSE can alleviate this,
at the cost of negligibly-reduced resolution, so prefer that where we
can.
Signed-off-by: Daniel Stone <daniel at fooishbar.org>
Reviewed-by: Julien Cristau <jcristau at debian.org>
Reviewed-by: Tiago Vignatti <tiago.vignatti at nokia.com>
diff --git a/os/utils.c b/os/utils.c
index afdff0c..18fd911 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -427,7 +427,21 @@ GetTimeInMillis(void)
#ifdef MONOTONIC_CLOCK
struct timespec tp;
- if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+ static clockid_t clockid;
+ if (!clockid) {
+#ifdef CLOCK_MONOTONIC_COARSE
+ if (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 &&
+ (tp.tv_nsec / 1000) <= 1000 &&
+ clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0)
+ clockid = CLOCK_MONOTONIC_COARSE;
+ else
+#endif
+ if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+ clockid = CLOCK_MONOTONIC;
+ else
+ clockid = ~0L;
+ }
+ if (clockid != ~0L && clock_gettime(clockid, &tp) == 0)
return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
#endif
More information about the xorg-commit
mailing list