From fee03799b95240471d9007e4ccd2d6aad73c6450 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Wed, 16 Jul 1997 02:50:37 +0000 Subject: o Implement /dev/graphics virtualizable access to registers. The actual context switch code is not yet there. But the rest of the magic (mapping/unmapping the registers on demand is already in). o Interface for allowing binary-only console modules added. o My RRM bits, nothing really interesting now. For now, I am assuming in the code that there will be a minor per real graphics device, and that the X server will go and open /dev/graphicsN instead of opening /dev/graphics and using the gfx_attach_board->board variable. The interface the X server uses is not clear. I believe it will be pretty easy to provide the stripped down shmiq interface. Not only that, but we can even provide the same ABI (yes, ABI) for SGI shmiq input modules (yep, looks pretty easy once you have an strace that shows this information). Now, the only thing missing is figuring what is wrong my current conception of the use of shmiq. I just can't get it. --- drivers/sgi/char/sgicons.c | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) (limited to 'drivers/sgi/char/sgicons.c') diff --git a/drivers/sgi/char/sgicons.c b/drivers/sgi/char/sgicons.c index 7f8882cda..daf1b8fce 100644 --- a/drivers/sgi/char/sgicons.c +++ b/drivers/sgi/char/sgicons.c @@ -17,60 +17,79 @@ #include "gconsole.h" /* This is the system graphics console (the first adapter found) */ -struct console_ops gconsole; +struct console_ops *gconsole = 0; + +void +register_gconsole (struct console_ops *gc) +{ + if (gconsole) + return; + gconsole = gc; +} void __set_origin (unsigned short offset) { - (*gconsole.set_origin)(offset); + if (gconsole) + (*gconsole->set_origin)(offset); } void hide_cursor (void) { - (*gconsole.hide_cursor)(); + + if (gconsole) + (*gconsole->hide_cursor)(); } void set_cursor (int currcons) { - (*gconsole.set_cursor)(currcons); + if (gconsole) + (*gconsole->set_cursor)(currcons); } void get_scrmem (int currcons) { - (*gconsole.get_scrmem)(currcons); + if (gconsole) + (*gconsole->get_scrmem)(currcons); } void set_scrmem (int currcons, long offset) { - (*gconsole.set_scrmem)(currcons, offset); + if (gconsole) + (*gconsole->set_scrmem)(currcons, offset); } int set_get_cmap (unsigned char *arg, int set) { - return (*gconsole.set_get_cmap)(arg, set); + if (gconsole) + return (*gconsole->set_get_cmap)(arg, set); + return 0; } void blitc (unsigned short charattr, unsigned long addr) { - (*gconsole.blitc)(charattr, addr); + if (gconsole) + (*gconsole->blitc)(charattr, addr); } void memsetw (void *s, unsigned short c, unsigned int count) { - (*gconsole.memsetw)(s, c, count); + if (gconsole) + (*gconsole->memsetw)(s, c, count); } void memcpyw (unsigned short *to, unsigned short *from, unsigned int count) { - (*gconsole.memcpyw)(to, from, count); + if (gconsole) + (*gconsole->memcpyw)(to, from, count); } int -- cgit v1.2.3