Lines Matching refs:var
255 static void set_color_bitfields(struct fb_var_screeninfo *var) in set_color_bitfields() argument
257 switch (var->bits_per_pixel) { in set_color_bitfields()
260 var->red.offset = 11; var->red.length = 5; in set_color_bitfields()
261 var->green.offset = 5; var->green.length = 6; in set_color_bitfields()
262 var->blue.offset = 0; var->blue.length = 5; in set_color_bitfields()
263 var->transp.offset = 0; var->transp.length = 0; in set_color_bitfields()
266 var->red.offset = 16; var->red.length = 8; in set_color_bitfields()
267 var->green.offset = 8; var->green.length = 8; in set_color_bitfields()
268 var->blue.offset = 0; var->blue.length = 8; in set_color_bitfields()
269 var->transp.offset = 0; var->transp.length = 0; in set_color_bitfields()
273 var->red.offset = 16; var->red.length = 8; in set_color_bitfields()
274 var->green.offset = 8; var->green.length = 8; in set_color_bitfields()
275 var->blue.offset = 0; var->blue.length = 8; in set_color_bitfields()
276 var->transp.offset = 24; var->transp.length = 8; in set_color_bitfields()
296 switch (info->var.bits_per_pixel) { in pvr2fb_setcolreg()
315 pr_debug("Invalid bit depth %d?!?\n", info->var.bits_per_pixel); in pvr2fb_setcolreg()
358 struct fb_var_screeninfo *var = &info->var; in pvr2fb_set_par() local
373 var->vmode &= FB_VMODE_MASK; in pvr2fb_set_par()
374 if (var->vmode & FB_VMODE_INTERLACED && video_output != VO_VGA) in pvr2fb_set_par()
380 if (var->vmode & FB_VMODE_DOUBLE && video_output == VO_VGA) in pvr2fb_set_par()
383 par->hsync_total = var->left_margin + var->xres + var->right_margin + in pvr2fb_set_par()
384 var->hsync_len; in pvr2fb_set_par()
385 par->vsync_total = var->upper_margin + var->yres + var->lower_margin + in pvr2fb_set_par()
386 var->vsync_len; in pvr2fb_set_par()
388 if (var->sync & FB_SYNC_BROADCAST) { in pvr2fb_set_par()
414 par->diwstart_h = par->borderstart_h + var->left_margin; in pvr2fb_set_par()
415 par->diwstart_v = par->borderstart_v + var->upper_margin; in pvr2fb_set_par()
416 par->borderstop_h = par->diwstart_h + var->xres + in pvr2fb_set_par()
417 var->right_margin; in pvr2fb_set_par()
418 par->borderstop_v = par->diwstart_v + var->yres + in pvr2fb_set_par()
419 var->lower_margin; in pvr2fb_set_par()
423 if (info->var.xres < 640) in pvr2fb_set_par()
426 line_length = get_line_length(var->xres_virtual, var->bits_per_pixel); in pvr2fb_set_par()
427 par->disp_start = info->fix.smem_start + (line_length * var->yoffset) * line_length; in pvr2fb_set_par()
432 static int pvr2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) in pvr2fb_check_var() argument
438 if (var->pixclock != TV_CLK && var->pixclock != VGA_CLK) { in pvr2fb_check_var()
439 pr_debug("Invalid pixclock value %d\n", var->pixclock); in pvr2fb_check_var()
443 if (var->xres < 320) in pvr2fb_check_var()
444 var->xres = 320; in pvr2fb_check_var()
445 if (var->yres < 240) in pvr2fb_check_var()
446 var->yres = 240; in pvr2fb_check_var()
447 if (var->xres_virtual < var->xres) in pvr2fb_check_var()
448 var->xres_virtual = var->xres; in pvr2fb_check_var()
449 if (var->yres_virtual < var->yres) in pvr2fb_check_var()
450 var->yres_virtual = var->yres; in pvr2fb_check_var()
452 if (var->bits_per_pixel <= 16) in pvr2fb_check_var()
453 var->bits_per_pixel = 16; in pvr2fb_check_var()
454 else if (var->bits_per_pixel <= 24) in pvr2fb_check_var()
455 var->bits_per_pixel = 24; in pvr2fb_check_var()
456 else if (var->bits_per_pixel <= 32) in pvr2fb_check_var()
457 var->bits_per_pixel = 32; in pvr2fb_check_var()
459 set_color_bitfields(var); in pvr2fb_check_var()
461 if (var->vmode & FB_VMODE_YWRAP) { in pvr2fb_check_var()
462 if (var->xoffset || var->yoffset >= var->yres_virtual) { in pvr2fb_check_var()
463 var->xoffset = var->yoffset = 0; in pvr2fb_check_var()
465 if (var->xoffset > var->xres_virtual - var->xres || in pvr2fb_check_var()
466 var->yoffset > var->yres_virtual - var->yres) in pvr2fb_check_var()
467 var->xoffset = var->yoffset = 0; in pvr2fb_check_var()
470 var->xoffset = var->yoffset = 0; in pvr2fb_check_var()
477 if (var->yres < 480 && video_output == VO_VGA) in pvr2fb_check_var()
478 var->vmode |= FB_VMODE_DOUBLE; in pvr2fb_check_var()
481 var->sync |= FB_SYNC_BROADCAST; in pvr2fb_check_var()
482 var->vmode |= FB_VMODE_INTERLACED; in pvr2fb_check_var()
484 var->sync &= ~FB_SYNC_BROADCAST; in pvr2fb_check_var()
485 var->vmode &= ~FB_VMODE_INTERLACED; in pvr2fb_check_var()
486 var->vmode |= FB_VMODE_NONINTERLACED; in pvr2fb_check_var()
489 if ((var->activate & FB_ACTIVATE_MASK) != FB_ACTIVATE_TEST) { in pvr2fb_check_var()
490 var->right_margin = par->borderstop_h - in pvr2fb_check_var()
491 (par->diwstart_h + var->xres); in pvr2fb_check_var()
492 var->left_margin = par->diwstart_h - par->borderstart_h; in pvr2fb_check_var()
493 var->hsync_len = par->borderstart_h + in pvr2fb_check_var()
496 var->upper_margin = par->diwstart_v - par->borderstart_v; in pvr2fb_check_var()
497 var->lower_margin = par->borderstop_v - in pvr2fb_check_var()
498 (par->diwstart_v + var->yres); in pvr2fb_check_var()
499 var->vsync_len = par->borderstop_v + in pvr2fb_check_var()
503 hsync_total = var->left_margin + var->xres + var->right_margin + in pvr2fb_check_var()
504 var->hsync_len; in pvr2fb_check_var()
505 vtotal = var->upper_margin + var->yres + var->lower_margin + in pvr2fb_check_var()
506 var->vsync_len; in pvr2fb_check_var()
508 if (var->sync & FB_SYNC_BROADCAST) { in pvr2fb_check_var()
509 if (var->vmode & FB_VMODE_INTERLACED) in pvr2fb_check_var()
528 line_length = get_line_length(var->xres_virtual, var->bits_per_pixel); in pvr2fb_check_var()
529 if (line_length * var->yres_virtual > info->fix.smem_len) in pvr2fb_check_var()
538 struct fb_var_screeninfo *var = &info->var; in pvr2_update_display() local
543 get_line_length(var->xoffset+var->xres, var->bits_per_pixel), in pvr2_update_display()
556 struct fb_var_screeninfo *var = &info->var; in pvr2_init_display() local
558 unsigned int bytesperpixel = var->bits_per_pixel >> 3; in pvr2_init_display()
568 diw_height = (par->is_interlaced ? var->yres / 2 : var->yres); in pvr2_init_display()
569 diw_width = get_line_length(var->xres, var->bits_per_pixel) / 4; in pvr2_init_display()
576 get_line_length(var->xoffset+var->xres, var->bits_per_pixel), in pvr2_init_display()
821 if (!fb_find_mode(&fb_info->var, fb_info, mode_option, pvr2_modedb, in pvr2fb_common_init()
823 fb_info->var = pvr2_var; in pvr2fb_common_init()
832 modememused = get_line_length(fb_info->var.xres_virtual, in pvr2fb_common_init()
833 fb_info->var.bits_per_pixel); in pvr2fb_common_init()
834 modememused *= fb_info->var.yres_virtual; in pvr2fb_common_init()
843 fb_info->var.xres, fb_info->var.yres, in pvr2fb_common_init()
844 fb_info->var.bits_per_pixel, in pvr2fb_common_init()
845 get_line_length(fb_info->var.xres, fb_info->var.bits_per_pixel), in pvr2fb_common_init()