Skip to content

Commit

Permalink
Intel FB: force even line count in interlaced mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Krzysztof Halasa authored and Linus Torvalds committed Oct 16, 2007
1 parent ee5618f commit 28ebe4f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/video/intelfb/intelfbhw.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,26 @@ 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) {
WRN_MSG("Mode is double-scan.\n");
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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 28ebe4f

Please sign in to comment.