summaryrefslogtreecommitdiff
path: root/xserver/glx
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-12-05 15:36:12 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-12-05 15:36:12 +0000
commita90ee792d96752ad1b71b9ada922fa6afe478c99 (patch)
tree6143b00f7646951d23dfe2a4fe2992ca40b77069 /xserver/glx
parentbc97d4ecc0aa9e1b823565b07282f848700bd11a (diff)
Upgrade to xorg-server 1.9.2.
Tested by ajacoutot@, krw@, shadchin@ and jasper@ on various configurations including multihead with both zaphod and xrandr.
Diffstat (limited to 'xserver/glx')
-rw-r--r--xserver/glx/Makefile.in30
-rw-r--r--xserver/glx/glxcmds.c36
-rw-r--r--xserver/glx/glxdri.c74
-rw-r--r--xserver/glx/glxdri2.c75
-rw-r--r--xserver/glx/glxdricommon.c15
-rw-r--r--xserver/glx/glxdricommon.h3
-rw-r--r--xserver/glx/glxdriswrast.c37
-rw-r--r--xserver/glx/glxext.c31
-rw-r--r--xserver/glx/glxscreens.c21
-rw-r--r--xserver/glx/indirect_util.c2
-rw-r--r--xserver/glx/single2.c26
-rw-r--r--xserver/glx/single2swap.c4
-rw-r--r--xserver/glx/singlesize.c4
-rw-r--r--xserver/glx/unpack.h2
-rw-r--r--xserver/glx/xfont.c25
15 files changed, 214 insertions, 171 deletions
diff --git a/xserver/glx/Makefile.in b/xserver/glx/Makefile.in
index c0d8bc828..4c51838b9 100644
--- a/xserver/glx/Makefile.in
+++ b/xserver/glx/Makefile.in
@@ -127,10 +127,6 @@ BUILDDOCS_TRUE = @BUILDDOCS_TRUE@
BUILD_DATE = @BUILD_DATE@
BUILD_KDRIVEFBDEVLIB_FALSE = @BUILD_KDRIVEFBDEVLIB_FALSE@
BUILD_KDRIVEFBDEVLIB_TRUE = @BUILD_KDRIVEFBDEVLIB_TRUE@
-BUILD_LINUXDOC_FALSE = @BUILD_LINUXDOC_FALSE@
-BUILD_LINUXDOC_TRUE = @BUILD_LINUXDOC_TRUE@
-BUILD_PDFDOC_FALSE = @BUILD_PDFDOC_FALSE@
-BUILD_PDFDOC_TRUE = @BUILD_PDFDOC_TRUE@
BUILD_TIME = @BUILD_TIME@
CC = @CC@
CCAS = @CCAS@
@@ -218,6 +214,8 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ENABLE_DEVEL_DOCS_FALSE = @ENABLE_DEVEL_DOCS_FALSE@
+ENABLE_DEVEL_DOCS_TRUE = @ENABLE_DEVEL_DOCS_TRUE@
EXEEXT = @EXEEXT@
F77 = @F77@
FBDEVHW_FALSE = @FBDEVHW_FALSE@
@@ -232,6 +230,7 @@ FONTOTFDIR = @FONTOTFDIR@
FONTROOTDIR = @FONTROOTDIR@
FONTTTFDIR = @FONTTTFDIR@
FONTTYPE1DIR = @FONTTYPE1DIR@
+FOP = @FOP@
FREEBSD_KLDLOAD_FALSE = @FREEBSD_KLDLOAD_FALSE@
FREEBSD_KLDLOAD_TRUE = @FREEBSD_KLDLOAD_TRUE@
GLIB_CFLAGS = @GLIB_CFLAGS@
@@ -249,10 +248,14 @@ HAVE_DBUS_FALSE = @HAVE_DBUS_FALSE@
HAVE_DBUS_TRUE = @HAVE_DBUS_TRUE@
HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@
HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@
-HAVE_PS2PDF_FALSE = @HAVE_PS2PDF_FALSE@
-HAVE_PS2PDF_TRUE = @HAVE_PS2PDF_TRUE@
+HAVE_FOP_FALSE = @HAVE_FOP_FALSE@
+HAVE_FOP_TRUE = @HAVE_FOP_TRUE@
HAVE_STYLESHEETS_FALSE = @HAVE_STYLESHEETS_FALSE@
HAVE_STYLESHEETS_TRUE = @HAVE_STYLESHEETS_TRUE@
+HAVE_XMLTO_FALSE = @HAVE_XMLTO_FALSE@
+HAVE_XMLTO_TEXT_FALSE = @HAVE_XMLTO_TEXT_FALSE@
+HAVE_XMLTO_TEXT_TRUE = @HAVE_XMLTO_TEXT_TRUE@
+HAVE_XMLTO_TRUE = @HAVE_XMLTO_TRUE@
HP300_VIDEO_FALSE = @HP300_VIDEO_FALSE@
HP300_VIDEO_TRUE = @HP300_VIDEO_TRUE@
HPPA_VIDEO_FALSE = @HPPA_VIDEO_FALSE@
@@ -308,10 +311,11 @@ LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIBS = @LIBDRM_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@
+LIBSHA1_LIBS = @LIBSHA1_LIBS@
LIBTOOL = @LIBTOOL@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
-LINUXDOC = @LINUXDOC@
LINUX_ALPHA_FALSE = @LINUX_ALPHA_FALSE@
LINUX_ALPHA_TRUE = @LINUX_ALPHA_TRUE@
LINUX_IA64_FALSE = @LINUX_IA64_FALSE@
@@ -329,17 +333,11 @@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAIN_LIB = @MAIN_LIB@
MAKEINFO = @MAKEINFO@
-MAKE_HTML = @MAKE_HTML@
-MAKE_PDF = @MAKE_PDF@
-MAKE_PS = @MAKE_PS@
-MAKE_TEXT = @MAKE_TEXT@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MITSHM_FALSE = @MITSHM_FALSE@
MITSHM_TRUE = @MITSHM_TRUE@
-MULTIBUFFER_FALSE = @MULTIBUFFER_FALSE@
-MULTIBUFFER_TRUE = @MULTIBUFFER_TRUE@
NEED_STRLCAT_FALSE = @NEED_STRLCAT_FALSE@
NEED_STRLCAT_TRUE = @NEED_STRLCAT_TRUE@
NEED_VSNPRINTF_FALSE = @NEED_VSNPRINTF_FALSE@
@@ -366,20 +364,23 @@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@
PCIACCESS_LIBS = @PCIACCESS_LIBS@
PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@
PERL = @PERL@
+PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
+PIXMAN_LIBS = @PIXMAN_LIBS@
PKG_CONFIG = @PKG_CONFIG@
PPC_VIDEO_FALSE = @PPC_VIDEO_FALSE@
PPC_VIDEO_TRUE = @PPC_VIDEO_TRUE@
PROJECTROOT = @PROJECTROOT@
-PS2PDF = @PS2PDF@
RANLIB = @RANLIB@
RAWCPP = @RAWCPP@
RAWCPPFLAGS = @RAWCPPFLAGS@
RECORD_FALSE = @RECORD_FALSE@
RECORD_TRUE = @RECORD_TRUE@
+RELEASE_DATE = @RELEASE_DATE@
RES_FALSE = @RES_FALSE@
RES_TRUE = @RES_TRUE@
SCREENSAVER_FALSE = @SCREENSAVER_FALSE@
SCREENSAVER_TRUE = @SCREENSAVER_TRUE@
+SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@
SECURE_RPC_FALSE = @SECURE_RPC_FALSE@
SECURE_RPC_TRUE = @SECURE_RPC_TRUE@
SED = @SED@
@@ -471,6 +472,7 @@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@
XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@
XLIB_CFLAGS = @XLIB_CFLAGS@
XLIB_LIBS = @XLIB_LIBS@
+XMLTO = @XMLTO@
XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@
XNESTMODULES_LIBS = @XNESTMODULES_LIBS@
XNEST_FALSE = @XNEST_FALSE@
diff --git a/xserver/glx/glxcmds.c b/xserver/glx/glxcmds.c
index ec3bbe6a3..8d13c1509 100644
--- a/xserver/glx/glxcmds.c
+++ b/xserver/glx/glxcmds.c
@@ -196,7 +196,7 @@ __glXContextDestroy(__GLXcontext *context)
static void __glXdirectContextDestroy(__GLXcontext *context)
{
__glXContextDestroy(context);
- xfree(context);
+ free(context);
}
static __GLXcontext *__glXdirectContextCreate(__GLXscreen *screen,
@@ -205,7 +205,7 @@ static __GLXcontext *__glXdirectContextCreate(__GLXscreen *screen,
{
__GLXcontext *context;
- context = xcalloc (1, sizeof (__GLXcontext));
+ context = calloc(1, sizeof (__GLXcontext));
if (context == NULL)
return NULL;
@@ -407,9 +407,9 @@ static int AddCurrentContext(__GLXclientState *cl, __GLXcontext *glxc)
** Didn't find a free slot, so we'll have to grow the table.
*/
if (!num) {
- table = (__GLXcontext **) xalloc(sizeof(__GLXcontext *));
+ table = (__GLXcontext **) malloc(sizeof(__GLXcontext *));
} else {
- table = (__GLXcontext **) xrealloc(table,
+ table = (__GLXcontext **) realloc(table,
(num+1)*sizeof(__GLXcontext *));
}
table[num] = glxc;
@@ -491,6 +491,13 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client,
return pGlxDraw;
}
+ /* No active context and an unknown drawable, bail. */
+ if (glxc == NULL) {
+ client->errorValue = drawId;
+ *error = BadMatch;
+ return NULL;
+ }
+
/* The drawId wasn't a GLX drawable. Make sure it's a window and
* create a GLXWindow for it. Check that the drawable screen
* matches the context screen and that the context fbconfig is
@@ -1527,7 +1534,7 @@ DoQueryContext(__GLXclientState *cl, GLXContextID gcId)
reply.n = nProps;
nReplyBytes = reply.length << 2;
- sendBuf = (int *)xalloc((size_t)nReplyBytes);
+ sendBuf = (int *)malloc((size_t)nReplyBytes);
if (sendBuf == NULL) {
return __glXError(GLXBadContext); /* XXX: Is this correct? */
}
@@ -1545,7 +1552,7 @@ DoQueryContext(__GLXclientState *cl, GLXContextID gcId)
WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)&reply);
WriteToClient(client, nReplyBytes, (char *)sendBuf);
}
- xfree((char *)sendBuf);
+ free((char *)sendBuf);
return Success;
}
@@ -1947,9 +1954,9 @@ int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc)
*/
if (cl->largeCmdBufSize < cmdlen) {
if (!cl->largeCmdBuf) {
- cl->largeCmdBuf = (GLbyte *) xalloc(cmdlen);
+ cl->largeCmdBuf = (GLbyte *) malloc(cmdlen);
} else {
- cl->largeCmdBuf = (GLbyte *) xrealloc(cl->largeCmdBuf, cmdlen);
+ cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, cmdlen);
}
if (!cl->largeCmdBuf) {
return BadAlloc;
@@ -2351,7 +2358,7 @@ int __glXDisp_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
reply.n = n;
/* Allocate buffer to make sure it's a multiple of 4 bytes big.*/
- buf = (char *) xalloc(length << 2);
+ buf = (char *) malloc(length << 2);
if (buf == NULL)
return BadAlloc;
memcpy(buf, pGlxScreen->GLXextensions, n);
@@ -2363,7 +2370,7 @@ int __glXDisp_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
WriteToClient(client, (int)(length << 2), (char *)buf);
}
- xfree(buf);
+ free(buf);
return Success;
}
@@ -2407,7 +2414,7 @@ int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc)
reply.length = length;
reply.n = n;
- buf = (char *) xalloc(length << 2);
+ buf = (char *) malloc(length << 2);
if (buf == NULL) {
return BadAlloc;
}
@@ -2420,7 +2427,7 @@ int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc)
WriteToClient(client, (int)(length << 2), buf);
}
- xfree(buf);
+ free(buf);
return Success;
}
@@ -2431,10 +2438,9 @@ int __glXDisp_ClientInfo(__GLXclientState *cl, GLbyte *pc)
cl->GLClientmajorVersion = req->major;
cl->GLClientminorVersion = req->minor;
- if (cl->GLClientextensions)
- xfree(cl->GLClientextensions);
+ free(cl->GLClientextensions);
buf = (const char *)(req+1);
- cl->GLClientextensions = xstrdup(buf);
+ cl->GLClientextensions = strdup(buf);
return Success;
}
diff --git a/xserver/glx/glxdri.c b/xserver/glx/glxdri.c
index e4870c319..41482c913 100644
--- a/xserver/glx/glxdri.c
+++ b/xserver/glx/glxdri.c
@@ -35,6 +35,7 @@
#include <drm.h>
#include <GL/gl.h>
#include <GL/internal/dri_interface.h>
+#include <GL/glxtokens.h>
#include <windowstr.h>
#include <os.h>
@@ -241,7 +242,7 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable)
__glXDrawableRelease(drawable);
- xfree(private);
+ free(private);
}
static GLboolean
@@ -298,7 +299,7 @@ __glXDRIcontextDestroy(__GLXcontext *baseContext)
__glXleaveServer(GL_FALSE);
__glXContextDestroy(&context->base);
- xfree(context);
+ free(context);
}
static int
@@ -467,7 +468,7 @@ nooverride:
pRegion = NULL;
} else {
pRegion = DamageRegion(driDraw->pDamage);
- if (REGION_NIL(pRegion))
+ if (RegionNil(pRegion))
return Success;
}
@@ -494,7 +495,7 @@ nooverride:
unsigned pitch = PixmapBytePad(pixmap->drawable.width,
pixmap->drawable.depth);
- data = xalloc(pitch * pixmap->drawable.height);
+ data = malloc(pitch * pixmap->drawable.height);
__glXenterServer(GL_FALSE);
pScreen->GetImage(&pixmap->drawable, 0 /*pixmap->drawable.x*/,
@@ -525,13 +526,13 @@ nooverride:
type,
data) );
- xfree(data);
+ free(data);
} else if (!override) {
int i, numRects;
BoxPtr p;
- numRects = REGION_NUM_RECTS (pRegion);
- p = REGION_RECTS (pRegion);
+ numRects = RegionNumRects (pRegion);
+ p = RegionRects (pRegion);
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, 0) );
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, 0) );
@@ -540,7 +541,7 @@ nooverride:
{
unsigned pitch = PixmapBytePad(p[i].x2 - p[i].x1,
pixmap->drawable.depth);
- void *data = xalloc(pitch * (p[i].y2 - p[i].y1));
+ void *data = malloc(pitch * (p[i].y2 - p[i].y1));
__glXenterServer(GL_FALSE);
pScreen->GetImage(&pixmap->drawable, /*pixmap->drawable.x +*/ p[i].x1,
@@ -566,7 +567,7 @@ nooverride:
type,
data) );
- xfree(data);
+ free(data);
}
}
@@ -606,7 +607,7 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
__glXScreenDestroy(baseScreen);
- xfree(screen);
+ free(screen);
}
static __GLXcontext *
@@ -633,7 +634,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
if (baseShareContext && baseShareContext->isDirect)
return NULL;
- context = xcalloc(1, sizeof *context);
+ context = calloc(1, sizeof *context);
if (context == NULL)
return NULL;
@@ -674,7 +675,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
__glXenterServer(GL_FALSE);
retval = DRIDestroyContext(baseScreen->pScreen, context->hwContextID);
__glXleaveServer(GL_FALSE);
- xfree(context);
+ free(context);
return NULL;
}
@@ -696,13 +697,13 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
GLboolean retval;
drm_drawable_t hwDrawable;
- private = xcalloc(1, sizeof *private);
+ private = calloc(1, sizeof *private);
if (private == NULL)
return NULL;
if (!__glXDrawableInit(&private->base, screen,
pDraw, type, glxDrawId, glxConfig)) {
- xfree(private);
+ free(private);
return NULL;
}
@@ -718,7 +719,7 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
__glXleaveServer(GL_FALSE);
if (!retval) {
- xfree(private);
+ free(private);
return NULL;
}
@@ -734,7 +735,7 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
__glXenterServer(GL_FALSE);
DRIDestroyDrawable(screen->pScreen, serverClient, pDraw);
__glXleaveServer(GL_FALSE);
- xfree(private);
+ free(private);
return NULL;
}
@@ -771,7 +772,7 @@ getDrawableInfo(__DRIdrawable *driDrawable,
if (retval && *numClipRects > 0) {
size = sizeof (drm_clip_rect_t) * *numClipRects;
- *ppClipRects = xalloc (size);
+ *ppClipRects = malloc(size);
/* Clip cliprects to screen dimensions (redirected windows) */
if (*ppClipRects != NULL) {
@@ -791,7 +792,7 @@ getDrawableInfo(__DRIdrawable *driDrawable,
if (*numClipRects != j) {
*numClipRects = j;
- *ppClipRects = xrealloc (*ppClipRects,
+ *ppClipRects = realloc(*ppClipRects,
sizeof (drm_clip_rect_t) *
*numClipRects);
}
@@ -805,7 +806,7 @@ getDrawableInfo(__DRIdrawable *driDrawable,
if (retval && *numBackClipRects > 0) {
size = sizeof (drm_clip_rect_t) * *numBackClipRects;
- *ppBackClipRects = xalloc (size);
+ *ppBackClipRects = malloc(size);
if (*ppBackClipRects != NULL)
memcpy (*ppBackClipRects, pBackClipRects, size);
else
@@ -831,12 +832,12 @@ static void __glXReportDamage(__DRIdrawable *driDraw,
__glXenterServer(GL_FALSE);
- REGION_INIT(pDraw->pScreen, &region, (BoxPtr) rects, num_rects);
- REGION_TRANSLATE(pScreen, &region, pDraw->x, pDraw->y);
+ RegionInit(&region, (BoxPtr) rects, num_rects);
+ RegionTranslate(&region, pDraw->x, pDraw->y);
DamageRegionAppend(pDraw, &region);
/* This is wrong, this needs a seperate function. */
DamageRegionProcessPending(pDraw);
- REGION_UNINIT(pDraw->pScreen, &region);
+ RegionUninit(&region);
__glXleaveServer(GL_FALSE);
}
@@ -865,12 +866,21 @@ static const char dri_driver_path[] = DRI_DRIVER_PATH;
static Bool
glxDRIEnterVT (int index, int flags)
{
+ ScrnInfoPtr scrn = xf86Screens[index];
+ Bool ret;
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(screenInfo.screens[index]);
LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
- if (!(*screen->enterVT) (index, flags))
+ scrn->EnterVT = screen->enterVT;
+
+ ret = scrn->EnterVT (index, flags);
+
+ screen->enterVT = scrn->EnterVT;
+ scrn->EnterVT = glxDRIEnterVT;
+
+ if (!ret)
return FALSE;
glxResumeClients();
@@ -881,6 +891,7 @@ glxDRIEnterVT (int index, int flags)
static void
glxDRILeaveVT (int index, int flags)
{
+ ScrnInfoPtr scrn = xf86Screens[index];
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(screenInfo.screens[index]);
@@ -888,7 +899,10 @@ glxDRILeaveVT (int index, int flags)
glxSuspendClients();
- return (*screen->leaveVT) (index, flags);
+ scrn->LeaveVT = screen->leaveVT;
+ (*screen->leaveVT) (index, flags);
+ screen->leaveVT = scrn->LeaveVT;
+ scrn->LeaveVT = glxDRILeaveVT;
}
static void
@@ -941,9 +955,6 @@ initializeExtensions(__GLXDRIscreen *screen)
}
}
-extern __GLXconfig *
-glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs);
-
static __GLXscreen *
__glXDRIscreenProbe(ScreenPtr pScreen)
{
@@ -979,7 +990,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
return NULL;
}
- screen = xcalloc(1, sizeof *screen);
+ screen = calloc(1, sizeof *screen);
if (screen == NULL)
return NULL;
@@ -1133,7 +1144,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
goto handle_error;
}
- screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs);
+ screen->base.fbconfigs = glxConvertConfigs(screen->core,
+ driConfigs, GLX_WINDOW_BIT);
initializeExtensions(screen);
@@ -1149,7 +1161,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
if (buffer_size > 0) {
if (screen->base.GLXextensions != NULL) {
- xfree(screen->base.GLXextensions);
+ free(screen->base.GLXextensions);
}
screen->base.GLXextensions = xnfalloc(buffer_size);
@@ -1184,7 +1196,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
if (screen->driver)
dlclose(screen->driver);
- xfree(screen);
+ free(screen);
LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
diff --git a/xserver/glx/glxdri2.c b/xserver/glx/glxdri2.c
index a580df381..c2305ad90 100644
--- a/xserver/glx/glxdri2.c
+++ b/xserver/glx/glxdri2.c
@@ -107,7 +107,7 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable)
__glXDrawableRelease(drawable);
- xfree(private);
+ free(private);
}
static void
@@ -122,7 +122,7 @@ __glXDRIdrawableCopySubBuffer(__GLXdrawable *drawable,
box.y1 = private->height - y - h;
box.x2 = x + w;
box.y2 = private->height - y;
- REGION_INIT(drawable->pDraw->pScreen, &region, &box, 0);
+ RegionInit(&region, &box, 0);
DRI2CopyRegion(drawable->pDraw, &region,
DRI2BufferFrontLeft, DRI2BufferBackLeft);
@@ -139,7 +139,7 @@ __glXDRIdrawableWaitX(__GLXdrawable *drawable)
box.y1 = 0;
box.x2 = private->width;
box.y2 = private->height;
- REGION_INIT(drawable->pDraw->pScreen, &region, &box, 0);
+ RegionInit(&region, &box, 0);
DRI2CopyRegion(drawable->pDraw, &region,
DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft);
@@ -156,7 +156,7 @@ __glXDRIdrawableWaitGL(__GLXdrawable *drawable)
box.y1 = 0;
box.x2 = private->width;
box.y2 = private->height;
- REGION_INIT(drawable->pDraw->pScreen, &region, &box, 0);
+ RegionInit(&region, &box, 0);
DRI2CopyRegion(drawable->pDraw, &region,
DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft);
@@ -187,7 +187,6 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
/* unknown swap completion type */
break;
}
- wire.sequenceNumber = client->sequence;
wire.drawable = drawable->drawId;
wire.ust_hi = ust >> 32;
wire.ust_lo = ust & 0xffffffff;
@@ -248,7 +247,7 @@ __glXDRIcontextDestroy(__GLXcontext *baseContext)
(*screen->core->destroyContext)(context->driContext);
__glXContextDestroy(&context->base);
- xfree(context);
+ free(context);
}
static int
@@ -386,7 +385,7 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
__glXScreenDestroy(baseScreen);
- xfree(screen);
+ free(screen);
}
static __GLXcontext *
@@ -405,7 +404,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
else
driShare = NULL;
- context = xcalloc(1, sizeof *context);
+ context = calloc(1, sizeof *context);
if (context == NULL)
return NULL;
@@ -422,13 +421,25 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
config->driConfig,
driShare, context);
if (context->driContext == NULL) {
- xfree(context);
+ free(context);
return NULL;
}
return &context->base;
}
+static void
+__glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv)
+{
+#if __DRI2_FLUSH_VERSION >= 3
+ __GLXDRIdrawable *private = priv;
+ __GLXDRIscreen *screen = private->screen;
+
+ if (screen->flush)
+ (*screen->flush->invalidate)(private->driDrawable);
+#endif
+}
+
static __GLXdrawable *
__glXDRIscreenCreateDrawable(ClientPtr client,
__GLXscreen *screen,
@@ -442,14 +453,14 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
__GLXDRIdrawable *private;
- private = xcalloc(1, sizeof *private);
+ private = calloc(1, sizeof *private);
if (private == NULL)
return NULL;
private->screen = driScreen;
if (!__glXDrawableInit(&private->base, screen,
pDraw, type, glxDrawId, glxConfig)) {
- xfree(private);
+ free(private);
return NULL;
}
@@ -459,8 +470,9 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
private->base.waitGL = __glXDRIdrawableWaitGL;
private->base.waitX = __glXDRIdrawableWaitX;
- if (DRI2CreateDrawable(client, pDraw, drawId)) {
- xfree(private);
+ if (DRI2CreateDrawable(client, pDraw, drawId,
+ __glXDRIinvalidateBuffers, private)) {
+ free(private);
return NULL;
}
@@ -573,9 +585,18 @@ static const __DRIdri2LoaderExtension loaderExtension = {
dri2GetBuffersWithFormat,
};
+#ifdef __DRI_USE_INVALIDATE
+static const __DRIuseInvalidateExtension dri2UseInvalidate = {
+ { __DRI_USE_INVALIDATE, __DRI_USE_INVALIDATE_VERSION }
+};
+#endif
+
static const __DRIextension *loader_extensions[] = {
&systemTimeExtension.base,
&loaderExtension.base,
+#ifdef __DRI_USE_INVALIDATE
+ &dri2UseInvalidate,
+#endif
NULL
};
@@ -584,12 +605,21 @@ static const char dri_driver_path[] = DRI_DRIVER_PATH;
static Bool
glxDRIEnterVT (int index, int flags)
{
+ ScrnInfoPtr scrn = xf86Screens[index];
+ Bool ret;
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(screenInfo.screens[index]);
LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n");
- if (!(*screen->enterVT) (index, flags))
+ scrn->EnterVT = screen->enterVT;
+
+ ret = scrn->EnterVT (index, flags);
+
+ screen->enterVT = scrn->EnterVT;
+ scrn->EnterVT = glxDRIEnterVT;
+
+ if (!ret)
return FALSE;
glxResumeClients();
@@ -600,6 +630,7 @@ glxDRIEnterVT (int index, int flags)
static void
glxDRILeaveVT (int index, int flags)
{
+ ScrnInfoPtr scrn = xf86Screens[index];
__GLXDRIscreen *screen = (__GLXDRIscreen *)
glxGetScreen(screenInfo.screens[index]);
@@ -607,7 +638,10 @@ glxDRILeaveVT (int index, int flags)
glxSuspendClients();
- return (*screen->leaveVT) (index, flags);
+ scrn->LeaveVT = screen->leaveVT;
+ (*screen->leaveVT) (index, flags);
+ screen->leaveVT = scrn->LeaveVT;
+ scrn->LeaveVT = glxDRILeaveVT;
}
static void
@@ -676,7 +710,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
const __DRIconfig **driConfigs;
int i;
- screen = xcalloc(1, sizeof *screen);
+ screen = calloc(1, sizeof *screen);
if (screen == NULL)
return NULL;
@@ -745,7 +779,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
initializeExtensions(screen);
- screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs);
+ screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs,
+ GLX_WINDOW_BIT |
+ GLX_PIXMAP_BIT |
+ GLX_PBUFFER_BIT);
__glXScreenInit(&screen->base, pScreen);
@@ -756,7 +793,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
if (buffer_size > 0) {
if (screen->base.GLXextensions != NULL) {
- xfree(screen->base.GLXextensions);
+ free(screen->base.GLXextensions);
}
screen->base.GLXextensions = xnfalloc(buffer_size);
@@ -790,7 +827,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
if (screen->driver)
dlclose(screen->driver);
- xfree(screen);
+ free(screen);
LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
diff --git a/xserver/glx/glxdricommon.c b/xserver/glx/glxdricommon.c
index faaa3b7ae..86797a0ef 100644
--- a/xserver/glx/glxdricommon.c
+++ b/xserver/glx/glxdricommon.c
@@ -121,13 +121,13 @@ setScalar(__GLXconfig *config, unsigned int attrib, unsigned int value)
static __GLXconfig *
createModeFromConfig(const __DRIcoreExtension *core,
const __DRIconfig *driConfig,
- unsigned int visualType)
+ unsigned int visualType, unsigned int drawableType)
{
__GLXDRIconfig *config;
unsigned int attrib, value;
int i;
- config = xalloc(sizeof *config);
+ config = malloc(sizeof *config);
config->driConfig = driConfig;
@@ -167,13 +167,14 @@ createModeFromConfig(const __DRIcoreExtension *core,
config->config.next = NULL;
config->config.xRenderable = GL_TRUE;
config->config.visualType = visualType;
- config->config.drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT;
+ config->config.drawableType = drawableType;
return &config->config;
}
__GLXconfig *
-glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs)
+glxConvertConfigs(const __DRIcoreExtension *core,
+ const __DRIconfig **configs, unsigned int drawableType)
{
__GLXconfig head, *tail;
int i;
@@ -183,7 +184,8 @@ glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs)
for (i = 0; configs[i]; i++) {
tail->next = createModeFromConfig(core,
- configs[i], GLX_TRUE_COLOR);
+ configs[i], GLX_TRUE_COLOR,
+ drawableType);
if (tail->next == NULL)
break;
@@ -192,7 +194,8 @@ glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs)
for (i = 0; configs[i]; i++) {
tail->next = createModeFromConfig(core,
- configs[i], GLX_DIRECT_COLOR);
+ configs[i], GLX_DIRECT_COLOR,
+ drawableType);
if (tail->next == NULL)
break;
diff --git a/xserver/glx/glxdricommon.h b/xserver/glx/glxdricommon.h
index f88964b36..41e2d2770 100644
--- a/xserver/glx/glxdricommon.h
+++ b/xserver/glx/glxdricommon.h
@@ -33,7 +33,8 @@ struct __GLXDRIconfig {
};
__GLXconfig *
-glxConvertConfigs(const __DRIcoreExtension *core, const __DRIconfig **configs);
+glxConvertConfigs(const __DRIcoreExtension *core,
+ const __DRIconfig **configs, unsigned int drawableType);
extern const __DRIsystemTimeExtension systemTimeExtension;
diff --git a/xserver/glx/glxdriswrast.c b/xserver/glx/glxdriswrast.c
index 6a34393dd..54f4440a3 100644
--- a/xserver/glx/glxdriswrast.c
+++ b/xserver/glx/glxdriswrast.c
@@ -104,7 +104,7 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable)
__glXDrawableRelease(drawable);
- xfree(private);
+ free(private);
}
static GLboolean
@@ -138,7 +138,7 @@ __glXDRIcontextDestroy(__GLXcontext *baseContext)
(*screen->core->destroyContext)(context->driContext);
__glXContextDestroy(&context->base);
- xfree(context);
+ free(context);
}
static int
@@ -254,7 +254,7 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
__glXScreenDestroy(baseScreen);
- xfree(screen);
+ free(screen);
}
static __GLXcontext *
@@ -274,7 +274,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
else
driShare = NULL;
- context = xcalloc(1, sizeof *context);
+ context = calloc(1, sizeof *context);
if (context == NULL)
return NULL;
@@ -292,14 +292,6 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
return &context->base;
}
-static void
-glxChangeGC(GCPtr gc, BITS32 mask, CARD32 val)
-{
- CARD32 v[1];
- v[0] = val;
- dixChangeGC(NullClient, gc, mask, v, NULL);
-}
-
static __GLXdrawable *
__glXDRIscreenCreateDrawable(ClientPtr client,
__GLXscreen *screen,
@@ -309,20 +301,21 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
XID glxDrawId,
__GLXconfig *glxConfig)
{
+ ChangeGCVal gcvals[2];
__GLXDRIscreen *driScreen = (__GLXDRIscreen *) screen;
__GLXDRIconfig *config = (__GLXDRIconfig *) glxConfig;
__GLXDRIdrawable *private;
ScreenPtr pScreen = driScreen->base.pScreen;
- private = xcalloc(1, sizeof *private);
+ private = calloc(1, sizeof *private);
if (private == NULL)
return NULL;
private->screen = driScreen;
if (!__glXDrawableInit(&private->base, screen,
pDraw, type, glxDrawId, glxConfig)) {
- xfree(private);
+ free(private);
return NULL;
}
@@ -333,9 +326,10 @@ __glXDRIscreenCreateDrawable(ClientPtr client,
private->gc = CreateScratchGC(pScreen, pDraw->depth);
private->swapgc = CreateScratchGC(pScreen, pDraw->depth);
- glxChangeGC(private->gc, GCFunction, GXcopy);
- glxChangeGC(private->swapgc, GCFunction, GXcopy);
- glxChangeGC(private->swapgc, GCGraphicsExposures, FALSE);
+ gcvals[0].val = GXcopy;
+ ChangeGC(NullClient, private->gc, GCFunction, gcvals);
+ gcvals[1].val = FALSE;
+ ChangeGC(NullClient, private->swapgc, GCFunction | GCGraphicsExposures, gcvals);
private->driDrawable =
(*driScreen->swrast->createNewDrawable)(driScreen->driScreen,
@@ -450,7 +444,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
const __DRIconfig **driConfigs;
int i;
- screen = xcalloc(1, sizeof *screen);
+ screen = calloc(1, sizeof *screen);
if (screen == NULL)
return NULL;
@@ -508,7 +502,10 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
initializeExtensions(screen);
- screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs);
+ screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs,
+ GLX_WINDOW_BIT |
+ GLX_PIXMAP_BIT |
+ GLX_PBUFFER_BIT);
__glXScreenInit(&screen->base, pScreen);
@@ -524,7 +521,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
if (screen->driver)
dlclose(screen->driver);
- xfree(screen);
+ free(screen);
LogMessage(X_ERROR, "GLX: could not load software renderer\n");
diff --git a/xserver/glx/glxext.c b/xserver/glx/glxext.c
index 89e58b0b0..f5ebe4f7e 100644
--- a/xserver/glx/glxext.c
+++ b/xserver/glx/glxext.c
@@ -65,8 +65,8 @@ RESTYPE __glXSwapBarrierRes;
*/
xGLXSingleReply __glXReply;
-static int glxClientPrivateKeyIndex;
-static DevPrivateKey glxClientPrivateKey = &glxClientPrivateKeyIndex;
+static DevPrivateKeyRec glxClientPrivateKeyRec;
+#define glxClientPrivateKey (&glxClientPrivateKeyRec)
/*
** Client that called into GLX dispatch.
@@ -124,7 +124,7 @@ static int glxBlockClients;
*/
static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
{
- __GLXcontext *c;
+ __GLXcontext *c, *next;
/* If this drawable was created using glx 1.3 drawable
* constructors, we added it as a glx drawable resource under both
@@ -137,7 +137,8 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
FreeResourceByType(glxPriv->drawId, __glXDrawableRes, TRUE);
}
- for (c = glxAllContexts; c; c = c->next) {
+ for (c = glxAllContexts; c; c = next) {
+ next = c->next;
if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) {
int i;
@@ -160,15 +161,13 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
}
}
}
-
- if (!c->idExists) {
- __glXFreeContext(c);
- }
}
if (c->drawPriv == glxPriv)
c->drawPriv = NULL;
if (c->readPriv == glxPriv)
c->readPriv = NULL;
+ if (!c->idExists && !c->isCurrent)
+ __glXFreeContext(c);
}
glxPriv->destroy(glxPriv);
@@ -205,8 +204,8 @@ GLboolean __glXFreeContext(__GLXcontext *cx)
{
if (cx->idExists || cx->isCurrent) return GL_FALSE;
- if (cx->feedbackBuf) xfree(cx->feedbackBuf);
- if (cx->selectBuf) xfree(cx->selectBuf);
+ free(cx->feedbackBuf);
+ free(cx->selectBuf);
if (cx == __glXLastContext) {
__glXFlushContextCache();
}
@@ -323,10 +322,10 @@ glxClientCallback (CallbackListPtr *list,
}
}
- if (cl->returnBuf) xfree(cl->returnBuf);
- if (cl->largeCmdBuf) xfree(cl->largeCmdBuf);
- if (cl->currentContexts) xfree(cl->currentContexts);
- if (cl->GLClientextensions) xfree(cl->GLClientextensions);
+ free(cl->returnBuf);
+ free(cl->largeCmdBuf);
+ free(cl->currentContexts);
+ free(cl->GLClientextensions);
break;
default:
@@ -364,7 +363,7 @@ void GlxExtensionInit(void)
if (!__glXContextRes || !__glXDrawableRes || !__glXSwapBarrierRes)
return;
- if (!dixRequestPrivate(glxClientPrivateKey, sizeof (__GLXclientState)))
+ if (!dixRegisterPrivateKey(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (__GLXclientState)))
return;
if (!AddCallback (&ClientStateCallback, glxClientCallback, 0))
return;
@@ -583,7 +582,7 @@ static int __glXDispatch(ClientPtr client)
ResetCurrentRequest(client);
client->sequence--;
IgnoreClient(client);
- return(client->noClientException);
+ return Success;
}
/*
diff --git a/xserver/glx/glxscreens.c b/xserver/glx/glxscreens.c
index b75aea6f2..8515e14d5 100644
--- a/xserver/glx/glxscreens.c
+++ b/xserver/glx/glxscreens.c
@@ -44,8 +44,8 @@
#include "glxext.h"
#include "protocol-versions.h"
-static int glxScreenPrivateKeyIndex;
-static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKeyIndex;
+static DevPrivateKeyRec glxScreenPrivateKeyRec;
+#define glxScreenPrivateKey (&glxScreenPrivateKeyRec)
const char GLServerVersion[] = "1.4";
static const char GLServerExtensions[] =
@@ -352,10 +352,13 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
__GLXconfig *config;
int i;
+ if (!dixRegisterPrivateKey(&glxScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return;
+
pGlxScreen->pScreen = pScreen;
- pGlxScreen->GLextensions = xstrdup(GLServerExtensions);
- pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName);
- pGlxScreen->GLXextensions = xstrdup(GLXServerExtensions);
+ pGlxScreen->GLextensions = strdup(GLServerExtensions);
+ pGlxScreen->GLXvendor = strdup(GLXServerVendorName);
+ pGlxScreen->GLXextensions = strdup(GLXServerExtensions);
/* All GLX providers must support all of the functionality required for at
* least GLX 1.2. If the provider supports a higher version, the GLXminor
@@ -378,7 +381,7 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
pGlxScreen->numFBConfigs = i;
pGlxScreen->visuals =
- xcalloc(pGlxScreen->numFBConfigs, sizeof (__GLXconfig *));
+ calloc(pGlxScreen->numFBConfigs, sizeof (__GLXconfig *));
/* First, try to choose featureful FBconfigs for the existing X visuals.
* Note that if multiple X visuals end up with the same FBconfig being
@@ -436,7 +439,7 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
void __glXScreenDestroy(__GLXscreen *screen)
{
- xfree(screen->GLXvendor);
- xfree(screen->GLXextensions);
- xfree(screen->GLextensions);
+ free(screen->GLXvendor);
+ free(screen->GLXextensions);
+ free(screen->GLextensions);
}
diff --git a/xserver/glx/indirect_util.c b/xserver/glx/indirect_util.c
index 44309104e..46a270695 100644
--- a/xserver/glx/indirect_util.c
+++ b/xserver/glx/indirect_util.c
@@ -88,7 +88,7 @@ __glXGetAnswerBuffer( __GLXclientState * cl, size_t required_size,
intptr_t temp_buf;
if ( cl->returnBufSize < worst_case_size ) {
- void * temp = xrealloc( cl->returnBuf, worst_case_size );
+ void * temp = realloc( cl->returnBuf, worst_case_size );
if ( temp == NULL ) {
return NULL;
diff --git a/xserver/glx/single2.c b/xserver/glx/single2.c
index 3d662e525..b81abc65c 100644
--- a/xserver/glx/single2.c
+++ b/xserver/glx/single2.c
@@ -62,7 +62,7 @@ int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
size = *(GLsizei *)(pc+0);
type = *(GLenum *)(pc+4);
if (cx->feedbackBufSize < size) {
- cx->feedbackBuf = (GLfloat *) xrealloc(cx->feedbackBuf,
+ cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf,
(size_t)size
* __GLX_SIZE_FLOAT32);
if (!cx->feedbackBuf) {
@@ -90,7 +90,7 @@ int __glXDisp_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
pc += __GLX_SINGLE_HDR_SIZE;
size = *(GLsizei *)(pc+0);
if (cx->selectBufSize < size) {
- cx->selectBuf = (GLuint *) xrealloc(cx->selectBuf,
+ cx->selectBuf = (GLuint *) realloc(cx->selectBuf,
(size_t) size
* __GLX_SIZE_CARD32);
if (!cx->selectBuf) {
@@ -261,21 +261,19 @@ char *__glXcombine_strings(const char *cext_string, const char *sext_string)
clen = strlen(cext_string);
slen = strlen(sext_string);
if (clen > slen) {
- combo_string = (char *) xalloc(slen + 2);
- s1 = (char *) xalloc(slen + 2);
+ combo_string = (char *) malloc(slen + 2);
+ s1 = (char *) malloc(slen + 2);
if (s1) strcpy(s1, sext_string);
s2 = cext_string;
} else {
- combo_string = (char *) xalloc(clen + 2);
- s1 = (char *) xalloc(clen + 2);
+ combo_string = (char *) malloc(clen + 2);
+ s1 = (char *) malloc(clen + 2);
if (s1) strcpy(s1, cext_string);
s2 = sext_string;
}
if (!combo_string || !s1) {
- if (combo_string)
- xfree(combo_string);
- if (s1)
- xfree(s1);
+ free(combo_string);
+ free(s1);
return NULL;
}
combo_string[0] = '\0';
@@ -302,7 +300,7 @@ char *__glXcombine_strings(const char *cext_string, const char *sext_string)
/* Get next extension token */
token = strtok( NULL, SEPARATOR);
}
- xfree(s1);
+ free(s1);
return combo_string;
}
@@ -349,14 +347,14 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap)
buf = __glXcombine_strings(buf1,
cx->pGlxScreen->GLextensions);
if (buf1 != NULL) {
- xfree(buf1);
+ free(buf1);
}
string = buf;
}
else if ( name == GL_VERSION ) {
if ( atof( string ) > atof( GLServerVersion ) ) {
size_t len = strlen( string ) + strlen( GLServerVersion ) + 4;
- buf = xalloc( len );
+ buf = malloc( len );
if ( buf == NULL ) {
string = GLServerVersion;
}
@@ -381,7 +379,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap)
__GLX_SEND_HEADER();
WriteToClient(client, length, (char *) string);
if (buf != NULL)
- xfree(buf);
+ free(buf);
return Success;
}
diff --git a/xserver/glx/single2swap.c b/xserver/glx/single2swap.c
index cf83bdc88..04e50b407 100644
--- a/xserver/glx/single2swap.c
+++ b/xserver/glx/single2swap.c
@@ -62,7 +62,7 @@ int __glXDispSwap_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
size = *(GLsizei *)(pc+0);
type = *(GLenum *)(pc+4);
if (cx->feedbackBufSize < size) {
- cx->feedbackBuf = (GLfloat *) xrealloc(cx->feedbackBuf,
+ cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf,
(size_t) size
* __GLX_SIZE_FLOAT32);
if (!cx->feedbackBuf) {
@@ -93,7 +93,7 @@ int __glXDispSwap_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(pc+0);
size = *(GLsizei *)(pc+0);
if (cx->selectBufSize < size) {
- cx->selectBuf = (GLuint *) xrealloc(cx->selectBuf,
+ cx->selectBuf = (GLuint *) realloc(cx->selectBuf,
(size_t) size
* __GLX_SIZE_CARD32);
if (!cx->selectBuf) {
diff --git a/xserver/glx/singlesize.c b/xserver/glx/singlesize.c
index 9e95dd3d3..6149b614c 100644
--- a/xserver/glx/singlesize.c
+++ b/xserver/glx/singlesize.c
@@ -77,7 +77,7 @@ GLint __glGetMap_size(GLenum target, GLenum query)
/*
** The query above might fail, but then order will be zero anyway.
*/
- return (order * k);
+ return order * k;
case GL_DOMAIN:
return 2;
case GL_ORDER:
@@ -101,7 +101,7 @@ GLint __glGetMap_size(GLenum target, GLenum query)
/*
** The query above might fail, but then majorMinor will be zeroes
*/
- return (majorMinor[0] * majorMinor[1] * k);
+ return majorMinor[0] * majorMinor[1] * k;
case GL_DOMAIN:
return 4;
case GL_ORDER:
diff --git a/xserver/glx/unpack.h b/xserver/glx/unpack.h
index 90cb71bd7..a4e6d7e84 100644
--- a/xserver/glx/unpack.h
+++ b/xserver/glx/unpack.h
@@ -86,7 +86,7 @@ extern xGLXSingleReply __glXReply;
if ((size) > sizeof(answerBuffer)) { \
int bump; \
if ((cl)->returnBufSize < (size)+(align)) { \
- (cl)->returnBuf = (GLbyte*)Xrealloc((cl)->returnBuf, \
+ (cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \
(size)+(align)); \
if (!(cl)->returnBuf) { \
return BadAlloc; \
diff --git a/xserver/glx/xfont.c b/xserver/glx/xfont.c
index b8b466d87..b4081cfd4 100644
--- a/xserver/glx/xfont.c
+++ b/xserver/glx/xfont.c
@@ -46,8 +46,6 @@
#include <windowstr.h>
#include <dixfontstr.h>
-extern XID clientErrorValue; /* imported kludge from dix layer */
-
/*
** Make a single GL bitmap from a single X glyph
*/
@@ -76,7 +74,7 @@ static int __glXMakeBitmapFromGlyph(FontPtr font, CharInfoPtr pci)
p = buf;
allocbuf = 0;
} else {
- p = (unsigned char *) xalloc(allocBytes);
+ p = (unsigned char *) malloc(allocBytes);
if (!p)
return BadAlloc;
allocbuf = p;
@@ -99,9 +97,7 @@ static int __glXMakeBitmapFromGlyph(FontPtr font, CharInfoPtr pci)
pci->metrics.characterWidth, 0,
allocbuf ? allocbuf : buf) );
- if (allocbuf) {
- xfree(allocbuf);
- }
+ free(allocbuf);
return Success;
#undef __GL_CHAR_BUF_SIZE
}
@@ -155,7 +151,6 @@ int __glXDisp_UseXFont(__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client;
xGLXUseXFontReq *req;
FontPtr pFont;
- GC *pGC;
GLuint currentListIndex;
__GLXcontext *cx;
int error;
@@ -181,19 +176,9 @@ int __glXDisp_UseXFont(__GLXclientState *cl, GLbyte *pc)
** containing a font.
*/
- error = dixLookupResourceByType((pointer *)&pFont,
- req->font, RT_FONT,
- client, DixReadAccess);
- if (error != Success) {
- error = dixLookupResourceByType((pointer *)&pGC,
- req->font, RT_GC,
- client, DixReadAccess);
- if (error != Success) {
- client->errorValue = req->font;
- return error == BadGC ? BadFont : error;
- }
- pFont = pGC->font;
- }
+ error = dixLookupFontable(&pFont, req->font, client, DixReadAccess);
+ if (error != Success)
+ return error;
return MakeBitmapsFromFont(pFont, req->first, req->count,
req->listBase);