linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] atyfb: another double scan fix
@ 2004-02-11 12:21 Ville Syrjälä
  0 siblings, 0 replies; only message in thread
From: Ville Syrjälä @ 2004-02-11 12:21 UTC (permalink / raw)
  To: linux-fbdev-devel

[-- 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;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-11 12:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-11 12:21 [PATCH] atyfb: another double scan fix Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).