linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Interlace for rivafb driver
@ 2003-01-25 23:08 Fredrik Noring
  2003-01-28 19:29 ` James Simmons
  0 siblings, 1 reply; 6+ messages in thread
From: Fredrik Noring @ 2003-01-25 23:08 UTC (permalink / raw)
  To: linux-fbdev-devel

Attached patch implements interlace for the rivafb driver and
the hardware that supports it (Riva 128, TNT, TNT2, some GeForce 
cards and possibly others).

It's a patch against 2.4.21-pre2 (with polarity and sync patches)
but it should fit with 2.5.x too skipping riva_hw.c and riva_hw.h 
which already are adopted from XFree86.

	Fredrik


--- linux-2.4.21-pre2/drivers/video/riva/riva_hw.c.orig	2003-01-25 00:36:10.000000000 +0100
+++ linux-2.4.21-pre2/drivers/video/riva/riva_hw.c	2003-01-25 00:38:14.000000000 +0100
@@ -1547,6 +1547,8 @@
     VGA_WR08(chip->PCIO, 0x03D5, state->cursor0);
     VGA_WR08(chip->PCIO, 0x03D4, 0x31);
     VGA_WR08(chip->PCIO, 0x03D5, state->cursor1);
+    VGA_WR08(chip->PCIO, 0x03D4, 0x39);
+    VGA_WR08(chip->PCIO, 0x03D5, state->interlace);
     chip->PRAMDAC[0x00000300/4]  = state->cursor2;
     chip->PRAMDAC[0x00000508/4]  = state->vpll;
     chip->PRAMDAC[0x0000050C/4]  = state->pllsel;
--- linux-2.4.21-pre2/drivers/video/riva/riva_hw.h.orig	2003-01-25 00:36:15.000000000 +0100
+++ linux-2.4.21-pre2/drivers/video/riva/riva_hw.h	2003-01-25 00:38:49.000000000 +0100
@@ -421,6 +421,7 @@
     U032 bpp;
     U032 width;
     U032 height;
+    U032 interlace;
     U032 repaint0;
     U032 repaint1;
     U032 screen;
--- linux-2.4.21-pre2/drivers/video/riva/fbdev.c.orig	2003-01-25 23:41:18.000000000 +0100
+++ linux-2.4.21-pre2/drivers/video/riva/fbdev.c	2003-01-25 23:45:07.000000000 +0100
@@ -14,6 +14,9 @@
  *
  *	Jindrich Makovicka:  Accel code help, hw cursor, mtrr
  *
+ *	Fredrik Noring <noring@nocrew.org>:  Sync polarity and
+ *	interlace code with XFree86 4.2 as reference.
+ *
  * Initial template from skeletonfb.c, created 28 Dec 1997 by Geert Uytterhoeven
  * Includes riva_hw.c from nVidia, see copyright below.
  * KGI code provided the basis for state storage, init, and mode switching.
@@ -26,6 +29,12 @@
  *	restoring text mode fails
  *	doublescan modes are broken
  *	option 'noaccel' has no effect
+ *
+ * Interlace is supported on Riva 128, TNT, TNT2 and some early
+ * GeForce cards. Many newer cards do not support interlace.
+ *
+ * Interlace and hardware accelerated video overlay are not compatible
+ * (likely a limitation in hardware).
  */
 
 #include <linux/config.h>
@@ -890,6 +899,9 @@
 
 	memcpy(&newmode, &reg_template, sizeof(struct riva_regs));
 
+	if((video_mode->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED) 
+		vTotal |= 1;
+
 	newmode.crtc[0x0] = Set8Bits (hTotal - 4);
 	newmode.crtc[0x1] = Set8Bits (hDisplay);
 	newmode.crtc[0x2] = Set8Bits (hDisplay);
@@ -929,6 +941,15 @@
 	else
 		newmode.misc_output |= 0x80;
 	
+	if((video_mode->vmode & FB_VMODE_MASK) == FB_VMODE_INTERLACED)
+	{
+	        int tmp = (hTotal >> 1) & ~1;
+		newmode.ext.interlace = Set8Bits(tmp);
+		newmode.ext.horiz |= SetBitField(tmp, 8:8,4:4);
+	} else {
+		newmode.ext.interlace = 0xff;  /* interlace off */
+	}
+
 	rinfo->riva.CalcStateExt(&rinfo->riva, &newmode.ext, bpp, width,
 				  hDisplaySize, hDisplay, hStart, hEnd,
 				  hTotal, height, vDisplay, vStart, vEnd,



-------------------------------------------------------
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] Interlace for rivafb driver
  2003-01-25 23:08 [PATCH] Interlace for rivafb driver Fredrik Noring
@ 2003-01-28 19:29 ` James Simmons
  2003-01-30  2:35   ` Antonino Daplas
  0 siblings, 1 reply; 6+ messages in thread
From: James Simmons @ 2003-01-28 19:29 UTC (permalink / raw)
  To: Fredrik Noring; +Cc: linux-fbdev-devel

On 26 Jan 2003, Fredrik Noring wrote:

> Attached patch implements interlace for the rivafb driver and
> the hardware that supports it (Riva 128, TNT, TNT2, some GeForce 
> cards and possibly others).
> 
> It's a patch against 2.4.21-pre2 (with polarity and sync patches)
> but it should fit with 2.5.x too skipping riva_hw.c and riva_hw.h 
> which already are adopted from XFree86.

Applied. 


P.S
   To Tony. I applied your patches as well. The only patch I didn't was 
the DIRECTCOLOR patch. The X server freaked out for my card when the video 
mode was in a DIRECTCOLOR state.



-------------------------------------------------------
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] Interlace for rivafb driver
  2003-01-28 19:29 ` James Simmons
@ 2003-01-30  2:35   ` Antonino Daplas
  2003-01-30 19:34     ` James Simmons
  0 siblings, 1 reply; 6+ messages in thread
From: Antonino Daplas @ 2003-01-30  2:35 UTC (permalink / raw)
  To: James Simmons; +Cc: Fredrik Noring, Linux Fbdev development list

On Wed, 2003-01-29 at 03:29, James Simmons wrote:
> On 26 Jan 2003, Fredrik Noring wrote:
> 
> > Attached patch implements interlace for the rivafb driver and
> > the hardware that supports it (Riva 128, TNT, TNT2, some GeForce 
> > cards and possibly others).
> > 
> > It's a patch against 2.4.21-pre2 (with polarity and sync patches)
> > but it should fit with 2.5.x too skipping riva_hw.c and riva_hw.h 
> > which already are adopted from XFree86.
> 
> Applied. 
> 
> 
> P.S
>    To Tony. I applied your patches as well. The only patch I didn't was 
> the DIRECTCOLOR patch. The X server freaked out for my card when the video 
> mode was in a DIRECTCOLOR state.
> 

Yes I'm not sure about this too.  Also the patch I submitted is untested
for RGB565, tested only for RGB555 and RGB8888.  So, does X work for
rivafb?  It does not work in my hardware unless I add the directcolor
patch.

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] Interlace for rivafb driver
  2003-01-30  2:35   ` Antonino Daplas
@ 2003-01-30 19:34     ` James Simmons
  2003-01-30 22:59       ` Antonino Daplas
  0 siblings, 1 reply; 6+ messages in thread
From: James Simmons @ 2003-01-30 19:34 UTC (permalink / raw)
  To: Antonino Daplas; +Cc: Fredrik Noring, Linux Fbdev development list


> >    To Tony. I applied your patches as well. The only patch I didn't was 
> > the DIRECTCOLOR patch. The X server freaked out for my card when the video 
> > mode was in a DIRECTCOLOR state.
> > 
> 
> Yes I'm not sure about this too.  Also the patch I submitted is untested
> for RGB565, tested only for RGB555 and RGB8888.  So, does X work for
> rivafb?  It does not work in my hardware unless I add the directcolor
> patch.

I applied your direct color patch. The X server has issues without it as 
well. For some reason the screen is cut in half and the colors are wrong.
Even when I leave X. The only solution is to switch back to 8 bpp mode.



-------------------------------------------------------
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] Interlace for rivafb driver
  2003-01-30 19:34     ` James Simmons
@ 2003-01-30 22:59       ` Antonino Daplas
  2003-02-12 20:09         ` James Simmons
  0 siblings, 1 reply; 6+ messages in thread
From: Antonino Daplas @ 2003-01-30 22:59 UTC (permalink / raw)
  To: James Simmons; +Cc: Fredrik Noring, Linux Fbdev development list

On Fri, 2003-01-31 at 03:34, James Simmons wrote:
> 
> > >    To Tony. I applied your patches as well. The only patch I didn't was 
> > > the DIRECTCOLOR patch. The X server freaked out for my card when the video 
> > > mode was in a DIRECTCOLOR state.
> > > 
> > 
> > Yes I'm not sure about this too.  Also the patch I submitted is untested
> > for RGB565, tested only for RGB555 and RGB8888.  So, does X work for
> > rivafb?  It does not work in my hardware unless I add the directcolor
> > patch.
> 
> I applied your direct color patch. The X server has issues without it as 
> well. For some reason the screen is cut in half and the colors are wrong.
> Even when I leave X. The only solution is to switch back to 8 bpp mode.
> 

I get this too.  For some reason, X fails to dynamically set rivafb to
the mode it wants to use.  So, I have to use fbset first to set rivafb
to the mode and visual X is going to use.  After doing this, I get
XFBdev working nicely (at Depth 15).

I have no problems with DirectFB though.

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] Interlace for rivafb driver
  2003-01-30 22:59       ` Antonino Daplas
@ 2003-02-12 20:09         ` James Simmons
  0 siblings, 0 replies; 6+ messages in thread
From: James Simmons @ 2003-02-12 20:09 UTC (permalink / raw)
  To: Antonino Daplas; +Cc: Fredrik Noring, Linux Fbdev development list


> > I applied your direct color patch. The X server has issues without it as 
> > well. For some reason the screen is cut in half and the colors are wrong.
> > Even when I leave X. The only solution is to switch back to 8 bpp mode.
> > 
> 
> I get this too.  For some reason, X fails to dynamically set rivafb to
> the mode it wants to use.  So, I have to use fbset first to set rivafb
> to the mode and visual X is going to use.  After doing this, I get
> XFBdev working nicely (at Depth 15).
> 
> I have no problems with DirectFB though.

Ug. Well the driver is really coming along. This is without specs. 




-------------------------------------------------------
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 20:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-25 23:08 [PATCH] Interlace for rivafb driver Fredrik Noring
2003-01-28 19:29 ` James Simmons
2003-01-30  2:35   ` Antonino Daplas
2003-01-30 19:34     ` James Simmons
2003-01-30 22:59       ` Antonino Daplas
2003-02-12 20:09         ` 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).