Thread (2 messages) flat view 2 messages, 2 authors, 2005-12-08

Re: Frame swapping

From: "Antonino A. Daplas" <adaplas@gmail.com>
Date: 2005-12-08 21:25:05

Jenkins, Clive wrote:
How is frame swapping done, using the mechanisms provided
by FB (in 2.4 and 2.6)?
Can anyone point me to any good code examples in the
existing FB device drivers?

["Frame swapping" or "video page flipping" is switching
to an alternate framebuffer memory area during the
vertical blank period. This is a common technique to
achieve animation or a single clean change of picture.]
Use the pan display ioctl, FBIOPAN_DISPLAY.  Basically, set
var->yres_virtual to be at least 2x var->yres so you can have
2 video buffers, one visible, one offscreen.  Then just do a
ypan ioctl to set which buffer becomes visible and which
becomes offscreen.

Doing it during vblank is a little difficult.  You can poll
the VGA registers (which is slow), or set up an interrupt
handler for the driver you are using that waits for vblank.

See www.directfb.org for code on how this can be done.  Also,
the directfb source have patches to some drivers that implements
the wating for vblank, such as in matroxfb.

Tony



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help