Hello,
I'm developing some image processing algorithm on a BeagleBoard (rev C xM).
I'm sampling a camera via USB port.
The camera data is monochrome 8bit per pixel.
I'm displaying the image on screen using FBDEV memory mapped buffer.
Since the pixel format of the frame buffer is truecolor 32 bit I need to replicate each pixel value for r,g,b and set some alpha value.
This works fine, but it's slow.
I'd like to set the frame buffer data by using memcpy.
In order to do so I tried to change the bpp of the framebuffer using the following code:
struct fb_var_screeninfo screen_info;
...
ioctl(fd, FBIOGET_VSCREENINFO, &screen_info);
...
screen_info.bits_per_pixel = 8;
screen_info.red.length = screen_info.green.length = screen_info.blue.length = screen_info.transp.length = 8;
screen_info.red.offset = 0;
screen_info.green.offset = 0;
screen_info.blue.offset = 0;
screen_info.transp.offset = 0;
ioctl(fd, FBIOPUT_VSCREENINFO, &screen_info);
the FBIOPUT_VSCREENINFO fails.
I also tried changing to 8bit using the fbset command. It also fails.
I tried to change the color LUT using the FBIOPUTCMAP ioctl. it changed the map but the 8bpp command still failed.
changing to 24bit/16bit works both in code and by fbset.
I'm using the angstrom distribution created by the narcissus tool (no xwin, only console).
I've three questions regarding the issue:
1. How do I get information why the ioctl failed? can I find FBIOPUT_VSCREENINFO specific errors return values?
2. What is the correct way to change the bpp to 8 and use a colormap or grayscale direct values?
3. If driver update is required, does it mean the kernel should be rebuilt? (I'm new to the whole xloader-uboot-kernel-filesystem interconnection and had tons of issues trying to change them, eventually unsuccessfully)