summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2007-05-11 16:11:23 -0400
committerKristian Høgsberg <[email protected]>2007-10-10 18:00:13 -0400
commitaac367f48afc62176faf67aa6f329fbeae2004b4 (patch)
tree9afce18cf316c930ca764e27caeadb2b0fb2f0be /src/glx
parentfa72013adaab4d0755e852805e2e44d1a879a204 (diff)
Remove screenConfigs from __DRIscreen.
The screenConfigs field of __DRIscreen points back to the containing __GLXscreenConfigs struct. This is a serious abstraction violation; it assumes that the loader is libGL and that there *is* a __GLXscreenConfigs type in the loader. Using the containerOf macro, we can get from the __DRIscreen pointer to the containing __GLXscreenConfigs struct, at a place in the stack where the above is a valid assumption. Besides, the __DRI* structs shouldn't hold state other than the private pointer.
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/x11/glxext.c1
-rw-r--r--src/glx/x11/glxextensions.c7
-rw-r--r--src/glx/x11/glxextensions.h9
3 files changed, 14 insertions, 3 deletions
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index 85c990d4fc1..45b1dde91b6 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -1203,7 +1203,6 @@ static Bool AllocAndFetchScreenConfigs(Display *dpy, __GLXdisplayPrivate *priv)
if (priv->driDisplay.createNewScreen &&
priv->driDisplay.createNewScreen[i]) {
- psc->driScreen.screenConfigs = (void *)psc;
psc->driScreen.private =
CallCreateNewScreen(dpy, i, psc,
& priv->driDisplay,
diff --git a/src/glx/x11/glxextensions.c b/src/glx/x11/glxextensions.c
index 1d99b61db08..96964d1db10 100644
--- a/src/glx/x11/glxextensions.c
+++ b/src/glx/x11/glxextensions.c
@@ -356,6 +356,7 @@ __glXProcessServerString( const struct extension_info * ext,
}
}
+#ifdef GLX_DIRECT_RENDERING
/**
* Enable a named GLX extension on a given screen.
@@ -370,14 +371,18 @@ __glXProcessServerString( const struct extension_info * ext,
* \since Internal API version 20030813.
*/
void
-__glXScrEnableExtension( __GLXscreenConfigs *psc, const char * name )
+__glXScrEnableExtension( __DRIscreen *driScreen, const char * name )
{
+ __GLXscreenConfigs *psc =
+ containerOf(driScreen, __GLXscreenConfigs, driScreen);
+
__glXExtensionsCtr();
__glXExtensionsCtrScreen(psc);
set_glx_extension( known_glx_extensions, name, strlen( name ), GL_TRUE,
psc->direct_support );
}
+#endif
/**
* Initialize global extension support tables.
diff --git a/src/glx/x11/glxextensions.h b/src/glx/x11/glxextensions.h
index a4241b6b7f9..62bbf116e93 100644
--- a/src/glx/x11/glxextensions.h
+++ b/src/glx/x11/glxextensions.h
@@ -234,7 +234,14 @@ extern GLboolean __glXExtensionBitIsEnabled( struct __GLXscreenConfigsRec *psc,
extern const char * __glXGetClientExtensions( void );
extern void __glXCalculateUsableExtensions( struct __GLXscreenConfigsRec *psc,
GLboolean display_is_direct_capable, int server_minor_version );
-extern void __glXScrEnableExtension( struct __GLXscreenConfigsRec *psc, const char * name );
+
+#ifdef GLX_DIRECT_RENDERING
+
+struct __DRIscreenRec;
+extern void __glXScrEnableExtension( struct __DRIscreenRec *driScreen, const char * name );
+
+#endif
+
extern void __glXCalculateUsableGLExtensions( struct __GLXcontextRec * gc,
const char * server_string, int major_version, int minor_version );
extern void __glXGetGLVersion( int * major_version, int * minor_version );