summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/unichrome
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/unichrome')
-rw-r--r--src/mesa/drivers/dri/unichrome/via_context.c15
-rw-r--r--src/mesa/drivers/dri/unichrome/via_context.h1
-rw-r--r--src/mesa/drivers/dri/unichrome/via_ioctl.c6
-rw-r--r--src/mesa/drivers/dri/unichrome/via_screen.c22
4 files changed, 14 insertions, 30 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c
index 4d67328671..ca31245b0f 100644
--- a/src/mesa/drivers/dri/unichrome/via_context.c
+++ b/src/mesa/drivers/dri/unichrome/via_context.c
@@ -342,12 +342,6 @@ FreeBuffer(struct via_context *vmesa)
via_free_dma_buffer(vmesa);
}
-static int
-get_ust_nop( int64_t * ust )
-{
- *ust = 1;
- return 0;
-}
GLboolean
viaCreateContext(const __GLcontextModes *visual,
@@ -563,13 +557,8 @@ viaCreateContext(const __GLcontextModes *visual,
if (getenv("VIA_PAGEFLIP"))
vmesa->allowPageFlip = 1;
-
- vmesa->get_ust =
- (PFNGLXGETUSTPROC) glXGetProcAddress( (const GLubyte *) "__glXGetUST" );
- if ( vmesa->get_ust == NULL ) {
- vmesa->get_ust = get_ust_nop;
- }
- vmesa->get_ust( &vmesa->swap_ust );
+
+ (*dri_interface->getUST)( &vmesa->swap_ust );
vmesa->regMMIOBase = (GLuint *)((GLuint)viaScreen->reg);
diff --git a/src/mesa/drivers/dri/unichrome/via_context.h b/src/mesa/drivers/dri/unichrome/via_context.h
index 54460d56f5..a4b1afc02b 100644
--- a/src/mesa/drivers/dri/unichrome/via_context.h
+++ b/src/mesa/drivers/dri/unichrome/via_context.h
@@ -320,7 +320,6 @@ struct via_context {
GLuint swap_count;
GLuint swap_missed_count;
- PFNGLXGETUSTPROC get_ust;
GLuint pfCurrentOffset;
GLboolean allowPageFlip;
diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c
index 651c5f6e31..435fd20f77 100644
--- a/src/mesa/drivers/dri/unichrome/via_ioctl.c
+++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c
@@ -512,7 +512,7 @@ static void viaWaitIdleVBlank( const __DRIdrawablePrivate *dPriv,
vmesa->vblank_flags, & missed_target );
if ( missed_target ) {
vmesa->swap_missed_count++;
- vmesa->get_ust( &vmesa->swap_missed_ust );
+ (*dri_interface->getUST)( &vmesa->swap_missed_ust );
}
}
while (!viaCheckBreadcrumb(vmesa, value));
@@ -615,7 +615,7 @@ void viaCopyBuffer(const __DRIdrawablePrivate *dPriv)
viaEmitBreadcrumbLocked(vmesa);
UNLOCK_HARDWARE(vmesa);
- vmesa->get_ust( &vmesa->swap_ust );
+ (*dri_interface->getUST)( &vmesa->swap_ust );
}
@@ -639,7 +639,7 @@ void viaPageFlip(const __DRIdrawablePrivate *dPriv)
viaEmitBreadcrumbLocked(vmesa);
UNLOCK_HARDWARE(vmesa);
- vmesa->get_ust( &vmesa->swap_ust );
+ (*dri_interface->getUST)( &vmesa->swap_ust );
/* KW: FIXME: When buffers are freed, could free frontbuffer by
diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c
index 4115434cf2..8de7353925 100644
--- a/src/mesa/drivers/dri/unichrome/via_screen.c
+++ b/src/mesa/drivers/dri/unichrome/via_screen.c
@@ -62,8 +62,6 @@ DRI_CONF_END;
static const GLuint __driNConfigOptions = 3;
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
-
static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo );
static drmBufMapPtr via_create_empty_buffers(void)
@@ -99,8 +97,7 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
viaScreenPrivate *viaScreen;
VIADRIPtr gDRIPriv = (VIADRIPtr)sPriv->pDevPriv;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) glXGetProcAddress(
- (const GLubyte *) "__glXScrEnableExtension" );
+ (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
void * const psc = sPriv->psc->screenConfigs;
@@ -368,7 +365,7 @@ viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer )
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,
@@ -405,7 +402,7 @@ viaFillInModes( unsigned pixel_bits, GLboolean have_back_buffer )
* failure.
*/
PUBLIC
-void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn,
+void * __driCreateNewScreen_20050725( __DRInativeDisplay *dpy, int scrn,
__DRIscreen *psc,
const __GLcontextModes * modes,
const __DRIversion * ddx_version,
@@ -414,6 +411,7 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd,
int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes )
{
@@ -422,6 +420,8 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn,
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 2, 3, 0 };
+ dri_interface = interface;
+
if ( ! driCheckDriDdxDrmVersions2( "Unichrome",
dri_version, & dri_expected,
ddx_version, & ddx_expected,
@@ -434,13 +434,9 @@ void * __driCreateNewScreen_20050722( __DRInativeDisplay *dpy, int scrn,
frame_buffer, pSAREA, fd,
internal_api_version, &viaAPI);
if ( psp != NULL ) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress( (const GLubyte *) "__glXCreateContextModes" );
- if ( create_context_modes != NULL ) {
- VIADRIPtr dri_priv = (VIADRIPtr) psp->pDevPriv;
- *driver_modes = viaFillInModes( dri_priv->bytesPerPixel * 8,
- GL_TRUE );
- }
+ VIADRIPtr dri_priv = (VIADRIPtr) psp->pDevPriv;
+ *driver_modes = viaFillInModes( dri_priv->bytesPerPixel * 8,
+ GL_TRUE );
}
fprintf(stderr, "%s - succeeded\n", __FUNCTION__);