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