glx: Remove swap barrier and hyperpipe support

Never implemented in any open source driver.  The implementation
assumed explicit DDX driver knowledge of how the client-side driver
worked, since at the time the server's GL renderer was not a DRI driver.
But now, it is, so any implementation of these should be done with
additional DRI driver API, like the swap control extension.

Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2010-11-17 09:03:06 -05:00
parent 23e3d1f233
commit a80780a763
14 changed files with 1 additions and 359 deletions

View File

@ -68,7 +68,6 @@ libglx_la_SOURCES = \
indirect_program.c \ indirect_program.c \
indirect_table.h \ indirect_table.h \
indirect_texture_compression.c \ indirect_texture_compression.c \
g_disptab.h \
glxbyteorder.h \ glxbyteorder.h \
glxcmds.c \ glxcmds.c \
glxcmdsswap.c \ glxcmdsswap.c \

View File

@ -1,52 +0,0 @@
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef _GLX_g_disptab_h_
#define _GLX_g_disptab_h_
/*
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice including the dates of first publication and
* either this permission notice or a reference to
* http://oss.sgi.com/projects/FreeB/
* shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of Silicon Graphics, Inc.
* shall not be used in advertising or otherwise to promote the sale, use or
* other dealings in this Software without prior written authorization from
* Silicon Graphics, Inc.
*/
extern int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDisp_QueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDisp_QueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDisp_DestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc);
extern int __glXDisp_QueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDisp_HyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDispSwap_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDispSwap_QueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDispSwap_QueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDispSwap_DestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc);
extern int __glXDispSwap_QueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc);
extern int __glXDispSwap_HyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc);
#endif /* _GLX_g_disptab_h_ */

View File

@ -38,7 +38,6 @@
#include "glxserver.h" #include "glxserver.h"
#include <GL/glxtokens.h> #include <GL/glxtokens.h>
#include <unpack.h> #include <unpack.h>
#include "g_disptab.h"
#include <pixmapstr.h> #include <pixmapstr.h>
#include <windowstr.h> #include <windowstr.h>
#include "glxutil.h" #include "glxutil.h"
@ -2061,238 +2060,6 @@ int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc)
} }
} }
extern RESTYPE __glXSwapBarrierRes;
int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXBindSwapBarrierSGIXReq *req = (xGLXBindSwapBarrierSGIXReq *) pc;
XID drawable = req->drawable;
int barrier = req->barrier;
DrawablePtr pDraw;
int screen, rc;
__GLXscreen *pGlxScreen;
rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixGetAttrAccess);
pGlxScreen = glxGetScreen(pDraw->pScreen);
if (rc == Success && (pDraw->type == DRAWABLE_WINDOW)) {
screen = pDraw->pScreen->myNum;
if (pGlxScreen->swapBarrierFuncs) {
int ret = pGlxScreen->swapBarrierFuncs->bindSwapBarrierFunc(screen, drawable, barrier);
if (ret == Success) {
if (barrier)
/* add source for cleanup when drawable is gone */
AddResource(drawable, __glXSwapBarrierRes, (pointer)(intptr_t)screen);
else
/* delete source */
FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE);
}
return ret;
}
}
client->errorValue = drawable;
return __glXError(GLXBadDrawable);
}
int __glXDisp_QueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryMaxSwapBarriersSGIXReq *req =
(xGLXQueryMaxSwapBarriersSGIXReq *) pc;
xGLXQueryMaxSwapBarriersSGIXReply reply;
int screen = req->screen;
__GLXscreen *pGlxScreen;
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
if (pGlxScreen->swapBarrierFuncs)
reply.max = pGlxScreen->swapBarrierFuncs->queryMaxSwapBarriersFunc(screen);
else
reply.max = 0;
reply.length = 0;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
if (client->swapped) {
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
}
WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply,
(char *) &reply);
return Success;
}
#define GLX_BAD_HYPERPIPE_SGIX 92
int __glXDisp_QueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryHyperpipeNetworkSGIXReq * req = (xGLXQueryHyperpipeNetworkSGIXReq *) pc;
xGLXQueryHyperpipeNetworkSGIXReply reply;
int screen = req->screen;
void *rdata = NULL;
int length=0;
int npipes=0;
int n= 0;
__GLXscreen *pGlxScreen;
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
if (pGlxScreen->hyperpipeFuncs) {
rdata =
(pGlxScreen->hyperpipeFuncs->queryHyperpipeNetworkFunc(screen, &npipes, &n));
}
length = __GLX_PAD(n) >> 2;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.length = length;
reply.n = n;
reply.npipes = npipes;
if (client->swapped) {
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
__GLX_SWAP_INT(&reply.n);
__GLX_SWAP_INT(&reply.npipes);
}
WriteToClient(client, sz_xGLXQueryHyperpipeNetworkSGIXReply,
(char *) &reply);
WriteToClient(client, length << 2, (char *)rdata);
return Success;
}
int __glXDisp_DestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXDestroyHyperpipeConfigSGIXReq * req =
(xGLXDestroyHyperpipeConfigSGIXReq *) pc;
xGLXDestroyHyperpipeConfigSGIXReply reply;
int screen = req->screen;
int success = GLX_BAD_HYPERPIPE_SGIX;
int hpId ;
__GLXscreen *pGlxScreen;
hpId = req->hpId;
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
if (pGlxScreen->hyperpipeFuncs) {
success = pGlxScreen->hyperpipeFuncs->destroyHyperpipeConfigFunc(screen, hpId);
}
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.length = __GLX_PAD(0) >> 2;
reply.n = 0;
reply.success = success;
if (client->swapped) {
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
}
WriteToClient(client,
sz_xGLXDestroyHyperpipeConfigSGIXReply,
(char *) &reply);
return Success;
}
int __glXDisp_QueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXQueryHyperpipeConfigSGIXReq * req =
(xGLXQueryHyperpipeConfigSGIXReq *) pc;
xGLXQueryHyperpipeConfigSGIXReply reply;
int screen = req->screen;
void *rdata = NULL;
int length;
int npipes=0;
int n= 0;
int hpId;
__GLXscreen *pGlxScreen;
hpId = req->hpId;
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
if (pGlxScreen->hyperpipeFuncs) {
rdata = pGlxScreen->hyperpipeFuncs->queryHyperpipeConfigFunc(screen, hpId,&npipes, &n);
}
length = __GLX_PAD(n) >> 2;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.length = length;
reply.n = n;
reply.npipes = npipes;
if (client->swapped) {
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
__GLX_SWAP_INT(&reply.n);
__GLX_SWAP_INT(&reply.npipes);
}
WriteToClient(client, sz_xGLXQueryHyperpipeConfigSGIXReply,
(char *) &reply);
WriteToClient(client, length << 2, (char *)rdata);
return Success;
}
int __glXDisp_HyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
{
ClientPtr client = cl->client;
xGLXHyperpipeConfigSGIXReq * req =
(xGLXHyperpipeConfigSGIXReq *) pc;
xGLXHyperpipeConfigSGIXReply reply;
int screen = req->screen;
void *rdata;
int npipes=0, networkId;
int hpId=-1;
__GLXscreen *pGlxScreen;
pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
networkId = (int)req->networkId;
npipes = (int)req->npipes;
rdata = (void *)(req +1);
if (pGlxScreen->hyperpipeFuncs) {
pGlxScreen->hyperpipeFuncs->hyperpipeConfigFunc(screen,networkId,
&hpId, &npipes,
(void *) rdata);
}
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.length = __GLX_PAD(0) >> 2;
reply.n = 0;
reply.npipes = npipes;
reply.hpId = hpId;
if (client->swapped) {
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.npipes);
__GLX_SWAP_INT(&reply.hpId);
}
WriteToClient(client, sz_xGLXHyperpipeConfigSGIXReply,
(char *) &reply);
return Success;
}
/************************************************************************/ /************************************************************************/
/* /*

View File

@ -37,7 +37,6 @@
#include "glxutil.h" #include "glxutil.h"
#include <GL/glxtokens.h> #include <GL/glxtokens.h>
#include <unpack.h> #include <unpack.h>
#include "g_disptab.h"
#include <pixmapstr.h> #include <pixmapstr.h>
#include <windowstr.h> #include <windowstr.h>
#include "glxext.h" #include "glxext.h"

View File

@ -56,7 +56,6 @@
#include "glxutil.h" #include "glxutil.h"
#include "glxdricommon.h" #include "glxdricommon.h"
#include "g_disptab.h"
#include "glapitable.h" #include "glapitable.h"
#include "glapi.h" #include "glapi.h"
#include "glthread.h" #include "glthread.h"

View File

@ -48,7 +48,6 @@
#include "glxutil.h" #include "glxutil.h"
#include "glxdricommon.h" #include "glxdricommon.h"
#include "g_disptab.h"
#include "glapitable.h" #include "glapitable.h"
#include "glapi.h" #include "glapi.h"
#include "glthread.h" #include "glthread.h"

View File

@ -48,7 +48,6 @@
#include "glxutil.h" #include "glxutil.h"
#include "glxdricommon.h" #include "glxdricommon.h"
#include "g_disptab.h"
#include "glapitable.h" #include "glapitable.h"
#include "glapi.h" #include "glapi.h"
#include "glthread.h" #include "glthread.h"

View File

@ -39,7 +39,6 @@
#include <registry.h> #include <registry.h>
#include "privates.h" #include "privates.h"
#include <os.h> #include <os.h>
#include "g_disptab.h"
#include "unpack.h" #include "unpack.h"
#include "glxutil.h" #include "glxutil.h"
#include "glxext.h" #include "glxext.h"
@ -58,7 +57,6 @@ __GLXcontext *__glXContextList;
*/ */
RESTYPE __glXContextRes; RESTYPE __glXContextRes;
RESTYPE __glXDrawableRes; RESTYPE __glXDrawableRes;
RESTYPE __glXSwapBarrierRes;
/* /*
** Reply for most singles. ** Reply for most singles.
@ -228,19 +226,6 @@ GLboolean __glXFreeContext(__GLXcontext *cx)
return GL_TRUE; return GL_TRUE;
} }
extern RESTYPE __glXSwapBarrierRes;
static int SwapBarrierGone(int screen, XID drawable)
{
__GLXscreen *pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
if (pGlxScreen->swapBarrierFuncs) {
pGlxScreen->swapBarrierFuncs->bindSwapBarrierFunc(screen, drawable, 0);
}
FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE);
return True;
}
/************************************************************************/ /************************************************************************/
/* /*
@ -358,9 +343,7 @@ void GlxExtensionInit(void)
"GLXContext"); "GLXContext");
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone, __glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone,
"GLXDrawable"); "GLXDrawable");
__glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone, if (!__glXContextRes || !__glXDrawableRes)
"GLXSwapBarrier");
if (!__glXContextRes || !__glXDrawableRes || !__glXSwapBarrierRes)
return; return;
if (!dixRegisterPrivateKey(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (__GLXclientState))) if (!dixRegisterPrivateKey(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (__GLXclientState)))

View File

@ -175,8 +175,6 @@ static char GLXServerExtensions[] =
"GLX_SGI_make_current_read " "GLX_SGI_make_current_read "
#ifndef __APPLE__ #ifndef __APPLE__
"GLX_SGIS_multisample " "GLX_SGIS_multisample "
"GLX_SGIX_hyperpipe "
"GLX_SGIX_swap_barrier "
#endif #endif
"GLX_SGIX_fbconfig " "GLX_SGIX_fbconfig "
"GLX_SGIX_pbuffer " "GLX_SGIX_pbuffer "
@ -184,31 +182,6 @@ static char GLXServerExtensions[] =
"GLX_INTEL_swap_event" "GLX_INTEL_swap_event"
; ;
/*
* If your DDX driver wants to register support for swap barriers or hyperpipe
* topology, it should call __glXHyperpipeInit() or __glXSwapBarrierInit()
* with a dispatch table of functions to handle the requests. In the XFree86
* DDX, for example, you would call these near the bottom of the driver's
* ScreenInit method, after DRI has been initialized.
*
* This should be replaced with a better method when we teach the server how
* to load DRI drivers.
*/
void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs)
{
__GLXscreen *pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
pGlxScreen->hyperpipeFuncs = funcs;
}
void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs)
{
__GLXscreen *pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
pGlxScreen->swapBarrierFuncs = funcs;
}
static Bool static Bool
glxCloseScreen (int index, ScreenPtr pScreen) glxCloseScreen (int index, ScreenPtr pScreen)
{ {

View File

@ -35,21 +35,6 @@
* Silicon Graphics, Inc. * Silicon Graphics, Inc.
*/ */
typedef struct {
void * (* queryHyperpipeNetworkFunc)(int, int *, int *);
void * (* queryHyperpipeConfigFunc)(int, int, int *, int *);
int (* destroyHyperpipeConfigFunc)(int, int);
void * (* hyperpipeConfigFunc)(int, int, int *, int *, void *);
} __GLXHyperpipeExtensionFuncs;
typedef struct {
int (* bindSwapBarrierFunc)(int, XID, int);
int (* queryMaxSwapBarriersFunc)(int);
} __GLXSwapBarrierExtensionFuncs;
void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs);
void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs);
typedef struct __GLXconfig __GLXconfig; typedef struct __GLXconfig __GLXconfig;
struct __GLXconfig { struct __GLXconfig {
__GLXconfig *next; __GLXconfig *next;
@ -144,9 +129,6 @@ struct __GLXscreen {
int (*swapInterval) (__GLXdrawable *drawable, int (*swapInterval) (__GLXdrawable *drawable,
int interval); int interval);
__GLXHyperpipeExtensionFuncs *hyperpipeFuncs;
__GLXSwapBarrierExtensionFuncs *swapBarrierFuncs;
ScreenPtr pScreen; ScreenPtr pScreen;
/* Linked list of valid fbconfigs for this screen. */ /* Linked list of valid fbconfigs for this screen. */

View File

@ -30,7 +30,6 @@
#include "glxext.h" #include "glxext.h"
#include "indirect_dispatch.h" #include "indirect_dispatch.h"
#include "indirect_reqsize.h" #include "indirect_reqsize.h"
#include "g_disptab.h"
#include "indirect_table.h" #include "indirect_table.h"
/*****************************************************************/ /*****************************************************************/

View File

@ -35,7 +35,6 @@
#include "glxserver.h" #include "glxserver.h"
#include "glxutil.h" #include "glxutil.h"
#include "unpack.h" #include "unpack.h"
#include "g_disptab.h"
#include "glapitable.h" #include "glapitable.h"
#include "glapi.h" #include "glapi.h"
#include "glthread.h" #include "glthread.h"

View File

@ -586,8 +586,6 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) {
screen->base.createContext = __glXAquaScreenCreateContext; screen->base.createContext = __glXAquaScreenCreateContext;
screen->base.createDrawable = __glXAquaScreenCreateDrawable; screen->base.createDrawable = __glXAquaScreenCreateDrawable;
screen->base.swapInterval = /*FIXME*/ NULL; screen->base.swapInterval = /*FIXME*/ NULL;
screen->base.hyperpipeFuncs = NULL;
screen->base.swapBarrierFuncs = NULL;
screen->base.pScreen = pScreen; screen->base.pScreen = pScreen;
screen->base.fbconfigs = __glXAquaCreateVisualConfigs(&screen->base.numFBConfigs, pScreen->myNum); screen->base.fbconfigs = __glXAquaCreateVisualConfigs(&screen->base.numFBConfigs, pScreen->myNum);

View File

@ -649,8 +649,6 @@ glxWinScreenProbe(ScreenPtr pScreen)
screen->base.createContext = glxWinCreateContext; screen->base.createContext = glxWinCreateContext;
screen->base.createDrawable = glxWinCreateDrawable; screen->base.createDrawable = glxWinCreateDrawable;
screen->base.swapInterval = glxWinScreenSwapInterval; screen->base.swapInterval = glxWinScreenSwapInterval;
screen->base.hyperpipeFuncs = NULL;
screen->base.swapBarrierFuncs = NULL;
screen->base.pScreen = pScreen; screen->base.pScreen = pScreen;
if (strstr(wgl_extensions, "WGL_ARB_pixel_format")) if (strstr(wgl_extensions, "WGL_ARB_pixel_format"))