swrast_kms: use swkmsDRI2Extension instead of driDRI2Extension

This set of changes:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15649

caused a regression in Xorg when using swrast_kms:
   (EE) AIGLX error: Calling driver entry point failed

This commit changes the swrast_kms driver to use a dedicated screen init function
(which I believe was overlooked); I also took the opportunity to rename the
associated plumbling to have swrast-specific names.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16942>
This commit is contained in:
Alexander Kanavin 2022-06-09 11:42:05 +02:00 committed by Marge Bot
parent fd91295473
commit 934bc2e8ca
4 changed files with 12 additions and 12 deletions

View File

@ -2507,7 +2507,7 @@ release_pipe:
* Returns the struct gl_config supported by this driver.
*/
static const __DRIconfig **
dri_kms_init_screen(__DRIscreen * sPriv)
dri_swrast_kms_init_screen(__DRIscreen * sPriv)
{
#if defined(GALLIUM_SOFTPIPE)
const __DRIconfig **configs;
@ -2611,8 +2611,8 @@ static const struct __DRIDriverVtableExtensionRec galliumdrm_vtable = {
* hook. The latter is used to explicitly initialise the kms_swrast driver
* rather than selecting the approapriate driver as suggested by the loader.
*/
const struct __DriverAPIRec dri_kms_driver_api = {
.InitScreen = dri_kms_init_screen,
const struct __DriverAPIRec dri_swrast_kms_driver_api = {
.InitScreen = dri_swrast_kms_init_screen,
.DestroyScreen = dri_destroy_screen,
.CreateBuffer = dri2_create_buffer,
.DestroyBuffer = dri_destroy_buffer,
@ -2631,17 +2631,17 @@ const __DRIextension *galliumdrm_driver_extensions[] = {
NULL
};
static const struct __DRIDriverVtableExtensionRec dri_kms_vtable = {
static const struct __DRIDriverVtableExtensionRec dri_swrast_kms_vtable = {
.base = { __DRI_DRIVER_VTABLE, 1 },
.vtable = &dri_kms_driver_api,
.vtable = &dri_swrast_kms_driver_api,
};
const __DRIextension *dri_kms_driver_extensions[] = {
const __DRIextension *dri_swrast_kms_driver_extensions[] = {
&driCoreExtension.base,
&driImageDriverExtension.base,
&driDRI2Extension.base,
&swkmsDRI2Extension.base,
&gallium_config_options.base,
&dri_kms_vtable.base,
&dri_swrast_kms_vtable.base,
NULL
};

View File

@ -165,8 +165,8 @@ dri_destroy_screen_helper(struct dri_screen * screen);
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 dri_swrast_kms_driver_api;
extern const __DRIextension *dri_swrast_kms_driver_extensions[];
extern const struct __DriverAPIRec galliumdrm_driver_api;
extern const __DRIextension *galliumdrm_driver_extensions[];
extern const struct __DriverAPIRec galliumsw_driver_api;

View File

@ -191,7 +191,7 @@ swkmsCreateNewScreen(int scrn, int fd,
const __DRIconfig ***driver_configs, void *data)
{
return driCreateNewScreen2(scrn, fd, extensions,
dri_kms_driver_extensions,
dri_swrast_kms_driver_extensions,
driver_configs, data);
}

View File

@ -25,7 +25,7 @@ const __DRIextension **__driDriverGetExtensions_kms_swrast(void);
PUBLIC const __DRIextension **__driDriverGetExtensions_kms_swrast(void)
{
return dri_kms_driver_extensions;
return dri_swrast_kms_driver_extensions;
}
#endif