mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [linux-fbdev] [PATCH] matroxfb as a module (PPC)
@ 2001-01-03 19:25 Petr Vandrovec
  2001-01-03 22:24 ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vandrovec @ 2001-01-03 19:25 UTC (permalink / raw)
  To: Tom Rini; +Cc: Petr Vandrovec, linux-fbdev, linux-kernel, geert

On  3 Jan 01 at 10:54, Tom Rini wrote:
> I agree this sounds good.  I just think it's too late to do it now. :)
> 
> The vmode/cmode/vesa number stuff should stick around in 2.4 (it's too late
> now to remove it) but documented as obsolete, and removed in 2.5.

I personally prefer 'video=matrox:vesa:0x105' over 
'video=matrox:1024x768-8', as with matroxfb you can modify this mode with
'left', 'right', 'fv', 'fh'... options, and without these parameters it is 
unusable on fixed sync monitors (f.e. 'sync' is vital to specify 
sync-on-green feature).

If someone will create modedb, which will allow specifying all parameters
of fb_var_screeninfo, I'll remove this parsing code from matroxfb. But 
without it I think that 'vesa' will survive forever... And as I can test
only vga16fb and matroxfb, I'm not probably right one to do this.
                                            Best regards,
                                                    Petr Vandrovec
                                                    vandrove@vc.cvut.cz
                                                    
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH] matroxfb as a module (PPC)
@ 2001-01-03 16:16 Tom Rini
  2001-01-03 17:44 ` [linux-fbdev] " Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2001-01-03 16:16 UTC (permalink / raw)
  To: Petr Vandrovec; +Cc: linux-fbdev, linux-kernel

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

Hello all.  I've recently been playing with modules on my PPC system, and
noticed that matroxfb doesn't work as a module, because of mac_vmode_to_par.
But, after looking at other drivers which did work (aty and aty128) I noticed
matroxfb was doing something it didn't need to be doing.
First, the code should never get compiled, if this is a module, and even then
the code only needs to be compiled on ALL_PPC (which is Pmac/PReP/CHRP).
Second, it's only valid to call the default_{vmode,cmode} code on a PMAC 
(tested on a pmac, and ran it by one of the IBM guys who agrees it shouldn't
break anything, but he's still working on making the machine boot to start
with. :))
Third, the nvram_read_byte needs to be protected by CONFIG_NVRAM.
Finally, the VMODE_CHOOSE stuff is 0'ed out in atyfb with a comment about this
not actually working, so I removed it.

Comments?

-- 
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

[-- Attachment #2: matroxfb_base.patch --]
[-- Type: text/plain, Size: 1706 bytes --]

===== drivers/video/matrox/matroxfb_base.c 1.13 vs edited =====
--- 1.13/drivers/video/matrox/matroxfb_base.c	Fri Dec 15 14:12:43 2000
+++ edited/drivers/video/matrox/matroxfb_base.c	Sun Dec 31 10:39:11 2000
@@ -1842,33 +1842,33 @@
 	}
 
 	/* FIXME: Where to move this?! */
-#if defined(CONFIG_PPC)
+#if defined(CONFIG_ALL_PPC)
 #if defined(CONFIG_FB_COMPAT_XPMAC)
 	strcpy(ACCESS_FBINFO(matrox_name), "MTRX,");	/* OpenFirmware naming convension */
 	strncat(ACCESS_FBINFO(matrox_name), b->name, 26);
 	if (!console_fb_info)
 		console_fb_info = &ACCESS_FBINFO(fbcon);
 #endif
-	if ((xres <= 640) && (yres <= 480)) {
+#ifndef MODULE
+	if (_machine == _MACH_Pmac) {
 		struct fb_var_screeninfo var;
-		if (default_vmode == VMODE_NVRAM) {
-			default_vmode = nvram_read_byte(NV_VMODE);
-			if (default_vmode <= 0 || default_vmode > VMODE_MAX)
-				default_vmode = VMODE_CHOOSE;
-		}
 		if (default_vmode <= 0 || default_vmode > VMODE_MAX)
 			default_vmode = VMODE_640_480_60;
+#ifdef CONFIG_NVRAM
 		if (default_cmode == CMODE_NVRAM)
 			default_cmode = nvram_read_byte(NV_CMODE);
+#endif
 		if (default_cmode < CMODE_8 || default_cmode > CMODE_32)
 			default_cmode = CMODE_8;
 		if (!mac_vmode_to_var(default_vmode, default_cmode, &var)) {
 			var.accel_flags = vesafb_defined.accel_flags;
 			var.xoffset = var.yoffset = 0;
-			vesafb_defined = var; /* Note: mac_vmode_to_var() doesnot set all parameters */
+			/* Note: mac_vmode_to_var() does not set all parameters */
+			vesafb_defined = var;
 		}
 	}
-#endif /* CONFIG_PPC */
+#endif /* !MODULE */
+#endif /* CONFIG_ALL_PPC */
 	vesafb_defined.xres_virtual = vesafb_defined.xres;
 	if (nopan) {
 		vesafb_defined.yres_virtual = vesafb_defined.yres;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-01-03 22:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-03 19:25 [linux-fbdev] [PATCH] matroxfb as a module (PPC) Petr Vandrovec
2001-01-03 22:24 ` Geert Uytterhoeven
  -- strict thread matches above, loose matches on Subject: below --
2001-01-03 16:16 Tom Rini
2001-01-03 17:44 ` [linux-fbdev] " Geert Uytterhoeven
2001-01-03 17:54   ` Tom Rini
2001-01-03 22:21     ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®