All of lore.kernel.org
 help / color / mirror / Atom feed
* kernel 2.6.18: Confusion about Macintosh backlight configuration
@ 2007-01-20 14:06 Matthias Grimm
  2007-01-22  3:33 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Grimm @ 2007-01-20 14:06 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: ben, paulus, 407671


Hi,
I know your guys are very busy and sometimes a email got lost. Normally
I would let it run but this time debian is going to integrate a kernel
from my point of view with a grave bug and they rejected any change
because they can't see any changes in the upstream project. (see debian
bug #407671)

I added the new SysFS backlight interface to PBButtons and struggled
over a bit of the kernel 2.6.18 (stable) configuration. Beside other we
have two options in Device Driver -> Macintosh Drivers:

CONFIG_PMAC_BACKLIGHT enables
 1. the generic backlight code used for the SysFS interface *and*
 2. the direct backlight manipulating routines for older PowerBooks.
    This means the kernel itself react to the brightness keys and
    change backlight level accordingly. This feature interferes with
    user space daemons like pbbuttonsd.

CONFIG_PMAC_BACKLIGHT enables
 1. PMU_IOC_GET_BACKLIGHT
 2. PMU_IOC_SET_BACKLIGHT
 3. PMU_IOC_GRAB_BACKLIGHT

The help text of CONFIG_PMAC_BACKLIGHT suggests that this option is only
needed if I have an old PowerBook and I could say "No" here if I use a
user space daemon. But if someone say "No" to this option he won't get any
backlight control at all (neither SysFS nor PMU).

To give a user space daemon full control over the backlight device, it has
to disable function #2 of CONFIG_PMAC_BACKLIGHT. Otherwise it would rival
with the kernel for any backlight setting.

This all leads to one single valid configuration:
  CONFIG_PMAC_BACKLIGHT        = YES
  CONFIG_PMAC_BACKLIGHT_LEGACY = YES

But If we have no choice anyway, we don't need configuration options.
Therefore here comes my suggestion:

1a. CONFIG_PMAC_BACKLIGHT
   Use this option for the generic backlight code only or compile it
   always in and get rid of this option.

1b. CONFIG_PMAC_BACKLIGHT_KERNELCTRL
   Use this option for the old Powerbooks or users that don't want to
   use a user space daemon. It should contain all the code that reads
   the brightness keys and set the backlight level in kernel space.
   Furthermore it should contain PMU_IOC_GRAB_BACKLIGHT to disable this
   behaviour during run time.

1c. CONFIG_PMAC_BACKLIGHT_LEGACY
   Should contain only interface parts that would be redundant with the
   new SysFS interface like PMU_IOC_GET_BACKLIGHT and PMU_IOC_SET_BACKLIGHT.

This will allow modern systems to be compiled only with
CONFIG_PMAC_BACKLIGHT and a user space daemon does the rest. I hope my
point could be seen. I would really appreciate if the configuration
could be cleaned up.

Other solutions could be:

2. If the sysfs backlight driver is opened switch kernel backlight keys
   handling off by calling PMU_IOC_GRAB_BACKLIGHT for machines that
   support the sysfs backlight interface.

3. Remove the kernel backlight keys control code from the kernel.

Which solution you prefer is up to you but I would be glad if at least
solution #1 could be realised.

  Best Regards
    Matthias

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kernel 2.6.18: Confusion about Macintosh backlight configuration
  2007-01-20 14:06 kernel 2.6.18: Confusion about Macintosh backlight configuration Matthias Grimm
@ 2007-01-22  3:33 ` Benjamin Herrenschmidt
  2007-01-22 15:05   ` Matthias Grimm
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2007-01-22  3:33 UTC (permalink / raw)
  To: Matthias Grimm; +Cc: linuxppc-dev, 407671, paulus

> This will allow modern systems to be compiled only with
> CONFIG_PMAC_BACKLIGHT and a user space daemon does the rest. I hope my
> point could be seen. I would really appreciate if the configuration
> could be cleaned up.
> 
> Other solutions could be:
> 
> 2. If the sysfs backlight driver is opened switch kernel backlight keys
>    handling off by calling PMU_IOC_GRAB_BACKLIGHT for machines that
>    support the sysfs backlight interface.
> 
> 3. Remove the kernel backlight keys control code from the kernel.
> 
> Which solution you prefer is up to you but I would be glad if at least
> solution #1 could be realised.

For now, at least, what prevents you from having all enabled and have
pbbuttonsd still call PMU_IOC_GRAB_BACKLIGHT ?

In the long run, we might want something smarter indeed, not sure what
the best solution is... I like having the kernel control work always
when no daemon is there.

Among others, because we have this never solved problem where
occasionally, the internal flat panel doesn't sync properly and the only
way to get it back is to turn the backlight all the way down and back up
a few times until it "kicks in".

Ben.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kernel 2.6.18: Confusion about Macintosh backlight configuration
  2007-01-22  3:33 ` Benjamin Herrenschmidt
@ 2007-01-22 15:05   ` Matthias Grimm
  2007-01-22 19:52     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias Grimm @ 2007-01-22 15:05 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, paulus, 407671

On Mon, 22 Jan 2007 14:33:35 +1100
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> > Which solution you prefer is up to you but I would be glad if at least
> > solution #1 could be realised.
> 
> For now, at least, what prevents you from having all enabled and have
> pbbuttonsd still call PMU_IOC_GRAB_BACKLIGHT ?

Nothing. Pbbuttonsd does so by now but this wouldn't help if someone set
CONFIG_PMAC_BACKLIGHT_LEGACY to off. 

I check this out with debian, hoping you will find a smart solution for
this in the future. I think the debian people getting aware of this
backwards compatibility problem now and there is hope they will fix it
for etch.

Thanks for your comment.

  Best Regards
   Matthias

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kernel 2.6.18: Confusion about Macintosh backlight configuration
  2007-01-22 15:05   ` Matthias Grimm
@ 2007-01-22 19:52     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2007-01-22 19:52 UTC (permalink / raw)
  To: Matthias Grimm; +Cc: linuxppc-dev, paulus, 407671

On Mon, 2007-01-22 at 16:05 +0100, Matthias Grimm wrote:
> On Mon, 22 Jan 2007 14:33:35 +1100
> Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> 
> > > Which solution you prefer is up to you but I would be glad if at least
> > > solution #1 could be realised.
> > 
> > For now, at least, what prevents you from having all enabled and have
> > pbbuttonsd still call PMU_IOC_GRAB_BACKLIGHT ?
> 
> Nothing. Pbbuttonsd does so by now but this wouldn't help if someone set
> CONFIG_PMAC_BACKLIGHT_LEGACY to off. 
> 
> I check this out with debian, hoping you will find a smart solution for
> this in the future. I think the debian people getting aware of this
> backwards compatibility problem now and there is hope they will fix it
> for etch.

Yes, debian should keep CONFIG_PMAC_BACKLIGHT_LEGACY enabled.

Ben.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-22 19:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-20 14:06 kernel 2.6.18: Confusion about Macintosh backlight configuration Matthias Grimm
2007-01-22  3:33 ` Benjamin Herrenschmidt
2007-01-22 15:05   ` Matthias Grimm
2007-01-22 19:52     ` Benjamin Herrenschmidt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.