From: Hans de Goede <hdegoede@redhat.com>
To: "Rafael J . Wysocki" <rjw@rjwysocki.net>, Len Brown <lenb@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
Matthew Garrett <mjg59@srcf.ucam.org>,
linux-acpi@vger.kernel.org, Iris <pawel.js@protonmail.com>,
John Warriner <taijitu@cox.net>,
Scott Ostrander <sos12_3@hotmail.com>,
Matthias Rampke <matthias.rampke@googlemail.com>
Subject: [PATCH 2/3] ACPI: video: Make acpi_video_backlight_use_native() always return true
Date: Fri, 4 Nov 2022 22:21:07 +0100 [thread overview]
Message-ID: <20221104212108.73537-3-hdegoede@redhat.com> (raw)
In-Reply-To: <20221104212108.73537-1-hdegoede@redhat.com>
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
next prev parent reply other threads:[~2022-11-04 21:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221104212108.73537-3-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=matthias.rampke@googlemail.com \
--cc=mjg59@srcf.ucam.org \
--cc=pawel.js@protonmail.com \
--cc=rjw@rjwysocki.net \
--cc=sos12_3@hotmail.com \
--cc=taijitu@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox