From owner-svn-src-all@freebsd.org Thu Apr 16 21:56:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3521A2C955B; Thu, 16 Apr 2020 21:56:53 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 493Cjw54vkz4B92; Thu, 16 Apr 2020 21:56:52 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7B46FD4D; Thu, 16 Apr 2020 21:56:52 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03GLuqQe058433; Thu, 16 Apr 2020 21:56:52 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03GLuqgw058432; Thu, 16 Apr 2020 21:56:52 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202004162156.03GLuqgw058432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Thu, 16 Apr 2020 21:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360025 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 360025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2020 21:56:53 -0000 Author: cperciva Date: Thu Apr 16 21:56:52 2020 New Revision: 360025 URL: https://svnweb.freebsd.org/changeset/base/360025 Log: Alert devd when acpi_video brightness changes On my Dell Latitude 7390 laptop, the brightness hotkeys (Fn+) send ACPI notifications which acpi_video handles by adjusting its brightness setting; but ACPI does not actually do anything with the backlight. Announcing brightness changes via devd makes it possible to close the loop by triggering the intel_backlight utility to perform the required backlight adjustment. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24424 Modified: head/sys/dev/acpica/acpi_video.c Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Thu Apr 16 21:53:17 2020 (r360024) +++ head/sys/dev/acpica/acpi_video.c Thu Apr 16 21:56:52 2020 (r360025) @@ -1036,6 +1036,7 @@ vo_get_brightness(ACPI_HANDLE handle) static void vo_set_brightness(ACPI_HANDLE handle, int level) { + char notify_buf[16]; ACPI_STATUS status; ACPI_SERIAL_ASSERT(video_output); @@ -1043,6 +1044,8 @@ vo_set_brightness(ACPI_HANDLE handle, int level) if (ACPI_FAILURE(status)) printf("can't evaluate %s._BCM - %s\n", acpi_name(handle), AcpiFormatException(status)); + snprintf(notify_buf, sizeof(notify_buf), "notify=%d", level); + devctl_notify("ACPI", "Video", "brightness", notify_buf); } static UINT32