Greetings all. So I'm interested in double buffering /dev/fb0 so that I can get smooth transitions on my sign. This link
Talks about opening the frame buffer, them mapping a buffer that is'twice' as big.
Well some interesting bits, if I do an FBIOGET_FSCREENINFO the line length is 8192. (this is the stride) Now I can map 1920 x 8192 but that sets up for 2K pixels per line (4 bytes per pixel) however this seems to be correct as writing into the frame buffer memory using that stride and the ARGB32 format gets me what I expect.
Now I want to double buffer it, so I want to map two buffers, and I want to be able to tell the frame buffer to switch.
This is my code:
/* open frame buffer device */
__fb = fd = open("/dev/fb0", O_RDWR);
if (fd >= 0) {
if (!ioctl(fd, FBIOGET_VSCREENINFO, &screen_info) &&
!ioctl(fd, FBIOGET_FSCREENINFO, &fixed_info)) {
buflen = screen_info.yres_virtual * fixed_info.line_length;
screen_data(&screen_info);
buffer = (unsigned char *) mmap(NULL, buflen,
PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
if (buffer != MAP_FAILED) {
If I try to map buflen * 2 (two frames) the mmap fails. So I'm wondering how to allocate a second buffer, and once allocated how I can swap to it in my 'flip_page()' routine.
--Chuck