diff options
author | Kristian Høgsberg <krh@redhat.com> | 2008-02-28 10:32:28 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2008-02-29 15:05:39 -0500 |
commit | 6cb3f5c4d8618a14bb7ad1d9df10ed7e648a7b2b (patch) | |
tree | b4fa3dcaf590e54c455aeaa8c68d2dc7897b234d /src/mesa/drivers/dri/radeon | |
parent | 16242a8007f41ab63f9a28bb9a750857c8cdb8af (diff) |
Use __DRIextension mechanism providing loader functionality to the driver.
Instead of passing in a fixed struct, the loader now passes in a list
of __DRIextension structs, to advertise the functionality it can provide
to the driver. Each extension is individually versioned and can be
extended or phased out as the interface develops.
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_context.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_ioctl.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.c | 10 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 18d9b0b65a..7aa0e3eac8 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -424,7 +424,7 @@ radeonCreateContext( const __GLcontextModes *glVisual, rmesa->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS); - (*dri_interface->getUST)( & rmesa->swap_ust ); + (*sPriv->systemTime->getUST)( & rmesa->swap_ust ); #if DO_DEBUG diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c index 2430158db2..078ac9a29a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c @@ -870,6 +870,7 @@ void radeonCopyBuffer( __DRIdrawablePrivate *dPriv, GLint nbox, i, ret; GLboolean missed_target; int64_t ust; + __DRIscreenPrivate *psp; assert(dPriv); assert(dPriv->driContextPriv); @@ -940,8 +941,9 @@ void radeonCopyBuffer( __DRIdrawablePrivate *dPriv, UNLOCK_HARDWARE( rmesa ); if (!rect) { + psp = dPriv->driScreenPriv; rmesa->swap_count++; - (*dri_interface->getUST)( & ust ); + (*psp->systemTime->getUST)( & ust ); if ( missed_target ) { rmesa->swap_missed_count++; rmesa->swap_missed_ust = ust - rmesa->swap_ust; @@ -957,12 +959,14 @@ void radeonPageFlip( __DRIdrawablePrivate *dPriv ) radeonContextPtr rmesa; GLint ret; GLboolean missed_target; + __DRIscreenPrivate *psp; assert(dPriv); assert(dPriv->driContextPriv); assert(dPriv->driContextPriv->driverPrivate); rmesa = (radeonContextPtr) dPriv->driContextPriv->driverPrivate; + psp = dPriv->driScreenPriv; if ( RADEON_DEBUG & DEBUG_IOCTL ) { fprintf(stderr, "%s: pfCurrentPage: %d\n", __FUNCTION__, @@ -990,7 +994,7 @@ void radeonPageFlip( __DRIdrawablePrivate *dPriv ) driWaitForVBlank( dPriv, & missed_target ); if ( missed_target ) { rmesa->swap_missed_count++; - (void) (*dri_interface->getUST)( & rmesa->swap_missed_ust ); + (void) (*psp->systemTime->getUST)( & rmesa->swap_missed_ust ); } LOCK_HARDWARE( rmesa ); @@ -1004,7 +1008,7 @@ void radeonPageFlip( __DRIdrawablePrivate *dPriv ) } rmesa->swap_count++; - (void) (*dri_interface->getUST)( & rmesa->swap_ust ); + (void) (*psp->systemTime->getUST)( & rmesa->swap_ust ); /* Get ready for drawing next frame. Update the renderbuffers' * flippedOffset/Pitch fields so we draw into the right place. diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 0b303b3c34..93b239ae9f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -253,8 +253,9 @@ radeonGetParam(int fd, int param, void *value) } static __GLcontextModes * -radeonFillInModes( unsigned pixel_bits, unsigned depth_bits, - unsigned stencil_bits, GLboolean have_back_buffer ) +radeonFillInModes( __DRIscreenPrivate *psp, + unsigned pixel_bits, unsigned depth_bits, + unsigned stencil_bits, GLboolean have_back_buffer ) { __GLcontextModes * modes; __GLcontextModes * m; @@ -301,7 +302,7 @@ radeonFillInModes( unsigned pixel_bits, unsigned depth_bits, fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; } - modes = (*dri_interface->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); + modes = (*psp->contextModes->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); m = modes; if ( ! driFillInModes( & m, fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, @@ -1082,7 +1083,8 @@ __GLcontextModes *__driDriverInitScreen(__DRIscreenPrivate *psp) if (!radeonInitDriver(psp)) return NULL; - return radeonFillInModes( dri_priv->bpp, + return radeonFillInModes( psp, + dri_priv->bpp, (dri_priv->bpp == 16) ? 16 : 24, (dri_priv->bpp == 16) ? 0 : 8, (dri_priv->backOffset != dri_priv->depthOffset) ); |