This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Changing bpp to 8bit fails

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)


  • More information:

    Even trying to set the display to 8bpp using the uboot kernel command line doesn't work.

    Kernel command line: console=ttyS2,115200n8 mpurate=auto buddy=none camera=lbcm5m03 vram=24M mem=80M@0x80000000 mem=324M@0x88000000 omapfb.vram=0:12M,1:8M,2:4M omapfb.mode=dvi:640x480MR-8@60 omapdss.def_disp=dvi root=/dev/nfs rw ip=a.b.c.d:255.255.255.0:a.b.c.1:usb0 nolock,rsize=1024,wsize=1024 nfsroot=a.b.c.e:/home/beagle/Target/FileSystem/fs rootfstype=ext3 rootwait

    after linux loads fbset shows that the geometry is 32bpp.

    I thought it might be the DVI doesn't support 8bpp but then read somewhere that it does.

    Any ideas would be appreciated.

    Thanks,

     Guy.