vgacon, vga16fb, clgenfb on PPC

5 messages, 3 authors, 2000-01-27 · open the first message on its own page

vgacon, vga16fb, clgenfb on PPC

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2000-01-27 22:00:32

	Hi,

Finally I was able to compile a recent kernel again (2.3.41 from
bitkeeper/PPC)!

I revised my patch to make vga16fb and clgenfb compile (as modules, in my
case). I couldn't test clgenfb, but vga16fb works fine as my second head (S3
Trio64V+ initialized by em86, first head on ATI Rage II+ handled by atyfb).

Compared to my previous version from 2 months ago, I think I found the bug that
caused the endianness problems with vgacon on PReP: defining
scr_memcpyw_{from,to} to be equal to memcpy() was wrong, since in that case no
byteswapping was done when accessing video memory.

The idea behind this patch is to make scr_{write,read}w() use {write,read}w()
when {vga,mda}con is compiled in (independent of CONFIG_FB), and to use native
byte ordering when it isn't.

This patch is especially interesting for people who want to

  - have a second head handled by vga16fb
  - use clgenfb
  - have vgacon on one head and clgenfb on the second
  - ...

Can someone with a PReP box and vgacon (Cort?) please verify that it works this
time? Thx!

===== include/linux/vt_buffer.h 1.1 vs edited =====
--- include/linux/vt_buffer.h 1.1	Thu Jan 27 22:50:06 2000
+++ include/linux/vt_buffer.h Thu Jan 27 21:22:29 2000
@@ -15,7 +15,7 @@

 #include <linux/config.h>

-#ifdef CONFIG_VGA_CONSOLE
+#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE)
 #include <asm/vga.h>
 #endif
===== include/asm-ppc/vga.h 1.1 vs edited =====
--- include/asm-ppc/vga.h 1.1	Thu Jan 27 22:50:13 2000
+++ include/asm-ppc/vga.h Thu Jan 27 21:21:49 2000
@@ -8,43 +8,33 @@
 #define _LINUX_ASM_VGA_H_

 #include <asm/io.h>
-#include <asm/processor.h>

 #include <linux/config.h>
-#include <linux/console.h>
+
+#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE)

 #define VT_BUF_HAVE_RW
+/*
+ *  These are only needed for supporting VGA or MDA text mode, which use little
+ *  endian byte ordering.
+ *  In other cases, we can optimize by using native byte ordering and
+ *  <linux/vt_buffer.h> has already done the right job for us.
+ */

 extern inline void scr_writew(u16 val, u16 *addr)
 {
-	/* If using vgacon (not fbcon) byteswap the writes.
-	 * If non-vgacon assume fbcon and don't byteswap
-	 * just like include/linux/vt_buffer.h.
-	 * XXX: this is a performance loss so get rid of it
-	 *      as soon as fbcon works on prep.
-	 * -- Cort
-	 */
-#ifdef CONFIG_FB
-	if ( conswitchp != &vga_con )
-		(*(addr) = (val));
-	else
-#endif /* CONFIG_FB */
-		st_le16(addr, val);
+    writew(val, (unsigned long)addr);
 }

 extern inline u16 scr_readw(const u16 *addr)
 {
-#ifdef CONFIG_FB
-	if ( conswitchp != &vga_con )
-		return (*(addr));
-	else
-#endif /* CONFIG_FB */
-		return ld_le16((unsigned short *)addr);
+    return readw((unsigned long)addr);
 }

-#define VT_BUF_HAVE_MEMCPYF
-#define scr_memcpyw_from memcpy
-#define scr_memcpyw_to memcpy
+#define VT_BUF_HAVE_MEMCPYW
+#define scr_memcpyw	memcpy
+
+#endif /* !CONFIG_VGA_CONSOLE && !CONFIG_MDA_CONSOLE */

 extern unsigned long vgacon_remap_base;
 #define VGA_MAP_MEM(x) (x + vgacon_remap_base)
Gr{oetje,eeting}s,
--
Geert Uytterhoeven -- Linux/{m68k~Amiga,PPC~CHRP} -- 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

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: [linux-fbdev] vgacon, vga16fb, clgenfb on PPC

From: Jeff Garzik <hidden>
Date: 2000-01-27 22:17:11

On Thu, 27 Jan 2000, Geert Uytterhoeven wrote:
I revised my patch to make vga16fb and clgenfb compile (as modules, in my
case). I couldn't test clgenfb, but vga16fb works fine as my second head (S3
[...]

Thanks!

I was hoping someone would patch up clgenfb for Zorro.  When I updated
it, I tried to make initialization as obvious as possible to correct.

Please let me know if there are any success or failure reports for
clgenfb...  I would love to continue to support it on Zorro, but don't
have the hardware to do so...

	Jeff


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: [linux-fbdev] vgacon, vga16fb, clgenfb on PPC

From: Jeff Rugen <hidden>
Date: 2000-01-27 22:30:57

Can someone with a PReP box and vgacon (Cort?) please verify that it works this
time? Thx!
I've been trying to get 2.3.x from vger working on PReP, but I'll try
bitkeeper out and see if that builds better.  I assume I can find the
documentation on how to get that version from www.bitkeeper.com?  (A more
specifc pointer would be appreciated though).

Did you want clgenfb tried out as a module or build in to the kernel (or
both?)

----------------------------------------------------------------------------
Jeff Rugen                      jrugen@primenet.com

When I said "we", officer, I was referring to myself, the four young ladies,
and, of course, the goat.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: [linux-fbdev] vgacon, vga16fb, clgenfb on PPC

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2000-01-27 22:38:47

On Thu, 27 Jan 2000, Jeff Garzik wrote:
On Thu, 27 Jan 2000, Geert Uytterhoeven wrote:
quoted
I revised my patch to make vga16fb and clgenfb compile (as modules, in my
case). I couldn't test clgenfb, but vga16fb works fine as my second head (S3
[...]

I was hoping someone would patch up clgenfb for Zorro.  When I updated
it, I tried to make initialization as obvious as possible to correct.

Please let me know if there are any success or failure reports for
clgenfb...  I would love to continue to support it on Zorro, but don't
have the hardware to do so...
Zorro patches are something different. I posted them to the linux-m68k list a
few days ago.

Gr{oetje,eeting}s,
--
Geert Uytterhoeven -- Linux/{m68k~Amiga,PPC~CHRP} -- 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


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: [linux-fbdev] vgacon, vga16fb, clgenfb on PPC

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2000-01-27 22:39:38

On Thu, 27 Jan 2000, Jeff Rugen wrote:
quoted
Can someone with a PReP box and vgacon (Cort?) please verify that it works this
time? Thx!
I've been trying to get 2.3.x from vger working on PReP, but I'll try
bitkeeper out and see if that builds better.  I assume I can find the
documentation on how to get that version from www.bitkeeper.com?  (A more
specifc pointer would be appreciated though).
Unfortunately not. Bitkeeper isn't released yet, and the tree isn't publicly
accessible yet.
Did you want clgenfb tried out as a module or build in to the kernel (or
both?)
Both, of course :-) And preferably with vgacon as well.

Gr{oetje,eeting}s,
--
Geert Uytterhoeven -- Linux/{m68k~Amiga,PPC~CHRP} -- 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


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help