aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/dmx
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-12-10 19:06:59 +0000
committermarha <marha@users.sourceforge.net>2010-12-10 19:06:59 +0000
commit3a20d23b48c1051e1f22295fd886cc7f643417f6 (patch)
tree5192dddd9ecf591de2e22504f7268c2935382d90 /xorg-server/hw/dmx
parent531a0d974b98074978535f086a73b6b662fa0cea (diff)
downloadvcxsrv-3a20d23b48c1051e1f22295fd886cc7f643417f6.tar.gz
vcxsrv-3a20d23b48c1051e1f22295fd886cc7f643417f6.tar.bz2
vcxsrv-3a20d23b48c1051e1f22295fd886cc7f643417f6.zip
xserver git update 10/12/2010
Diffstat (limited to 'xorg-server/hw/dmx')
-rw-r--r--xorg-server/hw/dmx/Makefile.am234
-rw-r--r--xorg-server/hw/dmx/dmx.c10
-rw-r--r--xorg-server/hw/dmx/dmxextension.c14
-rw-r--r--xorg-server/hw/dmx/dmxgcops.c10
-rw-r--r--xorg-server/hw/dmx/dmxpict.c54
-rw-r--r--xorg-server/hw/dmx/dmxwindow.c10
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxcmds.c182
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxext.c6
8 files changed, 300 insertions, 220 deletions
diff --git a/xorg-server/hw/dmx/Makefile.am b/xorg-server/hw/dmx/Makefile.am
index 0d0634628..939e8ec31 100644
--- a/xorg-server/hw/dmx/Makefile.am
+++ b/xorg-server/hw/dmx/Makefile.am
@@ -1,117 +1,117 @@
-DIST_SUBDIRS = input config glxProxy examples doc
-
-SUBDIRS = input config examples
-bin_PROGRAMS = Xdmx
-
-if XINERAMA
-PANORAMIX_SRCS = $(top_srcdir)/Xext/panoramiX.c
-endif
-
-if GLX
-SUBDIRS += glxProxy
-GLX_LIBS = glxProxy/libglxproxy.a
-GLX_SRCS = $(PANORAMIX_SRCS) dmx_glxvisuals.c dmx_glxvisuals.h
-GLX_INCS = -I$(top_srcdir)/hw/xfree86/dixmods/extmod
-GLX_DEFS = @GL_CFLAGS@
-endif
-
-if BUILDDOCS
-SUBDIRS += doc
-endif
-
-AM_CFLAGS = \
- -DHAVE_DMX_CONFIG_H \
- $(DIX_CFLAGS) \
- $(GLX_INCS) \
- $(GLX_DEFS) \
- $(DMX_CFLAGS) \
- @DMXMODULES_CFLAGS@
-
-Xdmx_SOURCES = dmx.c \
- dmxcb.c \
- dmxcb.h \
- dmxclient.h \
- dmxcmap.c \
- dmxcmap.h \
- dmx-config.h \
- dmxcursor.c \
- dmxcursor.h \
- dmxdpms.c \
- dmxdpms.h \
- dmxextension.c \
- dmxextension.h \
- dmxfont.c \
- dmxfont.h \
- dmxgc.c \
- dmxgc.h \
- dmxgcops.c \
- dmxgcops.h \
- dmx.h \
- dmxinit.c \
- dmxinit.h \
- dmxinput.c \
- dmxinput.h \
- dmxlog.c \
- dmxlog.h \
- dmxpict.c \
- dmxpict.h \
- dmxpixmap.c \
- dmxpixmap.h \
- dmxprop.c \
- dmxprop.h \
- dmxscrinit.c \
- dmxscrinit.h \
- dmxshadow.c \
- dmxshadow.h \
- dmxstat.c \
- dmxstat.h \
- dmxsync.c \
- dmxsync.h \
- dmxvisual.c \
- dmxvisual.h \
- dmxwindow.c \
- dmxwindow.h \
- $(top_srcdir)/mi/miinitext.c \
- $(top_srcdir)/fb/fbcmap_mi.c \
- $(GLX_SRCS)
-
-
-#if COMPOSITE
-#Xdmx_SOURCES += fakecw.c
-#endif
-
-XDMX_LIBS = \
- @XDMX_LIBS@ \
- $(GLX_LIBS) \
- input/libdmxinput.a \
- config/libdmxconfig.a
-
-Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
-Xdmx_DEPENDENCIES= $(XDMX_LIBS)
-Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS)
-
-# Man page
-appmandir = $(APP_MAN_DIR)
-
-appman_PRE = Xdmx.man
-appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
-
-CLEANFILES = $(appman_DATA)
-
-# Strings to replace in man pages
-XORGRELSTRING = @PACKAGE_STRING@
- XORGMANNAME = X Version 11
-
-MAN_SUBSTS = \
- -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
- -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g'
-
-SUFFIXES = .$(APP_MAN_SUFFIX) .man
-
-.man.$(APP_MAN_SUFFIX):
- $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
-
-EXTRA_DIST = $(appman_PRE)
-
-relink:
- $(AM_V_at)rm -f Xdmx$(EXEEXT) && $(MAKE) Xdmx$(EXEEXT)
+DIST_SUBDIRS = input config glxProxy examples doc
+
+SUBDIRS = input config examples
+bin_PROGRAMS = Xdmx
+
+if XINERAMA
+PANORAMIX_SRCS = $(top_srcdir)/Xext/panoramiX.c
+endif
+
+if GLX
+SUBDIRS += glxProxy
+GLX_LIBS = glxProxy/libglxproxy.a
+GLX_SRCS = $(PANORAMIX_SRCS) dmx_glxvisuals.c dmx_glxvisuals.h
+GLX_INCS = -I$(top_srcdir)/hw/xfree86/dixmods/extmod
+GLX_DEFS = @GL_CFLAGS@
+endif
+
+if BUILDDOCS
+SUBDIRS += doc
+endif
+
+AM_CFLAGS = \
+ -DHAVE_DMX_CONFIG_H \
+ $(DIX_CFLAGS) \
+ $(GLX_INCS) \
+ $(GLX_DEFS) \
+ $(DMX_CFLAGS) \
+ @DMXMODULES_CFLAGS@
+
+Xdmx_SOURCES = dmx.c \
+ dmxcb.c \
+ dmxcb.h \
+ dmxclient.h \
+ dmxcmap.c \
+ dmxcmap.h \
+ dmx-config.h \
+ dmxcursor.c \
+ dmxcursor.h \
+ dmxdpms.c \
+ dmxdpms.h \
+ dmxextension.c \
+ dmxextension.h \
+ dmxfont.c \
+ dmxfont.h \
+ dmxgc.c \
+ dmxgc.h \
+ dmxgcops.c \
+ dmxgcops.h \
+ dmx.h \
+ dmxinit.c \
+ dmxinit.h \
+ dmxinput.c \
+ dmxinput.h \
+ dmxlog.c \
+ dmxlog.h \
+ dmxpict.c \
+ dmxpict.h \
+ dmxpixmap.c \
+ dmxpixmap.h \
+ dmxprop.c \
+ dmxprop.h \
+ dmxscrinit.c \
+ dmxscrinit.h \
+ dmxshadow.c \
+ dmxshadow.h \
+ dmxstat.c \
+ dmxstat.h \
+ dmxsync.c \
+ dmxsync.h \
+ dmxvisual.c \
+ dmxvisual.h \
+ dmxwindow.c \
+ dmxwindow.h \
+ $(top_srcdir)/mi/miinitext.c \
+ $(top_srcdir)/fb/fbcmap_mi.c \
+ $(GLX_SRCS)
+
+
+#if COMPOSITE
+#Xdmx_SOURCES += fakecw.c
+#endif
+
+XDMX_LIBS = \
+ $(GLX_LIBS) \
+ @XDMX_LIBS@ \
+ input/libdmxinput.a \
+ config/libdmxconfig.a
+
+Xdmx_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+Xdmx_DEPENDENCIES= $(XDMX_LIBS)
+Xdmx_LDADD = $(XDMX_LIBS) $(XDMX_SYS_LIBS) $(XSERVER_SYS_LIBS)
+
+# Man page
+appmandir = $(APP_MAN_DIR)
+
+appman_PRE = Xdmx.man
+appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
+
+CLEANFILES = $(appman_DATA)
+
+# Strings to replace in man pages
+XORGRELSTRING = @PACKAGE_STRING@
+ XORGMANNAME = X Version 11
+
+MAN_SUBSTS = \
+ -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
+ -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g'
+
+SUFFIXES = .$(APP_MAN_SUFFIX) .man
+
+.man.$(APP_MAN_SUFFIX):
+ $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
+
+EXTRA_DIST = $(appman_PRE)
+
+relink:
+ $(AM_V_at)rm -f Xdmx$(EXEEXT) && $(MAKE) Xdmx$(EXEEXT)
diff --git a/xorg-server/hw/dmx/dmx.c b/xorg-server/hw/dmx/dmx.c
index f380b4b41..5de565f85 100644
--- a/xorg-server/hw/dmx/dmx.c
+++ b/xorg-server/hw/dmx/dmx.c
@@ -231,8 +231,9 @@ static int ProcDMXForceWindowCreation(ClientPtr client)
PanoramiXRes *win;
int i;
- if (!(win = SecurityLookupIDByType(client, stuff->window, XRT_WINDOW,
- DixReadAccess)))
+ if (Success != dixLookupResourceByType((pointer*) &win,
+ stuff->window, XRT_WINDOW,
+ client, DixReadAccess))
return -1; /* BadWindow */
FOR_NSCREENS(i) {
@@ -506,8 +507,9 @@ static int dmxPopulatePanoramiX(ClientPtr client, Window window,
int count = 0;
DMXWindowAttributesRec attr;
- if (!(win = SecurityLookupIDByType(client, window, XRT_WINDOW,
- DixReadAccess)))
+ if (Success != dixLookupResourceByType((pointer*) &win,
+ window, XRT_WINDOW,
+ client, DixReadAccess))
return -1; /* BadWindow */
FOR_NSCREENS(i) {
diff --git a/xorg-server/hw/dmx/dmxextension.c b/xorg-server/hw/dmx/dmxextension.c
index 25a10c015..97f2a04b0 100644
--- a/xorg-server/hw/dmx/dmxextension.c
+++ b/xorg-server/hw/dmx/dmxextension.c
@@ -699,7 +699,8 @@ static void dmxBERestorePixmapImage(pointer value, XID id, RESTYPE type,
PixmapPtr pPix;
int i;
- pPix = (PixmapPtr)LookupIDByType(pXinPix->info[idx].id, RT_PIXMAP);
+ dixLookupResourceByType((pointer*) &pPix, pXinPix->info[idx].id,
+ RT_PIXMAP, NullClient, DixUnknownAccess);
if (pPix != pDst) return; /* Not a match.... Next! */
for (i = 0; i < PanoramiXNumScreens; i++) {
@@ -708,8 +709,8 @@ static void dmxBERestorePixmapImage(pointer value, XID id, RESTYPE type,
if (i == idx) continue; /* Self replication is bad */
- pSrc =
- (PixmapPtr)LookupIDByType(pXinPix->info[i].id, RT_PIXMAP);
+ dixLookupResourceByType((pointer*) &pSrc, pXinPix->info[i].id,
+ RT_PIXMAP, NullClient, DixUnknownAccess);
pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc);
if (pSrcPriv->pixmap) {
DMXScreenInfo *dmxSrcScreen = &dmxScreens[i];
@@ -1365,7 +1366,8 @@ static void dmxBEFindPixmapImage(pointer value, XID id, RESTYPE type,
PixmapPtr pPix;
int i;
- pPix = (PixmapPtr)LookupIDByType(pXinPix->info[idx].id, RT_PIXMAP);
+ dixLookupResourceByType((pointer*) &pPix, pXinPix->info[idx].id,
+ RT_PIXMAP, NullClient, DixUnknownAccess);
if (pPix != pDst) return; /* Not a match.... Next! */
for (i = 0; i < PanoramiXNumScreens; i++) {
@@ -1374,8 +1376,8 @@ static void dmxBEFindPixmapImage(pointer value, XID id, RESTYPE type,
if (i == idx) continue; /* Self replication is bad */
- pSrc =
- (PixmapPtr)LookupIDByType(pXinPix->info[i].id, RT_PIXMAP);
+ dixLookupResourceByType((pointer*) &pSrc, pXinPix->info[i].id,
+ RT_PIXMAP, NullClient, DixUnknownAccess);
pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc);
if (pSrcPriv->pixmap) {
FoundPixImage = True;
diff --git a/xorg-server/hw/dmx/dmxgcops.c b/xorg-server/hw/dmx/dmxgcops.c
index 02b45a213..8f4f5c774 100644
--- a/xorg-server/hw/dmx/dmxgcops.c
+++ b/xorg-server/hw/dmx/dmxgcops.c
@@ -523,8 +523,10 @@ static DMXScreenInfo *dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw)
if (noPanoramiXExtension) return NULL;
if (pDrawable->type != DRAWABLE_PIXMAP) return NULL;
-
- if (!(pXinPix = (PanoramiXRes *)LookupIDByType(pDrawable->id, XRT_PIXMAP)))
+
+ if (Success != dixLookupResourceByType((pointer*) &pXinPix,
+ pDrawable->id, XRT_PIXMAP,
+ NullClient, DixUnknownAccess))
return NULL;
for (i = 1; i < PanoramiXNumScreens; i++) {
@@ -533,8 +535,8 @@ static DMXScreenInfo *dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw)
PixmapPtr pSrc;
dmxPixPrivPtr pSrcPriv;
- pSrc = (PixmapPtr)LookupIDByType(pXinPix->info[i].id,
- RT_PIXMAP);
+ dixLookupResourceByType((pointer*) &pSrc, pXinPix->info[i].id,
+ RT_PIXMAP, NullClient, DixUnknownAccess);
pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc);
if (pSrcPriv->pixmap) {
*draw = pSrcPriv->pixmap;
diff --git a/xorg-server/hw/dmx/dmxpict.c b/xorg-server/hw/dmx/dmxpict.c
index 25d923f01..3f5cd4a50 100644
--- a/xorg-server/hw/dmx/dmxpict.c
+++ b/xorg-server/hw/dmx/dmxpict.c
@@ -271,9 +271,11 @@ static int dmxProcRenderCreateGlyphSet(ClientPtr client)
/* Look up glyphSet that was just created ???? */
/* Store glyphsets from backends in glyphSet->devPrivate ????? */
/* Make sure we handle all errors here!! */
-
- glyphSet = SecurityLookupIDByType(client, stuff->gsid, GlyphSetType,
- DixDestroyAccess);
+
+ dixLookupResourceByType((pointer*) &glyphSet,
+ stuff->gsid, GlyphSetType,
+ client, DixDestroyAccess);
+
glyphPriv = malloc(sizeof(dmxGlyphPrivRec));
if (!glyphPriv) return BadAlloc;
glyphPriv->glyphSets = NULL;
@@ -314,8 +316,9 @@ static int dmxProcRenderFreeGlyphSet(ClientPtr client)
REQUEST(xRenderFreeGlyphSetReq);
REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq);
- glyphSet = SecurityLookupIDByType(client, stuff->glyphset, GlyphSetType,
- DixDestroyAccess);
+ dixLookupResourceByType((pointer*) &glyphSet,
+ stuff->glyphset, GlyphSetType,
+ client, DixDestroyAccess);
if (glyphSet && glyphSet->refcnt == 1) {
dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
@@ -357,8 +360,9 @@ static int dmxProcRenderAddGlyphs(ClientPtr client)
CARD8 *bits;
int nbytes;
- glyphSet = SecurityLookupIDByType(client, stuff->glyphset,
- GlyphSetType, DixReadAccess);
+ dixLookupResourceByType((pointer*) &glyphSet,
+ stuff->glyphset, GlyphSetType,
+ client, DixReadAccess);
glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
nglyphs = stuff->nglyphs;
@@ -400,8 +404,9 @@ static int dmxProcRenderFreeGlyphs(ClientPtr client)
REQUEST(xRenderFreeGlyphsReq);
REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq);
- glyphSet = SecurityLookupIDByType(client, stuff->glyphset, GlyphSetType,
- DixWriteAccess);
+ dixLookupResourceByType((pointer*) &glyphSet,
+ stuff->glyphset, GlyphSetType,
+ client, DixWriteAccess);
if (glyphSet) {
dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
@@ -472,14 +477,18 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client)
GlyphSetPtr glyphSet;
dmxGlyphPrivPtr glyphPriv;
- pSrc = SecurityLookupIDByType(client, stuff->src, PictureType,
- DixReadAccess);
+ dixLookupResourceByType((pointer*) &pSrc,
+ stuff->src, PictureType,
+ client, DixReadAccess);
+
pSrcPriv = DMX_GET_PICT_PRIV(pSrc);
if (!pSrcPriv->pict)
return ret;
- pDst = SecurityLookupIDByType(client, stuff->dst, PictureType,
- DixWriteAccess);
+ dixLookupResourceByType((pointer*) &pDst,
+ stuff->dst, PictureType,
+ client, DixWriteAccess);
+
pDstPriv = DMX_GET_PICT_PRIV(pDst);
if (!pDstPriv->pict)
return ret;
@@ -495,8 +504,9 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client)
return ret;
if (stuff->maskFormat)
- pFmt = SecurityLookupIDByType(client, stuff->maskFormat,
- PictFormatType, DixReadAccess);
+ dixLookupResourceByType((pointer*) &pFmt,
+ stuff->maskFormat, PictFormatType,
+ client, DixReadAccess);
else
pFmt = NULL;
@@ -546,8 +556,9 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client)
curGlyph = glyphs;
curElt = elts;
- glyphSet = SecurityLookupIDByType(client, stuff->glyphset,
- GlyphSetType, DixReadAccess);
+ dixLookupResourceByType((pointer*) &glyphSet,
+ stuff->glyphset, GlyphSetType,
+ client, DixReadAccess);
glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
while (buffer + sizeof(xGlyphElt) < end) {
@@ -555,10 +566,11 @@ static int dmxProcRenderCompositeGlyphs(ClientPtr client)
buffer += sizeof(xGlyphElt);
if (elt->len == 0xff) {
- glyphSet = SecurityLookupIDByType(client,
- *((CARD32 *)buffer),
- GlyphSetType,
- DixReadAccess);
+ dixLookupResourceByType((pointer*) &glyphSet,
+ *((CARD32 *)buffer),
+ GlyphSetType,
+ client,
+ DixReadAccess);
glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
buffer += 4;
} else {
diff --git a/xorg-server/hw/dmx/dmxwindow.c b/xorg-server/hw/dmx/dmxwindow.c
index 521f4af7d..ef912b6a3 100644
--- a/xorg-server/hw/dmx/dmxwindow.c
+++ b/xorg-server/hw/dmx/dmxwindow.c
@@ -84,7 +84,8 @@ Window dmxCreateRootWindow(WindowPtr pWindow)
parent = dmxScreen->scrnWin; /* This is our "Screen" window */
visual = dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual;
- pCmap = (ColormapPtr)LookupIDByType(wColormap(pWindow), RT_COLORMAP);
+ dixLookupResourceByType((pointer*) &pCmap, wColormap(pWindow),
+ RT_COLORMAP, NullClient, DixUnknownAccess);
pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap);
mask = CWEventMask | CWBackingStore | CWColormap | CWBorderPixel;
@@ -191,8 +192,8 @@ void dmxGetDefaultWindowAttributes(WindowPtr pWindow,
ColormapPtr pCmap;
dmxColormapPrivPtr pCmapPriv;
- pCmap = (ColormapPtr)LookupIDByType(wColormap(pWindow),
- RT_COLORMAP);
+ dixLookupResourceByType((pointer*) &pCmap, wColormap(pWindow),
+ RT_COLORMAP, NullClient, DixUnknownAccess);
pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap);
*cmap = pCmapPriv->cmap;
} else {
@@ -545,7 +546,8 @@ static void dmxDoChangeWindowAttributes(WindowPtr pWindow,
ColormapPtr pCmap;
dmxColormapPrivPtr pCmapPriv;
- pCmap = (ColormapPtr)LookupIDByType(wColormap(pWindow), RT_COLORMAP);
+ dixLookupResourceByType((pointer*) &pCmap, wColormap(pWindow),
+ RT_COLORMAP, NullClient, DixUnknownAccess);
pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap);
attribs->colormap = pCmapPriv->cmap;
}
diff --git a/xorg-server/hw/dmx/glxProxy/glxcmds.c b/xorg-server/hw/dmx/glxProxy/glxcmds.c
index 540fd00cd..74af631ad 100644
--- a/xorg-server/hw/dmx/glxProxy/glxcmds.c
+++ b/xorg-server/hw/dmx/glxProxy/glxcmds.c
@@ -129,7 +129,8 @@ static int CreateContext(__GLXclientState *cl,
if (shareList == None) {
shareglxc = NULL;
} else {
- shareglxc = (__GLXcontext *) LookupIDByType(shareList, __glXContextRes);
+ dixLookupResourceByType((pointer*) &shareglxc, shareList,
+ __glXContextRes, NullClient, DixUnknownAccess);
if (!shareglxc) {
client->errorValue = shareList;
return __glXBadContext;
@@ -420,14 +421,14 @@ int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixGetAttrAccess);
if (rc != Success) {
- pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->drawable,
- __glXPixmapRes);
+ dixLookupResourceByType((pointer*) &pGlxPixmap, req->drawable,
+ __glXPixmapRes, NullClient, DixUnknownAccess);
if (pGlxPixmap) pDraw = pGlxPixmap->pDraw;
}
if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- pGlxWindow = (__glXWindow *) LookupIDByType(req->drawable,
- __glXWindowRes);
+ dixLookupResourceByType((pointer*) &pGlxWindow, req->drawable,
+ __glXWindowRes, NullClient, DixUnknownAccess);
if (pGlxWindow) pDraw = pGlxWindow->pDraw;
}
@@ -450,14 +451,14 @@ int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc)
rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixManageAccess);
if (rc != Success) {
- pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->drawable,
- __glXPixmapRes);
+ dixLookupResourceByType((pointer*) &pGlxPixmap, req->drawable,
+ __glXPixmapRes, NullClient, DixUnknownAccess);
if (pGlxPixmap) pDraw = pGlxPixmap->pDraw;
}
if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- pGlxWindow = (__glXWindow *) LookupIDByType(req->drawable,
- __glXWindowRes);
+ dixLookupResourceByType((pointer*) &pGlxWindow, req->drawable,
+ __glXWindowRes, NullClient, DixUnknownAccess);
if (pGlxWindow) pDraw = pGlxWindow->pDraw;
}
@@ -470,14 +471,16 @@ int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc)
rc = dixLookupDrawable(&pMember, req->member, client, 0,
DixGetAttrAccess);
if (rc != Success) {
- pGlxPixmap = (__GLXpixmap *) LookupIDByType(req->member,
- __glXPixmapRes);
+ dixLookupResourceByType((pointer*) &pGlxPixmap, req->member,
+ __glXPixmapRes, NullClient,
+ DixUnknownAccess);
if (pGlxPixmap) pMember = pGlxPixmap->pDraw;
}
if (!pMember && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- pGlxWindow = (__glXWindow *) LookupIDByType(req->member,
- __glXWindowRes);
+ dixLookupResourceByType((pointer*) &pGlxWindow, req->member,
+ __glXWindowRes, NullClient,
+ DixUnknownAccess);
if (pGlxWindow) pMember = pGlxWindow->pDraw;
}
@@ -505,7 +508,8 @@ int __glXDestroyContext(__GLXclientState *cl, GLbyte *pc)
int to_screen = 0;
int s;
- glxc = (__GLXcontext *) LookupIDByType(gcId, __glXContextRes);
+ dixLookupResourceByType((pointer*) &glxc, gcId, __glXContextRes,
+ NullClient, DixUnknownAccess);
if (glxc) {
/*
** Just free the resource; don't actually destroy the context,
@@ -752,7 +756,8 @@ static int MakeCurrent(__GLXclientState *cl,
** Lookup new context. It must not be current for someone else.
*/
if (contextId != None) {
- glxc = (__GLXcontext *) LookupIDByType(contextId, __glXContextRes);
+ dixLookupResourceByType((pointer*) &glxc, contextId, __glXContextRes,
+ NullClient, DixUnknownAccess);
if (!glxc) {
client->errorValue = contextId;
return __glXBadContext;
@@ -802,8 +807,9 @@ static int MakeCurrent(__GLXclientState *cl,
}
if (!pDraw) {
- pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId,
- __glXPixmapRes);
+ dixLookupResourceByType((pointer*) &pGlxPixmap, drawId,
+ __glXPixmapRes, NullClient,
+ DixUnknownAccess);
if (pGlxPixmap) {
/*
** Check if pixmap and context are similar.
@@ -826,7 +832,9 @@ static int MakeCurrent(__GLXclientState *cl,
}
if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes);
+ dixLookupResourceByType((pointer*) &pGlxWindow, drawId,
+ __glXWindowRes, NullClient,
+ DixUnknownAccess);
if (pGlxWindow) {
/*
** Drawable is a GLXWindow.
@@ -847,7 +855,9 @@ static int MakeCurrent(__GLXclientState *cl,
}
if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- pGlxPbuffer = (__glXPbuffer *)LookupIDByType(drawId, __glXPbufferRes);
+ dixLookupResourceByType((pointer*) &pGlxPbuffer, drawId,
+ __glXPbufferRes, NullClient,
+ DixUnknownAccess);
if (pGlxPbuffer) {
if (pGlxPbuffer->pScreen != glxc->pScreen ||
pGlxPbuffer->pFBConfig != glxc->pFBConfig) {
@@ -908,8 +918,9 @@ static int MakeCurrent(__GLXclientState *cl,
}
if (!pReadDraw) {
- pReadGlxPixmap = (__GLXpixmap *) LookupIDByType(readId,
- __glXPixmapRes);
+ dixLookupResourceByType((pointer*) &pReadGlxPixmap, readId,
+ __glXPixmapRes, NullClient,
+ DixUnknownAccess);
if (pReadGlxPixmap) {
/*
** Check if pixmap and context are similar.
@@ -929,8 +940,9 @@ static int MakeCurrent(__GLXclientState *cl,
}
if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- pGlxReadWindow = (__glXWindow *)
- LookupIDByType(readId, __glXWindowRes);
+ dixLookupResourceByType((pointer*) &pGlxReadWindow, readId,
+ __glXWindowRes, NullClient,
+ DixUnknownAccess);
if (pGlxReadWindow) {
/*
** Drawable is a GLXWindow.
@@ -950,7 +962,9 @@ static int MakeCurrent(__GLXclientState *cl,
}
if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- pGlxReadPbuffer = (__glXPbuffer *)LookupIDByType(readId, __glXPbufferRes);
+ dixLookupResourceByType((pointer*) &pGlxReadPbuffer, readId,
+ __glXPbufferRes, NullClient,
+ DixUnknownAccess);
if (pGlxReadPbuffer) {
if (pGlxReadPbuffer->pScreen != glxc->pScreen ||
pGlxReadPbuffer->pFBConfig != glxc->pFBConfig) {
@@ -1090,14 +1104,16 @@ static int MakeCurrent(__GLXclientState *cl,
to_screen = screenInfo.numScreens - 1;
if (pDraw && new_reply.writeType != GLX_PBUFFER_TYPE) {
- pXinDraw = (PanoramiXRes *)
- SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
+ dixLookupResourceByClass((pointer*) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess);
}
if (pReadDraw && pReadDraw != pDraw &&
new_reply.readType != GLX_PBUFFER_TYPE) {
- pXinReadDraw = (PanoramiXRes *)
- SecurityLookupIDByClass(client, pReadDraw->id, XRC_DRAWABLE, DixReadAccess);
+ dixLookupResourceByClass((pointer*) &pXinReadDraw,
+ pReadDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess);
}
else {
pXinReadDraw = pXinDraw;
@@ -1303,7 +1319,8 @@ int __glXIsDirect(__GLXclientState *cl, GLbyte *pc)
/*
** Find the GL context.
*/
- glxc = (__GLXcontext *) LookupIDByType(req->context, __glXContextRes);
+ dixLookupResourceByType((pointer*) &glxc, req->context, __glXContextRes,
+ NullClient, DixUnknownAccess);
if (!glxc) {
client->errorValue = req->context;
return __glXBadContext;
@@ -1449,12 +1466,14 @@ int __glXCopyContext(__GLXclientState *cl, GLbyte *pc)
/*
** Check that each context exists.
*/
- src = (__GLXcontext *) LookupIDByType(source, __glXContextRes);
+ dixLookupResourceByType((pointer*) &src, source, __glXContextRes,
+ NullClient, DixUnknownAccess);
if (!src) {
client->errorValue = source;
return __glXBadContext;
}
- dst = (__GLXcontext *) LookupIDByType(dest, __glXContextRes);
+ dixLookupResourceByType((pointer*) &dst, dest, __glXContextRes,
+ NullClient, DixUnknownAccess);
if (!dst) {
client->errorValue = dest;
return __glXBadContext;
@@ -1748,8 +1767,9 @@ static int CreateGLXPixmap(__GLXclientState *cl,
from_screen = 0;
to_screen = screenInfo.numScreens - 1;
- pXinDraw = (PanoramiXRes *)
- SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
+ dixLookupResourceByClass((pointer*) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess);
}
#endif
@@ -1870,7 +1890,8 @@ int __glXDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
/*
** Check if it's a valid GLX pixmap.
*/
- pGlxPixmap = (__GLXpixmap *)LookupIDByType(glxpixmap, __glXPixmapRes);
+ dixLookupResourceByType((pointer*) &pGlxPixmap, glxpixmap,
+ __glXPixmapRes, NullClient, DixUnknownAccess);
if (!pGlxPixmap) {
client->errorValue = glxpixmap;
return __glXBadPixmap;
@@ -1953,8 +1974,8 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
}
if (!pDraw) {
- pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId,
- __glXPixmapRes);
+ dixLookupResourceByType((pointer*) &pGlxPixmap, drawId,
+ __glXPixmapRes, NullClient, DixUnknownAccess);
if (pGlxPixmap) {
/*
** Drawable is a GLX pixmap.
@@ -1965,7 +1986,8 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
}
if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes);
+ dixLookupResourceByType((pointer*) &pGlxWindow, drawId,
+ __glXWindowRes, NullClient, DixUnknownAccess);
if (pGlxWindow) {
/*
** Drawable is a GLXWindow.
@@ -1994,8 +2016,9 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
if (!noPanoramiXExtension) {
from_screen = 0;
to_screen = screenInfo.numScreens - 1;
- pXinDraw = (PanoramiXRes *)
- SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
+ dixLookupResourceByClass((pointer*) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess);
}
#endif
@@ -2100,8 +2123,8 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
}
if (!pDraw) {
- pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId,
- __glXPixmapRes);
+ dixLookupResourceByType((pointer*) &pGlxPixmap, drawId,
+ __glXPixmapRes, NullClient, DixUnknownAccess);
if (pGlxPixmap) {
/*
** Drawable is a GLX pixmap.
@@ -2111,7 +2134,8 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
}
if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes);
+ dixLookupResourceByType((pointer*) &pGlxWindow, drawId,
+ __glXWindowRes, NullClient, DixUnknownAccess);
if (pGlxWindow) {
/*
** Drawable is a GLXWindow.
@@ -2620,9 +2644,13 @@ int __glXUseXFont(__GLXclientState *cl, GLbyte *pc)
** Font can actually be either the ID of a font or the ID of a GC
** containing a font.
*/
- pFont = (FontPtr)LookupIDByType(req->font, RT_FONT);
+ dixLookupResourceByType((pointer*) &pFont, req->font, RT_FONT,
+ NullClient, DixUnknownAccess);
if (!pFont) {
- GC *pGC = (GC *)LookupIDByType(req->font, RT_GC);
+ GC *pGC;
+ dixLookupResourceByType((pointer*) &pGC, req->font,
+ RT_GC, NullClient,
+ DixUnknownAccess);
if (!pGC) {
client->errorValue = req->font;
return BadFont;
@@ -2873,6 +2901,7 @@ int __glXCreateWindow(__GLXclientState *cl, GLbyte *pc)
VisualPtr pVisual;
VisualID visId;
int i, rc;
+ pointer val;
/*
** Check if windowId is valid
@@ -2938,7 +2967,9 @@ int __glXCreateWindow(__GLXclientState *cl, GLbyte *pc)
/*
** Check if there is already a fbconfig associated with this window
*/
- if ( LookupIDByType(glxwindowId, __glXWindowRes) ) {
+ if (Success == dixLookupResourceByType(&val,
+ glxwindowId, __glXWindowRes,
+ NullClient, DixUnknownAccess)) {
client->errorValue = glxwindowId;
return BadAlloc;
}
@@ -2970,11 +3001,14 @@ int __glXDestroyWindow(__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client;
xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
XID glxwindow = req->glxwindow;
+ pointer val;
/*
** Check if it's a valid GLX window.
*/
- if (!LookupIDByType(glxwindow, __glXWindowRes)) {
+ if (Success != dixLookupResourceByType(&val,
+ glxwindow, __glXWindowRes,
+ NullClient, DixUnknownAccess)) {
client->errorValue = glxwindow;
return __glXBadDrawable;
}
@@ -2998,7 +3032,8 @@ int __glXQueryContext(__GLXclientState *cl, GLbyte *pc)
int nReplyBytes;
req = (xGLXQueryContextReq *)pc;
- ctx = (__GLXcontext *) LookupIDByType(req->context, __glXContextRes);
+ dixLookupResourceByType((pointer*) &ctx, req->context, __glXContextRes,
+ NullClient, DixUnknownAccess);
if (!ctx) {
client->errorValue = req->context;
return __glXBadContext;
@@ -3043,7 +3078,10 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
int nReplyBytes;
req = (xGLXQueryContextInfoEXTReq *)pc;
- ctx = (__GLXcontext *) SecurityLookupIDByType(client, req->context, __glXContextRes, DixReadAccess);
+ dixLookupResourceByType((pointer*) &ctx,
+ req->context, __glXContextRes,
+ client, DixReadAccess);
+
if (!ctx) {
client->errorValue = req->context;
return __glXBadContext;
@@ -3208,7 +3246,8 @@ int __glXDestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
/*
** Check if it's a valid Pbuffer
*/
- pGlxPbuffer = (__glXPbuffer *)LookupIDByType(pbuffer, __glXPbufferRes);
+ dixLookupResourceByType((pointer*) &pGlxPbuffer, pbuffer,
+ __glXPbufferRes, NullClient, DixUnknownAccess);
if (!pGlxPbuffer) {
client->errorValue = pbuffer;
return __glXBadPbuffer;
@@ -3280,8 +3319,10 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
}
if (!pDraw) {
- __GLXpixmap *pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId,
- __glXPixmapRes);
+ __GLXpixmap *pGlxPixmap;
+ dixLookupResourceByType((pointer*) &pGlxPixmap,
+ drawId, __glXPixmapRes,
+ NullClient, DixUnknownAccess);
if (pGlxPixmap) {
pDraw = pGlxPixmap->pDraw;
screen = pGlxPixmap->pScreen->myNum;
@@ -3290,7 +3331,10 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
}
if (!pDraw) {
- __glXWindow *pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes);
+ __glXWindow *pGlxWindow;
+ dixLookupResourceByType((pointer*) &pGlxWindow,
+ drawId, __glXWindowRes,
+ NullClient, DixUnknownAccess);
if (pGlxWindow) {
pDraw = pGlxWindow->pDraw;
screen = pGlxWindow->pScreen->myNum;
@@ -3299,7 +3343,10 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
}
if (!pDraw) {
- __glXPbuffer *pGlxPbuffer = (__glXPbuffer *)LookupIDByType(drawId, __glXPbufferRes);
+ __glXPbuffer *pGlxPbuffer;
+ dixLookupResourceByType((pointer*) &pGlxPbuffer,
+ drawId, __glXPbufferRes,
+ NullClient, DixUnknownAccess);
if (pGlxPbuffer) {
pDraw = (DrawablePtr)pGlxPbuffer;
screen = pGlxPbuffer->pScreen->myNum;
@@ -3326,9 +3373,9 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- pXinDraw = (PanoramiXRes *)
- SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
- if (!pXinDraw) {
+ if (Success != dixLookupResourceByClass((pointer*) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess)) {
client->errorValue = drawId;
return __glXBadDrawable;
}
@@ -3436,8 +3483,10 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
}
if (!pDraw) {
- __GLXpixmap *pGlxPixmap = (__GLXpixmap *) LookupIDByType(drawId,
- __glXPixmapRes);
+ __GLXpixmap *pGlxPixmap;
+ dixLookupResourceByType((pointer*) &pGlxPixmap,
+ drawId, __glXPixmapRes,
+ NullClient, DixUnknownAccess);
if (pGlxPixmap) {
pDraw = pGlxPixmap->pDraw;
screen = pGlxPixmap->pScreen->myNum;
@@ -3446,7 +3495,10 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
}
if (!pDraw) {
- __glXWindow *pGlxWindow = (__glXWindow *) LookupIDByType(drawId, __glXWindowRes);
+ __glXWindow *pGlxWindow;
+ dixLookupResourceByType((pointer*) &pGlxWindow,
+ drawId, __glXWindowRes,
+ NullClient, DixUnknownAccess);
if (pGlxWindow) {
pDraw = pGlxWindow->pDraw;
screen = pGlxWindow->pScreen->myNum;
@@ -3455,7 +3507,10 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
}
if (!pDraw) {
- __glXPbuffer *pGlxPbuffer = (__glXPbuffer *)LookupIDByType(drawId, __glXPbufferRes);
+ __glXPbuffer *pGlxPbuffer;
+ dixLookupResourceByType((pointer*) &pGlxPbuffer,
+ drawId, __glXPbufferRes,
+ NullClient, DixUnknownAccess);
if (pGlxPbuffer) {
pDraw = (DrawablePtr)pGlxPbuffer;
screen = pGlxPbuffer->pScreen->myNum;
@@ -3482,9 +3537,10 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- PanoramiXRes *pXinDraw = (PanoramiXRes *)
- SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
- if (!pXinDraw) {
+ PanoramiXRes *pXinDraw;
+ if (Success != dixLookupResourceByClass((pointer*) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess)) {
client->errorValue = drawId;
return __glXBadDrawable;
}
diff --git a/xorg-server/hw/dmx/glxProxy/glxext.c b/xorg-server/hw/dmx/glxProxy/glxext.c
index a90c14906..4da16a77d 100644
--- a/xorg-server/hw/dmx/glxProxy/glxext.c
+++ b/xorg-server/hw/dmx/glxProxy/glxext.c
@@ -186,8 +186,12 @@ void __glXFreeGLXWindow(__glXWindow *pGlxWindow)
{
if (!pGlxWindow->idExists && !pGlxWindow->refcnt) {
WindowPtr pWindow = (WindowPtr) pGlxWindow->pDraw;
+ WindowPtr ret;
- if (LookupIDByType(pWindow->drawable.id, RT_WINDOW) == pWindow) {
+ dixLookupResourceByType((pointer) &ret,
+ pWindow->drawable.id, RT_WINDOW,
+ NullClient, DixUnknownAccess);
+ if (ret == pWindow) {
(*pGlxWindow->pScreen->DestroyWindow)(pWindow);
}