Date: Thu, 16 Apr 2020 21:56:52 +0000 (UTC) From: Colin Percival <cperciva@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360025 - head/sys/dev/acpica Message-ID: <202004162156.03GLuqgw058432@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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+<up/down arrow>) 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004162156.03GLuqgw058432>