Frame buffer Reading fails!!

2 messages, 2 authors, 2003-01-04 · open the first message on its own page

Frame buffer Reading fails!!

From: Abhilash <hidden>
Date: 2003-01-04 10:06:16

Hello,

As u suggested I tried following code in RedHat7.1.
But it shows

 "The framebuffer device was opened successfully."
 "Error reading fixed information."

What could be the problem?
I am new to this.

Thank you,
Abhilash.


#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>

int main()
{
    int fbfd = 0;
    struct fb_var_screeninfo vinfo;
    struct fb_fix_screeninfo finfo;
    long int screensize = 0;
    char *fbp = 0;
    int x = 0, y = 0;
    long int location = 0;

    // Open the file for reading and writing
    fbfd = open("/dev/fb0", O_RDWR);
    if (!fbfd) {
        printf("Error: cannot open framebuffer device.\n");
        exit(1);
    }
    printf("The framebuffer device was opened successfully.\n");

    // Get fixed screen information
    if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo)) {
        printf("Error reading fixed information.\n");
        exit(2);
    }
}

----- Original Message -----
From: "Geert Uytterhoeven" <geert@linux-m68k.org>
To: "Abhilash" <redacted>
Cc: "Linux Frame Buffer Device Development"
[off-list ref]
Sent: Friday, December 27, 2002 5:03 PM
Subject: Re: [Linux-fbdev-devel] Screen Capturing

On Fri, 27 Dec 2002, Abhilash wrote:
quoted
I need to capture the screen .For that I use mirror driver in
Windows
for
quoted
capturing screen.
ie, its basically overloading the driver functions.

So in case of Linux, is there any method like this or which is the
best
quoted
method?
In Xlib there are some functions to capture screen and also heard
abt
VESA
quoted
which is better?
If you are using a frame buffer device, you can capture the contents
of
/dev/fb*. Either read from /dev/fb*, or mmap() it. The data you
receive
are in
the native format of the graphics chip. For CLUT modes, you have to
use an
ioctl() to get the colormap.

Gr{oetje,eeting}s,

Geert

Re: Frame buffer Reading fails!!

From: Antonino Daplas <hidden>
Date: 2003-01-04 11:19:20

On Fri, 2003-01-03 at 23:48, Abhilash wrote:
Hello,

As u suggested I tried following code in RedHat7.1.
But it shows

 "The framebuffer device was opened successfully."
 "Error reading fixed information."

What could be the problem?
I am new to this.
Try doing it again as root.  /dev/fbX is most probably owned by root (as
it should be).

If it still doesn't work, do a  

cat /dev/urandom > /dev/fb0 

to check if /dev/fb0 is valid.  BTW, what fb driver are you using?

Tony





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help