Help!

[PATCH] [resend] s3fb: Add Virge/MX (86C260)

 
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Kernel RSS
Next:  Bug#680511: xcp-xe: autocomplete for sr-probe typ..  
Author Message
Ondrej Zary
External


Since: May 17, 2006
Posts: 72



PostPosted: Fri Jul 06, 2012 2:10 pm    Post subject: [PATCH] [resend] s3fb: Add Virge/MX (86C260)
Archived from groups: linux>kernel (more info?)

Add support for Virge/MX (86C260) chip. Although this is a laptop chip,
there's an AGP card with this chip too.

Tested with AGP card, will probably not work correctly with laptops.
DDC does not work on this card (even in DOS or Windows).

Signed-off-by: Ondrej Zary

--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -84,7 +84,7 @@ static const char * const s3_names[] = {"S3 Unknown", "S3 Trio32", "S3 Trio64",
"S3 Virge/VX", "S3 Virge/DX", "S3 Virge/GX",
"S3 Virge/GX2", "S3 Virge/GX2+", "",
"S3 Trio3D/1X", "S3 Trio3D/2X", "S3 Trio3D/2X",
- "S3 Trio3D"};
+ "S3 Trio3D", "S3 Virge/MX"};

#define CHIP_UNKNOWN 0x00
#define CHIP_732_TRIO32 0x01
@@ -105,6 +105,7 @@ static const char * const s3_names[] = {"S3 Unknown", "S3 Trio32", "S3 Trio64",
#define CHIP_362_TRIO3D_2X 0x11
#define CHIP_368_TRIO3D_2X 0x12
#define CHIP_365_TRIO3D 0x13
+#define CHIP_260_VIRGE_MX 0x14

#define CHIP_XXX_TRIO 0x80
#define CHIP_XXX_TRIO64V2_DXGX 0x81
@@ -280,7 +281,8 @@ static int __devinit s3fb_setup_ddc_bus(struct fb_info *info)
*/
/* vga_wseq(par->state.vgabase, 0x08, 0x06); - not needed, already unlocked */
if (par->chip == CHIP_357_VIRGE_GX2 ||
- par->chip == CHIP_359_VIRGE_GX2P)
+ par->chip == CHIP_359_VIRGE_GX2P ||
+ par->chip == CHIP_260_VIRGE_MX)
svga_wseq_mask(par->state.vgabase, 0x0d, 0x01, 0x03);
else
svga_wseq_mask(par->state.vgabase, 0x0d, 0x00, 0x03);
@@ -487,7 +489,8 @@ static void s3_set_pixclock(struct fb_info *info, u32 pixclock)
par->chip == CHIP_359_VIRGE_GX2P ||
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_260_VIRGE_MX) {
vga_wseq(par->state.vgabase, 0x12, (n - 2) | ((r & 3) << 6)); /* n and two bits of r */
vga_wseq(par->state.vgabase, 0x29, r >> 2); /* remaining highest bit of r */
} else
@@ -690,7 +693,8 @@ static int s3fb_set_par(struct fb_info *info)
par->chip != CHIP_359_VIRGE_GX2P &&
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_260_VIRGE_MX) {
vga_wcrt(par->state.vgabase, 0x54, 0x18); /* M parameter */
vga_wcrt(par->state.vgabase, 0x60, 0xff); /* N parameter */
vga_wcrt(par->state.vgabase, 0x61, 0xff); /* L parameter */
@@ -739,7 +743,8 @@ static int s3fb_set_par(struct fb_info *info)
par->chip == CHIP_368_TRIO3D_2X ||
par->chip == CHIP_365_TRIO3D ||
par->chip == CHIP_375_VIRGE_DX ||
- par->chip == CHIP_385_VIRGE_GX) {
+ par->chip == CHIP_385_VIRGE_GX ||
+ par->chip == CHIP_260_VIRGE_MX) {
dbytes = info->var.xres * ((bpp+7)/Cool;
vga_wcrt(par->state.vgabase, 0x91, (dbytes + 7) / Cool;
vga_wcrt(par->state.vgabase, 0x90, (((dbytes + 7) / Cool >> Cool | 0x80);
@@ -751,7 +756,8 @@ static int s3fb_set_par(struct fb_info *info)
par->chip == CHIP_359_VIRGE_GX2P ||
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_260_VIRGE_MX)
vga_wcrt(par->state.vgabase, 0x34, 0x00);
else /* enable Data Transfer Position Control (DTPC) */
vga_wcrt(par->state.vgabase, 0x34, 0x10);
@@ -807,7 +813,8 @@ static int s3fb_set_par(struct fb_info *info)
par->chip == CHIP_359_VIRGE_GX2P ||
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_260_VIRGE_MX)
svga_wcrt_mask(par->state.vgabase, 0x67, 0x00, 0xF0);
else {
svga_wcrt_mask(par->state.vgabase, 0x67, 0x10, 0xF0);
@@ -837,7 +844,8 @@ static int s3fb_set_par(struct fb_info *info)
par->chip != CHIP_359_VIRGE_GX2P &&
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_260_VIRGE_MX)
hmul = 2;
}
break;
@@ -864,7 +872,8 @@ static int s3fb_set_par(struct fb_info *info)
par->chip != CHIP_359_VIRGE_GX2P &&
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_260_VIRGE_MX)
hmul = 2;
}
break;
@@ -1208,7 +1217,8 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i
break;
}
} else if (par->chip == CHIP_357_VIRGE_GX2 ||
- par->chip == CHIP_359_VIRGE_GX2P) {
+ par->chip == CHIP_359_VIRGE_GX2P ||
+ par->chip == CHIP_260_VIRGE_MX) {
switch ((regval & 0xC0) >> 6) {
case 1: /* 4MB */
info->screen_size = 4 << 20;
@@ -1515,6 +1525,7 @@ static struct pci_device_id s3_devices[] __devinitdata = {
{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},
+ {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8C01), .driver_data = CHIP_260_VIRGE_MX},

{0, 0, 0, 0, 0, 0, 0}
};

--
Ondrej Zary
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Florian Tobias Schandinat
External


Since: Jul 30, 2009
Posts: 50



PostPosted: Sun Jul 08, 2012 11:10 pm    Post subject: Re: [PATCH] [resend] s3fb: Add Virge/MX (86C260) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 07/06/2012 01:12 PM, Ondrej Zary wrote:
> Add support for Virge/MX (86C260) chip. Although this is a laptop chip,
> there's an AGP card with this chip too.
>
> Tested with AGP card, will probably not work correctly with laptops.
> DDC does not work on this card (even in DOS or Windows).
>
> Signed-off-by: Ondrej Zary

Applied.


Thanks,

Florian Tobias Schandinat

>
> --- a/drivers/video/s3fb.c
> +++ b/drivers/video/s3fb.c
> @@ -84,7 +84,7 @@ static const char * const s3_names[] = {"S3 Unknown", "S3 Trio32", "S3 Trio64",
> "S3 Virge/VX", "S3 Virge/DX", "S3 Virge/GX",
> "S3 Virge/GX2", "S3 Virge/GX2+", "",
> "S3 Trio3D/1X", "S3 Trio3D/2X", "S3 Trio3D/2X",
> - "S3 Trio3D"};
> + "S3 Trio3D", "S3 Virge/MX"};
>
> #define CHIP_UNKNOWN 0x00
> #define CHIP_732_TRIO32 0x01
> @@ -105,6 +105,7 @@ static const char * const s3_names[] = {"S3 Unknown", "S3 Trio32", "S3 Trio64",
> #define CHIP_362_TRIO3D_2X 0x11
> #define CHIP_368_TRIO3D_2X 0x12
> #define CHIP_365_TRIO3D 0x13
> +#define CHIP_260_VIRGE_MX 0x14
>
> #define CHIP_XXX_TRIO 0x80
> #define CHIP_XXX_TRIO64V2_DXGX 0x81
> @@ -280,7 +281,8 @@ static int __devinit s3fb_setup_ddc_bus(struct fb_info *info)
> */
> /* vga_wseq(par->state.vgabase, 0x08, 0x06); - not needed, already unlocked */
> if (par->chip == CHIP_357_VIRGE_GX2 ||
> - par->chip == CHIP_359_VIRGE_GX2P)
> + par->chip == CHIP_359_VIRGE_GX2P ||
> + par->chip == CHIP_260_VIRGE_MX)
> svga_wseq_mask(par->state.vgabase, 0x0d, 0x01, 0x03);
> else
> svga_wseq_mask(par->state.vgabase, 0x0d, 0x00, 0x03);
> @@ -487,7 +489,8 @@ static void s3_set_pixclock(struct fb_info *info, u32 pixclock)
> par->chip == CHIP_359_VIRGE_GX2P ||
> 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_260_VIRGE_MX) {
> vga_wseq(par->state.vgabase, 0x12, (n - 2) | ((r & 3) << 6)); /* n and two bits of r */
> vga_wseq(par->state.vgabase, 0x29, r >> 2); /* remaining highest bit of r */
> } else
> @@ -690,7 +693,8 @@ static int s3fb_set_par(struct fb_info *info)
> par->chip != CHIP_359_VIRGE_GX2P &&
> 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_260_VIRGE_MX) {
> vga_wcrt(par->state.vgabase, 0x54, 0x18); /* M parameter */
> vga_wcrt(par->state.vgabase, 0x60, 0xff); /* N parameter */
> vga_wcrt(par->state.vgabase, 0x61, 0xff); /* L parameter */
> @@ -739,7 +743,8 @@ static int s3fb_set_par(struct fb_info *info)
> par->chip == CHIP_368_TRIO3D_2X ||
> par->chip == CHIP_365_TRIO3D ||
> par->chip == CHIP_375_VIRGE_DX ||
> - par->chip == CHIP_385_VIRGE_GX) {
> + par->chip == CHIP_385_VIRGE_GX ||
> + par->chip == CHIP_260_VIRGE_MX) {
> dbytes = info->var.xres * ((bpp+7)/Cool;
> vga_wcrt(par->state.vgabase, 0x91, (dbytes + 7) / Cool;
> vga_wcrt(par->state.vgabase, 0x90, (((dbytes + 7) / Cool >> Cool | 0x80);
> @@ -751,7 +756,8 @@ static int s3fb_set_par(struct fb_info *info)
> par->chip == CHIP_359_VIRGE_GX2P ||
> 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_260_VIRGE_MX)
> vga_wcrt(par->state.vgabase, 0x34, 0x00);
> else /* enable Data Transfer Position Control (DTPC) */
> vga_wcrt(par->state.vgabase, 0x34, 0x10);
> @@ -807,7 +813,8 @@ static int s3fb_set_par(struct fb_info *info)
> par->chip == CHIP_359_VIRGE_GX2P ||
> 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_260_VIRGE_MX)
> svga_wcrt_mask(par->state.vgabase, 0x67, 0x00, 0xF0);
> else {
> svga_wcrt_mask(par->state.vgabase, 0x67, 0x10, 0xF0);
> @@ -837,7 +844,8 @@ static int s3fb_set_par(struct fb_info *info)
> par->chip != CHIP_359_VIRGE_GX2P &&
> 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_260_VIRGE_MX)
> hmul = 2;
> }
> break;
> @@ -864,7 +872,8 @@ static int s3fb_set_par(struct fb_info *info)
> par->chip != CHIP_359_VIRGE_GX2P &&
> 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_260_VIRGE_MX)
> hmul = 2;
> }
> break;
> @@ -1208,7 +1217,8 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i
> break;
> }
> } else if (par->chip == CHIP_357_VIRGE_GX2 ||
> - par->chip == CHIP_359_VIRGE_GX2P) {
> + par->chip == CHIP_359_VIRGE_GX2P ||
> + par->chip == CHIP_260_VIRGE_MX) {
> switch ((regval & 0xC0) >> 6) {
> case 1: /* 4MB */
> info->screen_size = 4 << 20;
> @@ -1515,6 +1525,7 @@ static struct pci_device_id s3_devices[] __devinitdata = {
> {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},
> + {PCI_DEVICE(PCI_VENDOR_ID_S3, 0x8C01), .driver_data = CHIP_260_VIRGE_MX},
>
> {0, 0, 0, 0, 0, 0, 0}
> };
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Kernel All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum