Lines Matching refs:var

79  * to get a fb_var_screeninfo. Otherwise define a default var as well.
174 static inline int pm3fb_depth(const struct fb_var_screeninfo *var)
176 if (var->bits_per_pixel == 16)
177 return var->red.length + var->green.length
178 + var->blue.length;
180 return var->bits_per_pixel;
217 const u32 width = (info->var.xres_virtual + 7) & ~7;
290 switch (info->var.bits_per_pixel) {
311 info->var.bits_per_pixel);
339 switch (info->var.bits_per_pixel) {
354 info->var.bits_per_pixel);
398 vxres = info->var.xres_virtual;
399 vyres = info->var.yres_virtual;
412 if (info->var.bits_per_pixel == 8)
414 if (info->var.bits_per_pixel <= 16)
457 vxres = info->var.xres_virtual;
458 vyres = info->var.yres_virtual;
541 if (info->var.bits_per_pixel == 8) {
545 if (info->var.bits_per_pixel <= 16) {
642 int x = cursor->image.dx - info->var.xoffset;
643 int y = cursor->image.dy - info->var.yoffset;
722 const u32 hsstart = info->var.right_margin;
723 const u32 hsend = hsstart + info->var.hsync_len;
724 const u32 hbend = hsend + info->var.left_margin;
725 const u32 xres = (info->var.xres + 31) & ~31;
727 const u32 vsstart = info->var.lower_margin;
728 const u32 vsend = vsstart + info->var.vsync_len;
729 const u32 vbend = vsend + info->var.upper_margin;
730 const u32 vtotal = info->var.yres + vbend;
731 const u32 width = (info->var.xres_virtual + 7) & ~7;
732 const unsigned bpp = info->var.bits_per_pixel;
828 unsigned long pixclock = PICOS2KHZ(info->var.pixclock);
857 switch (pm3fb_depth(&info->var)) {
912 static int pm3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
915 unsigned bpp = var->red.length + var->green.length
916 + var->blue.length + var->transp.length;
918 if (bpp != var->bits_per_pixel) {
921 switch (var->bits_per_pixel) {
923 var->red.length = 8;
924 var->green.length = 8;
925 var->blue.length = 8;
926 var->red.offset = 0;
927 var->green.offset = 0;
928 var->blue.offset = 0;
929 var->transp.offset = 0;
930 var->transp.length = 0;
933 var->red.length = 5;
934 var->blue.length = 5;
935 var->green.length = 6;
936 var->transp.length = 0;
939 var->red.length = 8;
940 var->green.length = 8;
941 var->blue.length = 8;
942 var->transp.length = 8;
946 var->bits_per_pixel);
951 if (var->bits_per_pixel > 8 ) {
952 var->blue.offset = 0;
953 var->green.offset = var->blue.length;
954 var->red.offset = var->green.offset + var->green.length;
955 var->transp.offset = var->red.offset + var->red.length;
957 var->height = -1;
958 var->width = -1;
960 if (var->xres != var->xres_virtual) {
966 if (var->yres > var->yres_virtual) {
972 if (var->xoffset) {
977 if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
982 var->xres = (var->xres + 31) & ~31; /* could sometimes be 8 */
983 lpitch = var->xres * ((var->bits_per_pixel + 7) >> 3);
985 if (var->xres < 200 || var->xres > 2048) {
986 DPRINTK("width not supported: %u\n", var->xres);
990 if (var->yres < 200 || var->yres > 4095) {
991 DPRINTK("height not supported: %u\n", var->yres);
995 if (lpitch * var->yres_virtual > info->fix.smem_len) {
997 var->xres, var->yres_virtual, var->bits_per_pixel);
1001 if (PICOS2KHZ(var->pixclock) > PM3_MAX_PIXCLOCK) {
1003 PICOS2KHZ(var->pixclock));
1007 var->accel_flags = 0; /* Can't mmap if this is on */
1010 var->xres, var->yres, var->bits_per_pixel);
1017 const u32 xres = (info->var.xres + 31) & ~31;
1018 const unsigned bpp = info->var.bits_per_pixel;
1020 par->base = pm3fb_shift_bpp(bpp, (info->var.yoffset * xres)
1021 + info->var.xoffset);
1024 if (info->var.sync & FB_SYNC_HOR_HIGH_ACT)
1029 if (info->var.sync & FB_SYNC_VERT_HIGH_ACT)
1034 if ((info->var.vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE)
1037 if ((info->var.activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW)
1059 info->fix.line_length = ((info->var.xres_virtual + 7) >> 3) * bpp;
1080 if (info->var.grayscale)
1084 * var->{color}.offset contains start of bitfield
1085 * var->{color}.length contains length of bitfield
1091 * color depth = SUM(var->{color}.length)
1094 * var->{color}.offset is 0
1095 * var->{color}.length contains width of DAC or the number
1099 * color depth = var->{color}.length
1107 red = CNVT_TOHW(red, info->var.red.length);
1108 green = CNVT_TOHW(green, info->var.green.length);
1109 blue = CNVT_TOHW(blue, info->var.blue.length);
1110 transp = CNVT_TOHW(transp, info->var.transp.length);
1120 v = (red << info->var.red.offset) |
1121 (green << info->var.green.offset) |
1122 (blue << info->var.blue.offset) |
1123 (transp << info->var.transp.offset);
1125 switch (info->var.bits_per_pixel) {
1140 static int pm3fb_pan_display(struct fb_var_screeninfo *var,
1144 const u32 xres = (info->var.xres + 31) & ~31;
1146 par->base = pm3fb_shift_bpp(info->var.bits_per_pixel,
1147 (var->yoffset * xres)
1148 + var->xoffset);
1423 retval = fb_find_mode(&info->var, info, mode_option, NULL, 0, NULL, 8);
1438 pm3fb_check_var(&info->var, info);