Patch to fix this Re: Dell/acpi_video hw.acpi.video.out0 is probably a bug, and an important one. Re: Dell laptops

Bruno Ducrot ducrot at poupinou.org
Sat Jul 15 18:38:19 UTC 2006


Hi John,

On Fri, Jul 14, 2006 at 02:05:40AM -0400, john at utzweb.net wrote:
> acpi_video.c expects the lcd to be identified as 0x0110, but my Dell
> Latitude C400 (and probably others) id's the lcd at 0x0400:
> 
> Device (LCD)
>                 {
>                     Method (_ADR, 0, NotSerialized)
>                     {
>                         Return (0x0400)
>                     }
> 
> 
> so, acpi_video needs to account for this.
> 
> 
> got this sorted, and now the display turns back on, here's the patch, i
> already send-pr'd it

You are somewhat right, but your patch is wrong.  Actually you have
to check if ((adr & 0x0400) == 0x0400).  In fact, acpi_video.c is
correct for ACPI spec2, but ACPI spec3 have changed in that regard, and
only the value 0x110 (LCD internal panel) should be kept for
backward compatility.

Please look at the two specifications (v2.0c and v3) at the ACPI
info website: http://www.acpi.info for more.

I would suggest something like that (not even compile tested):

Index: acpi_video.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/acpica/acpi_video.c,v
retrieving revision 1.12
diff -u -p -r1.12 acpi_video.c
--- acpi_video.c	20 Dec 2005 22:42:16 -0000	1.12
+++ acpi_video.c	15 Jul 2006 18:38:39 -0000
@@ -113,6 +113,11 @@ static void	vo_set_device_state(ACPI_HAN
 #define DOD_DEVID_MONITOR	0x0100
 #define DOD_DEVID_PANEL		0x0110
 #define DOD_DEVID_TV		0x0200
+#define DOD_DEVID_MASK_V3	0x0400
+#define DOD_DEVID_CRT_V3	0x0100
+#define DOD_DEVID_TV_V3		0x0200
+#define DOD_DEVID_DIGI_V3	0x0300
+#define DOD_DEVID_PANEL_V3	0x0400
 #define DOD_BIOS		(1 << 16)
 #define DOD_NONVGA		(1 << 17)
 #define DOD_HEAD_ID_SHIFT	18
@@ -426,9 +431,32 @@ acpi_video_vo_init(UINT32 adr)
 		voqh = &tv_units;
 		break;
 	default:
-		desc = "unknown output";
-		type = "out";
-		voqh = &other_units;
+		switch (adr & DOD_DEVID_MASK_V3) {
+		case DOD_DEVID_CRT_V3:
+			desc = "CRT monitor";
+			type = "crt";
+			voqh = &crt_units;
+			break;
+		case DOD_DEVID_DIGI_V3:
+			desc = "External digital monitor";
+			type = "crt";
+			voqh = &crt_units;
+			break;
+		case DOD_DEVID_PANEL_V3:
+			desc = "LCD panel";
+			type = "lcd";
+			voqh = &lcd_units;
+			break;
+		case DOD_DEVID_TV_V3:
+			desc = "TV";
+			type = "tv";
+			voqh = &tv_units;
+			break;
+		default:
+			desc = "unknown output";
+			type = "out";
+			voqh = &other_units;
+		}
 	}
 
 	n = 0;
@@ -564,7 +592,32 @@ acpi_video_vo_destroy(struct acpi_video_
 		voqh = &tv_units;
 		break;
 	default:
-		voqh = &other_units;
+		switch (adr & DOD_DEVID_MASK_V3) {
+		case DOD_DEVID_CRT_V3:
+			desc = "CRT monitor";
+			type = "crt";
+			voqh = &crt_units;
+			break;
+		case DOD_DEVID_DIGI_V3:
+			desc = "External digital monitor";
+			type = "crt";
+			voqh = &crt_units;
+			break;
+		case DOD_DEVID_PANEL_V3:
+			desc = "LCD panel";
+			type = "lcd";
+			voqh = &lcd_units;
+			break;
+		case DOD_DEVID_TV_V3:
+			desc = "TV";
+			type = "tv";
+			voqh = &tv_units;
+			break;
+		default:
+			desc = "unknown output";
+			type = "out";
+			voqh = &other_units;
+		}
 	}
 	STAILQ_REMOVE(voqh, vo, acpi_video_output, vo_unit.next);
 	free(vo, M_ACPIVIDEO);



Cheers,

-- 
Bruno Ducrot

--  Which is worse:  ignorance or apathy?
--  Don't know.  Don't care.


More information about the freebsd-mobile mailing list