[ltp] Re: Comparison: rovclock and PowerPlay

David Abrahams linux-thinkpad@linux-thinkpad.org
Tue, 29 Aug 2006 19:39:35 -0400


"Alex Deucher" <alexdeucher@gmail.com> writes:

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

OK

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

Am I using the "fn-F7 toggle" or the "ibm_acpi video toggles?"
I would have assumed the latter, but then you mention the former
further on.  Oh, the latter is the /proc/acpi/ibm/video stuff?

OK, then why do you think I'm using the former?  The ibm_acpi
documentation says that when you enable that mask bit, it turns off
the bios-based screen expansion function and turns on the ACPI event.
Unless the docs are lying, something in fglrx is listening for the
ACPI event and adjusting the screen, so isn't confused about
anything.  It certainly knows which screens are enabled as
demonstrated by

  aticonfig --query-monitor

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

Sorry to ask so many stupid questions, but I'm (a little too)
literal-minded and you're leaving out many details I need to
understand what you're saying.  Who's "we?"  Are you an ATI employee?

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

I gather you're saying that the incantation above that changes the
hotkey mask results in just such a call into the video bios via
ibm_acpi?  I don't understand why it would have anything to do with
the video bios, though, since its purpose is merely to expose
keystrokes to the ACPI system.

> if you do that while X is running, X has no knowledge of what the
> bios has just done and vice versa.  

Do you really mean X, or do you mean fglrx, my video driver?

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

I guess I still don't see where I've run afoul of the law here.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com