aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorKrzysztof Halasa <khc@pm.waw.pl>2007-10-16 04:29:33 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:20 -0400
commit28ebe4f66beda8f142569d24fe3b168f8a08a6a6 (patch)
tree7a5a448996ad6dbf98634a2dce6ffa54cc28a130 /drivers/video
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')
-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 270f6552603c..a02ee24f3668 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,
317 var->yres, VACTIVE_MASK + 1); 317 var->yres, VACTIVE_MASK + 1);
318 return 1; 318 return 1;
319 } 319 }
320 if (var->xres < 4) {
321 WRN_MSG("X resolution too small (%d vs 4).\n", var->xres);
322 return 1;
323 }
324 if (var->yres < 4) {
325 WRN_MSG("Y resolution too small (%d vs 4).\n", var->yres);
326 return 1;
327 }
320 328
321 /* Check for doublescan modes. */ 329 /* Check for doublescan modes. */
322 if (var->vmode & FB_VMODE_DOUBLE) { 330 if (var->vmode & FB_VMODE_DOUBLE) {
@@ -324,6 +332,11 @@ int intelfbhw_validate_mode(struct intelfb_info *dinfo,
324 return 1; 332 return 1;
325 } 333 }
326 334
335 if ((var->vmode & FB_VMODE_INTERLACED) && (var->yres & 1)) {
336 WRN_MSG("Odd number of lines in interlaced mode\n");
337 return 1;
338 }
339
327 /* Check if clock is OK. */ 340 /* Check if clock is OK. */
328 tmp = 1000000000 / var->pixclock; 341 tmp = 1000000000 / var->pixclock;
329 if (tmp < MIN_CLOCK) { 342 if (tmp < MIN_CLOCK) {
@@ -1127,6 +1140,8 @@ int intelfbhw_mode_to_hw(struct intelfb_info *dinfo,
1127 hblank_end); 1140 hblank_end);
1128 1141
1129 vactive = var->yres; 1142 vactive = var->yres;
1143 if (var->vmode & FB_VMODE_INTERLACED)
1144 vactive--; /* the chip adds 2 halflines automatically */
1130 vsync_start = vactive + var->lower_margin; 1145 vsync_start = vactive + var->lower_margin;
1131 vsync_end = vsync_start + var->vsync_len; 1146 vsync_end = vsync_start + var->vsync_len;
1132 vtotal = vsync_end + var->upper_margin; 1147 vtotal = vsync_end + var->upper_margin;