aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/intelfb
diff options
context:
space:
mode:
authorKrzysztof Halasa <khc@pm.waw.pl>2007-10-16 01:29:33 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 09:43:20 -0700
commit28ebe4f66beda8f142569d24fe3b168f8a08a6a6 (patch)
tree7a5a448996ad6dbf98634a2dce6ffa54cc28a130 /drivers/video/intelfb
parentee5618f4937dcbff15e504663d81a7adb3d849bf (diff)
Intel FB: force even line count in interlaced mode
Intel FB: the chip adds two halflines automatically in interlaced mode, force even line count for the right timings. Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl> Cc: "Antonino A. Daplas" <adaplas@pol.net> Cc: <sylvain.meyer@worldonline.fr> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/intelfb')
-rw-r--r--drivers/video/intelfb/intelfbhw.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c
index 270f6552603..a02ee24f366 100644
--- a/drivers/video/intelfb/intelfbhw.c
+++ b/drivers/video/intelfb/intelfbhw.c
@@ -317,6 +317,14 @@ int intelfbhw_validate_mode(struct intelfb_info *dinfo,
var->yres, VACTIVE_MASK + 1);
return 1;
}
+ if (var->xres < 4) {
+ WRN_MSG("X resolution too small (%d vs 4).\n", var->xres);
+ return 1;
+ }
+ if (var->yres < 4) {
+ WRN_MSG("Y resolution too small (%d vs 4).\n", var->yres);
+ return 1;
+ }
/* Check for doublescan modes. */
if (var->vmode & FB_VMODE_DOUBLE) {
@@ -324,6 +332,11 @@ int intelfbhw_validate_mode(struct intelfb_info *dinfo,
return 1;
}
+ if ((var->vmode & FB_VMODE_INTERLACED) && (var->yres & 1)) {
+ WRN_MSG("Odd number of lines in interlaced mode\n");
+ return 1;
+ }
+
/* Check if clock is OK. */
tmp = 1000000000 / var->pixclock;
if (tmp < MIN_CLOCK) {
@@ -1127,6 +1140,8 @@ int intelfbhw_mode_to_hw(struct intelfb_info *dinfo,
hblank_end);
vactive = var->yres;
+ if (var->vmode & FB_VMODE_INTERLACED)
+ vactive--; /* the chip adds 2 halflines automatically */
vsync_start = vactive + var->lower_margin;
vsync_end = vsync_start + var->vsync_len;
vtotal = vsync_end + var->upper_margin;