diff options
author | Adam Jackson <ajax@redhat.com> | 2010-11-17 09:03:06 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2010-11-30 12:54:47 -0500 |
commit | a80780a7638f847c3be20e5e0c7fe85e83d9bdd1 (patch) | |
tree | 737847849bbc80aacac7453cd7ac4c62879e8b8d | |
parent | 23e3d1f23318ce69623f91908f888a09f8b74ac2 (diff) |
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>
-rw-r--r-- | glx/Makefile.am | 1 | ||||
-rw-r--r-- | glx/g_disptab.h | 52 | ||||
-rw-r--r-- | glx/glxcmds.c | 233 | ||||
-rw-r--r-- | glx/glxcmdsswap.c | 1 | ||||
-rw-r--r-- | glx/glxdri.c | 1 | ||||
-rw-r--r-- | glx/glxdri2.c | 1 | ||||
-rw-r--r-- | glx/glxdriswrast.c | 1 | ||||
-rw-r--r-- | glx/glxext.c | 19 | ||||
-rw-r--r-- | glx/glxscreens.c | 27 | ||||
-rw-r--r-- | glx/glxscreens.h | 18 | ||||
-rw-r--r-- | glx/indirect_table.c | 1 | ||||
-rw-r--r-- | glx/xfont.c | 1 | ||||
-rw-r--r-- | hw/xquartz/GL/indirect.c | 2 | ||||
-rw-r--r-- | hw/xwin/glx/indirect.c | 2 |
14 files changed, 1 insertions, 359 deletions
diff --git a/glx/Makefile.am b/glx/Makefile.am index 9d9fa3c31..d70887252 100644 --- a/glx/Makefile.am +++ b/glx/Makefile.am @@ -68,7 +68,6 @@ libglx_la_SOURCES = \ indirect_program.c \ indirect_table.h \ indirect_texture_compression.c \ - g_disptab.h \ glxbyteorder.h \ glxcmds.c \ glxcmdsswap.c \ diff --git a/glx/g_disptab.h b/glx/g_disptab.h deleted file mode 100644 index 9b4308b57..000000000 --- a/glx/g_disptab.h +++ /dev/null @@ -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_ */ diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 8d13c1509..de9c3f039 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -38,7 +38,6 @@ #include "glxserver.h" #include <GL/glxtokens.h> #include <unpack.h> -#include "g_disptab.h" #include <pixmapstr.h> #include <windowstr.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; -} - - /************************************************************************/ /* diff --git a/glx/glxcmdsswap.c b/glx/glxcmdsswap.c index c414dc8e2..ce4d69a0b 100644 --- a/glx/glxcmdsswap.c +++ b/glx/glxcmdsswap.c @@ -37,7 +37,6 @@ #include "glxutil.h" #include <GL/glxtokens.h> #include <unpack.h> -#include "g_disptab.h" #include <pixmapstr.h> #include <windowstr.h> #include "glxext.h" diff --git a/glx/glxdri.c b/glx/glxdri.c index db3fcd5cb..7717fcfb7 100644 --- a/glx/glxdri.c +++ b/glx/glxdri.c @@ -56,7 +56,6 @@ #include "glxutil.h" #include "glxdricommon.h" -#include "g_disptab.h" #include "glapitable.h" #include "glapi.h" #include "glthread.h" diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 0b6920151..111118305 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -48,7 +48,6 @@ #include "glxutil.h" #include "glxdricommon.h" -#include "g_disptab.h" #include "glapitable.h" #include "glapi.h" #include "glthread.h" diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c index dc12f5705..08ea33865 100644 --- a/glx/glxdriswrast.c +++ b/glx/glxdriswrast.c @@ -48,7 +48,6 @@ #include "glxutil.h" #include "glxdricommon.h" -#include "g_disptab.h" #include "glapitable.h" #include "glapi.h" #include "glthread.h" diff --git a/glx/glxext.c b/glx/glxext.c index f5ebe4f7e..4bd5d6b6b 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -39,7 +39,6 @@ #include <registry.h> #include "privates.h" #include <os.h> -#include "g_disptab.h" #include "unpack.h" #include "glxutil.h" #include "glxext.h" @@ -58,7 +57,6 @@ __GLXcontext *__glXContextList; */ RESTYPE __glXContextRes; RESTYPE __glXDrawableRes; -RESTYPE __glXSwapBarrierRes; /* ** Reply for most singles. @@ -228,19 +226,6 @@ GLboolean __glXFreeContext(__GLXcontext *cx) 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"); __glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone, "GLXDrawable"); - __glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone, - "GLXSwapBarrier"); - if (!__glXContextRes || !__glXDrawableRes || !__glXSwapBarrierRes) + if (!__glXContextRes || !__glXDrawableRes) return; if (!dixRegisterPrivateKey(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (__GLXclientState))) diff --git a/glx/glxscreens.c b/glx/glxscreens.c index 8515e14d5..496cf9e14 100644 --- a/glx/glxscreens.c +++ b/glx/glxscreens.c @@ -175,8 +175,6 @@ static char GLXServerExtensions[] = "GLX_SGI_make_current_read " #ifndef __APPLE__ "GLX_SGIS_multisample " - "GLX_SGIX_hyperpipe " - "GLX_SGIX_swap_barrier " #endif "GLX_SGIX_fbconfig " "GLX_SGIX_pbuffer " @@ -184,31 +182,6 @@ static char GLXServerExtensions[] = "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 glxCloseScreen (int index, ScreenPtr pScreen) { diff --git a/glx/glxscreens.h b/glx/glxscreens.h index 861e03ce8..93b4109e0 100644 --- a/glx/glxscreens.h +++ b/glx/glxscreens.h @@ -35,21 +35,6 @@ * 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; struct __GLXconfig { __GLXconfig *next; @@ -144,9 +129,6 @@ struct __GLXscreen { int (*swapInterval) (__GLXdrawable *drawable, int interval); - __GLXHyperpipeExtensionFuncs *hyperpipeFuncs; - __GLXSwapBarrierExtensionFuncs *swapBarrierFuncs; - ScreenPtr pScreen; /* Linked list of valid fbconfigs for this screen. */ diff --git a/glx/indirect_table.c b/glx/indirect_table.c index cb3202605..01d1da3f8 100644 --- a/glx/indirect_table.c +++ b/glx/indirect_table.c @@ -30,7 +30,6 @@ #include "glxext.h" #include "indirect_dispatch.h" #include "indirect_reqsize.h" -#include "g_disptab.h" #include "indirect_table.h" /*****************************************************************/ diff --git a/glx/xfont.c b/glx/xfont.c index b4081cfd4..99437842e 100644 --- a/glx/xfont.c +++ b/glx/xfont.c @@ -35,7 +35,6 @@ #include "glxserver.h" #include "glxutil.h" #include "unpack.h" -#include "g_disptab.h" #include "glapitable.h" #include "glapi.h" #include "glthread.h" diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c index 58f78fb80..bdc7c3d50 100644 --- a/hw/xquartz/GL/indirect.c +++ b/hw/xquartz/GL/indirect.c @@ -586,8 +586,6 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) { screen->base.createContext = __glXAquaScreenCreateContext; screen->base.createDrawable = __glXAquaScreenCreateDrawable; screen->base.swapInterval = /*FIXME*/ NULL; - screen->base.hyperpipeFuncs = NULL; - screen->base.swapBarrierFuncs = NULL; screen->base.pScreen = pScreen; screen->base.fbconfigs = __glXAquaCreateVisualConfigs(&screen->base.numFBConfigs, pScreen->myNum); diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c index 5d7391d4c..c9831f3ea 100644 --- a/hw/xwin/glx/indirect.c +++ b/hw/xwin/glx/indirect.c @@ -649,8 +649,6 @@ glxWinScreenProbe(ScreenPtr pScreen) screen->base.createContext = glxWinCreateContext; screen->base.createDrawable = glxWinCreateDrawable; screen->base.swapInterval = glxWinScreenSwapInterval; - screen->base.hyperpipeFuncs = NULL; - screen->base.swapBarrierFuncs = NULL; screen->base.pScreen = pScreen; if (strstr(wgl_extensions, "WGL_ARB_pixel_format")) |