On Mon, May 19, 2008 at 5:03 PM, Jakob Bornecrantz <[EMAIL PROTECTED]> wrote: > On Mon, May 19, 2008 at 4:35 PM, Keith Whitwell > <[EMAIL PROTECTED]> wrote: >>> The biggest question is where we can write or read pages to swap at >>> suspend to RAM and resume from RAM under all occasions. >>> >>> If not we have no other option then to have pages as backing store if >>> we want to support suspend to ram for cards with VRAM that turn the >>> ram of at suspend to RAM. >> >> It should be possible. The two-phased approach that seems to be >> ascendent would give all the opportunity you need in the "prepare" >> phase, while the full system is still running. >> >> http://lwn.net/Articles/274008/ >> >> Keith > > Yes a two step program can work. At prepare we turn on backing storage > mode for VRAM, that is all buffers in VRAM gain backing storage and > all buffers that are moved to VRAM keep their pages. Then at suspend > we copy everything down from VRAM and turn the card off. > > The problem is that after prepare things must still work as before so > clients can still render so we can't copy pages down then. I also > don't think we can count on swap being around at the call to suspend. > Heck a system might not even have swap.
So the whole idea is that we have a backing store mode that is only used between prepare and suspend to make sure that buffers in VRAM can be saved. Some updates, allocating 1GB plus of memory might not work at prepare, for that matter allocating 64-256mb might not go that well over with the kernel developers for that matter. So the idea is that at prepare we evict all buffers that we can from VRAM and if we feel like it AGP too. If the driver is using a superioctl we can also temporary stop all submissions through it and wait on the last fence to be sure we can move all buffers out. That should only leave the cmdbuffer(s) and scanout buffer(s) left. For the buffers that are in VRAM we now allocate backing stores, this should not fail since we have just unpinned a lot of memory. Should this fail we are out of luck and can not suspend. After that we turn on backing store mode and unlock the superioctl so that clients can use it. Since the card should still work after prepare from what I can understand. Cheers Jakob. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ -- _______________________________________________ Dri-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dri-devel
