* [PATCH 0/3] ACPI: video: Fix backlight regressions in 6.1
@ 2022-11-04 21:21 Hans de Goede
2022-11-04 21:21 ` [PATCH 1/3] ACPI: video: Improve Chromebook checks Hans de Goede
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Hans de Goede @ 2022-11-04 21:21 UTC (permalink / raw)
To: Rafael J . Wysocki, Len Brown; +Cc: Hans de Goede, Matthew Garrett, linux-acpi
Hi Rafael,
Here is a series of patches to fix known (and likely also unknown)
regressions caused by the backlight-detect refactor landing in 6.1.
This builds on top of the earlier Chromebook fix which went upstream
through platform-drivers-x86.git/fixes. as such I believe it would
be best for this series to go upstream through the pdx86 tree.
Can you please give your Ack for merging this through the pdx86
git tree?
Regards,
Hans
Hans de Goede (3):
ACPI: video: Improve Chromebook checks
ACPI: video: Make acpi_video_backlight_use_native() always return true
ACPI: video: Add backlight=native DMI quirk for Dell G15 5515
drivers/acpi/video_detect.c | 41 +++++++++++++++++++++++++++++--------
1 file changed, 32 insertions(+), 9 deletions(-)
--
2.37.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] ACPI: video: Improve Chromebook checks
2022-11-04 21:21 [PATCH 0/3] ACPI: video: Fix backlight regressions in 6.1 Hans de Goede
@ 2022-11-04 21:21 ` Hans de Goede
2022-11-04 21:21 ` [PATCH 2/3] ACPI: video: Make acpi_video_backlight_use_native() always return true Hans de Goede
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Hans de Goede @ 2022-11-04 21:21 UTC (permalink / raw)
To: Rafael J . Wysocki, Len Brown
Cc: Hans de Goede, Matthew Garrett, linux-acpi, Mr . Chromebox
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..06aaec2e378b 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 prefer 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] 7+ messages in thread
* [PATCH 2/3] ACPI: video: Make acpi_video_backlight_use_native() always return true
2022-11-04 21:21 [PATCH 0/3] ACPI: video: Fix backlight regressions in 6.1 Hans de Goede
2022-11-04 21:21 ` [PATCH 1/3] ACPI: video: Improve Chromebook checks Hans de Goede
@ 2022-11-04 21:21 ` Hans de Goede
2022-11-04 21:21 ` [PATCH 3/3] ACPI: video: Add backlight=native DMI quirk for Dell G15 5515 Hans de Goede
2022-11-05 18:03 ` [PATCH 0/3] ACPI: video: Fix backlight regressions in 6.1 Rafael J. Wysocki
3 siblings, 0 replies; 7+ messages in thread
From: Hans de Goede @ 2022-11-04 21:21 UTC (permalink / raw)
To: Rafael J . Wysocki, Len Brown
Cc: Hans de Goede, Matthew Garrett, linux-acpi, Iris, John Warriner,
Scott Ostrander, Matthias Rampke
Testing has shown that there are quite a few laptop models which rely
on native backlight control and which do not support ACPI video bus
backlight control, causing __acpi_video_get_backlight_type() to return
vendor. Known Windows laptop models affected by this are:
Acer Aspire 1640
HP Compaq nc6120
IBM ThinkPad X40
System76 Starling Star1
and the following MacBook models are affected too:
Apple MacBook 2.1
Apple MacBook 4.1
Apple MacBook Pro 7.1
the list of affected Windows laptop models is likely just the top of
the iceberg. So for now lets undo the change to not register native
backlight class devices when __acpi_video_get_backlight_type() != native.
Since as part of the backlight-detect refactor the detection code now
relies on the GPU drivers calling acpi_video_backlight_use_native() to
learn that native backlight support is available we cannot just remove
the acpi_video_backlight_use_native() calls from the GPU drivers.
Instead modify acpi_video_backlight_use_native() to always return true
for now. This is meant as a temporary work-around, which will be removed
again when the heuristics from __acpi_video_get_backlight_type() have
been improved so that they will return native on affected models.
Reported-by: Matthew Garrett <mjg59@srcf.ucam.org>
Reported-by: Iris <pawel.js@protonmail.com>
Reported-by: John Warriner <taijitu@cox.net>
Reported-by: Scott Ostrander <sos12_3@hotmail.com>
Reported-by: Matthias Rampke <matthias.rampke@googlemail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/acpi/video_detect.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index 06aaec2e378b..c02e960cdbe3 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -751,6 +751,18 @@ EXPORT_SYMBOL(acpi_video_get_backlight_type);
bool acpi_video_backlight_use_native(void)
{
- return __acpi_video_get_backlight_type(true) == acpi_backlight_native;
+ /*
+ * Call __acpi_video_get_backlight_type() to let it know that
+ * a native backlight is available.
+ */
+ __acpi_video_get_backlight_type(true);
+
+ /*
+ * For now just always return true. There is a whole bunch of laptop
+ * models where (video_caps & ACPI_VIDEO_BACKLIGHT) is false causing
+ * __acpi_video_get_backlight_type() to return vendor, while these
+ * models only have a native backlight control.
+ */
+ return true;
}
EXPORT_SYMBOL(acpi_video_backlight_use_native);
--
2.37.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] ACPI: video: Add backlight=native DMI quirk for Dell G15 5515
2022-11-04 21:21 [PATCH 0/3] ACPI: video: Fix backlight regressions in 6.1 Hans de Goede
2022-11-04 21:21 ` [PATCH 1/3] ACPI: video: Improve Chromebook checks Hans de Goede
2022-11-04 21:21 ` [PATCH 2/3] ACPI: video: Make acpi_video_backlight_use_native() always return true Hans de Goede
@ 2022-11-04 21:21 ` Hans de Goede
2022-11-04 22:11 ` Daniel Dadap
2022-11-05 18:03 ` [PATCH 0/3] ACPI: video: Fix backlight regressions in 6.1 Rafael J. Wysocki
3 siblings, 1 reply; 7+ messages in thread
From: Hans de Goede @ 2022-11-04 21:21 UTC (permalink / raw)
To: Rafael J . Wysocki, Len Brown
Cc: Hans de Goede, Matthew Garrett, linux-acpi, Daniel Dadap
The Dell G15 5515 has the WMI interface (and WMI call returns) expected
by the nvidia-wmi-ec-backlight interface. But the backlight class device
registered by the nvidia-wmi-ec-backlight driver does not actually work.
The amdgpu_bl0 native GPU backlight class device does actually work,
add a backlight=native DMI quirk for this.
Cc: Daniel Dadap <ddadap@nvidia.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
- Add a comment that this needs to be revisited when dynamic-mux
support gets added (suggested by: Daniel Dadap)
---
drivers/acpi/video_detect.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index c02e960cdbe3..b2a616287638 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -645,6 +645,20 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
},
},
+ /*
+ * Models which have nvidia-ec-wmi support, but should not use it.
+ * Note this indicates a likely firmware bug on these models and should
+ * be revisited if/when Linux gets support for dynamic mux mode.
+ */
+ {
+ .callback = video_detect_force_native,
+ /* Dell G15 5515 */
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"),
+ },
+ },
+
/*
* Desktops which falsely report a backlight and which our heuristics
* for this do not catch.
--
2.37.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] ACPI: video: Add backlight=native DMI quirk for Dell G15 5515
2022-11-04 21:21 ` [PATCH 3/3] ACPI: video: Add backlight=native DMI quirk for Dell G15 5515 Hans de Goede
@ 2022-11-04 22:11 ` Daniel Dadap
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Dadap @ 2022-11-04 22:11 UTC (permalink / raw)
To: Hans de Goede; +Cc: Rafael J . Wysocki, Len Brown, Matthew Garrett, linux-acpi
Thanks, Hans:
On Fri, Nov 04, 2022 at 10:21:08PM +0100, Hans de Goede wrote:
> The Dell G15 5515 has the WMI interface (and WMI call returns) expected
> by the nvidia-wmi-ec-backlight interface. But the backlight class device
> registered by the nvidia-wmi-ec-backlight driver does not actually work.
>
> The amdgpu_bl0 native GPU backlight class device does actually work,
> add a backlight=native DMI quirk for this.
>
> Cc: Daniel Dadap <ddadap@nvidia.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Daniel Dadap <ddadap@nvidia.com>
> ---
> Changes in v2:
> - Add a comment that this needs to be revisited when dynamic-mux
> support gets added (suggested by: Daniel Dadap)
> ---
> drivers/acpi/video_detect.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
> index c02e960cdbe3..b2a616287638 100644
> --- a/drivers/acpi/video_detect.c
> +++ b/drivers/acpi/video_detect.c
> @@ -645,6 +645,20 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
> },
> },
>
> + /*
> + * Models which have nvidia-ec-wmi support, but should not use it.
> + * Note this indicates a likely firmware bug on these models and should
> + * be revisited if/when Linux gets support for dynamic mux mode.
> + */
> + {
> + .callback = video_detect_force_native,
> + /* Dell G15 5515 */
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> + DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"),
> + },
> + },
> +
> /*
> * Desktops which falsely report a backlight and which our heuristics
> * for this do not catch.
> --
> 2.37.3
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] ACPI: video: Fix backlight regressions in 6.1
2022-11-04 21:21 [PATCH 0/3] ACPI: video: Fix backlight regressions in 6.1 Hans de Goede
` (2 preceding siblings ...)
2022-11-04 21:21 ` [PATCH 3/3] ACPI: video: Add backlight=native DMI quirk for Dell G15 5515 Hans de Goede
@ 2022-11-05 18:03 ` Rafael J. Wysocki
2022-11-07 10:10 ` Hans de Goede
3 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2022-11-05 18:03 UTC (permalink / raw)
To: Hans de Goede; +Cc: Rafael J . Wysocki, Len Brown, Matthew Garrett, linux-acpi
On Fri, Nov 4, 2022 at 10:22 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi Rafael,
>
> Here is a series of patches to fix known (and likely also unknown)
> regressions caused by the backlight-detect refactor landing in 6.1.
>
> This builds on top of the earlier Chromebook fix which went upstream
> through platform-drivers-x86.git/fixes. as such I believe it would
> be best for this series to go upstream through the pdx86 tree.
>
> Can you please give your Ack for merging this through the pdx86
> git tree?
Sure, feel free to add
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
to these patches.
Also note that I'm going to drop the previously applied
https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=6a377205da554cec45c8fd1cd8395030b448de31
from my tree.
Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 0/3] ACPI: video: Fix backlight regressions in 6.1
2022-11-05 18:03 ` [PATCH 0/3] ACPI: video: Fix backlight regressions in 6.1 Rafael J. Wysocki
@ 2022-11-07 10:10 ` Hans de Goede
0 siblings, 0 replies; 7+ messages in thread
From: Hans de Goede @ 2022-11-07 10:10 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Rafael J . Wysocki, Len Brown, Matthew Garrett, linux-acpi
Hi,
On 11/5/22 19:03, Rafael J. Wysocki wrote:
> On Fri, Nov 4, 2022 at 10:22 PM Hans de Goede <hdegoede@redhat.com> wrote:
>>
>> Hi Rafael,
>>
>> Here is a series of patches to fix known (and likely also unknown)
>> regressions caused by the backlight-detect refactor landing in 6.1.
>>
>> This builds on top of the earlier Chromebook fix which went upstream
>> through platform-drivers-x86.git/fixes. as such I believe it would
>> be best for this series to go upstream through the pdx86 tree.
>>
>> Can you please give your Ack for merging this through the pdx86
>> git tree?
>
> Sure, feel free to add
>
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> to these patches.
Thanks, I'll go and prepare a fixes pull-req for Linus with these patches.
> Also note that I'm going to drop the previously applied
>
> https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=6a377205da554cec45c8fd1cd8395030b448de31
Ack, thanks.
Regards,
Hans
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-11-07 10:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-04 21:21 [PATCH 0/3] ACPI: video: Fix backlight regressions in 6.1 Hans de Goede
2022-11-04 21:21 ` [PATCH 1/3] ACPI: video: Improve Chromebook checks Hans de Goede
2022-11-04 21:21 ` [PATCH 2/3] ACPI: video: Make acpi_video_backlight_use_native() always return true Hans de Goede
2022-11-04 21:21 ` [PATCH 3/3] ACPI: video: Add backlight=native DMI quirk for Dell G15 5515 Hans de Goede
2022-11-04 22:11 ` Daniel Dadap
2022-11-05 18:03 ` [PATCH 0/3] ACPI: video: Fix backlight regressions in 6.1 Rafael J. Wysocki
2022-11-07 10:10 ` Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox