summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/radeon/radeon_screen.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2013-09-27 16:32:40 -0700
committerEric Anholt <[email protected]>2013-10-24 14:13:09 -0700
commit86d50c2f1567eebd193ac797a49c58c969646787 (patch)
treeea4c6298494f67b5feeff2c32652c42689303753 /src/mesa/drivers/dri/radeon/radeon_screen.c
parent6665b71b22c265a318ff76178cc27732512791a8 (diff)
radeon: Build the driver into the shared mesa_dri_drivers.so.
This required some reordering of headers to ensure that the symbol name redefines happened before any prototypes. v2: drop dridir now that it's unused. v3: Consistently put spaces around += in the updated Makefile.am blocks. v4: Set a global driverAPI variable so loaders don't have to update to createNewScreen2() (though they may want to for thread safety). Reviewed-by: Matt Turner <[email protected]> (v2) Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_screen.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index b0cc2d7084c..15bf5f859ae 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -764,7 +764,7 @@ __DRIconfig **radeonInitScreen2(__DRIscreen *psp)
return (const __DRIconfig **)configs;
}
-const struct __DriverAPIRec driDriverAPI = {
+static const struct __DriverAPIRec radeon_driver_api = {
.InitScreen = radeonInitScreen2,
.DestroyScreen = radeonDestroyScreen,
#if defined(RADEON_R200)
@@ -780,10 +780,32 @@ const struct __DriverAPIRec driDriverAPI = {
.UnbindContext = radeonUnbindContext,
};
+static const struct __DRIDriverVtableExtensionRec radeon_vtable = {
+ .base = { __DRI_DRIVER_VTABLE, 1 },
+ .vtable = &radeon_driver_api,
+};
+
/* This is the table of extensions that the loader will dlsym() for. */
-PUBLIC const __DRIextension *__driDriverExtensions[] = {
+static const __DRIextension *radeon_driver_extensions[] = {
&driCoreExtension.base,
&driDRI2Extension.base,
&radeon_config_options.base,
+ &radeon_vtable.base,
NULL
};
+
+#ifdef RADEON_R200
+PUBLIC const __DRIextension **__driDriverGetExtensions_r200(void)
+{
+ globalDriverAPI = &radeon_driver_api;
+
+ return radeon_driver_extensions;
+}
+#else
+PUBLIC const __DRIextension **__driDriverGetExtensions_radeon(void)
+{
+ globalDriverAPI = &radeon_driver_api;
+
+ return radeon_driver_extensions;
+}
+#endif