summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r200
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/r200')
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.c14
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.h1
-rw-r--r--src/mesa/drivers/dri/r200/r200_ioctl.c6
-rw-r--r--src/mesa/drivers/dri/r200/r200_screen.c24
4 files changed, 15 insertions, 30 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index 7c543a55ec..06834fb626 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -249,14 +249,6 @@ static const struct dri_debug_control debug_control[] =
};
-static int
-get_ust_nop( int64_t * ust )
-{
- *ust = 1;
- return 0;
-}
-
-
/* Create the device specific rendering context.
*/
GLboolean r200CreateContext( const __GLcontextModes *glVisual,
@@ -509,11 +501,7 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
rmesa->prefer_gart_client_texturing =
(getenv("R200_GART_CLIENT_TEXTURES") != 0);
- rmesa->get_ust = (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" );
- if ( rmesa->get_ust == NULL ) {
- rmesa->get_ust = get_ust_nop;
- }
- (*rmesa->get_ust)( & rmesa->swap_ust );
+ (*dri_interface->getUST)( & rmesa->swap_ust );
#if DO_DEBUG
diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h
index 5e3fb2295d..8169af709b 100644
--- a/src/mesa/drivers/dri/r200/r200_context.h
+++ b/src/mesa/drivers/dri/r200/r200_context.h
@@ -912,7 +912,6 @@ struct r200_context {
GLuint swap_count;
GLuint swap_missed_count;
- PFNGLXGETUSTPROC get_ust;
/* r200_tcl.c
*/
diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c
index ad43158d64..a2336ce4f3 100644
--- a/src/mesa/drivers/dri/r200/r200_ioctl.c
+++ b/src/mesa/drivers/dri/r200/r200_ioctl.c
@@ -486,7 +486,7 @@ void r200CopyBuffer( const __DRIdrawablePrivate *dPriv )
rmesa->hw.all_dirty = GL_TRUE;
rmesa->swap_count++;
- (*rmesa->get_ust)( & ust );
+ (*dri_interface->getUST)( & ust );
if ( missed_target ) {
rmesa->swap_missed_count++;
rmesa->swap_missed_ust = ust - rmesa->swap_ust;
@@ -540,7 +540,7 @@ void r200PageFlip( const __DRIdrawablePrivate *dPriv )
driWaitForVBlank( dPriv, & rmesa->vbl_seq, rmesa->vblank_flags, & missed_target );
if ( missed_target ) {
rmesa->swap_missed_count++;
- (void) (*rmesa->get_ust)( & rmesa->swap_missed_ust );
+ (void) (*dri_interface->getUST)( & rmesa->swap_missed_ust );
}
LOCK_HARDWARE( rmesa );
@@ -554,7 +554,7 @@ void r200PageFlip( const __DRIdrawablePrivate *dPriv )
}
rmesa->swap_count++;
- (void) (*rmesa->get_ust)( & rmesa->swap_ust );
+ (void) (*dri_interface->getUST)( & rmesa->swap_ust );
if ( rmesa->sarea->pfCurrentPage == 1 ) {
rmesa->state.color.drawOffset = rmesa->r200Screen->frontOffset;
diff --git a/src/mesa/drivers/dri/r200/r200_screen.c b/src/mesa/drivers/dri/r200/r200_screen.c
index 014818ac1b..ddb3a91b1d 100644
--- a/src/mesa/drivers/dri/r200/r200_screen.c
+++ b/src/mesa/drivers/dri/r200/r200_screen.c
@@ -136,7 +136,6 @@ static const GLuint __driNConfigOptions = 17;
#endif
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static r200ScreenPtr __r200Screen;
@@ -191,7 +190,7 @@ r200FillInModes( unsigned pixel_bits, unsigned depth_bits,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes = (*create_context_modes)( num_modes, sizeof( __GLcontextModes ) );
+ modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) );
m = modes;
if ( ! driFillInModes( & m, fb_format, fb_type,
depth_bits_array, stencil_bits_array, depth_buffer_factor,
@@ -232,7 +231,7 @@ r200CreateScreen( __DRIscreenPrivate *sPriv )
RADEONDRIPtr dri_priv = (RADEONDRIPtr)sPriv->pDevPriv;
unsigned char *RADEONMMIO;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress( (const GLubyte *) "__glXScrEnableExtension" );
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
@@ -643,7 +642,7 @@ static const struct __DriverAPIRec r200API = {
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
@@ -651,6 +650,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
@@ -659,6 +659,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 5, 0 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions3( "R200",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -671,15 +673,11 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn, __DRIsc
frame_buffer, pSAREA, fd,
internal_api_version, &r200API);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
- RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
- *driver_modes = r200FillInModes( dri_priv->bpp,
- (dri_priv->bpp == 16) ? 16 : 24,
- (dri_priv->bpp == 16) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
- }
+ RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
+ *driver_modes = r200FillInModes( dri_priv->bpp,
+ (dri_priv->bpp == 16) ? 16 : 24,
+ (dri_priv->bpp == 16) ? 0 : 8,
+ (dri_priv->backOffset != dri_priv->depthOffset) );
}
return (void *) psp;