xserver: Branch 'xorg-server-1.2-apple' - 2 commits
Ben Byer
bbyer at kemper.freedesktop.org
Thu Dec 13 06:54:20 PST 2007
fb/fb.h | 5 +++--
fb/fbpixmap.c | 12 ++++++++++++
hw/xquartz/xpr/Makefile.am | 1 +
3 files changed, 16 insertions(+), 2 deletions(-)
New commits:
commit b83bc124e8f27ad5cdbdaa6612d928d1d38bcaba
Author: Ben Byer <bbyer at bbyer.local>
Date: Thu Dec 13 06:54:07 2007 -0800
added Xquartz.man.pre to dist-extra
diff --git a/hw/xquartz/xpr/Makefile.am b/hw/xquartz/xpr/Makefile.am
index cccb8f6..7b19f0b 100644
--- a/hw/xquartz/xpr/Makefile.am
+++ b/hw/xquartz/xpr/Makefile.am
@@ -67,6 +67,7 @@ include $(top_srcdir)/cpprules.in
cp $< $@
EXTRA_DIST = \
+ Xquartz.man.pre \
dri.h \
dristruct.h \
appledri.h \
commit e1a67b4872d9e6e424b4ec06493ebc34c25bdb8f
Author: Ben Byer <bbyer at bbyer.local>
Date: Thu Dec 13 06:51:09 2007 -0800
fixes to debugging code: added "break on fb_null_pointer() hook", and make it so that
defining FB_DEBUG doesn't make Xquartz always crash (not that it currently helps with
any of our fb problems, but hey...)
diff --git a/fb/fb.h b/fb/fb.h
index ef7942f..ce0729c 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -133,10 +133,11 @@ typedef CARD32 FbStip;
typedef int FbStride;
+int fb_null_pointer(char *file, unsigned int line);
+
#define CHECK_NULL(ptr) \
if ((ptr) == NULL) {\
- ErrorF("%s:%d: null pointer\n", __FILE__, __LINE__); \
- return; \
+ if (fb_null_pointer(__FILE__, __LINE__)) return; \
}
#ifdef FB_DEBUG
diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
index f79f701..a554584 100644
--- a/fb/fbpixmap.c
+++ b/fb/fbpixmap.c
@@ -318,6 +318,15 @@ fbPixmapToRegion(PixmapPtr pPix)
return(pReg);
}
+int fb_null_pointer(char *file, unsigned int line) {
+ ErrorF("%s:%u: null pointer (break on fb_null_pointer to debug)\n", file, line);
+#ifdef FB_DEBUG
+ return 0; // ignore error, die horrible death
+#else
+ return 1; // harmlessly return to caller, hope we don't crash later
+#endif
+}
+
#ifdef FB_DEBUG
#ifndef WIN32
@@ -357,6 +366,9 @@ fbValidateDrawable (DrawablePtr pDrawable)
if (pDrawable->type != DRAWABLE_PIXMAP)
pDrawable = (DrawablePtr) fbGetWindowPixmap(pDrawable);
fbGetStipDrawable(pDrawable, bits, stride, bpp, xoff, yoff);
+#ifdef __APPLE__
+ if (bits >= 0xb0000000) return; // don't validate CG memory
+#endif
first = bits - stride;
last = bits + stride * pDrawable->height;
if (!fbValidateBits (first, stride, FB_HEAD_BITS) ||
More information about the xorg-commit
mailing list