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 _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"