[ltp] Re: Comparison: rovclock and PowerPlay
Alex Deucher
linux-thinkpad@linux-thinkpad.org
Tue, 29 Aug 2006 17:41:45 -0400
On 8/29/06, David Abrahams <dave@boost-consulting.com> wrote:
> "Alex Deucher" <alexdeucher@gmail.com> writes:
>
> >> Well, I've been playing around with ACPI and hotkeys and just
> >> discovered some really interesting things. Before I could use the
> >> video hotkey I had to enable all the hotkeys with
> >>
> >> sudo echo 0xffff > /proc/acpi/ibm/hotkey
> >>
> >> (stuck it in my /etc/rc.local actually). Without customizing the
> >> event response, /etc/acpi/events/ibm-videobtn was just a do-nothing
> >> stub, but the button actually did lots: it would cycle through all
> >> combinations of screens I had connected. Brilliant!
> >
> > ibm_acpi takes over the buttons, when it does they produce button
> > events which you can use to call scripts, etc.
>
> Yes, I know; I have several of those working.
>
> > when ibm_acpi doesn't
> > claim the buttons, then the bios controls them and they call into the
> > radeon bios to toggle displays and such. the bios and the X driver
> > don't know about each other
>
> Sorry, would you mind explaining? What does the X driver have to do
> with it? So far the entities involved are ibm_acpi and the bios, and
> according to you they are mutually exclusive.
The video hardware is configured by a set of registers. those
registers can be programmed by the video bios, the X driver, a kernel
FB driver, etc. If you use VBE (vesa) or the fn-F7 toggle, or the
ibm_acpi video toggles, all of those eventually call into the video
bios which in turn programs the video registers to produce the desired
affect. The X driver does the same thing, only in the X driver we
write directly to the registers.
>
> > so they are messing with register state without the other's
> > knowledge.
>
> What registers? What are the implications of this?
There is a single set of registers that configures the video hardware.
if you call into the video bios (via ibm_acpi, or the bios, etc.) you
are changing the register state. if you do that while X is running, X
has no knowledge of what the bios has just done and vice versa. As
such you might get into a weird hardware state that could result in a
lockup or an undesireable behavior. Generally it works ok though
since the fn-F7 toggle probably only messes a couple of output related
bits.
The ideal solution would be for the the acpi module to catch all the
Fn events and then pass them ot the X driver via an event interface.
then the X driver could decide what do to: turn on output on or off,
re-run DDC, etc. Unforunately, we don't have such an interface as of
yet in X.
Alternatively, if you know how the video bios works, you can just
register an event (either acpi or some sort of internal bios event)
and the X driver will know what has happened based on some sort of
shared data such as a bios scratch register. This requires knowledge
of the video bios and scratch regs, somthing only ati has.
Alex
>
> --
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
>
> --
> The linux-thinkpad mailing list home page is at:
> http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
>