Mesa (master): targets/egl: Check against drm_driver_descriptor::name.

Chia-I Wu olv at kemper.freedesktop.org
Tue Aug 24 03:52:25 UTC 2010


Module: Mesa
Branch: master
Commit: 65741c596f9c89ee25dfa4eb910a48140d22515b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=65741c596f9c89ee25dfa4eb910a48140d22515b

Author: Chia-I Wu <olv at lunarg.com>
Date:   Mon Aug 23 23:03:51 2010 +0800

targets/egl: Check against drm_driver_descriptor::name.

drm_driver_descriptor::driver_name is defined to be the name of the
kernel module.  We should check against drm_driver_descriptor::name
instead of drm_driver_descriptor::driver_name.

---

 src/gallium/targets/egl/egl.c       |   27 +++++++++++++--------------
 src/gallium/targets/egl/pipe_r300.c |    2 +-
 src/gallium/targets/egl/pipe_r600.c |    2 +-
 3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/src/gallium/targets/egl/egl.c b/src/gallium/targets/egl/egl.c
index d9d8948..a573b21 100644
--- a/src/gallium/targets/egl/egl.c
+++ b/src/gallium/targets/egl/egl.c
@@ -155,24 +155,23 @@ load_pipe_module(struct pipe_module *pmod, const char *name)
    if (!pmod->name)
       return FALSE;
 
+   _eglLog(_EGL_DEBUG, "searching for pipe module %s", pmod->name);
    _eglSearchPathForEach(dlopen_pipe_module_cb, (void *) pmod);
    if (pmod->lib) {
       pmod->drmdd = (const struct drm_driver_descriptor *)
          util_dl_get_proc_address(pmod->lib, "driver_descriptor");
-      if (pmod->drmdd) {
-         if (pmod->drmdd->driver_name) {
-            /* driver name mismatch */
-            if (strcmp(pmod->drmdd->driver_name, pmod->name) != 0)
-               pmod->drmdd = NULL;
-         }
-         else {
-            /* swrast */
-            pmod->swrast_create_screen =
-               (struct pipe_screen *(*)(struct sw_winsys *))
-               util_dl_get_proc_address(pmod->lib, "swrast_create_screen");
-            if (!pmod->swrast_create_screen)
-               pmod->drmdd = NULL;
-         }
+
+      /* sanity check on the name */
+      if (pmod->drmdd && strcmp(pmod->drmdd->name, pmod->name) != 0)
+         pmod->drmdd = NULL;
+
+      /* swrast */
+      if (pmod->drmdd && !pmod->drmdd->driver_name) {
+         pmod->swrast_create_screen =
+            (struct pipe_screen *(*)(struct sw_winsys *))
+            util_dl_get_proc_address(pmod->lib, "swrast_create_screen");
+         if (!pmod->swrast_create_screen)
+            pmod->drmdd = NULL;
       }
 
       if (!pmod->drmdd) {
diff --git a/src/gallium/targets/egl/pipe_r300.c b/src/gallium/targets/egl/pipe_r300.c
index 2fa495e..d84bb92 100644
--- a/src/gallium/targets/egl/pipe_r300.c
+++ b/src/gallium/targets/egl/pipe_r300.c
@@ -24,4 +24,4 @@ create_screen(int fd)
 }
 
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("r300", "r300", create_screen)
+DRM_DRIVER_DESCRIPTOR("r300", "radeon", create_screen)
diff --git a/src/gallium/targets/egl/pipe_r600.c b/src/gallium/targets/egl/pipe_r600.c
index c35a0b0..486a659 100644
--- a/src/gallium/targets/egl/pipe_r600.c
+++ b/src/gallium/targets/egl/pipe_r600.c
@@ -24,4 +24,4 @@ create_screen(int fd)
 }
 
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("r600", "r600", create_screen)
+DRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen)




More information about the mesa-commit mailing list