Mesa (mesa_7_7_branch): st/xorg: Pass kernel driver name to drmOpen

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Tue Jan 19 16:02:58 PST 2010


Module: Mesa
Branch: mesa_7_7_branch
Commit: 65354a7e3d8fd094837b7a999e8975dcfbd9d9c9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=65354a7e3d8fd094837b7a999e8975dcfbd9d9c9

Author: Jakob Bornecrantz <jakob at vmware.com>
Date:   Tue Jan 19 17:14:19 2010 +0000

st/xorg: Pass kernel driver name to drmOpen

---

 src/gallium/state_trackers/xorg/xorg_driver.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c
index b02fe68..ed185d3 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -206,10 +206,19 @@ drv_init_drm(ScrnInfoPtr pScrn)
 		ms->PciInfo->dev, ms->PciInfo->func
 	    );
 
-	ms->fd = drmOpen(NULL, BusID);
 
-	if (ms->fd < 0)
-	    return FALSE;
+	ms->api = drm_api_create();
+	ms->fd = drmOpen(ms->api ? ms->api->driver_name : NULL, BusID);
+
+	if (ms->fd >= 0)
+	    return TRUE;
+
+	if (ms->api->destroy)
+	    ms->api->destroy(ms->api);
+
+	ms->api = NULL;
+
+	return FALSE;
     }
 
     return TRUE;
@@ -229,7 +238,6 @@ drv_init_resource_management(ScrnInfoPtr pScrn)
     if (ms->screen || ms->kms)
 	return TRUE;
 
-    ms->api = drm_api_create();
     if (ms->api) {
 	ms->screen = ms->api->create_screen(ms->api, ms->fd, NULL);
 



More information about the mesa-commit mailing list