linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Funny sync calculation correction
@ 2003-01-24 23:17 Fredrik Noring
  2003-01-25 19:13 ` James Simmons
  2003-02-12 18:41 ` James Simmons
  0 siblings, 2 replies; 6+ messages in thread
From: Fredrik Noring @ 2003-01-24 23:17 UTC (permalink / raw)
  To: linux-fbdev-devel

I've been digging around in the rivafb module to find out why some
modes converted from XFree86 4.2 don't work on some display devices.
Here's a funny part of the riva_load_video_mode function (Linux
2.4.21-pre2):

	hStart = (hDisplaySize + video_mode->right_margin) / 8 + 2;
	hEnd   = (hDisplaySize + video_mode->right_margin +
		 video_mode->hsync_len) / 8 - 1;

Please notice how "hsync_len" does not actually represent the length
of the sync. Rather, it's compensated with 24 pixels. The corresponding
code in the XFree86 4.2 (nv_dac.c) contains no such compensation:

    int horizStart      = (mode->CrtcHSyncStart/8) - 1;
    int horizEnd        = (mode->CrtcHSyncEnd/8)   - 1;

The difference seems to be almost insignificant for modern multisync
screens, but devices such as TV:s get confused by the current version.
Is there a reason for the difference in calculations?

The attached patch corrects the calculations in accordance with XFree86
and works better with the modelines I've tested. 

Please give it a try. Thanks,

	Fredrik

--- linux-2.4.21-pre2/drivers/video/riva/fbdev.c.orig	2003-01-24 23:59:56.000000000 +0100
+++ linux-2.4.21-pre2/drivers/video/riva/fbdev.c	2003-01-25 00:00:24.000000000 +0100
@@ -874,7 +874,7 @@
 	width = video_mode->xres_virtual;
 	hDisplaySize = video_mode->xres;
 	hDisplay = (hDisplaySize / 8) - 1;
-	hStart = (hDisplaySize + video_mode->right_margin) / 8 + 2;
+	hStart = (hDisplaySize + video_mode->right_margin) / 8 - 1;
 	hEnd = (hDisplaySize + video_mode->right_margin +
 		video_mode->hsync_len) / 8 - 1;
 	hTotal = (hDisplaySize + video_mode->right_margin +



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Funny sync calculation correction
  2003-01-24 23:17 [PATCH] Funny sync calculation correction Fredrik Noring
@ 2003-01-25 19:13 ` James Simmons
  2003-01-25 23:18   ` Fredrik Noring
  2003-02-12 18:41 ` James Simmons
  1 sibling, 1 reply; 6+ messages in thread
From: James Simmons @ 2003-01-25 19:13 UTC (permalink / raw)
  To: Fredrik Noring; +Cc: linux-fbdev-devel

> I've been digging around in the rivafb module to find out why some
> modes converted from XFree86 4.2 don't work on some display devices.
> Here's a funny part of the riva_load_video_mode function (Linux
> 2.4.21-pre2):
> 
> 	hStart = (hDisplaySize + video_mode->right_margin) / 8 + 2;
> 	hEnd   = (hDisplaySize + video_mode->right_margin +
> 		 video_mode->hsync_len) / 8 - 1;
> 
> Please notice how "hsync_len" does not actually represent the length
> of the sync. Rather, it's compensated with 24 pixels. The corresponding
> code in the XFree86 4.2 (nv_dac.c) contains no such compensation:
> 
>     int horizStart      = (mode->CrtcHSyncStart/8) - 1;
>     int horizEnd        = (mode->CrtcHSyncEnd/8)   - 1;
> 
> The difference seems to be almost insignificant for modern multisync
> screens, but devices such as TV:s get confused by the current version.
> Is there a reason for the difference in calculations?
> 
> The attached patch corrects the calculations in accordance with XFree86
> and works better with the modelines I've tested. 
> 
> Please give it a try. Thanks,

Works fine. I applied it to the 2.5.X tree.



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Funny sync calculation correction
  2003-01-25 19:13 ` James Simmons
@ 2003-01-25 23:18   ` Fredrik Noring
  2003-01-28 19:20     ` James Simmons
  2003-01-30  2:36     ` Antonino Daplas
  0 siblings, 2 replies; 6+ messages in thread
From: Fredrik Noring @ 2003-01-25 23:18 UTC (permalink / raw)
  To: James Simmons; +Cc: linux-fbdev-devel

> Works fine. I applied it to the 2.5.X tree.

Has anyone got Riva 128 or TNT cards working with 2.5.59 or
later? My cards freeze up completely with the new driver when
loading fbcon.

	Fredrik




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Funny sync calculation correction
  2003-01-25 23:18   ` Fredrik Noring
@ 2003-01-28 19:20     ` James Simmons
  2003-01-30  2:36     ` Antonino Daplas
  1 sibling, 0 replies; 6+ messages in thread
From: James Simmons @ 2003-01-28 19:20 UTC (permalink / raw)
  To: Fredrik Noring; +Cc: linux-fbdev-devel


> > Works fine. I applied it to the 2.5.X tree.
> 
> Has anyone got Riva 128 or TNT cards working with 2.5.59 or
> later? My cards freeze up completely with the new driver when
> loading fbcon.

The card I have is a Diamond Multimedia Systems Viper V730.




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Funny sync calculation correction
  2003-01-25 23:18   ` Fredrik Noring
  2003-01-28 19:20     ` James Simmons
@ 2003-01-30  2:36     ` Antonino Daplas
  1 sibling, 0 replies; 6+ messages in thread
From: Antonino Daplas @ 2003-01-30  2:36 UTC (permalink / raw)
  To: Fredrik Noring; +Cc: James Simmons, Linux Fbdev development list

On Sun, 2003-01-26 at 07:18, Fredrik Noring wrote:
> > Works fine. I applied it to the 2.5.X tree.
> 
> Has anyone got Riva 128 or TNT cards working with 2.5.59 or
> later? My cards freeze up completely with the new driver when
> loading fbcon.
> 
> 	Fredrik
> 
> 
Works for STB Velocity 128 PCI (Riva 128)

Tony





-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Funny sync calculation correction
  2003-01-24 23:17 [PATCH] Funny sync calculation correction Fredrik Noring
  2003-01-25 19:13 ` James Simmons
@ 2003-02-12 18:41 ` James Simmons
  1 sibling, 0 replies; 6+ messages in thread
From: James Simmons @ 2003-02-12 18:41 UTC (permalink / raw)
  To: Fredrik Noring; +Cc: linux-fbdev-devel


Applied.



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-02-12 18:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-24 23:17 [PATCH] Funny sync calculation correction Fredrik Noring
2003-01-25 19:13 ` James Simmons
2003-01-25 23:18   ` Fredrik Noring
2003-01-28 19:20     ` James Simmons
2003-01-30  2:36     ` Antonino Daplas
2003-02-12 18:41 ` James Simmons

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).