Lines Matching refs:var
200 static void set_color_bitfields(struct fb_var_screeninfo *var);
201 static int pvr2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info);
286 static void set_color_bitfields(struct fb_var_screeninfo *var) in set_color_bitfields() argument
288 switch (var->bits_per_pixel) { in set_color_bitfields()
291 var->red.offset = 11; var->red.length = 5; in set_color_bitfields()
292 var->green.offset = 5; var->green.length = 6; in set_color_bitfields()
293 var->blue.offset = 0; var->blue.length = 5; in set_color_bitfields()
294 var->transp.offset = 0; var->transp.length = 0; in set_color_bitfields()
297 var->red.offset = 16; var->red.length = 8; in set_color_bitfields()
298 var->green.offset = 8; var->green.length = 8; in set_color_bitfields()
299 var->blue.offset = 0; var->blue.length = 8; in set_color_bitfields()
300 var->transp.offset = 0; var->transp.length = 0; in set_color_bitfields()
304 var->red.offset = 16; var->red.length = 8; in set_color_bitfields()
305 var->green.offset = 8; var->green.length = 8; in set_color_bitfields()
306 var->blue.offset = 0; var->blue.length = 8; in set_color_bitfields()
307 var->transp.offset = 24; var->transp.length = 8; in set_color_bitfields()
327 switch (info->var.bits_per_pixel) { in pvr2fb_setcolreg()
346 pr_debug("Invalid bit depth %d?!?\n", info->var.bits_per_pixel); in pvr2fb_setcolreg()
359 struct fb_var_screeninfo *var = &info->var; in pvr2fb_set_par() local
374 var->vmode &= FB_VMODE_MASK; in pvr2fb_set_par()
375 if (var->vmode & FB_VMODE_INTERLACED && video_output != VO_VGA) in pvr2fb_set_par()
381 if (var->vmode & FB_VMODE_DOUBLE && video_output == VO_VGA) in pvr2fb_set_par()
384 par->hsync_total = var->left_margin + var->xres + var->right_margin + in pvr2fb_set_par()
385 var->hsync_len; in pvr2fb_set_par()
386 par->vsync_total = var->upper_margin + var->yres + var->lower_margin + in pvr2fb_set_par()
387 var->vsync_len; in pvr2fb_set_par()
389 if (var->sync & FB_SYNC_BROADCAST) { in pvr2fb_set_par()
415 par->diwstart_h = par->borderstart_h + var->left_margin; in pvr2fb_set_par()
416 par->diwstart_v = par->borderstart_v + var->upper_margin; in pvr2fb_set_par()
417 par->borderstop_h = par->diwstart_h + var->xres + in pvr2fb_set_par()
418 var->right_margin; in pvr2fb_set_par()
419 par->borderstop_v = par->diwstart_v + var->yres + in pvr2fb_set_par()
420 var->lower_margin; in pvr2fb_set_par()
424 if (info->var.xres < 640) in pvr2fb_set_par()
427 line_length = get_line_length(var->xres_virtual, var->bits_per_pixel); in pvr2fb_set_par()
428 par->disp_start = info->fix.smem_start + (line_length * var->yoffset) * line_length; in pvr2fb_set_par()
433 static int pvr2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) in pvr2fb_check_var() argument
439 if (var->pixclock != TV_CLK && var->pixclock != VGA_CLK) { in pvr2fb_check_var()
440 pr_debug("Invalid pixclock value %d\n", var->pixclock); in pvr2fb_check_var()
444 if (var->xres < 320) in pvr2fb_check_var()
445 var->xres = 320; in pvr2fb_check_var()
446 if (var->yres < 240) in pvr2fb_check_var()
447 var->yres = 240; in pvr2fb_check_var()
448 if (var->xres_virtual < var->xres) in pvr2fb_check_var()
449 var->xres_virtual = var->xres; in pvr2fb_check_var()
450 if (var->yres_virtual < var->yres) in pvr2fb_check_var()
451 var->yres_virtual = var->yres; in pvr2fb_check_var()
453 if (var->bits_per_pixel <= 16) in pvr2fb_check_var()
454 var->bits_per_pixel = 16; in pvr2fb_check_var()
455 else if (var->bits_per_pixel <= 24) in pvr2fb_check_var()
456 var->bits_per_pixel = 24; in pvr2fb_check_var()
457 else if (var->bits_per_pixel <= 32) in pvr2fb_check_var()
458 var->bits_per_pixel = 32; in pvr2fb_check_var()
460 set_color_bitfields(var); in pvr2fb_check_var()
462 if (var->vmode & FB_VMODE_YWRAP) { in pvr2fb_check_var()
463 if (var->xoffset || var->yoffset < 0 || in pvr2fb_check_var()
464 var->yoffset >= var->yres_virtual) { in pvr2fb_check_var()
465 var->xoffset = var->yoffset = 0; in pvr2fb_check_var()
467 if (var->xoffset > var->xres_virtual - var->xres || in pvr2fb_check_var()
468 var->yoffset > var->yres_virtual - var->yres || in pvr2fb_check_var()
469 var->xoffset < 0 || var->yoffset < 0) in pvr2fb_check_var()
470 var->xoffset = var->yoffset = 0; in pvr2fb_check_var()
473 var->xoffset = var->yoffset = 0; in pvr2fb_check_var()
480 if (var->yres < 480 && video_output == VO_VGA) in pvr2fb_check_var()
481 var->vmode |= FB_VMODE_DOUBLE; in pvr2fb_check_var()
484 var->sync |= FB_SYNC_BROADCAST; in pvr2fb_check_var()
485 var->vmode |= FB_VMODE_INTERLACED; in pvr2fb_check_var()
487 var->sync &= ~FB_SYNC_BROADCAST; in pvr2fb_check_var()
488 var->vmode &= ~FB_VMODE_INTERLACED; in pvr2fb_check_var()
489 var->vmode |= FB_VMODE_NONINTERLACED; in pvr2fb_check_var()
492 if ((var->activate & FB_ACTIVATE_MASK) != FB_ACTIVATE_TEST) { in pvr2fb_check_var()
493 var->right_margin = par->borderstop_h - in pvr2fb_check_var()
494 (par->diwstart_h + var->xres); in pvr2fb_check_var()
495 var->left_margin = par->diwstart_h - par->borderstart_h; in pvr2fb_check_var()
496 var->hsync_len = par->borderstart_h + in pvr2fb_check_var()
499 var->upper_margin = par->diwstart_v - par->borderstart_v; in pvr2fb_check_var()
500 var->lower_margin = par->borderstop_v - in pvr2fb_check_var()
501 (par->diwstart_v + var->yres); in pvr2fb_check_var()
502 var->vsync_len = par->borderstop_v + in pvr2fb_check_var()
506 hsync_total = var->left_margin + var->xres + var->right_margin + in pvr2fb_check_var()
507 var->hsync_len; in pvr2fb_check_var()
508 vtotal = var->upper_margin + var->yres + var->lower_margin + in pvr2fb_check_var()
509 var->vsync_len; in pvr2fb_check_var()
511 if (var->sync & FB_SYNC_BROADCAST) { in pvr2fb_check_var()
512 if (var->vmode & FB_VMODE_INTERLACED) in pvr2fb_check_var()
531 line_length = get_line_length(var->xres_virtual, var->bits_per_pixel); in pvr2fb_check_var()
532 if (line_length * var->yres_virtual > info->fix.smem_len) in pvr2fb_check_var()
541 struct fb_var_screeninfo *var = &info->var; in pvr2_update_display() local
546 get_line_length(var->xoffset+var->xres, var->bits_per_pixel), in pvr2_update_display()
559 struct fb_var_screeninfo *var = &info->var; in pvr2_init_display() local
561 unsigned int bytesperpixel = var->bits_per_pixel >> 3; in pvr2_init_display()
571 diw_height = (par->is_interlaced ? var->yres / 2 : var->yres); in pvr2_init_display()
572 diw_width = get_line_length(var->xres, var->bits_per_pixel) / 4; in pvr2_init_display()
579 get_line_length(var->xoffset+var->xres, var->bits_per_pixel), in pvr2_init_display()
803 if (!fb_find_mode(&fb_info->var, fb_info, mode_option, pvr2_modedb, in pvr2fb_common_init()
805 fb_info->var = pvr2_var; in pvr2fb_common_init()
814 modememused = get_line_length(fb_info->var.xres_virtual, in pvr2fb_common_init()
815 fb_info->var.bits_per_pixel); in pvr2fb_common_init()
816 modememused *= fb_info->var.yres_virtual; in pvr2fb_common_init()
824 fb_info->node, fb_info->var.xres, fb_info->var.yres, in pvr2fb_common_init()
825 fb_info->var.bits_per_pixel, in pvr2fb_common_init()
826 get_line_length(fb_info->var.xres, fb_info->var.bits_per_pixel), in pvr2fb_common_init()