Lines Matching refs:var
606 static int sh_mobile_format_fourcc(const struct fb_var_screeninfo *var)
608 if (var->grayscale > 1)
609 return var->grayscale;
611 switch (var->bits_per_pixel) {
623 static int sh_mobile_format_is_fourcc(const struct fb_var_screeninfo *var)
625 return var->grayscale > 1;
723 const struct fb_var_screeninfo *var = &ch->info->var;
729 tmp |= (var->sync & FB_SYNC_VERT_HIGH_ACT) ? 0 : LDMT1R_VPOL;
730 tmp |= (var->sync & FB_SYNC_HOR_HIGH_ACT) ? 0 : LDMT1R_HPOL;
1104 static int __sh_mobile_lcdc_check_var(struct fb_var_screeninfo *var,
1107 if (var->xres > MAX_XRES || var->yres > MAX_YRES)
1113 if (var->xres_virtual < var->xres)
1114 var->xres_virtual = var->xres;
1115 if (var->yres_virtual < var->yres)
1116 var->yres_virtual = var->yres;
1118 if (sh_mobile_format_is_fourcc(var)) {
1121 format = sh_mobile_format_info(var->grayscale);
1124 var->bits_per_pixel = format->bpp;
1130 var->colorspace = V4L2_COLORSPACE_SRGB;
1131 else if (var->colorspace != V4L2_COLORSPACE_REC709)
1132 var->colorspace = V4L2_COLORSPACE_JPEG;
1134 if (var->bits_per_pixel <= 16) { /* RGB 565 */
1135 var->bits_per_pixel = 16;
1136 var->red.offset = 11;
1137 var->red.length = 5;
1138 var->green.offset = 5;
1139 var->green.length = 6;
1140 var->blue.offset = 0;
1141 var->blue.length = 5;
1142 var->transp.offset = 0;
1143 var->transp.length = 0;
1144 } else if (var->bits_per_pixel <= 24) { /* RGB 888 */
1145 var->bits_per_pixel = 24;
1146 var->red.offset = 16;
1147 var->red.length = 8;
1148 var->green.offset = 8;
1149 var->green.length = 8;
1150 var->blue.offset = 0;
1151 var->blue.length = 8;
1152 var->transp.offset = 0;
1153 var->transp.length = 0;
1154 } else if (var->bits_per_pixel <= 32) { /* RGBA 888 */
1155 var->bits_per_pixel = 32;
1156 var->red.offset = 16;
1157 var->red.length = 8;
1158 var->green.offset = 8;
1159 var->green.length = 8;
1160 var->blue.offset = 0;
1161 var->blue.length = 8;
1162 var->transp.offset = 24;
1163 var->transp.length = 8;
1167 var->red.msb_right = 0;
1168 var->green.msb_right = 0;
1169 var->blue.msb_right = 0;
1170 var->transp.msb_right = 0;
1174 if (var->xres_virtual * var->yres_virtual * var->bits_per_pixel / 8 >
1363 static int sh_mobile_lcdc_overlay_pan(struct fb_var_screeninfo *var,
1373 y_offset = (var->yoffset * ovl->xres_virtual + var->xoffset)
1380 y_offset = var->yoffset * ovl->xres_virtual + var->xoffset;
1381 c_offset = var->yoffset / ysub * ovl->xres_virtual * 2 / xsub
1382 + var->xoffset * 2 / xsub;
1425 static int sh_mobile_lcdc_overlay_check_var(struct fb_var_screeninfo *var,
1428 return __sh_mobile_lcdc_check_var(var, info);
1436 sh_mobile_format_info(sh_mobile_format_fourcc(&info->var));
1438 ovl->xres = info->var.xres;
1439 ovl->xres_virtual = info->var.xres_virtual;
1440 ovl->yres = info->var.yres;
1441 ovl->yres_virtual = info->var.yres_virtual;
1444 ovl->pitch = info->var.xres_virtual;
1446 ovl->pitch = info->var.xres_virtual * ovl->format->bpp / 8;
1452 if (sh_mobile_format_is_fourcc(&info->var)) {
1531 dev_name(lcdc->dev), ovl->index, info->var.xres,
1532 info->var.yres, info->var.bits_per_pixel);
1558 struct fb_var_screeninfo *var;
1599 var = &info->var;
1600 memset(var, 0, sizeof(*var));
1601 var->xres = ovl->xres;
1602 var->yres = ovl->yres;
1603 var->xres_virtual = ovl->xres_virtual;
1604 var->yres_virtual = ovl->yres_virtual;
1605 var->activate = FB_ACTIVATE_NOW;
1611 var->bits_per_pixel = ovl->format->bpp;
1613 var->grayscale = ovl->format->fourcc;
1615 return sh_mobile_lcdc_overlay_check_var(var, info);
1633 red >>= 16 - info->var.red.length;
1634 green >>= 16 - info->var.green.length;
1635 blue >>= 16 - info->var.blue.length;
1636 transp >>= 16 - info->var.transp.length;
1638 palette[regno] = (red << info->var.red.offset) |
1639 (green << info->var.green.offset) |
1640 (blue << info->var.blue.offset) |
1641 (transp << info->var.transp.offset);
1678 static int sh_mobile_lcdc_pan(struct fb_var_screeninfo *var,
1689 y_offset = (var->yoffset * ch->xres_virtual + var->xoffset)
1696 y_offset = var->yoffset * ch->xres_virtual + var->xoffset;
1697 c_offset = var->yoffset / ysub * ch->xres_virtual * 2 / xsub
1698 + var->xoffset * 2 / xsub;
1753 struct fb_var_screeninfo var;
1760 fb_var_to_videomode(&mode, &info->var);
1766 var = info->var;
1767 fb_videomode_to_var(&var, &ch->display.mode);
1768 var.width = ch->display.width;
1769 var.height = ch->display.height;
1770 var.activate = FB_ACTIVATE_NOW;
1772 if (fb_set_var(info, &var) < 0)
1817 static int sh_mobile_lcdc_check_var(struct fb_var_screeninfo *var,
1838 if (var->xres > mode->xres || var->yres > mode->yres)
1841 dist = var->xres * var->yres + mode->xres * mode->yres
1842 - 2 * min(var->xres, mode->xres)
1843 * min(var->yres, mode->yres);
1857 var->xres = best_xres;
1858 var->yres = best_yres;
1861 ret = __sh_mobile_lcdc_check_var(var, info);
1867 p->forced_fourcc != sh_mobile_format_fourcc(var))
1880 ch->format = sh_mobile_format_info(sh_mobile_format_fourcc(&info->var));
1881 ch->colorspace = info->var.colorspace;
1883 ch->xres = info->var.xres;
1884 ch->xres_virtual = info->var.xres_virtual;
1885 ch->yres = info->var.yres;
1886 ch->yres_virtual = info->var.yres_virtual;
1889 ch->pitch = info->var.xres_virtual;
1891 ch->pitch = info->var.xres_virtual * ch->format->bpp / 8;
1899 if (sh_mobile_format_is_fourcc(&info->var)) {
2011 "mainlcd" : "sublcd", info->var.xres, info->var.yres,
2012 info->var.bits_per_pixel);
2041 struct fb_var_screeninfo *var;
2094 var = &info->var;
2095 fb_videomode_to_var(var, modes);
2096 var->width = ch->display.width;
2097 var->height = ch->display.height;
2098 var->xres_virtual = ch->xres_virtual;
2099 var->yres_virtual = ch->yres_virtual;
2100 var->activate = FB_ACTIVATE_NOW;
2106 var->bits_per_pixel = ch->format->bpp;
2108 var->grayscale = ch->format->fourcc;
2110 ret = sh_mobile_lcdc_check_var(var, info);