Release 6 Public Patch #09 X Consortium This patch comes in two parts: this file and the file "XHPKeymaps.uu". To apply this patch: cd to the top of the source tree (to the directory containing the "xc" and "contrib" subdirectories) and do: patch -p -s < ThisFile Patch will work silently unless an error occurs. If you want to watch patch do its thing, leave out the "-s" argument to patch. Next, from the same top-level directory do: rm -f xc/programs/Xserver/hw/hp/README rm -f xc/programs/Xserver/hw/hp/input/beeper.c rm -f xc/programs/Xserver/hw/hp/input/drivers/x_serialdrv.h rm -f xc/programs/Xserver/hw/hp/input/x_threebut.c Next, from the same top-level directory do: uudecode < XHPKeymaps.uu uncompress xc/programs/Xserver/hw/hp/input/drivers/XHPKeymaps This patch creates the following new files: xc/programs/Xserver/hw/hp/Xhp.man xc/programs/Xserver/hw/hp/ngle/hyperScrn.c xc/programs/Xserver/hw/hp/input/drivers/X0screens xc/programs/Xserver/hw/hp/input/drivers/hil_driver.c xc/programs/Xserver/hw/hp/input/drivers/XHPKeymaps If you are using a symbolic link tree, you will need to create new links. If you do not build the Xhp server, no rebuild is necessary. Otherwise, cd to the "xc" subdirectory and do: make Everything >& every.log This patch provides updated X server support for HP display hardware. Only the HP device-dependent code is changed. Prereq: public-patch-8 *** - Wed Jan 25 18:23:15 1995 --- xc/bug-report Wed Jan 25 18:23:14 1995 *************** *** 3,9 **** VERSION: ! R6, public-patch-8 [X Consortium public patches edit this line to indicate the patch level] CLIENT MACHINE and OPERATING SYSTEM: --- 3,9 ---- VERSION: ! R6, public-patch-9 [X Consortium public patches edit this line to indicate the patch level] CLIENT MACHINE and OPERATING SYSTEM: *** - Wed Jan 25 18:47:47 1995 --- xc/programs/Xserver/hw/hp/Imakefile Wed Jan 25 18:47:46 1995 *************** *** 1,4 **** ! XCOMM $XConsortium: Imakefile,v 3.7 94/05/28 15:39:04 dpw Exp $ #include #define IHaveSubdirs --- 1,4 ---- ! XCOMM $XConsortium: Imakefile,v 3.8 95/01/24 01:39:46 dpw Exp $ #include #define IHaveSubdirs *************** *** 41,44 **** --- 41,45 ---- NormalRelocatableTarget(hp,$(OBJS)) SpecialCObjectRule(hpInit,$(ICONFIGFILES),$(LIB_DEFINES)) DependTarget() + InstallManPage(Xhp,$(MANDIR)) *** /dev/null Wed Jan 25 18:47:48 1995 --- xc/programs/Xserver/hw/hp/Xhp.man Wed Jan 25 18:47:48 1995 *************** *** 0 **** --- 1,141 ---- + .\" $XConsortium: Xhp.man,v 1.2 95/01/24 19:51:14 gildea Exp $ + .\" Copyright (c) 1994 Hewlett-Packard Company + .\" Copyright (c) 1994 X Consortium + .\" + .\" Permission is hereby granted, free of charge, to any person obtaining a + .\" copy of this software and associated documentation files (the "Software"), + .\" to deal in the Software without restriction, including without limitation + .\" the rights to use, copy, modify, merge, publish, distribute, sublicense, + .\" and/or sell copies of the Software, and to permit persons to whom the + .\" Software furnished to do so, subject to the following conditions: + .\" + .\" The above copyright notice and this permission notice shall be included in + .\" all copies or substantial portions of the Software. + .\" + .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + .\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + .\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + .\" THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + .\" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + .\" OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + .\" SOFTWARE. + .\" + .\" Except as contained in this notice, the name of the X Consortium shall not + .\" be used in advertising or otherwise to promote the sale, use or other + .\" dealing in this Software without prior written authorization from the + .\" X Consortium. + .\" + .\" HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS SOFWARE, + .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + .\" AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard shall not be liable + .\" for errors contained herein or direct, indirect, special, incidental or + .\" consequential damages in connection with the furnishing, performance, or + .\" use of this material. + .TH Xhp 1 "Release 6" "X Version 11" + .SH NAME + Xhp \- cfb-based X window system server for Hewlett-Packard workstations + .SH SYNOPSIS + .PP + This cfb-based X server implementation is contributed by Hewlett-Packard + as a sample implementation for HP workstations. Its performance on HP + workstations will be inferior to the product X servers available from + Hewlett-Packard. Not all graphics display devices available from + Hewlett-Packard are supported by this implementation. + .PP + .SH "SUPPORTED GRAPHICS DEVICES" + .PP + Please refer to the HP catalog or to the apropriate data sheets + for the displays. The data that follows relates the use of the + product names with their official HP product numbers. + .PP + The following graphics display devices are supported by this implementation: + .sp + .TP + .I HPA4070A + This graphics device, known as "HCRX", is a 1280x1024 color device that has + 8 planes. + .TP + .I HPA4071A + This graphics device, known as "HCRX24", is a 1280x1024 color device that has + 24 planes. It is optionally available with a hardware accelerator, in which + case the product number is HPA4071A_Z. + .TP + .I HPA1659A + This graphics device, known as "CRX", is a 1280x1024 color device that has + 8 planes. + .TP + .I HPA1439A + This graphics device, known as "CRX24", is a 1280x1024 color device that has + 24 planes. It is optionally available with a hardware accelerator. + .TP + .I HPA1924A + This graphics device, known as "GRX" is a 1280x1024 grayscale device that has + 8 planes. + .TP + .I HPA2269A + This graphics device, known as "Dual CRX" is a 1280x1024 color device that has + 8 planes. It implements support for two displays on a single graphics card. + .TP + .I HP710C + This graphics device is the internal graphics support optionally available on + the HP9000s710 SPU. It supports 1280x1024 color displays and has 8 planes. + .TP + .I HP710G + This graphics device is the internal graphics support optionally available on + the HP9000s710 SPU. It supports 1280x1024 grayscale displays and has 8 planes. + .TP + .I HP710L + This graphics device is the internal graphics support optionally available on + the HP9000s710 SPU. It supports 1024x768 color displays and has 8 planes. + .TP + .I HP712 + This graphics device is the internal graphics support available on + the HP9000s712 SPU. It supports 640x480, 1024x768 or 1280x1024 color displays + and has 8 planes. + .PP + .SH "MULTIPLE SCREEN SUPPORT" + .PP + This Xhp X11 sample server supports multiple physical screens connected to a + single X server. To use this feature, you must have an SPU that allows + the installation of a second graphics display card. The file + $(LIBDIR)/X*screens is read by the X11 server + to determine information about the system screen configuration. + You must modify this file to add information for the second graphics display. + .sp + $(LIBDIR) is /usr/X11R6/lib/X11 by default. + .sp + For a complete description of the X*screens file, refer to the HP-UX manuals, + or view the sample file in $(LIBDIR). + .SH "24 PLANE SUPPORT FOR HCRX24 AND CRX24" + .PP + This Xhp X11 sample server supports two modes for the HCRX24 and CRX24 display + hardware: 8 plane and 24 plane, with 8 plane being the default. + To run the server in 24 plane mode, you must add a depth parameter to + the X*screens file. For example: + .sp + /dev/crt depth 24 + .sp + .PP + In depth 24 mode, the default visual type is DirectColor. + .PP + .SH "KEYMAP FILE" + .PP + This Xhp server loads a keymap that is appropriate for the attached keyboard + from the XHPKeymaps file, which resides in $(LIBDIR). The XHPKeymaps file + supplied with this Xhp server is a minimal file that supports US English, + French, Spanish, German, and Japanese JIS keyboards. If you have some other + keyboard, the appropriate keymap may not be contained in the XHPKeymaps file. + In this case, if you have access to the Hewlett-Packard product X server, you + can copy its keymap file (found in /usr/lib/X11/XHPKeymaps) to $(LIBDIR). + .SH "FAST SCROLLING OPTION" + .PP + Since scrolling speed is especially slow on this server compared + to HP's product server, we have supplied fast scrolling support, + using a .o to link into the server. Using HP's fast scrolling + is optional. To enable the fast scrolling, set the token + "HPFastScrolling" to TRUE in the config/hp.cf file. If you want + to use the CFB scrolling module, simply remove the define in + config/hp.cf, remake the Makefiles, and recompile. + .SH TRADEMARKS + .PP + X Window System is a trademark of X Consortium, Inc. *** - Wed Jan 25 18:47:49 1995 --- xc/programs/Xserver/hw/hp/hpInit.c Wed Jan 25 18:47:49 1995 *************** *** 1,4 **** ! /* $XConsortium: hpInit.c,v 1.4 94/05/28 15:39:14 dpw Exp $ */ /************************************************************************* * * (c)Copyright 1992 Hewlett-Packard Co., All Rights Reserved. --- 1,4 ---- ! /* $XConsortium: hpInit.c,v 1.5 95/01/24 01:43:05 dpw Exp $ */ /************************************************************************* * * (c)Copyright 1992 Hewlett-Packard Co., All Rights Reserved. *************** *** 227,235 **** do { ! if (-1 == AddScreen( ! ddxScreenInitPointer[pScreenInfo->numScreens], argc,argv)) ! FatalError("Could not add screen.\n"); } while ( pScreenInfo->numScreens != hpNumScreens ); --- 227,235 ---- do { ! if (-1 == AddScreen(ddxScreenInitPointer[pScreenInfo->numScreens], ! argc,argv)) ! FatalError("Could not add screen.\n"); } while ( pScreenInfo->numScreens != hpNumScreens ); *** - Wed Jan 25 18:47:51 1995 --- xc/programs/Xserver/hw/hp/ddx_info.c Wed Jan 25 18:47:50 1995 *************** *** 1,4 **** ! /* $XConsortium: ddx_info.c,v 1.2 94/05/28 15:39:13 dpw Exp $ */ /************************************************************************* * --- 1,4 ---- ! /* $XConsortium: ddx_info.c,v 1.3 95/01/24 01:43:05 dpw Exp $ */ /************************************************************************* * *************** *** 61,69 **** # ifndef S9000_ID_TOMCAT /* 2-headed ELK; sorry, no P/N yet */ # define S9000_ID_TOMCAT 0x27FCCB6D # endif ! # ifndef S9000_ID_ARTIST /* Artist 712 mother board graphics */ # define S9000_ID_ARTIST 0x2B4DED6D # endif #endif /* Declare the external initialization functions */ --- 61,72 ---- # ifndef S9000_ID_TOMCAT /* 2-headed ELK; sorry, no P/N yet */ # define S9000_ID_TOMCAT 0x27FCCB6D # endif ! # ifndef S9000_ID_ARTIST /* Artist 712/715 mother board graphics */ # define S9000_ID_ARTIST 0x2B4DED6D # endif + # ifndef S9000_ID_HCRX /* Hyperdrive A4071A */ + # define S9000_ID_HCRX 0x2BCB015A + # endif #endif /* Declare the external initialization functions */ *************** *** 136,141 **** --- 139,145 ---- case S9000_ID_TIMBER: /* Bushmaster (710) Graphics */ case S9000_ID_A1439A: /* CRX24 (24-plane Color) */ case S9000_ID_ARTIST: /* 712 (8-plane Color) Graphics */ + case S9000_ID_HCRX: /* Hyperdrive (8 or 24 plane) */ return_value = ngleScreenInit; break; *** - Wed Jan 25 18:47:52 1995 --- xc/programs/Xserver/hw/hp/hpCursorUtils.c Wed Jan 25 18:47:52 1995 *************** *** 1,4 **** ! /* $XConsortium: hpCursorUtils.c,v 1.2 94/04/17 20:30:05 rws Exp $ */ /************************************************************************* * * (c)Copyright 1992 Hewlett-Packard Co., All Rights Reserved. --- 1,4 ---- ! /* $XConsortium: hpCursorUtils.c,v 1.3 95/01/24 01:43:05 dpw Exp $ */ /************************************************************************* * * (c)Copyright 1992 Hewlett-Packard Co., All Rights Reserved. *************** *** 81,87 **** extern int hpActiveScreen; /* Stacked mode, >1 head */ extern WindowPtr *WindowTable; /* Defined by DIX */ - static BoxRec LimitTheCursor; static CursorPtr currentCursors[MAXSCREENS]; void hpBlottoCursors() --- 81,86 ---- *************** *** 91,139 **** } /************************************************************ - * hpConstrainCursor - * - * This function simply sets the box to which the cursor - * is limited. - * - * ASSUMPTION: a single BoxRec is used for recording - * the cursor limits, instead of one per screen. This is - * done, in part, because the bogus hpConstrainXY routine - * (see below) is not passed a pScreen pointer. - * - * THEREFORE: Zaphod mode code will have to call this routine - * to establish new limits when the cursor leaves one screen - * for another. - * - ************************************************************/ - - void - hpConstrainCursor (pScreen,pBox) - ScreenPtr pScreen; /* Screen to which it should be constrained */ - BoxPtr pBox; /* Box in which... */ - { - LimitTheCursor = *pBox; - } - - /************************************************************ - * hpConstrainXY - * - * This function is called directly from x_hil.c - * It adjusts the cursor position to fit within the current - * constraints. - * - ************************************************************/ - - Bool - hpConstrainXY(px,py) - int *px, *py; - { - *px = max( LimitTheCursor.x1, min( LimitTheCursor.x2,*px)); - *py = max( LimitTheCursor.y1, min( LimitTheCursor.y2,*py)); - return TRUE; - } - - /************************************************************ * hpCursorLimits * Return a box within which the given cursor may move on the given * screen. We assume that the HotBox is actually on the given screen, --- 90,95 ---- *************** *** 156,162 **** --- 112,122 ---- } /************************************************************ + * * hpSetCursorPosition + * + * This routine is called from DIX when the X11 sprite/cursor is warped. + * ************************************************************/ Bool *************** *** 171,208 **** php = (hpPrivPtr) pScreen->devPrivate; ! /* Check to see if we've switched screens: */ InDev = GET_HPINPUTDEVICE((DeviceIntPtr)LookupPointerDevice()); - if (pScreen != InDev->pScreen) - { - WindowPtr pRootWindow = WindowTable[InDev->pScreen->myNum]; - - /* - ******************************************************************** - ** Turn old cursor off, blank/unblank screens for stacked mode, - ** let DIX know there is a new screen, set the input driver variable - ** to the new screen number. - ******************************************************************** - */ - - (*((hpPrivPtr)(InDev->pScreen->devPrivate))->CursorOff) - (InDev->pScreen); /* Old cursor off */ - php->ChangeScreen(pScreen); /* Stacked mode switch */ - NewCurrentScreen(pScreen, xhot, yhot);/* Let DIX know */ - hpActiveScreen = pScreen->myNum; /* Input driver global */ - } - - - /* Must Update the Corvallis Input Driver's Variables: */ InDev->pScreen = pScreen; InDev->coords[0] = xhot; InDev->coords[1] = yhot; ! if (!generateEvent) ! { ! (*php->MoveMouse)(pScreen, xhot, yhot, 0); /* Do the move now */ ! } ! else { queue_motion_event(InDev); /* Enqueue motion event, in x_hil.c */ isItTimeToYield++; /* Insures client get the event! */ --- 131,146 ---- php = (hpPrivPtr) pScreen->devPrivate; ! /* Must Update the Input Driver's Variables: */ InDev = GET_HPINPUTDEVICE((DeviceIntPtr)LookupPointerDevice()); InDev->pScreen = pScreen; InDev->coords[0] = xhot; InDev->coords[1] = yhot; ! /* Do the move now */ ! (*php->MoveMouse)(pScreen, xhot, yhot, 0); ! ! if (generateEvent) { queue_motion_event(InDev); /* Enqueue motion event, in x_hil.c */ isItTimeToYield++; /* Insures client get the event! */ *************** *** 210,213 **** return(TRUE); ! } --- 148,151 ---- return(TRUE); ! } /* hpSetCursorPosition() */ *** - Wed Jan 25 18:47:53 1995 --- xc/programs/Xserver/hw/hp/include/XHPproto.h Wed Jan 25 18:47:53 1995 *************** *** 1,10 **** ! /* $XConsortium: XHPproto.h,v 1.1 93/08/08 12:56:03 rws Exp $ */ ! #ifndef XHPPROTO_H ! #define XHPPROTO_H ! /* ! ! Copyright (c) 1986, 1987 by Hewlett-Packard Company ! Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright --- 1,8 ---- ! /* $XConsortium: XHPproto.h,v 1.2 95/01/24 01:46:26 dpw Exp $ */ ! /************************************************************************* ! * ! * (c)Copyright 1992 Hewlett-Packard Co., All Rights Reserved. ! * Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright *************** *** 14,32 **** advertising or publicity pertaining to distribution of the software without specific, written prior permission. ! HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard shall not be liable for errors contained herein or direct, indirect, special, incidental or consequential damages in connection with the furnishing, performance, or use of this material. - This software is not subject to any license of the American - Telephone and Telegraph Company or of the Regents of the - University of California. - - */ /* Definitions for HP extensions used by the server and C bindings*/ #ifndef XMD_H --- 12,29 ---- advertising or publicity pertaining to distribution of the software without specific, written prior permission. ! HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard shall not be liable for errors contained herein or direct, indirect, special, incidental or consequential damages in connection with the furnishing, performance, or use of this material. + + *************************************************************************/ + #ifndef XHPPROTO_H + #define XHPPROTO_H /* Definitions for HP extensions used by the server and C bindings*/ #ifndef XMD_H *************** *** 188,197 **** #define REL_807_SERVER 5 /* HP-UX 8.07 (IF2) */ #define REL_90_SERVER 6 /* HP-UX 9.0 R5 */ #define REL_903_SERVER 7 /* HP-UX 9.03 R5 */ #define VR_MIT_RELEASE 5 ! #define VR_HP_RELEASE REL_903_SERVER #define VR_HP_PATCH_LEVEL 0 #define HP_VRN(mit_release, hp_release, hp_patch_level) \ --- 185,200 ---- #define REL_807_SERVER 5 /* HP-UX 8.07 (IF2) */ #define REL_90_SERVER 6 /* HP-UX 9.0 R5 */ #define REL_903_SERVER 7 /* HP-UX 9.03 R5 */ + #define REL_905_SERVER 8 /* HP-UX 9.05 R5 */ + #define REL_100_SERVER 9 /* HP-UX 10.0 R5 */ #define VR_MIT_RELEASE 5 ! #ifdef hpV4 ! #define VR_HP_RELEASE REL_100_SERVER ! #else ! #define VR_HP_RELEASE REL_905_SERVER ! #endif /* hpV4 */ #define VR_HP_PATCH_LEVEL 0 #define HP_VRN(mit_release, hp_release, hp_patch_level) \ *** - Wed Jan 25 18:47:55 1995 --- xc/programs/Xserver/hw/hp/ngle/Imakefile Wed Jan 25 18:47:55 1995 *************** *** 1,15 **** ! /* $XConsortium: Imakefile,v 1.4 93/09/06 15:25:28 rws Exp $ */ #include ORIG_SRCS = nglescreen.c \ nglecolormap.c \ nglecursor.c \ ! nglenoop.c ORIG_OBJS = nglescreen.o \ nglecolormap.o \ nglecursor.o \ ! nglenoop.o #ifdef HPFastScrolling SCROLLING_SRC = nglecopy.c \ --- 1,17 ---- ! /* $XConsortium: Imakefile,v 1.6 95/01/25 23:37:39 gildea Exp $ */ #include ORIG_SRCS = nglescreen.c \ nglecolormap.c \ nglecursor.c \ ! nglenoop.c \ ! hyperScrn.c ORIG_OBJS = nglescreen.o \ nglecolormap.o \ nglecursor.o \ ! nglenoop.o \ ! hyperScrn.o #ifdef HPFastScrolling SCROLLING_SRC = nglecopy.c \ *** - Wed Jan 25 18:47:56 1995 --- xc/programs/Xserver/hw/hp/ngle/dregs.h Wed Jan 25 18:47:56 1995 *************** *** 1,4 **** ! /* $XConsortium: dregs.h,v 1.2 94/05/28 15:45:25 dpw Exp $ */ /************************************************************************* * * (c)Copyright 1992 Hewlett-Packard Co., All Rights Reserved. --- 1,4 ---- ! /* $XConsortium: dregs.h,v 1.3 95/01/24 01:54:12 dpw Exp $ */ /************************************************************************* * * (c)Copyright 1992 Hewlett-Packard Co., All Rights Reserved. *************** *** 46,100 **** } b; } dreg_cplx_t; ! ! typedef volatile struct { long int pad1[70]; ! unsigned long int reg1; ! long int pad2[217]; ! unsigned long int reg2; long int pad3[7]; ! unsigned long int reg3; long int pad4[63]; ! unsigned long int reg22; long int pad5[7]; ! unsigned long int reg23; long int pad6[15]; ! unsigned long int reg4; long int pad7[39]; ! unsigned long int reg5; long int pad8[87]; ! dreg_cplx_t reg6; ! dreg_cplx_t reg7; ! dreg_cplx_t reg24; long int pad9[5]; ! unsigned long int reg8; ! long int pad10[120]; ! dreg_cplx_t reg9; long int pad10a[62]; ! dreg_cplx_t reg25; long int pad11[23871]; ! unsigned long int reg10; ! unsigned long int reg11; long int pad12[1]; ! unsigned long int reg12; ! long int pad13[2]; ! unsigned long int reg13; ! dreg_cplx_t reg14; long int pad15[499704]; ! dreg_cplx_t reg15; ! dreg_cplx_t reg16; ! long int pad17[62]; ! dreg_cplx_t reg17; ! dreg_cplx_t reg18; long int pad18[4]; ! unsigned long int reg26; long int pad19[57]; ! dreg_cplx_t reg19; long int pad20[1]; ! dreg_cplx_t reg20; long int pad21[3]; ! dreg_cplx_t reg21; long int pad22[59]; ! dreg_cplx_t reg27; } ngle_dregs_t; --- 46,123 ---- } b; } dreg_cplx_t; ! typedef volatile struct { long int pad1[70]; ! unsigned long int reg1; ! long int pad2[193]; ! unsigned long int reg28; ! long int pad24[23]; ! unsigned long int reg2; long int pad3[7]; ! unsigned long int reg3; long int pad4[63]; ! unsigned long int reg22; long int pad5[7]; ! unsigned long int reg23; long int pad6[15]; ! unsigned long int reg4; long int pad7[39]; ! unsigned long int reg5; long int pad8[87]; ! dreg_cplx_t reg6; ! dreg_cplx_t reg7; ! dreg_cplx_t reg24; long int pad9[5]; ! unsigned long int reg8; ! long int pad10[72]; ! dreg_cplx_t reg37; ! long int pad13[47]; ! dreg_cplx_t reg9; long int pad10a[62]; ! dreg_cplx_t reg25; long int pad11[23871]; ! unsigned long int reg10; ! unsigned long int reg11; long int pad12[1]; ! unsigned long int reg12; ! unsigned long int reg35; ! unsigned long int reg36; ! unsigned long int reg13; ! dreg_cplx_t reg14; long int pad15[499704]; ! dreg_cplx_t reg15; ! dreg_cplx_t reg16; ! dreg_cplx_t reg34; ! long int pad17[61]; ! dreg_cplx_t reg17; ! dreg_cplx_t reg18; long int pad18[4]; ! unsigned long int reg26; long int pad19[57]; ! dreg_cplx_t reg19; long int pad20[1]; ! dreg_cplx_t reg20; long int pad21[3]; ! dreg_cplx_t reg21; long int pad22[59]; ! dreg_cplx_t reg27; ! long int pad23[16189]; ! dreg_cplx_t reg29; ! unsigned long int reg30; ! unsigned long int reg31; ! long int pad25[5]; ! unsigned long int reg38; ! unsigned long int reg41; ! unsigned long int reg42; ! unsigned long int reg43; ! unsigned long int reg44; ! unsigned long int reg45; ! long int pad26[1]; ! unsigned long int reg32; ! unsigned long int reg33; ! long int pad27[55]; ! unsigned long int reg39; ! long int pad28[3]; ! unsigned long int reg40; } ngle_dregs_t; *** /dev/null Wed Jan 25 18:47:57 1995 --- xc/programs/Xserver/hw/hp/ngle/hyperScrn.c Wed Jan 25 18:47:57 1995 *************** *** 0 **** --- 1,266 ---- + /* $XConsortium: hyperScrn.c,v 1.1 95/01/25 16:14:36 gildea Exp $ */ + /************************************************************************* + * + * (c)Copyright 1992 Hewlett-Packard Co., All Rights Reserved. + * + Permission to use, copy, modify, and distribute this + software and its documentation for any purpose and without + fee is hereby granted, provided that the above copyright + notice appear in all copies and that both that copyright + notice and this permission notice appear in supporting + documentation, and that the name of Hewlett Packard not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD + TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. Hewlett-Packard shall not be liable for errors + contained herein or direct, indirect, special, incidental or + consequential damages in connection with the furnishing, + performance, or use of this material. + + * + *************************************************************************/ + + /****************************************************************************** + * + * This file contains various global variables and routines concerning + * the Screen structure. This includes the ngleScreenInit routine. + * + ******************************************************************************/ + + + #include "ngle.h" + + Bool hyperResetPlanes( + NgleScreenPrivPtr pScreenPriv, + Card32 serverState); + + static void hyperUndoITE( + NgleScreenPrivPtr pScreenPriv); + + + /****************************************************************************** + * + * NGLE DDX Utility Procedure: hyperResetPlanes + * + * Description: + * + * This routine implements pNgleScreenInit->InitPlanes and + * pScreenPriv->ngleResetPlanes. It resets the image, overlay + * and attribute planes to a known state. This includes doing + * what is necessary to counteract what the ITE has done as well + * as supporting friendly boot operation. + * + * Assumptions: + * + * - default colormap has already been initialized and installed + * - fast-locking has been initialized. + * + * Does not assume a lock is in effect. + * + ******************************************************************************/ + + Bool hyperResetPlanes( + NgleScreenPrivPtr pScreenPriv, + Card32 serverState) + { + NgleHdwPtr pDregs = (NgleHdwPtr) pScreenPriv->pDregs; + Card32 controlPlaneReg; + Card32 planeEnableMask; + + + NGLE_LOCK(pScreenPriv); + + if (IS_24_DEVICE(pScreenPriv)) + if (pScreenPriv->devDepth == 24) + controlPlaneReg = 0x04000F00; + else + controlPlaneReg = 0x00000F00; /* 0x00000800 should be enought, but lets clear all 4 bits */ + else + controlPlaneReg = 0x00000F00; /* 0x00000100 should be enought, but lets clear all 4 bits */ + + switch(serverState) + { + case SERVER_INIT: + /************************************************** + ** Need to clear screen + **************************************************/ + if (IS_24_DEVICE(pScreenPriv)) + ngleDepth24_ClearImagePlanes(pScreenPriv); + else + ngleDepth8_ClearImagePlanes(pScreenPriv); + + /* Paint attribute planes for default case. + * On Hyperdrive, this means all windows using overlay cmap 0. + */ + ngleResetAttrPlanes(pScreenPriv, controlPlaneReg); + + /* Clear overlay planes: + * + * If on Hyperdrive and doing Friendly Boot, we want a smooth + * transition when VUE starts up. There are 3 cases to worry + * about: 1) If only the friendly boot slate is visible on the + * screen and ITE console messages are not, then we need to clear + * the text planes so that the ITE messages don't flash on screen. + * This will create a smooth transition when the vuelogin window + * appears. 2) If only ITE console messages are visible and the + * friendly boot slate is not, then we need to clear the planes + * containing the slate. 3) If both the friendly boot slate and + * ITE console messages are visible, then we don't need to bother + * clearing any of the overlay planes. + * + * Side note: The above is correct if the default visual is in + * the overlays. If the default visual is in the image planes, + * then clear all of the overlay planes to prevent color flashing + * of slate which will happen when smooth cmap is installed in + * overlays. + * + * STI uses the upper 5 overlay planes for the friendly boot slate + * and the lower 3 overlay planes for ITE console messages. These + * planes are enabled/disabled via the FDR register on Marathon. + */ + + if ( pScreenPriv->myNum == 0 && pScreenPriv->devDepth == 8 ) + { /* isDefaultVisualInOverlays == TRUE */ + SETUP_HW(pDregs); /* Wait for hw to be ready */ + planeEnableMask = NGLE_READ32(pDregs->reg32); + + if ((planeEnableMask & 0xffff0000) == 0xf8f80000) + { + /* only slate is visible so need to clear text planes */ + ngleClearOverlayPlanes(pScreenPriv, 0x7, 0); + } + else if ((planeEnableMask & 0xffff0000) == 0x07070000) + { + /* only text is visible so need to clear slate planes */ + ngleClearOverlayPlanes(pScreenPriv, 0xf8, 0); + } + /* else if ((planeEnableMask & 0xffff0000) == 0xffff0000) */ + /* both slate and text are visible so clear isn't necessary */ + } + else + { + /* Not in friendly boot mode and/or default visual is + * in image planes so clear all overlay planes + */ + ngleClearOverlayPlanes(pScreenPriv, 0xff, 255); + } + + /************************************************** + ** Also need to counteract ITE settings + **************************************************/ + hyperUndoITE(pScreenPriv); + break; + + case SERVER_EXIT: + /************************************************** + ** Need to clear screen + **************************************************/ + if (IS_24_DEVICE(pScreenPriv)) + ngleDepth24_ClearImagePlanes(pScreenPriv); + else + ngleDepth8_ClearImagePlanes(pScreenPriv); + ngleResetAttrPlanes(pScreenPriv, controlPlaneReg); + ngleClearOverlayPlanes(pScreenPriv, 0xff, 0); + break; + + case SERVER_RECOVERY: + /************************************************** + ** Need to counteract ITE settings + **************************************************/ + hyperUndoITE(pScreenPriv); + + /************************************************** + * Reset attribute planes to known state + **************************************************/ + ngleResetAttrPlanes(pScreenPriv, controlPlaneReg); + break; + } + + NGLE_UNLOCK(pScreenPriv); + + return(TRUE); + + } /* hyperResetPlanes */ + + + /****************************************************************************** + * + * NGLE DDX Utility Procedure: hyperUndoITE + * + * Description: + * + * This local routine counteracts what the ITE has done on + * Hyperdrive. + * + * STI uses the upper 5 overlay planes for the friendly boot slate + * and the lower 3 overlay planes for ITE console messages. These + * planes are enabled/disabled via the FDR register on Marathon. + * + * ITE has set transparency enable mask to a non-zero + * value. Make sure that it's set to zero. Method is per + * Curtis McAllister. + * + * Before clearing the transparency, write zeroes to the overlay + * planes (to avoid flashing display of colors that are no longer + * transparent). + * + * Assumptions: + * + * Assumes fast-locking has been initialized. + * Does not assume a lock is in effect. + * + ******************************************************************************/ + + static void hyperUndoITE( + NgleScreenPrivPtr pScreenPriv) + { + NgleHdwPtr pDregs; + Int32 nFreeFifoSlots = 0; + Card32 fbAddr; + + pDregs = (NgleHdwPtr) pScreenPriv->pDregs; + + NGLE_LOCK(pScreenPriv); + + + /********************************************** + * Display enable all overlay planes + **********************************************/ + + /* + * On Hyperdrive, plane enable done via FDR register on Marathon. + * Enable all planes (image and overlay). + */ + GET_FIFO_SLOTS(nFreeFifoSlots,1); + NGLE_WRITE32(pDregs->reg32,0xffffffff); + + + /********************************************** + * Write overlay transparency mask so only entry 255 is transparent + **********************************************/ + + /* Hardware setup for full-depth write to "magic" location */ + GET_FIFO_SLOTS(nFreeFifoSlots, 7); + NGLE_QUICK_SET_DST_BM_ACCESS( + BA(IndexedDcd, Otc04, Ots08, AddrLong, + BAJustPoint(0), BINovly, BAIndexBase(0))); + NGLE_QUICK_SET_IMAGE_BITMAP_OP( + IBOvals(RopSrc, MaskAddrOffset(0), + BitmapExtent08, StaticReg(FALSE), + DataDynamic, MaskOtc, BGx(FALSE), FGx(FALSE))); + + /* Now prepare to write to the "magic" location */ + fbAddr = (Card32) NGLE_LONG_FB_ADDRESS(0, 1532, 0); + NGLE_BINC_SET_DSTADDR(fbAddr); + NGLE_REALLY_SET_IMAGE_PLANEMASK(0xffffff); + NGLE_BINC_SET_DSTMASK(~0UL); + + /* Finally, write a zero to clear the mask */ + NGLE_BINC_WRITE32(0); + + NGLE_UNLOCK(pScreenPriv); + + } /* hyperUndoITE */ *** - Wed Jan 25 18:47:59 1995 --- xc/programs/Xserver/hw/hp/ngle/ngle.h Wed Jan 25 18:47:58 1995 *************** *** 1,4 **** ! /* $XConsortium: ngle.h,v 1.2 94/05/28 15:45:30 dpw Exp $ */ /************************************************************************* * * (c)Copyright 1992 Hewlett-Packard Co., All Rights Reserved. --- 1,4 ---- ! /* $XConsortium: ngle.h,v 1.3 95/01/24 01:55:45 dpw Exp $ */ /************************************************************************* * * (c)Copyright 1992 Hewlett-Packard Co., All Rights Reserved. *************** *** 25,34 **** --- 25,43 ---- #ifndef NGLE_H #define NGLE_H + /* Rummor has it that NDEBUG is defined by default in X build environment. + * It is used to activate assert statements (see /usr/include/assert.h). + * Compiling with the preprocessor option -DNDEBUG (see cpp(1)), or with + * the preprocessor control statement #define NDEBUG ahead of the + * #include statement, stops assertions from being compiled + * into the program. + */ + #include /* keys off _[POSIX|HPUX|XOPEN]_SOURCE */ #include /* For prototype of getenv() */ #include #include + #include /* For assert() statements */ #include #include #include *************** *** 96,103 **** # define CRX24_OVERLAY_PLANES 0x920825AA # endif ! # ifndef S9000_ID_ARTIST /* Artist (Gecko) Graphics */ # define S9000_ID_ARTIST 0x2B4DED6D # endif #define hpGivingUp (dispatchException & DE_TERMINATE) --- 105,116 ---- # define CRX24_OVERLAY_PLANES 0x920825AA # endif ! # ifndef S9000_ID_ARTIST /* Artist (Gecko/712 & 715) Graphics */ # define S9000_ID_ARTIST 0x2B4DED6D + # endif + + # ifndef S9000_ID_HCRX /* hyperdrive Graphics */ + # define S9000_ID_HCRX 0x2BCB015A # endif #define hpGivingUp (dispatchException & DE_TERMINATE) *** - Wed Jan 25 18:48:00 1995 --- xc/programs/Xserver/hw/hp/ngle/nglehdw.h Wed Jan 25 18:48:00 1995 *************** *** 1,4 **** ! /* $XConsortium: nglehdw.h,v 1.2 94/05/28 15:45:32 dpw Exp $ */ /************************************************************************* * --- 1,4 ---- ! /* $XConsortium: nglehdw.h,v 1.3 95/01/24 01:58:28 dpw Exp $ */ /************************************************************************* * *************** *** 24,68 **** *************************************************************************/ ! #ifndef NGLEHDW_H #define NGLEHDW_H typedef ngle_dregs_t NgleHdwRec; typedef ngle_dregs_t *NgleHdwPtr; ! #define SETUP_HW(pDregs) { \ ! char stat; \ ! volatile char * pstat = &((pDregs)->reg15.b.b0); \ ! do { \ ! stat = *pstat; \ ! if (!stat) \ ! stat = *pstat; \ ! } while(stat); \ ! } ! ! #define SETUP_FB(pDregs,ID, depth) { \ ! SETUP_HW(pDregs); \ ! switch (ID) { \ ! case S9000_ID_ARTIST: \ ! case S9000_ID_A1659A: \ ! (pDregs)->reg10 = 0x13601000; \ ! break; \ ! case S9000_ID_A1439A: \ ! if (depth == 24) \ ! (pDregs)->reg10 = 0xBBA0A000; \ ! else /* depth = 8 */ \ ! (pDregs)->reg10 = 0x13601000; \ ! break; \ ! case S9000_ID_TIMBER: \ ! case CRX24_OVERLAY_PLANES: \ ! (pDregs)->reg10 = 0x13602000; \ ! break; \ ! } \ ! (pDregs)->reg14.all = 0x83000300; \ ! SETUP_HW(pDregs); \ ! (pDregs)->reg16.b.b1 = 1; \ ! } #define START_CURSOR_COLORMAP_ACCESS(pDregs) { \ SETUP_HW(pDregs); \ --- 24,108 ---- *************************************************************************/ ! #ifndef NGLEHDW_H /*[ NGLEHDW_H */ #define NGLEHDW_H + /* Define pointer to NGLE registers */ + #ifndef DREGS_PTR + #define DREGS_PTR pDregs + #endif + + #define NGLE_LOCK(pScreenPriv) + #define NGLE_UNLOCK(pScreenPriv) + + #define NGLE_READ32(source) ((long)(source)) + #define NGLE_WRITE32(dest, data) ((dest) = (long)(data)) typedef ngle_dregs_t NgleHdwRec; typedef ngle_dregs_t *NgleHdwPtr; ! #define SETUP_HW(pDregs) \ ! { \ ! char stat; \ ! volatile char * pstat = &((pDregs)->reg15.b.b0); \ ! do { \ ! stat = *pstat; \ ! if (!stat) \ ! stat = *pstat; \ ! } while(stat); \ ! } ! ! #define SETUP_FB(pDregs, ID, depth) \ ! { \ ! SETUP_HW(pDregs); \ ! switch (ID) \ ! { \ ! case S9000_ID_ARTIST: \ ! case S9000_ID_A1659A: \ ! (pDregs)->reg10 = 0x13601000; \ ! break; \ ! case S9000_ID_A1439A: \ ! if (depth == 24) \ ! (pDregs)->reg10 = 0xBBA0A000; \ ! else /* depth = 8 */ \ ! (pDregs)->reg10 = 0x13601000; \ ! break; \ ! case S9000_ID_HCRX: \ ! if (depth == 24) \ ! (pDregs)->reg10 = 0xBBA0A000; \ ! else /* depth = 8 */ \ ! (pDregs)->reg10 = 0x13602000; \ ! break; \ ! case S9000_ID_TIMBER: \ ! case CRX24_OVERLAY_PLANES: \ ! (pDregs)->reg10 = 0x13602000; \ ! break; \ ! } \ ! (pDregs)->reg14.all = 0x83000300; \ ! SETUP_HW(pDregs); \ ! (pDregs)->reg16.b.b1 = 1; \ ! } ! ! #ifdef HPUX_ANSIC_ACKNOWLEDGES_VOLATILE_STRUCTURE /* [ */ ! #define GET_FIFO_SLOTS( cnt, numslots) \ ! { \ ! while (cnt < numslots) \ ! { \ ! cnt = DREGS_PTR->reg34.all; \ ! } \ ! cnt -= numslots; \ ! } ! #else /* Compiler does not treat pDregs as volatile ][ use local volatile */ ! #define GET_FIFO_SLOTS( cnt, numslots) \ ! { \ ! volatile unsigned long * pHwFifoFreeCnt = &(DREGS_PTR->reg34.all); \ ! while (cnt < numslots) \ ! { \ ! cnt = *pHwFifoFreeCnt; \ ! } \ ! cnt -= numslots; \ ! } ! #endif /* Use local volatile ] */ #define START_CURSOR_COLORMAP_ACCESS(pDregs) { \ SETUP_HW(pDregs); \ *************** *** 94,106 **** (pDregs)->reg13 = ~0; \ } ! #define WRITE_IMAGE_COLOR(pDregs,index,color) { \ SETUP_HW(pDregs); \ (pDregs)->reg3 = ((0x100+index) << 2); \ (pDregs)->reg4 = (color); \ } ! #define FINISH_IMAGE_COLORMAP_ACCESS(pDregs,ID, depth) { \ (pDregs)->reg2 = 0x400; \ if (depth == 24) \ (pDregs)->reg1 = 0x83000100; \ --- 134,146 ---- (pDregs)->reg13 = ~0; \ } ! #define WRITE_IMAGE_COLOR(pDregs, index, color) { \ SETUP_HW(pDregs); \ (pDregs)->reg3 = ((0x100+index) << 2); \ (pDregs)->reg4 = (color); \ } ! #define FINISH_IMAGE_COLORMAP_ACCESS(pDregs, ID, depth) { \ (pDregs)->reg2 = 0x400; \ if (depth == 24) \ (pDregs)->reg1 = 0x83000100; \ *************** *** 111,117 **** else \ (pDregs)->reg1 = 0x80000100; \ } \ ! SETUP_FB(pDregs,ID,depth); \ } #define GET_CURSOR_SPECS(pDregs,pScreenPriv) { \ --- 151,157 ---- else \ (pDregs)->reg1 = 0x80000100; \ } \ ! SETUP_FB(pDregs, ID, depth); \ } #define GET_CURSOR_SPECS(pDregs,pScreenPriv) { \ *************** *** 203,208 **** --- 243,252 ---- *(pAuxControlSpace+2) = 0x03000000; \ } + #define HCRX_SETUP_RAMDAC(pDregs) { \ + NGLE_WRITE32(pDregs->reg32,0xffffffff); \ + } + #define CRX24_SET_OVLY_MASK(pDregs) { \ SETUP_HW(pDregs); \ (pDregs)->reg11 = 0x13a02000; \ *************** *** 211,217 **** (pDregs)->reg13 = 0xffffffff; \ (pDregs)->reg22 = (long) (~0UL); \ (pDregs)->reg23 = 0x0; \ ! } #define ENABLE_DISPLAY(pDregs) { \ --- 255,261 ---- (pDregs)->reg13 = 0xffffffff; \ (pDregs)->reg22 = (long) (~0UL); \ (pDregs)->reg23 = 0x0; \ ! } #define ENABLE_DISPLAY(pDregs) { \ *************** *** 274,284 **** --- 318,406 ---- (pDregs)->reg27.all = *pDregsMiscCtl & ~0x00800000; \ } + #define HYPER_CONFIG_PLANES_24 0x00000100 + #define IS_24_DEVICE(pScreenPriv) \ + (pScreenPriv->deviceSpecificConfig & HYPER_CONFIG_PLANES_24) + + #define IS_888_DEVICE(pScreenPriv) (!(IS_24_DEVICE(pScreenPriv))) + + #define HYPER_CURSOR_DATA_BIT 0x80 + #define HYPER_CURSOR_ENABLE_BIT 0x80000000 + + #define HYPER_SET_CURSOR_ADDRESS(value) \ + NGLE_WRITE32(DREGS_PTR->reg30, (value)) + + #define HYPER_WRITE_CURSOR_DATA(value) \ + NGLE_WRITE32(DREGS_PTR->reg31, (value)) + + #define HYPER_CURSOR_XY(x,y) \ + (((x<0)?(((-x & 0xfff) | 0x1000)<<16):((x & 0xfff)<<16)) | \ + ((y<0)?((-y & 0xfff) | 0x1000):(y & 0x1fff))); + + #define HYPER_ENABLE_CURSOR(pScreenPriv, hypCursorXYValue) \ + { \ + /* Only called if cursor is visible */ \ + assert(pScreenPriv->sprite.visible == TRUE); \ + \ + /* Save value written for use by disable cursor */\ + pScreenPriv->sprite.enabledCursorXYValue = (hypCursorXYValue);\ + NGLE_WRITE32(pScreenPriv->pDregs->reg29.all, (hypCursorXYValue) | \ + HYPER_CURSOR_ENABLE_BIT); \ + \ + } + + #define HYPER_DISABLE_CURSOR(pScreenPriv) \ + { \ + long enabledCursorValue = pScreenPriv->sprite.enabledCursorXYValue; \ + \ + NGLE_WRITE32(pScreenPriv->pDregs->reg29.all, (enabledCursorValue & \ + ~(HYPER_CURSOR_ENABLE_BIT))); \ + } + + /* Macros for controlling cursor position, used in ngleMoveSprite() */ + #define HYPER_ACCEL_BUSY_DODGER_IDLE \ + ((NGLE_READ32(DREGS_PTR->reg15.all) & 0xc001000) == 0x00010000) + + /* not FIFO paced */ + #define HYPER_CPC(pScreenPriv,bifCursorXYValue) \ + pScreenPriv->sprite.enabledCursorXYValue = (bifCursorXYValue); \ + NGLE_WRITE32(DREGS_PTR->reg17.all, \ + (bifCursorXYValue) | HYPER_CURSOR_ENABLE_BIT); + + /* FIFO paced */ + #define HYPER_FIFO_CP(pScreenPriv,hypCursorXYValue) \ + GET_FIFO_SLOTS(nFreeFifoSlots,2); \ + HYPER_GET_VID_BUS_ACCESS; \ + HYPER_ENABLE_CURSOR(pScreenPriv, hypCursorXYValue); + + #define HYPER_GET_VID_BUS_ACCESS \ + NGLE_WRITE32(DREGS_PTR->reg28,0); + + #define HYPER_ENABLE_DISPLAY(pDregs) \ + { \ + volatile unsigned long *pDregsHypMiscVideo = \ + &((pDregs)->reg33); \ + \ + SETUP_HW(pDregs); \ + (pDregs)->reg33 = *pDregsHypMiscVideo | 0x0A000000; \ + } + + #define HYPER_DISABLE_DISPLAY(pDregs) \ + { \ + volatile unsigned long *pDregsHypMiscVideo = \ + &((pDregs)->reg33); \ + \ + SETUP_HW(pDregs); \ + (pDregs)->reg33 = *pDregsHypMiscVideo & ~0x0A000000; \ + } + /* define the various BufferNumber used by SETUP_ATTR_ACCESS */ #define BUFF0_CMAP0 0x00001e02 #define BUFF1_CMAP0 0x02001e02 #define BUFF1_CMAP3 0x0c001e02 #define ARTIST_CMAP0 0x00000102 + #define HYPER_CMAP8 0x00000100 + #define HYPER_CMAP24 0x00000800 #define SETUP_ATTR_ACCESS(pDregs,BufferNumber) { \ SETUP_HW(pDregs); \ *************** *** 303,308 **** #define SETUP_COPYAREA(pDregs) \ (pDregs)->reg16.b.b1 = 0; ! #endif /* NGLEHDW_H */ --- 425,523 ---- #define SETUP_COPYAREA(pDregs) \ (pDregs)->reg16.b.b1 = 0; + #define IndexedDcd 0 /* Pixel data is indexed (pseudo) color */ + #define Otc04 2 /* Pixels in each longword transfer (4) */ + #define Otc32 5 /* Pixels in each longword transfer (32) */ + #define Ots08 3 /* Each pixel is size (8)d transfer (1) */ + #define OtsIndirect 6 /* Each bit goes through FG/BG color(8) */ + #define AddrLong 5 /* FB address is Long aligned (pixel) */ + #define BINovly 0x2 /* 8 bit overlay */ + #define BINapp0I 0x0 /* Application Buffer 0, Indexed */ + #define BINapp1I 0x1 /* Application Buffer 1, Indexed */ + #define BINapp0F8 0xa /* Application Buffer 0, Fractional 8-8-8 */ + #define BINattr 0xd /* Attribute Bitmap */ + #define RopSrc 0x3 + #define BitmapExtent08 3 /* Each write hits ( 8) bits in depth */ + #define BitmapExtent32 5 /* Each write hits (32) bits in depth */ + #define DataDynamic 0 /* Data register reloaded by direct access */ + #define MaskDynamic 1 /* Mask register reloaded by direct access */ + #define MaskOtc 0 /* Mask contains Object Count valid bits */ + + #define MaskAddrOffset(offset) (offset) + #define StaticReg(en) (en) + #define BGx(en) (en) + #define FGx(en) (en) + + #define BAJustPoint(offset) (offset) + #define BAIndexBase(base) (base) + #define BA(F,C,S,A,J,B,I) \ + (((F)<<31)|((C)<<27)|((S)<<24)|((A)<<21)|((J)<<16)|((B)<<12)|(I)) + + #define IBOvals(R,M,X,S,D,L,B,F) \ + (((R)<<8)|((M)<<16)|((X)<<24)|((S)<<29)|((D)<<28)|((L)<<31)|((B)<<1)|(F)) + + #define NGLE_QUICK_SET_IMAGE_BITMAP_OP(val) \ + NGLE_WRITE32(DREGS_PTR->reg14.all, val) + + #define NGLE_QUICK_SET_DST_BM_ACCESS(val) \ + NGLE_WRITE32(DREGS_PTR->reg11, val) + + #define NGLE_QUICK_SET_CTL_PLN_REG(val) \ + NGLE_WRITE32(DREGS_PTR->reg12, val) + + #define NGLE_REALLY_SET_IMAGE_PLANEMASK(plnmsk32) \ + NGLE_WRITE32(DREGS_PTR->reg13, plnmsk32) + + #define NGLE_REALLY_SET_IMAGE_FG_COLOR(fg32) \ + NGLE_WRITE32(DREGS_PTR->reg35,fg32) + + #define NGLE_LONG_FB_ADDRESS(fbaddrbase, x, y) (void *) ( \ + (unsigned long) (fbaddrbase) + \ + ( \ + (unsigned int) ( (y) << 13 ) | \ + (unsigned int) ( (x) << 2 ) \ + ) \ + ) + + #define NGLE_BINC_SET_DSTADDR(addr) \ + NGLE_WRITE32(DREGS_PTR->reg3, (addr)) + + #define NGLE_BINC_SET_SRCADDR(addr) \ + NGLE_WRITE32(DREGS_PTR->reg2, (addr)) + + #define NGLE_BINC_SET_DSTMASK(mask) \ + NGLE_WRITE32(DREGS_PTR->reg22, (mask)) + + #define NGLE_BINC_WRITE32(data32) \ + NGLE_WRITE32(DREGS_PTR->reg23, (data32)) + + #define NGLE_MFGP_REGISTER_TYPE dreg_cplx_t + #define NGLE_MFGP_REGISTER_TYPE_ASLONG(ngleMfgpReg) ngleMfgpReg.all + + #define NGLE_SET_TRANSFERDATA(trandata32) \ + NGLE_WRITE32(DREGS_PTR->reg8, (trandata32)) + + #define HYPER_SET_LENXY_START_FAST_RECFILL(value) \ + NGLE_WRITE32(DREGS_PTR->reg37.all, (value)) + + #define NGLE_SET_LENXY_START_RECFILL(lenxy32) \ + NGLE_WRITE32(DREGS_PTR->reg9.all, (lenxy32)) + + #define SET_LENXY_START_RECFILL(lenxy32) \ + NGLE_SET_LENXY_START_RECFILL(NGLE_MFGP_REGISTER_TYPE_ASLONG(lenxy32)) + + #define NGLE_SET_SCOREBOARD_OVERRIDE(data32) + /* + NGLE_WRITE32(DREGS_PTR->bifSBO, data32) + */ + #define NGLE_SET_DSTXY(xy32) \ + NGLE_WRITE32(DREGS_PTR->reg6.all, (xy32)) + + #define PACK_2CARD16(dest32, highcard16, lowcard16) \ + dest32.w.high = (highcard16); \ + dest32.w.low = (lowcard16); + #define START_COLORMAPLOAD(cmapBltCtlData32) \ + NGLE_WRITE32(pDregs->reg38, (cmapBltCtlData32)) ! #endif /* NGLEHDW_H ]*/ *** - Wed Jan 25 18:48:02 1995 --- xc/programs/Xserver/hw/hp/ngle/nglecolormap.c Wed Jan 25 18:48:01 1995 *************** *** 1,4 **** ! /* $XConsortium: nglecolormap.c,v 1.1 93/08/08 12:56:41 rws Exp $ */ /************************************************************************* * --- 1,4 ---- ! /* $XConsortium: nglecolormap.c,v 1.2 95/01/24 02:00:06 dpw Exp $ */ /************************************************************************* * *************** *** 40,55 **** #include "ngle.h" /* Gray Scale support: calculate intensity from rgb using NTSC weights */ ! #define CALCULATE_GRAYSCALE_INTENSITY(intensity, red8, grn8, blu8)\ ! {\ ! intensity = (Card8) \ ! ( (float) ((red8) & 0xff) * 0.30 \ ! + (float) ((grn8) & 0xff) * 0.59 \ ! + (float) ((blu8) & 0xff) * 0.11 \ ! ); \ ! intensity &= 0xff; \ } --- 40,66 ---- #include "ngle.h" + extern NgleLutBltCtl setNgleLutBltCtl( + Card32 deviceID, + Int32 devDepth, + Card32 offsetWithinLut, + Card32 length); /* #entries to update */ + + extern NgleLutBltCtl setHyperLutBltCtl( + Card32 deviceID, + Int32 devDepth, + Card32 offsetWithinLut, + Card32 length); /* #entries to update */ /* Gray Scale support: calculate intensity from rgb using NTSC weights */ ! #define CALCULATE_GRAYSCALE_INTENSITY(intensity, red8, grn8, blu8) \ ! { \ ! intensity = (Card8) \ ! ( (float) ((red8) & 0xff) * 0.30 \ ! + (float) ((grn8) & 0xff) * 0.59 \ ! + (float) ((blu8) & 0xff) * 0.11 \ ! ); \ ! intensity &= 0xff; \ } *************** *** 385,393 **** } } ! /* cleanup colormap hardware */ ! FINISH_IMAGE_COLORMAP_ACCESS(pDregs,pScreenPriv->deviceID, pScreenPriv->devDepth); pScreenPriv->installedMap = cmap; WalkTree(cmap->pScreen, TellGainedMap, (char *) &(cmap->mid)); --- 396,422 ---- } } ! if (pScreenPriv->deviceID == S9000_ID_HCRX) ! { ! NgleLutBltCtl lutBltCtl; ! ! lutBltCtl = setHyperLutBltCtl(pScreenPriv->deviceID, ! pScreenPriv->devDepth, ! 0, /* Offset w/i LUT */ ! 256); /* Load entire LUT */ ! NGLE_BINC_SET_SRCADDR((Card32) ! NGLE_LONG_FB_ADDRESS(0, 0x100, 0)); /* 0x100 is same as used in ! * WRITE_IMAGE_COLOR() */ ! START_COLORMAPLOAD(lutBltCtl.all); ! SETUP_FB(pDregs, pScreenPriv->deviceID, pScreenPriv->devDepth); ! } ! else ! { ! /* cleanup colormap hardware */ ! FINISH_IMAGE_COLORMAP_ACCESS(pDregs,pScreenPriv->deviceID, pScreenPriv->devDepth); + } + pScreenPriv->installedMap = cmap; WalkTree(cmap->pScreen, TellGainedMap, (char *) &(cmap->mid)); *************** *** 524,532 **** } } ! /* cleanup colormap hardware */ ! FINISH_IMAGE_COLORMAP_ACCESS(pDregs,pScreenPriv->deviceID, pScreenPriv->devDepth); } /* ngleStoreColors() */ --- 553,578 ---- } } ! if (pScreenPriv->deviceID == S9000_ID_HCRX) ! { ! NgleLutBltCtl lutBltCtl; ! ! lutBltCtl = setHyperLutBltCtl(pScreenPriv->deviceID, ! pScreenPriv->devDepth, ! 0, /* Offset w/i LUT */ ! 256); /* Load entire LUT */ ! NGLE_BINC_SET_SRCADDR((Card32) ! NGLE_LONG_FB_ADDRESS(0, 0x100, 0)); /* 0x100 is same as used in ! * WRITE_IMAGE_COLOR() */ ! START_COLORMAPLOAD(lutBltCtl.all); ! SETUP_FB(pDregs, pScreenPriv->deviceID, pScreenPriv->devDepth); ! } ! else ! { ! /* cleanup colormap hardware */ ! FINISH_IMAGE_COLORMAP_ACCESS(pDregs,pScreenPriv->deviceID, pScreenPriv->devDepth); + } } /* ngleStoreColors() */ *************** *** 667,670 **** return; ! } --- 713,788 ---- return; ! } /* ngleResolvePseudoColor() */ ! ! ! NgleLutBltCtl setNgleLutBltCtl( ! Card32 deviceID, ! Int32 devDepth, ! Card32 offsetWithinLut, ! Card32 length) /* #entries to update */ ! { ! NgleLutBltCtl lutBltCtl; ! ! /* set enable, zero reserved fields */ ! lutBltCtl.all = 0x80000000; ! ! lutBltCtl.fields.length = length; ! ! if (deviceID == S9000_ID_A1439A) /* CRX24 */ ! { ! if (devDepth == 8) ! { ! lutBltCtl.fields.lutType = NGLE_CMAP_OVERLAY_TYPE; ! lutBltCtl.fields.lutOffset = 0; ! } ! else ! { ! lutBltCtl.fields.lutType = NGLE_CMAP_INDEXED0_TYPE; ! lutBltCtl.fields.lutOffset = 0 * 256; ! } ! } ! else if (deviceID == S9000_ID_ARTIST) ! { ! lutBltCtl.fields.lutType = NGLE_CMAP_INDEXED0_TYPE; ! lutBltCtl.fields.lutOffset = 0 * 256; ! } ! else ! { ! lutBltCtl.fields.lutType = NGLE_CMAP_INDEXED0_TYPE; ! lutBltCtl.fields.lutOffset = 0; ! } ! ! /* Offset points to start of LUT. Adjust for within LUT */ ! lutBltCtl.fields.lutOffset += offsetWithinLut; ! ! return(lutBltCtl); ! ! } /* setNgleLutBltCtl() */ ! ! NgleLutBltCtl setHyperLutBltCtl( ! Card32 deviceID, ! Int32 devDepth, ! Card32 offsetWithinLut, ! Card32 length) /* #entries to update */ ! { ! NgleLutBltCtl lutBltCtl; ! ! /* set enable, zero reserved fields */ ! lutBltCtl.all = 0x80000000; ! ! lutBltCtl.fields.length = length; ! lutBltCtl.fields.lutType = HYPER_CMAP_TYPE; ! ! /* Expect lutIndex to be 0 or 1 for image cmaps, 2 or 3 for overlay cmaps*/ ! if (devDepth == 8) ! lutBltCtl.fields.lutOffset = 2 * 256; ! else ! lutBltCtl.fields.lutOffset = 0 * 256; ! ! /* Offset points to start of LUT. Adjust for within LUT */ ! lutBltCtl.fields.lutOffset += offsetWithinLut; ! ! return(lutBltCtl); ! ! } /* setHyperLutBltCtl() */ *** - Wed Jan 25 18:48:03 1995 --- xc/programs/Xserver/hw/hp/ngle/nglecolormap.h Wed Jan 25 18:48:03 1995 *************** *** 1,4 **** ! /* $XConsortium: nglecolormap.h,v 1.1 93/08/08 12:56:48 rws Exp $ */ /************************************************************************* * --- 1,4 ---- ! /* $XConsortium: nglecolormap.h,v 1.2 95/01/24 02:02:01 dpw Exp $ */ /************************************************************************* * *************** *** 33,38 **** --- 33,57 ---- #ifndef NGLECOLORMAP_H #define NGLECOLORMAP_H + #define HYPER_CMAP_TYPE 0 + #define NGLE_CMAP_INDEXED0_TYPE 0 + #define NGLE_CMAP_OVERLAY_TYPE 3 + + /* Typedef of LUT (Colormap) BLT Control Register */ + typedef union + { /* Note assumption that fields are packed left-to-right */ + unsigned long all; + struct + { + unsigned enable : 1; + unsigned waitBlank : 1; + unsigned reserved1 : 4; + unsigned lutOffset : 10; /* Within destination LUT */ + unsigned lutType : 2; /* Cursor, image, overlay */ + unsigned reserved2 : 4; + unsigned length : 10; + } fields; + } NgleLutBltCtl; extern void ngleInstallColormap( ColormapPtr pColormap); *** - Wed Jan 25 18:48:05 1995 --- xc/programs/Xserver/hw/hp/ngle/nglecursor.c Wed Jan 25 18:48:04 1995 *************** *** 1,4 **** ! /* $XConsortium: nglecursor.c,v 1.2 94/05/28 15:45:31 dpw Exp $ */ /************************************************************************* * --- 1,4 ---- ! /* $XConsortium: nglecursor.c,v 1.3 95/01/24 02:05:50 dpw Exp $ */ /************************************************************************* * *************** *** 44,49 **** --- 44,139 ---- /****************************************************************************** * + * NGLE DDX Procedure: hyperInitSprite() + * + * Description: + * + * This routine is called at ScreenInit() time to initialize various + * cursor/sprite structures and the NGLE sprite code. + * + ******************************************************************************/ + + Bool hyperInitSprite( + ScreenPtr pScreen) + { + NgleScreenPrivPtr pScreenPriv = NGLE_SCREEN_PRIV(pScreen); + hpPrivPtr php = (hpPrivPtr)pScreen->devPrivate; + NgleHdwPtr pDregs = pScreenPriv->pDregs; + Int32 nScanlinesToZero; + Int32 curaddr; + Int32 nFreeFifoSlots = 0; + + NGLE_LOCK(pScreenPriv); + + /* Initialize the pScreen Cursor Procedure Pointers: */ + pScreen->PointerNonInterestBox = ngleNoop; + pScreen->CursorLimits = hpCursorLimits; + pScreen->ConstrainCursor = hpConstrainCursor; + pScreen->DisplayCursor = hyperDisplayCursor; + pScreen->SetCursorPosition = hpSetCursorPosition; + pScreen->RealizeCursor = ngleNoopTrue; + pScreen->UnrealizeCursor = ngleNoopTrue; + pScreen->RecolorCursor = ngleRecolorCursor; + + + /* Initialize the Cursor Procedure Pointers: */ + php->MoveMouse = ngleMoveSprite; + php->ChangeScreen = ngleChangeScreen; + php->CursorOff = ngleDisableSprite; + + /* Initialize the pScreenPriv->sprite Structure: */ + pScreenPriv->sprite.visible = FALSE; + pScreenPriv->sprite.x = (pScreenPriv->screenWidth >> 1); + pScreenPriv->sprite.y = (pScreenPriv->screenHeight >> 1); + pScreenPriv->sprite.width = 0; + pScreenPriv->sprite.height = 0; + pScreenPriv->sprite.pCursor = NULL; + pScreenPriv->sprite.firstCallTo_DisplayCursor = TRUE; + pScreenPriv->sprite.nTopPadLines = 0; + pScreenPriv->sprite.moveOnVBlank = FALSE; + + /* Zero out cursor mask and data: + * Each load of cursor data/mask will write minimum necessary + * to overwrite previous cursor. + */ + /* Zero out 64 bits (2 longs) in each mask scanline */ + nScanlinesToZero = NGLE_MAX_SPRITE_SIZE; + + /* to protect against VID bus data loss */ + SETUP_HW(pDregs); + + GET_FIFO_SLOTS(nFreeFifoSlots,2); + HYPER_GET_VID_BUS_ACCESS; + + /* Write to mask area */ + HYPER_SET_CURSOR_ADDRESS(0); + do + { + GET_FIFO_SLOTS(nFreeFifoSlots, 2); + HYPER_WRITE_CURSOR_DATA(0); + HYPER_WRITE_CURSOR_DATA(0); + } while (--nScanlinesToZero); + + /* Zero out 64 bits (2 longs) in each data scanline */ + nScanlinesToZero = NGLE_MAX_SPRITE_SIZE; + GET_FIFO_SLOTS(nFreeFifoSlots, 1); + HYPER_SET_CURSOR_ADDRESS(HYPER_CURSOR_DATA_BIT); + do + { + GET_FIFO_SLOTS(nFreeFifoSlots, 2); + HYPER_WRITE_CURSOR_DATA(0); + HYPER_WRITE_CURSOR_DATA(0); + } while (--nScanlinesToZero); + + NGLE_UNLOCK(pScreenPriv); + + return(TRUE); + + } /* hyperInitSprite() */ + + + /****************************************************************************** + * * NGLE DDX Procedure: ngleInitSprite() * * Description: *************** *** 544,549 **** --- 634,875 ---- } /* ngleDisplayCursor() */ + + /****************************************************************************** + * + * NGLE DDX Procedure: hyperDisplayCursor() + * + * Description: + * + * This routine is called by DIX (and the input driver?) + * whenever the sprite/cursor is changed 1) from one "cursor" (i.e. image + * and mask bits, foreground and background color) to another 2) from one + * screen to another. This routine downloads the cursor image/mask and + * foreground and background colors to the hardware cursor. + * + * Cloned from ngleDisplayCursor to use new hyperdrive cursor model and + * to avoid ugly bug workarounds in ngle code. + * + ******************************************************************************/ + + Bool hyperDisplayCursor( + ScreenPtr pScreen, + CursorPtr pCursor) + { + NgleScreenPrivPtr pScreenPriv = NGLE_SCREEN_PRIV(pScreen); + WindowPtr pRootWindow; + NgleHdwPtr pDregs = pScreenPriv->pDregs; + Card32 *pSrcStart; + Card32 *pSrc; + Int32 nScanlines; /* loop variable */ + Int32 heightPlus1; + Int32 sourceIncrement; + Int32 x0, y0; /* Sprite origin (not hotspot) */ + Int32 i; + Int32 curaddr; + Card32 srcMask; + Int32 nFreeFifoSlots = 0; + Card32 cursorXYValue = 0; + int nBotPadLines = 0; + + + /* + *************************************************************************** + ** We are called during initialization as a side effect of doing a change + ** screens to insure screen 0 is on top. At that time, there is no root + ** window so we should just abort and wait for a call that has a cursor + ** to display. + ** + ** After the first time this routine is called (i.e. after the side effect + ** call), if pCursor is NULL it means that the Corvallis input driver is + ** changing screens and wants this screen to use the same "cursor" (i.e. + ** image and mask bits, etc.) as the last time that the sprite was on + ** this screen. However, the second time that pScreen->DisplayCursor is + ** called, pCursor is NULL, but since there wasn't a previous cursor, + ** the driver should use the Root Window's cursor (which is the side + ** effect that the input driver and/or DIX wants to acheive). + *************************************************************************** + */ + if (!(pRootWindow = WindowTable[pScreen->myNum])) + return(TRUE); + + if (pScreenPriv->sprite.firstCallTo_DisplayCursor) + { + pScreenPriv->sprite.firstCallTo_DisplayCursor = FALSE; + + if (pCursor == NULL) + pCursor = pRootWindow->optional->cursor; + } + + /* Now if the cursor is still null, abort because we are using the + * same cursor as before: + */ + + if (pCursor == NULL) + return(FALSE); + + /* Check for a valid sized cursor: (hyper same as ngle) */ + if ((pCursor->bits->width > NGLE_MAX_SPRITE_SIZE) || + (pCursor->bits->height > NGLE_MAX_SPRITE_SIZE)) + return(FALSE); /* Cursor is TOO big */ + + /* Lock the device: */ + NGLE_LOCK(pScreenPriv); + + /* to protect against VID bus data loss */ + SETUP_HW(pDregs); + + GET_FIFO_SLOTS(nFreeFifoSlots,2); + HYPER_GET_VID_BUS_ACCESS; + if (pScreenPriv->sprite.visible == TRUE) + { + /**** Before loading the new image, mask, and colors into the hardware + **** cursor, turn it off so we don't get flicker: + ****/ + /* Accessing asynchronous register: no need to check FIFO */ + HYPER_DISABLE_CURSOR(pScreenPriv); + + } + + /* Calculate cursor origin (not hotspot) and number of scanlines not + * actually displayed. + */ + + x0 = pScreenPriv->sprite.x - pCursor->bits->xhot; + y0 = pScreenPriv->sprite.y + - (pCursor->bits->yhot); + nBotPadLines = NGLE_MAX_SPRITE_SIZE - pCursor->bits->height; + + /* If cursor has changed, write the image, mask, and cursor colormap + * to the hardware cursor: + */ + if ((pCursor != pScreenPriv->sprite.pCursor) + ||(pCursor->bits != pScreenPriv->sprite.pCursor->bits)) + { + + pScreenPriv->sprite.pCursor = pCursor; + + heightPlus1 = pCursor->bits->height + 1; + + /* Start out writing the mask */ + pSrcStart = (Card32 *) pCursor->bits->mask; + curaddr = 0; /* Mask Area */ + + /**** Write the image and mask to the hardware cursor: ****/ + for (i = 0; i < 2; i++) + { + /* Source is long-aligned: */ + assert((Card32) pSrcStart == ((Card32)(pSrcStart) >> 2) << 2); + + /* Like all pixmaps created by NGLE DDX, each scanline + * of the source and mask pixmaps are padded on the right + * to a long-word boundary. For a NGLE sprite, this means + * the scanline is either 32 or 64 bits. + * + * Padding is NOT necessarily 0! + */ + + if (pCursor->bits->width <= 32) + { + pSrc = pSrcStart; + + /* Form left justified mask of meaningful bits in cursor + * data and mask. Alas, masking is performed on CPU + * on source data rather than using the ELK mask + * register. Reason: old cursor may be larger and + * needs to be zeroed out, not left unchanged. + */ + srcMask = 0xffffffffUL << (32 - pCursor->bits->width); + + /* Ngle cares whether old cursor was small enough that */ + /* we dont have to zero all 64 bits. Hyperdrive */ + /* its a dont-care since you can either write the 0 or */ + /* write the new address. */ + + nScanlines = heightPlus1; + GET_FIFO_SLOTS(nFreeFifoSlots, 1); + HYPER_SET_CURSOR_ADDRESS(curaddr); + while (--nScanlines) + { + GET_FIFO_SLOTS(nFreeFifoSlots, 2); + HYPER_WRITE_CURSOR_DATA((*pSrc++ & srcMask)); + HYPER_WRITE_CURSOR_DATA(0); + } + nScanlines = nBotPadLines + 1; + while (--nScanlines) + { + GET_FIFO_SLOTS(nFreeFifoSlots, 2); + HYPER_WRITE_CURSOR_DATA(0); + HYPER_WRITE_CURSOR_DATA(0); + } + } + else + { /* Width == 64 */ + + /* Form left justified mask of meaningful bits + * second word in cursor data and mask. + */ + srcMask = 0xffffffffUL << (64 - pCursor->bits->width); + + /* Destination bitmap address already set to (0,0) */ + pSrc = pSrcStart; + + nScanlines = heightPlus1; + GET_FIFO_SLOTS(nFreeFifoSlots, 1); + HYPER_SET_CURSOR_ADDRESS(curaddr); + while (--nScanlines) + { + GET_FIFO_SLOTS(nFreeFifoSlots, 2); + HYPER_WRITE_CURSOR_DATA(*pSrc++); + HYPER_WRITE_CURSOR_DATA((*pSrc++ & srcMask)); + } + nScanlines = nBotPadLines + 1; + while (--nScanlines) + { + GET_FIFO_SLOTS(nFreeFifoSlots, 2); + HYPER_WRITE_CURSOR_DATA(0); + HYPER_WRITE_CURSOR_DATA(0); + } + } + /* Now do the data */ + pSrcStart = (Card32 *) pCursor->bits->source; + curaddr = HYPER_CURSOR_DATA_BIT; + } + + /* Load the correct colors into the hardware cursor: */ + ngleLoadCursorColormap(pScreen, pCursor); + } + + /* Load cursor position into NGLE: + * X11 hotspot hasn't changed position, but NGLE stores + * origin of cursor, and relative distance between hotspot + * and origin may have changed. + */ + + /* if y0 < 0, y0 has already been set to 0 above */ + cursorXYValue = HYPER_CURSOR_XY(x0,y0); + + /* Update values maintained in pScreenPriv->sprite */ + pScreenPriv->sprite.visible = TRUE; + pScreenPriv->sprite.width = pCursor->bits->width; + pScreenPriv->sprite.height = pCursor->bits->height; + + /**** Now, that we have loaded the correct bits into the hardware + **** cursor, turn it back on: + ****/ + + /* If cursor is at top of screen, hotspot may be displayed + * but origin is at (y<0). NGLE hardware stores this value + * in same register as cursor enable bit, so pass as parameter. + */ + HYPER_ENABLE_CURSOR(pScreenPriv, cursorXYValue); + + NGLE_UNLOCK(pScreenPriv); + + return(TRUE); + + } /* hyperDisplayCursor() */ + /****************************************************************************** *************** *** 604,609 **** --- 930,937 ---- xHi, xLo; Card32 cursorXYValue = 0; + NgleHdwPtr pDregs; + Int32 nFreeFifoSlots = 0; #ifdef XTESTEXT1 extern Int32 on_steal_input; /* Defined in xtestext1di.c */ *************** *** 613,618 **** --- 941,947 ---- #endif /* XTESTEXT1 */ pScreenPriv = NGLE_SCREEN_PRIV(pScreen); + pDregs = pScreenPriv->pDregs; /* Only move if cursor defined and position changed. * *************** *** 633,677 **** { /* Calculate cursor origin */ x0 = xhot - pCursorBits->xhot; y0 = yhot - pCursorBits->yhot - pScreenPriv->sprite.nTopPadLines; ! /* Calculate number of scanlines not displayed ! * because cursor is partly off the top of the screen. ! * (X11 requires hotspot to remain on-screen, ! * but not the sprite origin). ! */ ! if (y0 < 0) ! { ! nOffscreenScanlines = - y0; ! y0 = 0; } - - /* Update cursor X/Y position register, which contains - * all cursor position information except the number - * of scanlines hidden. - */ - hbp_times_vi = (pScreenPriv->sprite.horizBackPorch * - pScreenPriv->sprite.videoInterleave); - xHi = ((x0 + hbp_times_vi) / pScreenPriv->sprite.videoInterleave) - - pScreenPriv->sprite.pipelineDelay; - if (pScreenPriv->deviceID != S9000_ID_ARTIST) - xLo = x0 % pScreenPriv->sprite.videoInterleave; - else - xLo = (x0 + hbp_times_vi) % pScreenPriv->sprite.videoInterleave; - - /* if y0 < 0, y0 has already been set to 0 above */ - cursorXYValue = - ( (xHi << 19) - | (xLo << 16) - | (pScreenPriv->sprite.maxYLine - y0) - ); - - /* Now update number of cursor scan lines hidden. - * It's in same register as the enable cursor bit, and this macro - * also enables cursor, but this position cursor routine is only - * called if cursor is visible. - */ - ENABLE_CURSOR(pScreenPriv, cursorXYValue, nOffscreenScanlines); } } } /* ngleMoveSprite() */ --- 962,1037 ---- { /* Calculate cursor origin */ x0 = xhot - pCursorBits->xhot; + /* Not all cursors start at first scan line of cursor BINs + * (to work around hardware problem w/ghosting and tearing + * on Biff/Mojave-based graphics cards). Number of padding + * padding lines is set when cursor loaded. + */ y0 = yhot - pCursorBits->yhot - pScreenPriv->sprite.nTopPadLines; ! if (pScreenPriv->deviceID == S9000_ID_HCRX) ! { /* ie NGLE_II_HW_CURSOR */ ! cursorXYValue = HYPER_CURSOR_XY(x0,y0); ! assert(pScreenPriv->sprite.visible == TRUE); ! ! /* This test is an optimization for thunder */ ! if (HYPER_ACCEL_BUSY_DODGER_IDLE) ! { ! if (HYPER_ACCEL_BUSY_DODGER_IDLE) ! { ! /* FIFO slot not required for this write */ ! HYPER_CPC(pScreenPriv, cursorXYValue); ! } ! else ! { ! HYPER_FIFO_CP(pScreenPriv, cursorXYValue); ! } ! } ! else ! { ! HYPER_FIFO_CP(pScreenPriv, cursorXYValue); ! } ! } ! else ! { ! /* Calculate number of scanlines not displayed ! * because cursor is partly off the top of the screen. ! * (X11 requires hotspot to remain on-screen, ! * but not the sprite origin). ! */ ! if (y0 < 0) ! { ! nOffscreenScanlines = - y0; ! y0 = 0; ! } ! ! /* Update cursor X/Y position register, which contains ! * all cursor position information except the number ! * of scanlines hidden. ! */ ! hbp_times_vi = (pScreenPriv->sprite.horizBackPorch * ! pScreenPriv->sprite.videoInterleave); ! xHi = ((x0 + hbp_times_vi) / pScreenPriv->sprite.videoInterleave) ! - pScreenPriv->sprite.pipelineDelay; ! if (pScreenPriv->deviceID != S9000_ID_ARTIST) ! xLo = x0 % pScreenPriv->sprite.videoInterleave; ! else ! xLo = (x0 + hbp_times_vi) % pScreenPriv->sprite.videoInterleave; ! ! /* if y0 < 0, y0 has already been set to 0 above */ ! cursorXYValue = ! ( (xHi << 19) ! | (xLo << 16) ! | (pScreenPriv->sprite.maxYLine - y0) ! ); ! ! /* Now update number of cursor scan lines hidden. ! * It's in same register as the enable cursor bit, and this macro ! * also enables cursor, but this position cursor routine is only ! * called if cursor is visible. ! */ ! ENABLE_CURSOR(pScreenPriv, cursorXYValue, nOffscreenScanlines); } } } } /* ngleMoveSprite() */ *** - Wed Jan 25 18:48:06 1995 --- xc/programs/Xserver/hw/hp/ngle/nglecursor.h Wed Jan 25 18:48:06 1995 *************** *** 1,4 **** ! /* $XConsortium: nglecursor.h,v 1.1 93/08/08 12:57:15 rws Exp $ */ /************************************************************************* * --- 1,4 ---- ! /* $XConsortium: nglecursor.h,v 1.2 95/01/24 02:07:13 dpw Exp $ */ /************************************************************************* * *************** *** 116,127 **** --- 116,129 ---- ****************************************************************************** */ extern Bool ngleInitSprite(); + extern Bool hyperInitSprite(); extern Bool ngleUninitSprite(); extern void ngleDisableSprite(); extern void ngleChangeScreen(); extern Bool ngleDisplayCursor(); + extern Bool hyperDisplayCursor(); extern void ngleRecolorCursor(); extern Bool ngleSetCursorPosition(); *** - Wed Jan 25 18:48:07 1995 --- xc/programs/Xserver/hw/hp/ngle/nglescreen.h Wed Jan 25 18:48:07 1995 *************** *** 1,4 **** ! /* $XConsortium: nglescreen.h,v 1.1 93/08/08 12:58:00 rws Exp $ */ /************************************************************************* * --- 1,4 ---- ! /* $XConsortium: nglescreen.h,v 1.2 95/01/24 02:10:27 dpw Exp $ */ /************************************************************************* * *************** *** 54,59 **** --- 54,64 ---- Card32 deviceID; /* Is this an Elk or Rattler */ NgleHdwPtr pDregs; /* Pointer to the hardware */ pointer fbaddr; /* Pointer to the framebuffer */ + char *crt_region[CRT_MAX_REGIONS]; /* Other regions + * associated with frame buffer + * that might be mapped in. + * Obtained from GCDESCRIBE. + */ NgleDevRomDataPtr pDevRomData; /* Pointer to the ROM */ Bool isGrayScale; /* GRX (Not color device) */ *************** *** 82,94 **** */ Bool lastDeviceOnThisSgcToClose; /* * Pointers to various functions returned from cfbScreenInit(), * used for wrapper routines. */ Bool (* CreateGC)(); - } NgleScreenPrivRec, *NgleScreenPrivPtr; --- 87,103 ---- */ Bool lastDeviceOnThisSgcToClose; + /* Hyperdrive (and probably other future devices) has configuration bits */ + /* to tell frame buffer depth (8:88 or 8:24) and accelerator present + */ + unsigned Int32 deviceSpecificConfig; + /* * Pointers to various functions returned from cfbScreenInit(), * used for wrapper routines. */ Bool (* CreateGC)(); } NgleScreenPrivRec, *NgleScreenPrivPtr; *************** *** 116,121 **** --- 125,135 ---- #define CURSOR_AT_VBLANK_ALWAYS 1 #define CURSOR_AT_VBLANK_DRIVEROPTION 0 #define CURSOR_AT_VBLANK_NEVER -1 + + /* Server state values used by hyperResetPlanes() */ + #define SERVER_INIT 1 + #define SERVER_EXIT 2 + #define SERVER_RECOVERY 3 #endif /* NGLESCREEN */ *** - Wed Jan 25 18:48:09 1995 --- xc/programs/Xserver/hw/hp/ngle/nglescreen.c Wed Jan 25 18:48:08 1995 *************** *** 1,4 **** ! /* $XConsortium: nglescreen.c,v 1.2 94/05/28 15:45:33 dpw Exp $ */ /************************************************************************* * * (c)Copyright 1992 Hewlett-Packard Co., All Rights Reserved. --- 1,4 ---- ! /* $XConsortium: nglescreen.c,v 1.3 95/01/24 02:15:14 dpw Exp $ */ /************************************************************************* * * (c)Copyright 1992 Hewlett-Packard Co., All Rights Reserved. *************** *** 36,41 **** --- 36,46 ---- #define DEFAULT_CRX_MONITOR_DIAGONAL 19 /* inches */ #define LOWRES_CRX_MONITOR_DIAGONAL 16 /* inches */ + #define HYPERBOWL_MODE_FOR_8_OVER_88_LUT0_NO_TRANSPARENCIES 4 + #define HYPERBOWL_MODE01_8_24_LUT0_TRANSPARENT_LUT1_OPAQUE 8 + #define HYPERBOWL_MODE01_8_24_LUT0_OPAQUE_LUT1_OPAQUE 10 + #define HYPERBOWL_MODE2_8_24 15 + /* Can this graphics device be an ITE console? * Most all NGLE graphics devices can be. * The sole exception at this point (May'91) is the right-head of *************** *** 83,95 **** extern Bool (*ddxScreenInitPointer[])(); extern hpPrivPtr hpPrivates[MAXSCREENS]; Int32 ngleScreenPrivIndex = 0; /* FORWARD (procedures defined below in this file) */ ! static void elkSetupPlanes( ! NgleScreenPrivPtr pScreenPriv); static void rattlerSetupPlanes( NgleScreenPrivPtr pScreenPriv); --- 88,101 ---- extern Bool (*ddxScreenInitPointer[])(); extern hpPrivPtr hpPrivates[MAXSCREENS]; + extern Bool hyperResetPlanes(); Int32 ngleScreenPrivIndex = 0; /* FORWARD (procedures defined below in this file) */ ! static void hyperSetupPlanes( ! NgleScreenPrivPtr pScreenPriv); static void rattlerSetupPlanes( NgleScreenPrivPtr pScreenPriv); *************** *** 98,103 **** --- 104,112 ---- NgleScreenPrivPtr pScreenPriv, Card32 BufferNumber); + static void elkSetupPlanes( + NgleScreenPrivPtr pScreenPriv); + static Bool ngleClearScreen( ScreenPtr pScreen); *************** *** 111,116 **** --- 120,130 ---- static Bool ngleCloseScreen(); + static void nglePolyPaintAttr( + NgleScreenPrivPtr pScreenPriv, + Card32 ctlPlaneReg, + Int32 nBoxes, + BoxPtr pBoxes); /* OWN */ *************** *** 184,190 **** static int calculateDPI( int xsize, int ysize, int diagonal_length) - { static int old_diagonal_length = 0; int dpi = 0; --- 198,203 ---- *************** *** 251,258 **** ******************************************************************************/ static NgleDevRomDataPtr ngleGetDeviceRomData( ! NgleScreenPrivPtr pScreenPriv ! ) { crt_frame_buffer_t gcDescribe; Card32 *pBytePerLongDevDepData;/* data byte == LSB */ --- 264,270 ---- ******************************************************************************/ static NgleDevRomDataPtr ngleGetDeviceRomData( ! NgleScreenPrivPtr pScreenPriv) { crt_frame_buffer_t gcDescribe; Card32 *pBytePerLongDevDepData;/* data byte == LSB */ *************** *** 294,301 **** gcDescribe.crt_region[NGLEDEVDEPROM_CRT_REGION]; /* Tomcat supports several resolutions: 1280x1024, 1024x768, 640x480. ! * This code reads the index into a device dependent ROM array containing ! * the device's currently selected resolution. */ if (pScreenPriv->deviceID == S9000_ID_TOMCAT) { --- 306,313 ---- gcDescribe.crt_region[NGLEDEVDEPROM_CRT_REGION]; /* Tomcat supports several resolutions: 1280x1024, 1024x768, 640x480. ! * This code reads the index into a device dependent ROM array ! * containing the device's currently selected resolution. */ if (pScreenPriv->deviceID == S9000_ID_TOMCAT) { *************** *** 563,568 **** --- 575,581 ---- && (gcDescribe.crt_id != S9000_ID_TOMCAT) /* Dual CRX */ && (gcDescribe.crt_id != S9000_ID_A1439A) /* CRX24 */ && (gcDescribe.crt_id != S9000_ID_ARTIST) /* Artist */ + && (gcDescribe.crt_id != S9000_ID_HCRX) /* Hyperdrive */ ) { ioctl(fildes, GCUNMAP, &mapOrigin); *************** *** 595,608 **** pScreenPriv->devWidth = gcDescribe.crt_total_x; pScreenPriv->screenWidth = gcDescribe.crt_x; pScreenPriv->screenHeight = gcDescribe.crt_y; /* Set the device frame buffer depth. The default depth is set to * 8, but can be changed by setting the depth parameter in the ! * Xnscreens file. Currently, we only support depth 24 on CRX24, * and depth 8 on the remaining displays. */ ! if (pScreenPriv->deviceID == S9000_ID_A1439A) pScreenPriv->devDepth = php->depth; else pScreenPriv->devDepth = 8; --- 608,627 ---- pScreenPriv->devWidth = gcDescribe.crt_total_x; pScreenPriv->screenWidth = gcDescribe.crt_x; pScreenPriv->screenHeight = gcDescribe.crt_y; + + for (i=0; i < CRT_MAX_REGIONS; i++) + { + pScreenPriv->crt_region[i] = gcDescribe.crt_region[i]; + } /* Set the device frame buffer depth. The default depth is set to * 8, but can be changed by setting the depth parameter in the ! * Xnscreens file. Currently, we only support depth 24 on CRX24 & HCRX24, * and depth 8 on the remaining displays. */ ! if ((pScreenPriv->deviceID == S9000_ID_A1439A) || ! (pScreenPriv->deviceID == S9000_ID_HCRX)) pScreenPriv->devDepth = php->depth; else pScreenPriv->devDepth = 8; *************** *** 664,677 **** pScreenPriv->deviceID = S9000_ID_A1659A; break; ! case S9000_ID_ARTIST: /* Artist */ ! pScreenPriv->isGrayScale = FALSE; break; case S9000_ID_A1659A: /* CRX */ ! pScreenPriv->isGrayScale = FALSE; break; case S9000_ID_TIMBER: /* HP9000/710 Graphics */ --- 683,740 ---- pScreenPriv->deviceID = S9000_ID_A1659A; break; ! case S9000_ID_HCRX: /* Hyperdrive */ ! /* Hyperdrive doesn't use STI ROM info so don't bother reading it */ ! pScreenPriv->pDevRomData = NULL; /* #### strange #### */ ! NGLE_LOCK(pScreenPriv); ! { ! CARD32 *sti_rom_address; ! CARD32 temp; ! /* ! * In order to read the Hyperdrive configuration bits, we need to ! * read the STI ROM. But, the STI ROM is not always mapped into ! * the STI ROM space. Sometimes the STI ROM is mapped into the ! * BOOT ROM space. To find the true STI ROM space, we need to ! * look at the crt_region array in the gcDescribe structure. ! * The STI ROM address will either be in entry 0 or entry 1. ! * If entry 0 is mapped into the same space as the control space, ! * then this is the true STI ROM space. If entry 0 is in another ! * space, then entry 1 has the true STI ROM space. The space bits ! * of the address are the upper 6 bits of the address. For example, ! * if the address is 0xf4100000, then the space is 0xf4000000. ! */ ! if (((CARD32) pScreenPriv->pDregs & 0xfc000000) == ! ((CARD32) pScreenPriv->crt_region[0] & 0xfc000000)) ! { ! sti_rom_address = (CARD32 *) pScreenPriv->crt_region[0]; ! } ! else ! { ! sti_rom_address = (CARD32 *) pScreenPriv->crt_region[1]; ! } ! /* ! * Ok, grab the configuration bits from the hardware. These bits ! * come from Dodger and are added to any data read from the STI ROM. ! * When reading the STI ROM, we need to avoid a potential race ! * condition by doing a couple of things. We first need to read ! * some unbuffered register like BIFF status. Next we need to wait ! * for Dodger to go not busy. Then we can safely read the STI ROM. ! */ ! temp = NGLE_READ32(pDregs->reg15.all); ! SETUP_HW(pDregs); ! pScreenPriv->deviceSpecificConfig = *sti_rom_address; ! } ! NGLE_UNLOCK(pScreenPriv); ! ! pScreenPriv->isGrayScale = FALSE; /* No grayscale version */ break; + case S9000_ID_ARTIST: /* Artist */ + case S9000_ID_A1439A: /* CRX24 */ case S9000_ID_A1659A: /* CRX */ ! pScreenPriv->isGrayScale = FALSE; /* No grayscale version */ break; case S9000_ID_TIMBER: /* HP9000/710 Graphics */ *************** *** 731,744 **** pScreenPriv->deviceID = S9000_ID_A1659A; break; - case S9000_ID_A1439A: /* CRX24 */ - pScreenPriv->isGrayScale = FALSE; /* No grayscale version */ - break; - default: FatalError("Undefined device id!\n"); break; ! } /* --- 794,803 ---- pScreenPriv->deviceID = S9000_ID_A1659A; break; default: FatalError("Undefined device id!\n"); break; ! } /* switch (pScreenPriv->deviceID) */ /* *************** *** 827,832 **** --- 886,943 ---- /* ************************************************************************** ** + ** 11. Call pNgleScreenInit->InitMiscConfig to perform + ** device-dependent configuration and initialization + ** that does not change the hardware state. + ** + ** FIRST READ-ONLY ACCESS TO HARDWARE BY SERVER + ** (not counting indirect access via kernel ioctl calls) + ************************************************************************** + */ + if (pScreenPriv->deviceID == S9000_ID_HCRX) + { + Card32 hyperbowl; + Int32 nFreeFifoSlots = 0; + + /* Initialize Hyperbowl registers */ + GET_FIFO_SLOTS(nFreeFifoSlots, 7); + if (IS_24_DEVICE(pScreenPriv)) + { + if (pScreenPriv->devDepth == 24) + hyperbowl = HYPERBOWL_MODE01_8_24_LUT0_TRANSPARENT_LUT1_OPAQUE; + else + hyperbowl = HYPERBOWL_MODE01_8_24_LUT0_OPAQUE_LUT1_OPAQUE; + + /* First write to Hyperbowl must happen twice (bug) */ + NGLE_WRITE32(pDregs->reg40, hyperbowl); + NGLE_WRITE32(pDregs->reg40, hyperbowl); + + NGLE_WRITE32(pDregs->reg39, HYPERBOWL_MODE2_8_24); + + NGLE_WRITE32(pDregs->reg42, 0x014c0148); /* Set lut 0 to be the direct color */ + NGLE_WRITE32(pDregs->reg43, 0x404c4048); + NGLE_WRITE32(pDregs->reg44, 0x034c0348); + NGLE_WRITE32(pDregs->reg45, 0x444c4448); + } + else + { + hyperbowl = HYPERBOWL_MODE_FOR_8_OVER_88_LUT0_NO_TRANSPARENCIES; + + /* First write to Hyperbowl must happen twice (bug) */ + NGLE_WRITE32(pDregs->reg40, hyperbowl); + NGLE_WRITE32(pDregs->reg40, hyperbowl); + + NGLE_WRITE32(pDregs->reg42, 0); + NGLE_WRITE32(pDregs->reg43, 0); + NGLE_WRITE32(pDregs->reg44, 0); + NGLE_WRITE32(pDregs->reg45, 0x444c4048); + } + } + + + /* + ************************************************************************** + ** ** Call CFB routines to begin setting up of screen and ** visual default values. ** *************** *** 925,937 **** pScreen->SaveScreen = ngleSaveScreen; /**** Colormap Procedures: ****/ ! pScreen->CreateColormap = ngleCreateColormap; ! pScreen->DestroyColormap = ngleDestroyColormap; ! pScreen->InstallColormap = ngleInstallColormap; ! pScreen->UninstallColormap = ngleUninstallColormap; ! pScreen->ListInstalledColormaps = ngleListInstalledColormaps; ! pScreen->StoreColors = ngleStoreColors; ! pScreen->ResolveColor = ngleResolvePseudoColor; /* --- 1036,1048 ---- pScreen->SaveScreen = ngleSaveScreen; /**** Colormap Procedures: ****/ ! pScreen->CreateColormap = ngleCreateColormap; ! pScreen->DestroyColormap = ngleDestroyColormap; ! pScreen->InstallColormap = ngleInstallColormap; ! pScreen->UninstallColormap = ngleUninstallColormap; ! pScreen->ListInstalledColormaps = ngleListInstalledColormaps; ! pScreen->StoreColors = ngleStoreColors; ! pScreen->ResolveColor = ngleResolvePseudoColor; /* *************** *** 1018,1033 **** ************************************************************************** */ ! ngleInitSprite(pScreen); /* ************************************************************************** ** ! ** Initialize the image planes. ** ************************************************************************** */ /* On CRX24, ITE has set up overlay planes to be 3-plane * device. Set up overlays to be 8 planes and write all * pixels to transparent. Then set up the framebuffer colormap --- 1129,1160 ---- ************************************************************************** */ ! if (pScreenPriv->deviceID == S9000_ID_HCRX) ! { ! hyperInitSprite(pScreen); ! } ! else ! { ! ngleInitSprite(pScreen); ! } /* ************************************************************************** ** ! ** 20. Call hyperResetPlanes() to initialize the image, ! ** overlay and attribute planes. This includes doing what is ! ** necessary to counteract what the ITE has done ** ************************************************************************** */ + if (pScreenPriv->deviceID == S9000_ID_HCRX) + { + hyperResetPlanes(pScreenPriv, SERVER_INIT); + } + + /* Initialize the non HCRX image planes. */ + /* On CRX24, ITE has set up overlay planes to be 3-plane * device. Set up overlays to be 8 planes and write all * pixels to transparent. Then set up the framebuffer colormap *************** *** 1037,1052 **** * all 8 bits. */ ! if (pScreenPriv->deviceID == S9000_ID_A1439A) { rattlerSetupPlanes(pScreenPriv); } ! else { elkSetupPlanes(pScreenPriv); } ! /* Clear attribute planes on Artist, CRX, CRX24 and GRX devices. */ if ((pScreenPriv->deviceID == S9000_ID_A1659A) || /* CRX or GRX */ (pScreenPriv->deviceID == S9000_ID_A1439A) || /* CRX24 */ --- 1164,1181 ---- * all 8 bits. */ ! else if (pScreenPriv->deviceID == S9000_ID_A1439A) /* CRX24 */ { rattlerSetupPlanes(pScreenPriv); } ! else if ((pScreenPriv->deviceID == S9000_ID_A1659A) || /* CRX or GRX */ ! (pScreenPriv->deviceID == S9000_ID_ARTIST) /* Artist */ ! ) { elkSetupPlanes(pScreenPriv); } ! /* Clear attribute planes on non HCRX devices. */ if ((pScreenPriv->deviceID == S9000_ID_A1659A) || /* CRX or GRX */ (pScreenPriv->deviceID == S9000_ID_A1439A) || /* CRX24 */ *************** *** 1054,1069 **** ) { if (pScreenPriv->devDepth == 24) ! ngleSetupAttrPlanes(pScreenPriv,BUFF1_CMAP3); else /* depth = 8 */ if (pScreenPriv->deviceID == S9000_ID_ARTIST) ! ngleSetupAttrPlanes(pScreenPriv,ARTIST_CMAP0); else ! ngleSetupAttrPlanes(pScreenPriv,BUFF1_CMAP0); ! } - /* ************************************************************************** ** --- 1183,1196 ---- ) { if (pScreenPriv->devDepth == 24) ! ngleSetupAttrPlanes(pScreenPriv, BUFF1_CMAP3); else /* depth = 8 */ if (pScreenPriv->deviceID == S9000_ID_ARTIST) ! ngleSetupAttrPlanes(pScreenPriv, ARTIST_CMAP0); else ! ngleSetupAttrPlanes(pScreenPriv, BUFF1_CMAP0); } /* ************************************************************************** ** *************** *** 1124,1130 **** **********************************************/ SETUP_RAMDAC(pDregs); ! SETUP_FB(pDregs,pScreenPriv->deviceID,pScreenPriv->devDepth); } /* elkSetupPlanes() */ --- 1251,1257 ---- **********************************************/ SETUP_RAMDAC(pDregs); ! SETUP_FB(pDregs, pScreenPriv->deviceID, pScreenPriv->devDepth); } /* elkSetupPlanes() */ *************** *** 1152,1163 **** **********************************************/ CRX24_SETUP_RAMDAC(pDregs); ! ! SETUP_FB(pDregs, CRX24_OVERLAY_PLANES,pScreenPriv->devDepth); for (y=0; y < pScreenPriv->screenHeight; y++) { ! bits = (Card32 *) ((char *)pScreenPriv->fbaddr + y * pScreenPriv->devWidth); x = pScreenPriv->screenWidth >> 2; do { --- 1279,1290 ---- **********************************************/ CRX24_SETUP_RAMDAC(pDregs); ! SETUP_FB(pDregs, CRX24_OVERLAY_PLANES, pScreenPriv->devDepth); for (y=0; y < pScreenPriv->screenHeight; y++) { ! bits = (Card32 *) ((char *)pScreenPriv->fbaddr + y * ! pScreenPriv->devWidth); x = pScreenPriv->screenWidth >> 2; do { *************** *** 1174,1197 **** /****************************************************************************** * * NGLE DDX Utility Procedure: ngleSetupAttrPlanes * ******************************************************************************/ static void ngleSetupAttrPlanes( - NgleScreenPrivPtr pScreenPriv, Card32 BufferNumber) { NgleHdwPtr pDregs = pScreenPriv->pDregs; ! SETUP_ATTR_ACCESS(pDregs,BufferNumber); ! SET_ATTR_SIZE(pDregs,pScreenPriv->screenWidth,pScreenPriv->screenHeight); FINISH_ATTR_ACCESS(pDregs); ! SETUP_FB(pDregs,pScreenPriv->deviceID,pScreenPriv->devDepth); } /* ngleSetupAttrPlanes() */ --- 1301,1376 ---- /****************************************************************************** * + * NGLE DDX Utility Procedure: hyperSetupPlanes + * + ******************************************************************************/ + + static void hyperSetupPlanes( + NgleScreenPrivPtr pScreenPriv) + { + NgleHdwPtr pDregs; + Int32 x, y; + Card32 *bits; + + pDregs = (NgleHdwPtr) pScreenPriv->pDregs; + + /************************************************** + ** Need to clear screen + **************************************************/ + /* + if (IS_24_DEVICE(pScreenPriv)) + ngleDepth24_ClearImagePlanes(pScreenPriv); + else + ngleDepth8_ClearImagePlanes(pScreenPriv); + + */ + /********************************************** + * Write RAMDAC pixel read mask register so all overlay + * planes are display-enabled. (CRX24 uses Bt462 pixel + * read mask register for overlay planes, not image planes). + **********************************************/ + HCRX_SETUP_RAMDAC(pDregs); + + + SETUP_FB(pDregs, S9000_ID_HCRX, pScreenPriv->devDepth); + + for (y=0; y < pScreenPriv->screenHeight; y++) + { + bits = (Card32 *) ((char *)pScreenPriv->fbaddr + y * + pScreenPriv->devWidth); + x = pScreenPriv->screenWidth >> 2; + do + { + *bits++ = 0xffffffff; + } while (x--); + } + + CRX24_SET_OVLY_MASK(pDregs); + SETUP_FB(pDregs,pScreenPriv->deviceID,pScreenPriv->devDepth); + + } /* hyperSetupPlanes() */ + + + + /****************************************************************************** + * * NGLE DDX Utility Procedure: ngleSetupAttrPlanes * ******************************************************************************/ static void ngleSetupAttrPlanes( NgleScreenPrivPtr pScreenPriv, Card32 BufferNumber) { NgleHdwPtr pDregs = pScreenPriv->pDregs; ! SETUP_ATTR_ACCESS(pDregs, BufferNumber); ! SET_ATTR_SIZE(pDregs, pScreenPriv->screenWidth, pScreenPriv->screenHeight); FINISH_ATTR_ACCESS(pDregs); ! SETUP_FB(pDregs, pScreenPriv->deviceID, pScreenPriv->devDepth); } /* ngleSetupAttrPlanes() */ *************** *** 1211,1217 **** ******************************************************************************/ static Bool ngleClearScreen( - ScreenPtr pScreen) { NgleScreenPrivPtr pScreenPriv; --- 1390,1395 ---- *************** *** 1244,1259 **** } } ! /* Clear attribute planes on Artist, CRX, CRX24 and GRX devices. */ if ((pScreenPriv->deviceID == S9000_ID_A1659A) || /* CRX or GRX */ (pScreenPriv->deviceID == S9000_ID_A1439A) || /* CRX24 */ ! (pScreenPriv->deviceID == S9000_ID_ARTIST) /* Artist */ ) { ! ngleSetupAttrPlanes(pScreenPriv,BUFF0_CMAP0); } ! } --- 1422,1438 ---- } } ! /* Clear attribute planes on Hyperdrive, Artist, CRX, CRX24 and GRX devices. */ if ((pScreenPriv->deviceID == S9000_ID_A1659A) || /* CRX or GRX */ (pScreenPriv->deviceID == S9000_ID_A1439A) || /* CRX24 */ ! (pScreenPriv->deviceID == S9000_ID_ARTIST) || /* Artist */ ! (pScreenPriv->deviceID == S9000_ID_HCRX) /* Hyperdrive */ ) { ! ngleSetupAttrPlanes(pScreenPriv, BUFF0_CMAP0); } ! } /* ngleClearScreen() */ *************** *** 1299,1310 **** { ARTIST_DISABLE_DISPLAY(pDregs); } else { /* CRX and like elk */ DISABLE_DISPLAY(pDregs); } } ! else { /* Turn off screen blanking */ /* If the cursor is on this screen, display it. --- 1478,1493 ---- { ARTIST_DISABLE_DISPLAY(pDregs); } + else if (pScreenPriv->deviceID == S9000_ID_HCRX) + { + HYPER_DISABLE_DISPLAY(pDregs); + } else { /* CRX and like elk */ DISABLE_DISPLAY(pDregs); } } ! else /* if (blankOrUnblank == SCREEN_SAVER_OFF) */ { /* Turn off screen blanking */ /* If the cursor is on this screen, display it. *************** *** 1314,1321 **** extern int hpActiveScreen; /* active screen index in x_hil.c */ if (pScreenPriv->myNum == hpActiveScreen) { ! ngleDisplayCursor(pScreenPriv->pScreen, ! pScreenPriv->sprite.pCursor); } /* Enable image display by disabling display of --- 1497,1512 ---- extern int hpActiveScreen; /* active screen index in x_hil.c */ if (pScreenPriv->myNum == hpActiveScreen) { ! if (pScreenPriv->deviceID == S9000_ID_HCRX) ! { ! hyperDisplayCursor(pScreenPriv->pScreen, ! pScreenPriv->sprite.pCursor); ! } ! else ! { ! ngleDisplayCursor(pScreenPriv->pScreen, ! pScreenPriv->sprite.pCursor); ! } } /* Enable image display by disabling display of *************** *** 1329,1334 **** --- 1520,1529 ---- { ARTIST_ENABLE_DISPLAY(pDregs); } + else if (pScreenPriv->deviceID == S9000_ID_HCRX) + { + HYPER_ENABLE_DISPLAY(pDregs); + } else { /* CRX and like elk */ ENABLE_DISPLAY(pDregs); *************** *** 1418,1424 **** if (hpGivingUp) { (*php->CursorOff)(pScreen); ! ngleClearScreen(pScreen); } /* Turn off screen saver (if on) */ --- 1613,1626 ---- if (hpGivingUp) { (*php->CursorOff)(pScreen); ! if (pScreenPriv->deviceID == S9000_ID_HCRX) ! { ! hyperResetPlanes(pScreenPriv, SERVER_EXIT); ! } ! else ! { ! ngleClearScreen(pScreen); ! } } /* Turn off screen saver (if on) */ *************** *** 1436,1443 **** * (which is only head that can be an ITE console on Tomcat). */ #define GCTERM _IOWR('G',20,int) ! if ((hpGivingUp) ! && (!IS_NOT_FIRST_HEAD_ON_THIS_SGC_SLOT(pScreenPriv->dev_sc))) { int garbage=0; ioctl(pScreenPriv->fildes, GCTERM, &garbage); --- 1638,1645 ---- * (which is only head that can be an ITE console on Tomcat). */ #define GCTERM _IOWR('G',20,int) ! if ((hpGivingUp) && ! (!IS_NOT_FIRST_HEAD_ON_THIS_SGC_SLOT(pScreenPriv->dev_sc))) { int garbage=0; ioctl(pScreenPriv->fildes, GCTERM, &garbage); *************** *** 1468,1470 **** --- 1670,2070 ---- return(TRUE); } /* ngleCloseScreen() */ + + + /****************************************************************************** + * + * And now for some new routines to handle HCRX8 and HCRX24 + * + ******************************************************************************/ + + /****************************************************************************** + * + * NGLE DDX Procedure: ngleDepth8_ClearImagePlanes() + * + * Description: + * + * This routine clears the image planes for depth 8 devices. + * + * Assumptions: + * Assumptions fast-locking has been initialized. + * Does not assume a lock is in effect. + * + ******************************************************************************/ + + void ngleDepth8_ClearImagePlanes( + NgleScreenPrivPtr pScreenPriv) + { + NgleHdwPtr pDregs; + NGLE_MFGP_REGISTER_TYPE packedLenXY; + NGLE_MFGP_REGISTER_TYPE packedDstXY; + Int32 nFreeFifoSlots = 0; + + pDregs = (NgleHdwPtr) pScreenPriv->pDregs; + + NGLE_LOCK(pScreenPriv); + + /* Common Hardware setup */ + GET_FIFO_SLOTS(nFreeFifoSlots, 5); + + /* Re-use dstX/Y and transfer data for multiple recfills. */ + NGLE_SET_SCOREBOARD_OVERRIDE(0x30003); + NGLE_SET_TRANSFERDATA(0xffffffff); /* Write foreground color */ + + NGLE_REALLY_SET_IMAGE_FG_COLOR(0); + NGLE_REALLY_SET_IMAGE_PLANEMASK(0xff); + + PACK_2CARD16(packedDstXY, 0, 0); + PACK_2CARD16(packedLenXY, pScreenPriv->screenWidth, + pScreenPriv->screenHeight); + NGLE_SET_DSTXY(NGLE_MFGP_REGISTER_TYPE_ASLONG(packedDstXY)); + + /* Device-specific image buffer clear */ + switch(pScreenPriv->deviceID) + { + case S9000_ID_ARTIST: + /* Write zeroes to buffer */ + GET_FIFO_SLOTS(nFreeFifoSlots, 3); + NGLE_QUICK_SET_IMAGE_BITMAP_OP( + IBOvals(RopSrc, MaskAddrOffset(0), + BitmapExtent08, StaticReg(FALSE), + DataDynamic, MaskOtc, BGx(FALSE), FGx(FALSE))); + NGLE_QUICK_SET_DST_BM_ACCESS( + BA( IndexedDcd, Otc32, OtsIndirect, AddrLong, + BAJustPoint(0), BINapp0I, BAIndexBase(0))); + SET_LENXY_START_RECFILL(packedLenXY); + break; + + case S9000_ID_A1659A: /* ELK_DEVICE_ID */ + /* Write zeroes to buffer 0 */ + GET_FIFO_SLOTS(nFreeFifoSlots, 3); + NGLE_QUICK_SET_IMAGE_BITMAP_OP( + IBOvals(RopSrc, MaskAddrOffset(0), + BitmapExtent08, StaticReg(FALSE), + DataDynamic, MaskOtc, BGx(FALSE), FGx(FALSE))); + NGLE_QUICK_SET_DST_BM_ACCESS( + BA( IndexedDcd, Otc32, OtsIndirect, AddrLong, + BAJustPoint(0), BINapp0I, BAIndexBase(0))); + SET_LENXY_START_RECFILL(packedLenXY); + + /* Write zeroes to buffer 1 */ + GET_FIFO_SLOTS(nFreeFifoSlots, 2); + NGLE_QUICK_SET_DST_BM_ACCESS( + BA( IndexedDcd, Otc32, OtsIndirect, AddrLong, + BAJustPoint(0), BINapp1I, BAIndexBase(0))); + SET_LENXY_START_RECFILL(packedLenXY); + break; + + case S9000_ID_HCRX: + /* Write zeroes to buffer 0 */ + GET_FIFO_SLOTS(nFreeFifoSlots, 3); + NGLE_QUICK_SET_IMAGE_BITMAP_OP(IBOvals(RopSrc, MaskAddrOffset(0), + BitmapExtent08, StaticReg(FALSE), + MaskDynamic, MaskOtc, + BGx(TRUE), FGx(FALSE))); + NGLE_QUICK_SET_DST_BM_ACCESS( + BA( IndexedDcd, Otc32, OtsIndirect, AddrLong, + BAJustPoint(0), BINapp0I, BAIndexBase(0))); + HYPER_SET_LENXY_START_FAST_RECFILL(packedLenXY.all); + + /* Write zeroes to buffer 1 */ + GET_FIFO_SLOTS(nFreeFifoSlots, 2); + NGLE_QUICK_SET_DST_BM_ACCESS( + BA( IndexedDcd, Otc32, OtsIndirect, AddrLong, + BAJustPoint(0), BINapp1I, BAIndexBase(0))); + HYPER_SET_LENXY_START_FAST_RECFILL(packedLenXY.all); + break; + + /* There is no default */ + } /* Device-specific image buffer clear */ + + NGLE_UNLOCK(pScreenPriv); + + } /* ngleDepth8_ClearImagePlanes() */ + + + + /****************************************************************************** + * + * NGLE DDX Utility Procedure: ngleDepth24_ClearImagePlanes + * + * Description: + * + * This routine clears all 24 image planes to zeroes. + * + * Assumptions: + * Assumptions fast-locking has been initialized. + * Does not assume a lock is in effect. + * + ******************************************************************************/ + + void ngleDepth24_ClearImagePlanes( + NgleScreenPrivPtr pScreenPriv) + { + NgleHdwPtr pDregs; + NGLE_MFGP_REGISTER_TYPE packedLenXY; + NGLE_MFGP_REGISTER_TYPE packedDstXY; + Int32 nFreeFifoSlots = 0; + + pDregs = (NgleHdwPtr) pScreenPriv->pDregs; + + NGLE_LOCK(pScreenPriv); + + /* Hardware setup */ + GET_FIFO_SLOTS(nFreeFifoSlots, 8); + NGLE_QUICK_SET_DST_BM_ACCESS( + BA(IndexedDcd, Otc32, OtsIndirect, AddrLong, + BAJustPoint(0), BINapp0F8, BAIndexBase(0))); + NGLE_SET_SCOREBOARD_OVERRIDE(0); + NGLE_SET_TRANSFERDATA(0xffffffff); /* Write foreground color */ + + NGLE_REALLY_SET_IMAGE_FG_COLOR(0); /* load with zero */ + NGLE_REALLY_SET_IMAGE_PLANEMASK(0xffffff); + + PACK_2CARD16(packedDstXY, 0, 0); + PACK_2CARD16(packedLenXY, pScreenPriv->screenWidth, + pScreenPriv->screenHeight); + NGLE_SET_DSTXY(NGLE_MFGP_REGISTER_TYPE_ASLONG(packedDstXY)); + + /* Write zeroes to all 24 planes of image buffer */ + NGLE_QUICK_SET_IMAGE_BITMAP_OP(IBOvals(RopSrc, MaskAddrOffset(0), + BitmapExtent32, StaticReg(FALSE), + DataDynamic, MaskOtc, BGx(FALSE), FGx(FALSE))); + SET_LENXY_START_RECFILL(packedLenXY); + + NGLE_UNLOCK(pScreenPriv); + + } /* ngleDepth24_ClearImagePlanes */ + + + + /****************************************************************************** + * + * NGLE DDX Procedure: ngleClearOverlayPlanes() + * + * Description: + * + * This routine "clears" the overlay planes to the pased in value. + * + * Assumptions: + * Assumptions fast-locking has been initialized. + * Does not assume a lock is in effect. + * + ******************************************************************************/ + + void ngleClearOverlayPlanes( + NgleScreenPrivPtr pScreenPriv, + Card32 planeMask, + Card32 planeData) + { + NgleHdwPtr pDregs; + NGLE_MFGP_REGISTER_TYPE packedLenXY; + NGLE_MFGP_REGISTER_TYPE packedDstXY; + Int32 nFreeFifoSlots = 0; + + pDregs = (NgleHdwPtr) pScreenPriv->pDregs; + + NGLE_LOCK(pScreenPriv); + + /* Hardware setup */ + GET_FIFO_SLOTS(nFreeFifoSlots, 8); + NGLE_QUICK_SET_DST_BM_ACCESS( + BA( IndexedDcd, Otc32, OtsIndirect, AddrLong, + BAJustPoint(0), BINovly, BAIndexBase(0))); + NGLE_SET_SCOREBOARD_OVERRIDE(0); + NGLE_SET_TRANSFERDATA(0xffffffff); /* Write foreground color */ + + NGLE_REALLY_SET_IMAGE_FG_COLOR(planeData); /* fill with input data value */ + NGLE_REALLY_SET_IMAGE_PLANEMASK(planeMask); + + PACK_2CARD16(packedDstXY, 0, 0); + PACK_2CARD16(packedLenXY, pScreenPriv->screenWidth, + pScreenPriv->screenHeight); + NGLE_SET_DSTXY(NGLE_MFGP_REGISTER_TYPE_ASLONG(packedDstXY)); + + /* Write zeroes to overlay planes. */ + NGLE_QUICK_SET_IMAGE_BITMAP_OP( + IBOvals(RopSrc, MaskAddrOffset(0), + BitmapExtent08, StaticReg(FALSE), + DataDynamic, MaskOtc, BGx(FALSE), FGx(FALSE))); + SET_LENXY_START_RECFILL(packedLenXY); + + NGLE_UNLOCK(pScreenPriv); + + } /* ngleClearOverlayPlanes() */ + + + + /****************************************************************************** + * + * NGLE DDX Procedure: ngleResetAttrPlanes() + * + * Description: + * + * This routine resets the attribute planes to an initial state. + * + * Assumptions: + * Assumptions fast-locking has been initialized. + * Does not assume a lock is in effect. + * + ******************************************************************************/ + + void ngleResetAttrPlanes( + NgleScreenPrivPtr pScreenPriv, + Card32 controlPlaneReg) + { + BoxRec box; + + + box.x1 = 0; + box.y1 = 0; + box.x2 = pScreenPriv->screenWidth; + box.y2 = pScreenPriv->screenHeight; + nglePolyPaintAttr(pScreenPriv, controlPlaneReg, 1, &box); + + } /* ngleResetAttrPlanes() */ + + + + /****************************************************************************** + * + * NGLE DDX Procedure: nglePolyPaintAttr() + * + * Description: + * + * This routine is called by other NGLE DDX driver routines to perform + * a series of solid color, rectangle fills of the attribute plane(s). + * + * Useful comments about attribute painting: + * + * The Control Plane Register (CPR) is the equivalent of + * foreground and background pixel registers for the attribute + * planes. + * + * The most significant byte (CFC: Control Foreground Color) + * determines what's written if the foreground color is written + * to the attribute planes. + * + * The next most significant byte (CBC: Control Background + * Color) determines what's written if a zero is written. + * + * The third byte (CPM: Control Plane Mask Byte) indicates + * which group of planes is active. + * + * Control Bitmap Operation (CBO) determines whether foreground + * or background color is transparent or opaque. Here, we + * choose opaque for foreground and background (the latter is a + * don't-care). + * + * The ctlPlaneReg parameter which is passed into this routine + * represents the value to be loaded into the CPR. The CPR + * value is device specific, as each device has its own + * particular mapping of bits in the CPR fields to the devices + * attribute planes. But, the CPR register appears at the same + * address in each of the devices control register space. + * Therefore, each device can use this common routine to paint + * attribute planes. + * + ******************************************************************************/ + + static void nglePolyPaintAttr( + NgleScreenPrivPtr pScreenPriv, + Card32 ctlPlaneReg, + Int32 nBoxes, + BoxPtr pBoxes) + { + Int32 nFreeFifoSlots = 0; + /*## For now, treat as 32-bit integers so that we don't have to unpack: ##*/ + /*## Int16 *pBox;##*/ + Int32 *pBox; + NgleHdwPtr pDregs; + NGLE_MFGP_REGISTER_TYPE packedDstXY; + NGLE_MFGP_REGISTER_TYPE packedLenXY; + + + /* Return early if there's nothing to do: */ + if (nBoxes <= 0) + return; + + pDregs = pScreenPriv->pDregs; + NGLE_LOCK(pScreenPriv); + + + /* + ************************************************************************** + ** + ** Paint the Boxes in the Attribute Planes: + ** + ************************************************************************** + */ + + GET_FIFO_SLOTS(nFreeFifoSlots, 4); + NGLE_QUICK_SET_DST_BM_ACCESS(BA(IndexedDcd, Otc32, OtsIndirect, + AddrLong, BAJustPoint(0), + BINattr, BAIndexBase(0))); + NGLE_QUICK_SET_CTL_PLN_REG(ctlPlaneReg); + NGLE_SET_TRANSFERDATA(0xffffffff); + + /* Loop on boxes: */ + pBox = (Int32 *) pBoxes; + NGLE_QUICK_SET_IMAGE_BITMAP_OP(IBOvals(RopSrc, MaskAddrOffset(0), + BitmapExtent08, StaticReg(TRUE), + DataDynamic, MaskOtc, + BGx(TRUE), FGx(FALSE))); + do + { + packedDstXY.all = *pBox++; + packedLenXY.all = (*pBox++) - packedDstXY.all; + GET_FIFO_SLOTS(nFreeFifoSlots, 2); + NGLE_SET_DSTXY(NGLE_MFGP_REGISTER_TYPE_ASLONG(packedDstXY)); + SET_LENXY_START_RECFILL(packedLenXY); + } while (--nBoxes > 0); + + + /* + ************************************************************************** + ** + ** In order to work around an ELK hardware problem (Buffy doesn't + ** always flush it's buffers when writing to the attribute + ** planes), at least 4 pixels must be written to the attribute + ** planes starting at (X == 1280) and (Y != to the last Y written + ** by BIF): + ** + ************************************************************************** + */ + + if (pScreenPriv->deviceID == S9000_ID_A1659A) /* ELK_DEVICE_ID */ + { + /*## NOTE: This may cause problems on a 2K-wide device: ##*/ + if (packedLenXY.xy.y > 0) + { + /* It's safe to use scanline zero: */ + PACK_2CARD16(packedDstXY, 1280, 0); + } + else + { + /* Must generate a safe scanline: */ + if (packedDstXY.xy.y > 0) + { + PACK_2CARD16(packedDstXY, 1280, 0); + } + else + { + PACK_2CARD16(packedDstXY, 1280, 1); + } + } + + GET_FIFO_SLOTS(nFreeFifoSlots, 2); + NGLE_SET_DSTXY(NGLE_MFGP_REGISTER_TYPE_ASLONG(packedDstXY)); + PACK_2CARD16(packedLenXY, 4, 1); + SET_LENXY_START_RECFILL(packedLenXY); + } /* ELK Hardware Kludge */ + + + /**** Finally, set the Control Plane Register back to zero: ****/ + GET_FIFO_SLOTS(nFreeFifoSlots, 1); + NGLE_QUICK_SET_CTL_PLN_REG(0); + + NGLE_UNLOCK(pScreenPriv); + + } /* nglePolyPaintAttr() */ *** - Wed Jan 25 18:48:12 1995 --- xc/programs/Xserver/hw/hp/input/Imakefile Wed Jan 25 18:48:11 1995 *************** *** 1,77 **** ! XCOMM $XConsortium: Imakefile,v 1.5 94/05/28 15:50:16 dpw Exp $ #include #define IHaveSubdirs SUBDIRS=drivers - #if defined(HPArchitecture) || defined(HPOSFArchitecture) - SRCS1 = \ hpKeyMap.c \ x_hil.c \ x_hilinit.c \ - beeper.c \ - x_threebut.c \ xtest1imp.c \ getkeysym.c - #if defined(__hp9000s800) SRCS2 = \ cr16.s \ get_tv.c - #endif /* __hp9000s800 */ NONHILOBJS = \ hpKeyMap.o \ - x_threebut.o \ xtest1imp.o \ getkeysym.o - #if defined(__hp9000s800) NONHILOBJS2 = \ cr16.o \ get_tv.o - #endif /* __hp9000s800 */ - - #else - - SRCS1 = \ - hpKeyMap.c \ - x_hil.c \ - x_hilinit.c \ - beeper.c \ - x_threebut.c \ - xtest1imp.c \ - getkeysym.c - - NONHILOBJS = \ - hpKeyMap.o \ - x_threebut.o \ - xtest1imp.o \ - getkeysym.o - - #endif /* HPArchitecture */ SRCS = $(SRCS1) $(SRCS2) HILOBJS = \ x_hil.o \ ! x_hilinit.o \ ! beeper.o ! ! #ifdef __hp9000s700 ! HILOBJS800 = \ ! x_hil800.o \ ! x_hilinit800.o \ ! beeper800.o ! OBJS800 = $(NONHILOBJS) $(HILOBJS800) ! #endif OBJS = $(NONHILOBJS) $(NONHILOBJS2) $(HILOBJS) --- 1,40 ---- ! XCOMM $XConsortium: Imakefile,v 1.6 95/01/24 02:41:07 dpw Exp $ #include #define IHaveSubdirs SUBDIRS=drivers SRCS1 = \ hpKeyMap.c \ x_hil.c \ x_hilinit.c \ xtest1imp.c \ getkeysym.c SRCS2 = \ cr16.s \ get_tv.c NONHILOBJS = \ hpKeyMap.o \ xtest1imp.o \ getkeysym.o NONHILOBJS2 = \ cr16.o \ get_tv.o SRCS = $(SRCS1) $(SRCS2) HILOBJS = \ x_hil.o \ ! x_hilinit.o OBJS = $(NONHILOBJS) $(NONHILOBJS2) $(HILOBJS) *************** *** 79,86 **** hpKeyMap.ln \ x_hil.ln \ x_hilinit.ln \ - beeper.ln \ - x_threebut.ln \ xtest1imp.ln \ getkeysym.ln --- 42,47 ---- *************** *** 99,114 **** NormalLibraryObjectRule() NormalLibraryTarget(hp,$(OBJS)) - #ifdef __hp9000s700 - /* 800 mu server only .o's */ - ObjectFromSpecialSource(beeper800,beeper,-U__hp9000s700) - ObjectFromSpecialSource(x_hil800,x_hil,-U__hp9000s700) - ObjectFromSpecialSource(x_hilinit800,x_hilinit,-U__hp9000s700) - - NormalLibraryTarget(hp800,$(OBJS800)) - #endif - SpecialCObjectRule(x_hilinit,$(ICONFIGFILES),$(LIB_DEFINES)) SpecialCObjectRule(getkeysym,$(ICONFIGFILES),$(LIB_DEFINES)) DependTarget() --- 60,67 ---- NormalLibraryObjectRule() NormalLibraryTarget(hp,$(OBJS)) SpecialCObjectRule(x_hilinit,$(ICONFIGFILES),$(LIB_DEFINES)) + SpecialCObjectRule(x_hil,$(ICONFIGFILES),$(LIB_DEFINES)) SpecialCObjectRule(getkeysym,$(ICONFIGFILES),$(LIB_DEFINES)) DependTarget() *** - Wed Jan 25 18:48:13 1995 --- xc/programs/Xserver/hw/hp/input/hildef.h Wed Jan 25 18:48:12 1995 *************** *** 1,9 **** #ifndef HILDEF_H #define HILDEF_H ! /* $XConsortium: hildef.h,v 8.34 94/04/17 20:30:12 rws Exp $ */ /* ! Copyright (c) 1986, 1987 X Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the --- 1,9 ---- #ifndef HILDEF_H #define HILDEF_H ! /* $XConsortium: hildef.h,v 8.36 95/01/24 21:13:11 gildea Exp $ */ /* ! Copyright (c) 1988 X Consortium Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the *************** *** 30,52 **** from the X Consortium. ! Copyright (c) 1986, 1987 by Hewlett-Packard Company ! Permission to use, copy, modify, and distribute this ! software and its documentation for any purpose and without ! fee is hereby granted, provided that the above copyright ! notice appear in all copies and that both that copyright ! notice and this permission notice appear in supporting ! documentation, and that the name of Hewlett-Packard not be used in ! advertising or publicity pertaining to distribution of the ! software without specific, written prior permission. HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD ! TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ! PURPOSE. Hewlett-Packard shall not be liable for errors ! contained herein or direct, indirect, special, incidental or ! consequential damages in connection with the furnishing, performance, or use of this material. This software is not subject to any license of the American --- 30,52 ---- from the X Consortium. ! Copyright (c) 1988 by Hewlett-Packard Company ! Permission to use, copy, modify, and distribute this software ! and its documentation for any purpose and without fee is hereby ! granted, provided that the above copyright notice appear in all ! copies and that both that copyright notice and this permission ! notice appear in supporting documentation, and that the name of ! Hewlett-Packard not be used in advertising or publicity ! pertaining to distribution of the software without specific, written ! prior permission. HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD ! TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ! PURPOSE. Hewlett-Packard shall not be liable for errors ! contained herein or direct, indirect, special, incidental or ! consequential damages in connection with the furnishing, performance, or use of this material. This software is not subject to any license of the American *************** *** 54,60 **** University of California. */ - /* ** File: hildefs.h ** --- 54,59 ---- *************** *** 62,67 **** --- 61,67 ---- ** */ + #include "x_serialdrv.h" #include "sys/param.h" #include "X.h" #include "scrnintstr.h" *************** *** 72,77 **** --- 72,78 ---- /* KEEP THE FOLLOWING IN SYNC WITH THE DIX DEFINITION */ /***************************************************************/ + #define MAXNAMLEN 255 #define READ_SIZ 2000 /* leave room for partial packets*/ #define BUF_SIZ 2048 /* size of static buffer to use */ *************** *** 132,196 **** #define NLOCK 3 #define CAPSCODE 0x37 #define KBSIZE 32 /* bytes to hold 256 bits (1 per key/button */ ! #define LedOn(dev, d,cd,data) \ ! (dev->key->modifierMap[cd] & d->led[0] ? ioctl(d->file_ds,LedCmd[0].on,data) : \ ! dev->key->modifierMap[cd] & d->led[1] ? ioctl(d->file_ds,LedCmd[1].on,data) : \ ! dev->key->modifierMap[cd] & d->led[2] ? ioctl(d->file_ds,LedCmd[2].on,data) : \ ! ioctl(d->file_ds, LedCmd[3].on, data)) ! #define LedOff(dev, d,cd,data) \ ! (dev->key->modifierMap[cd] & d->led[0] ? ioctl(d->file_ds,LedCmd[0].off,data): \ ! dev->key->modifierMap[cd] & d->led[1] ? ioctl(d->file_ds,LedCmd[1].off,data): \ ! dev->key->modifierMap[cd] & d->led[2] ? ioctl(d->file_ds,LedCmd[2].off,data): \ ! ioctl(d->file_ds, LedCmd[3].off, data)) ! #define LatchKey(d,code) (d->kb_latched[code>>3] |= (1<<(code & 7))) ! #define LatchButton(d,code) (LatchKey(d,code)) ! #define UnlatchKey(d,code) (d->kb_latched[code>>3] &= ~(1<<(code & 7))) ! #define UnlatchButton(d,code) (UnlatchKey(d,code)) ! #define DeviceHasLeds(d) (d->hil_header.iob & HILIOB_NPA) #define KeyHasLed(dev,d,cd) ((dev->key->modifierMap[cd] & d->led[0]) || \ (dev->key->modifierMap[cd] & d->led[1]) || \ (dev->key->modifierMap[cd] & d->led[2]) || \ (dev->key->modifierMap[cd] & d->led[3])) ! #define KeyIsLatched(d,code) (d->kb_latched[code>>3] & (1<<(code & 7))) #define KeyIsIgnored(d,code) (d->kb_ignore[code>>3] & (1<<(code & 7))) #define IgnoreKey(d,code) (d->kb_ignore[code>>3] |= (1<<(code & 7))) #define UnignoreKey(d,code) (d->kb_ignore[code>>3] &= ~(1<<(code & 7))) - #define ButtonIsLatched(d,code) (KeyIsLatched(d,code)) - #define ButtonIsIgnored(d,code) (KeyIsIgnored(d,code)) - #define IgnoreButton(d,code) (IgnoreKey(d,code)) - #define UnignoreButton(d,code) (UnignoreKey(d,code)) #define KeyDownEvent(ev) (ev->u.u.type==KeyPress | ev->u.u.type==DeviceKeyPress) #define ButtonDownEvent(ev) (ev->u.u.type==ButtonPress | \ ev->u.u.type==DeviceButtonPress) #define KeyUpEvent(ev) (ev->u.u.type==KeyRelease | \ ev->u.u.type==DeviceKeyRelease) ! #define IsLockKey(dev,code) (dev->key->modifierMap[code] & LockMask) #define KeyIsDown(dev, code) (dev->key && \ (dev->key->down[code >> 3] & (1 << (code & 7)))) #define KeyIsRepeating(dev, code) (dev->kbdfeed && \ (dev->kbdfeed->ctrl.autoRepeats[code >> 3] & (1 << (code & 7)))) - struct hil_desc_record { - int resx; /* x-axis counts / meter */ - int resy; /* x-axis counts / meter */ - int size_x; /* maximum x value */ - int size_y; /* maximum y value */ - char *keymap_name; /* name of keymap */ - u_char flags; /* device characteristics */ - u_char ax_num; /* number of axes */ - u_short min_kcode; /* minimum keycode */ - u_short max_kcode; /* maximum keycode */ - u_char id; /* device HIL id */ - u_char iob; /* I/O descriptor Byte */ - u_char p_button_count; /* count of physical buttons */ - u_char v_button_count; /* count of virtual buttons */ - u_char num_keys; /* number of keys */ - u_char num_leds; /* number of leds */ - } ; - typedef struct _DeviceClients *DeviceClientsPtr; typedef struct _DeviceClients { --- 133,182 ---- #define NLOCK 3 #define CAPSCODE 0x37 #define KBSIZE 32 /* bytes to hold 256 bits (1 per key/button */ ! #define ExpectUpKey(d,code) (d->kb_exp_up[code>>3] |= (1<<(code & 7))) ! #define DontExpectUpKey(d,code) (d->kb_exp_up[code>>3] &= ~(1<<(code & 7))) ! #define DeviceHasLeds(d) (d->iob & HILIOB_NPA) #define KeyHasLed(dev,d,cd) ((dev->key->modifierMap[cd] & d->led[0]) || \ (dev->key->modifierMap[cd] & d->led[1]) || \ (dev->key->modifierMap[cd] & d->led[2]) || \ (dev->key->modifierMap[cd] & d->led[3])) ! #define UpIsExpected(d,code) (d->kb_exp_up[code>>3] & (1<<(code & 7))) #define KeyIsIgnored(d,code) (d->kb_ignore[code>>3] & (1<<(code & 7))) #define IgnoreKey(d,code) (d->kb_ignore[code>>3] |= (1<<(code & 7))) #define UnignoreKey(d,code) (d->kb_ignore[code>>3] &= ~(1<<(code & 7))) #define KeyDownEvent(ev) (ev->u.u.type==KeyPress | ev->u.u.type==DeviceKeyPress) #define ButtonDownEvent(ev) (ev->u.u.type==ButtonPress | \ ev->u.u.type==DeviceButtonPress) #define KeyUpEvent(ev) (ev->u.u.type==KeyRelease | \ ev->u.u.type==DeviceKeyRelease) ! ! #define ITF_KATAKANA 0xdd ! #define ITF_JAPANESE 0xc2 ! #define PS2_HIL_JIS 0xc1 ! #define PS2_DIN_JIS "PS2_DIN_JIS" ! #define IsLockKey(dev,code) (dev->key->modifierMap[code] & LockMask ? \ ! LockMapIndex : 0) ! #define IsMod2Key(dev,code) (dev->key->modifierMap[code] & Mod2Mask ? \ ! Mod2MapIndex : 0) ! #define IsJapaneseEnv(pHP) (pHP->id == ITF_KATAKANA || \ ! pHP->id == ITF_JAPANESE || \ ! pHP->id == PS2_HIL_JIS || \ ! !strcmp(pHP->d.keymap_name, PS2_DIN_JIS)) ! ! #define IsToggleKey(dev,pHP,code) (IsLockKey(dev,code)) ! ! /* This is the Kana Lock solution that APPO initially wanted. ! #define IsToggleKey(dev,pHP,code) (IsLockKey(dev,code) || \ ! (IsJapaneseEnv(pHP) && IsMod2Key(dev,code))) ! */ #define KeyIsDown(dev, code) (dev->key && \ (dev->key->down[code >> 3] & (1 << (code & 7)))) #define KeyIsRepeating(dev, code) (dev->kbdfeed && \ (dev->kbdfeed->ctrl.autoRepeats[code >> 3] & (1 << (code & 7)))) typedef struct _DeviceClients *DeviceClientsPtr; typedef struct _DeviceClients { *************** *** 202,214 **** } DeviceClients; typedef struct _indevices { ! struct hil_desc_record hil_header; /* HIL hdr */ float scaleX; /* Tablet scaling */ float scaleY; /* Tablet scaling */ - int file_ds; /* file descriptor */ DeviceClientsPtr clients; /* clients using device */ ScreenPtr pScreen; /* Screen pointer is on */ - int repeat_rate; /* keyboard repeat rate */ int coords[MAX_AXES];/* current coords of device */ Atom x_atom; /* atom for x type */ u_int button_state; /* device button state */ --- 188,199 ---- } DeviceClients; typedef struct _indevices { ! u_char id; /* device HIL id */ ! u_char iob; /* I/O descriptor Byte */ float scaleX; /* Tablet scaling */ float scaleY; /* Tablet scaling */ DeviceClientsPtr clients; /* clients using device */ ScreenPtr pScreen; /* Screen pointer is on */ int coords[MAX_AXES];/* current coords of device */ Atom x_atom; /* atom for x type */ u_int button_state; /* device button state */ *************** *** 223,244 **** u_char ignoremask; /* for button emulation */ u_char savebutton; /* saved button */ char x_type; /* MOUSE or KEYBOARD */ - u_char dev_id; /* device X id */ u_char mode; /* abs or rel movement */ ! u_char sndx; /* index of serialproc entry */ ! u_char pad1; /* reserved */ u_char pad2; /* reserved */ - char open_cnt; /* # clients accessing device */ - char dev_name[MAX_X_NAMELEN]; - char x_name[MAX_X_NAMELEN]; - u_char bell1[4]; /* arrays for the s300 beeper params */ - u_char bell2[4]; - u_char bell3[4]; u_char hpflags; /* hp-specific feature flags */ u_char led[NLOCK+1]; ! u_char kb_latched[KBSIZE]; u_char kb_ignore[KBSIZE]; } HPInputDevice; struct dev_info { unsigned int timestamp; --- 208,228 ---- u_char ignoremask; /* for button emulation */ u_char savebutton; /* saved button */ char x_type; /* MOUSE or KEYBOARD */ u_char mode; /* abs or rel movement */ ! u_char use; /* device use */ u_char pad2; /* reserved */ u_char hpflags; /* hp-specific feature flags */ u_char led[NLOCK+1]; ! u_char kb_exp_up[KBSIZE]; u_char kb_ignore[KBSIZE]; + char entry[MAX_NM]; + char driver_name[MAX_NM]; /* filled in by X server */ + int *dpmotionBuf; + int *dheadmotionBuf; + HPInputDeviceHeader d; + SerialProcs s; } HPInputDevice; + struct dev_info { unsigned int timestamp; *** - Wed Jan 25 18:48:14 1995 --- xc/programs/Xserver/hw/hp/input/getkeysym.c Wed Jan 25 18:48:14 1995 *************** *** 1,4 **** ! /* $XConsortium: getkeysym.c,v 1.6 94/05/28 15:50:21 dpw Exp $ */ /* Copyright (c) 1986, 1987 by Hewlett-Packard Company --- 1,4 ---- ! /* $XConsortium: getkeysym.c,v 1.7 95/01/24 02:45:23 dpw Exp $ */ /* Copyright (c) 1986, 1987 by Hewlett-Packard Company *************** *** 33,38 **** --- 33,39 ---- #define LIBDIR "/usr/lib/X11" #endif #endif + #include #include *************** *** 196,205 **** if (name[0] != '/') { ! sprintf(filename, "%s/%s",LIBDIR,name); } ! else ! strcpy(filename, name); if (NULL == (keysym_file = fopen(filename,"r"))) return False; --- 197,205 ---- if (name[0] != '/') { ! sprintf(filename, "%s/%s",LIBDIR,name); } ! else strcpy(filename, name); if (NULL == (keysym_file = fopen(filename,"r"))) return False; *** - Wed Jan 25 18:48:16 1995 --- xc/programs/Xserver/hw/hp/input/hpKeyMap.c Wed Jan 25 18:48:16 1995 *************** *** 1,4 **** ! /* $XConsortium: hpKeyMap.c,v 1.2 94/04/17 20:30:13 rws