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: yakui_zhao <yakui.zhao@intel.com>,
	lenb@kernel.org, linux-acpi@vger.kernel.org,
	rpurdie@linux.intel.com, jbarnes@virtuousgeek.org,
	Zhang Rui <rui.zhang@intel.com>, Matthew Garrett <mjg@redhat.com>
Subject: Re: a backlight issue
Date: Sun, 23 Aug 2009 09:41:19 -0300	[thread overview]
Message-ID: <20090823124119.GA28731@khazad-dum.debian.net> (raw)
In-Reply-To: <200908071025.31793.trenn@suse.de>

On Fri, 07 Aug 2009, Thomas Renninger wrote:
> > I do, but I don't know if it is a better solution.  In its "purest" form it
> > would be:  Teach the backlight core to have backlight domains and add a
> > backlight domain controler there.
> > 
> > You get KMS, platform drivers taking care of the main LVDS screen, and ACPI
> > on a single domain, let the kernel select ACPI by default or a different one
> > by command line, and let userspace change it through sysfs.
> > 
> > Drivers need some change to actually just register their backlight hooks
> > (plus hooks for "activate driver" and "deactivate driver", which are new)
> > with the backlight domain controller instead of a full backlight
> > device/class.  Other backlight drivers just register their own device using
> > the existing API.
> > 
> > Now, is that a better solution? I don't know.
> I don't think so. It sounds like quite some code/complexity that needs to be
> added for no functional enhancement.
> This is all about solving the complexity in kernel or in userspace.
> As it is *much* easier in userspace, I'd go that way.

I might even agree with you, but I object that any interface that publishes
broken controls to userspace is good.  We should only expose stuff that
works, if KMS is busted in a given platform, no KMS controls should be
exposed, etc.  Publishing two controls that "work" but fight each other is
worse.

Besides, we *have* the notion of a main screen on almost every platform, and
exposing the main screen backlight control in a single way (and allowing the
user to select the backlight control strategy at runtime, after we did our
best to select the proper one by default) is much more user-fiendly and
neat.

What we have currently just barely cuts it, and wouldn't handle secondary
displays of any sort.

> > But it is more user-friendly than what we have now, and more powerful.
> Why is it more powerful?

See above.  One can override the control strategy at runtime to select any
backlight driver that could work (this assumes backlight drivers refuse to
install when the support they need isn't there, which is a safe assumption
as that's exactly what we try to do already).

> It's about solving the problem in kernel or in userspace, while userspace
> might have additional info for choosing the right thing.

It can still choose.  But now almost every userspace app has a single
control point.  Just like we do in the API used for kernel drivers, we
should aim for userspace ABIs that are easy to use right.

> > It is also more complex.
> Which is a very strong argument.

Not that strong, the added complexity is NOT too high, as backlight
_already_ operates based on context that is passed around as a pointer, and
on hooks that are inside this context structure.  Also, the propler layering
already exists.

I'd say it is a matter of a few hundred lines of code in the backlight
class, and the change of one function call on the backend drivers, to
register the backlight class on the proper domain.

> BTW: How would several graphics cards/monitors and switching between them
> be handled currently or in future?

The above "backlight domain controller" could take care of it with very
small changes to the design.

> I once had such a machine and IIRC you ended up in double steps using generic
> ACPI backlight funcs on both graphics cards. When I saw the two active ACPI
> graphics devices I was happy that this was the only related defect and
> silently ignored it :)

I do expect we will have some headaches on the firmware side of things, yes
:-)

-- 
  "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

      reply	other threads:[~2009-08-23 12:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-25  2:09 a backlight issue yakui_zhao
2009-06-25  9:39 ` Richard Purdie
2009-08-05 12:50 ` Thomas Renninger
2009-08-06 12:55   ` Henrique de Moraes Holschuh
2009-08-06 13:38     ` Thomas Renninger
2009-08-06 19:50       ` Henrique de Moraes Holschuh
2009-08-07  8:25         ` Thomas Renninger
2009-08-23 12:41           ` Henrique de Moraes Holschuh [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=20090823124119.GA28731@khazad-dum.debian.net \
    --to=hmh@hmh.eng.br \
    --cc=jbarnes@virtuousgeek.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=rpurdie@linux.intel.com \
    --cc=rui.zhang@intel.com \
    --cc=trenn@suse.de \
    --cc=yakui.zhao@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