FreeBSD Bugzilla – Attachment 187601 Details for
Bug 207086
unable to change LCD brightness on Lenovo Thinkpad Edge E145
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Store brightness value in static variable; don't complain if _BQC method is missing.
bqc_missing.patch (text/plain), 1.65 KB, created by
Anthony Jenkins
on 2017-10-31 00:59:25 UTC
(
hide
)
Description:
Store brightness value in static variable; don't complain if _BQC method is missing.
Filename:
MIME Type:
Creator:
Anthony Jenkins
Created:
2017-10-31 00:59:25 UTC
Size:
1.65 KB
patch
obsolete
>commit 9bb5c06f96e0cd993d93b02cb23119a4843f626f >Author: Anthony Jenkins <Scoobi_doo@yahoo.com> >Date: Thu Mar 9 12:26:50 2017 -0500 > > Keep _BQC value in static var for machines w/o _BQC. > >diff --git a/sys/dev/acpica/acpi_video.c b/sys/dev/acpica/acpi_video.c >index 6360071b50a..e194fdf0a5d 100644 >--- a/sys/dev/acpica/acpi_video.c >+++ b/sys/dev/acpica/acpi_video.c >@@ -1012,17 +1012,43 @@ out: > return (0); > } > >+static UINT32 vo_brightness_level = 0; >+ >+static int >+vo_get_bqc(ACPI_HANDLE handle, UINT32 *level) >+{ >+ static int has_bqc = -1; >+ int retval = 0; >+ >+ switch (has_bqc) { >+ case 1: >+ retval = ACPI_FAILURE(acpi_GetInteger(handle, >+ "_BQC", &vo_brightness_level)); >+ break; >+ case -1: >+ has_bqc = ACPI_SUCCESS(acpi_GetInteger(handle, >+ "_BQC", &vo_brightness_level)); >+ break; >+ case 0: >+ default: >+ break; >+ } >+ if (retval == 0 && level != NULL) { >+ *level = vo_brightness_level; >+ } >+ return retval; >+} >+ > static int > vo_get_brightness(ACPI_HANDLE handle) > { > UINT32 level; >- ACPI_STATUS status; >+ /*ACPI_STATUS status;*/ > > ACPI_SERIAL_ASSERT(video_output); >- status = acpi_GetInteger(handle, "_BQC", &level); >- if (ACPI_FAILURE(status)) { >+ if (vo_get_bqc(handle, &level) != 0) { > printf("can't evaluate %s._BQC - %s\n", acpi_name(handle), >- AcpiFormatException(status)); >+ /*AcpiFormatException(status)*/""); > return (-1); > } > if (level > 100) >@@ -1037,6 +1063,7 @@ vo_set_brightness(ACPI_HANDLE handle, int level) > ACPI_STATUS status; > > ACPI_SERIAL_ASSERT(video_output); >+ vo_brightness_level = level; > status = acpi_SetInteger(handle, "_BCM", level); > if (ACPI_FAILURE(status)) > printf("can't evaluate %s._BCM - %s\n",
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 207086
: 187601 |
187602