From nobody@FreeBSD.org  Fri Jul 14 05:58:22 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2454916A4DD
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 14 Jul 2006 05:58:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C97EA43D55
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 14 Jul 2006 05:58:21 +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 k6E5wLqF006102
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 14 Jul 2006 05:58:21 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k6E5wL4h006099;
	Fri, 14 Jul 2006 05:58:21 GMT
	(envelope-from nobody)
Message-Id: <200607140558.k6E5wL4h006099@www.freebsd.org>
Date: Fri, 14 Jul 2006 05:58:21 GMT
From: "John L. Utz III" <john@utzweb.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: acpi_video cant identify some Dell lcd's.
X-Send-Pr-Version: www-2.3

>Number:         100271
>Category:       kern
>Synopsis:       [acpi] [patch] acpi_video cant identify some Dell lcd's.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 14 06:00:34 GMT 2006
>Closed-Date:    Thu Aug 10 13:25:02 GMT 2006
>Last-Modified:  Thu Aug 10 13:25:02 GMT 2006
>Originator:     John L. Utz III
>Release:        7.0-CURRENT, 6.1-RELEASE
>Organization:
>Environment:
[spaz@minime /usr/home/spaz]$ uname -a
FreeBSD minime.hsd1.wa.comcast.net. 7.0-CURRENT FreeBSD 7.0-CURRENT #3: Thu Jul 13 22:02:04 PDT 2006     spaz@minime.hsd1.wa.comcast.net.:/usr/src/sys/i386/compile/MINIME  i386

>Description:
acpi_video expects that the laptops' lcd will be called out in the ACPI asl by the value 0x0110.

however, some laptops' identify the LCD by the value 0x0400.

for laptops such as these, theirl displays will not be identified correctly and they will not be attached correctly to the ACPI tree

[spaz@minime /usr/home/spaz]$ sysctl hw.acpi.video
hw.acpi.video.crt0.active: 0
hw.acpi.video.out0.active: 1  <-- this is wrong!
[spaz@minime /usr/home/spaz]$ 

the fix is to apply the attached patch, it will allow the dell's to attach correctly:

[spaz@minime /usr/home/spaz]$ sysctl hw.acpi.videoight
hw.acpi.video.crt0.active: 0
hw.acpi.video.lcd0.active: 1  <-- this is r
[spaz@minime /usr/home/spaz]$ 
>How-To-Repeat:
[spaz@minime /usr/home/spaz]$ sysctl hw.acpi.video
hw.acpi.video.crt0.active: 0
hw.acpi.video.out0.active: 1
[spaz@minime /usr/home/spaz]$ 
>Fix:
[spaz@minime /usr/home/spaz]$ diff -u acpi_videoorig.c acpi_video.c
--- acpi_videoorig.c    Thu Jul 13 22:44:40 2006
+++ acpi_video.c        Thu Jul 13 22:44:28 2006
@@ -113,6 +113,7 @@
 #define DOD_DEVID_MONITOR      0x0100
 #define DOD_DEVID_PANEL                0x0110
 #define DOD_DEVID_TV           0x0200
+#define DOD_DEVID_LCD           0x0400
 #define DOD_BIOS               (1 << 16)
 #define DOD_NONVGA             (1 << 17)
 #define DOD_HEAD_ID_SHIFT      18
@@ -416,6 +417,7 @@
                voqh = &crt_units;
                break;
        case DOD_DEVID_PANEL:
+       case DOD_DEVID_LCD:
                desc = "LCD panel";
                type = "lcd";
                voqh = &lcd_units;
@@ -558,6 +560,7 @@
                voqh = &crt_units;
                break;
        case DOD_DEVID_PANEL:
+       case DOD_DEVID_LCD:
                voqh = &lcd_units;
                break;
        case DOD_DEVID_TV:
[spaz@minime /usr/home/spaz]$ 
>Release-Note:
>Audit-Trail:

From: Hiroki Sato <hrs@FreeBSD.org>
To: john@utzweb.net
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/100271: acpi_video cant identify some Dell lcd's.
Date: Fri, 14 Jul 2006 17:00:00 +0900 (JST)

 ----Security_Multipart(Fri_Jul_14_17_00_00_2006_641)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Hi,
 
 "John L. Utz III" <john@utzweb.net> wrote
   in <200607140558.k6E5wL4h006099@www.freebsd.org>:
 
 jo> >Fix:
 jo> [spaz@minime /usr/home/spaz]$ diff -u acpi_videoorig.c acpi_video.c
 jo> --- acpi_videoorig.c    Thu Jul 13 22:44:40 2006
 jo> +++ acpi_video.c        Thu Jul 13 22:44:28 2006
 jo> @@ -113,6 +113,7 @@
 jo>  #define DOD_DEVID_MONITOR      0x0100
 jo>  #define DOD_DEVID_PANEL                0x0110
 jo>  #define DOD_DEVID_TV           0x0200
 jo> +#define DOD_DEVID_LCD           0x0400
 jo>  #define DOD_BIOS               (1 << 16)
 jo>  #define DOD_NONVGA             (1 << 17)
 jo>  #define DOD_HEAD_ID_SHIFT      18
 (snip)
 
  I think this patch can be improved in more consistent way with
  the latest ACPI Video Extension specification.
 
  Could you try the following patch and let me know if it works
  fine or not?  Thanks.
 
   http://people.freebsd.org/~hrs/acpi_video.c.diff
 
 --
 | Hiroki SATO
 
 
 ----Security_Multipart(Fri_Jul_14_17_00_00_2006_641)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.2 (FreeBSD)
 
 iD8DBQBEt08ATyzT2CeTzy0RAhmNAJ0XT3t1C2FcFYxoEjNod8zYsuNICgCePwGO
 75vygQeBVQz+QmakMc1VIOw=
 =NnyD
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart(Fri_Jul_14_17_00_00_2006_641)----

From: john@utzweb.net
To: "Hiroki Sato" <hrs@FreeBSD.org>
Cc: john@utzweb.net,
 freebsd-gnats-submit@freebsd.org
Subject: Re: misc/100271: acpi_video cant identify some Dell lcd's.
Date: Fri, 14 Jul 2006 11:47:33 -0400 (EDT)

 Greetings!
 
 > Hi,
 >
 > "John L. Utz III" <john@utzweb.net> wrote
 >   in <200607140558.k6E5wL4h006099@www.freebsd.org>:
 >
 > jo> >Fix:
 > jo> [spaz@minime /usr/home/spaz]$ diff -u acpi_videoorig.c acpi_video.c
 > jo> --- acpi_videoorig.c    Thu Jul 13 22:44:40 2006
 > jo> +++ acpi_video.c        Thu Jul 13 22:44:28 2006
 > jo> @@ -113,6 +113,7 @@
 > jo>  #define DOD_DEVID_MONITOR      0x0100
 > jo>  #define DOD_DEVID_PANEL                0x0110
 > jo>  #define DOD_DEVID_TV           0x0200
 >+#define DOD_DEVID_LCD           0x0400
 > jo>  #define DOD_BIOS               (1 << 16)
 > jo>  #define DOD_NONVGA             (1 << 17)
 > jo>  #define DOD_HEAD_ID_SHIFT      18
 > (snip)
 >
 >  I think this patch can be improved in more consistent way with
 >  the latest ACPI Video Extension specification.
 >
 >  Could you try the following patch and let me know if it works
 >  fine or not?  Thanks.
 >
 >   http://people.freebsd.org/~hrs/acpi_video.c.diff
 
 sadly, this was not and improvement, none of the devices where attached:
 
 acpi_video0: <ACPI video extension> on vgapci0
 Ignore non-standard device (100).
 Ignore non-standard device (400).
 
 100 is my crt and 400 is my lcd.
 
 good effort, and i will be happy to continue to help you. i have to go to
 work now, but i will be happy to either fix your patch or test any new
 patch u provide
 
 
 > --
 > | Hiroki SATO
 >
 >
 
 

From: Bruno Ducrot <bruno@poupinou.org>
To: bug-followup@FreeBSD.org, john@utzweb.net
Cc:  
Subject: Re: kern/100271: [acpi] [patch] acpi_video cant identify some Dell lcd's.
Date: Mon, 17 Jul 2006 16:40:22 +0200

 Hi,
 
 Looking :
 http://people.freebsd.org/~hrs/acpi_video.c.diff
 I think this part is problematic:
 
 +	display_index = adr & DOD_DEVID_MASK_DISPIDX;
 +	display_port = (adr & DOD_DEVID_MASK_DISPPORT) >> 4;
 +
 +	if (!(adr & DOD_DEVID_SCHEME_STD)) {
 +		printf("Ignore non-standard device (%x).\n",
 +			adr & DOD_DEVID_MASK_FULL);
 +		return(NULL);
 +	}
 +	
 
 ACPI 2.0b reserve bits 30-31 to be 0, so if we follow exactly ACPI 3,
 that is if bit 31 is cleared then we can't be compatible with ACPI 2.0b.
 
 Therefore if we keep that if statement, we should at least verify that
 the DSDT is for ACPI 3.  Problem is : the DSDT header do have the
 same revision field for both specs 2.0b and 3.0.
 Worst, I've seen DSDT header with revision 1, even though they contains
 at least ACPI 2 objects (like processors, etc.)
 
 Sato-san, do you have any thought about this issue ?
 
 -- 
 Bruno Ducrot
 
 --  Which is worse:  ignorance or apathy?
 --  Don't know.  Don't care.
State-Changed-From-To: open->closed 
State-Changed-By: bruno 
State-Changed-When: Thu Aug 10 13:24:15 UTC 2006 
State-Changed-Why:  
Patch commited. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=100271 
>Unformatted:
