linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Multi-head fix for tdfxfb driver (again)
@ 2003-10-30 15:52 Richard Drummond
  0 siblings, 0 replies; only message in thread
From: Richard Drummond @ 2003-10-30 15:52 UTC (permalink / raw)
  To: Linux Fbdev development list; +Cc: Kernel Mailing List, James Simmons

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

Bloody web mail. I'll try that again . . .

Hi All

This patch (against 2.6.0-test9) corrects a bug in the tdfxfb driver with
regard to multi-head set-ups. The driver was stomping all over its default
fb_fix_screeninfo struct (the global, tdfx_fix) when initializing a card -
which could potentially causes problems when the time comes to set up the
next card. This fix makes it copy tdfx_fix first and modify only that copy.

Cheers,
Rich

[-- Attachment #2: tdfxfb2.6.0test920031030.diff --]
[-- Type: text/plain, Size: 3184 bytes --]

--- linux-2.6.0-test9/drivers/video/tdfxfb.c.orig	2003-10-30 08:32:22.000000000 -0500
+++ linux-2.6.0-test9/drivers/video/tdfxfb.c	2003-10-30 09:43:39.000000000 -0500
@@ -1152,6 +1152,8 @@
 {
 	struct tdfx_par *default_par;
 	struct fb_info *info;
+	struct fb_fix_screeninfo *fix;
+
 	int size, err;
 
 	if ((err = pci_enable_device(pdev))) {
@@ -1168,28 +1170,30 @@
 	memset(info, 0, size);
     
 	default_par = (struct tdfx_par *) (info + 1);
+	info->fix = tdfx_fix;
+	fix = &info->fix;
  
 	/* Configure the default fb_fix_screeninfo first */
 	switch (pdev->device) {
 		case PCI_DEVICE_ID_3DFX_BANSHEE:	
-			strcat(tdfx_fix.id, " Banshee");
+			strcat(fix->id, " Banshee");
 			default_par->max_pixclock = BANSHEE_MAX_PIXCLOCK;
 			break;
 		case PCI_DEVICE_ID_3DFX_VOODOO3:
-			strcat(tdfx_fix.id, " Voodoo3");
+			strcat(fix->id, " Voodoo3");
 			default_par->max_pixclock = VOODOO3_MAX_PIXCLOCK;
 			break;
 		case PCI_DEVICE_ID_3DFX_VOODOO5:
-			strcat(tdfx_fix.id, " Voodoo5");
+			strcat(fix->id, " Voodoo5");
 			default_par->max_pixclock = VOODOO5_MAX_PIXCLOCK;
 			break;
 	}
 
-	tdfx_fix.mmio_start = pci_resource_start(pdev, 0);
-	tdfx_fix.mmio_len = pci_resource_len(pdev, 0);
-	default_par->regbase_virt = ioremap_nocache(tdfx_fix.mmio_start, tdfx_fix.mmio_len);
+	fix->mmio_start = pci_resource_start(pdev, 0);
+	fix->mmio_len = pci_resource_len(pdev, 0);
+	default_par->regbase_virt = ioremap_nocache(fix->mmio_start, fix->mmio_len);
 	if (!default_par->regbase_virt) {
-		printk("fb: Can't remap %s register area.\n", tdfx_fix.id);
+		printk("fb: Can't remap %s register area.\n", fix->id);
 		goto out_err;
 	}
     
@@ -1199,9 +1203,9 @@
 		goto out_err;
 	} 
 
-	tdfx_fix.smem_start = pci_resource_start(pdev, 1);
-	if (!(tdfx_fix.smem_len = do_lfb_size(default_par, pdev->device))) {
-		printk("fb: Can't count %s memory.\n", tdfx_fix.id);
+	fix->smem_start = pci_resource_start(pdev, 1);
+	if (!(fix->smem_len = do_lfb_size(default_par, pdev->device))) {
+		printk("fb: Can't count %s memory.\n", fix->id);
 		release_mem_region(pci_resource_start(pdev, 0),
 				   pci_resource_len(pdev, 0));
 		goto out_err;	
@@ -1215,10 +1219,10 @@
 		goto out_err;
 	}
 
-	info->screen_base = ioremap_nocache(tdfx_fix.smem_start, 
-					    tdfx_fix.smem_len);
+	info->screen_base = ioremap_nocache(fix->smem_start, 
+					    fix->smem_len);
 	if (!info->screen_base) {
-		printk("fb: Can't remap %s framebuffer.\n", tdfx_fix.id);
+		printk("fb: Can't remap %s framebuffer.\n", fix->id);
 		release_mem_region(pci_resource_start(pdev, 1),
 				   pci_resource_len(pdev, 1));
 		release_mem_region(pci_resource_start(pdev, 0),
@@ -1238,13 +1242,13 @@
 		goto out_err;
 	}
 
-	printk("fb: %s memory = %dK\n", tdfx_fix.id, tdfx_fix.smem_len >> 10);
+	printk("fb: %s memory = %dK\n", fix->id, fix->smem_len >> 10);
 
-	tdfx_fix.ypanstep	= nopan ? 0 : 1;
-	tdfx_fix.ywrapstep	= nowrap ? 0 : 1;
+	fix->ypanstep	= nopan ? 0 : 1;
+	fix->ywrapstep	= nowrap ? 0 : 1;
    
 	info->fbops		= &tdfxfb_ops;
-	info->fix		= tdfx_fix; 	
+/*	info->fix		= tdfx_fix; */
 	info->par		= default_par;
 	info->pseudo_palette	= (void *)(default_par + 1); 
 	info->flags		= FBINFO_FLAG_DEFAULT;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-30 15:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-30 15:52 [PATCH] Multi-head fix for tdfxfb driver (again) Richard Drummond

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