Commit 696b137d authored by Alexander Gottwald's avatar Alexander Gottwald

Pull XORG-6_8_0 to CYGWIN branch

parent 2c971497
This diff is collapsed.
This diff is collapsed.
......@@ -54,18 +54,18 @@ __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXQueryExtensionsString,
__glXQueryServerString,
__glXClientInfo,
__glXNoSuchSingleOpcode, /* glXGetFBConfigs */
__glXNoSuchSingleOpcode, /* glXCreatePixmap */
__glXNoSuchSingleOpcode, /* glXDestroyPixmap */
__glXNoSuchSingleOpcode, /* glXCreateNewContext */
__glXGetFBConfigs,
__glXCreatePixmap,
__glXDestroyGLXPixmap, /* glXDestroyPixmap */
__glXCreateNewContext,
__glXNoSuchSingleOpcode, /* glXQueryContext */
__glXMakeContextCurrent,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode, /* glXCreatePbuffer */
__glXNoSuchSingleOpcode, /* glXDestroyPbuffer */
__glXNoSuchSingleOpcode, /* glXGetDrawableAttributes */
__glXNoSuchSingleOpcode, /* glXChangeDrawableAttributes */
__glXNoSuchSingleOpcode, /* glXCreateWindow */
__glXNoSuchSingleOpcode, /* glXDestroyWindow */
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
......@@ -455,18 +455,18 @@ __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
__glXSwapQueryExtensionsString,
__glXSwapQueryServerString,
__glXSwapClientInfo,
__glXNoSuchSingleOpcode, /* glXGetFBConfigs */
__glXNoSuchSingleOpcode, /* glXCreatePixmap */
__glXNoSuchSingleOpcode, /* glXDestroyPixmap */
__glXNoSuchSingleOpcode, /* glXCreateNewContext */
__glXSwapGetFBConfigs,
__glXSwapCreatePixmap,
__glXSwapDestroyGLXPixmap, /* glXDestroyPixmap */
__glXSwapCreateNewContext,
__glXNoSuchSingleOpcode, /* glXQueryContext */
__glXSwapMakeContextCurrent,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode, /* glXCreatePbuffer */
__glXNoSuchSingleOpcode, /* glXDestroyPbuffer */
__glXNoSuchSingleOpcode, /* glXGetDrawableAttributes */
__glXNoSuchSingleOpcode, /* glXChangeDrawableAttributes */
__glXNoSuchSingleOpcode, /* glXCreateWindow */
__glXNoSuchSingleOpcode, /* glXDestroyWindow */
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
__glXNoSuchSingleOpcode,
......
......@@ -52,6 +52,9 @@ extern int __glXQueryExtensionsString(__GLXclientState*, GLbyte*);
extern int __glXQueryServerString(__GLXclientState*, GLbyte*);
extern int __glXClientInfo(__GLXclientState*, GLbyte*);
extern int __glXMakeContextCurrent(__GLXclientState*, GLbyte*);
extern int __glXGetFBConfigs(__GLXclientState*, GLbyte*);
extern int __glXCreateNewContext(__GLXclientState*, GLbyte*);
extern int __glXCreatePixmap(__GLXclientState*, GLbyte*);
extern int __glXDisp_NewList(__GLXclientState*, GLbyte*);
extern int __glXDisp_EndList(__GLXclientState*, GLbyte*);
......@@ -349,6 +352,9 @@ extern int __glXSwapQueryExtensionsString(__GLXclientState*, GLbyte*);
extern int __glXSwapQueryServerString(__GLXclientState*, GLbyte*);
extern int __glXSwapClientInfo(__GLXclientState*, GLbyte*);
extern int __glXSwapMakeContextCurrent(__GLXclientState*, GLbyte*);
extern int __glXSwapGetFBConfigs(__GLXclientState*, GLbyte*);
extern int __glXSwapCreateNewContext(__GLXclientState*, GLbyte*);
extern int __glXSwapCreatePixmap(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_NewList(__GLXclientState*, GLbyte*);
extern int __glXDispSwap_EndList(__GLXclientState*, GLbyte*);
......
......@@ -2273,7 +2273,6 @@ void __glXDisp_WindowPos3fARB(GLbyte *pc)
*(GLfloat *)(pc + 8)
);
}
#endif /* !MISSING_GL_EXTS */
void __glXDisp_SampleCoverageARB(GLbyte *pc)
......
......@@ -3368,7 +3368,6 @@ void __glXDispSwap_WindowPos3fARB(GLbyte *pc)
*(GLfloat *)(pc + 8)
);
}
#endif /* !MISSING_GL_EXTS */
void __glXDispSwap_SampleCoverageARB(GLbyte *pc)
......
This diff is collapsed.
......@@ -47,6 +47,11 @@
#include "glxext.h"
#include "GL/glx_ansic.h"
static int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
static int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
static int __glXSwapCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
static int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc);
/************************************************************************/
/*
......@@ -67,7 +72,41 @@ int __glXSwapCreateContext(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->shareList);
return __glXCreateContext(cl, pc);
return DoCreateContext( cl, req->context, req->shareList, req->visual,
req->screen, req->isDirect );
}
int __glXSwapCreateNewContext(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->renderType);
__GLX_SWAP_INT(&req->shareList);
return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
req->screen, req->isDirect );
}
int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateContextWithConfigSGIXReq *req =
(xGLXCreateContextWithConfigSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->renderType);
__GLX_SWAP_INT(&req->shareList);
return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
req->screen, req->isDirect );
}
int __glXSwapDestroyContext(__GLXclientState *cl, GLbyte *pc)
......@@ -91,7 +130,8 @@ int __glXSwapMakeCurrent(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return __glXMakeCurrent(cl, pc);
return DoMakeCurrent( cl, req->drawable, req->drawable,
req->context, req->oldContextTag );
}
int __glXSwapMakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
......@@ -105,7 +145,8 @@ int __glXSwapMakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return __glXMakeContextCurrent(cl, pc);
return DoMakeCurrent( cl, req->drawable, req->readdrawable,
req->context, req->oldContextTag );
}
int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
......@@ -119,7 +160,8 @@ int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return __glXMakeCurrentReadSGI(cl, pc);
return DoMakeCurrent( cl, req->drawable, req->readable,
req->context, req->oldContextTag );
}
int __glXSwapIsDirect(__GLXclientState *cl, GLbyte *pc)
......@@ -182,90 +224,29 @@ int __glXSwapCopyContext(__GLXclientState *cl, GLbyte *pc)
int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
xGLXGetVisualConfigsReply reply;
__GLXscreenInfo *pGlxScreen;
__GLXvisualConfig *pGlxVisual;
CARD32 buf[__GLX_TOTAL_CONFIG];
unsigned int screen;
int i, p;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT(&req->screen);
screen = req->screen;
if (screen > screenInfo.numScreens) {
/* The client library must send a valid screen number. */
client->errorValue = screen;
return BadValue;
}
pGlxScreen = &__glXActiveScreens[screen];
reply.numVisuals = pGlxScreen->numUsableVisuals;
reply.numProps = __GLX_TOTAL_CONFIG;
reply.length = (pGlxScreen->numUsableVisuals * __GLX_SIZE_CARD32 *
__GLX_TOTAL_CONFIG) >> 2;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
__GLX_SWAP_INT(&reply.numVisuals);
__GLX_SWAP_INT(&reply.numProps);
WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *)&reply);
for (i=0; i < pGlxScreen->numVisuals; i++) {
pGlxVisual = &pGlxScreen->pGlxVisual[i];
if (pGlxVisual->vid == 0) {
/* not a usable visual */
continue;
}
p = 0;
buf[p++] = pGlxVisual->vid;
buf[p++] = pGlxVisual->class;
buf[p++] = pGlxVisual->rgba;
buf[p++] = pGlxVisual->redSize;
buf[p++] = pGlxVisual->greenSize;
buf[p++] = pGlxVisual->blueSize;
buf[p++] = pGlxVisual->alphaSize;
buf[p++] = pGlxVisual->accumRedSize;
buf[p++] = pGlxVisual->accumGreenSize;
buf[p++] = pGlxVisual->accumBlueSize;
buf[p++] = pGlxVisual->accumAlphaSize;
buf[p++] = pGlxVisual->doubleBuffer;
buf[p++] = pGlxVisual->stereo;
buf[p++] = pGlxVisual->bufferSize;
buf[p++] = pGlxVisual->depthSize;
buf[p++] = pGlxVisual->stencilSize;
buf[p++] = pGlxVisual->auxBuffers;
buf[p++] = pGlxVisual->level;
/*
** Add token/value pairs for extensions.
*/
buf[p++] = GLX_VISUAL_CAVEAT_EXT;
buf[p++] = pGlxVisual->visualRating;
buf[p++] = GLX_TRANSPARENT_TYPE_EXT;
buf[p++] = pGlxVisual->transparentPixel;
buf[p++] = GLX_TRANSPARENT_RED_VALUE_EXT;
buf[p++] = pGlxVisual->transparentRed;
buf[p++] = GLX_TRANSPARENT_GREEN_VALUE_EXT;
buf[p++] = pGlxVisual->transparentGreen;
buf[p++] = GLX_TRANSPARENT_BLUE_VALUE_EXT;
buf[p++] = pGlxVisual->transparentBlue;
buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE_EXT;
buf[p++] = pGlxVisual->transparentAlpha;
buf[p++] = GLX_TRANSPARENT_INDEX_VALUE_EXT;
buf[p++] = pGlxVisual->transparentIndex;
__GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);
WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
(char *)buf);
}
return Success;
return DoGetVisualConfigs( cl, req->screen, GL_TRUE );
}
int __glXSwapGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
{
xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&req->screen);
return DoGetFBConfigs( cl, req->screen, GL_TRUE );
}
int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
{
xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&req->screen);
return DoGetFBConfigs( cl, req->screen, GL_TRUE );
}
int __glXSwapCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
......@@ -279,7 +260,39 @@ int __glXSwapCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->pixmap);
__GLX_SWAP_INT(&req->glxpixmap);
return __glXCreateGLXPixmap(cl, pc);
return DoCreateGLXPixmap( cl, req->visual, req->screen,
req->pixmap, req->glxpixmap );
}
int __glXSwapCreatePixmap(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->pixmap);
__GLX_SWAP_INT(&req->glxpixmap);
return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
req->pixmap, req->glxpixmap );
}
int __glXSwapCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
xGLXCreateGLXPixmapWithConfigSGIXReq *req =
(xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->screen);
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->pixmap);
__GLX_SWAP_INT(&req->glxpixmap);
return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
req->pixmap, req->glxpixmap );
}
int __glXSwapDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
......@@ -806,6 +819,7 @@ int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc)
}
#endif
if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
(vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
(*__glXSwapVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])(cl, (GLbyte*)req);
......@@ -833,6 +847,12 @@ int __glXSwapVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
return __glXSwapQueryContextInfoEXT(cl, pc);
case X_GLXvop_MakeCurrentReadSGI:
return __glXSwapMakeCurrentReadSGI(cl, pc);
case X_GLXvop_GetFBConfigsSGIX:
return __glXSwapGetFBConfigsSGIX(cl, pc);
case X_GLXvop_CreateContextWithConfigSGIX:
return __glXSwapCreateContextWithConfigSGIX(cl, pc);
case X_GLXvop_CreateGLXPixmapWithConfigSGIX:
return __glXSwapCreateGLXPixmapWithConfigSGIX(cl, pc);
default:
break;
}
......
......@@ -80,7 +80,6 @@ struct __GLXcontextRec {
** This context is created with respect to this visual.
*/
VisualRec *pVisual;
__GLXvisualConfig *pGlxVisual;
/*
** The XID of this context.
......
......@@ -40,7 +40,7 @@
typedef struct {
DrawablePtr pDraw;
__GLXvisualConfig *pGlxVisual;
__GLcontextModes *modes;
__GLXscreenInfo *pGlxScreen;
ScreenPtr pScreen;
Bool idExists;
......@@ -69,11 +69,12 @@ struct __GLXdrawablePrivateRec {
/*
** Configuration of the visual to which this drawable was created.
*/
__GLXvisualConfig *pGlxVisual;
__GLcontextModes *modes;
/*
** cached drawable size and origin
*/
GLint xorigin, yorigin;
GLint width, height;
......
......@@ -30,12 +30,11 @@
#include "micmap.h"
extern __GLXextensionInfo __glDDXExtensionInfo;
void GlxWrapInitVisuals(miInitVisualsProcPtr *);
void GlxSetVisualConfigs(int nconfigs,
__GLXvisualConfig *configs, void **privates);
__GLXextensionInfo *__glXExt = &__glDDXExtensionInfo;
static __GLXextensionInfo *__glXExt /* = &__glDDXExtensionInfo */;
/*
** Forward declarations.
......@@ -314,6 +313,8 @@ GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc)
{
saveInitVisualsProc = *initVisProc;
*initVisProc = GlxInitVisuals;
/* HACK: this shouldn't be done here but it's the earliest time */
__glXExt = __glXglDDXExtensionInfo(); /* from GLcore */
}
/************************************************************************/
......
......@@ -73,8 +73,16 @@ extern void __glXResetLargeCommandStatus(__GLXclientState*);
extern int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
extern int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
extern int __glXMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc);
extern int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc);
extern int DoMakeCurrent( __GLXclientState *cl, GLXDrawable drawId,
GLXDrawable readId, GLXContextID contextId, GLXContextTag tag );
extern int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen,
GLboolean do_swap);
extern int DoGetFBConfigs(__GLXclientState *cl, unsigned screen,
GLboolean do_swap);
extern int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
GLXContextID shareList, VisualID visual, GLuint screen, GLboolean isDirect);
extern int DoCreateGLXPixmap(__GLXclientState *cl, VisualID visual,
GLuint screenNum, XID pixmapId, XID glxpixmapId);
extern void GlxExtensionInit(void);
......
......@@ -133,104 +133,34 @@ static char GLXServerExtensions[] =
"GLX_EXT_visual_info "
"GLX_EXT_visual_rating "
"GLX_EXT_import_context "
"GLX_OML_swap_method "
"GLX_SGI_make_current_read "
#ifndef __DARWIN__
"GLX_SGIS_multisample "
#endif
"GLX_SGIX_fbconfig "
;
/*
** This comes from the GL library that the server will link with. Right
** now, that is the DDX Sample OpenGL.
*/
extern __GLXscreenInfo __glDDXScreenInfo;
__GLXscreenInfo *__glXScreens[] = {
&__glDDXScreenInfo,
* __glDDXScreenInfo comes from GLcore, so we can't resolve this symbol at
* module open time. Leave a placeholder, and fill this in when we first
* need it (in __glXScreenInit). XXX Why make this an array?
*/
static __GLXscreenInfo *__glXScreens[] = {
NULL /* &__glDDXScreenInfo */ ,
};
GLint __glXNumStaticScreens = (sizeof __glXScreens / sizeof __glXScreens[0]);
static GLint __glXNumStaticScreens =
(sizeof __glXScreens / sizeof __glXScreens[0]);
__GLXscreenInfo *__glXActiveScreens;
GLint __glXNumActiveScreens;
RESTYPE __glXDrawableRes;
#if 0
static int
CountBits(unsigned long mask)
{
int count = 0;
while(mask) {
count += (mask&1);
mask >>= 1;
}
return count;
__GLXscreenInfo *__glXgetActiveScreen(int num) {
return &__glXActiveScreens[num];
}
#endif
#if 0
/*
** A typical implementation would not probably not run through the screen's
** visuals to find ones that match the visual configs supplied by the DDX
** Sample OpenGL as we do here; we have done this to make this code easy to
** drop into an existing X server.
*/
static int matchVisuals(__GLXvisualConfig *pGlxVisual, int numVisuals,
int screen)
{
int i, j;
__GLXvisualConfig *pvis = pGlxVisual;
ScreenPtr pScreen = screenInfo.screens[screen];
VisualPtr pVisual;
int numMatchingVisuals = 0;
int *used;
used = (int *)__glXMalloc(pScreen->numVisuals*sizeof(int));
__glXMemset(used, 0, pScreen->numVisuals*sizeof(int));
for (i=0; i < numVisuals; i++, pvis++) {
/*
** Look through all the server's visuals to see which match.
*/
pvis->vid = 0;
pVisual = pScreen->visuals;
for (j=0; j < pScreen->numVisuals; j++, pVisual++) {
if (pvis->class == pVisual->class &&
pvis->bufferSize == pVisual->nplanes &&
!used[j]) {
int rBits, gBits, bBits, aBits;
/* count bits per rgb */
rBits = CountBits(pVisual->redMask);
gBits = CountBits(pVisual->greenMask);
bBits = CountBits(pVisual->blueMask);
aBits = 0;
if ((pvis->redSize == rBits) &&
(pvis->greenSize == gBits) &&
(pvis->blueSize == bBits) &&
(pvis->alphaSize == aBits)) {
/*
** We'll consider this a match.