const char *name;
};
+/**
+ * Used by drivers to indicate support for setting the read drawable.
+ */
+#define __DRI_READ_DRAWABLE "DRI_ReadDrawable"
+
/**
* Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
*/
* not defined in dri_interface.h. Will enable
* GLX_OML_sync_control if implemented. */
#endif
+
+#ifdef __DRI_READ_DRAWABLE
+ if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
+ __glXScrEnableExtension(&psc->driScreen,
+ "GLX_SGI_make_current_read");
+ }
+#endif
/* Ignore unknown extensions */
}
}
static const int empty_attribute_list[1] = { None };
+/**
+ * This is just a token extension used to signal that the driver
+ * supports setting a read drawable.
+ */
+const __DRIextension driReadDrawableExtension = {
+ __DRI_READ_DRAWABLE
+};
+
/**
* Cached copy of the internal API version used by libGL and the client-side
* DRI driver.
/**
* Extensions.
*/
+extern const __DRIextension driReadDrawableExtension;
extern const __DRIcopySubBufferExtension driCopySubBufferExtension;
extern const __DRIswapControlExtension driSwapControlExtension;
extern const __DRIframeTrackingExtension driFrameTrackingExtension;
};
static const __DRIextension *intelExtensions[] = {
+ &driReadDrawableExtension,
&driCopySubBufferExtension.base,
&driSwapControlExtension.base,
&intelAllocateExtension.base,
I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv;
drmI830Sarea *sarea;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->
- getProcAddress("glxEnableExtension"));
-
if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
fprintf(stderr,
"\nERROR! sizeof(I830DRIRec) does not match passed size from device driver\n");
sPriv->extensions = intelExtensions;
- if (glx_enable_extension != NULL) {
- (*glx_enable_extension) (sPriv->psc, "GLX_SGI_make_current_read");
- }
-
/* If we've got a new enough DDX that's initializing TTM and giving us
* object handles for the shared buffers, use that.
*/
}
static const __DRIextension *intelExtensions[] = {
+ &driReadDrawableExtension,
&driCopySubBufferExtension.base,
&driSwapControlExtension.base,
&driFrameTrackingExtension.base,
{
intelScreenPrivate *intelScreen;
I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
volatile drmI830Sarea *sarea;
if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
}
sPriv->extensions = intelExtensions;
-
- if (glx_enable_extension != NULL)
- (*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" );
return GL_TRUE;
}
static const __DRIextension *mgaExtensions[] = {
+ &driReadDrawableExtension,
&driSwapControlExtension.base,
&driFrameTrackingExtension.base,
&driMediaStreamCounterExtension.base,
{
mgaScreenPrivate *mgaScreen;
MGADRIPtr serverInfo = (MGADRIPtr)sPriv->pDevPriv;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
if (sPriv->devPrivSize != sizeof(MGADRIRec)) {
fprintf(stderr,"\nERROR! sizeof(MGADRIRec) does not match passed size from device driver\n");
sPriv->extensions = mgaExtensions;
- if ( glx_enable_extension != NULL )
- (*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" );
-
if (serverInfo->chipset != MGA_CARD_TYPE_G200 &&
serverInfo->chipset != MGA_CARD_TYPE_G400) {
FREE(mgaScreen);
radeonScreenPtr screen;
RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv;
unsigned char *RADEONMMIO;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
int i;
if (sPriv->devPrivSize != sizeof(RADEONDRIRec)) {
i = 0;
screen->extensions[i++] = &driCopySubBufferExtension.base;
screen->extensions[i++] = &driFrameTrackingExtension.base;
+ screen->extensions[i++] = &driReadDrawableExtension;
+
if ( screen->irq != 0 ) {
screen->extensions[i++] = &driSwapControlExtension.base;
screen->extensions[i++] = &driMediaStreamCounterExtension.base;
}
- if ( glx_enable_extension != NULL )
- (*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" );
#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
if (IS_R200_CLASS(screen))
/* Configuration cache with default values for all contexts */
driOptionCache optionCache;
- const __DRIextension *extensions[6];
+ const __DRIextension *extensions[7];
} radeonScreenRec, *radeonScreenPtr;
#define IS_R100_CLASS(screen) \
};
+static const __DRIextension *savageExtensions[] = {
+ &driReadDrawableExtension,
+};
+
/* this is first function called in dirver*/
static GLboolean
{
savageScreenPrivate *savageScreen;
SAVAGEDRIPtr gDRIPriv = (SAVAGEDRIPtr)sPriv->pDevPriv;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
-
if (sPriv->devPrivSize != sizeof(SAVAGEDRIRec)) {
fprintf(stderr,"\nERROR! sizeof(SAVAGEDRIRec) does not match passed size from device driver\n");
driParseOptionInfo (&savageScreen->optionCache,
__driConfigOptions, __driNConfigOptions);
- if (glx_enable_extension != NULL) {
- (*glx_enable_extension)(sPriv->psc, "GLX_SGI_make_current_read");
- }
+ sPriv->extensions = savageExtensions;
#if 0
savageDDFastPathInit();
DRI_CONF_SECTION_END
DRI_CONF_END;
+static const __DRIextension *tdfxExtensions[] = {
+ &driReadDrawableExtension,
+};
+
static const GLuint __driNConfigOptions = 1;
extern const struct dri_extension card_extensions[];
{
tdfxScreenPrivate *fxScreen;
TDFXDRIPtr fxDRIPriv = (TDFXDRIPtr) sPriv->pDevPriv;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
if (sPriv->devPrivSize != sizeof(TDFXDRIRec)) {
fprintf(stderr,"\nERROR! sizeof(TDFXDRIRec) does not match passed size from device driver\n");
return GL_FALSE;
}
- if (glx_enable_extension != NULL) {
- (*glx_enable_extension)(sPriv->psc, "GLX_SGI_make_current_read");
- }
+ sPriv->extensions = tdfxExtensions;
return GL_TRUE;
}
{
viaScreenPrivate *viaScreen;
VIADRIPtr gDRIPriv = (VIADRIPtr)sPriv->pDevPriv;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
int i;
if (sPriv->devPrivSize != sizeof(VIADRIRec)) {
i = 0;
viaScreen->extensions[i++] = &driFrameTrackingExtension.base;
+ viaScreen->extensions[i++] = &driReadDrawableExtension;
if ( viaScreen->irqEnabled ) {
viaScreen->extensions[i++] = &driSwapControlExtension.base;
viaScreen->extensions[i++] = &driMediaStreamCounterExtension.base;
}
- if ( glx_enable_extension != NULL )
- (*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" );
-
viaScreen->extensions[i++] = NULL;
sPriv->extensions = viaScreen->extensions;
/* Configuration cache with default values for all contexts */
driOptionCache optionCache;
- const __DRIextension *extensions[4];
+ const __DRIextension *extensions[5];
} viaScreenPrivate;