fbdev: S3 Savage Framebuffer Driver
PATCH 1/2 fbdev: S3 Savage Framebuffer Driver
S3 Savage Frambuffer Driver for the following chipsets:
Savage 3D
Savage MX
Savage 4
Savage 2000
ProSavage
SuperSavage
This is based from the driver written by:
Denis Oliver Kropp <[email protected]>
Sven Neumann <[email protected]>
Initial Porting to 2.6 done by:
Mika Pruikkonen <[email protected]>
Added the following:
- Console acceleration support (imageblit, fillrect, copyarea) - Configurable
- DDC2/I2C support for (ProSavage DDR-K, Savage 4 and Prosavage PM only - Configurable
- 8, 16, 32 bits per pixel
--- drivers/video/Kconfig | 36 drivers/video/Makefile | 3 drivers/video/savage/Makefile | 8 drivers/video/savage/savagefb-i2c.c | 257 +++ drivers/video/savage/savagefb.c | 2282 ++++++++++++++++++++++++++++++++++ drivers/video/savage/savagefb.h | 354 +++++ drivers/video/savage/savagefb_accel.c | 135 ++ include/linux/fb.h | 15 8 files changed, 3089 insertions(+), 1 deletion(-)
drivers/video/Kconfig +36 -0
@@ -795,6 +795,42 @@ is at <http://support.ati.com/products/pc/mach64/graphics_xpression.html>. +config FB_SAVAGE + tristate "S3 Savage support" + depends on FB && PCI && EXPERIMENTAL + select I2C_ALGOBIT if FB_SAVAGE_I2C + select I2C if FB_SAVAGE_I2C + select FB_MODE_HELPERS + help + This driver supports notebooks and computers with S3 Savage PCI/AGP + chips. + + Say Y if you have such a graphics card. + + To compile this driver as a module, choose M here; the module + will be called savagefb. + +config FB_SAVAGE_I2C + bool "Enable DDC2 Support" + depends on FB_SAVAGE + help + This enables I2C support for S3 Savage Chipsets. This is used + only for getting EDID information from the attached display + allowing for robust video mode handling and switching. + + Because fbdev-2.6 requires that drivers must be able to + independently validate video mode parameters, you should say Y + here. + +config FB_SAVAGE_ACCEL + bool "Enable Console Acceleration" + depends on FB_SAVAGE + default n + help + This option will compile in console acceleration support. If + the resulting framebuffer console has bothersome glitches, then + choose N here. + config FB_SIS tristate "SiS acceleration" depends on FB && PCI
drivers/video/Makefile +2 -1
@@ -29,7 +29,8 @@ obj-$(CONFIG_FB_RADEON) += aty/ cfbcopyarea.o cfbfillrect.o cfbimgblt.o obj-$(CONFIG_FB_SIS) += sis/ cfbcopyarea.o cfbfillrect.o cfbimgblt.o obj-$(CONFIG_FB_KYRO) += kyro/ cfbfillrect.o cfbcopyarea.o cfbimgblt.o - +obj-$(CONFIG_FB_SAVAGE) += savage/ cfbfillrect.o cfbcopyarea.o \ + cfbimgblt.o obj-$(CONFIG_FB_I810) += cfbcopyarea.o cfbfillrect.o cfbimgblt.o \ vgastate.o obj-$(CONFIG_FB_INTEL) += cfbfillrect.o cfbcopyarea.o \
drivers/video/savage/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# +# Makefile for the S3 Savage framebuffer driver +# + +obj-$(CONFIG_FB_SAVAGE) += savagefb.o +obj-$(CONFIG_FB_SAVAGE_I2C) += savagefb-i2c.o +obj-$(CONFIG_FB_SAVAGE_ACCEL) += savagefb_accel.o +
drivers/video/savage/savagefb-i2c.c new file +257 -0
257 lines not on this page · raw message
drivers/video/savage/savagefb.c new file +2282 -0
2,282 lines not on this page · raw message
drivers/video/savage/savagefb.h new file +354 -0
354 lines not on this page · raw message
drivers/video/savage/savagefb_accel.c new file +135 -0
48 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
Part of the diff is not shown here. View the raw message.
Quoting Antonino A. Daplas:
Quoted 16 lines
S3 Savage Frambuffer Driver for the following chipsets:
Savage 3D
Savage MX
Savage 4
Savage 2000
ProSavage
SuperSavageThis is based from the driver written by:
Denis Oliver Kropp <[email protected]>
Sven Neumann <[email protected]>Initial Porting to 2.6 done by:
Mika Pruikkonen <[email protected]>
Quoted 6 lines
Added the following:
- Console acceleration support (imageblit, fillrect, copyarea) - Configurable
- DDC2/I2C support for (ProSavage DDR-K, Savage 4 and Prosavage PM only - Configurable
- 8, 16, 32 bits per pixel
Hi,
you've made a great progress with the driver!
Nice to see that this driver is maintained again.
Signature · 16 lines
Best regards,
Denis Oliver Kropp
.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/ |
"------------------------------------------"
Convergence GmbH
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmplQuoted 2 lines · Antonino A. Daplas
S3 Savage Frambuffer Driver for the following chipsets:
build fixes:
drivers/video/savage/savagefb.c:1368: macro SavagePrintRegs' used without args drivers/video/savage/savagefb.c:1926: macro SavagePrintRegs' used without args drivers/video/savage/savagefb.c:2141: macro `SavagePrintRegs' used without args
drivers/video/savage/savagefb.c: In function `savagefb_init':drivers/video/savage/savagefb.c:2276: warning: implicit declaration of function `savagefb_setup'
---
25-akpm/drivers/video/savage/savagefb.c | 5 ++--- 25-akpm/drivers/video/savage/savagefb.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/video/savage/savagefb.h renamed from drivers/video/savage/savagefb.h~savagefb-build-fix +1 -1
@@ -21,7 +21,7 @@# define DBG (x) printk (KERN_DEBUG "savagefb: %s\n", (x));#else # define DBG (x) -# define SavagePrintRegs (x) +# define SavagePrintRegs (...)#endif
drivers/video/savage/savagefb.c renamed from drivers/video/savage/savagefb.c~savagefb-build-fix +2 -3
@@ -2248,9 +2248,9 @@ static void __exit savage_done (void)/* ************************* init in-kernel code ************************** */ -#ifndef MODULE int __init savagefb_setup (char *options) { +#ifndef MODULE char *this_opt;if (!options || !*options)
@@ -2259,10 +2259,9 @@ int __init savagefb_setup(char *options)while ((this_opt =strsep (&options,"," )) !=NULL ) { mode_option = this_opt; } - +#endif /* !MODULE */ return 0 ; } -#endif /* !MODULE */ int __init savagefb_init (void ) {
_
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
Quoted 6 lines · Andrew Morton
Quoted 1 line · Antonino A. Daplas
S3 Savage Frambuffer Driver for the following chipsets:
build fixes:
Thanks.
Tony
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
From: Antonino A. Daplas <[email protected]>
Date: Sat, Oct 23, 2004 at 04:36:41AM +0800
Quoted 9 lines
S3 Savage Frambuffer Driver for the following chipsets:
Savage 3D
Savage MX
Savage 4
Savage 2000
ProSavage
SuperSavage
Excellent. I tried this (in 2.6.10-rc1-mm4) with my Thinkpad T23, which has a SuperSavage IX/C SDR according to lspci.
If I compile the framebuffer into the kernel, it hangs during boot. The oops is only partly visible, but the first line of the traceback contains savage_setup_i2c_bus.
If I compile it as a module, it comes up with 800x600, which looks like sh*t on a 1024x768 lcd panel. All my attempts to change the resolution, either with fbset, or variations on this command
modprobe savagefb mode=1024x768-60
didn't work.
Would you give me any hints on how to get it to come up with 1024x768? I would love to see if it's faster than the vesa framebuffer I've been using so far.
Thanks,
Jurriaan
Signature · 10 lines
I am the neurosis that requires a $500 an hour shrink Darkwing Duck Debian (Unstable) GNU/Linux 2.6.9-mm1 2x6078 bogomips load 0.84 ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
Quoted 12 lines · Jurriaan
From: Antonino A. Daplas <[email protected]>
Date: Sat, Oct 23, 2004 at 04:36:41AM +0800Quoted 8 lines
S3 Savage Frambuffer Driver for the following chipsets:
Savage 3D
Savage MX
Savage 4
Savage 2000
ProSavage
SuperSavage
Quoted 6 lines
Excellent. I tried this (in 2.6.10-rc1-mm4) with my Thinkpad T23, which has a SuperSavage IX/C SDR according to lspci.
If I compile the framebuffer into the kernel, it hangs during boot. The oops is only partly visible, but the first line of the traceback contains
savage_setup_i2c_bus.
Ok, this is a bug that is triggered when the particular chipset has no i2c support.
Quoted 8 lines
If I compile it as a module, it comes up with 800x600, which looks like sh*t on a 1024x768 lcd panel. All my attempts to change the resolution, either with fbset, or variations on this command
modprobe savagefb mode=1024x768-60
didn't work.
Ok, this is another bug that prevents mode changing if the EDID block is not found.
Quoted 2 lines
Would you give me any hints on how to get it to come up with 1024x768?
With the attached patch, which fixes both bugs, you can boot with:
video=savagefb:1024x768@60
and use fbset to your heart's content. But without an EDID block, no mode validating is done.
Quoted 2 lines
I would love to see if it's faster than the vesa framebuffer I've been using so far.
Should be, at least console-wise, if acceleration is enabled. Significant, but not to full potential, since in accelerated mode, the virtual resolution is limited at 4096.
Thanks for reporting the bugs. I'm also submitting the patch to Andrew.
Tony
drivers/video/savage/savagefb-i2c.c +54 -39
@@ -141,32 +141,37 @@static int savage_setup_i2c_bus (struct savagefb_i2c_chan *chan,const char *name) { -int rc; +int (*add_bus)(struct i2c_adapter *) =symbol_get (i2c_bit_add_bus); +int rc =0 ; + +if (add_bus && chan->par) { +strcpy (chan->adapter.name, name); + chan->adapter.owner =THIS_MODULE ; + chan->adapter.id =I2C_ALGO_SAVAGE ; + chan->adapter.algo_data = &chan->algo; + chan->adapter.dev.parent = &chan->par->pcidev->dev; + chan->algo.udelay =40 ; + chan->algo.mdelay =5 ; + chan->algo.timeout =20 ; + chan->algo.data = chan; + +i2c_set_adapdata (&chan->adapter, chan); + +/* Raise SCL and SDA */ + chan->algo.setsda (chan,1 ); + chan->algo.setscl (chan,1 ); +udelay (20 ); + + rc =add_bus (&chan->adapter); +if (rc ==0 ) +dev_dbg (&chan->par->pcidev->dev, +"I2C bus %s registered.\n" , name); +else +dev_warn (&chan->par->pcidev->dev, +"Failed to register I2C bus %s.\n" , name); + }else + chan->par =NULL ; -strcpy (chan->adapter.name, name); - chan->adapter.owner =THIS_MODULE ; - chan->adapter.id =I2C_ALGO_SAVAGE ; - chan->adapter.algo_data = &chan->algo; - chan->adapter.dev.parent = &chan->par->pcidev->dev; - chan->algo.udelay =40 ; - chan->algo.mdelay =5 ; - chan->algo.timeout =20 ; - chan->algo.data = chan; - -i2c_set_adapdata (&chan->adapter, chan); - -/* Raise SCL and SDA */ - chan->algo.setsda (chan,1 ); - chan->algo.setscl (chan,1 ); -udelay (20 ); - - rc =i2c_bit_add_bus (&chan->adapter); -if (rc ==0 ) -dev_dbg (&chan->par->pcidev->dev, -"I2C bus %s registered.\n" , name); -else -dev_warn (&chan->par->pcidev->dev, -"Failed to register I2C bus %s.\n" , name);return rc; }
@@ -174,7 +179,7 @@ {struct savagefb_par *par = (struct savagefb_par *)info->par; par->chan.par = par; - +switch (info->fix.accel) {case FB_ACCEL_PROSAVAGE_DDRK :case FB_ACCEL_PROSAVAGE_PM :
@@ -193,6 +198,8 @@ par->chan.algo.getsda = savage4_gpio_getsda; par->chan.algo.getscl = savage4_gpio_getscl;break ; +default : + par->chan.par =NULL ; }savage_setup_i2c_bus (&par->chan,"SAVAGE DDC2" );
@@ -202,9 +209,12 @@void savagefb_delete_i2c_busses (struct fb_info *info) {struct savagefb_par *par = (struct savagefb_par *)info->par; +int (*del_bus)(struct i2c_adapter *) = +symbol_get (i2c_bit_del_bus); + +if (del_bus && par->chan.par) +del_bus (&par->chan.adapter); -if (par->chan.par) -i2c_bit_del_bus (&par->chan.adapter); par->chan.par =NULL ; }EXPORT_SYMBOL (savagefb_delete_i2c_busses);
@@ -212,6 +222,8 @@static u8 *savage_do_probe_i2c_edid (struct savagefb_i2c_chan *chan) {u8 start =0x0 ; +int (*transfer)(struct i2c_adapter *,struct i2c_msg *,int ) = +symbol_get (i2c_transfer);struct i2c_msg msgs[] = { { .addr =SAVAGE_DDC ,
@@ -223,20 +235,23 @@ .len = EDID_LENGTH, }, }; -u8 *buf; +u8 *buf =NULL ; - buf =kmalloc (EDID_LENGTH ,GFP_KERNEL ); -if (!buf) { -dev_warn (&chan->par->pcidev->dev,"Out of memory!\n" ); -return NULL ; +if (transfer && chan->par) { + buf =kmalloc (EDID_LENGTH ,GFP_KERNEL ); +if (buf) { + msgs[1 ].buf = buf; + +if (transfer (&chan->adapter, msgs,2 ) !=2 ) { +dev_dbg (&chan->par->pcidev->dev, +"Unable to read EDID block.\n" ); +kfree (buf); + buf =NULL ; + } + } } - msgs[1 ].buf = buf; -if (i2c_transfer (&chan->adapter, msgs,2 ) ==2 ) -return buf; -dev_dbg (&chan->par->pcidev->dev,"Unable to read EDID block.\n" ); -kfree (buf); -return NULL ; +return buf; }int savagefb_probe_i2c_connector (struct savagefb_par *par,u8 **out_edid)
drivers/video/savage/savagefb.c +12 -13
@@ -738,7 +738,7 @@ } } -if (!mode_valid && !list_empty (&info->modelist)) +if (!mode_valid && info->monspecs.modedb_len)return -EINVAL ;/* Is the mode larger than the LCD panel? */
@@ -1821,43 +1821,43 @@break ;case FB_ACCEL_SAVAGE_MX_MV : par->chip =S3_SAVAGE_MX ; -snprintf (info->fix.id,16 ,"S3 Savage/MX-MV" ); +snprintf (info->fix.id,16 ,"Savage/MX-MV" );break ;case FB_ACCEL_SAVAGE_MX : par->chip =S3_SAVAGE_MX ; -snprintf (info->fix.id,16 ,"S3 Savage/MX" ); +snprintf (info->fix.id,16 ,"Savage/MX" );break ;case FB_ACCEL_SAVAGE_IX_MV : par->chip =S3_SAVAGE_MX ; -snprintf (info->fix.id,16 ,"S3 Savage/IX-MV" ); +snprintf (info->fix.id,16 ,"Savage/IX-MV" );break ;case FB_ACCEL_SAVAGE_IX : par->chip =S3_SAVAGE_MX ; -snprintf (info->fix.id,16 ,"S3 Savage/IX" ); +snprintf (info->fix.id,16 ,"Savage/IX" );break ;case FB_ACCEL_PROSAVAGE_PM : par->chip =S3_PROSAVAGE ; -snprintf (info->fix.id,16 ,"S3 ProSavage" ); +snprintf (info->fix.id,16 ,"ProSavagePM" );break ;case FB_ACCEL_PROSAVAGE_KM : par->chip =S3_PROSAVAGE ; -snprintf (info->fix.id,16 ,"S3 ProSavage" ); +snprintf (info->fix.id,16 ,"ProSavageKM" );break ;case FB_ACCEL_S3TWISTER_P : par->chip =S3_PROSAVAGE ; -snprintf (info->fix.id,16 ,"S3 Twister" ); +snprintf (info->fix.id,16 ,"TwisterP" );break ;case FB_ACCEL_S3TWISTER_K : par->chip =S3_PROSAVAGE ; -snprintf (info->fix.id,16 ,"S3 TwisterK" ); +snprintf (info->fix.id,16 ,"TwisterK" );break ;case FB_ACCEL_PROSAVAGE_DDR : par->chip =S3_PROSAVAGE ; -snprintf (info->fix.id,16 ,"S3 ProSavage DDR" ); +snprintf (info->fix.id,16 ,"ProSavageDDR" );break ;case FB_ACCEL_PROSAVAGE_DDRK : par->chip =S3_PROSAVAGE ; -snprintf (info->fix.id,16 ,"S3 ProSavage DDR-K" ); +snprintf (info->fix.id,16 ,"ProSavage8" );break ; }
@@ -2033,14 +2033,13 @@fb_destroy_modedb (info->monspecs.modedb); - info->monspecs.modedb_len =0 ; info->monspecs.modedb =NULL ; err =register_framebuffer (info);if (err <0 ) goto failed; -printk (KERN_INFO "fb: %s frame buffer device\n" , +printk (KERN_INFO "fb: S3 %s frame buffer device\n" , info->fix.id);/*
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click