[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: fbset problem or how to change the res?



On Fri, 8 Mar 2002, Ron Farrer wrote:
> Michel D?nzer (daenzer@debian.org) wrote:
> > It's a possible way, in particular if you just put Modes "current" in
> > the Display subsection.
> > 
> > Getting back to your original question: I guess just 'fbset 1024x768-60'
> > (or any other 1024x768 mode, see /etc/fb.modes) doesn't work either? Do
> > you use tdfxfb or OFfb? The latter can't change modes so you either have
> > to use tdfxfb or the tdfx X driver.
> 
> Ok, I tried changing the modes to "current" and 'fbset
> 1024x768-anything' works fine, I'm using "-100" right now. However fbset 
> only effects the current tty. It doesn't effect tty7. So X still runs at 
> 640x480... 
> 
> As I said in the past, setting the driver to "tdfx" causes the X server
> to segfault (signal 11) at startup (see list archives.) When I built
> this kernel, I said yes to tdfx framebuffer.. but how do I check if it's
> being used? 'cat /proc/fb' shows:
> 0 3Dfx Voodoo3
> 1 OFfb /bandit/3Dfx,Voodoo3
> 
> Looking at that I'd gather it's using the tdfxfb driver.

Worse, it's using _both_ drivers on the same card, because tdfxfb doesn't use
resource management yet! You can fix that by saying `video=offb:off', or
better, try this patch (untested, please let me know whether it works):

--- fbdev-resource-2.4.18-rc1/drivers/video/tdfxfb.c.orig	Thu Feb 14 09:56:52 2002
+++ fbdev-resource-2.4.18-rc1/drivers/video/tdfxfb.c	Sat Feb 16 14:37:39 2002
@@ -1907,6 +1907,7 @@
 {
 	struct fb_var_screeninfo var;
 	char *name = NULL;
+	int error = -ENXIO;
 
 	fb_info.dev = pdev->device;
 	
@@ -1927,28 +1928,36 @@
 	
 	fb_info.regbase_phys = pci_resource_start(pdev, 0);
 	fb_info.regbase_size = 1 << 24;
+	if (!request_mem_region(fb_info.regbase_phys, 1 << 24, "tdfxfb")) {
+		error = -EBUSY;
+		goto fail;
+	}
+
 	fb_info.regbase_virt = ioremap_nocache(fb_info.regbase_phys, 1 << 24);
 	
 	if (!fb_info.regbase_virt) {
 		printk(KERN_WARNING "fb: Can't remap %s register area.\n", name);
-		return -ENXIO;
+		goto release_reg;
 	}
       
 	fb_info.bufbase_phys = pci_resource_start (pdev, 1);
 	
 	if (!(fb_info.bufbase_size = do_lfb_size())) {
-		iounmap(fb_info.regbase_virt);
 		printk(KERN_WARNING "fb: Can't count %s memory.\n", name);
-		return -ENXIO;
+		goto unmap_reg;
 	}
 	
+	if (!request_mem_region(fb_info.bufbase_phys, bufbase_size,
+				"tdfxfb")) {
+		error = -EBUSY;
+		goto unmap_reg;
+	}
 	fb_info.bufbase_virt = ioremap_nocache(fb_info.bufbase_phys,
 					       fb_info.bufbase_size);
 					       
 	if (!fb_info.regbase_virt) {
 		printk(KERN_WARNING "fb: Can't remap %s framebuffer.\n", name);
-		iounmap(fb_info.regbase_virt);
-		return -ENXIO;
+		goto release_buf;
 	}
 
 	fb_info.iobase = pci_resource_start (pdev, 2);
@@ -2014,7 +2023,7 @@
 		if (tdfxfb_decode_var(&var, &fb_info.default_par, &fb_info)) {
 			/* this is getting really bad!... */
 			printk(KERN_WARNING "tdfxfb: can't decode default video mode\n");
-			return -ENXIO;
+			goto unmap_buf;
 		}
 	}
 
@@ -2023,18 +2032,29 @@
       
 	if (tdfxfb_set_var(&var, -1, &fb_info.fb_info)) {
 		printk(KERN_WARNING "tdfxfb: can't set default video mode\n");
-		return -ENXIO;
+		goto unmap_buf;
 	}
 
 	if (register_framebuffer(&fb_info.fb_info) < 0) {
 		printk(KERN_WARNING "tdfxfb: can't register framebuffer\n");
-		return -ENXIO;
+		goto unmap_buf;
 	}
 
 	printk(KERN_INFO "fb%d: %s frame buffer device\n", 
 	     GET_FB_IDX(fb_info.fb_info.node), fb_info.fb_info.modename);
       
   	return 0;
+
+unmap_buf:
+	iounmap(fb_info.bufbase_virt);
+release_buf:
+	release_mem_region(fb_info.bufbase_phys, bufbase_size);
+unmap_reg:
+	iounmap(fb_info.regbase_virt);
+release_reg:
+	release_mem_region(fb_info.regbase_phys, 1 << 24);
+fail:
+	return error;
 }
 
 /**
@@ -2058,8 +2078,10 @@
        }
 #endif
 
-	iounmap(fb_info.regbase_virt);
 	iounmap(fb_info.bufbase_virt);
+	release_mem_region(fb_info.bufbase_phys, bufbase_size);
+	iounmap(fb_info.regbase_virt);
+	release_mem_region(fb_info.regbase_phys, 1 << 24);
 }
 
 int __init tdfxfb_init(void)

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds



Reply to: