aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2011-03-01 14:18:17 -0500
committerPaul Mundt <lethal@linux-sh.org>2011-03-22 02:49:49 -0400
commit5694f9ce5801d58bfc1b011592a5e460cc0a274b (patch)
tree50659c06694a95c4a95fda4b41e77c301fe5b725 /drivers/video
parent99d054d8253b1dbc6ab2d4ebcb25ad4a4e6ba1c8 (diff)
s3fb: add support for 86C365 Trio3D
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> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/s3fb.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
index 9f9be9f37f2e..be12145681f6 100644
--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -64,6 +64,8 @@ static const struct svga_fb_format s3fb_formats[] = {
64 64
65static const struct svga_pll s3_pll = {3, 129, 3, 33, 0, 3, 65static const struct svga_pll s3_pll = {3, 129, 3, 33, 0, 3,
66 35000, 240000, 14318}; 66 35000, 240000, 14318};
67static const struct svga_pll s3_trio3d_pll = {3, 129, 3, 31, 0, 4,
68 230000, 460000, 14318};
67 69
68static const int s3_memsizes[] = {4096, 0, 3072, 8192, 2048, 6144, 1024, 512}; 70static const int s3_memsizes[] = {4096, 0, 3072, 8192, 2048, 6144, 1024, 512};
69 71
@@ -72,7 +74,8 @@ static const char * const s3_names[] = {"S3 Unknown", "S3 Trio32", "S3 Trio64",
72 "S3 Plato/PX", "S3 Aurora64VP", "S3 Virge", 74 "S3 Plato/PX", "S3 Aurora64VP", "S3 Virge",
73 "S3 Virge/VX", "S3 Virge/DX", "S3 Virge/GX", 75 "S3 Virge/VX", "S3 Virge/DX", "S3 Virge/GX",
74 "S3 Virge/GX2", "S3 Virge/GX2P", "S3 Virge/GX2P", 76 "S3 Virge/GX2", "S3 Virge/GX2P", "S3 Virge/GX2P",
75 "S3 Trio3D/1X", "S3 Trio3D/2X", "S3 Trio3D/2X"}; 77 "S3 Trio3D/1X", "S3 Trio3D/2X", "S3 Trio3D/2X",
78 "S3 Trio3D"};
76 79
77#define CHIP_UNKNOWN 0x00 80#define CHIP_UNKNOWN 0x00
78#define CHIP_732_TRIO32 0x01 81#define CHIP_732_TRIO32 0x01
@@ -93,6 +96,7 @@ static const char * const s3_names[] = {"S3 Unknown", "S3 Trio32", "S3 Trio64",
93#define CHIP_360_TRIO3D_1X 0x10 96#define CHIP_360_TRIO3D_1X 0x10
94#define CHIP_362_TRIO3D_2X 0x11 97#define CHIP_362_TRIO3D_2X 0x11
95#define CHIP_368_TRIO3D_2X 0x12 98#define CHIP_368_TRIO3D_2X 0x12
99#define CHIP_365_TRIO3D 0x13
96 100
97#define CHIP_XXX_TRIO 0x80 101#define CHIP_XXX_TRIO 0x80
98#define CHIP_XXX_TRIO64V2_DXGX 0x81 102#define CHIP_XXX_TRIO64V2_DXGX 0x81
@@ -341,7 +345,8 @@ static void s3_set_pixclock(struct fb_info *info, u32 pixclock)
341 u8 regval; 345 u8 regval;
342 int rv; 346 int rv;
343 347
344 rv = svga_compute_pll(&s3_pll, 1000000000 / pixclock, &m, &n, &r, info->node); 348 rv = svga_compute_pll((par->chip == CHIP_365_TRIO3D) ? &s3_trio3d_pll : &s3_pll,
349 1000000000 / pixclock, &m, &n, &r, info->node);
345 if (rv < 0) { 350 if (rv < 0) {
346 printk(KERN_ERR "fb%d: cannot set requested pixclock, keeping old value\n", info->node); 351 printk(KERN_ERR "fb%d: cannot set requested pixclock, keeping old value\n", info->node);
347 return; 352 return;
@@ -598,7 +603,8 @@ static int s3fb_set_par(struct fb_info *info)
598 603
599 if (par->chip == CHIP_360_TRIO3D_1X || 604 if (par->chip == CHIP_360_TRIO3D_1X ||
600 par->chip == CHIP_362_TRIO3D_2X || 605 par->chip == CHIP_362_TRIO3D_2X ||
601 par->chip == CHIP_368_TRIO3D_2X) { 606 par->chip == CHIP_368_TRIO3D_2X ||
607 par->chip == CHIP_365_TRIO3D) {
602 dbytes = info->var.xres * ((bpp+7)/8); 608 dbytes = info->var.xres * ((bpp+7)/8);
603 vga_wcrt(par->state.vgabase, 0x91, (dbytes + 7) / 8); 609 vga_wcrt(par->state.vgabase, 0x91, (dbytes + 7) / 8);
604 vga_wcrt(par->state.vgabase, 0x90, (((dbytes + 7) / 8) >> 8) | 0x80); 610 vga_wcrt(par->state.vgabase, 0x90, (((dbytes + 7) / 8) >> 8) | 0x80);
@@ -1012,13 +1018,15 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i
1012 regval = vga_rcrt(par->state.vgabase, 0x36); 1018 regval = vga_rcrt(par->state.vgabase, 0x36);
1013 if (par->chip == CHIP_360_TRIO3D_1X || 1019 if (par->chip == CHIP_360_TRIO3D_1X ||
1014 par->chip == CHIP_362_TRIO3D_2X || 1020 par->chip == CHIP_362_TRIO3D_2X ||
1015 par->chip == CHIP_368_TRIO3D_2X) { 1021 par->chip == CHIP_368_TRIO3D_2X ||
1022 par->chip == CHIP_365_TRIO3D) {
1016 switch ((regval & 0xE0) >> 5) { 1023 switch ((regval & 0xE0) >> 5) {
1017 case 0: /* 8MB -- only 4MB usable for display */ 1024 case 0: /* 8MB -- only 4MB usable for display */
1018 case 1: /* 4MB with 32-bit bus */ 1025 case 1: /* 4MB with 32-bit bus */
1019 case 2: /* 4MB */ 1026 case 2: /* 4MB */
1020 info->screen_size = 4 << 20; 1027 info->screen_size = 4 << 20;
1021 break; 1028 break;
1029 case 4: /* 2MB on 365 Trio3D */
1022 case 6: /* 2MB */ 1030 case 6: /* 2MB */
1023 info->screen_size = 2 << 20; 1031 info->screen_size = 2 << 20;
1024 break; 1032 break;
@@ -1226,6 +1234,7 @@ static struct pci_device_id s3_devices[] __devinitdata = {
1226 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A11), .driver_data = CHIP_357_VIRGE_GX2P}, 1234 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A11), .driver_data = CHIP_357_VIRGE_GX2P},
1227 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A12), .driver_data = CHIP_359_VIRGE_GX2P}, 1235 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A12), .driver_data = CHIP_359_VIRGE_GX2P},
1228 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A13), .driver_data = CHIP_36X_TRIO3D_1X_2X}, 1236 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8A13), .driver_data = CHIP_36X_TRIO3D_1X_2X},
1237 {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8904), .driver_data = CHIP_365_TRIO3D},
1229 1238
1230 {0, 0, 0, 0, 0, 0, 0} 1239 {0, 0, 0, 0, 0, 0, 0}
1231}; 1240};