Lines Matching full:var
254 static void set_color_bitfields(struct fb_var_screeninfo *var) in set_color_bitfields() argument
256 switch (var->bits_per_pixel) { in set_color_bitfields()
259 var->red.offset = 11; var->red.length = 5; in set_color_bitfields()
260 var->green.offset = 5; var->green.length = 6; in set_color_bitfields()
261 var->blue.offset = 0; var->blue.length = 5; in set_color_bitfields()
262 var->transp.offset = 0; var->transp.length = 0; in set_color_bitfields()
265 var->red.offset = 16; var->red.length = 8; in set_color_bitfields()
266 var->green.offset = 8; var->green.length = 8; in set_color_bitfields()
267 var->blue.offset = 0; var->blue.length = 8; in set_color_bitfields()
268 var->transp.offset = 0; var->transp.length = 0; in set_color_bitfields()
272 var->red.offset = 16; var->red.length = 8; in set_color_bitfields()
273 var->green.offset = 8; var->green.length = 8; in set_color_bitfields()
274 var->blue.offset = 0; var->blue.length = 8; in set_color_bitfields()
275 var->transp.offset = 24; var->transp.length = 8; in set_color_bitfields()
295 switch (info->var.bits_per_pixel) { in pvr2fb_setcolreg()
314 pr_debug("Invalid bit depth %d?!?\n", info->var.bits_per_pixel); in pvr2fb_setcolreg()
357 struct fb_var_screeninfo *var = &info->var; in pvr2fb_set_par() local
372 var->vmode &= FB_VMODE_MASK; in pvr2fb_set_par()
373 if (var->vmode & FB_VMODE_INTERLACED && video_output != VO_VGA) in pvr2fb_set_par()
379 if (var->vmode & FB_VMODE_DOUBLE && video_output == VO_VGA) in pvr2fb_set_par()
382 par->hsync_total = var->left_margin + var->xres + var->right_margin + in pvr2fb_set_par()
383 var->hsync_len; in pvr2fb_set_par()
384 par->vsync_total = var->upper_margin + var->yres + var->lower_margin + in pvr2fb_set_par()
385 var->vsync_len; in pvr2fb_set_par()
387 if (var->sync & FB_SYNC_BROADCAST) { in pvr2fb_set_par()
413 par->diwstart_h = par->borderstart_h + var->left_margin; in pvr2fb_set_par()
414 par->diwstart_v = par->borderstart_v + var->upper_margin; in pvr2fb_set_par()
415 par->borderstop_h = par->diwstart_h + var->xres + in pvr2fb_set_par()
416 var->right_margin; in pvr2fb_set_par()
417 par->borderstop_v = par->diwstart_v + var->yres + in pvr2fb_set_par()
418 var->lower_margin; in pvr2fb_set_par()
422 if (info->var.xres < 640) in pvr2fb_set_par()
425 line_length = get_line_length(var->xres_virtual, var->bits_per_pixel); in pvr2fb_set_par()
426 par->disp_start = info->fix.smem_start + (line_length * var->yoffset) * line_length; in pvr2fb_set_par()
431 static int pvr2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) in pvr2fb_check_var() argument
437 if (var->pixclock != TV_CLK && var->pixclock != VGA_CLK) { in pvr2fb_check_var()
438 pr_debug("Invalid pixclock value %d\n", var->pixclock); in pvr2fb_check_var()
442 if (var->xres < 320) in pvr2fb_check_var()
443 var->xres = 320; in pvr2fb_check_var()
444 if (var->yres < 240) in pvr2fb_check_var()
445 var->yres = 240; in pvr2fb_check_var()
446 if (var->xres_virtual < var->xres) in pvr2fb_check_var()
447 var->xres_virtual = var->xres; in pvr2fb_check_var()
448 if (var->yres_virtual < var->yres) in pvr2fb_check_var()
449 var->yres_virtual = var->yres; in pvr2fb_check_var()
451 if (var->bits_per_pixel <= 16) in pvr2fb_check_var()
452 var->bits_per_pixel = 16; in pvr2fb_check_var()
453 else if (var->bits_per_pixel <= 24) in pvr2fb_check_var()
454 var->bits_per_pixel = 24; in pvr2fb_check_var()
455 else if (var->bits_per_pixel <= 32) in pvr2fb_check_var()
456 var->bits_per_pixel = 32; in pvr2fb_check_var()
458 set_color_bitfields(var); in pvr2fb_check_var()
460 if (var->vmode & FB_VMODE_YWRAP) { in pvr2fb_check_var()
461 if (var->xoffset || var->yoffset >= var->yres_virtual) { in pvr2fb_check_var()
462 var->xoffset = var->yoffset = 0; in pvr2fb_check_var()
464 if (var->xoffset > var->xres_virtual - var->xres || in pvr2fb_check_var()
465 var->yoffset > var->yres_virtual - var->yres) in pvr2fb_check_var()
466 var->xoffset = var->yoffset = 0; in pvr2fb_check_var()
469 var->xoffset = var->yoffset = 0; in pvr2fb_check_var()
476 if (var->yres < 480 && video_output == VO_VGA) in pvr2fb_check_var()
477 var->vmode |= FB_VMODE_DOUBLE; in pvr2fb_check_var()
480 var->sync |= FB_SYNC_BROADCAST; in pvr2fb_check_var()
481 var->vmode |= FB_VMODE_INTERLACED; in pvr2fb_check_var()
483 var->sync &= ~FB_SYNC_BROADCAST; in pvr2fb_check_var()
484 var->vmode &= ~FB_VMODE_INTERLACED; in pvr2fb_check_var()
485 var->vmode |= FB_VMODE_NONINTERLACED; in pvr2fb_check_var()
488 if ((var->activate & FB_ACTIVATE_MASK) != FB_ACTIVATE_TEST) { in pvr2fb_check_var()
489 var->right_margin = par->borderstop_h - in pvr2fb_check_var()
490 (par->diwstart_h + var->xres); in pvr2fb_check_var()
491 var->left_margin = par->diwstart_h - par->borderstart_h; in pvr2fb_check_var()
492 var->hsync_len = par->borderstart_h + in pvr2fb_check_var()
495 var->upper_margin = par->diwstart_v - par->borderstart_v; in pvr2fb_check_var()
496 var->lower_margin = par->borderstop_v - in pvr2fb_check_var()
497 (par->diwstart_v + var->yres); in pvr2fb_check_var()
498 var->vsync_len = par->borderstop_v + in pvr2fb_check_var()
502 hsync_total = var->left_margin + var->xres + var->right_margin + in pvr2fb_check_var()
503 var->hsync_len; in pvr2fb_check_var()
504 vtotal = var->upper_margin + var->yres + var->lower_margin + in pvr2fb_check_var()
505 var->vsync_len; in pvr2fb_check_var()
507 if (var->sync & FB_SYNC_BROADCAST) { in pvr2fb_check_var()
508 if (var->vmode & FB_VMODE_INTERLACED) in pvr2fb_check_var()
527 line_length = get_line_length(var->xres_virtual, var->bits_per_pixel); in pvr2fb_check_var()
528 if (line_length * var->yres_virtual > info->fix.smem_len) in pvr2fb_check_var()
537 struct fb_var_screeninfo *var = &info->var; in pvr2_update_display() local
542 get_line_length(var->xoffset+var->xres, var->bits_per_pixel), in pvr2_update_display()
555 struct fb_var_screeninfo *var = &info->var; in pvr2_init_display() local
557 unsigned int bytesperpixel = var->bits_per_pixel >> 3; in pvr2_init_display()
567 diw_height = (par->is_interlaced ? var->yres / 2 : var->yres); in pvr2_init_display()
568 diw_width = get_line_length(var->xres, var->bits_per_pixel) / 4; in pvr2_init_display()
575 get_line_length(var->xoffset+var->xres, var->bits_per_pixel), in pvr2_init_display()
817 if (!fb_find_mode(&fb_info->var, fb_info, mode_option, pvr2_modedb, in pvr2fb_common_init()
819 fb_info->var = pvr2_var; in pvr2fb_common_init()
828 modememused = get_line_length(fb_info->var.xres_virtual, in pvr2fb_common_init()
829 fb_info->var.bits_per_pixel); in pvr2fb_common_init()
830 modememused *= fb_info->var.yres_virtual; in pvr2fb_common_init()
839 fb_info->var.xres, fb_info->var.yres, in pvr2fb_common_init()
840 fb_info->var.bits_per_pixel, in pvr2fb_common_init()
841 get_line_length(fb_info->var.xres, fb_info->var.bits_per_pixel), in pvr2fb_common_init()