diff options
author | Eric Anholt <eric@anholt.net> | 2013-09-26 10:51:29 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2013-10-24 14:04:20 -0700 |
commit | 4e54751624db7cb07cb4d36c3e683d9ed0a30016 (patch) | |
tree | 4b6ced37d1a6a696619ecb6f1608b53baed262da /include | |
parent | f93533d118b6dab00022cc9bc1448615a25946dc (diff) | |
download | mesa-4e54751624db7cb07cb4d36c3e683d9ed0a30016.tar.gz mesa-4e54751624db7cb07cb4d36c3e683d9ed0a30016.tar.bz2 mesa-4e54751624db7cb07cb4d36c3e683d9ed0a30016.zip |
dri: Implement a DRI vtable extension to replace the global driDriverAPI.
As we move to megadrivers, we are unable to build multiple drivers with
the same public global symbol per driver (Think an X Server with an intel
and a nouveau driver, and the X Server implementing indirect for both --
we have to actually talk to the right driver). By slipping the
driDriverAPI vtable into the driver's extension list, we can replace the
usage of the global symbol with usage of the loader-dlsym()ed driver
information.
v2: Pull in the hunk to avoid crashing on null driver_extensions. Thanks,
Emil!
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/GL/internal/dri_interface.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index a7afa224664..48993b93930 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -1270,4 +1270,21 @@ typedef struct __DRIconfigOptionsExtensionRec { const char *xml; } __DRIconfigOptionsExtension; +/** + * This extension provides a driver vtable to a set of common driver helper + * functions (driCoreExtension, driDRI2Extension) within the driver + * implementation, as opposed to having to pass them through a global + * variable. + * + * It is not intended to be public API to the actual loader, and the vtable + * layout may change at any time. + */ +#define __DRI_DRIVER_VTABLE "DRI_DriverVtable" +#define __DRI_DRIVER_VTABLE_VERSION 1 + +typedef struct __DRIDriverVtableExtensionRec { + __DRIextension base; + const struct __DriverAPIRec *vtable; +} __DRIDriverVtableExtension; + #endif |