From a39749b012757ca837b2409b2139ce979ac390b1 Mon Sep 17 00:00:00 2001 From: sborrill Date: Tue, 30 Jun 2020 13:14:21 +0000 Subject: [PATCH] Only need to set brightness if reading the initial state fails to sync firmware and the driver. Avoids black screen at boot time. Thanks to jmcneill@ --- sys/dev/acpi/acpi_display.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/acpi/acpi_display.c b/sys/dev/acpi/acpi_display.c index 8b0fdd7cd16a..4ef8884005ad 100644 --- a/sys/dev/acpi/acpi_display.c +++ b/sys/dev/acpi/acpi_display.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_display.c,v 1.17 2020/04/28 11:02:37 jmcneill Exp $ */ +/* $NetBSD: acpi_display.c,v 1.18 2020/06/30 13:14:21 sborrill Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: acpi_display.c,v 1.17 2020/04/28 11:02:37 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_display.c,v 1.18 2020/06/30 13:14:21 sborrill Exp $"); #include #include @@ -647,8 +647,8 @@ acpidisp_out_attach(device_t parent, device_t self, void *aux) * Synchronize ACPI and driver brightness levels, and * check that brightness control is working. */ - (void)acpidisp_get_brightness(osc, &bc->bc_current); - if (acpidisp_set_brightness(osc, bc->bc_current)) { + if (acpidisp_get_brightness(osc, &bc->bc_current) && + acpidisp_set_brightness(osc, bc->bc_current)) { kmem_free(bc->bc_level, bc->bc_level_count * sizeof(*bc->bc_level)); kmem_free(bc, sizeof(*bc));