diff options
-rw-r--r-- | drivers/video/cirrusfb.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index 9bb811d56721..d42e385f091c 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c | |||
@@ -701,45 +701,52 @@ static int cirrusfb_set_par_foo(struct fb_info *info) | |||
701 | 701 | ||
702 | hsyncstart = var->xres + var->right_margin; | 702 | hsyncstart = var->xres + var->right_margin; |
703 | hsyncend = hsyncstart + var->hsync_len; | 703 | hsyncend = hsyncstart + var->hsync_len; |
704 | htotal = (hsyncend + var->left_margin) / 8 - 5; | 704 | htotal = (hsyncend + var->left_margin) / 8; |
705 | hdispend = var->xres / 8 - 1; | 705 | hdispend = var->xres / 8; |
706 | hsyncstart = hsyncstart / 8 + 1; | 706 | hsyncstart = hsyncstart / 8; |
707 | hsyncend = hsyncend / 8 + 1; | 707 | hsyncend = hsyncend / 8; |
708 | 708 | ||
709 | yres = var->yres; | 709 | vdispend = var->yres; |
710 | vsyncstart = yres + var->lower_margin; | 710 | vsyncstart = vdispend + var->lower_margin; |
711 | vsyncend = vsyncstart + var->vsync_len; | 711 | vsyncend = vsyncstart + var->vsync_len; |
712 | vtotal = vsyncend + var->upper_margin; | 712 | vtotal = vsyncend + var->upper_margin; |
713 | vdispend = yres - 1; | ||
714 | 713 | ||
715 | if (var->vmode & FB_VMODE_DOUBLE) { | 714 | if (var->vmode & FB_VMODE_DOUBLE) { |
716 | yres *= 2; | 715 | vdispend *= 2; |
717 | vsyncstart *= 2; | 716 | vsyncstart *= 2; |
718 | vsyncend *= 2; | 717 | vsyncend *= 2; |
719 | vtotal *= 2; | 718 | vtotal *= 2; |
720 | } else if (var->vmode & FB_VMODE_INTERLACED) { | 719 | } else if (var->vmode & FB_VMODE_INTERLACED) { |
721 | yres = (yres + 1) / 2; | 720 | vdispend = (vdispend + 1) / 2; |
722 | vsyncstart = (vsyncstart + 1) / 2; | 721 | vsyncstart = (vsyncstart + 1) / 2; |
723 | vsyncend = (vsyncend + 1) / 2; | 722 | vsyncend = (vsyncend + 1) / 2; |
724 | vtotal = (vtotal + 1) / 2; | 723 | vtotal = (vtotal + 1) / 2; |
725 | } | 724 | } |
726 | 725 | yres = vdispend; | |
727 | vtotal -= 2; | ||
728 | vsyncstart -= 1; | ||
729 | vsyncend -= 1; | ||
730 | |||
731 | if (yres >= 1024) { | 726 | if (yres >= 1024) { |
732 | vtotal /= 2; | 727 | vtotal /= 2; |
733 | vsyncstart /= 2; | 728 | vsyncstart /= 2; |
734 | vsyncend /= 2; | 729 | vsyncend /= 2; |
735 | vdispend /= 2; | 730 | vdispend /= 2; |
736 | } | 731 | } |
732 | |||
733 | vdispend -= 1; | ||
734 | vsyncstart -= 1; | ||
735 | vsyncend -= 1; | ||
736 | vtotal -= 2; | ||
737 | |||
737 | if (cinfo->multiplexing) { | 738 | if (cinfo->multiplexing) { |
738 | htotal /= 2; | 739 | htotal /= 2; |
739 | hsyncstart /= 2; | 740 | hsyncstart /= 2; |
740 | hsyncend /= 2; | 741 | hsyncend /= 2; |
741 | hdispend /= 2; | 742 | hdispend /= 2; |
742 | } | 743 | } |
744 | |||
745 | htotal -= 5; | ||
746 | hdispend -= 1; | ||
747 | hsyncstart += 1; | ||
748 | hsyncend += 1; | ||
749 | |||
743 | /* unlock register VGA_CRTC_H_TOTAL..CRT7 */ | 750 | /* unlock register VGA_CRTC_H_TOTAL..CRT7 */ |
744 | vga_wcrt(regbase, VGA_CRTC_V_SYNC_END, 0x20); /* previously: 0x00) */ | 751 | vga_wcrt(regbase, VGA_CRTC_V_SYNC_END, 0x20); /* previously: 0x00) */ |
745 | 752 | ||