summaryrefslogtreecommitdiffstats
path: root/drivers/sgi/char/sgicons.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@nuclecu.unam.mx>1997-07-02 06:20:17 +0000
committerMiguel de Icaza <miguel@nuclecu.unam.mx>1997-07-02 06:20:17 +0000
commitaa2e5b3c38f27ee5efda70e68be0ccff9c334f9b (patch)
treea3c777358e97c0ca4013c96c2a1e858a35995a0d /drivers/sgi/char/sgicons.c
parentaf525316597ba42f324222ea8254ceb2f0c12681 (diff)
Preparing for supporting graphic drivers on Linux.
1. Make the code multiple-device aware (even if I can't test it, it is better to have it designed like this since now). 2. Added the beginning of the /dev/{graphics,opengl}, /dev/gfx drivers. 3. Renamed newport.c to cons_newport.c. This is just the console rendering code. Will put the more complex virtualizing, context switching code for the newport on newport.c 4. streamable.c is supposed to have all of the stream devices that we need for IRIX emulation (not much there just now): shmiq, gfx and keyboard and mouse plugins. More tomorrow, now it is time to sleep :-)
Diffstat (limited to 'drivers/sgi/char/sgicons.c')
-rw-r--r--drivers/sgi/char/sgicons.c125
1 files changed, 118 insertions, 7 deletions
diff --git a/drivers/sgi/char/sgicons.c b/drivers/sgi/char/sgicons.c
index 097ed1359..7f8882cda 100644
--- a/drivers/sgi/char/sgicons.c
+++ b/drivers/sgi/char/sgicons.c
@@ -2,29 +2,140 @@
* sgicons.c: Setting up and registering console I/O on the SGI.
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
+ * Copyright (C) 1997 Miguel de Icaza (miguel@nuclecu.unam.mx)
+ *
+ * This implement a virtual console interface.
+ *
+ * This should be replaced with Gert's all-singing all-dancing
+ * graphics console code in the future
+ *
*/
#include <linux/init.h>
#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <asm/uaccess.h>
+#include "gconsole.h"
+
+/* This is the system graphics console (the first adapter found) */
+struct console_ops gconsole;
+
+void
+__set_origin (unsigned short offset)
+{
+ (*gconsole.set_origin)(offset);
+}
+
+void
+hide_cursor (void)
+{
+ (*gconsole.hide_cursor)();
+}
+
+void
+set_cursor (int currcons)
+{
+ (*gconsole.set_cursor)(currcons);
+}
+
+void
+get_scrmem (int currcons)
+{
+ (*gconsole.get_scrmem)(currcons);
+}
+
+void
+set_scrmem (int currcons, long offset)
+{
+ (*gconsole.set_scrmem)(currcons, offset);
+}
+
+int
+set_get_cmap (unsigned char *arg, int set)
+{
+ return (*gconsole.set_get_cmap)(arg, set);
+}
+
+void
+blitc (unsigned short charattr, unsigned long addr)
+{
+ (*gconsole.blitc)(charattr, addr);
+}
+
+void
+memsetw (void *s, unsigned short c, unsigned int count)
+{
+ (*gconsole.memsetw)(s, c, count);
+}
+
+void
+memcpyw (unsigned short *to, unsigned short *from, unsigned int count)
+{
+ (*gconsole.memcpyw)(to, from, count);
+}
+
+int
+con_adjust_height (unsigned long fontheight)
+{
+ return -EINVAL;
+}
+
+int
+set_get_font (char *arg, int set, int ch512)
+{
+ int error, i, line;
+
+ if (!arg)
+ return -EINVAL;
+ error = verify_area (set ? VERIFY_READ : VERIFY_WRITE, (void *) arg,
+ ch512 ? 2* cmapsz : cmapsz);
+ if (error)
+ return error;
+
+ /* download the current font */
+ if (!set) {
+ memset (arg, 0, cmapsz);
+ for (i = 0; i < 256; i++) {
+ for (line = 0; line < CHAR_HEIGHT; line++)
+ __put_user (vga_font [i], arg+(i*32+line));
+ }
+ return 0;
+ }
+
+ /* set the font */
+ for (i = 0; i < 256; i++) {
+ for (line = 0; line < CHAR_HEIGHT; line++) {
+ __get_user(vga_font [i*CHAR_HEIGHT + line],
+ arg + (i * 32 + line));
+ }
+ }
+ return 0;
+}
+
+/*
+ * dummy routines for the VESA blanking code, which is VGA only,
+ * so we don't have to carry that stuff around for the Sparc... */
+void vesa_blank(void) { }
+void vesa_unblank(void) { }
+void set_vesa_blanking(const unsigned long arg) { }
+void vesa_powerdown(void) { }
+void set_palette (void) { }
-extern void newport_init(void);
extern unsigned long video_mem_base, video_screen_size, video_mem_term;
__initfunc(unsigned long con_type_init(unsigned long start_mem, const char **name))
{
extern int serial_console;
- *name = "NEWPORT";
-
- if(!serial_console) {
+ if (serial_console)
+ *name = "NONE";
+ else {
+ gfx_init (name);
printk("Video screen size is %08lx at %08lx\n",
video_screen_size, start_mem);
video_mem_base = start_mem;
start_mem += (video_screen_size * 2);
video_mem_term = start_mem;
-
- newport_init();
}
-
return start_mem;
}