Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jan 2005 04:32:23 GMT
From:      Alex <lesha@intercaf.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/76879: ports/dri:  for some reason drm.ko PCI vendor/device id detection is broken
Message-ID:  <200501310432.j0V4WNiI051778@www.freebsd.org>
Resent-Message-ID: <200501310440.j0V4eMpK079427@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         76879
>Category:       ports
>Synopsis:       ports/dri:  for some reason drm.ko PCI vendor/device id detection is broken
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 31 04:40:22 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Alex
>Release:        5.3-RELEASE-p5
>Organization:
Intercaf
>Environment:
FreeBSD life.offshoredrive.com 5.3-RELEASE-p5 FreeBSD 5.3-RELEASE-p5 #2: Sun Jan 23 16:28:10 MSK 2005     lesha@life.offshoredrive.com:/usr/obj/usr/src/sys/LIFE  i386

Graphics Card:
Intel i852GM/i855GM GMCH

Computer:
Fujitsu-Siemens LifeBook S 7010
>Description:
During drm_probe vendor and device ids are messed up.

------------ [from drm_drv.c] ------------
if (!strcmp(device_get_name(dev), "drmsub"))
                pciid = pci_get_devid(device_get_parent(dev));
        else
                pciid = pci_get_devid(dev);

        vendor = (pciid & 0x0000ffff);
        device = (pciid & 0xffff0000) >> 16;
------------
This returns trash instead of real vendor/device ids for probed hardware.

Why not to use  pci_get_vendor(dev)  and  pci_get_device(dev) ??

p.s. I'm totally lame, but curious.  ;)
>How-To-Repeat:
Install DRI port and see that your i915 is not detected/working 
;)
>Fix:
*** drm_drv.c.org       Mon Jan 31 07:14:19 2005
--- drm_drv.c   Mon Jan 31 07:16:19 2005
*************** int drm_probe(device_t dev, drm_pci_id_l
*** 150,155 ****
--- 150,159 ----

        vendor = (pciid & 0x0000ffff);
        device = (pciid & 0xffff0000) >> 16;
+
+ // override
+         vendor = pci_get_vendor(dev);
+         device = pci_get_device(dev);

        s = drm_find_description(vendor, device, idlist);
        if (s != NULL) {


--------
after this patch:
drmsub1: <Intel i852GM/i855GM GMCH> mem 0xd0080000-0xd00fffff,0xe0000000-0xe7ffffff at device 2.1 on pci0
info: [drm] AGP at 0xd8000000 128MB
info: [drm] Initialized i915 1.2.0 20041217 on minor 1
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501310432.j0V4WNiI051778>