All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <syrjala@sci.fi>
To: linux-fbdev-devel@lists.sourceforge.net
Subject: [PATCH] atyfb: another double scan fix
Date: Wed, 11 Feb 2004 14:21:05 +0200	[thread overview]
Message-ID: <20040211122105.GA26947@sci.fi> (raw)

[-- Attachment #1: Type: text/plain, Size: 534 bytes --]

Here's another doublescan fix for atyfb.

Previosly var<->crtc conversion would do different things depending on 
which way the conversion was made. 
var->crtc: vdisp = ((yres-1)<<1) 
crtc->var: yres  = ((vdisp+1)>>1)

That's obviously wrong. And thus fbset would report incorrect yres value. 
The patch changes var->crtc conversion to do vdisp = ((yres<<1)-1).

I'm not entirely sure which way is the right way but at least now things 
work as expected.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/

[-- Attachment #2: atyfb_dblscan_fix.patch --]
[-- Type: text/plain, Size: 1696 bytes --]

--- linux-2.4.24/drivers/video/aty/atyfb_base.c.pan	2004-02-11 13:12:47.000000000 +0200
+++ linux-2.4.24/drivers/video/aty/atyfb_base.c	2004-02-11 13:16:23.000000000 +0200
@@ -600,6 +600,18 @@
     sync = var->sync;
     vmode = var->vmode;
 
+    /* In double scan mode, the vertical parameters need to be doubled.
+       But in interlaced mode, there is no need to half the vertical parameters.
+       Code has been tested in 1024x768, 43 Hz interlaced and 640x480, 60 Hz
+       double scan.
+     */
+    if ((vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
+        ryres <<= 1;
+        upper <<= 1;
+        lower <<= 1;
+        vslen <<= 1;
+    }
+
     /* convert (and round up) and validate */
     xres = (xres+7) & ~7;
     xoffset = (xoffset+7) & ~7;
@@ -623,7 +635,7 @@
 
     if (vyres < yres+yoffset)
         vyres = yres+yoffset;
-    v_disp = yres-1;
+    v_disp = ryres-1;
     if (v_disp > 0x7ff)
         FAIL("v_disp too large");
     v_sync_strt = v_disp+lower;
@@ -636,18 +648,6 @@
     if (v_total > 0x7ff)
         FAIL("v_total too large");
     v_sync_pol = sync & FB_SYNC_VERT_HIGH_ACT ? 0 : 1;
-    /* In double scan mode, the vertical parameters need to be doubled.
-       But in interlaced mode, there is no need to half the vertical parameters.
-       Code has been tested in 1024x768, 43 Hz interlaced and 640x480, 60 Hz
-       double scan.
-     */
-   if ((vmode & FB_VMODE_MASK) == FB_VMODE_DOUBLE) {
-       ryres <<= 1;
-       v_total <<= 1;
-       v_disp <<= 1;
-       v_sync_strt <<= 1;
-       v_sync_wid <<= 1;
-   };
                                                            
     c_sync = sync & FB_SYNC_COMP_HIGH_ACT ? CRTC_CSYNC_EN : 0;
 

                 reply	other threads:[~2004-02-11 12:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040211122105.GA26947@sci.fi \
    --to=syrjala@sci.fi \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.