Skip to contentSkip to conversation

: Updates to rivafb driver

PATCH In review Antonino A. Daplas 5 participants 14 messages Jun 15, 2004 – Jun 17, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Updates to rivafb driver

Hi,

The patch updates rivafb to the following:

1. Fixed cursor corruption and simplified cursor code.

2. Maximized var->yres_virtual on initial mode setting. Scrolling, therefore, defaults to y-panning which is significantly faster.

3. Restricted var->xres_virtual and var->yres_virtual to 0x7fff (hardware limitation?). Otherwise, var->yres_virtual > 0x7fff + panning will hang the GPU.

4. Added I2C/DDC support. This feature enables independent mode setup to rivafb. 'stty rows n cols n' should now work correctly. This is a configurable option.

5. Various/minor fixes to drawing code.

Diff is against linux-2.6.6. Test hardware - GeForce 2 MX.

Tony

drivers/video/Kconfig +5 -0
diff -Naur linux-2.6.6-orig/drivers/video/Kconfig linux-2.6.6-new/drivers/video/Kconfig
@@ -405,6 +405,11 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called rivafb.
 
+config FB_RIVA_I2C
+       bool "Enable DDC Support"
+       depends on FB_RIVA && I2C
+       help
+
 config FB_I810
 	tristate "Intel 810/815 support (EXPERIMENTAL)"
 	depends on FB && AGP && AGP_INTEL && EXPERIMENTAL && PCI	
drivers/video/riva/Makefile +6 -2
diff -Naur linux-2.6.6-orig/drivers/video/riva/Makefile linux-2.6.6-new/drivers/video/riva/Makefile
@@ -2,6 +2,10 @@
 # Makefile for the Riva framebuffer driver
 #
 
-obj-$(CONFIG_FB_RIVA) += rivafb.o
+obj-$(CONFIG_FB_RIVA)     += rivafb.o
 
-rivafb-objs := fbdev.o riva_hw.o nv_driver.o
+rivafb-objs               := fbdev.o riva_hw.o nv_driver.o
+
+ifdef CONFIG_FB_RIVA_I2C
+	rivafb-objs       += rivafb-i2c.o
+endif
drivers/video/riva/fbdev.c +192 -147

557 lines not on this page · raw message

drivers/video/riva/rivafb-i2c.c +209 -0

209 lines not on this page · raw message

drivers/video/riva/rivafb.h +24 -9
diff -Naur linux-2.6.6-orig/drivers/video/riva/rivafb.h linux-2.6.6-new/drivers/video/riva/rivafb.h
@@ -4,6 +4,10 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 #include <video/vga.h>
+#include <linux/i2c.h>
+#include <linux/i2c-id.h>
+#include <linux/i2c-algo-bit.h>
+
 #include "riva_hw.h"
 
 /* GGI compatibility macros */
@@ -12,6 +16,12 @@
 #define NUM_GRC_REGS		0x09
 #define NUM_ATC_REGS		0x15
 
+/* I2C */
+#define DDC_SCL_READ_MASK       (1 << 2)
+#define DDC_SCL_WRITE_MASK      (1 << 5)
+#define DDC_SDA_READ_MASK       (1 << 3)
+#define DDC_SDA_WRITE_MASK      (1 << 4)
+
 /* holds the state of the VGA core and extended Riva hw state from riva_hw.c.
  * From KGI originally. */
 struct riva_regs {
@@ -23,6 +33,15 @@
 	RIVA_HW_STATE ext;
 };
 
+struct riva_par;
+
+struct riva_i2c_chan {
+	struct riva_par *par;
+	unsigned long   ddc_base;
+	struct i2c_adapter adapter;
+	struct i2c_algo_bit_data algo;
+};
+
 struct riva_par {
 	RIVA_HW_INST riva;	/* interface to riva_hw.c */
 
@@ -36,26 +55,22 @@
 	u32 cursor_data[32 * 32/4];
 	int cursor_reset;
 	unsigned char *EDID;
-
-	int panel_xres, panel_yres;
-	int hOver_plus, hSync_width, hblank;
-	int vOver_plus, vSync_width, vblank;
-	int hAct_high, vAct_high, interlaced;
-	int synct, misc, clock;
-
-	int use_default_var;
-	int got_dfpinfo;
 	unsigned int Chipset;
 	int forceCRTC;
 	Bool SecondCRTC;
 	int FlatPanel;
+	struct pci_dev *pdev;
 #ifdef CONFIG_MTRR
 	struct { int vram; int vram_valid; } mtrr;
 #endif
+	struct riva_i2c_chan chan[3];
 };
 
 void riva_common_setup(struct riva_par *);
 unsigned long riva_get_memlen(struct riva_par *);
 unsigned long riva_get_maxdclk(struct riva_par *);
+void riva_delete_i2c_busses(struct riva_par *par);
+void riva_create_i2c_busses(struct riva_par *par);
+int riva_probe_i2c_connector(struct riva_par *par, int conn, u8 **out_edid);
 
 #endif /* __RIVAFB_H */

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

#1 lore raw

hey tony,

your patch against drivers/video/riva/fbdev.c chokes on hunk 2 when applied to 2.6.7-rc3-mm2. resend, and i'll test it on my TNT2 :)

-dte

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

#2 lore raw

I wil give it a try tonight. I'm working on the riva driver as well. I got a oops in the i2c code. This is from the code in the fbdev-2.5 BK branch.

Quoted 8 lines · David Eger

hey tony,

your patch against drivers/video/riva/fbdev.c chokes on hunk 2 when applied to 2.6.7-rc3-mm2. resend, and i'll test it on my TNT2 :)

-dte

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

#3 lore raw
In reply to David Eger
Quoted 5 lines · David Eger

hey tony,

your patch against drivers/video/riva/fbdev.c chokes on hunk 2 when applied to 2.6.7-rc3-mm2. resend, and i'll test it on my TNT2 :)

Ok. Patch against 2.6.7-rc3-mm2.

Note I haven't added the hardware acceleration capability support yet, so scrolling is still slow.

Secondly, stty seems not to work anymore, though I'm sure the driver can do mode setup independently if with DDC. I'll look into this later.

Tony

drivers/video/Kconfig +5 -0
diff -Naur linux-2.6.6-rc3-mm2-orig/drivers/video/Kconfig linux-2.6.6-rc3-mm2/drivers/video/Kconfig
@@ -432,6 +432,11 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called rivafb.
 
+config FB_RIVA_I2C
+       bool "Enable DDC Support"
+       depends on FB_RIVA && I2C
+       help
+
 config FB_I810
 	tristate "Intel 810/815 support (EXPERIMENTAL)"
 	depends on FB && AGP && AGP_INTEL && EXPERIMENTAL && PCI	
drivers/video/riva/Makefile +6 -2
diff -Naur linux-2.6.6-rc3-mm2-orig/drivers/video/riva/Makefile linux-2.6.6-rc3-mm2/drivers/video/riva/Makefile
@@ -2,6 +2,10 @@
 # Makefile for the Riva framebuffer driver
 #
 
-obj-$(CONFIG_FB_RIVA) += rivafb.o
+obj-$(CONFIG_FB_RIVA)     += rivafb.o
 
-rivafb-objs := fbdev.o riva_hw.o nv_driver.o
+rivafb-objs               := fbdev.o riva_hw.o nv_driver.o
+
+ifdef CONFIG_FB_RIVA_I2C
+	rivafb-objs       += rivafb-i2c.o
+endif
drivers/video/riva/fbdev.c +190 -150

555 lines not on this page · raw message

drivers/video/riva/rivafb-i2c.c +209 -0

209 lines not on this page · raw message

drivers/video/riva/rivafb.h +24 -9
diff -Naur linux-2.6.6-rc3-mm2-orig/drivers/video/riva/rivafb.h linux-2.6.6-rc3-mm2/drivers/video/riva/rivafb.h
@@ -4,6 +4,10 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 #include <video/vga.h>
+#include <linux/i2c.h>
+#include <linux/i2c-id.h>
+#include <linux/i2c-algo-bit.h>
+
 #include "riva_hw.h"
 
 /* GGI compatibility macros */
@@ -12,6 +16,12 @@
 #define NUM_GRC_REGS		0x09
 #define NUM_ATC_REGS		0x15
 
+/* I2C */
+#define DDC_SCL_READ_MASK       (1 << 2)
+#define DDC_SCL_WRITE_MASK      (1 << 5)
+#define DDC_SDA_READ_MASK       (1 << 3)
+#define DDC_SDA_WRITE_MASK      (1 << 4)
+
 /* holds the state of the VGA core and extended Riva hw state from riva_hw.c.
  * From KGI originally. */
 struct riva_regs {
@@ -23,6 +33,15 @@
 	RIVA_HW_STATE ext;
 };
 
+struct riva_par;
+
+struct riva_i2c_chan {
+	struct riva_par *par;
+	unsigned long   ddc_base;
+	struct i2c_adapter adapter;
+	struct i2c_algo_bit_data algo;
+};
+
 struct riva_par {
 	RIVA_HW_INST riva;	/* interface to riva_hw.c */
 
@@ -36,26 +55,22 @@
 	u32 cursor_data[32 * 32/4];
 	int cursor_reset;
 	unsigned char *EDID;
-
-	int panel_xres, panel_yres;
-	int hOver_plus, hSync_width, hblank;
-	int vOver_plus, vSync_width, vblank;
-	int hAct_high, vAct_high, interlaced;
-	int synct, misc, clock;
-
-	int use_default_var;
-	int got_dfpinfo;
 	unsigned int Chipset;
 	int forceCRTC;
 	Bool SecondCRTC;
 	int FlatPanel;
+	struct pci_dev *pdev;
 #ifdef CONFIG_MTRR
 	struct { int vram; int vram_valid; } mtrr;
 #endif
+	struct riva_i2c_chan chan[3];
 };
 
 void riva_common_setup(struct riva_par *);
 unsigned long riva_get_memlen(struct riva_par *);
 unsigned long riva_get_maxdclk(struct riva_par *);
+void riva_delete_i2c_busses(struct riva_par *par);
+void riva_create_i2c_busses(struct riva_par *par);
+int riva_probe_i2c_connector(struct riva_par *par, int conn, u8 **out_edid);
 
 #endif /* __RIVAFB_H */

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

#4 lore raw
Quoted 6 lines · Antonino A. Daplas
Quoted 4 lines · David Eger

hey tony,

your patch against drivers/video/riva/fbdev.c chokes on hunk 2 when applied to 2.6.7-rc3-mm2. resend, and i'll test it on my TNT2 :)

Quoted 8 lines

Ok. Patch against 2.6.7-rc3-mm2.

Note I haven't added the hardware acceleration capability support yet, so scrolling is still slow.

Secondly, stty seems not to work anymore, though I'm sure the driver can do mode setup independently if with DDC. I'll look into this later.

I believe I know why stty failed. It's because fbcon_resize() inf fbcon.c uses fb_find_mode(). I have reservations with this method though.

1. Since it uses a mode database, this will completely ignore drivers/hardware that can do scaling or can use the GTF.

2. Secondly, stty works in a weird manner. For example, fb is in 800x600. I want to go to 1024x768. In order to do that I issue 'stty cols 128 rows 48'. This will fail because it will be processed in 2 steps:

1. set at 1024x592 (128x37) <-- fails
2. set at 1024x768(128x48)

Of course, step 1 will fail since 1024x592 is not in the database.

I believe a proper way is to just add another method in info->fb_ops, something like info->fb_ops->fb_find_mode(struct fb_var_screeninfo*, int xres, int yres) that will be called by fbcon_resize().

Anyway, a workaround is to add a best-fit algorithm in fb_find_mode(). It will try to return modes that are bigger but closest to the given mode. fb_find_mode will return 5 in this case. Note that it currently ignores refresh rates. So, it will now work this way:

	1. set at 1024x592(128x37)
		fb_find_mode() return 1024x768
	2. set at 1024x768(128x48)
		fb_find_mode() return 1024x768 (success)

The algo is currently very simple, feel free to modify.

Tony

1. pass info->monspecs.modedb and info->monspecs.modedb_len to fb_find_mode() instead of NULL, 0 since its contents are specific to the attached display. Anyway, if info->monspecs.modedb == NULL, fb_find_mode() will use the default database.

2. Added best fit algo to fb_find_mode().

3. Use snprintf instead of sprintf.

drivers/video/console/fbcon.c +4 -3
diff -Naur linux-2.6.6-rc3-mm2-orig/drivers/video/console/fbcon.c linux-2.6.6-rc3-mm2-test/drivers/video/console/fbcon.c
@@ -1512,9 +1512,10 @@
 		if (!info->fbops->fb_set_par)
 			return -EINVAL;
 
-		sprintf(mode, "%dx%d", var.xres, var.yres);
-		err = fb_find_mode(&var, info, mode, NULL, 0, NULL,
-					info->var.bits_per_pixel);
+		snprintf(mode, 40, "%ix%i", var.xres, var.yres);
+		err = fb_find_mode(&var, info, mode, info->monspecs.modedb, 
+				   info->monspecs.modedb_len, NULL,
+				   info->var.bits_per_pixel);
 		if (!err || width > var.xres/fw || height > var.yres/fh)
 			return -EINVAL;
 		DPRINTK("resize now %ix%i\n", var.xres, var.yres);
drivers/video/modedb.c +20 -3
diff -Naur linux-2.6.6-rc3-mm2-orig/drivers/video/modedb.c linux-2.6.6-rc3-mm2-test/drivers/video/modedb.c
@@ -490,7 +490,8 @@
 	int res_specified = 0, bpp_specified = 0, refresh_specified = 0;
 	unsigned int xres = 0, yres = 0, bpp = default_bpp, refresh = 0;
 	int yres_specified = 0;
-
+	u32 best = -1, diff = -1;
+	
 	for (i = namelen-1; i >= 0; i--) {
 	    switch (name[i]) {
 		case '@':
@@ -529,8 +530,8 @@
 	}
 done:
 	for (i = refresh_specified; i >= 0; i--) {
-	    DPRINTK("Trying specified video mode%s\n",
-		    i ? "" : " (ignoring refresh rate)");
+	    DPRINTK("Trying specified video mode%s %ix%i\n",
+		    i ? "" : " (ignoring refresh rate)", xres, yres);
 	    for (j = 0; j < dbsize; j++)
 		if ((name_matches(db[j], name, namelen) ||
 		     (res_specified && res_matches(db[j], xres, yres))) &&
@@ -538,6 +539,22 @@
 		    !fb_try_mode(var, info, &db[j], bpp))
 		    return 2-i;
 	}
+	DPRINTK("Trying best-fit modes\n");
+	for (i = 0; i < dbsize; i++) {
+	    if (xres <= db[i].xres && yres <= db[i].yres) {
+		DPRINTK("Trying %ix%i\n", db[i].xres, db[i].yres);
+		if (!fb_try_mode(var, info, &db[i], bpp)) {
+		    if (diff > (db[i].xres - xres) + (db[i].yres - yres)) {
+			diff = (db[i].xres - xres) + (db[i].yres - yres);
+			best = i;
+		    }
+		}
+	    }
+	}
+	if (best != -1) {
+	    fb_try_mode(var, info, &db[best], bpp);
+	    return 5;
+	}
     }
 
     DPRINTK("Trying default video mode\n");

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

#5 lore raw
Quoted 6 lines

I believe I know why stty failed. It's because fbcon_resize() inf fbcon.c uses fb_find_mode(). I have reservations with this method though.

1. Since it uses a mode database, this will completely ignore drivers/hardware that can do scaling or can use the GTF.

The mode database is meant to deal with the lowest denominator hardware. It works in a large number of cases. I plan to expand that functionaly even more in the near future.

Quoted 8 lines

2. Secondly, stty works in a weird manner. For example, fb is in 800x600. I want to go to 1024x768. In order to do that I issue 'stty cols 128 rows 48'. This will fail because it will be processed in 2 steps:

1. set at 1024x592 (128x37) <-- fails
2. set at 1024x768(128x48)

Of course, step 1 will fail since 1024x592 is not in the database.

This is a bug in stty. I sent the patch to the maintainer. We shoudl add that functionalty to fbset now.

Quoted 10 lines

Anyway, a workaround is to add a best-fit algorithm in fb_find_mode(). It will try to return modes that are bigger but closest to the given mode. fb_find_mode will return 5 in this case. Note that it currently ignores refresh rates. So, it will now work this way:

	1. set at 1024x592(128x37)
		fb_find_mode() return 1024x768
	2. set at 1024x768(128x48)
		fb_find_mode() return 1024x768 (success)

The algo is currently very simple, feel free to modify.

Nice. I will apply.

Quoted 69 lines

Tony

1. pass info->monspecs.modedb and info->monspecs.modedb_len to fb_find_mode() instead of NULL, 0 since its contents are specific to the attached display. Anyway, if info->monspecs.modedb == NULL, fb_find_mode() will use the default database.

2. Added best fit algo to fb_find_mode().

3. Use snprintf instead of sprintf.

diff -Naur linux-2.6.6-rc3-mm2-orig/drivers/video/console/fbcon.c linux-2.6.6-rc3-mm2-test/drivers/video/console/fbcon.c

drivers/video/console/fbcon.c +4 -3
@@ -1512,9 +1512,10 @@
 		if (!info->fbops->fb_set_par)
 			return -EINVAL;
 
-		sprintf(mode, "%dx%d", var.xres, var.yres);
-		err = fb_find_mode(&var, info, mode, NULL, 0, NULL,
-					info->var.bits_per_pixel);
+		snprintf(mode, 40, "%ix%i", var.xres, var.yres);
+		err = fb_find_mode(&var, info, mode, info->monspecs.modedb, 
+				   info->monspecs.modedb_len, NULL,
+				   info->var.bits_per_pixel);
 		if (!err || width > var.xres/fw || height > var.yres/fh)
 			return -EINVAL;
 		DPRINTK("resize now %ix%i\n", var.xres, var.yres);

diff -Naur linux-2.6.6-rc3-mm2-orig/drivers/video/modedb.c linux-2.6.6-rc3-mm2-test/drivers/video/modedb.c

drivers/video/modedb.c +13 -3
@@ -490,7 +490,8 @@
 	int res_specified = 0, bpp_specified = 0, refresh_specified = 0;
 	unsigned int xres = 0, yres = 0, bpp = default_bpp, refresh = 0;
 	int yres_specified = 0;
-
+	u32 best = -1, diff = -1;
+	
 	for (i = namelen-1; i >= 0; i--) {
 	    switch (name[i]) {
 		case '@':
@@ -529,8 +530,8 @@
 	}
 done:
 	for (i = refresh_specified; i >= 0; i--) {
-	    DPRINTK("Trying specified video mode%s\n",
-		    i ? "" : " (ignoring refresh rate)");
+	    DPRINTK("Trying specified video mode%s %ix%i\n",
+		    i ? "" : " (ignoring refresh rate)", xres, yres);
 	    for (j = 0; j < dbsize; j++)
 		if ((name_matches(db[j], name, namelen) ||
 		     (res_specified && res_matches(db[j], xres, yres))) &&
@@ -538,6 +539,22 @@
 		    !fb_try_mode(var, info, &db[j], bpp))
 		    return 2-i;
 	}
+	DPRINTK("Trying best-fit modes\n");
+	for (i = 0; i < dbsize; i++) {
+	    if (xres <= db[i].xres && yres <= db[i].yres) {
+		DPRINTK("Trying %ix%i\n", db[i].xres, db[i].yres);
+		if (!fb_try_mode(var, info, &db[i], bpp)) {
+		    if (diff > (db[i].xres - xres) + (db[i].yres - yres)) {
+			diff = (db[i].xres - xres) + (db[i].yres - yres);
+			best = i;
+		    }

drivers/video/modedb.c line 560

Quoted 10 lines
drivers/video/modedb.c +7 -0
+		}
+	    }
+	}
+	if (best != -1) {
+	    fb_try_mode(var, info, &db[best], bpp);
+	    return 5;
+	}
     }
 
     DPRINTK("Trying default video mode\n");

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

#10 lore raw
In reply to Antonino A. Daplas
Quoted 7 lines · Antonino A. Daplas
Quoted 7 lines · David Eger
Quoted 4 lines

hey tony,

your patch against drivers/video/riva/fbdev.c chokes on hunk 2 when applied to 2.6.7-rc3-mm2. resend, and i'll test it on my TNT2 :)

Ok. Patch against 2.6.7-rc3-mm2.

Applying your rivafb and fbmode patches work great on my TNT2. I get a console with 160 columns and 60 rows :-)

And yes, the capabilities patch makes your driver slow. But setting the proper flags makes it fast again ;-)

The driver still doesn't play nice with the evil binary nvidia drivers, but then, that's expected. (It'd be nice if changing from X to a console didn't *crash my machine* though.)

-dte

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

#6 lore raw
In reply to [email protected]
Quoted 2 lines · [email protected] wrote:

Nice. I will apply.

And then what will happen?

Patches seem to disappear into the linux-fbdev tree never to be seen again. What can we do about this?

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

#11 lore raw
In reply to David Eger
Quoted 11 lines · David Eger
Quoted 7 lines · Antonino A. Daplas
Quoted 7 lines · David Eger
Quoted 4 lines

hey tony,

your patch against drivers/video/riva/fbdev.c chokes on hunk 2 when applied to 2.6.7-rc3-mm2. resend, and i'll test it on my TNT2 :)

Ok. Patch against 2.6.7-rc3-mm2.

Applying your rivafb and fbmode patches work great on my TNT2. I get a console with 160 columns and 60 rows :-)

That's great.

Quoted 3 lines

And yes, the capabilities patch makes your driver slow. But setting the proper flags makes it fast again ;-)

Do you mind submitting a patch yourself? It's probably a 1 liner patch, unless we also modify rivafb to use cfb_* drawing functions depending on the setting of var->accel_flags.

Quoted 5 lines

The driver still doesn't play nice with the evil binary nvidia drivers, but then, that's expected. (It'd be nice if changing from X to a console didn't *crash my machine* though.)

Yeah, even with XOrg/Free86 nv driver, it hangs. Don't really know the exact solution, probably a complete re-initialization of the hardware when switching from X. But this will require that fbcon recognizes a switch from X itself which it currently doesn't (unless I'm mistaken).

Tony

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

#7 lore raw
In reply to Andrew Morton
Quoted 8 lines · Andrew Morton
Quoted 1 line · [email protected] wrote:

Nice. I will apply.

And then what will happen?

Patches seem to disappear into the linux-fbdev tree never to be seen again. What can we do about this?

Andrew,

Can you also apply it (and the rivafb update patch) to your tree? Especially the best-fit mode patch in -mm2 branch which fixes the broken stty functionality.

I'll also submit corresponding changes to James' fbdev tree (once he releases a diff against one of the 2.6.x branch -- I don't have BK).

Tony

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

#8 lore raw
Quoted 3 lines · Antonino A. Daplas

Can you also apply it (and the rivafb update patch) to your tree? Especially the best-fit mode patch in -mm2 branch which fixes the broken stty functionality.

yup. I have three fbdev patches in -mm so far:

updates-to-rivafb-driver.patch
updates-to-rivafb-driver-2.patch
asiliantfb-init-fix.patch

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

#12 lore raw
In reply to Antonino A. Daplas
Quoted 7 lines · Antonino A. Daplas
Quoted 2 lines · David Eger

And yes, the capabilities patch makes your driver slow. But setting the proper flags makes it fast again ;-)

Do you mind submitting a patch yourself? It's probably a 1 liner patch, unless we also modify rivafb to use cfb_* drawing functions depending on the setting of var->accel_flags.

I'd be happy to. I'll forward it to Andrew+James tomorrow. ( I'm currently at the GNU/yak café night in Atlanta, away
from my TNT2 testing box )

Quoted 8 lines
Quoted 3 lines

The driver still doesn't play nice with the evil binary nvidia drivers, but then, that's expected. (It'd be nice if changing from X to aa console didn't *crash my machine* though.)

Yeah, even with XOrg/Free86 nv driver, it hangs. Don't really know the exact solution, probably a complete re-initialization of the hardware when switching from X. But this will require that fbcon recognizes a switch from X itself which it currently doesn't (unless I'm mistaken).

Back in February, BenH said he was going to work on a patch for this:

http://www.uwsg.iu.edu/hypermail/linux/kernel/0402.2/0247.html

Hey Ben, what ever became of this? Are there now hooks for this or something?

-dte

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

#13 lore raw
Quoted 11 lines · David Eger
Quoted 4 lines

Yeah, even with XOrg/Free86 nv driver, it hangs. Don't really know the exact solution, probably a complete re-initialization of the hardware when switching from X. But this will require that fbcon recognizes a switch from X itself which it currently doesn't (unless I'm mistaken).

Back in February, BenH said he was going to work on a patch for this:

http://www.uwsg.iu.edu/hypermail/linux/kernel/0402.2/0247.html

Hey Ben, what ever became of this? Are there now hooks for this or something?

Last time I played with nv & rivafb (a loooong time ago), I found out the hangs were caused by some weirdness with the manipulation of the endian flip register and got that working. The problem I've been working on for restoring console is different, and has to do with forcing a call to set-par when coming back from KD_GRAPHICS mode. That is already upstream (though I noticed some X driver still mess with the HW after the switch back, like the radeon one)

Ben.

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND

#9 lore raw

PATCH 1/1 rivafb: fb accel capabilities

In reply to Antonino A. Daplas

Dear Andrew,

Here's the fb accel capabilities patch for rivafb.

-dte

drivers/video/riva/fbdev.c +6 -1
diff -ru linux-2.6.7-rc3-mm2-wrivafb/drivers/video/riva/fbdev.c linux-2.6.7-rc3-mm2-wrivafb2/drivers/video/riva/fbdev.c
@@ -1665,7 +1665,12 @@
 {
 	unsigned int cmap_len;
 
-	info->flags = FBINFO_FLAG_DEFAULT;
+	info->flags = FBINFO_DEFAULT
+		    | FBINFO_HWACCEL_XPAN
+		    | FBINFO_HWACCEL_YPAN
+		    | FBINFO_HWACCEL_COPYAREA
+		    | FBINFO_HWACCEL_FILLRECT
+		    | FBINFO_HWACCEL_IMAGEBLIT;
 	info->var = rivafb_default_var;
 	info->fix.visual = (info->var.bits_per_pixel == 8) ?
 				FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR;

-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND