summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/r300')
-rw-r--r--src/mesa/drivers/dri/r300/radeon_context.c14
-rw-r--r--src/mesa/drivers/dri/r300/radeon_context.h1
-rw-r--r--src/mesa/drivers/dri/r300/radeon_ioctl.c6
-rw-r--r--src/mesa/drivers/dri/r300/radeon_screen.c32
4 files changed, 18 insertions, 35 deletions
diff --git a/src/mesa/drivers/dri/r300/radeon_context.c b/src/mesa/drivers/dri/r300/radeon_context.c
index 8c712dc203..97507617cd 100644
--- a/src/mesa/drivers/dri/r300/radeon_context.c
+++ b/src/mesa/drivers/dri/r300/radeon_context.c
@@ -124,12 +124,6 @@ static void radeonInitDriverFuncs(struct dd_function_table *functions)
}
-static int get_ust_nop(int64_t * ust)
-{
- *ust = 1;
- return 0;
-}
-
/**
* Create and initialize all common fields of the context,
* including the Mesa context itself.
@@ -195,13 +189,7 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
radeon->vblank_flags = (radeon->radeonScreen->irq != 0)
? driGetDefaultVBlankFlags(&radeon->optionCache) : VBLANK_FLAG_NO_IRQ;
- radeon->get_ust =
- (PFNGLXGETUSTPROC) glXGetProcAddress((const GLubyte *)
- "__glXGetUST");
- if (radeon->get_ust == NULL) {
- radeon->get_ust = get_ust_nop;
- }
- (*radeon->get_ust) (&radeon->swap_ust);
+ (*dri_interface->getUST) (&radeon->swap_ust);
return GL_TRUE;
}
diff --git a/src/mesa/drivers/dri/r300/radeon_context.h b/src/mesa/drivers/dri/r300/radeon_context.h
index 84fcaee718..189bc6ad02 100644
--- a/src/mesa/drivers/dri/r300/radeon_context.h
+++ b/src/mesa/drivers/dri/r300/radeon_context.h
@@ -196,7 +196,6 @@ struct radeon_context {
GLuint swap_count;
GLuint swap_missed_count;
- PFNGLXGETUSTPROC get_ust;
/* Derived state */
struct radeon_state state;
diff --git a/src/mesa/drivers/dri/r300/radeon_ioctl.c b/src/mesa/drivers/dri/r300/radeon_ioctl.c
index 1f2f71c29a..af489e2a84 100644
--- a/src/mesa/drivers/dri/r300/radeon_ioctl.c
+++ b/src/mesa/drivers/dri/r300/radeon_ioctl.c
@@ -208,7 +208,7 @@ void radeonCopyBuffer(const __DRIdrawablePrivate * dPriv)
((r300ContextPtr)radeon)->hw.all_dirty = GL_TRUE;
radeon->swap_count++;
- (*radeon->get_ust) (&ust);
+ (*dri_interface->getUST) (&ust);
if (missed_target) {
radeon->swap_missed_count++;
radeon->swap_missed_ust = ust - radeon->swap_ust;
@@ -266,7 +266,7 @@ void radeonPageFlip(const __DRIdrawablePrivate * dPriv)
&missed_target);
if (missed_target) {
radeon->swap_missed_count++;
- (void)(*radeon->get_ust) (&radeon->swap_missed_ust);
+ (void)(*dri_interface->getUST) (&radeon->swap_missed_ust);
}
LOCK_HARDWARE(radeon);
@@ -280,7 +280,7 @@ void radeonPageFlip(const __DRIdrawablePrivate * dPriv)
}
radeon->swap_count++;
- (void)(*radeon->get_ust) (&radeon->swap_ust);
+ (void)(*dri_interface->getUST) (&radeon->swap_ust);
if (radeon->sarea->pfCurrentPage == 1) {
radeon->state.color.drawOffset = radeon->radeonScreen->frontOffset;
diff --git a/src/mesa/drivers/dri/r300/radeon_screen.c b/src/mesa/drivers/dri/r300/radeon_screen.c
index ea9b9ea266..34f5d84e36 100644
--- a/src/mesa/drivers/dri/r300/radeon_screen.c
+++ b/src/mesa/drivers/dri/r300/radeon_screen.c
@@ -216,7 +216,6 @@ static const struct dri_debug_control debug_control[] = {
#define PCI_CHIP_R420_JK 0x4a4b
#endif
-static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
static radeonScreenPtr __radeonScreen;
@@ -271,7 +270,7 @@ static __GLcontextModes *radeonFillInModes(unsigned pixel_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,
@@ -312,7 +311,7 @@ static radeonScreenPtr radeonCreateScreen(__DRIscreenPrivate * sPriv)
unsigned char *RADEONMMIO;
PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
(PFNGLXSCRENABLEEXTENSIONPROC)
- glXGetProcAddress((const GLubyte *) "__glXScrEnableExtension");
+ (*dri_interface->getProcAddress("glxEnableExtension"));
void *const psc = sPriv->psc->screenConfigs;
@@ -790,13 +789,14 @@ static const struct __DriverAPIRec radeonAPI = {
* \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
* failure.
*/
-void *__driCreateNewScreen_20050722(__DRInativeDisplay * dpy, int scrn,
+void *__driCreateNewScreen_20050725(__DRInativeDisplay * dpy, int scrn,
__DRIscreen * psc, const __GLcontextModes * modes,
const __DRIversion * ddx_version,
const __DRIversion * dri_version,
const __DRIversion * drm_version,
const __DRIframebuffer * frame_buffer,
drmAddress pSAREA, int fd, int internal_api_version,
+ const __DRIinterfaceMethods * interface,
__GLcontextModes ** driver_modes)
{
__DRIscreenPrivate *psp;
@@ -804,6 +804,8 @@ void *__driCreateNewScreen_20050722(__DRInativeDisplay * dpy, int scrn,
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 11, 1 };
+ dri_interface = interface;
+
if (!driCheckDriDdxDrmVersions3("R300",
dri_version, &dri_expected,
ddx_version, &ddx_expected,
@@ -816,20 +818,14 @@ void *__driCreateNewScreen_20050722(__DRInativeDisplay * dpy, int scrn,
frame_buffer, pSAREA, fd,
internal_api_version, &radeonAPI);
if (psp != NULL) {
- create_context_modes = (PFNGLXCREATECONTEXTMODES)
- glXGetProcAddress((const GLubyte *)
- "__glXCreateContextModes");
- if (create_context_modes != NULL) {
- RADEONDRIPtr dri_priv = (RADEONDRIPtr) psp->pDevPriv;
- *driver_modes = radeonFillInModes(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 = radeonFillInModes(dri_priv->bpp,
+ (dri_priv->bpp ==
+ 16) ? 16 : 24,
+ (dri_priv->bpp ==
+ 16) ? 0 : 8,
+ (dri_priv->backOffset !=
+ dri_priv->depthOffset));
}
return (void *)psp;