From: Krzysztof Halasa <khc@pm.waw.pl>
To: adaplas@gmail.com, sylvain.meyer@worldonline.fr,
akpm@linux-foundation.org
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/4] Intel FB: force even line count in interlaced mode
Date: Sun, 23 Sep 2007 00:21:50 +0200 [thread overview]
Message-ID: <m3sl5649z5.fsf@maximus.localdomain> (raw)
In-Reply-To: <m33ax65ot6.fsf@maximus.localdomain> (Krzysztof Halasa's message of "Sun, 23 Sep 2007 00:16:05 +0200")
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>
--- 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;
next prev parent reply other threads:[~2007-09-22 22:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-22 22:16 [PATCH 0/4] Intel FB: cleanup and misc interlaced mode support Krzysztof Halasa
2007-09-22 22:19 ` [PATCH 1/4] Intel FB: whitespace, bracket and other clean-ups Krzysztof Halasa
2007-09-22 22:20 ` [PATCH 2/4] Intel FB: obvious changes and corrections Krzysztof Halasa
2007-09-22 22:21 ` Krzysztof Halasa [this message]
2007-09-22 22:22 ` [PATCH 4/4] Intel FB: more interlaced mode support Krzysztof Halasa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3sl5649z5.fsf@maximus.localdomain \
--to=khc@pm.waw.pl \
--cc=adaplas@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sylvain.meyer@worldonline.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox