Hi,

sorry for lagging a bit on my email, it has been a quite busy week :-)

On Mon, Jun 19, 2006 at 07:22:52PM +0100, Richard Hughes wrote:
> Maybe you've seen this already:
> http://hughsient.livejournal.com/1906.html
> 
> Could you tell me what you think please, and tell me if you think it
> could be used in s2ram -- then I could merge the existing white-list you
> have in whitelist.c into the hal fdi file and we can work from a shared
> list. I noticed whitelist.c has no licence, so I wanted to ask you
> first.

First, the whitelist.c license is (as the whole suspend project) GPL, unless
i did miss something very important :-)

Generally, i think the approach "use HAL to determine the needed workarounds"
is sensible. HAL has all the needed bits and pieces to do matching based upon
hardware and software configurations AFAICS (i am no HAL expert at all, if i
need a custom fdi file for a storage device that i do want special treatment
for, i get somebody to write it for me :-) and -we might like it or not- it
will happen rather sooner than later that we will need different workarounds
depending on e.g. somebody using the NVidia driver or not.
I think that HAL can already handle that and also - maybe with the help of
some desktop helper (gnome-power-manager, kpowersave, whatever) can even tell
us if X is running, which brings us closer to success on those "can only
suspend from X"-machines.
Also, another thing that bothers me is that with HAL you should be able to
do some "proximity based matching" (not sure if this is the right term :-):
"It is an intel i915, but i do not know anything else about it, and we are
 running X with the i915 driver" => do nothing, the X server does everything
"It is an HP with ATI graphics" => forbid vesafb usage,
 do vbetool post; vbestate restore
"It is an HP with ATI graphics, model nx6125" => forbid vesafb,
 do _not_ post but only vbestate restore.
"it is an unknown IBM ThinkPad" => use s3_bios,s3_mode

You get the idea, instead of whitelisting the exact model, we could do a 
"light gray" list of probably-working machines, and handle the ones where
we need an explicit workaround separate.

Of course this all could also be implemented in s2ram, but i doubt that we
really want to duplicate this, when the code is already present and usable
in HAL.
 
> You can easily use the fdi whitelist (and using HAL) doing this:
> 
> # Suspend all video devices using the HAL dbus methods
> devices=`hal-find-by-capability --capability video_adapter_pm`
> for device in $devices
>    do
>      dbus-send --system --print-reply --dest=org.freedesktop.Hal \
>        $device org.freedesktop.Hal.Device.VideoAdapterPM.SuspendVideo
>    done
> 
> So it should fit into s2ram pretty easily if you wanted it to.

The main concern probably is, that s2ram right now is self-contained,
so no HAL or dbus or anything else is needed to get it to work.

Right now, there is no problem in co-existing, the pm-utils scripts just need
to call s2ram with "-f" which disables the internal whitelist, then "-a [123]"
for s3_bios/s3_mode, "-p" for "vbetool post" and "-s" for "vbestate save /
restore". I will probably add another switch for "vbetool vbemode get / set"
in s2ram and also for "vbetool dpms off/on".
The only thing is, that in s2ram, the workarounds come in "pairs": if it does
"vbestate save" before suspend, it will do "vbestate restore" after resume,
before returning. I believe that this is the right thing to do and even
important in order to get the restore as quickly done as possible, without
the possibility that the user presses ALT-f7 and screws up everything because
the card was not reinitialized soon enough..

If somebody really wants to implement the complex matching in s2ram, there
should be no problem to either implement an fdi parser or just write a small
converter that "compiles" the HAL fdi files to include them at compile time
into the s2ram binary.

> Comments appreciated.

I am not against it, but let's see what Pavel thinks ;-)
-- 
Stefan Seyfried                  \ "I didn't want to write for pay. I
QA / R&D Team Mobile Devices      \ wanted to be paid for what I write."
SUSE LINUX Products GmbH, Nürnberg \                    -- Leonard Cohen

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Suspend-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to