Merge remote branch 'ajax/for-keithp'

This commit is contained in:
Keith Packard 2011-02-24 18:49:40 -08:00
commit 365ad68fb9
8 changed files with 57 additions and 113 deletions

View File

@ -101,8 +101,8 @@ static int CreateContext(__GLXclientState *cl,
int from_screen = screen; int from_screen = screen;
int to_screen = screen; int to_screen = screen;
DMXScreenInfo *dmxScreen; DMXScreenInfo *dmxScreen;
VisualID be_vid; VisualID be_vid = 0;
GLXFBConfigID be_fbconfigId; GLXFBConfigID be_fbconfigId = 0;
int num_be_screens; int num_be_screens;
Display *dpy; Display *dpy;
@ -1660,7 +1660,7 @@ static int CreateGLXPixmap(__GLXclientState *cl,
return BadMatch; return BadMatch;
} }
if (fbconfigId == NULL && visual == NULL) { if (fbconfigId == 0 && visual == 0) {
return BadValue; return BadValue;
} }
@ -1733,6 +1733,7 @@ static int CreateGLXPixmap(__GLXclientState *cl,
else { else {
pVisual = NULL; pVisual = NULL;
pGlxVisual = NULL; pGlxVisual = NULL;
pGlxScreen = &__glXActiveScreens[pDraw->pScreen->myNum];
} }
pGlxPixmap = (__GLXpixmap *) malloc(sizeof(__GLXpixmap)); pGlxPixmap = (__GLXpixmap *) malloc(sizeof(__GLXpixmap));
@ -3295,27 +3296,23 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
int screen, rc; int screen, rc;
DMXScreenInfo *dmxScreen; DMXScreenInfo *dmxScreen;
CARD32 *attribs = NULL; CARD32 *attribs = NULL;
int attribs_size; int attribs_size = 0;
#ifdef PANORAMIX #ifdef PANORAMIX
PanoramiXRes *pXinDraw = NULL; PanoramiXRes *pXinDraw = NULL;
#endif #endif
if (drawId != None) { if (drawId != None) {
rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess); rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess);
if (rc == Success) { if (rc == Success && pDraw->type == DRAWABLE_WINDOW) {
if (pDraw->type == DRAWABLE_WINDOW) { WindowPtr pWin = (WindowPtr)pDraw;
WindowPtr pWin = (WindowPtr)pDraw; be_drawable = 0;
be_drawable = 0; screen = pWin->drawable.pScreen->myNum;
screen = pWin->drawable.pScreen->myNum; } else {
/*
} ** Drawable is not a Window , GLXWindow or a GLXPixmap.
else { */
/* client->errorValue = drawId;
** Drawable is not a Window , GLXWindow or a GLXPixmap. return __glXBadDrawable;
*/
client->errorValue = drawId;
return __glXBadDrawable;
}
} }
if (!pDraw) { if (!pDraw) {
@ -3353,17 +3350,15 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
be_drawable = pGlxPbuffer->be_xids[screen]; 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 - /* if the drawable is a window or GLXWindow -
* we need to find the base id on the back-end server * 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) { if (drawId != None) {
rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixSetAttrAccess); rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixSetAttrAccess);
if (rc == Success) { if (rc == Success && pDraw->type == DRAWABLE_WINDOW) {
if (pDraw->type == DRAWABLE_WINDOW) { be_drawable = 0;
WindowPtr pWin = (WindowPtr)pDraw; screen = pDraw->pScreen->myNum;
be_drawable = 0; } else {
screen = pWin->drawable.pScreen->myNum; /*
** Drawable is not a Window , GLXWindow or a GLXPixmap.
} */
else { client->errorValue = drawId;
/* return __glXBadDrawable;
** Drawable is not a Window , GLXWindow or a GLXPixmap.
*/
client->errorValue = drawId;
return __glXBadDrawable;
}
} }
if (!pDraw) { if (!pDraw) {
@ -3517,17 +3507,15 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
be_drawable = pGlxPbuffer->be_xids[screen]; be_drawable = pGlxPbuffer->be_xids[screen];
} }
} }
}
if (!pDraw) {
if (!pDraw) {
/* /*
** Drawable is not a Window , GLXWindow or a GLXPixmap. ** Drawable is not a Window , GLXWindow or a GLXPixmap.
*/ */
client->errorValue = drawId; client->errorValue = drawId;
return __glXBadDrawable; return __glXBadDrawable;
} }
}
/* if the drawable is a window or GLXWindow - /* if the drawable is a window or GLXWindow -
* we need to find the base id on the back-end server * we need to find the base id on the back-end server

View File

@ -215,7 +215,7 @@ int __glXForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc )
xGLXSingleReply be_reply; xGLXSingleReply be_reply;
__GLXcontext *glxc; __GLXcontext *glxc;
int buf_size; int buf_size;
char *be_buf; char *be_buf = NULL;
int be_buf_size; int be_buf_size;
DMXScreenInfo *dmxScreen; DMXScreenInfo *dmxScreen;
Display *dpy; Display *dpy;
@ -297,8 +297,8 @@ int __glXForwardAllWithReply( __GLXclientState *cl, GLbyte *pc )
xGLXSingleReply be_reply; xGLXSingleReply be_reply;
__GLXcontext *glxc; __GLXcontext *glxc;
int buf_size; int buf_size;
char *be_buf; char *be_buf = NULL;
int be_buf_size; int be_buf_size = 0;
int from_screen = 0; int from_screen = 0;
int to_screen = 0; int to_screen = 0;
int s; int s;
@ -811,6 +811,7 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
} }
else { else {
buf_size = 0; buf_size = 0;
buf = NULL;
} }
if (buf_size > 0) { if (buf_size > 0) {

View File

@ -202,7 +202,7 @@ int __glXVForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc )
xGLXVendorPrivReply be_reply; xGLXVendorPrivReply be_reply;
__GLXcontext *glxc; __GLXcontext *glxc;
int buf_size; int buf_size;
char *be_buf; char *be_buf = NULL;
int be_buf_size; int be_buf_size;
DMXScreenInfo *dmxScreen; DMXScreenInfo *dmxScreen;
Display *dpy; Display *dpy;
@ -281,8 +281,8 @@ int __glXVForwardAllWithReply( __GLXclientState *cl, GLbyte *pc )
xGLXVendorPrivReply be_reply; xGLXVendorPrivReply be_reply;
__GLXcontext *glxc; __GLXcontext *glxc;
int buf_size; int buf_size;
char *be_buf; char *be_buf = NULL;
int be_buf_size; int be_buf_size = 0;
int from_screen = 0; int from_screen = 0;
int to_screen = 0; int to_screen = 0;
int s; int s;

View File

@ -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) void __glXDispSwap_DrawArrays(GLbyte *pc)
{ {
__GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc; __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;

View File

@ -1565,7 +1565,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
int min_clock = 0; int min_clock = 0;
int max_clock = 0; int max_clock = 0;
double clock; double clock;
Bool add_default_modes = xf86ReturnOptValBool(output->options, OPTION_DEFAULT_MODES, TRUE); Bool add_default_modes;
Bool debug_modes = config->debug_modes || Bool debug_modes = config->debug_modes ||
xf86Initialising; xf86Initialising;
enum det_monrec_source sync_source = sync_default; enum det_monrec_source sync_source = sync_default;
@ -1612,6 +1612,14 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
output_modes = (*output->funcs->get_modes) (output); output_modes = (*output->funcs->get_modes) (output);
/*
* If the user has a preference, respect it.
* Otherwise, don't second-guess the driver.
*/
if (!xf86GetOptValBool(output->options, OPTION_DEFAULT_MODES,
&add_default_modes))
add_default_modes = (output_modes == NULL);
edid_monitor = output->MonInfo; edid_monitor = output->MonInfo;
if (edid_monitor) if (edid_monitor)

View File

@ -103,12 +103,12 @@ typedef struct _ColormapRec
{ {
VisualPtr pVisual; VisualPtr pVisual;
short class; /* PseudoColor or DirectColor */ short class; /* PseudoColor or DirectColor */
#if defined(_XSERVER64) #if defined(_LP64)
short pad0; short pad0;
XID pad1; XID pad1;
#endif #endif
XID mid; /* client's name for colormap */ XID mid; /* client's name for colormap */
#if defined(_XSERVER64) && (X_BYTE_ORDER == X_LITTLE_ENDIAN) #if defined(_LP64) && (X_BYTE_ORDER == X_LITTLE_ENDIAN)
XID pad2; XID pad2;
#endif #endif
ScreenPtr pScreen; /* screen map is associated with */ ScreenPtr pScreen; /* screen map is associated with */

View File

@ -404,7 +404,7 @@ typedef void (* DeviceCursorCleanupProcPtr)(
ScreenPtr /* pScreen */); ScreenPtr /* pScreen */);
typedef void (*ConstrainCursorHarderProcPtr)( typedef void (*ConstrainCursorHarderProcPtr)(
DeviceIntPtr, ScreenPtr, int *, int *); DeviceIntPtr, ScreenPtr, int, int *, int *);
typedef struct _Screen { typedef struct _Screen {
int myNum; /* index of this instance in Screens[] */ int myNum; /* index of this instance in Screens[] */

View File

@ -157,9 +157,6 @@
/* Name of X server */ /* Name of X server */
#undef __XSERVERNAME__ #undef __XSERVERNAME__
/* Define to 1 if unsigned long is 64 bits. */
#undef _XSERVER64
/* Building vgahw module */ /* Building vgahw module */
#undef WITH_VGAHW #undef WITH_VGAHW
@ -187,4 +184,8 @@
/* X Access Control Extension */ /* X Access Control Extension */
#undef XACE #undef XACE
#ifdef _LP64
#define _XSERVER64 1
#endif
#endif /* _XORG_SERVER_H_ */ #endif /* _XORG_SERVER_H_ */