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

Re: 2.6.8-2 drivers/video/tgafb.c



Steve Langasek wrote:
> On Fri, Dec 23, 2005 at 11:02:26AM -0600, Bob Tracy wrote:
> > The subject driver will not compile as a built-in.  I have a patch
> > available for the interested...  (Yes, I'll post this through
> > "reportbug" when I can come up for air).
> 
> I'd be interested to know what problems you're running into as well, since
> it's been suggested that building tgafb into the kernel image is the way to
> get support for these cards into debian-installer.

Well, I've got relatives in town for the holidays and not much time to
spend on Linux-related things :-).  Here's the patch: if anyone wants to
scan it / rework it / whatever and then submit it through proper channels,
please feel free to do so.  The original problem with not being able to
build tgafb.o as a built-in was an undefined tgafb_pci_unregister()
function.  I simply removed a "#if MODULE" constraint that was inconsistent
with the way other drivers in the video driver directory were implemented.
The type of the function had to change as well: I was getting a weird
vmlinux link error that pointed to built-in.o and exit-related issues.  I
also relocated the function to do away with an otherwise unneeded forward
declaration.

As for whether tga2 is supported by this driver, I would speculate the
answer is "no".  The following blurb from linux/Documentation/fb/tgafb.txt
pretty much says it all:

"This driver does not (yet) support the TGA2 family of framebuffers, so the
PowerStorm 3D30/4D20 (also known as PBXGB) cards are not supported. These
can however be used with the standard VGA Text Console driver."

Someone else mentioned the Cirrus fb driver as a possibility for the tga2.
Can anyone confirm whether this works?

====--CUT HERE--====
--- linux/drivers/video/tgafb.c~	2005-12-23 10:37:31.000000000 -0600
+++ linux/drivers/video/tgafb.c	2005-12-23 10:51:55.000000000 -0600
@@ -45,9 +45,6 @@
 static void tgafb_copyarea(struct fb_info *, const struct fb_copyarea *);
 
 static int tgafb_pci_register(struct pci_dev *, const struct pci_device_id *);
-#ifdef MODULE
-static void tgafb_pci_unregister(struct pci_dev *);
-#endif
 
 static const char *mode_option = "640x480@60";
 
@@ -78,6 +75,21 @@
 	  0, 0, 0 }
 };
 
+void __devexit
+tgafb_pci_unregister(struct pci_dev *pdev)
+{
+	struct fb_info *info = pci_get_drvdata(pdev);
+	struct tga_par *par = info->par;
+
+	if (!info)
+		return;
+	unregister_framebuffer(info);
+	iounmap(par->tga_mem_base);
+	release_mem_region(pci_resource_start(pdev, 0),
+			   pci_resource_len(pdev, 0));
+	kfree(info);
+}
+
 static struct pci_driver tgafb_driver = {
 	.name			= "tgafb",
 	.id_table		= tgafb_pci_table,
@@ -1482,28 +1494,11 @@
 	return pci_module_init(&tgafb_driver);
 }
 
-#ifdef MODULE
-static void __exit
-tgafb_pci_unregister(struct pci_dev *pdev)
-{
-	struct fb_info *info = pci_get_drvdata(pdev);
-	struct tga_par *par = info->par;
-
-	if (!info)
-		return;
-	unregister_framebuffer(info);
-	iounmap(par->tga_mem_base);
-	release_mem_region(pci_resource_start(pdev, 0),
-			   pci_resource_len(pdev, 0));
-	kfree(info);
-}
-
-static void __exit
+void __exit
 tgafb_exit(void)
 {
 	pci_unregister_driver(&tgafb_driver);
 }
-#endif /* MODULE */
 
 #ifndef MODULE
 int __init
====--CUT HERE--====

-- 
-----------------------------------------------------------------------
Bob Tracy                   WTO + WIPO = DMCA? http://www.anti-dmca.org
rct@frus.com
-----------------------------------------------------------------------



Reply to: