Hi, Guys:
         Did anybody run into the same problem I have now ? I have a console vx 18bit and sumsung lcd . While the red color seems abnormal, I think it is because the problem of bits_per_pixel, we find it under "/sys/class/graphics/fb0/bits_per_pixel" = 16,  we have problem in changing it into 18 bit. 
  We are using open embedded linux-2.6.21
the following code is how we tried to change it

    fbfd = open("/dev/fb0", O_RDWR);
    if (fbfd == -1) {
        perror("/dev/fb0");
        exit(1);
    }


    /* Get fixed screen information */
    if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo)) {
        perror("FBIOGET_FSCREENINFO");
        exit(2);
    }

    /*  Get variable screen information */
    if (ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo)) {
        perror("FBIOGET_VSCREENINFO");
        exit(3);
    }
// set bits_per_pixel
    vinfo.bits_per_pixel = 18;
    printf("%dx%d, %dbpp\n", vinfo.xres, vinfo.yres, vinfo.bits_per_pixel );
   
    /*  Set variable screen information */
    if (ioctl(fbfd, FBIOPUT_VSCREENINFO, &vinfo)) {
        perror("FBIOPUT_VSCREENINFO");
        exit(4);
    }

while we get error message tells us that invalid argument, when we change  vinfo.bits_per_pixel back to 16, everything works fine again.
So would anybody please tell me your idea why this happens? I really appreciate your help. Thank you very much.


Yunfei Qiu