Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-26-2006, 03:03 PM   #1
LQ Guru
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
Frame Buffer Programming - Need Documentation

Hello guys.

Hey Guys, Im working on a 2d Game Engine for embedded x86 Linux.
As size and efficiant use of resources is extrememly important, i have decided to use the vesafb frame buffer via its block device /dev/fb

excluding the need to X, SDL, or DirectFB.

Its currently in very early development - ( works my mmap'ing /dev/fb0, then memcpy'ing pixels line by line.

This is all working very nicely, except for the opviouse faults...

* Occasional Flickering...
* std-output overwriting the graphics.
* Blinking Cursor flickering in the top corner.

I need to know.....

1) How to page flip ( double buffering )
2) How to wait for Verticle sync
3) How to prevent Linux From writing text to the fbdev that im using.
4) What kernel source files provide the /dev/fb0 block device interface.

I Assume that the first two are done with ioctl's
However i cannot find any odumentation on how.

and i have no diea what so ever about how to implement number 3.

i have read the vesafb.c source code, however this does not appear to be the kernel source code that provides the /dev/fb0 block device, and so offers no information on ioctl codes.

Im affraid that i have never programmed outside of the X11 environment.. and so am a little lost at this level.

What doesnt help, is that most how-to's about frame buffers under linux were written a very long time ago, in the days of kernel 2.0.

Anyways... Thanks for any help / advice / links / code anyone can provide.
Old 12-27-2006, 02:03 PM   #2
LQ Newbie
Registered: Jun 2006
Distribution: Fedora 7
Posts: 11

Rep: Reputation: 0
I thought this might help
Old 12-10-2010, 08:45 PM   #3
LQ Newbie
Registered: Aug 2006
Location: Silicon Valley
Distribution: Slackware
Posts: 4

Rep: Reputation: 0
Did you figure this out? I'm currently trying something similar.
Old 08-07-2012, 03:29 PM   #4
LQ Newbie
Registered: Aug 2012
Posts: 1

Rep: Reputation: Disabled
struct fb_fix_screeninfo fix;
struct fb_var_screeninfo var;
int DisplayIdx; //0=Buffer 0 1=Buffer 1
int dummy=0;
unsigned int FbSize;

//Ok, now we are in the vertical retrace

//Get the video into
ioctl(Fh_frbuff,FBIOGET_FSCREENINFO,&fix); //Fixed info
ioctl(Fh_frbuff,FBIOGET_VSCREENINFO,&var); //Variable info
FbSize=(var.xres*var.yres*var.bits_per_pixel)/8; //Get buffer size
var.yoffset=var.yres*DisplayIdx; //Pan the display to buffer 1

Good luck


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
about frame buffer yugandhar Linux - Kernel 2 06-03-2006 06:07 PM
Disable Frame Buffer metamaverick SUSE / openSUSE 4 03-18-2006 09:01 AM
X server with frame buffer bluedude2288 Linux - Software 0 08-06-2004 12:37 PM
Frame buffer bkeating Linux - Newbie 6 04-22-2003 07:09 PM
kernel 2.4.17 and frame buffer help hanzerik Linux From Scratch 2 03-12-2002 01:53 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:36 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration