Lines Matching refs:var
39 struct fb_var_screeninfo var; member
96 static int sgivwfb_get_var(struct fb_var_screeninfo *var, int con,
98 static int sgivwfb_set_var(struct fb_var_screeninfo *var, int con,
132 struct fb_var_screeninfo *var);
249 bytesPerPixel = bytes_per_pixel(par->var.bits_per_pixel); in activate_par()
491 struct fb_var_screeninfo *var) in sgivwfb_encode_fix() argument
499 switch (var->bits_per_pixel) { in sgivwfb_encode_fix()
510 fix->line_length = get_line_length(var->xres_virtual, var->bits_per_pixel); in sgivwfb_encode_fix()
566 fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel), 1, in do_install_cmap()
578 struct fb_var_screeninfo *var; in sgivwfb_get_fix() local
581 var = &par_current.var; in sgivwfb_get_fix()
583 var = &fb_display[con].var; in sgivwfb_get_fix()
584 sgivwfb_encode_fix(fix, var); in sgivwfb_get_fix()
591 static int sgivwfb_get_var(struct fb_var_screeninfo *var, int con, in sgivwfb_get_var() argument
595 *var = par_current.var; in sgivwfb_get_var()
597 *var = fb_display[con].var; in sgivwfb_get_var()
605 static int sgivwfb_set_var(struct fb_var_screeninfo *var, int con, in sgivwfb_set_var() argument
608 int err, activate = var->activate; in sgivwfb_set_var()
629 if (var->vmode & FB_VMODE_CONUPDATE) { in sgivwfb_set_var()
630 var->vmode |= FB_VMODE_YWRAP; in sgivwfb_set_var()
631 var->xoffset = display->var.xoffset; in sgivwfb_set_var()
632 var->yoffset = display->var.yoffset; in sgivwfb_set_var()
636 var->xoffset = 0; in sgivwfb_set_var()
637 var->yoffset = 0; in sgivwfb_set_var()
640 if (var->bits_per_pixel <= 8) in sgivwfb_set_var()
641 var->bits_per_pixel = 8; in sgivwfb_set_var()
642 else if (var->bits_per_pixel <= 16) in sgivwfb_set_var()
643 var->bits_per_pixel = 16; in sgivwfb_set_var()
644 else if (var->bits_per_pixel <= 32) in sgivwfb_set_var()
645 var->bits_per_pixel = 32; in sgivwfb_set_var()
649 var->grayscale = 0; /* No grayscale for now */ in sgivwfb_set_var()
653 if (dbeVTimings[min_mode].width >= var->xres && in sgivwfb_set_var()
654 dbeVTimings[min_mode].height >= var->yres) in sgivwfb_set_var()
664 req_dot = (int)((1.0e3/1.0e6) / (1.0e-12 * (float)var->pixclock)); in sgivwfb_set_var()
665 printk(KERN_INFO "sgivwfb: requested pixclock=%d ps (%d KHz)\n", var->pixclock, in sgivwfb_set_var()
680 if (var->xres > var->xres_virtual || (!ywrap && !ypan)) in sgivwfb_set_var()
681 var->xres_virtual = var->xres; in sgivwfb_set_var()
682 if (var->yres > var->yres_virtual || (!ywrap && !ypan)) in sgivwfb_set_var()
683 var->yres_virtual = var->yres; in sgivwfb_set_var()
688 line_length = get_line_length(var->xres_virtual, var->bits_per_pixel); in sgivwfb_set_var()
689 if (line_length*var->yres_virtual > sgivwfb_mem_size) in sgivwfb_set_var()
692 switch (var->bits_per_pixel) in sgivwfb_set_var()
695 var->red.offset = 0; in sgivwfb_set_var()
696 var->red.length = 8; in sgivwfb_set_var()
697 var->green.offset = 0; in sgivwfb_set_var()
698 var->green.length = 8; in sgivwfb_set_var()
699 var->blue.offset = 0; in sgivwfb_set_var()
700 var->blue.length = 8; in sgivwfb_set_var()
701 var->transp.offset = 0; in sgivwfb_set_var()
702 var->transp.length = 0; in sgivwfb_set_var()
705 var->red.offset = 11; in sgivwfb_set_var()
706 var->red.length = 5; in sgivwfb_set_var()
707 var->green.offset = 6; in sgivwfb_set_var()
708 var->green.length = 5; in sgivwfb_set_var()
709 var->blue.offset = 1; in sgivwfb_set_var()
710 var->blue.length = 5; in sgivwfb_set_var()
711 var->transp.offset = 0; in sgivwfb_set_var()
712 var->transp.length = 0; in sgivwfb_set_var()
715 var->red.offset = 0; in sgivwfb_set_var()
716 var->red.length = 8; in sgivwfb_set_var()
717 var->green.offset = 8; in sgivwfb_set_var()
718 var->green.length = 8; in sgivwfb_set_var()
719 var->blue.offset = 16; in sgivwfb_set_var()
720 var->blue.length = 8; in sgivwfb_set_var()
721 var->transp.offset = 24; in sgivwfb_set_var()
722 var->transp.length = 8; in sgivwfb_set_var()
725 var->red.msb_right = 0; in sgivwfb_set_var()
726 var->green.msb_right = 0; in sgivwfb_set_var()
727 var->blue.msb_right = 0; in sgivwfb_set_var()
728 var->transp.msb_right = 0; in sgivwfb_set_var()
731 var->pixclock = (__u32)(1.0e+9/(float)timing->cfreq); in sgivwfb_set_var()
732 var->left_margin = timing->htotal - timing->hsync_end; in sgivwfb_set_var()
733 var->right_margin = timing->hsync_start - timing->width; in sgivwfb_set_var()
734 var->upper_margin = timing->vtotal - timing->vsync_end; in sgivwfb_set_var()
735 var->lower_margin = timing->vsync_start - timing->height; in sgivwfb_set_var()
736 var->hsync_len = timing->hsync_end - timing->hsync_start; in sgivwfb_set_var()
737 var->vsync_len = timing->vsync_end - timing->vsync_start; in sgivwfb_set_var()
740 oldxres = display->var.xres; in sgivwfb_set_var()
741 oldyres = display->var.yres; in sgivwfb_set_var()
742 oldvxres = display->var.xres_virtual; in sgivwfb_set_var()
743 oldvyres = display->var.yres_virtual; in sgivwfb_set_var()
744 oldbpp = display->var.bits_per_pixel; in sgivwfb_set_var()
745 display->var = *var; in sgivwfb_set_var()
746 par_current.var = *var; in sgivwfb_set_var()
748 if (oldxres != var->xres || oldyres != var->yres || in sgivwfb_set_var()
749 oldvxres != var->xres_virtual || oldvyres != var->yres_virtual || in sgivwfb_set_var()
750 oldbpp != var->bits_per_pixel || !par_current.valid) { in sgivwfb_set_var()
753 var->xres, var->yres, var->bits_per_pixel); in sgivwfb_set_var()
755 var->xres_virtual, var->yres_virtual); in sgivwfb_set_var()
757 sgivwfb_encode_fix(&fix, var); in sgivwfb_set_var()
767 if (oldbpp != var->bits_per_pixel || !par_current.valid) { in sgivwfb_set_var()
772 switch (var->bits_per_pixel) { in sgivwfb_set_var()
813 fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel), in sgivwfb_get_cmap()
827 int size = fb_display[con].var.bits_per_pixel == 16 ? 32 : 256; in sgivwfb_set_cmap()
907 sgivwfb_set_var(&par_current.var, -1, &fb_info); in sgivwfb_init()