differences between linux framebuffer driver and X fbdev driver
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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?
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:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.