Mesa (master): egl_dri2: add nouveau support.

Dave Airlie airlied at kemper.freedesktop.org
Sun Feb 13 22:01:11 UTC 2011


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Feb 14 07:52:26 2011 +1000

egl_dri2: add nouveau support.

but really wtf? all these PCI IDs need to be ripped out of here, its totally
unscalable and the drivers already have this info so could export it some better way.

tested by Darxus on #wayland.

---

 src/egl/drivers/dri2/platform_drm.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index 42939a5..a25cad6 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -565,6 +565,7 @@ const struct dri2_driver_map driver_map[] = {
    { 0x1002, "r200", r200_chip_ids, ARRAY_SIZE(r200_chip_ids) },
    { 0x1002, "r300", r300_chip_ids, ARRAY_SIZE(r300_chip_ids) },
    { 0x1002, "r600", r600_chip_ids, ARRAY_SIZE(r600_chip_ids) },
+   { 0x10de, "nouveau", NULL, -1 },
 };
 
 char *
@@ -605,6 +606,13 @@ dri2_get_driver_for_fd(int fd)
    for (i = 0; i < ARRAY_SIZE(driver_map); i++) {
       if (vendor_id != driver_map[i].vendor_id)
 	 continue;
+      if (driver_map[i].num_chips_ids == -1) {
+	    driver = strdup(driver_map[i].driver);
+	    _eglLog(_EGL_DEBUG, "pci id for %d: %04x:%04x, driver %s",
+		    fd, vendor_id, chip_id, driver);
+	    goto out;
+      }
+
       for (j = 0; j < driver_map[i].num_chips_ids; j++)
 	 if (driver_map[i].chip_ids[j] == chip_id) {
 	    driver = strdup(driver_map[i].driver);




More information about the mesa-commit mailing list