diff options
author | Ian Romanick <idr@us.ibm.com> | 2006-08-31 13:54:10 -0700 |
---|---|---|
committer | Ian Romanick <idr@us.ibm.com> | 2006-08-31 13:54:10 -0700 |
commit | 0f9cfb2f752a9010ff07f4b2bd891db0cc30b8e6 (patch) | |
tree | 6104b3d4cf72bf11d4ea283a2e8e5de25aa315ca /GL | |
parent | a9ef5862919313582f72fc0cfb5ab0af4df6507e (diff) |
Implement GLX_SGI_swap_control.
Regenerate from glX_API.xml 1.2. Add infrastructure to support
GLX_SGI_swap_control for AIGLX when the DRI driver enables it. Tested
with R300.
Diffstat (limited to 'GL')
-rw-r--r-- | GL/glx/Makefile.am | 1 | ||||
-rw-r--r-- | GL/glx/extension_string.c | 4 | ||||
-rw-r--r-- | GL/glx/glxcmds.c | 3 | ||||
-rw-r--r-- | GL/glx/glxdri.c | 50 | ||||
-rw-r--r-- | GL/glx/glxscreens.h | 2 | ||||
-rw-r--r-- | GL/glx/indirect_dispatch.h | 10 | ||||
-rw-r--r-- | GL/glx/indirect_table.c | 2 |
7 files changed, 43 insertions, 29 deletions
diff --git a/GL/glx/Makefile.am b/GL/glx/Makefile.am index 9bb2b7eff..44d9cf9e4 100644 --- a/GL/glx/Makefile.am +++ b/GL/glx/Makefile.am @@ -77,5 +77,6 @@ libglx_la_SOURCES = \ singlepixswap.c \ singlesize.c \ singlesize.h \ + swap_interval.c \ unpack.h \ xfont.c diff --git a/GL/glx/extension_string.c b/GL/glx/extension_string.c index 8f13963ce..a4b202af3 100644 --- a/GL/glx/extension_string.c +++ b/GL/glx/extension_string.c @@ -60,7 +60,7 @@ struct extension_info { unsigned char version_minor; /** - * Is driver supported foced by the ABI? + * Is driver support forced by the ABI? */ unsigned char driver_support; }; @@ -77,9 +77,7 @@ static const struct extension_info known_glx_extensions[] = { { GLX(MESA_copy_sub_buffer), VER(0,0), N, }, { GLX(OML_swap_method), VER(0,0), Y, }, { GLX(SGI_make_current_read), VER(1,3), N, }, -#if 0 /* GLX protocol not yet supported for these. */ { GLX(SGI_swap_control), VER(0,0), N, }, -#endif { GLX(SGIS_multisample), VER(0,0), Y, }, { GLX(SGIX_fbconfig), VER(1,3), Y, }, { GLX(SGIX_pbuffer), VER(1,3), N, }, diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c index 3092f853f..ccdf3fa00 100644 --- a/GL/glx/glxcmds.c +++ b/GL/glx/glxcmds.c @@ -2274,9 +2274,6 @@ int __glXDisp_VendorPrivate(__GLXclientState *cl, GLbyte *pc) return Success; } - /* - ** This sample implemention does not support any private requests. - */ cl->client->errorValue = req->vendorCode; return __glXError(GLXUnsupportedPrivateRequest); } diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c index 212f2a80c..41e49e225 100644 --- a/GL/glx/glxdri.c +++ b/GL/glx/glxdri.c @@ -148,6 +148,22 @@ __glXDRIenterServer(void) DRIWakeupHandler(NULL, 0, NULL); } +/** + * \bug + * We're jumping through hoops here to get the DRIdrawable which the DRI + * driver tries to keep to it self... cf. FIXME in \c createDrawable. + */ +static void +__glXDRIdrawableFoo(__GLXDRIdrawable *draw) +{ + __GLXDRIscreen * const screen = + (__GLXDRIscreen *) __glXgetActiveScreen(draw->base.pDraw->pScreen->myNum); + + draw->driDrawable = (*screen->driScreen.getDrawable)(NULL, + draw->base.drawId, + screen->driScreen.private); +} + static void __glXDRIdrawableDestroy(__GLXdrawable *private) { @@ -172,16 +188,8 @@ static GLboolean __glXDRIdrawableSwapBuffers(__GLXdrawable *basePrivate) { __GLXDRIdrawable *private = (__GLXDRIdrawable *) basePrivate; - __GLXDRIscreen *screen; - /* FIXME: We're jumping through hoops here to get the DRIdrawable - * which the dri driver tries to keep to it self... cf. FIXME in - * createDrawable. */ - - screen = (__GLXDRIscreen *) __glXgetActiveScreen(private->base.pDraw->pScreen->myNum); - private->driDrawable = (screen->driScreen.getDrawable)(NULL, - private->base.drawId, - screen->driScreen.private); + __glXDRIdrawableFoo(private); (*private->driDrawable->swapBuffers)(NULL, private->driDrawable->private); @@ -189,21 +197,26 @@ __glXDRIdrawableSwapBuffers(__GLXdrawable *basePrivate) return TRUE; } + +static int +__glXDRIdrawableSwapInterval(__GLXdrawable *baseDrawable, int interval) +{ + __GLXDRIdrawable *draw = (__GLXDRIdrawable *) baseDrawable; + + __glXDRIdrawableFoo(draw); + + draw->driDrawable->swap_interval = interval; + return 0; +} + + static void __glXDRIdrawableCopySubBuffer(__GLXdrawable *basePrivate, int x, int y, int w, int h) { __GLXDRIdrawable *private = (__GLXDRIdrawable *) basePrivate; - __GLXDRIscreen *screen; - - /* FIXME: We're jumping through hoops here to get the DRIdrawable - * which the dri driver tries to keep to it self... cf. FIXME in - * createDrawable. */ - screen = (__GLXDRIscreen *) __glXgetActiveScreen(private->base.pDraw->pScreen->myNum); - private->driDrawable = (screen->driScreen.getDrawable)(NULL, - private->base.drawId, - screen->driScreen.private); + __glXDRIdrawableFoo(private); (*private->driDrawable->copySubBuffer)(NULL, private->driDrawable->private, @@ -849,6 +862,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->base.destroy = __glXDRIscreenDestroy; screen->base.createContext = __glXDRIscreenCreateContext; screen->base.createDrawable = __glXDRIscreenCreateDrawable; + screen->base.swapInterval = __glXDRIdrawableSwapInterval; screen->base.pScreen = pScreen; __glXInitExtensionEnableBits(screen->glx_enable_bits); diff --git a/GL/glx/glxscreens.h b/GL/glx/glxscreens.h index 8beec17ec..a7700f649 100644 --- a/GL/glx/glxscreens.h +++ b/GL/glx/glxscreens.h @@ -62,6 +62,8 @@ struct __GLXscreen { DrawablePtr pDraw, XID drawId, __GLcontextModes *modes); + int (*swapInterval) (__GLXdrawable *drawable, + int interval); ScreenPtr pScreen; diff --git a/GL/glx/indirect_dispatch.h b/GL/glx/indirect_dispatch.h index 2a2fd27c6..c259fd930 100644 --- a/GL/glx/indirect_dispatch.h +++ b/GL/glx/indirect_dispatch.h @@ -401,8 +401,8 @@ extern HIDDEN void __glXDisp_TexCoord4fv(GLbyte * pc); extern HIDDEN void __glXDispSwap_TexCoord4fv(GLbyte * pc); extern HIDDEN int __glXDisp_WaitX(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_WaitX(struct __GLXclientStateRec *, GLbyte *); -extern HIDDEN void __glXDisp_VertexAttrib2dvNV(GLbyte * pc); -extern HIDDEN void __glXDispSwap_VertexAttrib2dvNV(GLbyte * pc); +extern HIDDEN void __glXDisp_SecondaryColor3uivEXT(GLbyte * pc); +extern HIDDEN void __glXDispSwap_SecondaryColor3uivEXT(GLbyte * pc); extern HIDDEN void __glXDisp_FramebufferRenderbufferEXT(GLbyte * pc); extern HIDDEN void __glXDispSwap_FramebufferRenderbufferEXT(GLbyte * pc); extern HIDDEN void __glXDisp_VertexAttrib1dvNV(GLbyte * pc); @@ -549,6 +549,8 @@ extern HIDDEN void __glXDisp_PolygonMode(GLbyte * pc); extern HIDDEN void __glXDispSwap_PolygonMode(GLbyte * pc); extern HIDDEN void __glXDisp_CompressedTexSubImage1DARB(GLbyte * pc); extern HIDDEN void __glXDispSwap_CompressedTexSubImage1DARB(GLbyte * pc); +extern HIDDEN void __glXDisp_VertexAttrib2dvNV(GLbyte * pc); +extern HIDDEN void __glXDispSwap_VertexAttrib2dvNV(GLbyte * pc); extern HIDDEN int __glXDisp_GetVertexAttribivNV(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_GetVertexAttribivNV(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDisp_IsQueryARB(struct __GLXclientStateRec *, GLbyte *); @@ -679,8 +681,8 @@ extern HIDDEN void __glXDisp_TexEnviv(GLbyte * pc); extern HIDDEN void __glXDispSwap_TexEnviv(GLbyte * pc); extern HIDDEN void __glXDisp_TexSubImage3D(GLbyte * pc); extern HIDDEN void __glXDispSwap_TexSubImage3D(GLbyte * pc); -extern HIDDEN void __glXDisp_SecondaryColor3uivEXT(GLbyte * pc); -extern HIDDEN void __glXDispSwap_SecondaryColor3uivEXT(GLbyte * pc); +extern HIDDEN int __glXDisp_SwapIntervalSGI(struct __GLXclientStateRec *, GLbyte *); +extern HIDDEN int __glXDispSwap_SwapIntervalSGI(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDisp_GetColorTableParameterfv(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN int __glXDispSwap_GetColorTableParameterfv(struct __GLXclientStateRec *, GLbyte *); extern HIDDEN void __glXDisp_Bitmap(GLbyte * pc); diff --git a/GL/glx/indirect_table.c b/GL/glx/indirect_table.c index de3986cdc..d13e4f8df 100644 --- a/GL/glx/indirect_table.c +++ b/GL/glx/indirect_table.c @@ -1557,7 +1557,7 @@ static const void *VendorPriv_function_table[80][2] = { /* [ 69] = 5157 */ {NULL, NULL}, /* [ 70] = 5158 */ {NULL, NULL}, /* [ 71] = 5159 */ {NULL, NULL}, - /* [ 72] = 65536 */ {NULL, NULL}, + /* [ 72] = 65536 */ {__glXDisp_SwapIntervalSGI, __glXDispSwap_SwapIntervalSGI}, /* [ 73] = 65537 */ {__glXDisp_MakeCurrentReadSGI, __glXDispSwap_MakeCurrentReadSGI}, /* [ 74] = 65538 */ {NULL, NULL}, /* [ 75] = 65539 */ {NULL, NULL}, |