-
- switch(var->nonstd&0x0f)
- {
- case 0: // rgb
- switch(var->bits_per_pixel)
- {
- case 16: // rgb565
- var->xres_virtual = (var->xres_virtual + 0x1) & (~0x1);
- var->xres = (var->xres + 0x1) & (~0x1);
- var->xoffset = (var->xoffset) & (~0x1);
- break;
- default: // rgb888
- var->bits_per_pixel = 32;
- break;
- }
- var->nonstd &= ~0xc0; //not support I2P in this format
- break;
- case 1: // yuv422
- var->xres_virtual = (var->xres_virtual + 0x3) & (~0x3);
- var->xres = (var->xres + 0x3) & (~0x3);
- var->xoffset = (var->xoffset) & (~0x3);
- break;
- case 2: // yuv4200
- var->xres_virtual = (var->xres_virtual + 0x3) & (~0x3);
- var->yres_virtual = (var->yres_virtual + 0x1) & (~0x1);
- var->xres = (var->xres + 0x3) & (~0x3);
- var->yres = (var->yres + 0x1) & (~0x1);
- var->xoffset = (var->xoffset) & (~0x3);
- var->yoffset = (var->yoffset) & (~0x1);
- break;
- case 3: // yuv4201
- var->xres_virtual = (var->xres_virtual + 0x3) & (~0x3);
- var->yres_virtual = (var->yres_virtual + 0x1) & (~0x1);
- var->xres = (var->xres + 0x3) & (~0x3);
- var->yres = (var->yres + 0x1) & (~0x1);
- var->xoffset = (var->xoffset) & (~0x3);
- var->yoffset = (var->yoffset) & (~0x1);
- var->nonstd &= ~0xc0; //not support I2P in this format
- break;
- case 4: // none
- case 5: // yuv444
- var->xres_virtual = (var->xres_virtual + 0x3) & (~0x3);
- var->xres = (var->xres + 0x3) & (~0x3);
- var->xoffset = (var->xoffset) & (~0x3);
- var->nonstd &= ~0xc0; //not support I2P in this format
- break;
- default:
- printk(">>>>>> fb1 var->nonstd=%d is invalid! \n", var->nonstd);
- return -EINVAL;
- }
-