From owner-freebsd-x11@FreeBSD.ORG Wed Jan 21 14:23:39 2009 Return-Path: Delivered-To: freebsd-x11@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9D121065A20; Wed, 21 Jan 2009 14:23:39 +0000 (UTC) (envelope-from Mark_Andrews@isc.org) Received: from mx.isc.org (mx.isc.org [IPv6:2001:4f8:0:2::1c]) by mx1.freebsd.org (Postfix) with ESMTP id C781C8FC1D; Wed, 21 Jan 2009 14:23:39 +0000 (UTC) (envelope-from Mark_Andrews@isc.org) Received: from farside.isc.org (farside.isc.org [IPv6:2001:4f8:3:bb::5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "farside.isc.org", Issuer "ISC CA" (verified OK)) by mx.isc.org (Postfix) with ESMTPS id 977C111404F; Wed, 21 Jan 2009 14:23:36 +0000 (UTC) (envelope-from Mark_Andrews@isc.org) Received: from drugs.dv.isc.org (drugs.dv.isc.org [IPv6:2001:470:1f00:820:214:22ff:fed9:fbdc]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "drugs.dv.isc.org", Issuer "ISC CA" (not verified)) by farside.isc.org (Postfix) with ESMTP id 9D554E606B; Wed, 21 Jan 2009 14:23:35 +0000 (UTC) (envelope-from marka@isc.org) Received: from drugs.dv.isc.org (localhost [127.0.0.1]) by drugs.dv.isc.org (8.14.3/8.14.3) with ESMTP id n0LENVKO001979; Thu, 22 Jan 2009 01:23:32 +1100 (EST) (envelope-from marka@drugs.dv.isc.org) Message-Id: <200901211423.n0LENVKO001979@drugs.dv.isc.org> To: Robert Noland From: Mark Andrews In-reply-to: Your message of "Tue, 20 Jan 2009 22:19:24 CDT." <1232507970.1860.9.camel@wombat.2hip.net> Date: Thu, 22 Jan 2009 01:23:31 +1100 Sender: Mark_Andrews@isc.org X-Spam-Status: No, score=-4.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mx.isc.org Cc: freebsd-x11@FreeBSD.org Subject: Re: How do I get the xf86-video-intel to work on a DELL D610 under FreeBSD 6.4? X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 14:23:42 -0000 In message <1232507970.1860.9.camel@wombat.2hip.net>, Robert Noland writes: > > --=-vgnUuZBqAt2Vb45jVePh > Content-Type: text/plain > Content-Transfer-Encoding: quoted-printable > > On Wed, 2009-01-21 at 13:59 +1100, Mark Andrews wrote: > > In message <200901210247.n0L2l7qw002241@drugs.dv.isc.org>, Mark Andrews w= > rites: > > >=20 > > > In message <200901210237.n0L2bgIj002006@drugs.dv.isc.org>, Mark Andrews= > write > > > s: > > > > > On Wed, 2009-01-21 at 13:19 +1100, Mark Andrews wrote: > > > > > > > Ok, I think maybe I see what is going on. Try not loading > > > > > > acpi_video. > > > > > > > 6 doesn't appear to have vgapci which iirc, is needed for both = > acpi > > > > > > and > > > > > > > agp to attach to the device. > > > > > > >=3D20 > > > > > > > robert. > > > > > >=3D20 > > > > > > That did it. Thanks. > > > > > >=3D20 > > > > > > Now where is the best place to record this bit of informa= > tion > > > > > > for others to find? > > > > >=20 > > > > > Looking at the tree, acpi_video looks like it has been in 6 for a l= > ong > > > > > time... at least 2 years. I'm not sure why vgapci was never MFC'd. > > > > > This is only an issue on 6. 7 and 8 will allow both to attach via > > > > > vgapci. > > > > >=20 > > > > > robert. > > > >=20 > > > > Do I need to file a PR for this? > > > =20 > > > I knew I had acpi_video in there for a reason. > > > Shutting the lid gives a blank screen otherwise. > > >=20 > > > #!/bin/sh > > > # deal with lid switch events > > >=20 > > > if [ "x$1" =3D x0x00 ]; then > > > /usr/bin/logger -t Lid Closed at `/bin/date` > > > /sbin/sysctl hw.acpi.video.lcd0.active=3D0 > > > else > > > /usr/bin/logger -t Lid Opened at `/bin/date` > > > /sbin/sysctl hw.acpi.video.lcd0.active=3D1 > > > fi > >=20 > > Should I just copy the driver from 7 or will it need to be > > modified? I'm willing to test. > > You could try it, I can't think of anything off hand that would prevent > it from working, but in order to MFC it, I would have to pull 6 trees > and at least build test as well. > > robert. I got it working using the following changes and $FreeBSD: src/sys/dev/pci/vga_pci.c,v 1.3 2005/12/20 22:41:33 jhb Exp$. I havn't tested to see if I can get away without the change to drm_pciids.h. That was mention in some email to stable as getting agp to work with the same chipset on a different Dell box. Mark Index: sys/conf/files =================================================================== RCS file: /home/ncvs/src/sys/conf/files,v retrieving revision 1.1031.2.78 diff -u -r1.1031.2.78 files --- sys/conf/files 14 Jan 2009 10:17:35 -0000 1.1031.2.78 +++ sys/conf/files 21 Jan 2009 03:44:03 -0000 @@ -837,6 +837,7 @@ dev/pci/pci_pci.c optional pci dev/pci/pci_user.c optional pci dev/pci/pcib_if.m standard +dev/pci/vga_pci.c optional pci dev/pdq/if_fea.c optional fea eisa dev/pdq/if_fpa.c optional fpa pci dev/pdq/pdq.c optional fea eisa nowerror Index: sys/dev/acpica/acpi_video.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi_video.c,v retrieving revision 1.10.2.2 diff -u -r1.10.2.2 acpi_video.c --- sys/dev/acpica/acpi_video.c 16 Aug 2006 13:51:05 -0000 1.10.2.2 +++ sys/dev/acpica/acpi_video.c 21 Jan 2009 13:57:25 -0000 @@ -70,6 +70,7 @@ /* interfaces */ static int acpi_video_modevent(struct module*, int, void *); +static void acpi_video_identify(driver_t *driver, device_t parent); static int acpi_video_probe(device_t); static int acpi_video_attach(device_t); static int acpi_video_detach(device_t); @@ -143,6 +144,7 @@ #define DSS_COMMIT (1 << 31) static device_method_t acpi_video_methods[] = { + DEVMETHOD(device_identify, acpi_video_identify), DEVMETHOD(device_probe, acpi_video_probe), DEVMETHOD(device_attach, acpi_video_attach), DEVMETHOD(device_detach, acpi_video_detach), @@ -158,7 +160,7 @@ static devclass_t acpi_video_devclass; -DRIVER_MODULE(acpi_video, pci, acpi_video_driver, acpi_video_devclass, +DRIVER_MODULE(acpi_video, vgapci, acpi_video_driver, acpi_video_devclass, acpi_video_modevent, NULL); MODULE_DEPEND(acpi_video, acpi, 1, 1, 1); @@ -196,6 +198,14 @@ return (err); } +static void +acpi_video_identify(driver_t *driver, device_t parent) +{ + + if (device_find_child(parent, "acpi_video", -1) == NULL) + device_add_child(parent, "acpi_video", -1); +} + static int acpi_video_probe(device_t dev) { Index: sys/dev/drm/drm_pciids.h =================================================================== RCS file: /home/ncvs/src/sys/dev/drm/drm_pciids.h,v retrieving revision 1.2.2.6 diff -u -r1.2.2.6 drm_pciids.h --- sys/dev/drm/drm_pciids.h 24 Mar 2008 10:43:41 -0000 1.2.2.6 +++ sys/dev/drm/drm_pciids.h 20 Jan 2009 12:27:23 -0000 @@ -287,6 +287,7 @@ {0x8086, 0x2572, 0, "Intel i865G GMCH"}, \ {0x8086, 0x2582, 0, "Intel i915G"}, \ {0x8086, 0x2592, 0, "Intel i915GM"}, \ + {0x8086, 0x2792, 0, "Intel i915GML"}, \ {0x8086, 0x2772, 0, "Intel i945G"}, \ {0x8086, 0x27A2, 0, "Intel i945GM"}, \ {0x8086, 0x2972, 0, "Intel i946GZ"}, \ Index: sys/dev/drm/i915_drv.c =================================================================== RCS file: /home/ncvs/src/sys/dev/drm/i915_drv.c,v retrieving revision 1.1.2.2 diff -u -r1.1.2.2 i915_drv.c --- sys/dev/drm/i915_drv.c 17 May 2006 07:40:11 -0000 1.1.2.2 +++ sys/dev/drm/i915_drv.c 21 Jan 2009 13:13:12 -0000 @@ -100,7 +100,7 @@ }; static driver_t i915_driver = { -#if __FreeBSD_version >= 700010 +#if __FreeBSD_version >= 604100 "drm", #else "drmsub", @@ -110,7 +110,7 @@ }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 +#if __FreeBSD_version >= 604100 DRIVER_MODULE(i915, vgapci, i915_driver, drm_devclass, 0, 0); #else DRIVER_MODULE(i915, agp, i915_driver, drm_devclass, 0, 0); Index: sys/dev/drm/mach64_drv.c =================================================================== RCS file: /home/ncvs/src/sys/dev/drm/mach64_drv.c,v retrieving revision 1.1.2.2 diff -u -r1.1.2.2 mach64_drv.c --- sys/dev/drm/mach64_drv.c 17 May 2006 07:40:11 -0000 1.1.2.2 +++ sys/dev/drm/mach64_drv.c 21 Jan 2009 08:48:39 -0000 @@ -109,7 +109,7 @@ }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 +#if __FreeBSD_version >= 604100 DRIVER_MODULE(mach64, vgapci, mach64_driver, drm_devclass, 0, 0); #else DRIVER_MODULE(mach64, pci, mach64_driver, drm_devclass, 0, 0); Index: sys/dev/drm/mga_drv.c =================================================================== RCS file: /home/ncvs/src/sys/dev/drm/mga_drv.c,v retrieving revision 1.9.2.2 diff -u -r1.9.2.2 mga_drv.c --- sys/dev/drm/mga_drv.c 17 May 2006 07:40:11 -0000 1.9.2.2 +++ sys/dev/drm/mga_drv.c 21 Jan 2009 12:16:49 -0000 @@ -74,7 +74,7 @@ * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the * device. */ -#if __FreeBSD_version >= 700010 +#if __FreeBSD_version >= 604100 bus = device_get_parent(device_get_parent(dev->device)); #else bus = device_get_parent(dev->device); @@ -155,7 +155,7 @@ }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 +#if __FreeBSD_version >= 604100 DRIVER_MODULE(mga, vgapci, mga_driver, drm_devclass, 0, 0); #else DRIVER_MODULE(mga, pci, mga_driver, drm_devclass, 0, 0); Index: sys/dev/drm/r128_drv.c =================================================================== RCS file: /home/ncvs/src/sys/dev/drm/r128_drv.c,v retrieving revision 1.9.2.2 diff -u -r1.9.2.2 r128_drv.c --- sys/dev/drm/r128_drv.c 17 May 2006 07:40:11 -0000 1.9.2.2 +++ sys/dev/drm/r128_drv.c 21 Jan 2009 08:48:49 -0000 @@ -109,7 +109,7 @@ }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 +#if __FreeBSD_version >= 604100 DRIVER_MODULE(r128, vgapci, r128_driver, drm_devclass, 0, 0); #else DRIVER_MODULE(r128, pci, r128_driver, drm_devclass, 0, 0); Index: sys/dev/drm/radeon_drv.c =================================================================== RCS file: /home/ncvs/src/sys/dev/drm/radeon_drv.c,v retrieving revision 1.12.2.2 diff -u -r1.12.2.2 radeon_drv.c --- sys/dev/drm/radeon_drv.c 17 May 2006 07:40:11 -0000 1.12.2.2 +++ sys/dev/drm/radeon_drv.c 21 Jan 2009 08:48:54 -0000 @@ -114,7 +114,7 @@ }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 +#if __FreeBSD_version >= 604100 DRIVER_MODULE(radeon, vgapci, radeon_driver, drm_devclass, 0, 0); #else DRIVER_MODULE(radeon, pci, radeon_driver, drm_devclass, 0, 0); Index: sys/dev/drm/savage_drv.c =================================================================== RCS file: /home/ncvs/src/sys/dev/drm/savage_drv.c,v retrieving revision 1.1.2.2 diff -u -r1.1.2.2 savage_drv.c --- sys/dev/drm/savage_drv.c 17 May 2006 07:40:11 -0000 1.1.2.2 +++ sys/dev/drm/savage_drv.c 21 Jan 2009 08:49:02 -0000 @@ -99,7 +99,7 @@ }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 +#if __FreeBSD_version >= 604100 DRIVER_MODULE(savage, vgapci, savage_driver, drm_devclass, 0, 0); #else DRIVER_MODULE(savage, pci, savage_driver, drm_devclass, 0, 0); Index: sys/dev/drm/sis_drv.c =================================================================== RCS file: /home/ncvs/src/sys/dev/drm/sis_drv.c,v retrieving revision 1.5.2.2 diff -u -r1.5.2.2 sis_drv.c --- sys/dev/drm/sis_drv.c 17 May 2006 07:40:11 -0000 1.5.2.2 +++ sys/dev/drm/sis_drv.c 21 Jan 2009 08:49:09 -0000 @@ -92,7 +92,7 @@ }; extern devclass_t drm_devclass; -#if __FreeBSD_version >= 700010 +#if __FreeBSD_version >= 604100 DRIVER_MODULE(sisdrm, vgapci, sis_driver, drm_devclass, 0, 0); #else DRIVER_MODULE(sisdrm, pci, sis_driver, drm_devclass, 0, 0); Index: sys/pci/agp_i810.c =================================================================== RCS file: /home/ncvs/src/sys/pci/Attic/agp_i810.c,v retrieving revision 1.32.2.4 diff -u -r1.32.2.4 agp_i810.c --- sys/pci/agp_i810.c 8 Nov 2007 20:50:13 -0000 1.32.2.4 +++ sys/pci/agp_i810.c 21 Jan 2009 13:40:05 -0000 @@ -188,7 +188,8 @@ devid -= 0x20000; break; }; - if (device_get_children(device_get_parent(dev), &children, &nchildren)) + if (device_get_children(device_get_parent(device_get_parent(dev)), + &children, &nchildren)) return 0; for (i = 0; i < nchildren; i++) { @@ -203,6 +204,15 @@ return 0; } +static void +agp_i810_identify(driver_t *driver, device_t parent) +{ + + if (device_find_child(parent, "agp", -1) == NULL && + agp_i810_match(parent)) + device_add_child(parent, "agp", -1); +} + static int agp_i810_probe(device_t dev) { @@ -273,7 +283,6 @@ return ENXIO; } - device_verbose(dev); device_set_desc(dev, desc); return BUS_PROBE_DEFAULT; } @@ -485,18 +494,13 @@ gatt->ag_physical = pgtblctl & ~1; } - /* Add a device for the drm to attach to */ - if (!device_add_child( dev, "drmsub", -1 )) - printf("out of memory...\n"); - - return bus_generic_attach(dev); + return 0; } static int agp_i810_detach(device_t dev) { struct agp_i810_softc *sc = device_get_softc(dev); - device_t child; agp_free_cdev(dev); @@ -531,10 +535,6 @@ } agp_free_res(dev); - child = device_find_child( dev, "drmsub", 0 ); - if (child) - device_delete_child( dev, child ); - return 0; } @@ -920,26 +920,12 @@ return 0; } -static int -agp_i810_print_child(device_t dev, device_t child) -{ - int retval = 0; - - retval += bus_print_child_header(dev, child); - retval += printf(": (child of agp_i810.c)"); - retval += bus_print_child_footer(dev, child); - - return retval; -} - static device_method_t agp_i810_methods[] = { /* Device interface */ + DEVMETHOD(device_identify, agp_i810_identify), DEVMETHOD(device_probe, agp_i810_probe), DEVMETHOD(device_attach, agp_i810_attach), DEVMETHOD(device_detach, agp_i810_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), /* AGP interface */ DEVMETHOD(agp_get_aperture, agp_i810_get_aperture), @@ -953,14 +939,6 @@ DEVMETHOD(agp_bind_memory, agp_i810_bind_memory), DEVMETHOD(agp_unbind_memory, agp_i810_unbind_memory), - /* bus methods */ - DEVMETHOD(bus_print_child, agp_i810_print_child), - DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), { 0, 0 } }; @@ -972,6 +950,6 @@ static devclass_t agp_devclass; -DRIVER_MODULE(agp_i810, pci, agp_i810_driver, agp_devclass, 0, 0); +DRIVER_MODULE(agp_i810, vgapci, agp_i810_driver, agp_devclass, 0, 0); MODULE_DEPEND(agp_i810, agp, 1, 1, 1); MODULE_DEPEND(agp_i810, pci, 1, 1, 1); -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: Mark_Andrews@isc.org