Add a DRI_ReadDrawable marker extension to signal read drawable capability.
This commit is contained in:

committed by
Kristian Høgsberg

parent
106a6f29bb
commit
f968f67e62
@@ -78,6 +78,11 @@ struct __DRIextensionRec {
|
|||||||
const char *name;
|
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.
|
* Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
|
||||||
*/
|
*/
|
||||||
|
@@ -1068,6 +1068,13 @@ static void queryExtensions(__GLXscreenConfigs *psc)
|
|||||||
* not defined in dri_interface.h. Will enable
|
* not defined in dri_interface.h. Will enable
|
||||||
* GLX_OML_sync_control if implemented. */
|
* GLX_OML_sync_control if implemented. */
|
||||||
#endif
|
#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 */
|
/* Ignore unknown extensions */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -46,6 +46,14 @@ const __DRIinterfaceMethods * dri_interface = NULL;
|
|||||||
static const int empty_attribute_list[1] = { None };
|
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
|
* Cached copy of the internal API version used by libGL and the client-side
|
||||||
* DRI driver.
|
* DRI driver.
|
||||||
|
@@ -76,6 +76,7 @@ extern __GLcontextModes *__driDriverInitScreen(__DRIscreenPrivate *psp);
|
|||||||
/**
|
/**
|
||||||
* Extensions.
|
* Extensions.
|
||||||
*/
|
*/
|
||||||
|
extern const __DRIextension driReadDrawableExtension;
|
||||||
extern const __DRIcopySubBufferExtension driCopySubBufferExtension;
|
extern const __DRIcopySubBufferExtension driCopySubBufferExtension;
|
||||||
extern const __DRIswapControlExtension driSwapControlExtension;
|
extern const __DRIswapControlExtension driSwapControlExtension;
|
||||||
extern const __DRIframeTrackingExtension driFrameTrackingExtension;
|
extern const __DRIframeTrackingExtension driFrameTrackingExtension;
|
||||||
|
@@ -427,6 +427,7 @@ static const __DRIallocateExtension intelAllocateExtension = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const __DRIextension *intelExtensions[] = {
|
static const __DRIextension *intelExtensions[] = {
|
||||||
|
&driReadDrawableExtension,
|
||||||
&driCopySubBufferExtension.base,
|
&driCopySubBufferExtension.base,
|
||||||
&driSwapControlExtension.base,
|
&driSwapControlExtension.base,
|
||||||
&intelAllocateExtension.base,
|
&intelAllocateExtension.base,
|
||||||
@@ -442,10 +443,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv;
|
I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv;
|
||||||
drmI830Sarea *sarea;
|
drmI830Sarea *sarea;
|
||||||
|
|
||||||
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
|
|
||||||
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->
|
|
||||||
getProcAddress("glxEnableExtension"));
|
|
||||||
|
|
||||||
if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
|
if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"\nERROR! sizeof(I830DRIRec) does not match passed size from device driver\n");
|
"\nERROR! sizeof(I830DRIRec) does not match passed size from device driver\n");
|
||||||
@@ -539,10 +536,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
|
|
||||||
sPriv->extensions = intelExtensions;
|
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
|
/* If we've got a new enough DDX that's initializing TTM and giving us
|
||||||
* object handles for the shared buffers, use that.
|
* object handles for the shared buffers, use that.
|
||||||
*/
|
*/
|
||||||
|
@@ -265,6 +265,7 @@ intelUpdateScreenFromSAREA(intelScreenPrivate *intelScreen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const __DRIextension *intelExtensions[] = {
|
static const __DRIextension *intelExtensions[] = {
|
||||||
|
&driReadDrawableExtension,
|
||||||
&driCopySubBufferExtension.base,
|
&driCopySubBufferExtension.base,
|
||||||
&driSwapControlExtension.base,
|
&driSwapControlExtension.base,
|
||||||
&driFrameTrackingExtension.base,
|
&driFrameTrackingExtension.base,
|
||||||
@@ -276,8 +277,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
{
|
{
|
||||||
intelScreenPrivate *intelScreen;
|
intelScreenPrivate *intelScreen;
|
||||||
I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv;
|
I830DRIPtr gDRIPriv = (I830DRIPtr)sPriv->pDevPriv;
|
||||||
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
|
|
||||||
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
|
|
||||||
volatile drmI830Sarea *sarea;
|
volatile drmI830Sarea *sarea;
|
||||||
|
|
||||||
if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
|
if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
|
||||||
@@ -358,9 +357,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sPriv->extensions = intelExtensions;
|
sPriv->extensions = intelExtensions;
|
||||||
|
|
||||||
if (glx_enable_extension != NULL)
|
|
||||||
(*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" );
|
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -194,6 +194,7 @@ mgaFillInModes( unsigned pixel_bits, unsigned depth_bits,
|
|||||||
|
|
||||||
|
|
||||||
static const __DRIextension *mgaExtensions[] = {
|
static const __DRIextension *mgaExtensions[] = {
|
||||||
|
&driReadDrawableExtension,
|
||||||
&driSwapControlExtension.base,
|
&driSwapControlExtension.base,
|
||||||
&driFrameTrackingExtension.base,
|
&driFrameTrackingExtension.base,
|
||||||
&driMediaStreamCounterExtension.base,
|
&driMediaStreamCounterExtension.base,
|
||||||
@@ -205,8 +206,6 @@ mgaInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
{
|
{
|
||||||
mgaScreenPrivate *mgaScreen;
|
mgaScreenPrivate *mgaScreen;
|
||||||
MGADRIPtr serverInfo = (MGADRIPtr)sPriv->pDevPriv;
|
MGADRIPtr serverInfo = (MGADRIPtr)sPriv->pDevPriv;
|
||||||
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
|
|
||||||
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
|
|
||||||
|
|
||||||
if (sPriv->devPrivSize != sizeof(MGADRIRec)) {
|
if (sPriv->devPrivSize != sizeof(MGADRIRec)) {
|
||||||
fprintf(stderr,"\nERROR! sizeof(MGADRIRec) does not match passed size from device driver\n");
|
fprintf(stderr,"\nERROR! sizeof(MGADRIRec) does not match passed size from device driver\n");
|
||||||
@@ -243,9 +242,6 @@ mgaInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
|
|
||||||
sPriv->extensions = mgaExtensions;
|
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 &&
|
if (serverInfo->chipset != MGA_CARD_TYPE_G200 &&
|
||||||
serverInfo->chipset != MGA_CARD_TYPE_G400) {
|
serverInfo->chipset != MGA_CARD_TYPE_G400) {
|
||||||
FREE(mgaScreen);
|
FREE(mgaScreen);
|
||||||
|
@@ -351,8 +351,6 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
|
|||||||
radeonScreenPtr screen;
|
radeonScreenPtr screen;
|
||||||
RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv;
|
RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv;
|
||||||
unsigned char *RADEONMMIO;
|
unsigned char *RADEONMMIO;
|
||||||
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
|
|
||||||
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (sPriv->devPrivSize != sizeof(RADEONDRIRec)) {
|
if (sPriv->devPrivSize != sizeof(RADEONDRIRec)) {
|
||||||
@@ -745,12 +743,12 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
|
|||||||
i = 0;
|
i = 0;
|
||||||
screen->extensions[i++] = &driCopySubBufferExtension.base;
|
screen->extensions[i++] = &driCopySubBufferExtension.base;
|
||||||
screen->extensions[i++] = &driFrameTrackingExtension.base;
|
screen->extensions[i++] = &driFrameTrackingExtension.base;
|
||||||
|
screen->extensions[i++] = &driReadDrawableExtension;
|
||||||
|
|
||||||
if ( screen->irq != 0 ) {
|
if ( screen->irq != 0 ) {
|
||||||
screen->extensions[i++] = &driSwapControlExtension.base;
|
screen->extensions[i++] = &driSwapControlExtension.base;
|
||||||
screen->extensions[i++] = &driMediaStreamCounterExtension.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 RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
|
||||||
if (IS_R200_CLASS(screen))
|
if (IS_R200_CLASS(screen))
|
||||||
|
@@ -104,7 +104,7 @@ typedef struct {
|
|||||||
/* Configuration cache with default values for all contexts */
|
/* Configuration cache with default values for all contexts */
|
||||||
driOptionCache optionCache;
|
driOptionCache optionCache;
|
||||||
|
|
||||||
const __DRIextension *extensions[6];
|
const __DRIextension *extensions[7];
|
||||||
} radeonScreenRec, *radeonScreenPtr;
|
} radeonScreenRec, *radeonScreenPtr;
|
||||||
|
|
||||||
#define IS_R100_CLASS(screen) \
|
#define IS_R100_CLASS(screen) \
|
||||||
|
@@ -168,6 +168,10 @@ static const struct tnl_pipeline_stage *savage_pipeline[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const __DRIextension *savageExtensions[] = {
|
||||||
|
&driReadDrawableExtension,
|
||||||
|
};
|
||||||
|
|
||||||
/* this is first function called in dirver*/
|
/* this is first function called in dirver*/
|
||||||
|
|
||||||
static GLboolean
|
static GLboolean
|
||||||
@@ -175,9 +179,6 @@ savageInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
{
|
{
|
||||||
savageScreenPrivate *savageScreen;
|
savageScreenPrivate *savageScreen;
|
||||||
SAVAGEDRIPtr gDRIPriv = (SAVAGEDRIPtr)sPriv->pDevPriv;
|
SAVAGEDRIPtr gDRIPriv = (SAVAGEDRIPtr)sPriv->pDevPriv;
|
||||||
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
|
|
||||||
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
|
|
||||||
|
|
||||||
|
|
||||||
if (sPriv->devPrivSize != sizeof(SAVAGEDRIRec)) {
|
if (sPriv->devPrivSize != sizeof(SAVAGEDRIRec)) {
|
||||||
fprintf(stderr,"\nERROR! sizeof(SAVAGEDRIRec) does not match passed size from device driver\n");
|
fprintf(stderr,"\nERROR! sizeof(SAVAGEDRIRec) does not match passed size from device driver\n");
|
||||||
@@ -265,9 +266,7 @@ savageInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
driParseOptionInfo (&savageScreen->optionCache,
|
driParseOptionInfo (&savageScreen->optionCache,
|
||||||
__driConfigOptions, __driNConfigOptions);
|
__driConfigOptions, __driNConfigOptions);
|
||||||
|
|
||||||
if (glx_enable_extension != NULL) {
|
sPriv->extensions = savageExtensions;
|
||||||
(*glx_enable_extension)(sPriv->psc, "GLX_SGI_make_current_read");
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
savageDDFastPathInit();
|
savageDDFastPathInit();
|
||||||
|
@@ -63,6 +63,10 @@ DRI_CONF_BEGIN
|
|||||||
DRI_CONF_SECTION_END
|
DRI_CONF_SECTION_END
|
||||||
DRI_CONF_END;
|
DRI_CONF_END;
|
||||||
|
|
||||||
|
static const __DRIextension *tdfxExtensions[] = {
|
||||||
|
&driReadDrawableExtension,
|
||||||
|
};
|
||||||
|
|
||||||
static const GLuint __driNConfigOptions = 1;
|
static const GLuint __driNConfigOptions = 1;
|
||||||
|
|
||||||
extern const struct dri_extension card_extensions[];
|
extern const struct dri_extension card_extensions[];
|
||||||
@@ -73,8 +77,6 @@ tdfxCreateScreen( __DRIscreenPrivate *sPriv )
|
|||||||
{
|
{
|
||||||
tdfxScreenPrivate *fxScreen;
|
tdfxScreenPrivate *fxScreen;
|
||||||
TDFXDRIPtr fxDRIPriv = (TDFXDRIPtr) sPriv->pDevPriv;
|
TDFXDRIPtr fxDRIPriv = (TDFXDRIPtr) sPriv->pDevPriv;
|
||||||
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
|
|
||||||
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
|
|
||||||
|
|
||||||
if (sPriv->devPrivSize != sizeof(TDFXDRIRec)) {
|
if (sPriv->devPrivSize != sizeof(TDFXDRIRec)) {
|
||||||
fprintf(stderr,"\nERROR! sizeof(TDFXDRIRec) does not match passed size from device driver\n");
|
fprintf(stderr,"\nERROR! sizeof(TDFXDRIRec) does not match passed size from device driver\n");
|
||||||
@@ -115,9 +117,7 @@ tdfxCreateScreen( __DRIscreenPrivate *sPriv )
|
|||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (glx_enable_extension != NULL) {
|
sPriv->extensions = tdfxExtensions;
|
||||||
(*glx_enable_extension)(sPriv->psc, "GLX_SGI_make_current_read");
|
|
||||||
}
|
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -98,8 +98,6 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
{
|
{
|
||||||
viaScreenPrivate *viaScreen;
|
viaScreenPrivate *viaScreen;
|
||||||
VIADRIPtr gDRIPriv = (VIADRIPtr)sPriv->pDevPriv;
|
VIADRIPtr gDRIPriv = (VIADRIPtr)sPriv->pDevPriv;
|
||||||
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
|
|
||||||
(PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (sPriv->devPrivSize != sizeof(VIADRIRec)) {
|
if (sPriv->devPrivSize != sizeof(VIADRIRec)) {
|
||||||
@@ -177,14 +175,12 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
|
|||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
viaScreen->extensions[i++] = &driFrameTrackingExtension.base;
|
viaScreen->extensions[i++] = &driFrameTrackingExtension.base;
|
||||||
|
viaScreen->extensions[i++] = &driReadDrawableExtension;
|
||||||
if ( viaScreen->irqEnabled ) {
|
if ( viaScreen->irqEnabled ) {
|
||||||
viaScreen->extensions[i++] = &driSwapControlExtension.base;
|
viaScreen->extensions[i++] = &driSwapControlExtension.base;
|
||||||
viaScreen->extensions[i++] = &driMediaStreamCounterExtension.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;
|
viaScreen->extensions[i++] = NULL;
|
||||||
sPriv->extensions = viaScreen->extensions;
|
sPriv->extensions = viaScreen->extensions;
|
||||||
|
|
||||||
|
@@ -71,7 +71,7 @@ typedef struct {
|
|||||||
/* Configuration cache with default values for all contexts */
|
/* Configuration cache with default values for all contexts */
|
||||||
driOptionCache optionCache;
|
driOptionCache optionCache;
|
||||||
|
|
||||||
const __DRIextension *extensions[4];
|
const __DRIextension *extensions[5];
|
||||||
} viaScreenPrivate;
|
} viaScreenPrivate;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user