kern/95703: i915 DRI driver doesn't work

Dmitriy Marchenko _pppp at mail.ru
Thu Apr 13 16:40:25 UTC 2006


>Number:         95703
>Category:       kern
>Synopsis:       i915 DRI driver doesn't work
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 13 16:40:14 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Dmitriy Marchenko
>Release:        RELENG_6
>Organization:
AGAVA Software
>Environment:
FreeBSD pppp.home 6.1-RC FreeBSD 6.1-RC #1: Wed Apr 12 00:54:24 MSD 2006     root at pppp.home:/home/tmp/usr/obj/home/tmp/usr/src/sys/PPPP  i386

>Description:
Eric Anholt commited the i915 DRI driver to RELENG_6. I was one of the testers last autumn. The driver doesn't actually work without a patch (provided in the "Fix" section). It would be a nice idea to have a working driver in 6.1 release; not only announce the new feature which doesn't actually work.
>How-To-Repeat:
Run X server on any modern Intel integrated graphics card.
The driver will attach as /dev/dri/card1 instead of /dev/dri/card0 and hardware acceleration won't work.
>Fix:
Apply the following patch:

diff -ur dev/drm.orig/drm_drv.c dev/drm/drm_drv.c
--- dev/drm.orig/drm_drv.c      Wed Nov 30 16:22:19 2005
+++ dev/drm/drm_drv.c   Wed Nov 30 18:08:54 2005
@@ -149,9 +149,15 @@
 {
        drm_pci_id_list_t *id_entry;
        int vendor, device;
+       device_t realdev;

-       vendor = pci_get_vendor(dev);
-       device = pci_get_device(dev);
+       if (!strcmp(device_get_name(dev), "drmsub"))
+               realdev = device_get_parent(dev);
+       else
+               realdev = dev;
+
+       vendor = pci_get_vendor(realdev);
+       device = pci_get_device(realdev);

        id_entry = drm_find_description(vendor, device, idlist);
        if (id_entry != NULL) {
@@ -167,14 +173,17 @@
        drm_device_t *dev;
        drm_pci_id_list_t *id_entry;
        int unit;
+       int subdevice = 0;
+       device_t parentdev = device_get_parent( nbdev );

        unit = device_get_unit(nbdev);
        dev = device_get_softc(nbdev);

-       if (!strcmp(device_get_name(nbdev), "drmsub"))
-               dev->device = device_get_parent(nbdev);
-       else
-               dev->device = nbdev;
+       if (!strcmp(device_get_name(nbdev), "drmsub")) {
+               parentdev = device_get_parent(nbdev);
+               subdevice = 1;
+       }
+       dev->device = subdevice ? parentdev : nbdev;

        dev->devnode = make_dev(&drm_cdevsw,
                        unit,
@@ -186,8 +195,9 @@
        mtx_init(&dev->dev_lock, "drm device", NULL, MTX_DEF);
 #endif

-       id_entry = drm_find_description(pci_get_vendor(nbdev),
-           pci_get_device(nbdev), idlist);
+       id_entry = drm_find_description(
+                       pci_get_vendor(subdevice ? parentdev : nbdev),
+                       pci_get_device(subdevice ? parentdev : nbdev), idlist);
        dev->id_entry = id_entry;

        return drm_load(dev);
@@ -519,8 +529,9 @@
        }

        if (dev->driver.use_agp) {
-               if (drm_device_is_agp(dev))
-                       dev->agp = drm_agp_init();
+               if (drm_device_is_agp(dev) ||
+                       !strcmp(device_get_name(dev->device), "agp"))
+                               dev->agp = drm_agp_init();
                if (dev->driver.require_agp && dev->agp == NULL) {
                        DRM_ERROR("Card isn't AGP, or couldn't initialize "
                            "AGP.\n");
diff -ur dev/drm.orig/i915_drv.c dev/drm/i915_drv.c
--- dev/drm.orig/i915_drv.c     Wed Nov 30 16:22:19 2005
+++ dev/drm/i915_drv.c  Wed Nov 30 16:28:20 2005
@@ -104,7 +104,7 @@
 };

 extern devclass_t drm_devclass;
-DRIVER_MODULE(i915, pci, i915_driver, drm_devclass, 0, 0);
+DRIVER_MODULE(i915, agp, i915_driver, drm_devclass, 0, 0);
 MODULE_DEPEND(i915, drm, 1, 1, 1);

 #elif defined(__NetBSD__) || defined(__OpenBSD__)


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list