From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Jan 31 04:40:24 2005 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4162F16A4D5 for ; Mon, 31 Jan 2005 04:40:24 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8898C43D86 for ; Mon, 31 Jan 2005 04:40:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j0V4eM6m079429 for ; Mon, 31 Jan 2005 04:40:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id j0V4eMpK079427; Mon, 31 Jan 2005 04:40:22 GMT (envelope-from gnats) Resent-Date: Mon, 31 Jan 2005 04:40:22 GMT Resent-Message-Id: <200501310440.j0V4eMpK079427@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alex Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5DBA016A4CE for ; Mon, 31 Jan 2005 04:32:26 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3DC8043D4C for ; Mon, 31 Jan 2005 04:32:26 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j0V4WNsB051779 for ; Mon, 31 Jan 2005 04:32:23 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j0V4WNiI051778; Mon, 31 Jan 2005 04:32:23 GMT (envelope-from nobody) Message-Id: <200501310432.j0V4WNiI051778@www.freebsd.org> Date: Mon, 31 Jan 2005 04:32:23 GMT From: Alex To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: ports/76879: ports/dri: for some reason drm.ko PCI vendor/device id detection is broken X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2005 04:40:24 -0000 >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: 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: