Lines Matching refs:var
218 static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_info *);
256 static inline u_int palette_pbs(struct fb_var_screeninfo *var) in palette_pbs() argument
259 switch (var->bits_per_pixel) { in palette_pbs()
281 val |= palette_pbs(&fbi->fb.var); in sa1100fb_setpalettereg()
314 if (fbi->fb.var.grayscale) in sa1100fb_setcolreg()
325 val = chan_to_field(red, &fbi->fb.var.red); in sa1100fb_setcolreg()
326 val |= chan_to_field(green, &fbi->fb.var.green); in sa1100fb_setcolreg()
327 val |= chan_to_field(blue, &fbi->fb.var.blue); in sa1100fb_setcolreg()
350 static inline unsigned int sa1100fb_display_dma_period(struct fb_var_screeninfo *var) in sa1100fb_display_dma_period() argument
356 return var->pixclock * 8 * 16 / var->bits_per_pixel; in sa1100fb_display_dma_period()
367 sa1100fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) in sa1100fb_check_var() argument
373 if (var->xres < MIN_XRES) in sa1100fb_check_var()
374 var->xres = MIN_XRES; in sa1100fb_check_var()
375 if (var->yres < MIN_YRES) in sa1100fb_check_var()
376 var->yres = MIN_YRES; in sa1100fb_check_var()
377 if (var->xres > fbi->inf->xres) in sa1100fb_check_var()
378 var->xres = fbi->inf->xres; in sa1100fb_check_var()
379 if (var->yres > fbi->inf->yres) in sa1100fb_check_var()
380 var->yres = fbi->inf->yres; in sa1100fb_check_var()
381 var->xres_virtual = max(var->xres_virtual, var->xres); in sa1100fb_check_var()
382 var->yres_virtual = max(var->yres_virtual, var->yres); in sa1100fb_check_var()
384 dev_dbg(fbi->dev, "var->bits_per_pixel=%d\n", var->bits_per_pixel); in sa1100fb_check_var()
385 switch (var->bits_per_pixel) { in sa1100fb_check_var()
403 var->red = fbi->rgb[rgbidx]->red; in sa1100fb_check_var()
404 var->green = fbi->rgb[rgbidx]->green; in sa1100fb_check_var()
405 var->blue = fbi->rgb[rgbidx]->blue; in sa1100fb_check_var()
406 var->transp = fbi->rgb[rgbidx]->transp; in sa1100fb_check_var()
409 var->red.length, var->green.length, var->blue.length, in sa1100fb_check_var()
410 var->transp.length); in sa1100fb_check_var()
413 var->red.offset, var->green.offset, var->blue.offset, in sa1100fb_check_var()
414 var->transp.offset); in sa1100fb_check_var()
418 sa1100fb_display_dma_period(var), in sa1100fb_check_var()
439 struct fb_var_screeninfo *var = &info->var; in sa1100fb_set_par() local
444 if (var->bits_per_pixel == 16) in sa1100fb_set_par()
457 fbi->fb.fix.line_length = var->xres_virtual * in sa1100fb_set_par()
458 var->bits_per_pixel / 8; in sa1100fb_set_par()
459 fbi->palette_size = var->bits_per_pixel == 8 ? 256 : 16; in sa1100fb_set_par()
472 sa1100fb_activate_var(var, fbi); in sa1100fb_set_par()
487 if (!kspc && (fbi->fb.var.bits_per_pixel == 16 || fbi->inf->cmap_static))
609 static int sa1100fb_activate_var(struct fb_var_screeninfo *var, struct sa1100fb_info *fbi) in sa1100fb_activate_var() argument
618 var->xres, var->hsync_len, in sa1100fb_activate_var()
619 var->left_margin, var->right_margin); in sa1100fb_activate_var()
621 var->yres, var->vsync_len, in sa1100fb_activate_var()
622 var->upper_margin, var->lower_margin); in sa1100fb_activate_var()
625 if (var->xres < 16 || var->xres > 1024) in sa1100fb_activate_var()
627 fbi->fb.fix.id, var->xres); in sa1100fb_activate_var()
628 if (var->hsync_len < 1 || var->hsync_len > 64) in sa1100fb_activate_var()
630 fbi->fb.fix.id, var->hsync_len); in sa1100fb_activate_var()
631 if (var->left_margin < 1 || var->left_margin > 255) in sa1100fb_activate_var()
633 fbi->fb.fix.id, var->left_margin); in sa1100fb_activate_var()
634 if (var->right_margin < 1 || var->right_margin > 255) in sa1100fb_activate_var()
636 fbi->fb.fix.id, var->right_margin); in sa1100fb_activate_var()
637 if (var->yres < 1 || var->yres > 1024) in sa1100fb_activate_var()
639 fbi->fb.fix.id, var->yres); in sa1100fb_activate_var()
640 if (var->vsync_len < 1 || var->vsync_len > 64) in sa1100fb_activate_var()
642 fbi->fb.fix.id, var->vsync_len); in sa1100fb_activate_var()
643 if (var->upper_margin < 0 || var->upper_margin > 255) in sa1100fb_activate_var()
645 fbi->fb.fix.id, var->upper_margin); in sa1100fb_activate_var()
646 if (var->lower_margin < 0 || var->lower_margin > 255) in sa1100fb_activate_var()
648 fbi->fb.fix.id, var->lower_margin); in sa1100fb_activate_var()
656 LCCR1_DisWdth(var->xres) + in sa1100fb_activate_var()
657 LCCR1_HorSnchWdth(var->hsync_len) + in sa1100fb_activate_var()
658 LCCR1_BegLnDel(var->left_margin) + in sa1100fb_activate_var()
659 LCCR1_EndLnDel(var->right_margin); in sa1100fb_activate_var()
665 yres = var->yres; in sa1100fb_activate_var()
671 LCCR2_VrtSnchWdth(var->vsync_len) + in sa1100fb_activate_var()
672 LCCR2_BegFrmDel(var->upper_margin) + in sa1100fb_activate_var()
673 LCCR2_EndFrmDel(var->lower_margin); in sa1100fb_activate_var()
675 pcd = get_pcd(fbi, var->pixclock); in sa1100fb_activate_var()
677 (var->sync & FB_SYNC_HOR_HIGH_ACT ? LCCR3_HorSnchH : LCCR3_HorSnchL) | in sa1100fb_activate_var()
678 (var->sync & FB_SYNC_VERT_HIGH_ACT ? LCCR3_VrtSnchH : LCCR3_VrtSnchL); in sa1100fb_activate_var()
685 half_screen_size = var->bits_per_pixel; in sa1100fb_activate_var()
686 half_screen_size = half_screen_size * var->xres * var->yres / 16; in sa1100fb_activate_var()
756 if (fbi->fb.var.bits_per_pixel > 8 || in sa1100fb_setup_gpio()
787 fbi->palette_cpu[0] |= palette_pbs(&fbi->fb.var); in sa1100fb_enable_controller()
987 pcd = get_pcd(fbi, fbi->fb.var.pixclock); in sa1100fb_freq_transition()
1084 fbi->fb.var.nonstd = 0; in sa1100fb_init_fbinfo()
1085 fbi->fb.var.activate = FB_ACTIVATE_NOW; in sa1100fb_init_fbinfo()
1086 fbi->fb.var.height = -1; in sa1100fb_init_fbinfo()
1087 fbi->fb.var.width = -1; in sa1100fb_init_fbinfo()
1088 fbi->fb.var.accel_flags = 0; in sa1100fb_init_fbinfo()
1089 fbi->fb.var.vmode = FB_VMODE_NONINTERLACED; in sa1100fb_init_fbinfo()
1109 fbi->fb.var.xres = inf->xres; in sa1100fb_init_fbinfo()
1110 fbi->fb.var.xres_virtual = inf->xres; in sa1100fb_init_fbinfo()
1111 fbi->fb.var.yres = inf->yres; in sa1100fb_init_fbinfo()
1112 fbi->fb.var.yres_virtual = inf->yres; in sa1100fb_init_fbinfo()
1113 fbi->fb.var.bits_per_pixel = inf->bpp; in sa1100fb_init_fbinfo()
1114 fbi->fb.var.pixclock = inf->pixclock; in sa1100fb_init_fbinfo()
1115 fbi->fb.var.hsync_len = inf->hsync_len; in sa1100fb_init_fbinfo()
1116 fbi->fb.var.left_margin = inf->left_margin; in sa1100fb_init_fbinfo()
1117 fbi->fb.var.right_margin = inf->right_margin; in sa1100fb_init_fbinfo()
1118 fbi->fb.var.vsync_len = inf->vsync_len; in sa1100fb_init_fbinfo()
1119 fbi->fb.var.upper_margin = inf->upper_margin; in sa1100fb_init_fbinfo()
1120 fbi->fb.var.lower_margin = inf->lower_margin; in sa1100fb_init_fbinfo()
1121 fbi->fb.var.sync = inf->sync; in sa1100fb_init_fbinfo()
1122 fbi->fb.var.grayscale = inf->cmap_greyscale; in sa1100fb_init_fbinfo()
1188 sa1100fb_check_var(&fbi->fb.var, &fbi->fb); in sa1100fb_probe()