From owner-freebsd-acpi@FreeBSD.ORG Sat Jul 15 18:44:09 2006 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E430416A4DE; Sat, 15 Jul 2006 18:44:08 +0000 (UTC) (envelope-from ducrot@poupinou.org) Received: from poup.poupinou.org (poup.poupinou.org [195.101.94.96]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7141243D46; Sat, 15 Jul 2006 18:44:08 +0000 (GMT) (envelope-from ducrot@poupinou.org) Received: from ducrot by poup.poupinou.org with local (Exim) id 1G1p7W-0000gP-00; Sat, 15 Jul 2006 20:44:06 +0200 Date: Sat, 15 Jul 2006 20:44:06 +0200 To: john@utzweb.net Message-ID: <20060715184406.GO17014@poupinou.org> References: <200607122136.54293.mistry.7@osu.edu> <44B6401F.8050507@centtech.com> <44B641F2.2020500@centtech.com> <32884.69.93.78.27.1152831695.squirrel@69.93.78.27> <34247.69.93.78.27.1152835592.squirrel@69.93.78.27> <39062.69.93.78.27.1152857140.squirrel@69.93.78.27> <20060715183804.GN17014@poupinou.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060715183804.GN17014@poupinou.org> User-Agent: Mutt/1.5.9i From: Bruno Ducrot Cc: freebsd-acpi@freebsd.org, freebsd-mobile@freebsd.org Subject: Re: Patch to fix this Re: Dell/acpi_video hw.acpi.video.out0 is probably a bug, and an important one. Re: Dell laptops X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jul 2006 18:44:09 -0000 On Sat, Jul 15, 2006 at 08:38:04PM +0200, Bruno Ducrot wrote: > > I would suggest something like that (not even compile tested): > Gna, bad patch. Consider that one instead. 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:45:52 -0000 @@ -109,10 +109,12 @@ static void vo_set_device_state(ACPI_HAN #define DOS_BRIGHTNESS_BY_BIOS (1 << 2) /* _DOD and subdev's _ADR */ -#define DOD_DEVID_MASK 0xffff +#define DOD_DEVID_MASK 0x0400 #define DOD_DEVID_MONITOR 0x0100 -#define DOD_DEVID_PANEL 0x0110 #define DOD_DEVID_TV 0x0200 +#define DOD_DEVID_DIGITAL 0x0300 +#define DOD_DEVID_PANEL 0x0400 +#define DOD_DEVID_PANEL_COMPAT 0x0110 #define DOD_BIOS (1 << 16) #define DOD_NONVGA (1 << 17) #define DOD_HEAD_ID_SHIFT 18 @@ -409,27 +411,37 @@ acpi_video_vo_init(UINT32 adr) struct acpi_video_output_queue *voqh; ACPI_SERIAL_ASSERT(video); - switch (adr & DOD_DEVID_MASK) { - case DOD_DEVID_MONITOR: - desc = "CRT monitor"; - type = "crt"; - voqh = &crt_units; - break; - case DOD_DEVID_PANEL: + if ((adr & 0xffff) == DOD_DEVID_PANEL_COMPAT) { desc = "LCD panel"; type = "lcd"; voqh = &lcd_units; - break; - case DOD_DEVID_TV: - desc = "TV"; - type = "tv"; - voqh = &tv_units; - break; - default: - desc = "unknown output"; - type = "out"; - voqh = &other_units; - } + } else + switch (adr & DOD_DEVID_MASK) { + case DOD_DEVID_MONITOR: + desc = "CRT monitor"; + type = "crt"; + voqh = &crt_units; + break; + case DOD_DEVID_DIGITAL: + desc = "Digital monitor"; + type = "crt"; + voqh = &crt_units; + break; + case DOD_DEVID_PANEL: + desc = "LCD panel"; + type = "lcd"; + voqh = &lcd_units; + break; + case DOD_DEVID_TV: + desc = "TV"; + type = "tv"; + voqh = &tv_units; + break; + default: + desc = "unknown output"; + type = "out"; + voqh = &other_units; + } n = 0; vn = vp = NULL; @@ -553,19 +565,29 @@ acpi_video_vo_destroy(struct acpi_video_ if (vo->vo_levels != NULL) AcpiOsFree(vo->vo_levels); - switch (vo->adr & DOD_DEVID_MASK) { - case DOD_DEVID_MONITOR: - voqh = &crt_units; - break; - case DOD_DEVID_PANEL: + if ((adr & 0xffff) == DOD_DEVID_PANEL_COMPAT) { + desc = "LCD panel"; + type = "lcd"; voqh = &lcd_units; - break; - case DOD_DEVID_TV: - voqh = &tv_units; - break; - default: - voqh = &other_units; - } + } else + switch (vo->adr & DOD_DEVID_MASK) { + case DOD_DEVID_MONITOR: + voqh = &crt_units; + break; + case DOD_DEVID_DIGITAL: + desc = "Digital monitor"; + type = "crt"; + voqh = &crt_units; + break; + case DOD_DEVID_PANEL: + voqh = &lcd_units; + break; + case DOD_DEVID_TV: + voqh = &tv_units; + break; + default: + voqh = &other_units; + } STAILQ_REMOVE(voqh, vo, acpi_video_output, vo_unit.next); free(vo, M_ACPIVIDEO); } -- Bruno Ducrot -- Which is worse: ignorance or apathy? -- Don't know. Don't care.