Merge ACPI display driver. Provides generic support for brightness

control and output switching, through ACPI video extensions.

TODO: use wsconsctl(8) instead of sysctl(8) for brightness control.

ok jruoho@
also discussed with cegger@ and jmcneill@
This commit is contained in:
gsutre 2010-10-12 19:10:49 +00:00
parent d199f85d70
commit e28e04ce32
7 changed files with 2031 additions and 12 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: GENERIC,v 1.285 2010/08/22 18:56:21 rmind Exp $ # $NetBSD: GENERIC,v 1.286 2010/10/12 19:10:49 gsutre Exp $
# #
# GENERIC machine description file # GENERIC machine description file
# #
@ -22,7 +22,7 @@ include "arch/amd64/conf/std.amd64"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary options INCLUDE_CONFIG_FILE # embed config file in kernel binary
#ident "GENERIC-$Revision: 1.285 $" #ident "GENERIC-$Revision: 1.286 $"
maxusers 64 # estimated number of users maxusers 64 # estimated number of users
@ -284,6 +284,8 @@ acpiecdt* at acpi? # ACPI Embedded Controller (early binding)
acpilid* at acpi? # ACPI Lid Switch acpilid* at acpi? # ACPI Lid Switch
#acpismbus* at acpi? # ACPI SMBus CMI (experimental) #acpismbus* at acpi? # ACPI SMBus CMI (experimental)
acpitz* at acpi? # ACPI Thermal Zone acpitz* at acpi? # ACPI Thermal Zone
acpivga* at acpi? # ACPI Display Adapter
acpiout* at acpivga? # ACPI Display Output Device
acpiwmi* at acpi? # ACPI WMI Mapper acpiwmi* at acpi? # ACPI WMI Mapper
# Mainboard devices # Mainboard devices

View File

@ -1,4 +1,4 @@
# $NetBSD: ALL,v 1.267 2010/08/22 18:56:21 rmind Exp $ # $NetBSD: ALL,v 1.268 2010/10/12 19:10:50 gsutre Exp $
# From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
# #
# ALL machine description file # ALL machine description file
@ -17,7 +17,7 @@ include "arch/i386/conf/std.i386"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary options INCLUDE_CONFIG_FILE # embed config file in kernel binary
#ident "ALL-$Revision: 1.267 $" #ident "ALL-$Revision: 1.268 $"
maxusers 64 # estimated number of users maxusers 64 # estimated number of users
@ -375,6 +375,8 @@ acpilid* at acpi? # ACPI Lid Switch
# XXX the same bus, and bad things (tm) will happen! # XXX the same bus, and bad things (tm) will happen!
acpismbus* at acpi? # ACPI SMBus CMI (experimental) acpismbus* at acpi? # ACPI SMBus CMI (experimental)
acpitz* at acpi? # ACPI Thermal Zone acpitz* at acpi? # ACPI Thermal Zone
acpivga* at acpi? # ACPI Display Adapter
acpiout* at acpivga? # ACPI Display Output Device
acpiwmi* at acpi? # ACPI WMI Mapper acpiwmi* at acpi? # ACPI WMI Mapper
# Mainboard devices # Mainboard devices

View File

@ -1,4 +1,4 @@
# $NetBSD: GENERIC,v 1.993 2010/08/22 18:56:21 rmind Exp $ # $NetBSD: GENERIC,v 1.994 2010/10/12 19:10:50 gsutre Exp $
# #
# GENERIC machine description file # GENERIC machine description file
# #
@ -22,7 +22,7 @@ include "arch/i386/conf/std.i386"
options INCLUDE_CONFIG_FILE # embed config file in kernel binary options INCLUDE_CONFIG_FILE # embed config file in kernel binary
#ident "GENERIC-$Revision: 1.993 $" #ident "GENERIC-$Revision: 1.994 $"
maxusers 64 # estimated number of users maxusers 64 # estimated number of users
@ -364,6 +364,8 @@ acpiecdt* at acpi? # ACPI Embedded Controller (early binding)
acpilid* at acpi? # ACPI Lid Switch acpilid* at acpi? # ACPI Lid Switch
#acpismbus* at acpi? # ACPI SMBus CMI (experimental) #acpismbus* at acpi? # ACPI SMBus CMI (experimental)
acpitz* at acpi? # ACPI Thermal Zone acpitz* at acpi? # ACPI Thermal Zone
acpivga* at acpi? # ACPI Display Adapter
acpiout* at acpivga? # ACPI Display Output Device
acpiwmi* at acpi? # ACPI WMI Mapper acpiwmi* at acpi? # ACPI WMI Mapper
# Mainboard devices # Mainboard devices

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi.c,v 1.220 2010/10/02 18:06:47 gsutre Exp $ */ /* $NetBSD: acpi.c,v 1.221 2010/10/12 19:10:50 gsutre Exp $ */
/*- /*-
* Copyright (c) 2003, 2007 The NetBSD Foundation, Inc. * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@ -100,7 +100,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.220 2010/10/02 18:06:47 gsutre Exp $"); __KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.221 2010/10/12 19:10:50 gsutre Exp $");
#include "opt_acpi.h" #include "opt_acpi.h"
#include "opt_pcifixup.h" #include "opt_pcifixup.h"
@ -665,11 +665,10 @@ acpi_build_tree(struct acpi_softc *sc)
/* /*
* Scan the internal namespace. * Scan the internal namespace.
*/ */
(void)acpi_pcidev_scan(sc->sc_root);
(void)acpi_rescan(sc->sc_dev, NULL, NULL); (void)acpi_rescan(sc->sc_dev, NULL, NULL);
acpi_rescan_capabilities(sc); acpi_rescan_capabilities(sc);
(void)acpi_pcidev_scan(sc->sc_root);
} }
static ACPI_STATUS static ACPI_STATUS

2006
sys/dev/acpi/acpi_display.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpireg.h,v 1.10 2010/08/27 02:44:05 jruoho Exp $ */ /* $NetBSD: acpireg.h,v 1.11 2010/10/12 19:10:50 gsutre Exp $ */
/* /*
* Copyright 2001 Wasabi Systems, Inc. * Copyright 2001 Wasabi Systems, Inc.
@ -72,5 +72,6 @@
#define ACPI_LID_COMPONENT 0x00200000 #define ACPI_LID_COMPONENT 0x00200000
#define ACPI_RESOURCE_COMPONENT 0x00400000 #define ACPI_RESOURCE_COMPONENT 0x00400000
#define ACPI_TZ_COMPONENT 0x00800000 #define ACPI_TZ_COMPONENT 0x00800000
#define ACPI_DISPLAY_COMPONENT 0x01000000
#endif /* !_SYS_DEV_ACPI_ACPIREG_H */ #endif /* !_SYS_DEV_ACPI_ACPIREG_H */

View File

@ -1,4 +1,4 @@
# $NetBSD: files.acpi,v 1.80 2010/09/06 15:54:27 jmcneill Exp $ # $NetBSD: files.acpi,v 1.81 2010/10/12 19:10:50 gsutre Exp $
include "dev/acpi/acpica/files.acpica" include "dev/acpi/acpica/files.acpica"
@ -66,6 +66,13 @@ file dev/acpi/acpi_cpu_cstate.c acpicpu
file dev/acpi/acpi_cpu_pstate.c acpicpu file dev/acpi/acpi_cpu_pstate.c acpicpu
file dev/acpi/acpi_cpu_tstate.c acpicpu file dev/acpi/acpi_cpu_tstate.c acpicpu
# ACPI Display
device acpivga {}
attach acpivga at acpinodebus
device acpiout
attach acpiout at acpivga
file dev/acpi/acpi_display.c acpivga|acpiout
# ACPI Thermal Zone # ACPI Thermal Zone
device acpitz: sysmon_envsys device acpitz: sysmon_envsys
attach acpitz at acpinodebus attach acpitz at acpinodebus