1 /* 2 * Copyright 1992 by Kevin E. Martin, Chapel Hill, North Carolina. 3 * 4 * Permission to use, copy, modify, distribute, and sell this software and its 5 * documentation for any purpose is hereby granted without fee, provided that 6 * the above copyright notice appear in all copies and that both that 7 * copyright notice and this permission notice appear in supporting 8 * documentation, and that the name of Kevin E. Martin not be used in 9 * advertising or publicity pertaining to distribution of the software without 10 * specific, written prior permission. Kevin E. Martin makes no 11 * representations about the suitability of this software for any purpose. 12 * It is provided "as is" without express or implied warranty. 13 * 14 * KEVIN E. MARTIN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO 16 * EVENT SHALL KEVIN E. MARTIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR 17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 20 * PERFORMANCE OF THIS SOFTWARE. 21 * 22 */ 23 24 /* 25 * Modified by Amancio Hasty and Jon Tombs 26 * 27 * Id: s3.h,v 2.2 1993/06/22 20:54:09 jon Exp jon 28 */ 29 30 /* $XFree86: mit/server/ddx/x386/accel/s3/s3.h,v 2.22 1993/09/29 11:10:56 dawes Exp $ */ 31 32 #ifndef S3_H 33 #define S3_H 34 35 #define S3_PATCHLEVEL "0" 36 37 #ifndef LINKKIT 38 #include "s3name.h" 39 40 #include "X.h" 41 #include "Xmd.h" 42 #include "input.h" 43 #include "scrnintstr.h" 44 #include "mipointer.h" 45 #include "cursorstr.h" 46 #include "compiler.h" 47 #include "misc.h" 48 #include "x386.h" 49 #include "regionstr.h" 50 #include "xf86_OSlib.h" 51 #include "x386Procs.h" 52 53 #include "s3Cursor.h" 54 55 #include <X11/Xfuncproto.h> 56 57 #if defined(S3_MMIO) && (defined(__STDC__) || defined(__GNUC__)) 58 # define S3_OUTW(p,n) *(volatile unsigned short *)(vgaBase+(p)) = \ 59 (unsigned short)(n) 60 #else 61 # define S3_OUTW(p,n) outw(p, n) 62 #endif 63 64 #else /* !LINKKIT */ 65 #include "X.h" 66 #include "input.h" 67 #include "misc.h" 68 #include "x386.h" 69 #include "xf86_OSlib.h" 70 #endif /* !LINKKIT */ 71 72 #if !defined(__GNUC__) || defined(NO_INLINE) 73 #define __inline__ /**/ 74 #endif 75 76 typedef struct { 77 Bool (*ChipProbe)(); 78 char *(*ChipIdent)(); 79 void (*ChipEnterLeaveVT)(); 80 Bool (*ChipInitialize)(); 81 void (*ChipAdjustFrame)(); 82 Bool (*ChipSwitchMode)(); 83 } s3VideoChipRec, *s3VideoChipPtr; 84 85 extern ScrnInfoRec s3InfoRec; 86 87 #ifndef LINKKIT 88 _XFUNCPROTOBEGIN 89 90 extern void s3WarpCursor(); 91 extern void s3RestoreCursor(); 92 extern void s3QueryBestSize(); 93 extern void (*s3ImageReadFunc)(); 94 extern void (*s3ImageWriteFunc)(); 95 extern void (*s3ImageFillFunc)(); 96 extern Bool s3ScreenInit(); 97 extern void vgaGetClocks(); 98 extern Bool s3CursorInit(); 99 extern Bool s3Probe(); 100 extern Bool s3Initialize(); 101 extern void s3EnterLeaveVT(); 102 extern void s3Dline(); 103 extern void s3Dsegment(); 104 extern Bool s3SaveScreen(); 105 extern Bool s3CloseScreen(); 106 extern void s3RestoreDACvalues(); 107 extern int s3GetInstalledColormaps(); 108 extern int s3ListInstalledColormaps(); 109 extern void s3StoreColors(); 110 extern void s3InstallColormap(); 111 extern void s3UninstallColormap(); 112 extern void s3RestoreColor0(); 113 extern void s3AdjustFrame( 114 #if NeedFunctionPrototypes 115 int x, int y 116 #endif 117 ); 118 extern Bool s3SwitchMode( 119 #if NeedFunctionPrototypes 120 DisplayModePtr mode 121 #endif 122 ); 123 extern Bool s3RealizeFont(); 124 extern Bool s3UnrealizeFont(); 125 extern Bool s3Init( 126 #if NeedFunctionPrototypes 127 DisplayModePtr mode 128 #endif 129 ); 130 extern void InitEnvironment( 131 #if NeedFunctionPrototypes 132 void 133 #endif 134 ); 135 extern void s3CleanUp( 136 #if NeedFunctionPrototypes 137 void 138 #endif 139 ); 140 extern void *s3Save(); 141 extern void s3Unlock(); 142 extern void s3Restore(); 143 144 extern void s3ImageStipple(); 145 extern void s3ImageOpStipple( 146 #if NeedFunctionPrototypes 147 int, int, int, int, unsigned char *, int, int, 148 int, int, int, int, int, short, short 149 #endif 150 ); 151 152 extern int s3PcachOverflow(); 153 extern void s3CacheInit(); 154 extern void s3FontCache8Init(); 155 extern void s3ImageInit(); 156 157 extern int s3CacheTile(); 158 extern int s3CacheStipple(); 159 extern int s3CacheOpStipple(); 160 extern int s3CImageText8(); 161 extern void s3CImageFill(); 162 extern void s3CImageStipple(); 163 extern void s3CImageOpStipple(); 164 extern void s3CacheFreeSlot(); 165 166 167 extern int s3CPolyText8(); 168 extern void s3UnCacheFont8(); 169 extern void s3BitCache8Init(); 170 171 extern void s3PolyPoint(); 172 extern void s3Line(); 173 extern void s3Segment(); 174 175 extern void s3SetSpans(); 176 extern void s3GetSpans(); 177 178 extern void s3SolidFSpans(); 179 extern void s3TiledFSpans(); 180 extern void s3StipFSpans(); 181 extern void s3OStipFSpans(); 182 183 extern void s3PolyFillRect(); 184 185 extern int s3PolyText8(); 186 extern void s3ImageText8(); 187 extern int s3PolyText16(); 188 extern void s3ImageText16(); 189 190 extern void s3FindOrdering(); 191 extern RegionPtr s3CopyArea(); 192 extern RegionPtr s3CopyPlane(); 193 extern void s3CopyWindow(); 194 extern void s3GetImage(); 195 196 extern void s3SaveAreas(); 197 extern void s3RestoreAreas(); 198 199 extern Bool s3CreateGC(); 200 201 extern int s3DisplayWidth; 202 extern int s3ScissB; 203 extern short s3alu[]; 204 extern pointer s3VideoMem; 205 extern pointer vgaBase; 206 extern ScreenPtr s3savepScreen; 207 208 /* also needed in s3 somebody fix these headers please */ 209 extern Bool mfbRegisterCopyPlaneProc(); 210 extern int cfbReduceRasterOp(); 211 extern int miFindMaxBand(); 212 extern int miClipSpans(); 213 extern void DoChangeGC(); 214 extern void QueryGlyphExtents(); 215 extern int cfbExpandDirectColors(); 216 extern int QueryColors(); 217 extern int miScreenInit(); 218 extern int mfbClipLine(); 219 extern int miPolyText8(); 220 extern int miPolyText16(); 221 222 extern int vgaCRIndex; 223 extern int vgaCRReg; 224 225 extern int s3ValidTokens[]; 226 _XFUNCPROTOEND 227 228 #endif /* !LINKKIT */ 229 #endif /* S3_H */ 230 231