LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 08-15-2006, 12:01 PM   #1
dogalmity
LQ Newbie
 
Registered: May 2006
Posts: 20

Rep: Reputation: 0
differences between linux framebuffer driver and X fbdev driver


Hey folks,

I'm hoping somebody out there can provide some information on this.

I'm doing some driver development and I'm trying to get a handle on how the X video drivers work. The linux framebuffer drivers are pretty straightforward. Vesafb, for example. It initializes and probes and whatnot the framebuffer device to get started, then uses the generic drawing functions cfb_fillrect, cfb_copyarea, and cfb_imageblit to manipulate the screen.

According to documentation the X fbdev driver (xf86-video-fbdev) is a video driver that uses the linux framebuffer device. What exactly does that mean? Does it mean that the contents of the X framebuffer is the same as whats in /dev/fb0? If I don't use the X fbdev driver is the X framebuffer stored somewhere else physically?

Also, what functions does the X driver use to manipulate the screen? From some tinkering, I've determined that it does NOT use the generic functions above. The xf86-video-fbdev source doesn't contain any screen drawing functions.

Any help would be appreciated.

Thanks,
Nathan
 
Old 08-17-2006, 11:48 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

There's a really good explanation, by Geert Uytterhoeven, in the kernel source, e.g.:

/usr/src/linux/Documentation/fb/framebuffer.txt

Here are some other links:

http://en.wikipedia.org/wiki/Linux_framebuffer
http://tldp.org/HOWTO/Framebuffer-HOWTO.html
... and ...
http://www.linux-fbdev.org/

Basically, /dev/vesafb is what you're in during system boot ... and text mode ... and any of the "<Alt-Fx>" text mode virtual consoles.

On the other hand, when you're in GUI mode, you're using whatever X driver best matches your video H/W. For example, the PC I'm using now is running the "nvidia" X driver.

'Hope that helps .. PSM

Last edited by paulsm4; 08-17-2006 at 11:51 PM.
 
Old 08-21-2006, 09:49 AM   #3
dogalmity
LQ Newbie
 
Registered: May 2006
Posts: 20

Original Poster
Rep: Reputation: 0
paulsm4,

Thanks for the reply. I've read through the kernel documentation and the fbdev and fbdevhw man files. I guess I'm looking for a guide on the internals of the X video drivers and video system. When X wants to put some pixels on the screen, what is the lowest level function called in X before the request is sent to the hardware?

Nathan
 
Old 08-21-2006, 10:14 AM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

In answer to "difference between Linux fb and X11 video driver...", please refer back to my previous post:
Quote:
Basically, /dev/vesafb is what you're in during system boot ... and text mode ... and any of the "<Alt-Fx>" text mode virtual consoles.

On the other hand, when you're in GUI mode, you're using whatever X driver best matches your video H/W. For example, the PC I'm using now is running the "nvidia" X driver.
As far as the architecture of an X11 video driver, here's a good link:

http://www.xfree86.org/current/DESIGN.html
 
Old 08-21-2006, 11:19 AM   #5
bastl
Member
 
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 237

Rep: Reputation: 22
On most systems you have a X-server in use so use those functions or QT if you want to make bit manipulation. Then the X-Server has not to be killed. QT also has a openGL implementation if the X-Server driver supports it. The driver only says X11 how to handle the features (does settings) of you graphics card. You can also write directly to your card but you won't be able to do flicker free painting when the X-server is running. A basically CPU command from the X-server is f.e.
Code:
 YASM:
 MOV [EBP],EAX ;where EAX includes one pixel (32bit)
 INC EBP       ;next ->pixel
and the descriptor is set to your graphics memory.

Last edited by bastl; 08-21-2006 at 11:31 AM.
 
Old 08-22-2006, 10:42 AM   #6
dogalmity
LQ Newbie
 
Registered: May 2006
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
As far as the architecture of an X11 video driver, here's a good link:

http://www.xfree86.org/current/DESIGN.html
Hey, now thats some good stuff right there. My ultimate goal here is to be able to detect when X is writing to the screen in some way more efficent than a constant scan of the framebuffer.

Much grass.

Nathan
 
Old 09-14-2006, 08:18 PM   #7
algogo-com
LQ Newbie
 
Registered: Sep 2006
Posts: 4

Rep: Reputation: 0
Hello,everyone!:-)
 
  


Reply



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
New NVIDIA driver and framebuffer lp449 Linux - Laptop and Netbook 3 09-25-2006 01:17 PM
Wich framebuffer driver to use? egtheb Linux - Hardware 1 07-13-2005 04:21 AM
knoppix framebuffer driver LiquidSlumber Linux - Software 1 06-07-2005 04:42 AM
VESA Framebuffer Driver hubabuba Linux - General 1 10-02-2004 07:37 AM
Framebuffer driver suriyamohan Linux - Software 4 04-26-2003 02:15 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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