From: Aaron Lu <aaron.lu@intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
ACPI Devel Mailing List <linux-acpi@vger.kernel.org>,
Anton Gubarkov <anton.gubarkov@gmail.com>
Subject: Re: [PATCH v3] drm/i915/opregion: ignore firmware requests for backlight change
Date: Wed, 09 Jul 2014 09:20:22 +0800 [thread overview]
Message-ID: <53BC98D6.6020705@intel.com> (raw)
In-Reply-To: <3611713.jVJeiZUPhg@vostro.rjw.lan>
On 07/08/2014 08:48 PM, Rafael J. Wysocki wrote:
> On Tuesday, July 08, 2014 04:09:25 PM Aaron Lu wrote:
>> Some Thinkpad laptops' firmware will initiate a backlight level change
>> request through operation region on the events of AC plug/unplug, but
>> since we are not using firmware's interface to do the backlight setting
>> on these affected laptops, we do not want the firmware to use some
>> arbitrary value from its ASL variable to set the backlight level on
>> AC plug/unplug either.
>>
>> Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=76491
>> Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=77091
>> Reported-and-tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
>> Reported-and-tested-by: Anton Gubarkov <anton.gubarkov@gmail.com>
>> Signed-off-by: Aaron Lu <aaron.lu@intel.com>
>> Acked-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>> v3:
>> - use EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL;
>> - add inline to stub
>> as suggested by Rafael.
>
> I've made these two changes already in the commit in my tree.
Good, thanks!
-Aaron
>
>> drivers/acpi/video.c | 3 ++-
>> drivers/gpu/drm/i915/intel_opregion.c | 9 +++++++++
>> include/acpi/video.h | 2 ++
>> 3 files changed, 13 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
>> index fb9ffe9adc64..5bb1278e9324 100644
>> --- a/drivers/acpi/video.c
>> +++ b/drivers/acpi/video.c
>> @@ -241,13 +241,14 @@ static bool acpi_video_use_native_backlight(void)
>> return use_native_backlight_dmi;
>> }
>>
>> -static bool acpi_video_verify_backlight_support(void)
>> +bool acpi_video_verify_backlight_support(void)
>> {
>> if (acpi_osi_is_win8() && acpi_video_use_native_backlight() &&
>> backlight_device_registered(BACKLIGHT_RAW))
>> return false;
>> return acpi_video_backlight_support();
>> }
>> +EXPORT_SYMBOL_GPL(acpi_video_verify_backlight_support);
>>
>> /* backlight device sysfs support */
>> static int acpi_video_get_brightness(struct backlight_device *bd)
>> diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
>> index 2e2c71fcc9ed..4f6b53998d79 100644
>> --- a/drivers/gpu/drm/i915/intel_opregion.c
>> +++ b/drivers/gpu/drm/i915/intel_opregion.c
>> @@ -403,6 +403,15 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
>>
>> DRM_DEBUG_DRIVER("bclp = 0x%08x\n", bclp);
>>
>> + /*
>> + * If the acpi_video interface is not supposed to be used, don't
>> + * bother processing backlight level change requests from firmware.
>> + */
>> + if (!acpi_video_verify_backlight_support()) {
>> + DRM_DEBUG_KMS("opregion backlight request ignored\n");
>> + return 0;
>> + }
>> +
>> if (!(bclp & ASLE_BCLP_VALID))
>> return ASLC_BACKLIGHT_FAILED;
>>
>> diff --git a/include/acpi/video.h b/include/acpi/video.h
>> index ea4c7bbded4d..3d0bf9cd88c9 100644
>> --- a/include/acpi/video.h
>> +++ b/include/acpi/video.h
>> @@ -22,6 +22,7 @@ extern void acpi_video_unregister(void);
>> extern void acpi_video_unregister_backlight(void);
>> extern int acpi_video_get_edid(struct acpi_device *device, int type,
>> int device_id, void **edid);
>> +extern bool acpi_video_verify_backlight_support(void);
>> #else
>> static inline int acpi_video_register(void) { return 0; }
>> static inline void acpi_video_unregister(void) { return; }
>> @@ -31,6 +32,7 @@ static inline int acpi_video_get_edid(struct acpi_device *device, int type,
>> {
>> return -ENODEV;
>> }
>> +static inline bool acpi_video_verify_backlight_support() { return false; }
>
> And here you need acpi_video_verify_backlight_support(void) (fixed up too).
>
>> #endif
>>
>> #endif
>>
>
prev parent reply other threads:[~2014-07-09 1:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 2:35 [PATCH] drm/i915/opregion: ignore firmware requests for backlight change Aaron Lu
2014-06-25 11:08 ` Jani Nikula
2014-06-27 3:20 ` Aaron Lu
2014-06-30 5:26 ` Anton Gubar'kov
2014-07-04 8:06 ` Igor Gnatenko
2014-07-04 8:32 ` Igor Gnatenko
2014-07-07 7:43 ` [PATCH v2] " Aaron Lu
2014-07-07 12:51 ` Rafael J. Wysocki
2014-07-08 1:30 ` Aaron Lu
2014-07-07 13:01 ` Rafael J. Wysocki
2014-07-08 1:21 ` Aaron Lu
2014-07-08 8:09 ` [PATCH v3] " Aaron Lu
2014-07-08 12:48 ` Rafael J. Wysocki
2014-07-09 1:20 ` Aaron Lu [this message]
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=53BC98D6.6020705@intel.com \
--to=aaron.lu@intel.com \
--cc=anton.gubarkov@gmail.com \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-acpi@vger.kernel.org \
--cc=rjw@rjwysocki.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