public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: Thomas Renninger <trenn@suse.de>
Cc: ak@linux.intel.com, mjg59@srcf.ucam.org,
	jwoithe@physics.adelaide.edu.au, rui.zhang@intel.com,
	corentincj@iksaif.net, linux-acpi@vger.kernel.org,
	dannybaumann@web.de, marcus@better.se, corsac@debian.org,
	mzxreary@0pointer.de, carlos@strangeworlds.co.uk,
	malattia@linux.it
Subject: Re: [PATCH 10/11] thinkpad_acpi: fingers off backlight if video.ko is serving this functionality
Date: Wed, 16 Jul 2008 09:40:44 -0300	[thread overview]
Message-ID: <20080716124044.GA3329@khazad-dum.debian.net> (raw)
In-Reply-To: <1216205553-8486-11-git-send-email-trenn@suse.de>

On Wed, 16 Jul 2008, Thomas Renninger wrote:
> @@ -2337,6 +2341,28 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
>  		case 1:
>  			/* 0x1000-0x1FFF: key presses */
>  			scancode = hkey & 0xfff;
> +			if (tp_features.bright_igdmode) {
> +				/* ToDo:
> +				 * Is there an already defined key?
> +				 */
> +				if (hkey == 0x1011) {
> +					if (ibm_backlight_device->
> +					    props.brightness > 0) {
> +						ibm_backlight_device->
> +							props.brightness--;
> +					}
> +				} else if (hkey == 0x1010) {
> +					if (ibm_backlight_device->
> +					    props.brightness <
> +					    ibm_backlight_device->
> +					    props.max_brightness) {
> +						ibm_backlight_device->
> +							props.brightness++;
> +					}
> +				}
> +				brightness_update_status(ibm_backlight_device);
> +			}
> +

NAK.   Sorry I didn't look it over in detail the last time you posted
this.

As per my golden rule for thinkpad-acpi (always have some way to let the
user disable such stuff, because it WILL break in some thinkpad), these
need to be configurable as a module parameter.

Extending brightness_mode (it is a bitmap) to let one force igd_mode
on and off would solve this detail.

Also, usually I would veto such automatic hotkey handling in the driver,
but since the firmware ALREADY does it on every IBM thinkpad anyway (and
I can't fix it since hotpatching DSDT in code is absolutely forbidden),
the driver has all facilities needed to deal with it.

One question: is there a good reason to actually have the hotkey
handling for IGD mode directly in thinkpad-acpi?  We don't do it for
Vista BIOS, video.ko doesn't do it either (anymore)... and I would make
it configurable for IBM firmware if I could.

Anyway, that means hotkey-driven igd_mode brightness change, if handled
by thinkpad-acpi without going through userspace, HAS to mask off the
relevant hotkeys in hotkey_init and set to KEY_RESERVED the relevant
keymap entries.   The code is there already, but it does mean you
need to factor out brightness_mode autodetection into a function
of its own, and have it run BEFORE hotkey_init and brightness_init
have a chance to run, because both will have to be in sync.

If you'd rather not have all that work, just add minimal support for igd
and the video stuff to thinkpad-acpi so that it doesn't get in the way
of your work, and I will follow up with whatever else enhancements are
needed.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

  parent reply	other threads:[~2008-07-16 12:40 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-16 10:52 Check for ACPI backlight support otherwise use vendor ACPI drivers - version 2 Thomas Renninger
2008-07-16 10:52 ` [PATCH 01/11] ACPI: video: Ignore devices that aren't present in hardware Thomas Renninger
2008-07-16 10:52 ` [PATCH 02/11] Check for ACPI backlight support otherwise use vendor ACPI drivers Thomas Renninger
2008-07-16 11:16   ` Matthew Garrett
2008-07-16 13:01     ` Sergio Monteiro Basto
2008-07-17 13:52       ` Thomas Renninger
2008-07-18  3:18         ` Sergio Monteiro Basto
2008-07-18  2:54           ` Thomas Renninger
2008-07-18  3:52             ` Sergio Monteiro Basto
2008-07-17  6:33   ` Zhao Yakui
2008-08-01  1:27   ` Zhang Rui
2008-07-16 10:52 ` [PATCH 03/11] Acer-WMI: fingers off backlight if video.ko is serving this functionality Thomas Renninger
2008-07-16 17:42   ` Carlos Corbacho
2008-07-16 10:52 ` [PATCH 04/11] asus-acpi: " Thomas Renninger
2008-07-16 10:52 ` [PATCH 05/11] eeepc-laptop: " Thomas Renninger
2008-07-16 10:52 ` [PATCH 06/11] fujitsu-laptop: " Thomas Renninger
2008-07-16 23:11   ` Jonathan Woithe
2008-07-18  0:04   ` Jonathan Woithe
2008-07-16 10:52 ` [PATCH 07/11] fujitsu-laptop: Fix section mismatch Thomas Renninger
2008-07-16 10:52 ` [PATCH 08/11] msi-laptop: fingers off backlight if video.ko is serving this functionality Thomas Renninger
2008-07-16 10:52 ` [PATCH 09/11] sony-laptop: " Thomas Renninger
2008-07-16 10:52 ` [PATCH 10/11] thinkpad_acpi: " Thomas Renninger
2008-07-16 11:20   ` Matthew Garrett
2008-07-16 11:36     ` Thomas Renninger
2008-07-16 12:40   ` Henrique de Moraes Holschuh [this message]
2008-07-16 12:47     ` Matthew Garrett
2008-07-16 13:38       ` Henrique de Moraes Holschuh
2008-07-16 15:27         ` Thomas Renninger
2008-07-16 15:29           ` Matthew Garrett
2008-07-16 15:49             ` Yves-Alexis Perez
2008-07-17  9:10             ` Andi Kleen
2008-07-17 10:46               ` Matthew Garrett
2008-07-17 11:18                 ` Yves-Alexis Perez
2008-07-17 11:25                   ` Matthew Garrett
2008-07-16 10:52 ` [PATCH 11/11] compal: " Thomas Renninger
     [not found] ` <20080716105931.GC1701@corsac.net>
2008-07-16 11:16   ` Check for ACPI backlight support otherwise use vendor ACPI drivers - version 2 Thomas Renninger
2008-07-19  6:01 ` Yves-Alexis Perez
2008-07-30  6:29 ` Yves-Alexis Perez
2008-07-30  9:06   ` Thomas Renninger
2008-07-31  0:35     ` Jonathan Woithe
2008-07-31  2:28       ` Zhang Rui
2008-07-31  2:51         ` Check for ACPI backlight support otherwise use vendor ACPI Jonathan Woithe
2008-07-31  5:22           ` Zhang Rui
2008-07-31 15:32     ` Check for ACPI backlight support otherwise use vendor ACPI drivers - version 2 nokos
2008-07-31 23:00       ` Check for ACPI backlight support otherwise use vendor ACPI Jonathan Woithe
2008-08-01  1:28       ` Check for ACPI backlight support otherwise use vendor ACPIdrivers - version 2 Zhang Rui
2008-08-01  8:25         ` nokos
2008-08-01  9:29         ` nokos
  -- strict thread matches above, loose matches on Subject: below --
2008-07-17 17:32 Check for ACPI backlight support otherwise use vendor ACPI drivers - version 3 Thomas Renninger
2008-07-17 17:32 ` [PATCH 10/11] thinkpad_acpi: fingers off backlight if video.ko is serving this functionality Thomas Renninger

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=20080716124044.GA3329@khazad-dum.debian.net \
    --to=hmh@hmh.eng.br \
    --cc=ak@linux.intel.com \
    --cc=carlos@strangeworlds.co.uk \
    --cc=corentincj@iksaif.net \
    --cc=corsac@debian.org \
    --cc=dannybaumann@web.de \
    --cc=jwoithe@physics.adelaide.edu.au \
    --cc=linux-acpi@vger.kernel.org \
    --cc=malattia@linux.it \
    --cc=marcus@better.se \
    --cc=mjg59@srcf.ucam.org \
    --cc=mzxreary@0pointer.de \
    --cc=rui.zhang@intel.com \
    --cc=trenn@suse.de \
    /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