Module Name: src Committed By: gsutre Date: Fri Oct 29 09:04:39 UTC 2010
Modified Files: src/sys/dev/acpi: acpi_display.c Log Message: Lock the _DGS values (desired output state) during the display output switch. ok jruoho@ To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/dev/acpi/acpi_display.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/acpi/acpi_display.c diff -u src/sys/dev/acpi/acpi_display.c:1.4 src/sys/dev/acpi/acpi_display.c:1.5 --- src/sys/dev/acpi/acpi_display.c:1.4 Thu Oct 28 21:45:02 2010 +++ src/sys/dev/acpi/acpi_display.c Fri Oct 29 09:04:38 2010 @@ -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); }