mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-21 18:30:42 +02:00
dri: Implement __DRI_DRIVER_VTABLE
We're going to switch to using this instead of doing all these weird globalDriverAPI hacks, which are fragile and weird. Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649>
This commit is contained in:
parent
9c772de270
commit
c1dc98ceec
4 changed files with 28 additions and 2 deletions
|
|
@ -2544,6 +2544,11 @@ const struct __DriverAPIRec galliumdrm_driver_api = {
|
|||
.ReleaseBuffer = dri2_release_buffer,
|
||||
};
|
||||
|
||||
static const struct __DRIDriverVtableExtensionRec galliumdrm_vtable = {
|
||||
.base = { __DRI_DRIVER_VTABLE, 1 },
|
||||
.vtable = &galliumdrm_driver_api,
|
||||
};
|
||||
|
||||
/**
|
||||
* DRI driver virtual function table.
|
||||
*
|
||||
|
|
@ -2567,6 +2572,21 @@ const __DRIextension *galliumdrm_driver_extensions[] = {
|
|||
&driImageDriverExtension.base,
|
||||
&driDRI2Extension.base,
|
||||
&gallium_config_options.base,
|
||||
&galliumdrm_vtable.base,
|
||||
NULL
|
||||
};
|
||||
|
||||
static const struct __DRIDriverVtableExtensionRec dri_kms_vtable = {
|
||||
.base = { __DRI_DRIVER_VTABLE, 1 },
|
||||
.vtable = &dri_kms_driver_api,
|
||||
};
|
||||
|
||||
const __DRIextension *dri_kms_driver_extensions[] = {
|
||||
&driCoreExtension.base,
|
||||
&driImageDriverExtension.base,
|
||||
&driDRI2Extension.base,
|
||||
&gallium_config_options.base,
|
||||
&dri_kms_vtable.base,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ void
|
|||
dri_destroy_screen(__DRIscreen * sPriv);
|
||||
|
||||
extern const struct __DriverAPIRec dri_kms_driver_api;
|
||||
|
||||
extern const __DRIextension *dri_kms_driver_extensions[];
|
||||
extern const struct __DriverAPIRec galliumdrm_driver_api;
|
||||
extern const __DRIextension *galliumdrm_driver_extensions[];
|
||||
extern const struct __DriverAPIRec galliumsw_driver_api;
|
||||
|
|
|
|||
|
|
@ -609,12 +609,18 @@ const struct __DriverAPIRec galliumsw_driver_api = {
|
|||
.CopySubBuffer = drisw_copy_sub_buffer,
|
||||
};
|
||||
|
||||
static const struct __DRIDriverVtableExtensionRec galliumsw_vtable = {
|
||||
.base = { __DRI_DRIVER_VTABLE, 1 },
|
||||
.vtable = &galliumsw_driver_api,
|
||||
};
|
||||
|
||||
/* This is the table of extensions that the loader will dlsym() for. */
|
||||
const __DRIextension *galliumsw_driver_extensions[] = {
|
||||
&driCoreExtension.base,
|
||||
&driSWRastExtension.base,
|
||||
&driCopySubBufferExtension.base,
|
||||
&gallium_config_options.base,
|
||||
&galliumsw_vtable.base,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ const __DRIextension **__driDriverGetExtensions_kms_swrast(void);
|
|||
PUBLIC const __DRIextension **__driDriverGetExtensions_kms_swrast(void)
|
||||
{
|
||||
globalDriverAPI = &dri_kms_driver_api;
|
||||
return galliumdrm_driver_extensions;
|
||||
return dri_kms_driver_extensions;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue