From: Aaron Lu <aaron.lu@intel.com>
To: Hans de Goede <hdegoede@redhat.com>, Lee Chun-Yi <jlee@suse.com>
Cc: Zhang Rui <rui.zhang@intel.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>,
Matthew Garrett <matthew.garrett@nebula.com>,
Massimiliano <massi.ergosum@gmail.com>,
linux-acpi@vger.kernel.org, platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH 2/4] acpi-video: Add an acpi_video_unregister_backlight function
Date: Fri, 16 May 2014 10:26:25 +0800 [thread overview]
Message-ID: <53757751.8090808@intel.com> (raw)
In-Reply-To: <1400152956-9053-3-git-send-email-hdegoede@redhat.com>
On 05/15/2014 07:22 PM, Hans de Goede wrote:
> Add an acpi_video_unregister_backlight function, which only unregisters
> the backlight device, and leaves the acpi_notifier in place. Some acpi_vendor
> driver need this as they don't want the acpi_video# backlight device, but do
> need the acpi-video driver for hotkey handling.
>
> Chances are that this new acpi_video_unregister_backlight() is actually
> what existing acpi_vendor drivers have wanted all along. Currently acpi_vendor
> drivers which want to disable the acpi_video# backlight device, make 2 calls:
>
> acpi_video_dmi_promote_vendor();
> acpi_video_unregister();
>
> The intention here is to make things independent of when acpi_video_register()
> gets called. As acpi_video_register() will get called on acpi-video load time
> on non intel gfx machines, while it gets called on i915 load time on intel
> gfx machines.
>
> This leads to the following 2 interesting scenarios:
>
> a) intel gfx:
> 1) acpi-video module gets loaded (as it is a dependency of acpi_vendor and i915)
> 2) acpi-video does NOT call acpi_video_register()
> 3) acpi_vendor loads (lets assume it loads before i915), calls
> acpi_video_dmi_promote_vendor(); which sets ACPI_VIDEO_BACKLIGHT_DMI_VENDOR
> 4) calls acpi_video_unregister -> not registered, nop
> 5) i915 loads, calls acpi_video_register
> 6) acpi_video_register registers the acpi_notifier for the hotkeys,
> does NOT register a backlight device because of ACPI_VIDEO_BACKLIGHT_DMI_VENDOR
>
> b) non intel gfx
> 1) acpi-video module gets loaded (as it is a dependency acpi_vendor)
> 2) acpi-video calls acpi_video_register()
> 3) acpi_video_register registers the acpi_notifier for the hotkeys,
> and a backlight device
> 4) acpi_vendor loads, calls acpi_video_dmi_promote_vendor()
> 5) calls acpi_video_unregister, this unregisters BOTH the acpi_notifier for
> the hotkeys AND the backlight device
>
> So here we have possibly the same acpi_vendor module, making the same calls,
> but with different results, in one cases acpi-video does handle hotkeys,
> in the other it does not.
>
> Note that the a) scenario turns into b) if we assume the i915 module loads
> before the vendor_acpi module, so we also have different behavior depending
> on module loading order!
>
> So as said I believe that quite a few existing acpi_vendor modules really
> always want the behavior of a), hence this patch adds a new
> acpi_video_unregister_backlight() which gives the behavior of a) independent
> of module loading order.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Aaron Lu <aaron.lu@intel.com>
next prev parent reply other threads:[~2014-05-16 2:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-15 11:22 [PATCH 0/4] Add acpi_video_unregister_backlight(), use in acer-wmi Hans de Goede
2014-05-15 11:22 ` [PATCH 1/4] acpi-video: Don't register acpi_video_resume notifier without backlight devices Hans de Goede
2014-05-16 2:25 ` Aaron Lu
2014-05-19 22:59 ` Rafael J. Wysocki
2014-05-15 11:22 ` [PATCH 2/4] acpi-video: Add an acpi_video_unregister_backlight function Hans de Goede
2014-05-16 2:26 ` Aaron Lu [this message]
2014-05-15 11:22 ` [PATCH 3/4] acer-wmi: Switch to acpi_video_unregister_backlight Hans de Goede
2014-05-15 11:22 ` [PATCH 4/4] acer-wmi: Add Aspire 5741 to video_vendor_dmi_table 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=53757751.8090808@intel.com \
--to=aaron.lu@intel.com \
--cc=hdegoede@redhat.com \
--cc=jlee@suse.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=massi.ergosum@gmail.com \
--cc=matthew.garrett@nebula.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=rui.zhang@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).