* [PATCH] ACPI: video: Improve Chromebook checks
@ 2022-10-31 10:58 Hans de Goede
2022-11-03 18:50 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2022-10-31 10:58 UTC (permalink / raw)
To: Rafael J . Wysocki
Cc: Hans de Goede, Len Brown, Mr . Chromebox, linux-acpi,
platform-driver-x86
2 improvements for the Chromebook handling in
acpi_video_get_backlight_type():
1. Also check for the "GOOG000C" ACPI HID used on some models
2. Move the Chromebook check to above the ACPI-video check normally
Chromebooks don't have ACPI video backlight support, but when
flashed with upstream coreboot builds they may have ACPI video
backlight support, but native should still be used/preferred then.
Suggested-by: Mr. Chromebox <mrchromebox@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/acpi/video_detect.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index 9cd8797d12bb..841f6213b4de 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -670,7 +670,7 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
static bool google_cros_ec_present(void)
{
- return acpi_dev_found("GOOG0004");
+ return acpi_dev_found("GOOG0004") || acpi_dev_found("GOOG000C");
}
/*
@@ -718,6 +718,10 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
if (apple_gmux_present())
return acpi_backlight_apple_gmux;
+ /* Chromebooks should always use native backlight control. */
+ if (google_cros_ec_present() && native_available)
+ return acpi_backlight_native;
+
/* On systems with ACPI video use either native or ACPI video. */
if (video_caps & ACPI_VIDEO_BACKLIGHT) {
/*
@@ -735,13 +739,6 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
return acpi_backlight_video;
}
- /*
- * Chromebooks that don't have backlight handle in ACPI table
- * are supposed to use native backlight if it's available.
- */
- if (google_cros_ec_present() && native_available)
- return acpi_backlight_native;
-
/* No ACPI video (old hw), use vendor specific fw methods. */
return acpi_backlight_vendor;
}
--
2.37.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ACPI: video: Improve Chromebook checks
2022-10-31 10:58 [PATCH] ACPI: video: Improve Chromebook checks Hans de Goede
@ 2022-11-03 18:50 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2022-11-03 18:50 UTC (permalink / raw)
To: Hans de Goede
Cc: Rafael J . Wysocki, Len Brown, Mr . Chromebox, linux-acpi,
platform-driver-x86
On Mon, Oct 31, 2022 at 11:58 AM Hans de Goede <hdegoede@redhat.com> wrote:
>
> 2 improvements for the Chromebook handling in
> acpi_video_get_backlight_type():
>
> 1. Also check for the "GOOG000C" ACPI HID used on some models
> 2. Move the Chromebook check to above the ACPI-video check normally
> Chromebooks don't have ACPI video backlight support, but when
> flashed with upstream coreboot builds they may have ACPI video
> backlight support, but native should still be used/preferred then.
>
> Suggested-by: Mr. Chromebox <mrchromebox@gmail.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/acpi/video_detect.c | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
> index 9cd8797d12bb..841f6213b4de 100644
> --- a/drivers/acpi/video_detect.c
> +++ b/drivers/acpi/video_detect.c
> @@ -670,7 +670,7 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
>
> static bool google_cros_ec_present(void)
> {
> - return acpi_dev_found("GOOG0004");
> + return acpi_dev_found("GOOG0004") || acpi_dev_found("GOOG000C");
> }
>
> /*
> @@ -718,6 +718,10 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
> if (apple_gmux_present())
> return acpi_backlight_apple_gmux;
>
> + /* Chromebooks should always use native backlight control. */
> + if (google_cros_ec_present() && native_available)
> + return acpi_backlight_native;
> +
> /* On systems with ACPI video use either native or ACPI video. */
> if (video_caps & ACPI_VIDEO_BACKLIGHT) {
> /*
> @@ -735,13 +739,6 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native)
> return acpi_backlight_video;
> }
>
> - /*
> - * Chromebooks that don't have backlight handle in ACPI table
> - * are supposed to use native backlight if it's available.
> - */
> - if (google_cros_ec_present() && native_available)
> - return acpi_backlight_native;
> -
> /* No ACPI video (old hw), use vendor specific fw methods. */
> return acpi_backlight_vendor;
> }
> --
Applied as 6.2 material, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-03 18:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-31 10:58 [PATCH] ACPI: video: Improve Chromebook checks Hans de Goede
2022-11-03 18:50 ` Rafael J. Wysocki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.