Lines Matching refs:var

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