summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2007-05-16 14:10:29 -0400
committerKristian Høgsberg <[email protected]>2007-10-11 11:09:57 -0400
commit78a6aa57a0155d72280dd91c05513c847bf76f3b (patch)
treef007653457bdcff728af99fda719b574c20a2575 /src/mesa
parentefaf90b03e8b69e04909bce071f8ef6b65cc0e9d (diff)
Move GLX_MESA_allocate_memory related functions to new extension mechanism.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i915/intel_screen.c8
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c26
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.h2
3 files changed, 25 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c
index f507a3bf05f..27bf5e12a20 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -419,9 +419,17 @@ intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen,
intelPrintSAREA(sarea);
}
+static const __DRIallocateExtension intelAllocateExtension = {
+ { __DRI_ALLOCATE },
+ intelAllocateMemoryMESA,
+ intelFreeMemoryMESA,
+ intelGetMemoryOffsetMESA
+};
+
static const __DRIextension *intelExtensions[] = {
&driCopySubBufferExtension.base,
&driSwapControlExtension.base,
+ &intelAllocateExtension.base,
NULL
};
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 46160babb01..362d70f9e57 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -332,6 +332,17 @@ radeonFillInModes( unsigned pixel_bits, unsigned depth_bits,
return modes;
}
+#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
+
+static const __DRIallocateExtension r200AllocateExtension = {
+ { __DRI_ALLOCATE },
+ r200AllocateMemoryMESA,
+ r200FreeMemoryMESA,
+ r200GetMemoryOffsetMESA
+};
+
+#endif
+
/* Create the device specific screen private data struct.
*/
static radeonScreenPtr
@@ -741,22 +752,17 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv )
}
(*glx_enable_extension)( sPriv->psc, "GLX_MESA_swap_frame_usage" );
- if (IS_R200_CLASS(screen))
- (*glx_enable_extension)( sPriv->psc, "GLX_MESA_allocate_memory" );
-
(*glx_enable_extension)( sPriv->psc, "GLX_SGI_make_current_read" );
}
- screen->extensions[i++] = NULL;
- sPriv->extensions = screen->extensions;
#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
- if (IS_R200_CLASS(screen)) {
- sPriv->psc->allocateMemory = (void *) r200AllocateMemoryMESA;
- sPriv->psc->freeMemory = (void *) r200FreeMemoryMESA;
- sPriv->psc->memoryOffset = (void *) r200GetMemoryOffsetMESA;
- }
+ if (IS_R200_CLASS(screen))
+ screen->extensions[i++] = &r200AllocateExtension.base;
#endif
+ screen->extensions[i++] = NULL;
+ sPriv->extensions = screen->extensions;
+
screen->driScreen = sPriv;
screen->sarea_priv_offset = dri_priv->sarea_priv_offset;
return screen;
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.h b/src/mesa/drivers/dri/radeon/radeon_screen.h
index eceab53f5f5..954096f6770 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.h
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.h
@@ -104,7 +104,7 @@ typedef struct {
/* Configuration cache with default values for all contexts */
driOptionCache optionCache;
- const __DRIextension *extensions[3];
+ const __DRIextension *extensions[4];
} radeonScreenRec, *radeonScreenPtr;
#define IS_R100_CLASS(screen) \