summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2005-07-24 06:29:14 +0000
committerIan Romanick <[email protected]>2005-07-24 06:29:14 +0000
commitc39bf5e273a4995a279ae2af59fc29e06ab47e29 (patch)
tree7b2edd0c9b039d75da7b95c8c97142c31494a03e /src/mesa/drivers/dri/r300
parent7d40d230fa26abeb9f92bdcf8012eddbc585b118 (diff)
All elements of pre-DRI_NEW_INTERFACE_ONLY are removed. This allows
1,402 lines of code to be removed from Mesa (drivers and libGL). The big winner is dri_util.c. Primary changes are: 1. Remove all "deprecated" entry-points from the various structures in dri_interface.h. 2. Rename the remaining fields to removed "version numbers." So, bindContext3 becomes bindContext. Functions with "New" in the name (e.g., CreateNewContext) were *not* changed, but that is an option. Having "New" in the name is less annoying to me than having "3" in the name. 3. Remove all compatibility code that handles cases where the driver or the loader is too old to support the latest interfaces. 4. Append the API version to the __driCreateNewScreen function name. This is currently done by hand. In the future (i.e., the next time we make an incompatible change to the interface) we'll want to come up with a better way to do this. This prevents old loaders from being able to load new (incompatible) drivers. 5. Bump the API version to 20050722. All drivers (by way of dri_util.c) require this version. 6. All drivers are *required* to expose GLX_SGIX_fbconfig and GLX_OML_swap_method (or the moral equivalents). Support for these functions in implicit in the use of the "new" interface. 7. Some cases still exist that need to be compiled differently in a loader or core Mesa versus in a driver. These are identified by the define IN_DRI_DRIVER.
Diffstat (limited to 'src/mesa/drivers/dri/r300')
-rw-r--r--src/mesa/drivers/dri/r300/radeon_screen.c83
1 files changed, 23 insertions, 60 deletions
diff --git a/src/mesa/drivers/dri/r300/radeon_screen.c b/src/mesa/drivers/dri/r300/radeon_screen.c
index a508c62e834..ea9b9ea2669 100644
--- a/src/mesa/drivers/dri/r300/radeon_screen.c
+++ b/src/mesa/drivers/dri/r300/radeon_screen.c
@@ -216,15 +216,12 @@ static const struct dri_debug_control debug_control[] = {
#define PCI_CHIP_R420_JK 0x4a4b
#endif
-#ifdef USE_NEW_INTERFACE
static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
-#endif /* USE_NEW_INTERFACE */
static radeonScreenPtr __radeonScreen;
static int getSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo);
-#ifdef USE_NEW_INTERFACE
static __GLcontextModes *radeonFillInModes(unsigned pixel_bits,
unsigned depth_bits,
unsigned stencil_bits,
@@ -304,7 +301,7 @@ static __GLcontextModes *radeonFillInModes(unsigned pixel_bits,
return modes;
}
-#endif /* USE_NEW_INTERFACE */
+
/* Create the device specific screen private data struct.
*/
@@ -313,6 +310,15 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv)
radeonScreenPtr screen;
RADEONDRIPtr dri_priv = (RADEONDRIPtr) sPriv->pDevPriv;
unsigned char *RADEONMMIO;
+ PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
+ (PFNGLXSCRENABLEEXTENSIONPROC)
+ glXGetProcAddress((const GLubyte *) "__glXScrEnableExtension");
+ void *const psc = sPriv->psc->screenConfigs;
+
+
+ if (glx_enable_extension == NULL) {
+ return NULL;
+ }
/* Allocate the private area */
screen = (radeonScreenPtr) CALLOC(sizeof(*screen));
@@ -580,48 +586,22 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv)
screen->driScreen = sPriv;
screen->sarea_priv_offset = dri_priv->sarea_priv_offset;
- if (driCompareGLXAPIVersion(20030813) >= 0) {
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC)
- glXGetProcAddress((const GLubyte *)
- "__glXScrEnableExtension");
- void *const psc = sPriv->psc->screenConfigs;
-
- if (glx_enable_extension != NULL) {
- if (screen->irq != 0) {
- (*glx_enable_extension) (psc,
- "GLX_SGI_swap_control");
- (*glx_enable_extension) (psc,
- "GLX_SGI_video_sync");
- (*glx_enable_extension) (psc,
- "GLX_MESA_swap_control");
- }
+ if (screen->irq != 0) {
+ (*glx_enable_extension) (psc, "GLX_SGI_swap_control");
+ (*glx_enable_extension) (psc, "GLX_SGI_video_sync");
+ (*glx_enable_extension) (psc, "GLX_MESA_swap_control");
+ }
- (*glx_enable_extension) (psc,
- "GLX_MESA_swap_frame_usage");
+ (*glx_enable_extension) (psc, "GLX_MESA_swap_frame_usage");
#if R200_MERGED
- if (driCompareGLXAPIVersion(20030818) >= 0) {
- sPriv->psc->allocateMemory =
- (void *)r200AllocateMemoryMESA;
- sPriv->psc->freeMemory =
- (void *)r200FreeMemoryMESA;
- sPriv->psc->memoryOffset =
- (void *)r200GetMemoryOffsetMESA;
-
- (*glx_enable_extension) (psc,
- "GLX_MESA_allocate_memory");
- }
+ sPriv->psc->allocateMemory = (void *)r200AllocateMemoryMESA;
+ sPriv->psc->freeMemory = (void *)r200FreeMemoryMESA;
+ sPriv->psc->memoryOffset = (void *)r200GetMemoryOffsetMESA;
+
+ (*glx_enable_extension) (psc, "GLX_MESA_allocate_memory");
#endif
- if (driCompareGLXAPIVersion(20030915) >= 0) {
- (*glx_enable_extension) (psc,
- "GLX_SGIX_fbconfig");
- (*glx_enable_extension) (psc,
- "GLX_OML_swap_method");
- }
- }
- }
return screen;
}
@@ -799,22 +779,6 @@ static const struct __DriverAPIRec radeonAPI = {
.SwapBuffersMSC = NULL
};
-/*
- * This is the bootstrap function for the driver.
- * The __driCreateScreen name is the symbol that libGL.so fetches.
- * Return: pointer to a __DRIscreenPrivate.
- *
- */
-#if !defined(DRI_NEW_INTERFACE_ONLY)
-void *__driCreateScreen(Display * dpy, int scrn, __DRIscreen * psc,
- int numConfigs, __GLXvisualConfig * config)
-{
- __DRIscreenPrivate *psp;
- psp =
- __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &radeonAPI);
- return (void *)psp;
-}
-#endif /* !defined(DRI_NEW_INTERFACE_ONLY) */
/**
* This is the bootstrap function for the driver. libGL supplies all of the
@@ -826,8 +790,7 @@ void *__driCreateScreen(Display * dpy, int scrn, __DRIscreen * psc,
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
-#ifdef USE_NEW_INTERFACE
-void *__driCreateNewScreen(__DRInativeDisplay * dpy, int scrn,
+void *__driCreateNewScreen_20050722(__DRInativeDisplay * dpy, int scrn,
__DRIscreen * psc, const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -871,7 +834,7 @@ void *__driCreateNewScreen(__DRInativeDisplay * dpy, int scrn,
return (void *)psp;
}
-#endif /* USE_NEW_INTERFACE */
+
/**
* Get information about previous buffer swaps.