aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/matrox/matroxfb_base.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-09-22 19:47:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 10:39:56 -0400
commit0728bacbba3b0267fa8ca8be69aa43d81b57ab51 (patch)
treea0dd85cb348ad481e92a0d4f45eefdc88fac6e3d /drivers/video/matrox/matroxfb_base.c
parent0fcf6ada2b8eb42d132c0846384f1299889609e3 (diff)
matroxfb: make CONFIG_FB_MATROX_MULTIHEAD=y mandatory
I would like to get rid of option CONFIG_FB_MATROX_MULTIHEAD and just always enable it. There are many reasons for doing this: * CONFIG_FB_MATROX_MULTIHEAD=y is what all x86 distributions do, so it definitely works or we would know by now. * Building the matroxfb driver with CONFIG_FB_MATROX_MULTIHEAD not set results in the following build warning: drivers/video/matrox/matroxfb_crtc2.c: In function 'matroxfb_dh_open': drivers/video/matrox/matroxfb_crtc2.c:265: warning: the address of 'matroxfb_global_mxinfo' will always evaluate as 'true' drivers/video/matrox/matroxfb_crtc2.c: In function 'matroxfb_dh_release': drivers/video/matrox/matroxfb_crtc2.c:285: warning: the address of 'matroxfb_global_mxinfo' will always evaluate as 'true' This is nothing to be worried about, the driver will work fine, but build warnings are still annoying. * The trick to get multihead support without CONFIG_FB_MATROX_MULTIHEAD, which is described in the config help text, no longer works: you can't load the same kernel module more than once. * I fail to see how CONFIG_FB_MATROX_MULTIHEAD=y would make the code significantly slower, contrary to what the help text says. A few extra parameters on the stack here and there can't really slow things down in comaprison to the rest of the code, and register access. * The driver built without CONFIG_FB_MATROX_MULTIHEAD is larger than the driver build with CONFIG_FB_MATROX_MULTIHEAD=y by 8%. * One less configuration option makes things simpler. We add options all the time, being able to remove one for once is nice. It improves testing coverage. And I don't think the Matrox adapters are still popular enough to warrant overdetailed configuration settings. * We should be able to unobfuscate the driver code quite a bit after this change (patches follow.) Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Petr Vandrovec <vandrove@vc.cvut.cz> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/matrox/matroxfb_base.c')
-rw-r--r--drivers/video/matrox/matroxfb_base.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
index 0c1049b308b..6ede98da461 100644
--- a/drivers/video/matrox/matroxfb_base.c
+++ b/drivers/video/matrox/matroxfb_base.c
@@ -379,9 +379,7 @@ static void matroxfb_remove(WPMINFO int dummy) {
379 mga_iounmap(ACCESS_FBINFO(video.vbase)); 379 mga_iounmap(ACCESS_FBINFO(video.vbase));
380 release_mem_region(ACCESS_FBINFO(video.base), ACCESS_FBINFO(video.len_maximum)); 380 release_mem_region(ACCESS_FBINFO(video.base), ACCESS_FBINFO(video.len_maximum));
381 release_mem_region(ACCESS_FBINFO(mmio.base), 16384); 381 release_mem_region(ACCESS_FBINFO(mmio.base), 16384);
382#ifdef CONFIG_FB_MATROX_MULTIHEAD
383 kfree(minfo); 382 kfree(minfo);
384#endif
385} 383}
386 384
387 /* 385 /*
@@ -644,9 +642,7 @@ static int matroxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
644 unsigned blue, unsigned transp, 642 unsigned blue, unsigned transp,
645 struct fb_info *fb_info) 643 struct fb_info *fb_info)
646{ 644{
647#ifdef CONFIG_FB_MATROX_MULTIHEAD
648 struct matrox_fb_info* minfo = container_of(fb_info, struct matrox_fb_info, fbcon); 645 struct matrox_fb_info* minfo = container_of(fb_info, struct matrox_fb_info, fbcon);
649#endif
650 646
651 DBG(__func__) 647 DBG(__func__)
652 648
@@ -2011,9 +2007,6 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm
2011 struct matrox_fb_info* minfo; 2007 struct matrox_fb_info* minfo;
2012 int err; 2008 int err;
2013 u_int32_t cmd; 2009 u_int32_t cmd;
2014#ifndef CONFIG_FB_MATROX_MULTIHEAD
2015 static int registered = 0;
2016#endif
2017 DBG(__func__) 2010 DBG(__func__)
2018 2011
2019 svid = pdev->subsystem_vendor; 2012 svid = pdev->subsystem_vendor;
@@ -2037,15 +2030,9 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm
2037 return -1; 2030 return -1;
2038 } 2031 }
2039 2032
2040#ifdef CONFIG_FB_MATROX_MULTIHEAD
2041 minfo = kmalloc(sizeof(*minfo), GFP_KERNEL); 2033 minfo = kmalloc(sizeof(*minfo), GFP_KERNEL);
2042 if (!minfo) 2034 if (!minfo)
2043 return -1; 2035 return -1;
2044#else
2045 if (registered) /* singlehead driver... */
2046 return -1;
2047 minfo = &matroxfb_global_mxinfo;
2048#endif
2049 memset(MINFO, 0, sizeof(*MINFO)); 2036 memset(MINFO, 0, sizeof(*MINFO));
2050 2037
2051 ACCESS_FBINFO(pcidev) = pdev; 2038 ACCESS_FBINFO(pcidev) = pdev;
@@ -2090,15 +2077,10 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm
2090 2077
2091 err = initMatrox2(PMINFO b); 2078 err = initMatrox2(PMINFO b);
2092 if (!err) { 2079 if (!err) {
2093#ifndef CONFIG_FB_MATROX_MULTIHEAD
2094 registered = 1;
2095#endif
2096 matroxfb_register_device(MINFO); 2080 matroxfb_register_device(MINFO);
2097 return 0; 2081 return 0;
2098 } 2082 }
2099#ifdef CONFIG_FB_MATROX_MULTIHEAD
2100 kfree(minfo); 2083 kfree(minfo);
2101#endif
2102 return -1; 2084 return -1;
2103} 2085}
2104 2086
@@ -2510,13 +2492,8 @@ module_param(inv24, int, 0);
2510MODULE_PARM_DESC(inv24, "Inverts clock polarity for 24bpp and loop frequency > 100MHz (default=do not invert polarity)"); 2492MODULE_PARM_DESC(inv24, "Inverts clock polarity for 24bpp and loop frequency > 100MHz (default=do not invert polarity)");
2511module_param(inverse, int, 0); 2493module_param(inverse, int, 0);
2512MODULE_PARM_DESC(inverse, "Inverse (0 or 1) (default=0)"); 2494MODULE_PARM_DESC(inverse, "Inverse (0 or 1) (default=0)");
2513#ifdef CONFIG_FB_MATROX_MULTIHEAD
2514module_param(dev, int, 0); 2495module_param(dev, int, 0);
2515MODULE_PARM_DESC(dev, "Multihead support, attach to device ID (0..N) (default=all working)"); 2496MODULE_PARM_DESC(dev, "Multihead support, attach to device ID (0..N) (default=all working)");
2516#else
2517module_param(dev, int, 0);
2518MODULE_PARM_DESC(dev, "Multihead support, attach to device ID (0..N) (default=first working)");
2519#endif
2520module_param(vesa, int, 0); 2497module_param(vesa, int, 0);
2521MODULE_PARM_DESC(vesa, "Startup videomode (0x000-0x1FF) (default=0x101)"); 2498MODULE_PARM_DESC(vesa, "Startup videomode (0x000-0x1FF) (default=0x101)");
2522module_param(xres, int, 0); 2499module_param(xres, int, 0);