aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/dmx
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/dmx')
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxcmds.c80
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxsingle.c7
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxvendor.c6
-rw-r--r--xorg-server/hw/dmx/glxProxy/render2swap.c54
4 files changed, 41 insertions, 106 deletions
diff --git a/xorg-server/hw/dmx/glxProxy/glxcmds.c b/xorg-server/hw/dmx/glxProxy/glxcmds.c
index 74af631ad..eb589f428 100644
--- a/xorg-server/hw/dmx/glxProxy/glxcmds.c
+++ b/xorg-server/hw/dmx/glxProxy/glxcmds.c
@@ -101,8 +101,8 @@ static int CreateContext(__GLXclientState *cl,
int from_screen = screen;
int to_screen = screen;
DMXScreenInfo *dmxScreen;
- VisualID be_vid;
- GLXFBConfigID be_fbconfigId;
+ VisualID be_vid = 0;
+ GLXFBConfigID be_fbconfigId = 0;
int num_be_screens;
Display *dpy;
@@ -1660,7 +1660,7 @@ static int CreateGLXPixmap(__GLXclientState *cl,
return BadMatch;
}
- if (fbconfigId == NULL && visual == NULL) {
+ if (fbconfigId == 0 && visual == 0) {
return BadValue;
}
@@ -1733,6 +1733,7 @@ static int CreateGLXPixmap(__GLXclientState *cl,
else {
pVisual = NULL;
pGlxVisual = NULL;
+ pGlxScreen = &__glXActiveScreens[pDraw->pScreen->myNum];
}
pGlxPixmap = (__GLXpixmap *) malloc(sizeof(__GLXpixmap));
@@ -3295,27 +3296,23 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
int screen, rc;
DMXScreenInfo *dmxScreen;
CARD32 *attribs = NULL;
- int attribs_size;
+ int attribs_size = 0;
#ifdef PANORAMIX
PanoramiXRes *pXinDraw = NULL;
#endif
if (drawId != None) {
rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess);
- if (rc == Success) {
- if (pDraw->type == DRAWABLE_WINDOW) {
- WindowPtr pWin = (WindowPtr)pDraw;
- be_drawable = 0;
- screen = pWin->drawable.pScreen->myNum;
-
- }
- else {
- /*
- ** Drawable is not a Window , GLXWindow or a GLXPixmap.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
+ if (rc == Success && pDraw->type == DRAWABLE_WINDOW) {
+ WindowPtr pWin = (WindowPtr)pDraw;
+ be_drawable = 0;
+ screen = pWin->drawable.pScreen->myNum;
+ } else {
+ /*
+ ** Drawable is not a Window , GLXWindow or a GLXPixmap.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
}
if (!pDraw) {
@@ -3353,17 +3350,15 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
be_drawable = pGlxPbuffer->be_xids[screen];
}
}
-
-
- if (!pDraw) {
- /*
- ** Drawable is not a Window , GLXWindow or a GLXPixmap.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
}
+ if (!pDraw) {
+ /*
+ ** Drawable is not a Window , GLXWindow or a GLXPixmap.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
/* if the drawable is a window or GLXWindow -
* we need to find the base id on the back-end server
@@ -3466,20 +3461,15 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
if (drawId != None) {
rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixSetAttrAccess);
- if (rc == Success) {
- if (pDraw->type == DRAWABLE_WINDOW) {
- WindowPtr pWin = (WindowPtr)pDraw;
- be_drawable = 0;
- screen = pWin->drawable.pScreen->myNum;
-
- }
- else {
- /*
- ** Drawable is not a Window , GLXWindow or a GLXPixmap.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
+ if (rc == Success && pDraw->type == DRAWABLE_WINDOW) {
+ be_drawable = 0;
+ screen = pDraw->pScreen->myNum;
+ } else {
+ /*
+ ** Drawable is not a Window , GLXWindow or a GLXPixmap.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
}
if (!pDraw) {
@@ -3517,17 +3507,15 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
be_drawable = pGlxPbuffer->be_xids[screen];
}
}
+ }
-
- if (!pDraw) {
+ if (!pDraw) {
/*
** Drawable is not a Window , GLXWindow or a GLXPixmap.
*/
client->errorValue = drawId;
return __glXBadDrawable;
- }
- }
-
+ }
/* if the drawable is a window or GLXWindow -
* we need to find the base id on the back-end server
diff --git a/xorg-server/hw/dmx/glxProxy/glxsingle.c b/xorg-server/hw/dmx/glxProxy/glxsingle.c
index 7856f5884..834c7b8d9 100644
--- a/xorg-server/hw/dmx/glxProxy/glxsingle.c
+++ b/xorg-server/hw/dmx/glxProxy/glxsingle.c
@@ -215,7 +215,7 @@ int __glXForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc )
xGLXSingleReply be_reply;
__GLXcontext *glxc;
int buf_size;
- char *be_buf;
+ char *be_buf = NULL;
int be_buf_size;
DMXScreenInfo *dmxScreen;
Display *dpy;
@@ -297,8 +297,8 @@ int __glXForwardAllWithReply( __GLXclientState *cl, GLbyte *pc )
xGLXSingleReply be_reply;
__GLXcontext *glxc;
int buf_size;
- char *be_buf;
- int be_buf_size;
+ char *be_buf = NULL;
+ int be_buf_size = 0;
int from_screen = 0;
int to_screen = 0;
int s;
@@ -811,6 +811,7 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
}
else {
buf_size = 0;
+ buf = NULL;
}
if (buf_size > 0) {
diff --git a/xorg-server/hw/dmx/glxProxy/glxvendor.c b/xorg-server/hw/dmx/glxProxy/glxvendor.c
index 26a9c92fb..9dbc46daa 100644
--- a/xorg-server/hw/dmx/glxProxy/glxvendor.c
+++ b/xorg-server/hw/dmx/glxProxy/glxvendor.c
@@ -202,7 +202,7 @@ int __glXVForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc )
xGLXVendorPrivReply be_reply;
__GLXcontext *glxc;
int buf_size;
- char *be_buf;
+ char *be_buf = NULL;
int be_buf_size;
DMXScreenInfo *dmxScreen;
Display *dpy;
@@ -281,8 +281,8 @@ int __glXVForwardAllWithReply( __GLXclientState *cl, GLbyte *pc )
xGLXVendorPrivReply be_reply;
__GLXcontext *glxc;
int buf_size;
- char *be_buf;
- int be_buf_size;
+ char *be_buf = NULL;
+ int be_buf_size = 0;
int from_screen = 0;
int to_screen = 0;
int s;
diff --git a/xorg-server/hw/dmx/glxProxy/render2swap.c b/xorg-server/hw/dmx/glxProxy/render2swap.c
index 34fd19624..70ed5e802 100644
--- a/xorg-server/hw/dmx/glxProxy/render2swap.c
+++ b/xorg-server/hw/dmx/glxProxy/render2swap.c
@@ -261,60 +261,6 @@ void __glXDispSwap_CallLists(GLbyte *pc)
}
-static void swapArray(GLint numVals, GLenum datatype,
- GLint stride, GLint numVertexes, GLbyte *pc)
-{
- int i,j;
- __GLX_DECLARE_SWAP_VARIABLES;
-
- switch (datatype) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- /* don't need to swap */
- return;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- for (i=0; i<numVertexes; i++) {
- GLshort *pVal = (GLshort *) pc;
- for (j=0; j<numVals; j++) {
- __GLX_SWAP_SHORT(&pVal[j]);
- }
- pc += stride;
- }
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- for (i=0; i<numVertexes; i++) {
- GLint *pVal = (GLint *) pc;
- for (j=0; j<numVals; j++) {
- __GLX_SWAP_INT(&pVal[j]);
- }
- pc += stride;
- }
- break;
- case GL_FLOAT:
- for (i=0; i<numVertexes; i++) {
- GLfloat *pVal = (GLfloat *) pc;
- for (j=0; j<numVals; j++) {
- __GLX_SWAP_FLOAT(&pVal[j]);
- }
- pc += stride;
- }
- break;
- case GL_DOUBLE:
- for (i=0; i<numVertexes; i++) {
- GLdouble *pVal = (GLdouble *) pc;
- for (j=0; j<numVals; j++) {
- __GLX_SWAP_DOUBLE(&pVal[j]);
- }
- pc += stride;
- }
- break;
- default:
- return;
- }
-}
-
void __glXDispSwap_DrawArrays(GLbyte *pc)
{
__GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;