Mesa (main): swrast_kms: use swkmsDRI2Extension instead of driDRI2Extension

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 15 02:17:37 UTC 2022


Module: Mesa
Branch: main
Commit: 934bc2e8ca42d30376c11656a81676ed95dab24a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=934bc2e8ca42d30376c11656a81676ed95dab24a

Author: Alexander Kanavin <alex at linutronix.de>
Date:   Thu Jun  9 11:42:05 2022 +0200

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 at linutronix.de>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16942>

---

 src/gallium/frontends/dri/dri2.c       | 16 ++++++++--------
 src/gallium/frontends/dri/dri_screen.h |  4 ++--
 src/gallium/frontends/dri/dri_util.c   |  2 +-
 src/gallium/targets/dri/target.c       |  2 +-
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c
index 611ac5cd0c8..504945c6984 100644
--- a/src/gallium/frontends/dri/dri2.c
+++ b/src/gallium/frontends/dri/dri2.c
@@ -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
 };
 
diff --git a/src/gallium/frontends/dri/dri_screen.h b/src/gallium/frontends/dri/dri_screen.h
index fc7d63699c4..e01eb3d7960 100644
--- a/src/gallium/frontends/dri/dri_screen.h
+++ b/src/gallium/frontends/dri/dri_screen.h
@@ -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;
diff --git a/src/gallium/frontends/dri/dri_util.c b/src/gallium/frontends/dri/dri_util.c
index 4207eff3f43..4a6c201387e 100644
--- a/src/gallium/frontends/dri/dri_util.c
+++ b/src/gallium/frontends/dri/dri_util.c
@@ -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);
 }
 
diff --git a/src/gallium/targets/dri/target.c b/src/gallium/targets/dri/target.c
index 9b78351fa8f..e02b03b5817 100644
--- a/src/gallium/targets/dri/target.c
+++ b/src/gallium/targets/dri/target.c
@@ -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



More information about the mesa-commit mailing list