targets/egl: Check against drm_driver_descriptor::name.
authorChia-I Wu <olv@lunarg.com>
Mon, 23 Aug 2010 15:03:51 +0000 (23:03 +0800)
committerChia-I Wu <olv@lunarg.com>
Tue, 24 Aug 2010 03:50:36 +0000 (11:50 +0800)
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
src/gallium/targets/egl/pipe_r300.c
src/gallium/targets/egl/pipe_r600.c

index d9d89485c3cde1c40a7c9752215c3e0354410e5f..a573b212179195712916e0b45685177a73c2cad1 100644 (file)
@@ -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) {
index 2fa495e8a2fb6d1a5a412bcf13700eab5373fce4..d84bb92539aeb73e1aebd93343ecefe19e84e0bc 100644 (file)
@@ -24,4 +24,4 @@ create_screen(int fd)
 }
 
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("r300", "r300", create_screen)
+DRM_DRIVER_DESCRIPTOR("r300", "radeon", create_screen)
index c35a0b09b992e6576fc00b30417f1d2f490ac53c..486a659258571d509a111684b22bfad8ded158fd 100644 (file)
@@ -24,4 +24,4 @@ create_screen(int fd)
 }
 
 PUBLIC
-DRM_DRIVER_DESCRIPTOR("r600", "r600", create_screen)
+DRM_DRIVER_DESCRIPTOR("r600", "radeon", create_screen)