linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/5] s3fb: add support for 86C365 Trio3D
@ 2011-03-01 19:18 Ondrej Zary
  2011-03-03  8:49 ` Ondrej Zajicek
  0 siblings, 1 reply; 2+ messages in thread
From: Ondrej Zary @ 2011-03-01 19:18 UTC (permalink / raw)
  To: Ondrej Zajicek; +Cc: linux-fbdev, Kernel development list

Add support for S3 Trio3D (86C365) cards to s3fb driver. Tested with one 4MB card.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>

--- linux-2.6.38-rc4-/drivers/video/s3fb.c	2011-02-20 20:11:18.000000000 +0100
+++ linux-2.6.38-rc4/drivers/video/s3fb.c	2011-02-20 20:31:34.000000000 +0100
@@ -64,6 +64,8 @@ static const struct svga_fb_format s3fb_
 
 static const struct svga_pll s3_pll = {3, 129, 3, 33, 0, 3,
 	35000, 240000, 14318};
+static const struct svga_pll s3_trio3d_pll = {3, 129, 3, 31, 0, 4,
+	230000, 460000, 14318};
 
 static const int s3_memsizes[] = {4096, 0, 3072, 8192, 2048, 6144, 1024, 512};
 
@@ -72,7 +74,8 @@ static const char * const s3_names[] = {
 			"S3 Plato/PX", "S3 Aurora64VP", "S3 Virge",
 			"S3 Virge/VX", "S3 Virge/DX", "S3 Virge/GX",
 			"S3 Virge/GX2", "S3 Virge/GX2P", "S3 Virge/GX2P",
-			"S3 Trio3D/1X", "S3 Trio3D/2X", "S3 Trio3D/2X"};
+			"S3 Trio3D/1X", "S3 Trio3D/2X", "S3 Trio3D/2X",
+			"S3 Trio3D"};
 
 #define CHIP_UNKNOWN		0x00
 #define CHIP_732_TRIO32		0x01
@@ -93,6 +96,7 @@ static const char * const s3_names[] = {
 #define CHIP_360_TRIO3D_1X	0x10
 #define CHIP_362_TRIO3D_2X	0x11
 #define CHIP_368_TRIO3D_2X	0x12
+#define CHIP_365_TRIO3D		0x13
 
 #define CHIP_XXX_TRIO		0x80
 #define CHIP_XXX_TRIO64V2_DXGX	0x81
@@ -341,7 +345,8 @@ static void s3_set_pixclock(struct fb_in
 	u8 regval;
 	int rv;
 
-	rv = svga_compute_pll(&s3_pll, 1000000000 / pixclock, &m, &n, &r, info->node);
+	rv = svga_compute_pll((par->chip = CHIP_365_TRIO3D) ? &s3_trio3d_pll : &s3_pll,
+			      1000000000 / pixclock, &m, &n, &r, info->node);
 	if (rv < 0) {
 		printk(KERN_ERR "fb%d: cannot set requested pixclock, keeping old value\n", info->node);
 		return;
@@ -598,7 +603,8 @@ static int s3fb_set_par(struct fb_info *
 
 	if (par->chip = CHIP_360_TRIO3D_1X ||
 	    par->chip = CHIP_362_TRIO3D_2X ||
-	    par->chip = CHIP_368_TRIO3D_2X) {
+	    par->chip = CHIP_368_TRIO3D_2X ||
+	    par->chip = CHIP_365_TRIO3D) {
 		dbytes = info->var.xres * ((bpp+7)/8);
 		vga_wcrt(par->state.vgabase, 0x91, (dbytes + 7) / 8);
 		vga_wcrt(par->state.vgabase, 0x90, (((dbytes + 7) / 8) >> 8) | 0x80);
@@ -1012,13 +1018,15 @@ static int __devinit s3_pci_probe(struct
 	regval = vga_rcrt(par->state.vgabase, 0x36);
 	if (par->chip = CHIP_360_TRIO3D_1X ||
 	    par->chip = CHIP_362_TRIO3D_2X ||
-	    par->chip = CHIP_368_TRIO3D_2X) {
+	    par->chip = CHIP_368_TRIO3D_2X ||
+	    par->chip = CHIP_365_TRIO3D) {
 		switch ((regval & 0xE0) >> 5) {
 		case 0: /* 8MB -- only 4MB usable for display */
 		case 1: /* 4MB with 32-bit bus */
 		case 2:	/* 4MB */
 			info->screen_size = 4 << 20;
 			break;
+		case 4: /* 2MB on 365 Trio3D */
 		case 6: /* 2MB */
 			info->screen_size = 2 << 20;
 			break;
@@ -1233,6 +1241,7 @@ static struct pci_device_id s3_devices[]
 	{PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A11), .driver_data = CHIP_357_VIRGE_GX2P},
 	{PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A12), .driver_data = CHIP_359_VIRGE_GX2P},
 	{PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A13), .driver_data = CHIP_36X_TRIO3D_1X_2X},
+	{PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8904), .driver_data = CHIP_365_TRIO3D},
 
 	{0, 0, 0, 0, 0, 0, 0}
 };

-- 
Ondrej Zary

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

* Re: [PATCH 2/5] s3fb: add support for 86C365 Trio3D
  2011-03-01 19:18 [PATCH 2/5] s3fb: add support for 86C365 Trio3D Ondrej Zary
@ 2011-03-03  8:49 ` Ondrej Zajicek
  0 siblings, 0 replies; 2+ messages in thread
From: Ondrej Zajicek @ 2011-03-03  8:49 UTC (permalink / raw)
  To: Ondrej Zary; +Cc: Ondrej Zajicek, linux-fbdev, Kernel development list

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

On Tue, Mar 01, 2011 at 08:18:17PM +0100, Ondrej Zary wrote:
> Add support for S3 Trio3D (86C365) cards to s3fb driver. Tested with one 4MB card.
> 
> Signed-off-by: Ondrej Zary <linux@rainbow-software.org>

Acked-by: Ondrej Zajicek <santiago@crfreenet.org>

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

end of thread, other threads:[~2011-03-03  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-01 19:18 [PATCH 2/5] s3fb: add support for 86C365 Trio3D Ondrej Zary
2011-03-03  8:49 ` Ondrej Zajicek

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