Lines Matching defs:var

556  *	pm2fb_check_var - Optional function. Validates a var passed in.
557 * @var: frame buffer variable screen structure
561 * var passed in.
565 static int pm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
569 if (var->bits_per_pixel != 8 && var->bits_per_pixel != 16 &&
570 var->bits_per_pixel != 24 && var->bits_per_pixel != 32) {
571 DPRINTK("depth not supported: %u\n", var->bits_per_pixel);
575 if (var->xres != var->xres_virtual) {
581 if (var->yres > var->yres_virtual) {
588 if (var->yres_virtual > 2047) {
589 var->yres_virtual = 2047;
592 if (var->xoffset) {
597 if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
602 var->xres = (var->xres + 15) & ~15; /* could sometimes be 8 */
603 lpitch = var->xres * ((var->bits_per_pixel + 7) >> 3);
605 if (var->xres < 320 || var->xres > 1600) {
606 DPRINTK("width not supported: %u\n", var->xres);
610 if (var->yres < 200 || var->yres > 1200) {
611 DPRINTK("height not supported: %u\n", var->yres);
615 if (lpitch * var->yres_virtual > info->fix.smem_len) {
617 var->xres, var->yres_virtual, var->bits_per_pixel);
621 if (!var->pixclock) {
626 if (PICOS2KHZ(var->pixclock) > PM2_MAX_PIXCLOCK) {
628 PICOS2KHZ(var->pixclock));
632 var->transp.offset = 0;
633 var->transp.length = 0;
634 switch (var->bits_per_pixel) {
636 var->red.length = 8;
637 var->green.length = 8;
638 var->blue.length = 8;
641 var->red.offset = 11;
642 var->red.length = 5;
643 var->green.offset = 5;
644 var->green.length = 6;
645 var->blue.offset = 0;
646 var->blue.length = 5;
649 var->transp.offset = 24;
650 var->transp.length = 8;
651 var->red.offset = 16;
652 var->green.offset = 8;
653 var->blue.offset = 0;
654 var->red.length = 8;
655 var->green.length = 8;
656 var->blue.length = 8;
660 var->red.offset = 0;
661 var->blue.offset = 16;
663 var->red.offset = 16;
664 var->blue.offset = 0;
666 var->green.offset = 8;
667 var->red.length = 8;
668 var->green.length = 8;
669 var->blue.length = 8;
672 var->height = -1;
673 var->width = -1;
675 var->accel_flags = 0; /* Can't mmap if this is on */
678 var->xres, var->yres, var->bits_per_pixel);
693 u32 width = (info->var.xres_virtual + 7) & ~7;
694 u32 height = info->var.yres_virtual;
695 u32 depth = (info->var.bits_per_pixel + 7) & ~7;
706 u32 xres = (info->var.xres + 31) & ~31;
718 pixclock = PICOS2KHZ(info->var.pixclock);
724 hsstart = to3264(info->var.right_margin, depth, data64);
725 hsend = hsstart + to3264(info->var.hsync_len, depth, data64);
726 hbend = hsend + to3264(info->var.left_margin, depth, data64);
728 vsstart = (info->var.lower_margin)
729 ? info->var.lower_margin - 1
731 vsend = info->var.lower_margin + info->var.vsync_len - 1;
732 vbend = info->var.lower_margin + info->var.vsync_len +
733 info->var.upper_margin;
734 vtotal = info->var.yres + vbend - 1;
736 base = to3264(info->var.yoffset * xres + info->var.xoffset, depth, 1);
740 if (info->var.sync & FB_SYNC_HOR_HIGH_ACT) {
749 if (info->var.sync & FB_SYNC_VERT_HIGH_ACT) {
758 if ((info->var.vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) {
762 if ((info->var.vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE)
764 if ((info->var.activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW)
770 info->fix.line_length = info->var.xres * depth / 8;
854 info->var.xres, info->var.yres, info->var.bits_per_pixel);
887 if (info->var.grayscale)
891 * var->{color}.offset contains start of bitfield
892 * var->{color}.length contains length of bitfield
900 * var->{color}.offset is 0
901 * var->{color}.length contains width of DAC
906 * var->{color}.offset contains start of bitfield
907 * var->{color}.length contains length of bitfield
917 red = CNVT_TOHW(red, info->var.red.length);
918 green = CNVT_TOHW(green, info->var.green.length);
919 blue = CNVT_TOHW(blue, info->var.blue.length);
920 transp = CNVT_TOHW(transp, info->var.transp.length);
940 v = (red << info->var.red.offset) |
941 (green << info->var.green.offset) |
942 (blue << info->var.blue.offset) |
943 (transp << info->var.transp.offset);
945 switch (info->var.bits_per_pixel) {
963 * @var: frame buffer variable screen structure
967 * `xoffset' and `yoffset' fields of the `var' structure.
973 static int pm2fb_pan_display(struct fb_var_screeninfo *var,
978 u32 depth = (info->var.bits_per_pixel + 7) & ~7;
979 u32 xres = (info->var.xres + 31) & ~31;
982 base = to3264(var->yoffset * xres + var->xoffset, depth, 1);
1069 vxres = info->var.xres_virtual;
1070 vyres = info->var.yres_virtual;
1083 if (info->var.bits_per_pixel == 8)
1085 if (info->var.bits_per_pixel <= 16)
1092 if (info->var.bits_per_pixel != 24) {
1126 vxres = info->var.xres_virtual;
1127 vyres = info->var.yres_virtual;
1163 u32 xres = (info->var.xres + 31) & ~31;
1187 if (info->var.bits_per_pixel == 8) {
1191 if (info->var.bits_per_pixel <= 16) {
1211 if (info->var.bits_per_pixel == 24) {
1270 int x = cursor->image.dx - info->var.xoffset;
1271 int y = cursor->image.dy - info->var.yoffset;
1399 int x = cursor->image.dx - info->var.xoffset + 63;
1400 int y = cursor->image.dy - info->var.yoffset + 63;
1687 err = fb_find_mode(&info->var, info, mode_option, NULL, 0, NULL, 8);
1689 info->var = pm2fb_var;