Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Lock the _DGS values (desired output state) dur...
details: https://anonhg.NetBSD.org/src/rev/4b83afaa8c2c
branches: trunk
changeset: 758254:4b83afaa8c2c
user: gsutre <gsutre%NetBSD.org@localhost>
date: Fri Oct 29 09:04:38 2010 +0000
description:
Lock the _DGS values (desired output state) during the display
output switch.
ok jruoho@
diffstat:
sys/dev/acpi/acpi_display.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diffs (48 lines):
diff -r 69689e7a6f15 -r 4b83afaa8c2c sys/dev/acpi/acpi_display.c
--- a/sys/dev/acpi/acpi_display.c Thu Oct 28 21:45:02 2010 +0000
+++ b/sys/dev/acpi/acpi_display.c Fri Oct 29 09:04:38 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_display.c,v 1.4 2010/10/28 21:45:02 gsutre Exp $ */
+/* $NetBSD: acpi_display.c,v 1.5 2010/10/29 09:04:38 gsutre Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_display.c,v 1.4 2010/10/28 21:45:02 gsutre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_display.c,v 1.5 2010/10/29 09:04:38 gsutre Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -911,6 +911,7 @@
struct acpidisp_out_softc *osc, *last_osc;
acpidisp_od_state_t state, last_state;
acpidisp_od_status_t status;
+ acpidisp_bios_policy_t lock_policy;
uint32_t i;
if (oi == NULL)
@@ -919,6 +920,11 @@
/* Mutual exclusion with callbacks of connected output devices. */
mutex_enter(&asc->sc_mtx);
+ /* Lock the _DGS values. */
+ lock_policy = asc->sc_policy;
+ lock_policy.fmt.output = ACPI_DISP_POLICY_OUTPUT_LOCKED;
+ (void)acpidisp_set_policy(asc, lock_policy.raw);
+
last_osc = NULL;
for (i = 0, od = oi->oi_dev; i < oi->oi_dev_count; i++, od++) {
if (od->od_device == NULL)
@@ -955,6 +961,9 @@
(void)acpidisp_set_state(last_osc, last_state.raw);
}
+ /* Restore the original BIOS policy. */
+ (void)acpidisp_set_policy(asc, asc->sc_policy.raw);
+
mutex_exit(&asc->sc_mtx);
}
Home |
Main Index |
Thread Index |
Old Index