Prereq: 2.0 diff -c mit/server/ddx/x386/x386Version.h:2.44 mit/server/ddx/x386/x386Version.h:2.64 *** mit/server/ddx/x386/x386Version.h:2.44 Fri Mar 11 23:35:51 1994 --- mit/server/ddx/x386/x386Version.h Fri Mar 11 23:35:51 1994 *************** *** 1,3 **** ! /* $XFree86: mit/server/ddx/x386/x386Version.h,v 2.44 1993/10/18 12:16:19 dawes Exp $ */ ! #define X386_VERSION " 2.0 " --- 1,3 ---- ! /* $XFree86: mit/server/ddx/x386/x386Version.h,v 2.64 1994/03/08 04:46:31 dawes Exp $ */ ! #define X386_VERSION " 2.1 " diff -c mit/server/ddx/cfb/cfbrrop.h:1.1.1.1 mit/server/ddx/cfb/cfbrrop.h:2.0 *** mit/server/ddx/cfb/cfbrrop.h:1.1.1.1 Fri Mar 11 23:35:07 1994 --- mit/server/ddx/cfb/cfbrrop.h Fri Mar 11 23:35:07 1994 *************** *** 1,4 **** --- 1,5 ---- /* + * $XFree86: mit/server/ddx/cfb/cfbrrop.h,v 2.0 1993/12/10 14:33:58 dawes Exp $ * $XConsortium: cfbrrop.h,v 1.6 91/04/10 11:42:06 keith Exp $ * * Copyright 1989 Massachusetts Institute of Technology *************** *** 128,134 **** } #endif ! #if __STDC__ && !defined(UNIXCPP) #define RROP_NAME_CAT(prefix,suffix) prefix##suffix #else #define RROP_NAME_CAT(prefix,suffix) prefix/**/suffix --- 129,135 ---- } #endif ! #if (__STDC__ && !defined(UNIXCPP)) || (defined (SOLX86) && defined (__STDC__) && !defined (__GNUC__)) #define RROP_NAME_CAT(prefix,suffix) prefix##suffix #else #define RROP_NAME_CAT(prefix,suffix) prefix/**/suffix diff -c mit/server/ddx/mfb/maskbits.h:1.6 mit/server/ddx/mfb/maskbits.h:2.0 *** mit/server/ddx/mfb/maskbits.h:1.6 Fri Mar 11 23:35:12 1994 --- mit/server/ddx/mfb/maskbits.h Fri Mar 11 23:35:13 1994 *************** *** 22,28 **** SOFTWARE. ******************************************************************/ ! /* $XFree86: mit/server/ddx/mfb/maskbits.h,v 1.6 1993/03/27 09:00:31 dawes Exp $ */ /* $XConsortium: maskbits.h,v 1.26 91/07/09 19:44:24 keith Exp $ */ #include "X.h" #include "Xmd.h" --- 22,28 ---- SOFTWARE. ******************************************************************/ ! /* $XFree86: mit/server/ddx/mfb/maskbits.h,v 2.0 1993/11/24 12:32:34 dawes Exp $ */ /* $XConsortium: maskbits.h,v 1.26 91/07/09 19:44:24 keith Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 400,407 **** --- 400,409 ---- int m = 32-(x); \ *MAPW(pdst) = ((*MAPR(pdst)) & endtab[x]) | (t2 & starttab[x]); \ t1 = SCRLEFT((src), m); \ + CHECKRWONEXT(pdst); \ DoRop(t2, rop, t1, *MAPR(&((pdst)[1]))); \ *MAPW(&((pdst)[1])) = ((*MAPR(&((pdst)[1]))) & starttab[n]) | (t2 & endtab[n]); \ + CHECKRWU(pdst); \ } \ } diff -c mit/server/ddx/mfb/mergerop.h:1.1.1.1 mit/server/ddx/mfb/mergerop.h:2.0 *** mit/server/ddx/mfb/mergerop.h:1.1.1.1 Fri Mar 11 23:35:13 1994 --- mit/server/ddx/mfb/mergerop.h Fri Mar 11 23:35:13 1994 *************** *** 1,4 **** --- 1,5 ---- /* + * $XFree86: mit/server/ddx/mfb/mergerop.h,v 2.0 1993/12/10 14:34:07 dawes Exp $ * $XConsortium: mergerop.h,v 1.7 91/07/18 22:54:58 keith Exp $ * * Copyright 1989 Massachusetts Institute of Technology *************** *** 176,182 **** #define MROP_PREBUILT_MASK(src,dst,mask) MROP_MASK(src,dst,mask) #endif ! #if __STDC__ && !defined(UNIXCPP) #define MROP_NAME_CAT(prefix,suffix) prefix##suffix #else #define MROP_NAME_CAT(prefix,suffix) prefix/**/suffix --- 177,183 ---- #define MROP_PREBUILT_MASK(src,dst,mask) MROP_MASK(src,dst,mask) #endif ! #if (__STDC__ && !defined(UNIXCPP)) || (defined (SOLX86) && defined (__STDC__) && !defined (__GNUC__)) #define MROP_NAME_CAT(prefix,suffix) prefix##suffix #else #define MROP_NAME_CAT(prefix,suffix) prefix/**/suffix diff -c mit/server/ddx/mfb/mfbmap.h:1.3 mit/server/ddx/mfb/mfbmap.h:2.0 *** mit/server/ddx/mfb/mfbmap.h:1.3 Fri Mar 11 23:35:13 1994 --- mit/server/ddx/mfb/mfbmap.h Fri Mar 11 23:35:14 1994 *************** *** 1,6 **** ! /* $XFree86: mit/server/ddx/mfb/mfbmap.h,v 1.3 1993/02/27 04:31:11 dawes Exp $ */ ! #if __STDC__ && !defined(UNIXCPP) #define CATNAME(prefix,subname) prefix##subname #else #define CATNAME(prefix,subname) prefix/**/subname --- 1,6 ---- ! /* $XFree86: mit/server/ddx/mfb/mfbmap.h,v 2.0 1993/12/10 14:34:08 dawes Exp $ */ ! #if (__STDC__ && !defined(UNIXCPP)) || (defined (SOLX86) && defined (__STDC__) && !defined (__GNUC__)) #define CATNAME(prefix,subname) prefix##subname #else #define CATNAME(prefix,subname) prefix/**/subname diff -c mit/server/ddx/mi/cbrt.c:1.1.1.1 mit/server/ddx/mi/cbrt.c:2.0 *** mit/server/ddx/mi/cbrt.c:1.1.1.1 Fri Mar 11 23:35:21 1994 --- mit/server/ddx/mi/cbrt.c Fri Mar 11 23:35:21 1994 *************** *** 1,3 **** --- 1,4 ---- + /* $XFree86: mit/server/ddx/mi/cbrt.c,v 2.0 1994/03/06 06:42:53 dawes Exp $ */ /* $XConsortium: cbrt.c,v 1.0 90/09/29 10:24:02 rws Exp $ */ /* simple cbrt, in case your math library doesn't have a good one */ *************** *** 8,12 **** cbrt(x) double x; { ! return pow(x, 1.0/3.0); } --- 9,16 ---- cbrt(x) double x; { ! if (x > 0.0) ! return pow(x, 1.0/3.0); ! else ! return -pow(-x, 1.0/3.0); } diff -c mit/server/ddx/x386/CHANGELOG:2.91 mit/server/ddx/x386/CHANGELOG:2.141 *** mit/server/ddx/x386/CHANGELOG:2.91 Fri Mar 11 23:35:29 1994 --- mit/server/ddx/x386/CHANGELOG Fri Mar 11 23:35:30 1994 *************** *** 1,3 **** --- 1,261 ---- + XFree86 2.1 (11 March 1994) + 151. OS README updates (affect individual OSs only) + 150. Fix AltGr handling for Linux (affects Linux only) + 149. Comment out the unused s3Save() and s3Restore() functions -- a typo in + some unreachable code may cause problems with some compilers (should not + affect any OSs) + 148. Linux compile-time fix for fonts/PEX/lex.l (affects Linux only) + 147. Late cirrus fix for large tiles + 146. Fix for LinkKit site.def and Imakefile (remove dbm references) + + XFree86 2.0Z (8 March 1994) + 145. Fix text/graphics mode switching for pixmux with SPEA Mercury. This + code is now reasonably stable (interlace support is still absent though) + (Norbert Distler) + 144. Fix for cirrus stipple fill when virtual width is not a multiple of 32 + 143. Linux keyboard updates + + XFree86 2.0Ce (7 March 1994) + 142. Preliminary support for Bt485 pixel multiplexing on the SPEA Mercury + card (Norbert Distler) + 141. More documentation updates + 140. SuperProbe updates (ATI and Weitek fixes) + 139. Fix for second MB cirrus BitBLT but -- BitBLT now turned back on for + 2MB cards (Wolfgang Jung) + + XFree86 2.0Cd (6 March 1994) + 138. Default to building shared libs for FreeBSD + 137. Updates to cirrus driver: (Harm Hanemaayer) + New Option flag "no_2mb_banksel" for cards that have 2MB in the form + of 512kx8 DRAMS (4 chips) + Disable BitBLT engine use when using more than 1MB because there + are problems + New text bitmap transfer code + 136. Documentation updates + 135. Fix mi/cbrt.c so it handles negative arguments. + + XFree86 2.0Cc (5 March 1994) + 134. Update x386/etc/console.h to current version + 133. Some documentation updates (including removing README.XS3) + 132. Updates to cirrus driver: (Harm Hanemaayer) + New option flags "fifo_conservative" and "fifo_aggressive" to + control the CRTC fifo threshold. + Reduce clock limit for the 5420 + Remove accelerated PolyGlyphBlt -- it causes problems + 131. Modify pvga1 driver to detect the 90C24 and treat it as a 90C30 + 130. Support for the SC15025 RAMDAC in 8-bit/RGB mode (requires + the "sc15025" and "dac_8_bit" options) (Helmut Geyer) + 129. Fix vga colourmap save/restore when using a RAMDAC in 8-bit mode (Helmut + Geyer) + + XFree86 2.0Cb (3 March 1994) + 128. Fix for "snow" problems on WD90C3x cards with 80MHz clock (Anders Bostrom) + 127. Fixes for compilation problems on Mach and ISC + 126. Support for 8-bit/RGB for the AT&T 20C490/491 ramdacs (S3 server). + There is no auto-detect, so the "att_20c490_1" Option must be + specified (together with the "dac_8_bit" Option) + 125. Added some sample patches from Gertjan Akkerman which document some + useful changes which could me made to the VGA16 server (these are + in x386/vga16/doc/). + 124. Fix Mach8 and Mach32 server hang when run on a card with no Mach chip + 123. Update xterm's terminfo file + 122. Install mit/config/README in lib/X11/config + 121. Modify Trident driver to recognise the 9000i, 9200CX, 9100B and 9420 + chipsets. The first is treated as a 9000, and the last three are + treated as a 8900CL. + + XFree86 2.0Ca (2 March 1994) + 120. Fix CR60 setting for clocks > 100MHz (S3 server) + 119. Fix cirrus compilation on SVR4, and bsd_init.c typo + 118. Enable Home/End esc sequences for xterm on all OSs + 117. SuperProbe register unlock fixes + + XFree86 2.0C (1 March 1994) + 116. Allow the MIT-SHM extension to be disabled at run-time on BSD systems + when kernel support for sysv-shm isn't present + 115. Enable Home/End esc sequences for xterm (Linux only -- should this be + extended?) + 114. Set default xterm tty parameters to reasonable values (fixes problems + seen when using xdm) + 113. gccmakedep fix (David McCullough) + 112. Special-case code for lines where this is one rectangle in the clip + region -- for Mach32 (Craig Groeschel) + 111. Update to compaq probe code -- hopefully this will reduce the number + of false positives + 110. Major updates to SuperProbe + 109. Cirrus driver patches + + XFree86 2.0Bb (27 February 1994) + 108. Removed experimental "cr60=..." options (S3), and made CR60=0xFF + the default setting. The "dram_{slow,med,fast}" options still remain + as un-documented options (just in case). + 107. Manual page updates + 106. Support for linear fb location on Mach32 PCI cards + 105. Include Solaris x86 "aperture driver" (Doug Anson and David Holland) + 104. Updated Thomas Wolfram's SVR3 mmap driver to version 2.2.3 + 103. Allow the MemBase setting in Xconfig specify the high 5 bits of the + 4MB aperture address for the Mach32 server, and the high 6 bits of + the LAW address for the S3 server + + XFree86 2.0Ba (25 February 1994) + 102. Fix/speedup for window->pixmap part of CopyPlane() in the accel servers + 101. Fix bits per RGB reported for S3 server when using 8bpRGB + 100. Modify code for determining when pixel multiplexing is required for + the S3 server, and restrict the DisplayWidth to either 1024 or 2048 when + pixel multiplexing is used + 99. Preliminary support for the SC11412 clock chip used on the SPEA Mercury + (S3). Use 'Clocks "sc11412"' to select this (Norbert Distler) + 98. "icd2061a" now uses the "icd2061a_slow" clock setting algorithm. + The name "icd2061a_slow" will be dropped in the release after 2.1 + 97. Fixes for zero-width arcs for the VGA16 server (Gertjan Akkerman) + 96. Support for David Holland's "aperture driver" for linear fbs on Solaris + 95. Fix Solaris panic when no free VTs are available + 94. Much-enhanced accelerated support for Cirrus chips (Harm Hanemaayer) + 93. Support for up to 17 clocks on WD90C3x cards (Anders Bostrom) + 92. Fix for Compaq avga driver + 91. Keyboard updates to handle Linux' key remapping (Orest Zborowski) + 90. README for Solaris (David Holland) + + XFree86 2.0B (21 February 1994) + 89. Possible fix for Bt probe problem that some people see + + XFree86 2.0Ab (19 February 1994) + 88. Combine DRAM and non-DRAM mach8 image assembler code into single files + with #ifdefs + 87. Fix for hga2 driver to prevent it from blanking MDA displays when + swithching back to text mode + 86. Code to explicitly recognise the *BSD PCVT console driver + 85. Preliminary support for the S3 805i in interleaved mode + 85. Fix for single-bank SVGA bitblt code (Giovanni Novelli) + 84. Fix alu usage in mach32CopyArea() (Craig Groeschel) + 83. Fix dash line support in Mach32 server (Mike Bernson) + + XFree86 2.0Aa (13 February 1994) + 82. S3 "No_Bt485" and "No_Ti3020" options have been replaced by "Normal_DAC", + and a "20C505" option has been added + 81. ATI text restore fixes for Mach32 server (Ton van Rosmalen) + 80. Planemask fixes for Mach32GetImage() (Craig Groeschel) + 79. Prevent S3 Ti cursor from being turned on when the screen is blanked + 78. No longer define __386BSD__ for BSD/386, NetBSD, FreeBSD. Change + the FreeBSD define from -DFreeBSD to -D__FreeBSD__. Code outside + ddx/x386 now uses the value of BSD (from ) and for + code below ddx/x386, __BSD__ is defined for all the x86 BSD OSs + 77. Rewrite of Mach32 memory detection code (Mark Weaver) + 76. Set clock-doubler cut-in to 67.5MHz for Bt485 and 90MHz for AT&T 20C505 + 75. Add ClearRTS option (some mice seem to need it) + 74. Mach8 server now uses a 1024 line pitch (regardless of virtualX) for + cards with 1MB + 73. Support for bank switching with the VGA16 server. Staticgray and + Grayscale visuals added to the VGA16 server (Gertjan Akkerman) + 72. Slowed down image routines for DRAM based Mach8 cards (Hans Nasten) + 71. Improvements to solx86 in/out assembler code, and removal of the + broken ProworksMOption + + XFree86 2.0A (15 January 1994) + 70. Increase Bt485 clock-doubler cut-in point from 67.5MHz to 90MHz. This + should fix the "flashing pixel" problem many have reported + 69. Mach8 font cache performance updates + 68. Update assembler code and SuperProbe Makefile.std for the ProWorks + compile on Solaris x86 + 67. Ti3020 probe code for SuperProbe (Robin Cutshaw) + 66. Fix Mach32 server to recognise PCI cards + + XFree86 2.0g (9 January 1994) + 65. Clock probe code for Mach32 server + 64. Support for TI3020 ramdac for S3 server (Robin Cutshaw) + 63. Fix server crash problem if reset occurs when VT switched away + 62. Make accel servers honour the -dpi flag + 61. Mach8 font cache updates + 60. Support for the ProWorks compiler on Solarix x86 + 59. Add memory probe to SuperProbe (only for a couple of chipsets so far) + 58. Support for display widths of 640, 800 and 2048 with S3 server + 57. Generalise S3 HW cursor memory allocation -- fixes problems that showed + up with some virtualY/displaywidth combinations, and will work for + display widths < 1024 + + XFree86 2.0f (27 December 1993) + 56. Fix mach32RecolorCursor() SIGSEGV when VT switched away + 55. Possible fix for cases where the S3 linear fb probe fails the first + time the server is started but succeeds on subsequent times + 54. Updates to Mach32 memory probe + 53. Fixes for ATI SVGA save/restore code (Ton van Rosmalen) + 52. Fix xman's handling of nroff bullets and bolding (Rich Murphey) + 51. Mach8 font cache updates (Hans Nasten) + 50. Mach32 HW cursor fixes (Mark Weaver) + 49. Change "makedepend" for systems with gcc to use "gcc -M" (based on + code from Hongjiu Lu). This is much slower than the other version, + and maybe should be disabled by default for !UseInstalled + + XFree86 2.0e (18 December 1993) + 48. SuperProbe updates (details in SuperProbe/ChangeLog) + 47. Imake updates for NetBSD + 46. Ramdac multiplexing for Mach32 cards with TLC34075 (and ATI68875?) + ramdacs (Mike Bernson) + 45. Imake changes to allow easy building of just the servers with a + cut-down source tree + 44. Fix ClearDTR -- now it clears *only* the DTR line + + XFree86 2.0d (11 December 1993) + 43. Xconfig keyboard option: VTSysReq to enable SVR4-style VT switching + sequence on Linux and *BSD+syscons + 42. Solaris 2.x x86 support (David Holland, Doug Anson) + 41. Accelerated dline and dseg for Mach32 (Mike Bernson) + 40. Accelerated non-cache text code for Mach8 (Hans Nasten) + 39. VirtualY limit removed for Mach8 (cache can be disabled) + 38. Dynamic allocation for font cache for Mach8 (Hans Nasten) + 37. New GetImage for Mach32 (Mike Bernson) + 36. Support for linear fb on *BSD with mmapable /dev/mem + 35. Preliminary support for 1152 width on Rev C 801 and Rev E 928, and + 1600 width on Rev E 928 in S3 server + + XFree86 2.0c (3 December 1993) + 34. Support for 8-bit/gun for Mach32 server (Craig Groeschel) + 33. New GetImage() for Mach8 and 8514 + 32. Fix error message printed when no appropriate graphics sections are + present in Xconfig + 31. Add a "fb_debug" option to the S3 server + 30. MemBase Xconfig parameter added to allow the fb base address to be + specified. This is currently used only by some bdm2 drivers + 29. Support added to bdm2 for Visa board (untested) + 28. HGC-1280 now supported on both primary and secondary addresses + 27. Sigma L-View driver tested and works now + 26. Code from ATI to work around memory probing problems with some Mach32 + chips (untested) + 25. Workaround for some 2MB DRAM ATI cards (eg, CLX). This allows the + VideoRam amount specified in Xconfig to override the detected value + 24. Support for NetBSD/FreeBSD shared libraries (John Brezak & ??) + 23. Add option "intel_gx" to handle linear fb on Intel GX/Pro (Mach32) + 22. Composite sync support for Mach8 + 21. Allow linear fb for EISA S3 cards + 20. Fix s3RecolorCursor() SIGSEGV when VT switched away + + XFree86 2.0b (14 November 1993) + 19. Add virtualY <= 896 check to Mach8 server + 18. Restore settings for VGA aperture mapping if linear fb access fails for, + S3. Also restore those registers at exit + 17. Merge in MIT fix-26 (mainly xterm security patch) + 16. Fix S3 interlaced modes with VTotal > 1025. + 15. Hack for 1280x1024 on S3 801 with 110MHz clock + 14. Composite sync support for Mach32 (Todd Pfaff) + + XFree86 2.0a (9 November 1993) + 13. Speedup for aligned <=16 bit wide stipple ops for Mach8 and 8514 + 12. Fix NULL dereference when ModeDB is empty (Bill Metzenthen) + 11. make mit/rgb consistent with the server's usage of it. showrgb can now + read rgb.txt directly, and [sng]dbm is no longer required + 10. Attempt to clean up strerror() vs sys_errlist[] usage outside ddx/x386 + 9. Disable saving the Tek screen to a file in xterm -- a quick hack to + get around another security problem. An official X Consortium fix + should be available soon + 8. Fix vgaFasm.h so it works for gcc2 with '-traditional' + 7. Fix clock probing problem in pvga1 driver + 6. Fix typo in xf86_OSlib.h + 5. Fix ClockProg informational message + 4. Truncate clock values to MHz resolution when checking against the limit + 3. Fix bug in LinkKit Imakefile + 2. Fix malloc problem in the PEX font reader + 1. Some documentation fixes + XFree86 2.0 (24 October 1993) 247. Documentation finalised 246. Fix for VT switching problem with Mach32 server diff -c mit/server/ddx/x386/INSTALL:2.4 mit/server/ddx/x386/INSTALL:2.7 *** mit/server/ddx/x386/INSTALL:2.4 Fri Mar 11 23:35:31 1994 --- mit/server/ddx/x386/INSTALL Fri Mar 11 23:35:31 1994 *************** *** 1,5 **** ! Installation Guide for XFree86 2.0 ---------------------------------- Contents --- 1,5 ---- ! Installation Guide for XFree86 2.1 ---------------------------------- Contents *************** *** 28,34 **** An additional 20-30MB (for OSs with shared libraries) or 30-50MB (for OSs without shared libraries) is required to install the built binaries, fonts, etc, ! - MIT X11R5 distribution with fixes 01-25 applied. If you want to minimise disk usage, you can remove some or all of the following directories: --- 28,34 ---- An additional 20-30MB (for OSs with shared libraries) or 30-50MB (for OSs without shared libraries) is required to install the built binaries, fonts, etc, ! - MIT X11R5 distribution with fixes 01-26 applied. If you want to minimise disk usage, you can remove some or all of the following directories: *************** *** 54,84 **** k14.bdf hang*.bdf jiskan*.bdf ! - XFree86-2.0.diff.gz, XFree86-2.0.tar.gz, sdbm.tar.gz (for SVR4 and ! some SVR3), and optionally Type1.tar.gz, Type1.patch1.gz, ! Type1.patch2.gz if you wish to built the Adobe Type-1 font renderer. ! ! - If you are upgrading from XFree86 version 1.3, you will only need ! 1.3-2.0.diff.gz. ! ! 2. If you need to use libsdbm.a, extract sdbm.tar.gz somewhere and build ! it. Install libsdbm.a in a directory your ld searches. (You could use ! /usr/local/lib, and with SVR4 add it to your LD_LIBRARY_PATH.) Install ! sdbm.h in /usr/include. ! 3. If you are starting from the stock MIT PL25 distribution, go to the directory above your 'mit' directory, and run: rm -fr mit/server/ddx/x386 ! then extract XFree86-2.0.tar.gz: ! gzip -d < XFree86-2.0.tar.gz | tar vxf - ! This tar file contains the XFree86 2.0 version of mit/server/ddx/x386. Then apply the patch: ! gzip -d < XFree86-2.0.diff.gz | patch -p If you are installing in an unmodified tree there shouldn't be any problems. Check for any patch rejections and resolve them. If you've --- 54,92 ---- k14.bdf hang*.bdf jiskan*.bdf ! - It is possible to configure a cut-down source tree for building only ! the XFree86 servers. Building from a cut-down source tree requires ! about 30-35MB of disk space. Such a source tree can be obtained by ! additionally removing the following directories: ! ! mit/clients mit/demos ! mit/extensions/lib mit/fonts/bdf ! mit/fonts/clients mit/fonts/scaled ! mit/fonts/server mit/lib/X ! mit/lib/Xaw mit/lib/Xmu ! mit/lib/Xt mit/lib/nls ! mit/man ! ! - XFree86-2.1.diff.gz, XFree86-2.1.tar.gz, and optionally ! Type1.tar.gz, Type1.patch1.gz, Type1.patch2.gz if you wish to ! built the Adobe Type-1 font renderer. ! - If you are upgrading from XFree86 version 2.0, you will only need ! 2.0-2.1.diff.gz. ! ! 2. If you are starting from the stock MIT PL26 distribution, go to the directory above your 'mit' directory, and run: rm -fr mit/server/ddx/x386 ! then extract XFree86-2.1.tar.gz: ! gzip -d < XFree86-2.1.tar.gz | tar vxf - ! This tar file contains the XFree86 2.1 version of mit/server/ddx/x386. Then apply the patch: ! gzip -d < XFree86-2.1.diff.gz | patch -p If you are installing in an unmodified tree there shouldn't be any problems. Check for any patch rejections and resolve them. If you've *************** *** 90,99 **** If you are patching a tree that you've previously used, make sure you run 'make clean' from the 'mit' directory before applying the diffs. ! 4. If you are upgrading your source tree from XFree86 version 1.3, go to the directory above your 'mit' directory, and run: ! gzip -d < 1.3-2.0.diff.gz | patch -p -E If your version of 'patch' doesn't support the '-E' flag, get a newer version before patching. The use of the '-E' flag is important because --- 98,107 ---- If you are patching a tree that you've previously used, make sure you run 'make clean' from the 'mit' directory before applying the diffs. ! 3. If you are upgrading your source tree from XFree86 version 2.0, go to the directory above your 'mit' directory, and run: ! gzip -d < 2.0-2.1.diff.gz | patch -p -E If your version of 'patch' doesn't support the '-E' flag, get a newer version before patching. The use of the '-E' flag is important because *************** *** 103,114 **** If you are installing in an unmodified tree there shouldn't be any problems. Check for any patch rejections and resolve them. If you've modified some files (e.g. x386.cf, site.def) you should rename them, and ! restore the 1.3 versions before patching. If you are patching a tree that you've previously used, make sure you run 'make clean' from the 'mit' directory before applying the diffs. ! 5. If you want to include the Type1 font code, extract Type1.tar.gz in mit/fonts/lib/font, and then apply the Type1 patches. Some contributed fonts can be found on ftp.x.org in: --- 111,122 ---- If you are installing in an unmodified tree there shouldn't be any problems. Check for any patch rejections and resolve them. If you've modified some files (e.g. x386.cf, site.def) you should rename them, and ! restore the 2.0 versions before patching. If you are patching a tree that you've previously used, make sure you run 'make clean' from the 'mit' directory before applying the diffs. ! 4. If you want to include the Type1 font code, extract Type1.tar.gz in mit/fonts/lib/font, and then apply the Type1 patches. Some contributed fonts can be found on ftp.x.org in: *************** *** 115,121 **** /pub/R5untarred/contrib/fonts/scaled/Type1 /pub/R5untarred/contrib/fonts/Utopia ! 6. Have a look at config/site.def. Set the various parameters to suit your configuration. If it is your first build, you should set BuildFonts, InstallXdmConfig, InstallXinitConfig to YES (as well as InstallFSConfig if you are building the Font Server). If you have installed --- 123,129 ---- /pub/R5untarred/contrib/fonts/scaled/Type1 /pub/R5untarred/contrib/fonts/Utopia ! 5. Have a look at config/site.def. Set the various parameters to suit your configuration. If it is your first build, you should set BuildFonts, InstallXdmConfig, InstallXinitConfig to YES (as well as InstallFSConfig if you are building the Font Server). If you have installed *************** *** 122,129 **** Type1.tar.gz, set BuildType1 to YES. If you want to build the large fonts in mit/fonts/bdf/misc set BuildLargeMiscFonts to YES. If you want to build the 100dpi fonts as well as the 75dpi fonts set Build100Dpi to ! YES. Make sure both HasNdbm and HasSdbm are set correctly for the ! [n]dbm library you are using. Set the defines to specify which server(s) you want to build: --- 130,139 ---- Type1.tar.gz, set BuildType1 to YES. If you want to build the large fonts in mit/fonts/bdf/misc set BuildLargeMiscFonts to YES. If you want to build the 100dpi fonts as well as the 75dpi fonts set Build100Dpi to ! YES. ! ! If you are using a cut-down source tree for building only the servers, ! set BuildServersOnly to YES. Set the defines to specify which server(s) you want to build: *************** *** 157,163 **** The VGA16 and VGA2 screens both have `generic' drivers, and these should always be last in the list because their probe will succeed for any VGA ! card. Similarly, the S3 server has a 'generic_s3' driver which will function with any S3 card. Note: --- 167,173 ---- The VGA16 and VGA2 screens both have `generic' drivers, and these should always be last in the list because their probe will succeed for any VGA ! card. Similarly, the S3 server has a 's3_generic' driver which will function with any S3 card. Note: *************** *** 164,170 **** it is not possible to have both the monochrome and colour drivers in the same server executable. ! 7. The following server connection defaults are set up by x386.cf, and there should be little reason to change them. For an explanation of how these connection modes are used, refer to the XFree86(1) manual page. --- 174,180 ---- it is not possible to have both the monochrome and colour drivers in the same server executable. ! 6. The following server connection defaults are set up by x386.cf, and there should be little reason to change them. For an explanation of how these connection modes are used, refer to the XFree86(1) manual page. *************** *** 191,197 **** #undef ConnectionFlags #define ConnectionFlags YOUR_CHOICE_OF_FLAGS ! 8. Before building the distribution, read through the OS-specific README file in mit/server/ddx/x386 that is relevant to you. Once those OS-specific details have been taken care of, go the 'mit' directory and: --- 201,207 ---- #undef ConnectionFlags #define ConnectionFlags YOUR_CHOICE_OF_FLAGS ! 7. Before building the distribution, read through the OS-specific README file in mit/server/ddx/x386 that is relevant to you. Once those OS-specific details have been taken care of, go the 'mit' directory and: *************** *** 204,209 **** --- 214,223 ---- make World BOOTSTRAPCFLAGS='-DSVR4 -DSYSV386 -DNCR' > World.Log 2>&1 & + For Solaris, run: + + make World BOOTSTRAPCFLAGS='-DSVR4 -DSYSV386 -DSOLX86' > World.Log 2>&1 & + For 386BSD, NetBSD, BSD/386, Mach386, OSF/1, Linux, Minix-386 and Amoeba, run: *************** *** 211,217 **** For FreeBSD, run: ! make World BOOTSTRAPCFLAGS=-DFreeBSD > World.Log 2>&1 & For SVR3, run: --- 225,231 ---- For FreeBSD, run: ! make World BOOTSTRAPCFLAGS=-D__FreeBSD__ > World.Log 2>&1 & For SVR3, run: *************** *** 242,248 **** make World BOOTSTRAPCFLAGS='-DSYSV -DSYSV386 -DSCO -DSCO324' > \ World.Log 2>&1 & ! 9. If all goes well, that will finish successfully in anything from two to eight hours depending on your CPU/RAM/OS/compiler/disks. You should check World.Log to see if there were any problems. If there weren't any then you can do a 'make install' and a 'make install.man'. Make sure --- 256,262 ---- make World BOOTSTRAPCFLAGS='-DSYSV -DSYSV386 -DSCO -DSCO324' > \ World.Log 2>&1 & ! 8. If all goes well, that will finish successfully in anything from two to eight hours depending on your CPU/RAM/OS/compiler/disks. You should check World.Log to see if there were any problems. If there weren't any then you can do a 'make install' and a 'make install.man'. Make sure *************** *** 363,369 **** Note: the ordering of drivers determines the order in which the probing is done. The 'generic' driver should be the last one included in the monochrome and 16 colour servers because its probe always succeeds. The ! 'generic_s3' driver should be the last one included in the S3 servers for similar reasons. 2. If you are including a driver that it not part of the standard --- 377,383 ---- Note: the ordering of drivers determines the order in which the probing is done. The 'generic' driver should be the last one included in the monochrome and 16 colour servers because its probe always succeeds. The ! 's3_generic' driver should be the last one included in the S3 servers for similar reasons. 2. If you are including a driver that it not part of the standard *************** *** 392,395 **** ! $XFree86: mit/server/ddx/x386/INSTALL,v 2.4 1993/10/24 13:43:55 dawes Exp $ --- 406,409 ---- ! $XFree86: mit/server/ddx/x386/INSTALL,v 2.7 1994/03/05 08:22:22 dawes Exp $ diff -c mit/server/ddx/x386/Imakefile:2.18 mit/server/ddx/x386/Imakefile:2.21 *** mit/server/ddx/x386/Imakefile:2.18 Fri Mar 11 23:35:32 1994 --- mit/server/ddx/x386/Imakefile Fri Mar 11 23:35:32 1994 *************** *** 1,4 **** ! XCOMM $XFree86: mit/server/ddx/x386/Imakefile,v 2.18 1993/10/24 13:43:56 dawes Exp $ XCOMM $XConsortium: Imakefile,v 1.1 91/07/16 22:57:37 gildea Exp $ #include #define IHaveSubdirs --- 1,4 ---- ! XCOMM $XFree86: mit/server/ddx/x386/Imakefile,v 2.21 1994/03/06 14:53:41 dawes Exp $ XCOMM $XConsortium: Imakefile,v 1.1 91/07/16 22:57:37 gildea Exp $ #include #define IHaveSubdirs *************** *** 40,50 **** SUBDIRS = common common_hw os-support $(SCREENS) $(ACCELDIRS) etc LinkKit \ VGADriverDoc $(SUPERPROBE) #if i386Bsd # ifdef i386Bsdi EXTRAREADME = README.Bsdi # else ! EXTRAREADME = README.BSD # endif #endif #if i386Mach --- 40,53 ---- SUBDIRS = common common_hw os-support $(SCREENS) $(ACCELDIRS) etc LinkKit \ VGADriverDoc $(SUPERPROBE) + /* FreeBSD's README is handled separately because of name length limits */ #if i386Bsd # ifdef i386Bsdi EXTRAREADME = README.Bsdi # else ! # ifdef i386NetBsd ! EXTRAREADME = README.NetBSD ! # endif # endif #endif #if i386Mach *************** *** 51,57 **** --- 54,64 ---- EXTRAREADME = README.Mach #endif #if SystemV4 + # ifdef i386SVR4Solarisx86 + EXTRAREADME = README.SOLX86 + # else EXTRAREADME = README.SVR4 + # endif #endif #if SystemV # ifdef i386Sco *************** *** 150,155 **** --- 157,165 ---- InstallManPageLong(XF86kbd,$(MANDIR),XFree86kbd) InstallNamedNonExec(Xconfig,Xconfig.sample,$(LIBDIR)) InstallMultipleDestFlags(install,$(FILES),$(LIBDIR)/etc,$(INSTDATFLAGS)) + #ifdef i386FreeBsd + InstallNamedNonExec(READ.FreeBSD,README.FreeBSD,$(LIBDIR)/etc) + #endif MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) diff -c /dev/null mit/server/ddx/x386/READ.FreeBSD:2.10 *** /dev/null Fri Mar 11 23:35:32 1994 --- mit/server/ddx/x386/READ.FreeBSD Fri Mar 11 23:35:33 1994 *************** *** 0 **** --- 1,362 ---- + README for XFree86 2.1 on FreeBSD 1.1 + ------------------------------------- + + Contents + -------- + 1) What and Where is XFree86? + 2) Bug Reports for This Document + 3) Installing The Binaries + 4) Installing Xdm, the display manager + 5) Configuring X for Your Hardware + 6) Running X + 7) Kernel Support for X + 8) Rebuilding the XFree86 Distribution + 9) Building New X Clients + + + 1 - What and Where is XFree86? + ------------------------------ + XFree86 is a port of X11R5 that supports several versions of + Intel-based Unix. It is derived from X386 1.2, which was the X server + distributed with X11R5. This release consists of many new features + and performance improvements as well as many bug fixes. The release + is available as source patches against the MIT X11R5 code, as well as + binary distributions for many architectures. + + The sources for XFree86 are available by anonymous ftp from: + + ftp.x.org:/contrib/XFree86 + ftp.physics.su.oz.au:/XFree86. + + Binaries for XFree86 on FreeBSD will be available from: + + XFree86.cdrom.com:/pub/XFree86/FreeBSD/XFree86-2.1 + + On US ftp sites note 00README-Legal-Rules-Regs or + README.export-control which state that ftp users outside the U.S. + should not copy XFree86-2.1-xdm-des.tar.gz from sites within the U.S. + because it employs DES encryption. + + 2 - Bug Reports for This Document + --------------------------------- + Send email to Rich-Murphey@Rice.edu or XFree86@physics.su.oz.au if + you have comments or suggestions about this file and we'll revise it. + + 3 - Installing the Binaries + --------------------------- + + The binary distribution is composed of a number of tar archives + which are the executables, servers, fonts, libraries, include files, + man pages, config files, and server link kit. The full distribution + takes 23Mb. + + At a minimum you need to unpack the required bin, fonts, doc, lib, + config archives and a server that matches your vga card. But if you + are unsure you can can safely just install all of them. + + REQUIRED: + + bin - all the executable X client applications and shared libs + fonts - the misc and 75 dpi fonts (required) + doc - READMEs, install scripts, and XFree86 specific man pages + lib - data files needed at runtime (required) + config - customizable xinit, xdm and fs runtime configuration files + + CHOOSE ONE (or more): + + 8514 - server for IBM 8514/A boards + Mach32 - server for ATI Mach32 graphic accelerator boards + Mach8 - server for ATI Mach8 graphic accelerator boards + Mono - monochrome server for VGA, Super-VGA, Hercules, and others + S3 - server for S3 based boards + SVGA - 8-bit pseudocolor server for Super-VGA cards + VGA16 - 4-bit pseudocolor server for VGA and Super-VGA cards + + OPTIONAL: + + man - man pages except XFree86 specific ones in etc archive + fonts-100dpi - optional 100dpi fonts + fonts-scaled - optional Speedo and Type1 fonts + prog - lib*.a and *.h files needed only for compiling + xdm-des - xdm executable with des encryption + xdm-nodes - xdm executable with no encryption + linkkit - optional X server reconfiguration kit + fontserver - the font server and it's man page + pex - pex clients, libraries, header files and data. + + + First find a partition that has enough space: 10Mb for the required + for the run-time binaries only, 23Mb for the complete binaries. + + For a FULL INSTALL, unpack everything (assuming you are using csh): + + foreach i (XFree86-2.1-*.tar.gz) + tar -xzf $i + end + + For a MINIMAL INSTALL, unpack the required files and a server (e.g. SVGA): + + foreach i (XFree86-2.1-{bin,fonts,doc,lib,config}.tar.gz) + tar -xzf $i + end + tar -xzf XFree86-2.1-S3.tar.gz + + After unpacking the archives, run the installation script, x386install + from the directory where you just unpacked everything. It creates + links so that the distribution appears to be in /usr/X386, and adds + /usr/X386/bin to the default path for sh in /etc/profile and for csh + in /etc/csh.login. + + ./X386/lib/X11/etc/x386install + + Next, create a symbolic link for the server that matches your vga + card. For example, if you have an ET4000 based SVGA card, then you + want a symbolic link for the SVGA server: + + cd /usr/X386/bin; rm X; ln -s XF86_SVGA X + + Also make sure you add /usr/X386/bin to your shell's `path' variable. + + If X was already installed and you have have customized your xinit or + xdm runtime configuration scripts, omit the config archive or unpack + it elsewhere and merge in your customizations. The fonts-scaled and + fonts-100dpi archives are optional and can be omitted if you are short + on space. The optional linkkit archive which allows you to + reconfigure and link a server. The optional the prog archive is + needed only for writing or compiling X applications. The optional pex + archive contains pex clients and libraries for writing pex + applications. + + NOTE: Do not uncompress the font files without subsequently rerunning + mkfontdir in the corresponding font directory; otherwise your server + will abort with the message "could not open default font 'fixed'". + + 4 - Installing Xdm, the display manager + --------------------------------------- + Export restrictions prevent us from providing support for DES + encryption outside the US. If you have not installed FreeBSD's + optional securedist/des, then passwords in /etc/passwd.master are + unencrypted and you should install the version of xdm without DES + encryption: + + tar xzf XFree86-2.1-xdm-nodes.tar.gz + cd /usr/X386/bin; ln -s xdm-nodes xdm + + The xdm-nodes binary uses the *BSD dummy crypt routine that prints the + message 'Crypt not present in system' in the xdm-errors file each time + a user logs in. You can ignore this. It just means + /etc/passwd.master is unencrypted. If you install xdm-des by mistake + xdm will not accept any passwords. + + If you have installed the optional securedist/des package on your + system then you are using DES encryption on passwords and you should + install xdm-des: + + tar xzf XFree86-2.1-xdm-des.tar.gz + cd /usr/X386/bin; ln -s xdm-des xdm + + To start the display manager, log in as root on the console and type + `xdm -nodaemon'. + + You can start xdm automatically on bootup by disabling the console + getty adding the following code to /etc/rc.local: + + if [ -x /usr/X386/bin/xdm ]; then + echo -n ' xdm'; /usr/X386/bin/xdm + fi + + To disable the console getty, change 'on' to 'off' in the ttyv0 + entry in /etc/ttys: + + ttyv0 "/usr/libexec/getty Pc" pc3 off secure + + When using the syscons console driver, it is recommended that xdm be + started by adding the following to /etc/rc.local: + + if [ -x /usr/X386/bin/xdm ]; then + echo -n ' xdm'; (sleep 5; /usr/X386/bin/xdm)& + fi + + Check /etc/ttys to make sure there are some ttyv? devices which don't + have gettys enabled. The default is to have 4 devices configured to + run gettys. If your kernel was configured with more than 4 VTs this + is fine. + + 5 - Configuring X for Your Hardware + ----------------------------------- + You *must* create /usr/X386/lib/X11/Xconfig to suit your hardware. + See README.Config for step-by-step instructions for setting it up. + + The Xconfig file tells the X server what kind of monitor, adapter and + mouse you have. In addition to README.Config, the server manual pages + (XF86_Accel, XF86_Mono, XF86_SVGA, and XF86_VGA16) describe the + options specific to each type of board. + + Read README.Config, and look in /usr/X386/lib/X11/etc/modeDB.txt and + /usr/X386/lib/X11/etc/AccelCards to find Clocks and ModeDB entries to + your specific monitor and graphics card. If you can find them there, + grab the Clocks and ModeDB lines and put them in your Xconfig. If + not, read /usr/X386/lib/X11/etc/VideoModes.doc for instructions on how + to create the video timing values given your vga card and monitor + specs. The manual for your monitor and adapter should have these + values. The tuner program (on FreeBSD.cdrom.com + /pub/386BSD/0.1-ports/XFree86-2.0) can calculate a rough guess about a + ModeDB line given the dot clock rate and horizontal frequency of your + monitor. + + The X server (except the 8514 server) will print out the Clocks values + for your card if you leave them our of your Xconfig file when you run: + + X -probeonly >& x.out + + You can take these values and edit them to put them in your Xconfig + file; although you MUST include all the clock values, AND leave them + in the same order. + + If your mouse does not work try using kermit or tip to connect to the + mouse serial port and verify that it does indeed generate characters. + + 6 - Running X + ------------- + 8mb of memory is a recommended minimum for running X. The server, + window manager and an xterm take about 2.5 Mb of memory themselves. + On a 4Mb system that would leave very little left over for other + applications like gcc that expect a few meg free. X will work with + 4Mb of memory, but in practice compilation while running X can take 5 + or 10 times as long due to constant paging. + + The easiest way for new users to start X windows is to type 'startx >& + startx.log'. Error messages are lost unless you redirect them because + the server takes over the screen. + + To get out of X windows, type 'exit' in the console xterm. You can + customize your X by creating .xinitrc, .xserverrc, and .twmrc files in + your home directory as described in the xinit and startx man pages. + + 7 - Kernel Support for X + ------------------------ + The server supports several console drivers: pccons, syscons, codrv + and pcvt. They are detected at runtime and no configuration of the + server itself is required. + + The pccons driver is the most widely tested and is the console driver + contained in the FreeBSD binary distribution's kernels. + + In order to instead use the syscons driver, you must reconfigure, + compile and install a new kernel from the FreeBSD sources. For a + general description of BSD kernel configuration get smm.02.config.ps.Z + from gatekeeper.dec.com (16.1.0.2) in /pub/BSD/manuals. It is a ready + postscript copy of the kernel configuration chapter from the systems + maintainers manual. + + Do not remove the two lines below from your kernel configuration file + (in /sys/arch/i386/conf). They are both required for X support: + + options XSERVER #Xserver + options UCONSOLE #X Console support + + To use syscons with FreeBSD, add the following in place of the pc0 + entry, as in /sys/i386/conf/SYSCONS: + + device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr + + The number of virtual consoles can be set by adding a line like: + + options "NCONS=8" #8 virtual consoles + + to your kernel config file (the default without a line like this is 12). + It recommended that you have more then 4 when using X. + + The codrv console driver is not bundled with FreeBSD. It is available + from ftp.uni-duisburg.de in /pub/unix/386bsd-0.1/unofficial/codrv and + from bsd386.first.gmd.de in ~veit/codrv (no ANON FTP, login with + 'guest'/'guest', cd to ~veit/codrv). + + The pcvt console driver is also not bundled with FreeBSD. A "ports" + version of pcvt for FreeBSD versions 1.0.2 through FreeBSD 1.1 may be + obtained from: + + FreeBSD.cdrom.com:~ftp/pub/FreeBSD/FreeBSD-1.1/ports/util/pcvt + + Refer to the README.FreeBSD file for complete installation + instructions. + + The XFree86 servers include support for the MIT-SHM extension. If you + want to make use of this, you will need a kernel configured with SYSV + shared memory support. To do this, add the following line to your + kernel config file: + + options SYSVSHM #System V shared memory support + + + 8 - Rebuilding the XFree86 Distribution + --------------------------------------- + The server link kit allow you to rebuild just the X server with a + minimum amount of disk space. Just unpack it, make the appropriate + changes to the site.def, type './mkmf' and 'make' to link the server. + See /usr/X386/lib/Server/README for more info. + + See /usr/X386/lib/X11/etc/INSTALL for instructions on unbundling and + building the source distribution. The source tree takes approximately + 82Mb before compiling and 170Mb after 'make World'. You should + configure the distribution by editing mit/site.def before compiling. + Note that by default, the config files are set up to build shared + libraries. If you are running a version of FreeBSD that doesn't + include shared library support, add the following line to site.def: + + #define BuildBsdSharedLibs NO + + If your system doesn't have support or SYSV shared memory (for + example, if you don't have the header), you should disable + the MIT-SHM extension by adding the following line to site.def: + + #define HasShm NO + + To compile the sources: + + If you are running an older version of FreeBSD (pre 1.1), then type + + make World BOOTSTRAPCFLAGS=-D__FreeBSD__ + + in the mit directory. Otherwise, a simple 'make World' will suffice. + + 9 - Building New X Clients + -------------------------- + The easiest way to build a new client (X application) is to use + xmkmf if an Imakefile is included in the sources. Type 'xmkmf -a' to + create the Makefiles, check the configuration if necessary and type + 'make'. Whenever you install additional man pages you should update + whatis.db by running 'makewhatis /usr/X386/man'. To avoid the + `Virtual memory exhausted' message from cc while compiling, increase + the data and stack size limits (in csh type `limit datasize 32M' and + `limit stacksize 16M'). + + Note: Starting with XFree86 2.1 and FreeBSD 1.1, the symbol "__386BSD__" + no longer gets defined either by the compiler or via the X config files + for FreeBSD systems. When porting clients to BSD systems, make use of the + symbol "BSD" for code which is truly BSD-specific. The value of the + symbol can be used to distinguish different BSD releases. For example, + code specific to the Net-2 and later releases can use: + + #if (BSD >= 199103) + + To ensure that this symbol is correctly defined, include either + (best) or in the source that requires it. + For code that really is specific to a particular i386 BSD port, use + __FreeBSD__ for FreeBSD, __NetBSD__ for NetBSD, __386BSD__ for 386BSD, + and __bsdi__ for BSD/386. + + + Many thanks to + - Pace Willison for providing the initial port to 386BSD. + - Amancio Hasty for fixing cursor restoration, mouse bugs and many others. + - Christoph Robitschko for fixing com.c and thus select(). + - Nate Williams for the patchkit support for X. + - Rod Grimes and Jack Velte of Walnut Creek Cdrom for use + of their machines in preparing the FreeBSD binary release. + + Rich Murphey + David Dawes + + + $XFree86: mit/server/ddx/x386/READ.FreeBSD,v 2.10 1994/03/11 03:08:35 dawes Exp $ diff -c mit/server/ddx/x386/README:2.8 mit/server/ddx/x386/README:2.13 *** mit/server/ddx/x386/README:2.8 Fri Mar 11 23:35:34 1994 --- mit/server/ddx/x386/README Fri Mar 11 23:35:34 1994 *************** *** 1,10 **** ! README for XFree86 2.0 ! ---------------------- Contents -------- 1) What is XFree86? ! 2) What's new in XFree86 2.0? 3) XFree86 features 4) Systems XFree86 has been tested on 5) Supported video-card chip-sets --- 1,10 ---- ! README for XFree86[TM] 2.1 ! -------------------------- Contents -------- 1) What is XFree86? ! 2) What's new in XFree86 2.1? 3) XFree86 features 4) Systems XFree86 has been tested on 5) Supported video-card chip-sets *************** *** 12,19 **** 7) Bugs known fixed in XFree86 vs stock X11R5 8) Known bugs in XFree86 9) Credits ! 10) Contact information ! 11) Source and binary archive sites 1 - What is XFree86? -------------------- --- 12,20 ---- 7) Bugs known fixed in XFree86 vs stock X11R5 8) Known bugs in XFree86 9) Credits ! 10) The XFree86 Project, Inc. ! 11) Contact information ! 12) Source and binary archive sites 1 - What is XFree86? -------------------- *************** *** 24,93 **** as many bug fixes. The release is available as source patches against the MIT X11R5 code, as well as binary distributions for many architectures. - XFree86 2.0 is a major step forward in capability compared to previous - XFree86 releases. There is a massive amount of new code, including - several completely new servers, and many other enhancements. The vast - majority of this code was developed by a handful of developers, listed - in the credits section, below. All XFree86 users owe a large debt of - gratitude to these individuals. The performance of the XFree86 2.0 - accelerated servers is on a par with commercial servers for most of - the supported hardware; a $200 graphics accelerator now gives - workstation-class performance. This has been a difficult release to - complete, and not everything we hoped to get done for it is done. But - we expect that there is enough here to satisfy the hungriest freeware - user. - Note that while the source and installation trees retain the 'X386' name (for simplicity of maintenance of the source tree), there is no ! connection between XFree86 and the commercial X386 product sold by SGCS. ! The XFree86 Core Team maintains technical contacts with SGCS in an effort ! to keep user-affecting changes to the workings of the products from ! diverging too radically. There is no direct involvement of either group ! in the workings of the other. ! 2 - What's new in XFree86 2.0? ------------------------------ ! The following items have been added since XFree86 1.3 was released in ! June 1993: ! ! 1) Support for the following accelerated chipsets has been added: ! IBM 8514/A and true compatibles ! ATI Mach8, Mach32 ! S3 86C911, 86C924, 86C801, 86C805, 86C928 ! Cirrus 5426, 5428 ! WD 90C31 ! (see the file AccelCards for information on which specific cards ! have been tested). ! 2) Support for the following SVGA chipsets has been added: ! Cirrus 62x5 ! OAK OTI067, OTI077 ! 3) A 16 colour generic VGA server (this server is still experimental ! but quite usable at this stage). ! 4) Support for "banked dumb monochrome" boards. Currently the ! Hyundai HGC1280 is supported. ! 5) Support for the following operating systems has been added: ! OSF/1 ! BSD/386 1.0 ! NetBSD 0.9 ! FreeBSD 1.0 ! In addition, an OS porting layer has been defined inside the ! device-dependent layer of the server to make further OS ports ! simpler and to ensure that all future servers are supported ! on all OS platforms. ! 6) Support for the syscons driver (with VT switching) for 386BSD, ! FreeBSD and NetBSD. ! 7) Support for the Hitachi Puma Plus tablet as an input device. ! 8) The SuperProbe program introduced with XFree86 1.3 has been updated ! to detect many more chipsets and to be more reliable overall. ! 9) A new README.Config file is included with step-by-step instructions ! for setting up the Xconfig file. This file includes a list of ! generic video mode settings which should provide working modes ! for most video displays. ! 10) Several dozen bug fixes for problems detected and reported for ! XFree86 1.3. ! 11) Hard limits for the maximum dot-clock frequency used are introduced. ! These provide a rudimentary means of protecting the graphic boards ! from overclocking. (See the Known Bugs section for some more details). Plus a number of other small things. Refer to the CHANGELOG file in the source distribution for full details. --- 25,105 ---- as many bug fixes. The release is available as source patches against the MIT X11R5 code, as well as binary distributions for many architectures. Note that while the source and installation trees retain the 'X386' name (for simplicity of maintenance of the source tree), there is no ! connection between XFree86 and the commercial X386 product formerly ! sold by SGCS. The XFree86 Core Team has maintained technical contacts ! with SGCS in an effort to keep user-affecting changes to the workings ! of the products from diverging too radically (although this has happened ! anyhow over the course of time). There is no direct involvement of either ! group in the workings of the other. ! ! ****News Flash**** ! ! At this time, the XFree86 Core Team is pursuing the legal work to complete ! the formation of The XFree86 Project, Inc, a not-for-profit corporation. ! The paperwork is with the lawyers, and this incorporation should be ! complete in the near future. See the section on The XFree86 Project, Inc, ! later in this document for more information. ! 2 - What's new in XFree86 2.1? ------------------------------ ! XFree86 2.1 is not a huge release compared to prior XFree86 releases. There ! are a number of reasons for this, including the fact that two of the Core ! Team members have moved and started new employment, significantly cutting into ! their time for XFree86 work. In addition, we are hard at work on merging ! XFree86 with the upcoming X11R6. Many new features have been put on hold ! while this integration is done, so that a stable and viable X11R6 release ! can be developed. XFree86 3.0 will be released on the X11R6 contributed ! software distribution, and it is our intention that many of these features ! will be present in that release. ! ! The following items have been added since XFree86 2.0 was released in ! October 1993: ! ! 1) The X Consortium's fix-26 is included. ! 2) Support for pixel multiplexing has been added for Mach32 boards ! with ATI68875, TLC34075 or Bt885 RAMDACs. This allows dot clocks ! up to 135MHz to be used with these boards. ! 3) Support for the TI ViewPoint 3020 RAMDAC used on the #9 GXe ! Level 14 and 16 cards has been added, supporting dot clocks up to ! 135MHz and 200MHz respectively. ! 4) Support for pixel multiplexing (and thus dot clocks up to 135MHz) ! has been added for the SPEA Mercury cards (S3 928 + Bt485). This ! has *not* been tested on other 928 + Bt485 cards. ! 5) Performance improvements for some of the accelerated servers. ! 6) Support has been added for all the display widths available with ! the S3 chips. In addition to the 1024 and 1280 widths supported ! by XFree86 2.0, there is now support for 640, 800 and 2048 with ! all 801, 805 and 928 chips. 1152 is supported with 801/5 chips ! at revision C or later. 1152 and 1600 are supported with 928 ! chips at revision E or later. Note that this change should make ! XFree86 viable on 512k boards. ! 7) Support for 8-bit resolution RGB values (as opposed to the ! standard VGA 6-bit resolution) for S3 cards with AT&T20C490/1, ! Sierra SC15025 or Ti3020 RAMDACs, and for Mach32 cards with ! ATI68875, TLC34075 or Bt885 RAMDACs. ! 8) Support for DRAM based S3 cards using slow memory has been ! improved. ! 9) Accelerated support for the Cirrus chipsets has been enhanced and ! extended to include the lower-end chipsets (5420, 5422, 5424). ! 10) The pvga1 driver can now access all the clocks on boards using the ! WD90C30 and WD90C31 chips. ! 11) The 16 colour generic VGA server has been extended to include ! banked memory support on selected chipsets. This allows it to ! make full use of the available video memory on these boards. This ! server now includes support for GrayScale and StaticGray visuals ! which makes for better use on many laptops. ! 12) Support for the Sigma LaserView and Visa monochrome boards has ! been added to the bdm2 driver in the Mono server. ! 13) Support for Solaris x86 2.1 has been added. ! 14) Support is included for shared libraries on FreeBSD-1.1 and ! NetBSD-current (0.9 based) systems. ! 15) The SuperProbe program introduced with XFree86 1.3 has been updated ! to detect more chipsets, to detect installed video memory, and to ! be more reliable overall. ! 16) Several dozen bug fixes for problems detected and reported for ! XFree86 2.0. Plus a number of other small things. Refer to the CHANGELOG file in the source distribution for full details. *************** *** 116,129 **** 5) Support for the Hercules mono card in the monochrome server, and with it the ability to support a "two headed" server - one mono VGA, and one Hercules. ! 6) Support for Hyundai HGC1280 monochrome graphics card in the ! monochrome server. ! 7) An (experimental) 16-color VGA server is included, which supports ! generic VGA hardware. 8) SVR3 shared libraries, tested under ISC SVR3 2.0.2, 2.2, 3.0.1 and 4.0; SCO 3.2.2, 3.2.4. 9) Support for Linux, 386BSD, NetBSD, FreeBSD, BSD/386, Mach, OSF/1, ! SVR4.2, SCO, Amoeba, and Minix-386. Including Linux shared libraries. 10) Support for LOCALCONN. This support is for both SVR3.2 and SVR4. For SVR4.0.4 with the 'Advanced Compatibility Package' and on SVR4.2, local connections from SCO XSight/ODT clients are supported. --- 128,142 ---- 5) Support for the Hercules mono card in the monochrome server, and with it the ability to support a "two headed" server - one mono VGA, and one Hercules. ! 6) Support for Hyundai HGC1280, Sigma LaserView and Visa monochrome ! graphics card in the monochrome server. ! 7) A 16-color VGA server is included, which supports generic VGA ! hardware. 8) SVR3 shared libraries, tested under ISC SVR3 2.0.2, 2.2, 3.0.1 and 4.0; SCO 3.2.2, 3.2.4. 9) Support for Linux, 386BSD, NetBSD, FreeBSD, BSD/386, Mach, OSF/1, ! SVR4.2, SCO, Solaris 2.1, Amoeba, and Minix-386. Including shared ! libraries for Linux, FreeBSD and NetBSD. 10) Support for LOCALCONN. This support is for both SVR3.2 and SVR4. For SVR4.0.4 with the 'Advanced Compatibility Package' and on SVR4.2, local connections from SCO XSight/ODT clients are supported. *************** *** 154,160 **** 4 - Systems XFree86 has been tested on -------------------------------------- SVR4.0: ! Esix: 4.0.3A, 4.0.4 Microport: 2.2, 3.1, 4.1, 4.2 Dell: 2.1, 2.2 UHC: 2.0, 3.6 --- 167,173 ---- 4 - Systems XFree86 has been tested on -------------------------------------- SVR4.0: ! Esix: 4.0.3A, 4.0.4, 4.0.4.1 Microport: 2.2, 3.1, 4.1, 4.2 Dell: 2.1, 2.2 UHC: 2.0, 3.6 *************** *** 163,168 **** --- 176,182 ---- ISC: 4.0.3 AT&T: 2.1, 4.0 NCR: MP-RAS + SunSoft: Solaris x86 2.1 SVR4.2: Consensys *************** *** 174,195 **** AT&T: 3.2.2 Others: ! 386BSD 0.1, NetBSD 0.9, FreeBSD 1.0 BSD/386 1.0 Mach 386 OSF/1 ! Linux 0.99pl13 Amoeba Minix-386 5 - Supported video-card chipsets --------------------------------- ! At this time, XFree86 2.0 supports the following accelerated chipsets: 8514/A (and true clones) ATI Mach8, Mach32 ! Cirrus CLGD5426, CLGD5428 ! S3 86C911, 86C924, 86C801, 86C805, 86C928 Western Digital WD90C31 The Cirrus and Western Digital accelerators are supported in the SVGA --- 188,209 ---- AT&T: 3.2.2 Others: ! 386BSD 0.1, NetBSD 0.9, FreeBSD 1.1(beta) BSD/386 1.0 Mach 386 OSF/1 ! Linux 0.99pl15h Amoeba Minix-386 5 - Supported video-card chipsets --------------------------------- ! At this time, XFree86 2.1 supports the following accelerated chipsets: 8514/A (and true clones) ATI Mach8, Mach32 ! Cirrus CLGD5420, CLGD5422, CLGD5424, CLGD5426, CLGD5428 ! S3 86C911, 86C924, 86C801, 86C805, 86C805i, 86C928 Western Digital WD90C31 The Cirrus and Western Digital accelerators are supported in the SVGA *************** *** 196,215 **** server; the other chipsets each have their own server. A list of cards on which the accelerated servers have been tested is included in the file AccelCards. They may well work on other cards, but we cannot guarantee it. - Linux and BSD users of the XS3 server are referred to the README.XS3 - file for information on the differences between XS3 and the XFree86 S3 - server. Xconfig files must be changed when using XF86_S3 instead of XS3. In addition, the following SVGA chipsets are supported: Tseng ET3000, ET4000AX, ET4000/W32 Western Digital/Paradise PVGA1 ! Western Digital WD90C00, WD90C10, WD90C11, WD90C30, WD90C31 Genoa GVGA ! Trident TVGA8800CS, TVGA8900B, TVGA8900C, TVGA8900CL, TVGA9000 ATI 28800-4, 28800-5, 28800-a ! NCR 77C22, 77C22E ! Cirrus Logic CLGD5420, CLGD5422, CLGD5424, CLGD5426, CLGD5428, CLGD6205, CLGD6215, CLGD6225, CLGD6235 Compaq AVGA OAK OTI067, OTI077 --- 210,227 ---- server; the other chipsets each have their own server. A list of cards on which the accelerated servers have been tested is included in the file AccelCards. They may well work on other cards, but we cannot guarantee it. In addition, the following SVGA chipsets are supported: Tseng ET3000, ET4000AX, ET4000/W32 Western Digital/Paradise PVGA1 ! Western Digital WD90C00, WD90C10, WD90C11, WD90C24, WD90C30, WD90C31 Genoa GVGA ! Trident TVGA8800CS, TVGA8900B, TVGA8900C, TVGA8900CL, TVGA9000, ! TVGA9000i, TVGA9100B, TVGA9200CX, TVGA9320, TVGA9400CX, TVGA9420 ATI 28800-4, 28800-5, 28800-a ! NCR 77C22, 77C22E, 77C22E+ ! Cirrus Logic CLGD5420, CLGD5422, CLGD5424, CLGD5426, CLGD5428 CLGD6205, CLGD6215, CLGD6225, CLGD6235 Compaq AVGA OAK OTI067, OTI077 *************** *** 222,250 **** Digital, ATI, and Trident) for more information about using those chipsets. The monochrome server also supports generic VGA cards, using 64k of video ! memory in a single bank, the Hercules card, and the Hynudai HGC1280 card. ! On the Compaq AVGA, only 64k of video memory is supported for the monochrome ! server, and the GVGA has not been tested with more than 64k. ! ! XFree86 2.0 includes an experimental 16-color generic VGA server. This ! server has not been as extensively tested and debugged as the others, but ! it should work rather well (but slowly) on most hardware. At this time, ! it does not support banking, hence display is currently limited to 64k ! of memory (approximately 800x600). Note ---- ! It appears that some of the SVGA card manufacturers are going to ! non-traditional mechanisms for selecting pixel-clock frequencies. To ! avoid having to modify the server to accommodate these schemes XFree86 1.2 ! added support for using an external program to select the pixel clock. ! This allows programs to be written as new mechanisms are discovered. ! Refer to the README.clkprog file for information on how these programs ! work, if you need to write one. If you do develop such a program, we ! would be interested in including it with future XFree86 releases. NOTE: The Diamond SpeedStar 24 (and possibly recent SpeedStar+) boards are ! NOT supported, even though they use the ET4000. The same is valid for all of Diamond's S3 boards. The reason for this is that Diamond has changed the mechanism used to select pixel clock frequencies, and will only release programming information under --- 234,264 ---- Digital, ATI, and Trident) for more information about using those chipsets. The monochrome server also supports generic VGA cards, using 64k of video ! memory in a single bank, the Hercules monochrome card, the Hyundai ! HGC1280, Sigma LaserView and Visa monochrome cards. On the Compaq AVGA, ! only 64k of video memory is supported for the monochrome server, and the ! GVGA has not been tested with more than 64k. ! ! The VGA16 server has not been as extensively tested and debugged as the ! others, but it should work rather well (but slowly) on most hardware. ! This server supports memory banking with the ET4000 and Trident chipsets ! allowing virtual display sizes up to about 1600x1200 (with 1MB of video ! memory). For other chipsets the display size is limited to approximately ! 800x600. Note ---- ! Some of the SVGA card manufacturers are using non-traditional mechanisms ! for selecting pixel-clock frequencies. To avoid having to modify the ! server to accommodate these schemes XFree86 1.2 added support for using ! an external program to select the pixel clock. This allows programs to ! be written as new mechanisms are discovered. Refer to the README.clkprog ! file for information on how these programs work, if you need to write one. ! If you do develop such a program, we would be interested in including it ! with future XFree86 releases. NOTE: The Diamond SpeedStar 24 (and possibly recent SpeedStar+) boards are ! NOT supported, even though they use the ET4000. The same is true for all of Diamond's S3 boards. The reason for this is that Diamond has changed the mechanism used to select pixel clock frequencies, and will only release programming information under *************** *** 256,261 **** --- 270,279 ---- DOES NOT SUPPORT DIAMOND HARDWARE. It is possible to make some of it work, but we will not assist in doing this. + Diamond's Cirrus-based boards should work with XFree86 because they + use the standard Cirrus clock synthesiser. This includes the + SpeedStar Pro and possibly the SpeedStar 64. + 6 - Where to get more information --------------------------------- Additional documentation is available in the XFree86(1), Xconfig(4/5), *************** *** 277,283 **** If you are totally at a loss, you can contact the XFree86 Core Team at the electronic mail address below. ! There exists a Usenet news group comp.windows.x.i386unix that contains mostly discussions about XFree86 and related topics. Many questions can be answered there. The answers to common questions are found in the corresponding FAQ. --- 295,301 ---- If you are totally at a loss, you can contact the XFree86 Core Team at the electronic mail address below. ! There is a Usenet news group comp.windows.x.i386unix that contains mostly discussions about XFree86 and related topics. Many questions can be answered there. The answers to common questions are found in the corresponding FAQ. *************** *** 321,332 **** believe that we have worked around this problem, but have not yet solved the root cause. 2) While not strictly a bug, there is currently a limitation on the ! dot-clock frequencies allowed in the S3 and Mach32 servers. For ! S3 cards with the Bt485 RAMDAC (e.g. #9 GXe), the limit is 85Mhz. ! For Mach32 boards, the limit is 80Mhz. There is some special ! programming required to use these RAMDACs at higher dot-clocks, ! and we were not able to get it fully developed in time. We intend ! to release a patch with these updates in the near future. We welcome reports of bugs sent to the electronic mail address listed below. --- 339,350 ---- believe that we have worked around this problem, but have not yet solved the root cause. 2) While not strictly a bug, there is currently a limitation on the ! dot-clock frequencies allowed with the S3 server. For S3 cards ! with the Bt485 RAMDAC (e.g. #9 GXe), the limit is 85Mhz. There ! is some special programming required to use these RAMDACs at higher ! dot-clocks, and we were not able to get it fully developed in ! time. An exception to this is the SPEA Mercury card which is ! supported at dot clocks up to 135MHz. We welcome reports of bugs sent to the electronic mail address listed below. *************** *** 359,364 **** --- 377,385 ---- BSD/386 support by: Hans Nasten Paul Vixie + Solaris support by: + Doug Anson + David Holland SVR3 shared libraries by: Thomas Wolfram Linux shared libraries by: *************** *** 372,377 **** --- 393,399 ---- Jon Tombs David Wexelblat David Dawes + Robin Cutshaw Amancio Hasty Mach32 accelerated code by: Kevin Martin *************** *** 378,383 **** --- 400,406 ---- Rik Faith Mike Bernson Mark Weaver + Craig Groeschel Mach8, 8514 accelerated code by: Kevin Martin Rik Faith *************** *** 386,391 **** --- 409,415 ---- Scott Laird Cirrus accelerated code by: Simon Cooper + Harm Hanemaayer Bill Reynolds Western Digital accelerated code by: Mike Tierney *************** *** 394,400 **** Gertjan Akkerman ATI SVGA driver by: ! Rik Faith Trident SVGA driver by: Alan Hourihane NCR SVGA driver by: --- 418,425 ---- Gertjan Akkerman ATI SVGA driver by: ! Per Lindqvist and Doug Evans ! Ported to X11R5 by Rik Faith Trident SVGA driver by: Alan Hourihane NCR SVGA driver by: *************** *** 410,416 **** Configurable MFB and Hercules driver by: Davor Matic ! Banked Dumb Monochrome and Hyundai drivers by: Pascal Haible X386 1.2, and moral support from: --- 435,441 ---- Configurable MFB and Hercules driver by: Davor Matic ! Banked Dumb Monochrome and related drivers by: Pascal Haible X386 1.2, and moral support from: *************** *** 430,451 **** Ongoing development planning and support is coordinated by the XFree86 Core Team. At this time the Core Team consists of (in alphabetical order): - Robert Baron David Dawes Dirk Hohndel - Glenn Lai Rich Murphey Jon Tombs David Wexelblat , - Thomas Wolfram - Orest Zborowski E-mail sent to will reach the Core Team. ! 11 - Source and binary archive sites ------------------------------------ Source patches based on X11R5 PL25, from MIT, and as an upgrade from ! XFree86 1.3 are available via anonymous FTP from: ftp.x.org (under /contrib/XFree86) ftp.physics.su.oz.au (under /XFree86) --- 455,551 ---- Ongoing development planning and support is coordinated by the XFree86 Core Team. At this time the Core Team consists of (in alphabetical order): David Dawes Dirk Hohndel Rich Murphey Jon Tombs David Wexelblat , E-mail sent to will reach the Core Team. ! 11 - The XFree86 Project, Inc. ! ------------------------------ ! The XFree86 Project, Inc, has been founded to accomplish two major goals: ! ! 1) To provide a vehicle by which XFree86 can be represented in ! X Consortium, Inc, the organization responsible for the ! design, development, and release of The X Window System. ! 2) To provide some basic funding for acquisition of facilities for ! ongoing XFree86 development, largly to consist of new video ! hardware and basic computing facilities. ! ! The first of these was the primary motivation. We have held discussions ! with the X Consortium on and off for many months, attempting to find an ! avenue by which our loosely-organized free software project could be ! given a voice within the X Consortium. The bylaws of the Consortium ! would not recognize such an organization. After an initial investigation ! about funding, we decided to form our own corporation to provide the ! avenue we needed to meet the requirements of the X Consortium bylaws. ! ! By doing this, we are able to be involved in the beta-test interval for ! X11R6, and will be contributing the majority of XFree86 to the X11R6 core ! release. The next full-featured release of XFree86, version 3.0, will ! be present on the X11R6 contributed software tape, with full X11R6 ! support, and (hopefully) a host of new features. As time goes on, ! XFree86 will be involved with more of the development of The X Window ! System, as a full Consortium member. How exactly this will evolve is ! still being determined. ! ! An additional benefit of this incorporation is that The XFree86 Project, ! Inc has obtained outside financial support for our work. This will ! hopefully give us the freedom to be more proactive in obtaining new ! video hardware, and enable us to release better products more quickly, ! as we will be able to go and get what we need, and get it into the hands ! of the people who can do the work. ! ! The initial Board of Directors and Officers of the The XFree86 Project, ! Inc, are the same XFree86 Core Team as is listed above. Our bylaws have ! been crafted in such a way to ensure that XFree86 is and always will ! be a free software project. There is no personal financial benefit ! to any member of the Core Team or any other XFree86 participant. All ! assets of the corporation remain with the corporation, and, in the event ! of the dissolution of the corporation, all assets will be turned over ! to the X Consortium, Inc. It is hoped that by doing this, our corporation ! will be merely a formalization of what we have been doing in the past, ! rather than something entirely new. ! ! Here is a list of the organizations and individuals who have provided ! sponsorship to The XFree86 Project, Inc, either by financial contribution ! or by the donation of equipment and resources. The XFree86 Project, Inc ! gratefully acknowledges these contributions, and hopes that we can do ! justice to them by continuing to release high-quality free software for ! the betterment of the Internet community as a whole. ! ! UUNET Communications Services, Inc. ! ! UUNET Communications Services, Inc, deserves special mention. This ! organization stepped forward and contributed the entire 1994 X Consortium ! membership fee on a moment's notice. This single act ensured XFree86's ! involvement in X11R6. ! ! AIB Software Corporation ! American Micro Group ! AT&T Global Information Services (formerly NCR) ! BSDI ! InfoMagic ! LunetIX ! Frank & Paige McCormick ! Prime Time Freeware ! Red Hat Software ! ! The XFree86 Project, Inc, welcomes the additional contribution of funding ! and/or equipment. Such contributions should be tax-deductible; we will ! know for certain when the lawyers get finished with the papers. For more ! information, contact The XFree86 Project, Inc, at ! ! We are in the process of establishing our own Internet domain, XFree86.Org. ! Most of the pieces are in place, and we hope to be online within a few ! more weeks. We will post an announcement when this is ready for use. ! ! 12 - Source and binary archive sites ------------------------------------ Source patches based on X11R5 PL25, from MIT, and as an upgrade from ! XFree86 2.0 are available via anonymous FTP from: ftp.x.org (under /contrib/XFree86) ftp.physics.su.oz.au (under /XFree86) *************** *** 478,486 **** tsx-11.mit.edu - Linux binaries under /pub/linux/packages/X11 ftp.unipi.it - Linux binaries ! under /pub/linux/XFree86_2.0 XFree86.cdrom.com - FreeBSD binaries ! under /pub/XFree86/FreeBSD/XFree86-2.0 gil.physik.rwth-aachen.de - FreeBSD binaries under /pub/XFree86 agate.berkeley.edu - NetBSD 0.9 binaries --- 578,586 ---- tsx-11.mit.edu - Linux binaries under /pub/linux/packages/X11 ftp.unipi.it - Linux binaries ! under /pub/linux/XFree86_2.1 XFree86.cdrom.com - FreeBSD binaries ! under /pub/XFree86/FreeBSD/XFree86-2.1 gil.physik.rwth-aachen.de - FreeBSD binaries under /pub/XFree86 agate.berkeley.edu - NetBSD 0.9 binaries *************** *** 489,503 **** under /pub/NetBSD/ports ftp.cs.mcgill.ca - NetBSD 0.9 binaries under /pub/NetBSD/XFree86 - ftp.cs.uwm.edu - Mach386 binaries - under /i386 ! Ensure that you are getting XFree86 2.0 - some of these sites may archive older releases as well. Each binary distribution will contain a README file that describes what files you need to take from the archive, and which compile-time option selections were made when building the distribution. ! 23 October, 1993 ! $XFree86: mit/server/ddx/x386/README,v 2.8 1993/10/24 13:43:59 dawes Exp $ --- 589,601 ---- under /pub/NetBSD/ports ftp.cs.mcgill.ca - NetBSD 0.9 binaries under /pub/NetBSD/XFree86 ! Ensure that you are getting XFree86 2.1 - some of these sites may archive older releases as well. Each binary distribution will contain a README file that describes what files you need to take from the archive, and which compile-time option selections were made when building the distribution. ! 6 March 1994 ! $XFree86: mit/server/ddx/x386/README,v 2.13 1994/03/08 08:07:02 dawes Exp $ diff -c mit/server/ddx/x386/README.Amoeba:2.0 mit/server/ddx/x386/README.Amoeba:2.1 *** mit/server/ddx/x386/README.Amoeba:2.0 Fri Mar 11 23:35:36 1994 --- mit/server/ddx/x386/README.Amoeba Fri Mar 11 23:35:36 1994 *************** *** 80,88 **** make World BOOTSTRAPCFLAGS='-DCROSS_COMPILE' >BuildX.i80386 2>&1 & ! - When this has finished succesfully, the client and server binaries, scripts, and other support files can be installed from Unix to Amoeba by means of the command "make install" in the X11R5/mit config tree. ! $XFree86: mit/server/ddx/x386/README.Amoeba,v 2.0 1993/10/24 13:44:01 dawes Exp $ --- 80,88 ---- make World BOOTSTRAPCFLAGS='-DCROSS_COMPILE' >BuildX.i80386 2>&1 & ! - When this has finished successfully, the client and server binaries, scripts, and other support files can be installed from Unix to Amoeba by means of the command "make install" in the X11R5/mit config tree. ! $XFree86: mit/server/ddx/x386/README.Amoeba,v 2.1 1994/03/08 08:07:05 dawes Exp $ diff -c mit/server/ddx/x386/README.BSD:2.3 mit/server/ddx/x386/README.BSD:removed *** mit/server/ddx/x386/README.BSD:2.3 Fri Mar 11 23:35:36 1994 --- mit/server/ddx/x386/README.BSD Fri Mar 11 23:35:36 1994 *************** *** 1,471 **** - README for XFree86 2.0 on FreeBSD 1.0 and NetBSD 0.9 - ---------------------------------------------------- - - Contents - -------- - 0) Notes - 1) What and Where is XFree86? - 2) Bug Reports for This Document - 3) Installing The Binaries - 4) Installing Xdm, the display manager - 5) Configuring X for Your Hardware - 6) Running X - 7) Kernel Support for X - 8) Rebuilding the XFree86 Distribution - 9) Building New X Clients - - - 0 - Notes - --------- - Unless indicated otherwise, *BSD refers to both FreeBSD 1.0 and NetBSD - 0.9. A binary distribution is not available for 386BSD 0.1. The XFree86 - 2.0 source code supports 386BSD 0.1, but future version probably will not. - - 1 - What and Where is XFree86? - ------------------------------ - XFree86 is a port of X11R5 that supports several versions of Intel-based - Unix. It is derived from X386 1.2, which was the X server distributed - with X11R5. This release consists of many new features and performance - improvements as well as many bug fixes. The release is available as - source patches against the MIT X11R5 code, as well as binary distributions - for many architectures. - - The sources for XFree86 are available by anonymous ftp from: - - ftp.x.org:/contrib/XFree86 - ftp.physics.su.oz.au:/XFree86. - - Binaries for XFree86 on FreeBSD will be available from: - - XFree86.cdrom.com:/pub/XFree86/FreeBSD/XFree86-2.0 - gil.physik.rwth-aachen.de:/pub/XFree86 - - Binaries for NetBSD 0.9 will be available from: - - ftp.cs.mcgill.ca:/pub/NetBSD - agate.berkeley.edu:/pub/NetBSD/ports - sun-lamp.cs.berkeley.edu:/pub/NetBSD/ports - - On US ftp sites note 00README-Legal-Rules-Regs or README.export-control - which state that ftp users outside the U.S. should not copy - XFree86-2.0-xdm-des.tar.gz from sites within the U.S. because it employs - DES encryption. - - 2 - Bug Reports for This Document - --------------------------------- - Send email to Rich-Murphey@Rice.edu or XFree86@physics.su.oz.au - if you have comments or suggestions about this file and we'll revise it. - NetBSD specific issues should be sent to Marc Wandschneider, - storm@cs.mcgill.ca - - 3 - Installing the Binaries - --------------------------- - - FreeBSD: - =------= - The binary distribution is composed of a number of tar archives - which are the executables, servers, fonts, libraries, include files, - man pages, config files, and server link kit. The full distribution - takes 43Mb. The bin archive is split into 1 meg pieces. - - The contents of the archives are: - - Required: - - bin - all the executable X client applications (required) - fonts - the misc and 75 dpi fonts (required) - doc - READMEs, install scripts, and XFree86 specific man pages - lib - data files needed at runtime (required) - config - customizable xinit, xdm and fs runtime configuration files - - Choose at least one matching your video hardware: - - 8514 - server for IBM 8514/A boards - Mach32 - server for ATI Mach32 graphic accelerator boards - Mach8 - server for ATI Mach8 graphic accelerator boards - Mono - monochrome server for VGA, Super-VGA, Hercules, and others - S3 - server for S3 based boards - SVGA - 8-bit pseudocolor server for Super-VGA cards - VGA16 - 4-bit pseudocolor server for VGA and Super-VGA cards - - Optional: - - man - man pages except XFree86 specific ones in etc archive - fonts-100dpi - optional 100dpi fonts - fonts-scaled - optional Speedo and Type1 fonts - prog - lib*.a and *.h files needed only for compiling - xdm-des - xdm executable with des encryption - xdm-nodes - xdm executable with no encryption - linkkit - optional X server reconfiguration kit - fontserver - the font server and it's man page - pex - pex clients, libraries, header files and data. - - If this is your first time, you can safely just install all of them. - - But at a minimum you need to unpack the following: bin, fonts, doc, - lib, config and a server archive that matches your vga card. - - To unpack the archives use: - - cat XFree86-2.0-bin.tar.gz.* | gunzip | tar xf - - cat XFree86-2.0-etc.tar.gz | gunzip | tar xf - - cat XFree86-2.0-fonts-100dpi.tar.gz | gunzip | tar xf - - cat XFree86-2.0-fonts-scaled.tar.gz | gunzip | tar xf - - cat XFree86-2.0-fonts.tar.gz | gunzip | tar xf - - cat XFree86-2.0-fontserver.tar.gz | gunzip | tar xf - - cat XFree86-2.0-lib.tar.gz | gunzip | tar xf - - cat XFree86-2.0-linkkit.tar.gz | gunzip | tar xf - - cat XFree86-2.0-man.tar.gz | gunzip | tar xf - - cat XFree86-2.0-pex.tar.gz | gunzip | tar xf - - cat XFree86-2.0-prog.tar.gz | gunzip | tar xf - - cat XFree86-2.0-xdm-des.tar.gz | gunzip | tar xf - - cat XFree86-2.0-xdm-nodes.tar.gz | gunzip | tar xf - - cat XFree86-2.0-config.tar.gz | gunzip | tar xf - - cat XFree86-2.0-8514.tar.gz | gunzip | tar xf - - cat XFree86-2.0-Mach32.tar.gz | gunzip | tar xf - - cat XFree86-2.0-Mach8.tar.gz | gunzip | tar xf - - cat XFree86-2.0-Mono.tar.gz | gunzip | tar xf - - cat XFree86-2.0-S3.tar.gz | gunzip | tar xf - - cat XFree86-2.0-SVGA.tar.gz | gunzip | tar xf - - cat XFree86-2.0-VGA16.tar.gz | gunzip | tar xf - - - After unpacking the archives, run the installation script, - x386install, it creates links so that the distribution appears to be - in /usr/X386, checks the /dev and /etc/ttys entries, and adds - /usr/X386/bin to the default path in /etc/csh.login. - - ./X386/lib/X11/etc/x386install - - Create a symbolic link for the server that matches your vga card. For - example, if you have an ET4000 based SVGA card, then you want a - symbolic link for the SVGA server: - - cd /usr/X386/bin; rm X; ln -s XF86_SVGA X - - Also make sure to add /usr/X386/bin to your shell's `path' variable. - - If X was already installed and you have have customized your xinit or - xdm runtime configuration scripts, omit the config archive or unpack - it elsewhere and merge in your customizations. The fonts-scaled and - fonts-100dpi archives are optional and can be omitted if you are short - on space. The optional linkkit archive which allows you to - reconfigure and link a server. The optional the prog archive is - needed only for writing or compiling X applications. The optional pex - archive contains pex clients and libraries for writing pex applications. - - NOTE: Do not uncompress the font files without subsequently rerunning - mkfontdir in the corresponding font directory; otherwise your server - will abort with the message "could not open default font 'fixed'". - - - NetBSD: - =-----= - The binary distribution is composed of a number of split tar archives - which are the executables, servers, fonts, libraries, include files, - man pages, config files, and the server link kit. The full distribution - takes over 40MB of disk space. The large archives are split into - smaller chunks. - - The contents of the archives are: - - bin - all of the executable X client applications (except xdm) - include - the include/X11 header files - fonts - the misc, 75dpi, 100dpi, and scaled fonts - doc - READMEs, install scripts, and XFree86 specific man pages. - lib - X11 libraries, and data files needed at runtime - config - customizable xinit, xdm, and fs runtime configuration files. - - Choose at least one of the following to match your hardware: - - 8514 - the X server for IBM 8514/A and compatible boards - Mach8 - the X server for ATI Mach8 graphics accelerator boards - Mach32 - the X server for ATI Mach32 graphics accelerator boards - S3 - the X server for S3 based boards - SVGA - the 8-bit pseudo-color X server for Super VGA cards - VGA16 - the 4-bit pseudo-color X server for VGA & SVGA cards. - Mono - the Monochrome X Server - - OPTIONAL: - - man - man pages except XFree86 specific ones in the etc archive - xdm-des - xdm executable with DES encryption - xdm-no-des - xdm executable without DES encryption - linkkit - optional X server reconfiguration kit - pex - pex clients, libraries, header files and data - - - If this is your first time, then you should be able to safely - install all of the packages. If you're going to be installing the - source as well, then you might not want to bother with the linkkit and - pex archives. As a minimal install, you'll need bin, include, fonts - doc, lib, config, and one X server. - - To unpack and install the archives: - - 1. create some destination directory in which you'd like the - X distribution to live. /usr/X386 is recommended, but if that - partiton is full (as it is on my machine), then just create an - alternate directory, and sym-link /usr/X386 to this place. - - ie, on my machine, I do the following: - - % cd /usr/local - % mkdir X11 - % ln -s /usr/local/X11 /usr/X386 - - - 2. Assuming that the destination directory for XFree86 2.0 is /usr/X386, - run the following from whereever all the archive files are (replace - /usr/X386 with wherever you wish them to go if that isn't the place): - - % cat XFree86-2.0-bin.tar.gz.* | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-include.tar.gz.* | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-fonts.tar.gz.* | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-doc.tar.gz | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-lib.tar.gz.* | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-config.tar.gz | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-man.tar.gz | gunzip | (cd /usr/X386; tar xf -) - - # Choose only one of the following two - % cat XFree86-2.0-xdm-des.tar.gz | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-xdm-no-des.tar.gz | gunzip | (cd /usr/X386; tar xf -) - - % cat XFree86-2.0-linkkit.tar.gz.* | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-pex.tar.gz | gunzip | (cd /usr/X386; tar xf -) - - # Choose one ore more servers to install - % cat XFree86-2.0-8514.tar.gz | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-Mach8.tar.gz | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-Mach32.tar.gz | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-S3.tar.gz | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-SVGA.tar.gz | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-VGA16.tar.gz | gunzip | (cd /usr/X386; tar xf -) - % cat XFree86-2.0-Mono.tar.gz | gunzip | (cd /usr/X386; tar xf -) - - - 3. You should now run the script x386install.netbsd from lib/X11/etc. - It is invoked as follows (assuming we are in the top level dir of - where we installed X to): - - % lib/X11/etc/x386install.netbsd $DIRNAME - - where $DIRNAME is this top level dir (ie /usr/X386, /usr/local/X386, - /usr/local/X11, or wherever) - - This script verifies that /usr/X386 points to the correct place, - checks the /dev/ and /etc/ttys entries, and adds /usr/X386/bin to the - default path in /etc/csh.login. - - You should also add /usr/X386/bin to your own shell's path variable. - - - If X was already installed on your machine and you have customized your - xinit or xdm runtime configuation scripts, omit the config archive or unpack - it elsewhere and extract only that which you need. - - NOTE: Do not uncompress the font files in lib/X11/fonts without - subsequently running 'mkfontdir' in the corresponding font directory; - otherwise, your server will abort with the message "could not open default - font 'fixed'". - - 4 - Installing Xdm, the display manager - --------------------------------------- - Export restrictions prevent us from providing support for DES - encryption outside the US. If you have not installed FreeBSD's - optional securedist/des, then passwords in /etc/passwd.master are - unencrypted and you should install the version of xdm without DES - encryption: - - - FreeBSD: - =------= - cat XFree86-2.0-xdm-nodes.tar.gz | gunzip | tar xf - - cd /usr/X386/bin; ln -s xdm-nodes xdm - - NetBSD: - =-----= - % cat XFree86-2.0-xdm-no-des.tar.gz | gunzip | (cd /usr/X386; tar xf -) - - The xdm-nodes binary uses the *BSD dummy crypt routine that - prints the message 'Crypt not present in system' in the xdm-errors - file each time a user logs in. You can ignore this. It just means - /etc/passwd.master is unencrypted. If you install xdm-des by mistake - xdm will not accept any passwords. - - If you have installed the optional securedist/des (secr09 for NetBSD) package - on your system then you are using DES encryption on passwords and you should - install xdm-des: - - FreeBSD: - =------= - cat XFree86-2.0-xdm-des.tar.gz | gunzip | tar xf - - cd /usr/X386/bin; ln -s xdm-des xdm - - NetBSD: - =------= - % cat XFree86-2.0-xdm-des.tar.gz | gunzip | (cd /usr/X386; tar xf -) - - To start the display manager, log in as root on the console and type - `xdm -nodaemon'. - - You can start xdm automatically on bootup by disabling the console getty - adding the following code to /etc/rc.local: - - if [ -x /usr/X386/bin/xdm ]; then - echo -n ' xdm'; /usr/X386/bin/xdm - fi - - To disable the console getty, change 'on' to 'off' in the console - entry in /etc/ttys: - - console "/usr/libexec/getty Pc" cons25 off secure - - 5 - Configuring X for Your Hardware - ----------------------------------- - You *must* create /usr/X386/lib/X11/Xconfig to suit your hardware. - See README.Config for step-by-step instructions for setting it up. - - The Xconfig file tells the X server what kind of monitor, adapter and - mouse you have. In addition to README.Config, the server manual pages - (XF86_Accel, XF86_Mono, XF86_SVGA, and XF86_VGA16) describe the - options specific to each type of board. - - Read README.Config, and look in /usr/X386/lib/X11/etc/modeDB.txt and - /usr/X386/lib/X11/etc/AccelCards to find Clocks and ModeDB entries to your - specific monitor and graphics card. If you can find them there, grab the - Clocks and ModeDB lines and put them in your Xconfig. If not, read - /usr/X386/lib/X11/etc/VideoModes.doc for instructions on how to create the - video timing values given your vga card and monitor specs. The manual for - your monitor and adapter should have these values. The tuner program (on - FreeBSD.cdrom.com /pub/386BSD/0.1-ports/XFree86-2.0) can calculate a rough - guess about a ModeDB line given the dot clock rate and horizontal - frequency of your monitor. - - Note: 386BSD, FreeBSD, and NetBSD do not support memory mapping of video - memory on vesa local bus cards. For these cards the server will respond - 'Direct memory accessing has been disabled', which is normal. - - The X server (except the 8514 and Mach32 servers) will print out the - Clocks values for your card if you leave them our of your Xconfig file - when you run: - - X -probeonly >& x.out - - You can take these values and edit them to put them in your Xconfig file; - although you MUST include all the clock values, AND leave them in the same - order. - - If your mouse does not work try using kermit or tip to connect to the - mouse serial port and verify that it does indeed generate characters. - - For NetBSD 0.9, Microsoft BusMouse users will find that the following - line should work: - - BusMouse "/dev/mms0" - - 6 - Running X - ------------- - 8mb of memory is a recommended minimum for running X. The server, - window manager and an xterm take about 2.5 Mb of memory themselves. On a - 4Mb system that would leave very little left over for other applications - like gcc that expect a few meg free. X will work with 4Mb of memory, but - in practice compilation while running X can take 5 or 10 times as long due - to constant paging. - - The easiest way for new users to start X windows is to type 'startx >& - startx.log'. Error messages are lost unless you redirect them because - the server takes over the screen. - - To get out of X windows, type 'exit' in the console xterm. You can - customize your X by creating .xinitrc, .xserverrc, and .twmrc files in - your home directory as described in the xinit and startx man pages. - - 7 - Kernel Support for X - ------------------------ - The server supports several console drivers: pccons, syscons, codrv - and pcvt. They are detected at runtime and no configuration of the - server itself is required. - - The pccons driver is the most widely tested and is the console driver - contained in the FreeBSD binary distribution's kernels, as well as - that shipped with the GENERICAHA kernels in NetBSD 0.9. - - In order to insead use the syscons driver, you must reconfigure, - compile and install a new kernel from the FreeBSD sources. For a - general description of BSD kernel configuration get smm.02.config.ps.Z - from gatekeeper.dec.com (16.1.0.2) in /pub/BSD/manuals. It is a ready - postscript copy of the kernel configuration chapter from the systems - maintainers manual. - - To make sure X support is enabled under NetBSD 0.9, the following - line must be in your config file in /sys/arch/i386/conf: - - options XSERVER, UCONSOLE - - To use syscons 0.1 with NetBSD 0.9, obtain the syscons 0.1 package, - and apply the patches in the file syscons-0.1.patch, available from - ftp.cs.mcgill.ca:/pub/NetBSD/ports. - - The codrv console driver is not bundled with FreeBSD, nor with NetBSD. - It is available from ftp.uni-duisburg.de in - /pub/unix/386bsd-0.1/unofficial/codrv and from bsd386.first.gmd.de in - ~veit/codrv (no ANON FTP, login with 'guest'/'guest', cd to ~veit/codrv). - It is not clear that anybody has attempted to get this working with - NetBSD 0.9 - - The pcvt console driver is also not bundled with *BSD. There are - patches available for pcvt version 2.10 to make it compatible with - XFree86. Recent pcvt sources along with these patches can be found on - irzr11.inf.tu-dresden.de (141.76.4.11) in /pub/unix/386bsd/pcvt. - Refer to the file README.X-PATCHES there for more information. The - pcvt X mode is compatible with the pccons driver X mode. - - 8 - Rebuilding the XFree86 Distribution - --------------------------------------- - The server link kit allow you to rebuild just the X server with a - minimum amount of disk space. Just unpack it, make the appropriate - changes to the site.def, type './mkmf' and 'make' to link the server. - See /usr/X386/lib/Server/README for more info. - - See /usr/X386/lib/X11/etc/INSTALL for instructions on unbundling and - building the source distribution. You should configure the - distribution by editing mit/site.def before compiling. To compile the - sources, invoke - - FreeBSD: - =------= - make World BOOTSTRAPCFLAGS=-DFreeBSD - - NetBSD: - =-----= - make World BOOTSTRAPCFLAGS= - # _NOT_ -DNetBSD!!!!!, just empty. - - in the mit directory. - - 9 - Building New X Clients - -------------------------- - The easiest way to build a new client (X application) is to use - xmkmf if an Imakefile is included in the sources. Type 'xmkmf -a' to - create the Makefiles, check the configuration if necessary and type - 'make'. Whenever you install additional man pages you should update - whatis.db by running 'makewhatis /usr/X386/man'. To avoid the - `Virtual memory exhausted' message from cc while compiling, increase - the data and stack size limits (in csh type `limit datasize 32M' and - `limit stacksize 16M'). - - - Many thanks to - - Pace Willison for providing the initial port to 386BSD. - - Amancio Hasty for fixing cursor restoration, mouse bugs and many others. - - Christoph Robitschko for fixing com.c and thus select(). - - Nate Williams for the patchkit support for X. - - Rod Grimes and Jack Velte of Walnut Creek Cdrom for use - of their machines in preparing the FreeBSD binary release. - - Rich Murphey - David Dawes - Marc Wandschneider - - - $XFree86: mit/server/ddx/x386/README.BSD,v 2.3 1993/10/24 13:44:04 dawes Exp $ --- 0 ---- diff -c mit/server/ddx/x386/README.Bsdi:2.3 mit/server/ddx/x386/README.Bsdi:2.4 *** mit/server/ddx/x386/README.Bsdi:2.3 Fri Mar 11 23:35:37 1994 --- mit/server/ddx/x386/README.Bsdi Fri Mar 11 23:35:37 1994 *************** *** 1,4 **** ! README for XFree86 2.0 on BSDI 1.0 ---------------------------------- Contents --- 1,4 ---- ! README for XFree86 2.1 on BSDI 1.0 ---------------------------------- Contents *************** *** 75,81 **** 4 - Rebuilding the XFree86 Distribution --------------------------------------- ! The INSTALL file describes how to create and build the XFree86-2.0 source distribution. When building for BSD/386, the default compiler is gcc-1.40. If you want to use gcc-2.4.5, define "#define HasGcc2 YES" in config/site.def. The compiler --- 75,81 ---- 4 - Rebuilding the XFree86 Distribution --------------------------------------- ! The INSTALL file describes how to create and build the XFree86-2.1 source distribution. When building for BSD/386, the default compiler is gcc-1.40. If you want to use gcc-2.4.5, define "#define HasGcc2 YES" in config/site.def. The compiler *************** *** 87,95 **** config/site.def. The default is to skip the font creation. If you are using X when doing "make World", keep the number of open windows ! to a minimum or you may get "Can't fork" errors from make. The make program distributed with BSD/386 1.0 has been seen doing recompilations in the wrong order. When that happens, you can usually restart ! the make and it will complete OK. Gnu Make 3.67 or higher works much better. ! $XFree86: mit/server/ddx/x386/README.Bsdi,v 2.3 1993/10/24 13:44:05 dawes Exp $ --- 87,99 ---- config/site.def. The default is to skip the font creation. If you are using X when doing "make World", keep the number of open windows ! to a minimum or you may get "Can't fork" errors from make. Another way to ! avoid this problem is to raise your process limit to 64. If you are using ! bash the command is "ulimit -u 64". With csh use "limit maxproc 64". ! The make program distributed with BSD/386 1.0 has been seen doing recompilations in the wrong order. When that happens, you can usually restart ! the make and it will complete OK. Gnu Make 3.70 works much better and builds ! without problems on BSD/386 1.0. ! $XFree86: mit/server/ddx/x386/README.Bsdi,v 2.4 1994/03/05 11:54:56 dawes Exp $ diff -c mit/server/ddx/x386/README.Config:2.3 mit/server/ddx/x386/README.Config:2.4 *** mit/server/ddx/x386/README.Config:2.3 Fri Mar 11 23:35:38 1994 --- mit/server/ddx/x386/README.Config Fri Mar 11 23:35:38 1994 *************** *** 61,69 **** server binaries are: XF86_SVGA: 256-color Super-VGA server. Contains accelerated ! support for Cirrus 542{6,8} and Western Digital 90C31 ! chipsets, unaccelerated for the rest of the supported ! chipsets. XF86_Mono: (S)VGA monochrome, optionally Hercules or other monochrome hardware support is linked in. XF86_VGA16: Generic VGA 16-color server (experimental). --- 61,69 ---- server binaries are: XF86_SVGA: 256-color Super-VGA server. Contains accelerated ! support for Cirrus 542{0,2,4,6,8} and Western ! Digital 90C31 chipsets, unaccelerated for the rest ! of the supported chipsets. XF86_Mono: (S)VGA monochrome, optionally Hercules or other monochrome hardware support is linked in. XF86_VGA16: Generic VGA 16-color server (experimental). *************** *** 449,452 **** "1280x1024" 135 1280 1312 1456 1712 1024 1027 1030 1064 ! $XFree86: mit/server/ddx/x386/README.Config,v 2.3 1993/10/24 13:44:07 dawes Exp $ --- 449,452 ---- "1280x1024" 135 1280 1312 1456 1712 1024 1027 1030 1064 ! $XFree86: mit/server/ddx/x386/README.Config,v 2.4 1994/03/05 08:22:39 dawes Exp $ diff -c mit/server/ddx/x386/README.Linux:2.4 mit/server/ddx/x386/README.Linux:2.8 *** mit/server/ddx/x386/README.Linux:2.4 Fri Mar 11 23:35:39 1994 --- mit/server/ddx/x386/README.Linux Fri Mar 11 23:35:39 1994 *************** *** 5,130 **** ---------- 1) Linux versions on which XFree86 has been tested 2) Running XFree86 ! 3) Compiling XFree86 ! 4) Compiling a PEX server ! 5) Omissions 1 - Linux versions on which XFree86 has been tested --------------------------------------------------- ! XFree86 has been tested with Linux version 0.99pl13. It should work with any later version without change. The binaries and libraries are based ! on the 4.4.1 DLL C libraries. The DLL X libraries are produced with the 2.9 ! dll-tools by Eric Youngdale. - !!! TO USE THE BINARIES YOU NEED DAVID ENGEL'S SHARED DYNAMIC LINKER ld.so - !!! INSTALLED !!! - - You should include /usr/X386/lib in /etc/ld.so.conf (it is in there by - default) or in your LD_LIBRARY_PATH environment variable. - 2 - Running XFree86 ------------------- XFree86 is installed in /usr/X386. It requires about 4mb of virtual memory to run, although having 8mb of RAM is probably the minimum comfortable configuration. A 387 coprocessor is helpful for 386 machines, although ! greater gains in interactive performace are obtained with an increase in physical memory. Also, a faster graphics card, bus or RAM, will improve server performance. ! After unpacking the tar files, you need to include /usr/X386/lib in ! /etc/ld.so.conf (where it should already be by default) or in your LD_LIBRARY_PATH environment variable. Also, the configuration file ! /usr/X386/lib/X11/Xconfig *MUST* be modified based on the host setup. ! You may damage your hardware if you use a wrong Xconfig file, so ! READ THE DOCS, especially the man pages and the other README files in ! /usr/X386/lib/X11/etc. ! ! Old binaries (linked to XFree86-1.2 or XFree86-1.3 libraries) ! will continue to work, but may need an explicit symlink from ! /lib/libX{11,t,aw}.so.3 to /usr/X386/lib/libX{11,t,aw}.so.3. Linking ! with ld.so against the XView 3L5 distribution will give problems with ! pre-1.3 versions of ld.so, since the XView libraries contain the ! absolute path to the shared images, which is discuraged with ld.so. A ! tempoary fix is including / in /etc/ld.so.config, better recompile ! XView with relative library names or get a newer ld.so. ! XFree86 has the ability to perform VT switching to and from the X server. When first started, XFree86 will automatically locate the first ! available VT (one that hasn't been opened by any process), and run on that VT. ! If there isn't one available, XFree86 will terminate with an error message. ! The server can be run on a specific VT by using the "vt" option, where ! is the number of an available VT (starting from 1). ! ! Once running inside X, switching to another VT is accomplished ! by pressing Ctrl-Alt- where nn is the number of the VT to switch ! to. To return to the server, press the proper key-combination that ! moves you back to the VT that XFree86 is using: by default, this is ! Alt-, where mm is the number of the VT the server is running on ! (this number is printed when the server is started). Note that this is ! NOT the VT from which the server was started. ! NOTE: you can redefine the text-mode keybindings with the 'loadkeys' ! command found in the kbd-0.81.tar.gz archive. With this, you can (for ! example) make Ctrl-Alt- work from text mode the same way it works ! under the XFree86 server. ! ! CAUTION: There are versions of the Linux Kernel (including some pl12 ! and pl13 releases), that don't restore the status of the Ctrl and Alt ! key correctly when switching to a VT. This can be solved by pressing ! and releasing the CTRL and ALT key after switching (or by upgrading ! to a newer kernel...). This will be fixed in the next kernel version. ! ! When the server is exited, it will return to the original VT it was ! started from, unless it dies unexpectedly, when the switch must be done ! manually. ! There are some quirks that may need some fixing depending on your ! configuration. In the past, Linux xload used the BSD method of obtaining the ! load average from the running kernel. In the XFree86-1.3 release, that has ! been replaced by reading the information from /proc/loadavg instead, which ! should be forward-compatible with future kernel releases. Xman has also been ! changed to support the GNU groff family instead of the BSD nroff family. A ! quick edit and recompile restores BSD conventions. The server has been modified ! to provide better console redirection support for clients, which includes ! changing the ownership of /dev/console and /dev/tty0 as well as the VT used ! to run on. Unfortunately, the kernel requires that a process be setuid root ! to perform console redirection, so xterm and xconsole must be setuid root. ! 3 - Compiling XFree86 --------------------- There are no special instructions required for compiling XFree86. ! This version was compiled with gcc-2.4.5, the 4.4.1 DLL libraries and the ! 1.3 shared, dynamic linker ld.so. The tools-2.9 DLL package was used to ! generate the shared libraries. The server has been compiled with -m486, ! which optimizes it for the 486 processor, but the binary will run on the ! 386 processor (there is a slight increase in binary size over using -m386, ! but no loss of performance). The distribution is very large, but it is possible to compile XFree86 on a single 64mb partition, if the source tree is carefully ! trimmed (no manpages, PEX or large clients). Simply run "make World" to ! create the Makefiles, then stop the make and run each piece individually. It ! is not necessary to run "make depend" as well, which saves some space. ! Having 100mb available makes compiling XFree86 a lot easier. You will need ! about 10mb of virtual memory to compile the entire server. ! ! There is an external problem with compiling the server. The ! makedepend program does not search the private gcc include directory for ! headers (i.e. float.h), so there are lots of warnings generated during the ! make depend phase. These can be safely ignored, or the private headers can ! be symlinked to /usr/include. A better solution which involves cpp directly ! is being investigated. There is support now for creating X DLL libraries. By default, certain libraries are compiled into both static and shared form, but this can be changed by editing mit/config/lnuxLib.rules. The new shared library symlinks no longer need to be moved to /lib, as starting with XFree86-2.0 ! the shared, dynamic linker ld.so is used. ! If patches are applied which change the libraries, modified ! jump_xxx files will be needed. Those can be generated according to ! instructions given in the dll tools package, and will be made ! available as XFree86 patches. Thanks to Dirk Hohndel (hohndel@informatik.uni-wuerzburg.de) for working out all the details and doing all the work in creating the first --- 5,144 ---- ---------- 1) Linux versions on which XFree86 has been tested 2) Running XFree86 ! 3) Backwards Compatibility ! 4) Compiling XFree86 ! 5) Compiling a PEX server ! 6) Omissions 1 - Linux versions on which XFree86 has been tested --------------------------------------------------- ! XFree86 has been tested with Linux version 0.99pl15h. It should work with any later version without change. The binaries and libraries are based ! on the 4.5.21 DLL C libraries, and the 1.4.3 dynamic linker ld.so. The DLL X ! libraries are produced with the 2.11 DLL-tools by Eric Youngdale. 2 - Running XFree86 ------------------- XFree86 is installed in /usr/X386. It requires about 4mb of virtual memory to run, although having 8mb of RAM is probably the minimum comfortable configuration. A 387 coprocessor is helpful for 386 machines, although ! greater gains in interactive performance are obtained with an increase in physical memory. Also, a faster graphics card, bus or RAM, will improve server performance. ! After unpacking the tar files, you need to include /usr/X386/lib ! in /etc/ld.so.conf (where it should already be by default) or in your LD_LIBRARY_PATH environment variable. Also, the configuration file ! /usr/X386/lib/X11/Xconfig *MUST* be properly filled out based on the host ! setup using Xconfig.sample as a starting point and README.Config as ! guideline. You may damage your hardware if you use a wrong Xconfig file, ! so READ THE DOCS, especially the man pages and the other README files in ! /usr/X386/lib/X11/etc. ! XFree86 has the ability to perform VT switching to and from the X server. When first started, XFree86 will automatically locate the first ! available VT (one that hasn't been opened by any process), and run on that ! VT. If there isn't one available, XFree86 will terminate with an error ! message. The server can be run on a specific VT by using the "vt" ! option, where is the number of an available VT (starting from 1). If ! you don't have a free VT XFree86 cannot run. You can increase the number ! of available VTs by increasing the value of NR_CONSOLES in ! include/linux/tty.h and recompiling the kernel. ! ! Once running inside X, switching to another VT is accomplished by ! pressing Ctrl-Alt- where nn is the number of the VT to switch to. To ! return to the server, press the proper key-combination that moves you back ! to the VT that XFree86 is using: by default, this is Alt-, where mm ! is the number of the VT the server is running on (this number is printed ! when the server is started). Note that this is NOT the VT from which the ! server was started. ! NOTE: you can redefine the text-mode keybindings with the 'loadkeys' ! command found in the kbd-0.81.tar.gz archive (or a later version thereof). ! With this, you can (for example) make Ctrl-Alt- work from text mode ! the same way it works under the XFree86 server. ! ! When the server is exited, it will return to the original VT it ! was started from, unless it dies unexpectedly, when the switch must be ! done manually. There still seem to be wierd combinations of graphic cards ! and motherboards that have problems to restore the textfont when returning ! from XFree86 to the text mode. In these cases using the runx script from ! the svgalib distribution might help. ! ! The XFree86 server now queries the kernel to obtain the key ! binding in effect at startup. These bindings are either the default map in ! place when the kernel was compiled, or reloaded using the 'loadkeys' ! utility. Not all keys are bound: kernel-specific, multiple keysym, and ! dead keys are not handled by the server. All others are translated to ! their X equivalents. Note that the XFree86 server only allows for four ! modifier maps: unshifted, shifted, modeswitch unshifted and modeswitch ! shifted. Depending on what the modeswitch key is (it is settable in your ! Xconfig and defaults to Alt), XFree86 will read those tables into its ! keymaps. This means if you use certain keys, like left-Control, for Linux ! modeswitch, that will not be mappable to X. Read the manpage XFree86kbd ! for more information about X keyboard handling. ! There are some quirks that may need some fixing depending on your ! configuration. In the past, Linux xload used the BSD method of obtaining ! the load average from the running kernel. In the XFree86-1.3 release, that ! has been replaced by reading the information from /proc/loadavg instead, ! which should be forward-compatible with future kernel releases. Xman has ! also been changed to support the GNU groff family instead of the BSD nroff ! family. A quick edit and recompile restores BSD conventions. The server ! has been modified to provide better console redirection support for ! clients, which includes changing the ownership of /dev/console and ! /dev/tty0 as well as the VT used to run on. Unfortunately, the kernel ! requires that a process be setuid root to perform console redirection, so ! xterm and xconsole must be setuid root. As xconsole is not designed with ! running setuid root in mind, this opens a big security problem. ! ! 3 - Backwards Compatibility ! --------------------------- ! ! Old binaries (linked to XFree86-1.2, XFree86-1.3 or XFree86-2.0 ! libraries) will continue to work, but may need an explicit symlink from ! /lib/libX{11,t,aw}.so.3 to /usr/X386/lib/libX{11,t,aw}.so.3. Linking with ! ld.so against the XView3L5 distribution will give problems with pre-1.3 ! versions of ld.so, since the XView libraries contain the absolute path to ! the shared images, which is discouraged with ld.so. A temporary fix is ! including / in /etc/ld.so.config, better recompile XView with relative ! library names or get a newer ld.so. ! 4 - Compiling XFree86 --------------------- There are no special instructions required for compiling XFree86. ! This version was compiled with gcc-2.5.8, the 4.4.21 DLL libraries and the ! 1.4.3 shared, dynamic linker ld.so. The tools-2.11 DLL package was used to ! generate the shared libraries. Using newer versions of these tools should ! definitely work, as should slightly older versions. The server has been ! compiled with -m486, which optimizes it for the 486 processor, but the ! binary will run on the 386 processor (there is a slight increase in binary ! size over using -m386, but no loss of performance). The distribution is very large, but it is possible to compile XFree86 on a single 64mb partition, if the source tree is carefully ! trimmed (no manpages, PEX or large clients). Simply run "make Makefiles" ! to create the Makefiles, then stop the make and run each piece ! individually. It is not necessary to run "make depend" as well, which ! saves some space. Having 100mb available makes compiling XFree86 a lot ! easier. You will need about 10mb of virtual memory to compile the entire ! server. There is support now for creating X DLL libraries. By default, certain libraries are compiled into both static and shared form, but this can be changed by editing mit/config/lnuxLib.rules. The new shared library symlinks no longer need to be moved to /lib, as starting with XFree86-2.0 ! the shared, dynamic linker ld.so is used. ! If patches are applied which significantly change the libraries, ! modified jump_xxx files will be needed. Those can be generated according to ! instructions given in the DLL tools package, and will be made available as ! XFree86 patches. ! ! The JUMP_xxx defines used to compile the X libraries can also ! be used to compile external X shared libraries, like Xaw3d. Detailed ! instructions are provided in /usr/X386/lib/X11/config/lnuxLib.rules, ! where the X library definitions are provided, as an example. Thanks to Dirk Hohndel (hohndel@informatik.uni-wuerzburg.de) for working out all the details and doing all the work in creating the first *************** *** 131,137 **** set of XFree86 DLL libs, on which the current method (developed by Orest Zborowski (orestz@microsoft.com)) is based. ! 4 - Compiling a PEX server -------------------------- PEX is now a part of the XFree86 source distribution and including --- 145,151 ---- set of XFree86 DLL libs, on which the current method (developed by Orest Zborowski (orestz@microsoft.com)) is based. ! 5 - Compiling a PEX server -------------------------- PEX is now a part of the XFree86 source distribution and including *************** *** 143,154 **** produce a server including PEX. See the relevant docs in /usr/X386/lib/Server/README. ! 5 - Omissions ------------- With each release there are fewer omissions from the basic X11R5 ! offering. Starting with XFree86-2.0 the MITSHM (shared memory) extensions are included. Now only the XINPUT extension is missing. ! $XFree86: mit/server/ddx/x386/README.Linux,v 2.4 1993/10/24 13:44:08 dawes Exp $ --- 157,168 ---- produce a server including PEX. See the relevant docs in /usr/X386/lib/Server/README. ! 6 - Omissions ------------- With each release there are fewer omissions from the basic X11R5 ! offering. Starting with XFree86-2.0 the MITSHM (shared memory) extensions are included. Now only the XINPUT extension is missing. ! $XFree86: mit/server/ddx/x386/README.Linux,v 2.8 1994/03/09 11:16:13 dawes Exp $ diff -c mit/server/ddx/x386/README.Mach:2.0 mit/server/ddx/x386/README.Mach:2.2 *** mit/server/ddx/x386/README.Mach:2.0 Fri Mar 11 23:35:40 1994 --- mit/server/ddx/x386/README.Mach Fri Mar 11 23:35:40 1994 *************** *** 1,4 **** ! README for XFree86 2.0 on Mach ------------------------------ All XFree86 client binaries should work with not only the Mach 2.5 --- 1,4 ---- ! README for XFree86 2.1 on Mach ------------------------------ All XFree86 client binaries should work with not only the Mach 2.5 *************** *** 54,60 **** 1 for microsoft mouse 2 for ps2 mouse 3 for no real mouse at all ! 4 for logitek mouse man (M+ or V type) We have implemented a neat hack for notebooks so that they don't have to be saddled with a HUGE external mouse. Scroll lock toggles a mode --- 54,60 ---- 1 for microsoft mouse 2 for ps2 mouse 3 for no real mouse at all ! 4 for logitech mouse man (M+ or V type) We have implemented a neat hack for notebooks so that they don't have to be saddled with a HUGE external mouse. Scroll lock toggles a mode *************** *** 127,130 **** for read/write. There are many ways to achieve this effect. ! $XFree86: mit/server/ddx/x386/README.Mach,v 2.0 1993/10/21 15:53:54 dawes Exp $ --- 127,130 ---- for read/write. There are many ways to achieve this effect. ! $XFree86: mit/server/ddx/x386/README.Mach,v 2.2 1994/03/08 08:07:08 dawes Exp $ diff -c mit/server/ddx/x386/README.Minix:1.1 mit/server/ddx/x386/README.Minix:2.0 *** mit/server/ddx/x386/README.Minix:1.1 Fri Mar 11 23:35:40 1994 --- mit/server/ddx/x386/README.Minix Fri Mar 11 23:35:40 1994 *************** *** 17,23 **** following features required for the X server and clients: - TCP/IP server ! - Asynchronous I/O (instead of Berkely-like "select()") - Ptys - New ioctls to configure the keyboard, screen, etc. devices --- 17,23 ---- following features required for the X server and clients: - TCP/IP server ! - Asynchronous I/O (instead of Berkeley-like "select()") - Ptys - New ioctls to configure the keyboard, screen, etc. devices *************** *** 105,108 **** your cross development system) or by copying them to floppy/tape. ! $XFree86: mit/server/ddx/x386/README.Minix,v 1.1 1993/03/23 13:58:02 dawes Exp $ --- 105,108 ---- your cross development system) or by copying them to floppy/tape. ! $XFree86: mit/server/ddx/x386/README.Minix,v 2.0 1994/03/08 08:07:09 dawes Exp $ diff -c /dev/null mit/server/ddx/x386/README.NetBSD:2.9 *** /dev/null Fri Mar 11 23:35:40 1994 --- mit/server/ddx/x386/README.NetBSD Fri Mar 11 23:35:41 1994 *************** *** 0 **** --- 1,436 ---- + README for XFree86 2.1 on NetBSD 0.9 and NetBSD-current + ------------------------------------------------------- + + Contents + -------- + 0) Notes + 1) What and Where is XFree86? + 2) Bug Reports for This Document + 3) Installing The Binaries + 4) Installing Xdm, the display manager + 5) Configuring X for Your Hardware + 6) Running X + 7) Kernel Support for X + 8) Rebuilding the XFree86 Distribution + 9) Building New X Clients + + + 1 - What and Where is XFree86? + ------------------------------ + XFree86 is a port of X11R5 that supports several versions of Intel-based + Unix. It is derived from X386 1.2, which was the X server distributed + with X11R5. This release consists of many new features and performance + improvements as well as many bug fixes. The release is available as + source patches against the MIT X11R5 code, as well as binary distributions + for many architectures. + + The sources for XFree86 are available by anonymous ftp from: + + ftp.x.org:/contrib/XFree86 + ftp.physics.su.oz.au:/XFree86. + + [I don't know if someone will do specific NetBSD 0.9 binary distribution. + perhaps static -current binaries will run on 0.9 ?] + Binaries for NetBSD 0.9 will be available from: + + ftp.cs.mcgill.ca:/pub/NetBSD + agate.berkeley.edu:/pub/NetBSD/ports + sun-lamp.cs.berkeley.edu:/pub/NetBSD/ports + + Binaries for NetBSD-Current will be available from: + + ftp.laas.fr:/pub/NetBSD + + On US ftp sites note 00README-Legal-Rules-Regs or README.export-control + which state that ftp users outside the U.S. should not copy + XFree86-2.1-xdm-des.tar.gz from sites within the U.S. because it employs + DES encryption. + + 2 - Bug Reports for This Document + --------------------------------- + Send email to matthieu@laas.fr (Matthieu Herrb) or XFree86@physics.su.oz.au + if you have comments or suggestions about this file and we'll revise it. + + 3 - Installing the Binaries + --------------------------- + + The binary distribution is composed of a number of split tar archives + which are the executables, servers, fonts, libraries, include files, + man pages, config files, and the server link kit. The full distribution + takes over 40MB of disk space. The large archives are split into + smaller chunks. + + The contents of the archives are: + + bin - all of the executable X client applications (except xdm) + include - the include/X11 header files + fonts - the misc, 75dpi, 100dpi, and scaled fonts + doc - READMEs, install scripts, and XFree86 specific man pages. + lib - X11 libraries, and data files needed at runtime + config - customizable xinit, xdm, and fs runtime configuration files. + + Choose at least one of the following to match your hardware: + + 8514 - the X server for IBM 8514/A and compatible boards + Mach8 - the X server for ATI Mach8 graphics accelerator boards + Mach32 - the X server for ATI Mach32 graphics accelerator boards + S3 - the X server for S3 based boards + SVGA - the 8-bit pseudo-color X server for Super VGA cards + VGA16 - the 4-bit pseudo-color X server for VGA & SVGA cards. + Mono - the Monochrome X Server + + OPTIONAL: + + man - man pages except XFree86 specific ones in the etc archive + xdm-des - xdm executable with DES encryption + xdm-no-des - xdm executable without DES encryption + linkkit - optional X server reconfiguration kit + pex - pex clients, libraries, header files and data + + + If this is your first time, then you should be able to safely + install all of the packages. If you're going to be installing the + source as well, then you might not want to bother with the linkkit and + pex archives. As a minimal install, you'll need bin, include, fonts + doc, lib, config, and one X server. + + To unpack and install the archives: + + 1. create some destination directory in which you'd like the + X distribution to live. /usr/X386 is recommended, but if that + partition is full (as it is on my machine), then just create an + alternate directory, and sym-link /usr/X386 to this place. + + ie, on my machine, I do the following: + + % cd /usr/local + % mkdir X11 + % ln -s /usr/local/X11 /usr/X386 + + + 2. Assuming that the destination directory for XFree86 2.1 is /usr/X386, + run the following from wherever all the archive files are (replace + /usr/X386 with wherever you wish them to go if that isn't the place): + + % cat XFree86-2.1-bin.tar.gz.* | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-include.tar.gz.* | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-fonts.tar.gz.* | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-doc.tar.gz | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-lib.tar.gz.* | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-config.tar.gz | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-man.tar.gz | gunzip | (cd /usr/X386; tar xf -) + + # Choose only one of the following two + % cat XFree86-2.1-xdm-des.tar.gz | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-xdm-no-des.tar.gz | gunzip | (cd /usr/X386; tar xf -) + + % cat XFree86-2.1-linkkit.tar.gz.* | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-pex.tar.gz | gunzip | (cd /usr/X386; tar xf -) + + # Choose one ore more servers to install + % cat XFree86-2.1-8514.tar.gz | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-Mach8.tar.gz | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-Mach32.tar.gz | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-S3.tar.gz | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-SVGA.tar.gz | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-VGA16.tar.gz | gunzip | (cd /usr/X386; tar xf -) + % cat XFree86-2.1-Mono.tar.gz | gunzip | (cd /usr/X386; tar xf -) + + 3. Set the XWINHOME environment variable to the path where you + installed XFree86. Under csh type: + + setenv XWINHOME /usr/X386 + + under sh type + + XWINHOME=/usr/X386 + export XWINHOME + + (Replace /usr/X386 by the appropriate dir if necessary). + + Also, don't forget to include these lines in your .login or + .profile for permanent use. + + 4. You should now run the script x386install from lib/X11/etc. + It is invoked as follows (assuming we are in the top level dir of + where we installed X to): + + % lib/X11/etc/x386install + + This script verifies that ${XWINHOME} points to the correct + place, checks the /dev/ and /etc/ttys entries, and adds + ${XWINHOME}/bin to the default path in /etc/csh.login. + + You should also add ${XWINHOME}/bin to your own shell's path + variable. + + 5. If needed, reboot your machine to take all previous + modifications into account. + + 6. Finally, run the ConfigXF86 script from ${XWINHOME}/lib/X11/etc + in order to build a Xconfig file. See README.ConfigXF86 for + details. + + If X was already installed on your machine and you have customized your + xinit or xdm runtime configuration scripts, omit the config archive or unpack + it elsewhere and extract only that which you need. + + NOTE: Do not uncompress the font files in lib/X11/fonts without + subsequently running 'mkfontdir' in the corresponding font directory; + otherwise, your server will abort with the message "could not open default + font 'fixed'". + + Using shared libraries with NetBSD-current: + + The binary distribution for NetBSD-current uses shared libraries. + In order to get it running you need to make sure that either: + + o XWINHOME is set to /usr/X386. In this case ld.so will + find your libraries automagically + o you added ${XWINHOME}/lib to the arguments of the + ``ldconfig'' command in /etc/rc. (See ldconfig(8) in the + manual for details) + o you have a LD_LIBRARY_PATH environment variable that + includes the path to your XFree86 libraries. (In this latter + case setuid executables won't run). + + If XWINHOME is not /usr/X386 and you have an older version with + shared libraries in /usr/X386, be warned that the libraries in + /usr/X386/lib will probably take precedence over the one in + XWINHOME because ld has a hard-coded path to /usr/X386/lib. + + + + 4 - Installing Xdm, the display manager + --------------------------------------- + Export restrictions prevent us from providing support for DES + encryption outside the US. If you have not installed NetBSD's + optional secr09, then passwords in /etc/passwd.master are + unencrypted and you should install the version of xdm without DES + encryption: + + % cat XFree86-2.1-xdm-no-des.tar.gz | gunzip | (cd /usr/X386; tar xf -) + + The xdm-nodes binary uses the *BSD dummy crypt routine that + prints the message 'Crypt not present in system' in the xdm-errors + file each time a user logs in. You can ignore this. It just means + /etc/passwd.master is unencrypted. If you install xdm-des by mistake + xdm will not accept any passwords. + + If you have installed the optional securedist/des (secr09 for NetBSD) package + on your system then you are using DES encryption on passwords and you should + install xdm-des: + + % cat XFree86-2.1-xdm-des.tar.gz | gunzip | (cd /usr/X386; tar xf -) + + To start the display manager, log in as root on the console and type + `xdm -nodaemon'. + + You can start xdm automatically on bootup by disabling the console getty + adding the following code to /etc/rc.local: + + if [ -x /usr/X386/bin/xdm ]; then + echo -n ' xdm'; /usr/X386/bin/xdm + fi + + To disable the console getty, change 'on' to 'off' in the console + entry in /etc/ttys: + + console "/usr/libexec/getty Pc" cons25 off secure + + 5 - Configuring X for Your Hardware + ----------------------------------- + You *must* create /usr/X386/lib/X11/Xconfig to suit your hardware. + See README.Config for step-by-step instructions for setting it up. + + The Xconfig file tells the X server what kind of monitor, adapter and + mouse you have. In addition to README.Config, the server manual pages + (XF86_Accel, XF86_Mono, XF86_SVGA, and XF86_VGA16) describe the + options specific to each type of board. + + Read README.Config, and look in /usr/X386/lib/X11/etc/modeDB.txt and + /usr/X386/lib/X11/etc/AccelCards to find Clocks and ModeDB entries to your + specific monitor and graphics card. If you can find them there, grab the + Clocks and ModeDB lines and put them in your Xconfig. If not, read + /usr/X386/lib/X11/etc/VideoModes.doc for instructions on how to create the + video timing values given your vga card and monitor specs. The manual for + your monitor and adapter should have these values. The tuner program (on + FreeBSD.cdrom.com /pub/386BSD/0.1-ports/XFree86-2.1) can calculate a rough + guess about a ModeDB line given the dot clock rate and horizontal + frequency of your monitor. + + Note: 386BSD, FreeBSD, and NetBSD do not support memory mapping of video + memory on vesa local bus cards. For these cards the server will respond + 'Direct memory accessing has been disabled', which is normal. + + The X server (except the 8514 and Mach32 servers) will print out the + Clocks values for your card if you leave them our of your Xconfig file + when you run: + + X -probeonly >& x.out + + You can take these values and edit them to put them in your Xconfig file; + although you MUST include all the clock values, AND leave them in the same + order. + + If your mouse does not work try using kermit or tip to connect to the + mouse serial port and verify that it does indeed generate characters. + + For NetBSD 0.9, Microsoft BusMouse users will find that the following + line should work: + + BusMouse "/dev/mms0" + + 6 - Running X + ------------- + 8mb of memory is a recommended minimum for running X. The server, + window manager and an xterm take about 2.5 Mb of memory themselves. On a + 4Mb system that would leave very little left over for other applications + like gcc that expect a few meg free. X will work with 4Mb of memory, but + in practice compilation while running X can take 5 or 10 times as long due + to constant paging. + + The easiest way for new users to start X windows is to type 'startx >& + startx.log'. Error messages are lost unless you redirect them because + the server takes over the screen. + + To get out of X windows, type 'exit' in the console xterm. You can + customize your X by creating .xinitrc, .xserverrc, and .twmrc files in + your home directory as described in the xinit and startx man pages. + + 7 - Kernel Support for X + ------------------------ + The server supports several console drivers: pccons, syscons, codrv + and pcvt. They are detected at runtime and no configuration of the + server itself is required. + + The pccons driver is the most widely tested and is the console driver + contained in the GENERICAHA kernels in NetBSD 0.9 and NetBSD-current + + In order to instead use the syscons driver, you must reconfigure, + compile and install a new kernel from the NetBSD sources. For a + general description of BSD kernel configuration look in + /usr/src/share/doc/smm/02.config. After running 'make' it contains a + ready postscript copy of the kernel configuration chapter from the + systems maintainers manual. + + To make sure X support is enabled under NetBSD, the following + line must be in your config file in /sys/arch/i386/conf: + + options XSERVER, UCONSOLE + + The syscons console driver is not bundled with FreeBSD or NetBSD. + Current version is 1.2 and supports XFree86-2.1. + + The codrv console driver is not bundled with FreeBSD, nor with NetBSD. + It is available from ftp.uni-duisburg.de in + /pub/unix/386bsd-0.1/unofficial/codrv and from bsd386.first.gmd.de in + ~veit/codrv (no ANON FTP, login with 'guest'/'guest', cd to ~veit/codrv). + It is not clear that anybody has attempted to get this working with + NetBSD 0.9 + + The pcvt console driver is also not bundled with *BSD. Version 3.0 + has just been posted to comp.sources.misc. The pcvt X mode is + compatible with the pccons driver X mode. + + MIT-SHM + =-----= + + NetBSD-current supports System V shared memory. If XFree86 2.1 detects + this support in your kernel, it will support the MIT-SHM extension. + + Under NetBSD-current, use the following to add shared memory + support to your kernel: + + To add support for system V shared memory to your kernel add the + lines: + + # System V-like IPC + options SYSVMSG + options SYSVSEM + options SYSVSHM + + to your kernel config file. Then from /sys/arch/i386/config, type + + # rm -f ../compile//* + # config + # cd ../compile/ + # make depend + # make + + Then install your new kernel and re-boot: + + # cp /netbsd /onetbsd + # cp netbsd / + # reboot + + + 8 - Rebuilding the XFree86 Distribution + --------------------------------------- + The server link kit allow you to rebuild just the X server with a + minimum amount of disk space. Just unpack it, make the appropriate + changes to the site.def, type './mkmf' and 'make' to link the server. + See /usr/X386/lib/Server/README for more info. + + See /usr/X386/lib/X11/etc/INSTALL for instructions on unbundling and + building the source distribution. + + If you don't already have the header files 'console.h' and 'pccons.h' + installed in /usr/include/machine (or /usr/include/sys for 386BSD), then + install the copies that are supplied in mit/server/ddx/x386/etc/. + + You should configure the distribution by editing mit/site.def before + compiling. To compile the sources, invoke + + make World + + in the mit directory. + + Support for shared libs under NetBSD-current + =------------------------------------------= + + If you're running NetBSD-current, you can enable the build of + shared libraries by uncommenting the appropriate line in + 'config/site.def'. + + 9 - Building New X Clients + -------------------------- + The easiest way to build a new client (X application) is to use + xmkmf if an Imakefile is included in the sources. Type 'xmkmf -a' to + create the Makefiles, check the configuration if necessary and type + 'make'. Whenever you install additional man pages you should update + whatis.db by running 'makewhatis /usr/X386/man'. To avoid the + `Virtual memory exhausted' message from cc while compiling, increase + the data and stack size limits (in csh type `limit datasize 32M' and + `limit stacksize 16M'). + + Note: Starting with XFree86 2.1 and NetBSD-current, the symbol "__386BSD__" + no longer gets defined either by the compiler or via the X config files + for FreeBSD systems. When porting clients to BSD systems, make use of the + symbol "BSD" for code which is truly BSD-specific. The value of the + symbol can be used to distinguish different BSD releases. For example, + code specific to the Net-2 and later releases can use: + + #if (BSD >= 199103) + + To ensure that this symbol is correctly defined, include either + (best) or in the source that requires it. + For code that really is specific to a particular i386 BSD port, use + __FreeBSD__ for FreeBSD, __NetBSD__ for NetBSD, __386BSD__ for 386BSD, + and __bsdi__ for BSD/386. + + + Many thanks to + - Pace Willison for providing the initial port to 386BSD. + - Amancio Hasty for fixing cursor restoration, mouse bugs and many others. + - Christoph Robitschko for fixing com.c and thus select(). + - Nate Williams for the patchkit support for X. + - Rod Grimes and Jack Velte of Walnut Creek Cdrom for use + of their machines in preparing the FreeBSD binary release. + + Rich Murphey + David Dawes + Marc Wandschneider + Matthieu Herrb + + $XFree86: mit/server/ddx/x386/README.NetBSD,v 2.9 1994/03/08 08:07:12 dawes Exp $ diff -c mit/server/ddx/x386/README.SCO:2.2 mit/server/ddx/x386/README.SCO:2.5 *** mit/server/ddx/x386/README.SCO:2.2 Fri Mar 11 23:35:42 1994 --- mit/server/ddx/x386/README.SCO Fri Mar 11 23:35:42 1994 *************** *** 123,129 **** mapping in high memory when accessing the card. The dmmap driver comes in two forms, a binary archive which is supplied with the full binary distribution and a source archive which is located in /usr/X386/lib/X11/etc. ! Both distributions provide instuctions for installation/removal within the README file. --- 123,129 ---- mapping in high memory when accessing the card. The dmmap driver comes in two forms, a binary archive which is supplied with the full binary distribution and a source archive which is located in /usr/X386/lib/X11/etc. ! Both distributions provide instructions for installation/removal within the README file. *************** *** 176,184 **** The defaults are set such that you should only require minimal changes to the site.def file. The BOOTSTRAPCFLAGS do most of the work for you. The ! defaults will use gcc 2 or above and the sdbm library. They also compile ! for shared libraries and setup formatted man pages using compression. The ! most likely Parameters you will be interested in changing are: 1. What Fonts etc get compiled. 2. What gets installed (XdmConfig, FSConfig, ...) --- 176,184 ---- The defaults are set such that you should only require minimal changes to the site.def file. The BOOTSTRAPCFLAGS do most of the work for you. The ! defaults will use gcc 2 or above. They also compile for shared libraries ! and setup formatted man pages using compression. The most likely ! Parameters you will be interested in changing are: 1. What Fonts etc get compiled. 2. What gets installed (XdmConfig, FSConfig, ...) *************** *** 224,236 **** #include #endif /* _SYS_TIME_H_ */ - Get a copy of the sdbm library, SCO has one but its operation is a - little different to other OS's. Set HasNdbm and HasSdbm in site.def - to YES, put libsdbm.a in /lib or /usr/lib and sdbm.h in /usr/include. - Compile sdbm with "cc" and do not enable the optimiser. There were - some problems early on when using sdbm compiled with gcc or with the - optimisation enabled. These may have been fixed. - To compile from here, follow the XFree86 README, basically after obtaining X11r5, applying the XFree86 patches and completing the above changes you should only need to run: --- 224,229 ---- *************** *** 298,315 **** A) Create the "net/errno.h" and "sys/bsdtypes.h" as per the 3.2.2 instructions above. ! B) Get and compile the "sdbm" as per the 3.2.2 instructions above. ! Be sure not to use gcc or optimisation when compiling sdbm. ! ! C) Check that you have a "sys/uio.h" as there have been reports of system which have it and systems which don't! If you already have one it need not be changed. ! D) Edit the gnu "unistd.h" include file and remove the non prototyped version of close (Look for "close()" and remove that line), do not remove the prototyped declaration. ! E) Create a "sys/stat.h" under the gnu include directory containing this: #ifndef _XFREE86_STAT --- 291,305 ---- A) Create the "net/errno.h" and "sys/bsdtypes.h" as per the 3.2.2 instructions above. ! B) Check that you have a "sys/uio.h" as there have been reports of system which have it and systems which don't! If you already have one it need not be changed. ! C) Edit the gnu "unistd.h" include file and remove the non prototyped version of close (Look for "close()" and remove that line), do not remove the prototyped declaration. ! D) Create a "sys/stat.h" under the gnu include directory containing this: #ifndef _XFREE86_STAT *************** *** 325,333 **** #endif /* _XFREE86_STAT */ ! F) Check the paragraph on site.def in the compiling for 3.2.2 section. ! G) Add a -DSCO324 to the BOOTSTRAPCFLAGS when you do the make World. make BOOTSTRAPCFLAGS="-DSYSV -DSYSV386 -DSCO -DSCO324" World --- 315,323 ---- #endif /* _XFREE86_STAT */ ! E) Check the paragraph on site.def in the compiling for 3.2.2 section. ! F) Add a -DSCO324 to the BOOTSTRAPCFLAGS when you do the make World. make BOOTSTRAPCFLAGS="-DSYSV -DSYSV386 -DSCO -DSCO324" World *************** *** 337,343 **** - The default compile line will contain -D_NO_PROTOTYPE instead of -DNO_PROTOTYPE as this is what 3.2.4 expects. ! H) If you have problems with mkshlib reporting an error like mkshlib: : cannot exec /bin/sh --- 327,333 ---- - The default compile line will contain -D_NO_PROTOTYPE instead of -DNO_PROTOTYPE as this is what 3.2.4 expects. ! G) If you have problems with mkshlib reporting an error like mkshlib: : cannot exec /bin/sh *************** *** 451,457 **** corrupted especially when scrolling. Causes: 1) You are running an original 1.3 distribution of XFree86. Update ! to 2.0. 2) You have resized the window and not ran "eval `resize`" before using your application. The SCO operating system does not support dynamic resizing or xterms fully so this command must be run after resizing --- 441,447 ---- corrupted especially when scrolling. Causes: 1) You are running an original 1.3 distribution of XFree86. Update ! to 2.1. 2) You have resized the window and not ran "eval `resize`" before using your application. The SCO operating system does not support dynamic resizing or xterms fully so this command must be run after resizing *************** *** 518,521 **** ftp site for the binary distribution. ! $XFree86: mit/server/ddx/x386/README.SCO,v 2.2 1993/10/24 13:44:10 dawes Exp $ --- 508,511 ---- ftp site for the binary distribution. ! $XFree86: mit/server/ddx/x386/README.SCO,v 2.5 1994/03/08 08:31:20 dawes Exp $ diff -c /dev/null mit/server/ddx/x386/README.SOLX86:2.2 *** /dev/null Fri Mar 11 23:35:42 1994 --- mit/server/ddx/x386/README.SOLX86 Fri Mar 11 23:35:43 1994 *************** *** 0 **** --- 1,214 ---- + Information for Solaris for x86 Users + ------------------------------------- + + Contents + -------- + 1) Solaris versions on which XFree86[TM] has been tested. + 2) The VT-switching sub-system on Solaris x86 + 3) Notes for building XFree86 on Solaris x86 + 4) Notes for running XFree86 on Solaris x86 + 5) Building non-core clients with Solaris x86 + 6) Known bugs, and workarounds with Solaris x86 + + 1 - Solaris versions on which XFree86 has been tested + ----------------------------------------------------- + + XFree86 has been actively tested on Solaris 2.1 for x86. + + It is improbable that XFree86 will work on the soon to + be released Solaris 2.3.2 for x86. (Due to the probable + absense of Virtual Terminals under 2.3.2) + + However, if 2.3.2 still has VT's, XFree86 "MAY" work under + it. All we can say is, if XFree86 doesn't run under 2.3.2, + we'll generate patches for 2.3.2 as soon as we can after we + obtain a copy of 2.3.2. + + 2 - The VT-switching sub-system on Solaris x86 + ---------------------------------------------- + + The virtual terminal subsystem in Solaris x86 is a undocumented, + and unsupported feature of Solaris 2.1 for x86. Therefore if + you use Virtual Terminals, you use them at YOUR OWN RISK. + + The virtual terminals of Solaris work basically the same way as + most other Intel based SVR4 VT sub-systems. However, there + are a number of limitations documented below. + + The keys used for VT switching are as follows: + + Alt-SysReq-F1 through Alt-SysReq-F7 enables VT screens 1-7 respectively. + Alt-SysReq-n enables the next active VT screen. + Alt-SysReq-p enables the previous active VT screen. + Alt-SysReq-h returns to the console. + + To enable VT's on a Solaris 2.1 system the following lines (as root) + to the file /etc/inittab: + + (Note do NOT make a mistake here, you could lock yourself out of the system) + + --------------------------->Snip Snip<----------------------------------------- + v1:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` VT01 login: " -T AT386 -d /dev/vt01 -l console + v2:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` VT02 login: " -T AT386 -d /dev/vt02 -l console + v3:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` VT03 login: " -T AT386 -d /dev/vt03 -l console + v4:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` VT04 login: " -T AT386 -d /dev/vt04 -l console + -------------------------->End here<------------------------------------------- + + These four lines enable are what I use to enable 4 VT's on Alt-SysReq-F1 + through Alt-SysReq-F4. + + Then (as root) execute the command 'init q' to immediately enable the + virtual terminals. + + You must leave at least one free virtual terminal for use under + Solaris 2.1 for the Xserver. + + Limitations of the Virtual Terminal sub-system under Solaris 2.1 for x86: + + 1. There are only a total of 8 login windows (7 VT's + 1 console) + not the usual 15. If you have all 8 allocated, and you attempt + allocate a additional VT you will immediately panic the system. + (This bug is worked around in the Solaris 2.1 Xserver) + + 2. From a programming stand point, they work pretty much as documented + in the AT&T Unix System V/386 Release 4 Integrated Software Development + Guide, however a number of ioctl()'s are broken. + + + 3 - Notes for building XFree86 on Solaris x86 + --------------------------------------------- + + 1. Both GCC, and ProWorks are supported by XFree86. GCC-2.4.5 is + suggested, later versions are untested. You also need to set + HasGcc, and HasGcc2 appropriately in site.def. + + 2. If you are using ProWorks to compile the XFree86 distribution, you + should modify your PATH appropriately so the ProWorks tools are + available. + + 3. You MUST put /usr/ccs/bin at the front of your PATH. There are known + problems with some GNU replacements for the utilities found there, so + the /usr/ccs/bin versions of these programs must be found before any + other possible GNU versions. (Most notably GNU 'ar' does not work during + the build.) + + 4. If you wish to use the "memory aperture" of the S3, or Mach32 servers + you need to compile, and install the Solaris x86 aperture driver for + memory mapped I/O support. + + The source for this driver should be included in + ~mit/server/ddx/x386/etc/apSolx86.shar. Building and installing + the driver is relatively straight forward. Please read its accompanying + README file. + + You also need to set HasSolx86apertureDrv to YES in ~mit/config/site.def. + + 5. The BOOTSTRAPCFLAGS for Solaris x86 is: + + "-DSVR4 -DSYSV386 -DSOLX86" + + 6. You will also need to add CC=gcc to your 'make World' command + if you are using gcc. You may possibly get a warning about + unknown option '-Xc' while compiling imake, however the warning can + be safely ignored. + + 4 - Notes for running XFree86 on Solaris x86 + -------------------------------------------- + + 1. For Solaris, you will probably want to set your LD_LIBRARY_PATH + to /usr/X386/lib:/usr/openwin/lib, setting LD_LIBRARY_PATH to include + /usr/X386/lib is not necessary providing that clients are build with + LD_RUN_PATH set properly. + + Including /usr/openwin/lib in the LD_LIBRARY_PATH, is recommended + because some Sun supplied binaries were not compiled with LD_RUN_PATH + set properly. (Wabi 1.0 is a good example.) + + 3. Xqueue is NOT supported under Solaris. The includes necessary for + Xqueue are available, however, the driver does not seem to be. + (Go figure) + + 4. If you want to use xdm with Solaris, extract the files from the shar file + in /usr/X386/lib/X11/etc/XdmConf.svr4 into a temporary directory. The + README file tells where the individual files should be installed. Be + sure to read through each file and make any site-specific changes that + you need. + + 5 - Building non-core clients with Solaris x86 + ---------------------------------------------- + + 1. A lot of clients (even some which have explicit SVR4 support) require + -DSYSV when building under SVR4. This will not be set when using the + default x386.cf and site.def. A quick fix is to add something like the + following to the client's Imakefile: + + #if SystemV4 + DEFINES = -DSYSV OTHER_CLIENT_DEPENDENT_DEFINES + #endif + + The best solution is to modify the code so it compiles correctly + without -DSYSV. + + 2. The default compiler options include '-ansi' for gcc, and '-Xc' for cc. + A consequence of this is __STDC__ gets #defined to '1'. There are a + number of functions which will not have prototypes declared unless + either __STDC__ is not defined, or + + __STDC__ == 0 || defined(_POSIX_SOURCE) || defined(_XOPEN_SOURCE) + + Possible solutions are to change the definition of ANSICCOPTIONS by + adding a line to the Imakefile, or to add the required prototypes to + the source. + + 3. A lot of clients make use of BSD functions like bcopy(), etc. The + default configuration files are set up to link with libXbsd.a which + contains emulation for bcopy(), bzero(), bcmp(), ffs(), random(), + seed(). ffs() is not required (it is already in libnsl.so), and a + better way of providing the 'b' functions is to include + in source files that call them. Xfuncs.h provides macro definitions + for these in terms of the SYSV 'mem' functions. If you require more + efficient versions of random(), seed() you should supply your own macro + definitions. If you are linking with a vendor supplied library which + calls some of these functions, then you should link with libXbsd.a + + If you want to change this default, you can edit your x386.cf file. If + you want to change the behavior on a per client basis, you can add a + line to the clients Imakefile which redefines XBSDLIB. To eliminate + the use of that library use something like: + + XBSDLIB = + + If you find you need some other BSD functions, you could link with + libucb.a by using something like: + + XBSDLIB = -lc -L/usr/ucblib -lucb + + WARNING: be *very* careful blindly linking with libucb.a. + + 6 - Known bugs, and workarounds with Solaris x86 + ------------------------------------------------ + + 1. Wabi 1.0 tickles a obscure bug in the Mach32 hardware cursor code. The + hardware cursor shows up as a multicolored square while inside of Wabi + windows. + + The workaround, add: + + Option "sw_cursor" + + to your Xconfig. + + 2. The Solaris 2.1 for x86 OpenWindows filemgr does not work against + Sparc Solaris MIT X11R5 Xserver, nor XFree86. Attempting to + 'Drag and Drop' a file causes the filemgr to abort with a 'X error'. + + There is no known workaround. + + Many thanks to the original authors of README.SVR4, and README.SVR3 + upon which this document is based a large part upon. + + (Somebody clue me in on the appropriate names to stick in here will you?) + + Id: README.SOLX86,v 1.2 1994/02/24 04:56:49 davidh Exp + + $XFree86: mit/server/ddx/x386/README.SOLX86,v 2.2 1994/03/11 03:05:26 dawes Exp $ diff -c mit/server/ddx/x386/README.SVR3:2.1 mit/server/ddx/x386/README.SVR3:2.5 *** mit/server/ddx/x386/README.SVR3:2.1 Fri Mar 11 23:35:43 1994 --- mit/server/ddx/x386/README.SVR3 Fri Mar 11 23:35:44 1994 *************** *** 54,93 **** the Hercules driver in the monochrom server) the lkit archive is required. It contains also a tutorial how to add an (S)VGA driver to XFree86 including stub driver code. ! The non-server PEX stuff is seperated in the pex archive. ! bin-2.0tz.?? - Executables, including target shared libraries. The XFree86 server binaries: ! SVGA-2.0tz.? - XF86_SVGA: 256-color Super-VGA server. Contains accelerated support for Cirrus 542{6,8} and Western Digital 90C31 chipsets, unaccelerated for the rest of the supported chipsets. ! Mono-2.0tz.? - XF86_Mono: (S)VGA monochrome, optionally Hercules or other monochrome hardware support is linked in (not in the binary distribution). ! VGA16-2.0tz.? - XF86_VGA16: Generic VGA 16-color server (experimental). ! 8514-2.0tz.? - XF86_8514: 8514/A 256-color accelerated server. ! Mach32-2.0tz.? - XF86_Mach32: ATI Mach32 256-color accelerated server. ! Mach8-2.0tz.? - XF86_Mach8: ATI Mach8 256-color accelerated server. ! S3-2.0tz.? - XF86_S3: S3 256-color accelerated server. ! ! misc-2.0tz - Application default files, bitmaps, etc. ! cfg-2.0tz - Default xinit, xdm and fs config files. ! ! font-2.0tz.?? - Fonts (misc, 75dpi, 100dpi, Speedo). ! man-2.0tz.?? - Formatted X11R5 manual pages. ! doc-2.0tz - Documentation including XFree86-specific man pages. ! ! lib-2.0tz.?? - Libraries, configuration and header files. ! lkit-2.0tz.?? - LinkKit, including PEX support. ! pex-2.0tz.?? - The non-server parts of PEX (clients, libs, headers, etc.). gpc.tz.?? - The Graphics Performance Characterization suite of PEX. (Files needed for the ! 'plbpex' program.) It's seperated because unpacked it needs ~9MB! It's unchanged since 1.3. --- 54,93 ---- the Hercules driver in the monochrom server) the lkit archive is required. It contains also a tutorial how to add an (S)VGA driver to XFree86 including stub driver code. ! The non-server PEX stuff is separated in the pex archive. ! bin-2.1tz.?? - Executables, including target shared libraries. The XFree86 server binaries: ! SVGA-2.1tz.? - XF86_SVGA: 256-color Super-VGA server. Contains accelerated support for Cirrus 542{6,8} and Western Digital 90C31 chipsets, unaccelerated for the rest of the supported chipsets. ! Mono-2.1tz.? - XF86_Mono: (S)VGA monochrome, optionally Hercules or other monochrome hardware support is linked in (not in the binary distribution). ! VGA16-2.1tz.? - XF86_VGA16: Generic VGA 16-color server (experimental). ! 8514-2.1tz.? - XF86_8514: 8514/A 256-color accelerated server. ! Mach32-2.1tz.? - XF86_Mach32: ATI Mach32 256-color accelerated server. ! Mach8-2.1tz.? - XF86_Mach8: ATI Mach8 256-color accelerated server. ! S3-2.1tz.? - XF86_S3: S3 256-color accelerated server. ! ! misc-2.1tz - Application default files, bitmaps, etc. ! cfg-2.1tz - Default xinit, xdm and fs config files. ! ! font-2.1tz.?? - Fonts (misc, 75dpi, 100dpi, Speedo). ! man-2.1tz.?? - Formatted X11R5 manual pages. ! doc-2.1tz - Documentation including XFree86-specific man pages. ! ! lib-2.1tz.?? - Libraries, configuration and header files. ! lkit-2.1tz.?? - LinkKit, including PEX support. ! pex-2.1tz.?? - The non-server parts of PEX (clients, libs, headers, etc.). gpc.tz.?? - The Graphics Performance Characterization suite of PEX. (Files needed for the ! 'plbpex' program.) It's separated because unpacked it needs ~9MB! It's unchanged since 1.3. *************** *** 98,104 **** binary distribution for SVR3 on ftp.prz.tu-berlin.de under /pub/pc/isc/gzip. If you want to use the "memory aperture" feature which S3 and Mach32 ! servers provide you need also the SVR3 mmap driver (at least v2.2.2) for memory mapped I/O support (i.e. accessing the frame buffer in a linear address space). The source of this driver is included in the binary distribution --- 98,104 ---- binary distribution for SVR3 on ftp.prz.tu-berlin.de under /pub/pc/isc/gzip. If you want to use the "memory aperture" feature which S3 and Mach32 ! servers provide you need also the SVR3 mmap driver (at least v2.2.3) for memory mapped I/O support (i.e. accessing the frame buffer in a linear address space). The source of this driver is included in the binary distribution *************** *** 114,120 **** 1. Login as root ! 2. If you have previously installed XFree86 1.2, note that 2.0 contains an incompatible new revision of the shared Xlib (libX11.5.0.1). If you're using other X clients then the core stuff (like the actual XView 3.0 binary distribution from Thomas J. Wu on ftp.prz.tu-berlin.de) --- 114,120 ---- 1. Login as root ! 2. If you have previously installed XFree86 1.2, note that 2.1 contains an incompatible new revision of the shared Xlib (libX11.5.0.1). If you're using other X clients then the core stuff (like the actual XView 3.0 binary distribution from Thomas J. Wu on ftp.prz.tu-berlin.de) *************** *** 122,128 **** on-line. If you have previously installed XFree86 1.3 there should be no problems. Clients which are linked with the 1.3 shared libraries should also ! work with the installed shared libraries from 2.0. As for XView 3.0: if you plan to link XView clients with the XView shared libraries you must keep also the host shared libraries --- 122,128 ---- on-line. If you have previously installed XFree86 1.3 there should be no problems. Clients which are linked with the 1.3 shared libraries should also ! work with the installed shared libraries from 2.1. As for XView 3.0: if you plan to link XView clients with the XView shared libraries you must keep also the host shared libraries *************** *** 147,162 **** # /usr/X11R5/bin/mkdirhier /usr/X386/lib/X11/shlib # ln /usr/X11R5/lib/X11/shlib/* /usr/X386/lib/X11/shlib ! 3. Unpack the distribution (assume splitted archives are in /usr/tmp and a S3 video card): # cd /usr/X386 ! # cat /usr/tmp/bin-2.0tz.?? | gunzip | tar xfp - ! # cat /usr/tmp/S3-2.0.tz.? | gunzip | tar xfp - ! # cat /usr/tmp/misc-2.0tz | gunzip | tar xfp - ! # cat /usr/tmp/font-2.0tz.?? | gunzip | tar xfp - ! # cat /usr/tmp/man-2.0tz.?? | gunzip | tar xfp - ! # cat /usr/tmp/doc-2.0tz | gunzip | tar xfp - NOTE: Don't forget that p option for tar! Some programs (X servers itself, xterm, xload) must be setuid-root and p restores --- 147,162 ---- # /usr/X11R5/bin/mkdirhier /usr/X386/lib/X11/shlib # ln /usr/X11R5/lib/X11/shlib/* /usr/X386/lib/X11/shlib ! 3. Unpack the distribution (assume split archives are in /usr/tmp and a S3 video card): # cd /usr/X386 ! # cat /usr/tmp/bin-2.1tz.?? | gunzip | tar xfp - ! # cat /usr/tmp/S3-2.1.tz.? | gunzip | tar xfp - ! # cat /usr/tmp/misc-2.1tz | gunzip | tar xfp - ! # cat /usr/tmp/font-2.1tz.?? | gunzip | tar xfp - ! # cat /usr/tmp/man-2.1tz.?? | gunzip | tar xfp - ! # cat /usr/tmp/doc-2.1tz | gunzip | tar xfp - NOTE: Don't forget that p option for tar! Some programs (X servers itself, xterm, xload) must be setuid-root and p restores *************** *** 163,184 **** the original permissions. If this is not your first installation of XFree86 you should be ! carefull if you want to unpack the cfg archive, it contains the default xinit, xdm and fs config files. If you have customized them already you may want to save them before you type: ! # cat /usr/tmp/cfg-2.0tz | gunzip | tar xfp - If you want to install the libraries and/or linkkit and/or PEX, same applies: ! # cat /usr/tmp/lib-2.0tz.?? | gunzip | tar xfp - ! # cat /usr/tmp/lkit-2.0tz.?? | gunzip | tar xfp - ! # cat /usr/tmp/pex-2.0tz.?? | gunzip | tar xfp - If you want the GPC stuff for PEX: ! # cat /usr/tmp/gpc-2.0tz.?? | gunzip | tar xfp - If you want PEX you need also the linkkit to get a server with PEX support. --- 163,184 ---- the original permissions. If this is not your first installation of XFree86 you should be ! careful if you want to unpack the cfg archive, it contains the default xinit, xdm and fs config files. If you have customized them already you may want to save them before you type: ! # cat /usr/tmp/cfg-2.1tz | gunzip | tar xfp - If you want to install the libraries and/or linkkit and/or PEX, same applies: ! # cat /usr/tmp/lib-2.1tz.?? | gunzip | tar xfp - ! # cat /usr/tmp/lkit-2.1tz.?? | gunzip | tar xfp - ! # cat /usr/tmp/pex-2.1tz.?? | gunzip | tar xfp - If you want the GPC stuff for PEX: ! # cat /usr/tmp/gpc-2.1tz.?? | gunzip | tar xfp - If you want PEX you need also the linkkit to get a server with PEX support. *************** *** 224,231 **** using the linkkit in /usr/X386/lib/Server. Informations how to do it you'll find also in /usr/X386/lib/X11/etc/INSTALL in section "Reconfiguring the server (binary distribution)". ! Note: Installing libsdbm.a is not needed on ISC, ISC's libdbm.a works. ! If you don't use gcc anyway, you may also need to install libgcc.a in /lib or /usr/lib and set "NeedLibGcc" to YES in site.def (/usr/X386/lib/Server/site.def !). --- 224,230 ---- using the linkkit in /usr/X386/lib/Server. Informations how to do it you'll find also in /usr/X386/lib/X11/etc/INSTALL in section "Reconfiguring the server (binary distribution)". ! Note: If you don't use gcc anyway, you may also need to install libgcc.a in /lib or /usr/lib and set "NeedLibGcc" to YES in site.def (/usr/X386/lib/Server/site.def !). *************** *** 381,393 **** in your base OS. We are working in fixing the source tree to not depend on TCP/IP, but it is a fundamental piece of the MIT architecture, and all the problems have not yet been resolved. ! 3. ISC no longer requires a separate dbm library. It works fine with the ! existing dbm library (libdbm.a). Set HasNdbm to NO in site.def. ! 4. Note for ISC: A limit in the hash table with ISC's 'make' will cause it to die in the middle of mit/lib/X. This can be overcome by uncommenting the MakeHashTableBug line in site.def. But a better alternative is to use GNU make. ! 5. If you want to compile XDM Authorization-1 in you must applying following patch to mit/lib/Xdmcp/Wraphelp.c: ---cut here--------------------------------------------------------------- --- 380,390 ---- in your base OS. We are working in fixing the source tree to not depend on TCP/IP, but it is a fundamental piece of the MIT architecture, and all the problems have not yet been resolved. ! 3. Note for ISC: A limit in the hash table with ISC's 'make' will cause it to die in the middle of mit/lib/X. This can be overcome by uncommenting the MakeHashTableBug line in site.def. But a better alternative is to use GNU make. ! 4. If you want to compile XDM Authorization-1 in you must applying following patch to mit/lib/Xdmcp/Wraphelp.c: ---cut here--------------------------------------------------------------- *************** *** 409,421 **** for using in the shared Xlib. For information how to obtain a copy of mit/lib/Xdmcp/Wraphelp.c look into mit/RELNOTES.TXT. ! 6. We highly recommend gcc 2.4.5 to build XFree86. It fixes several bugs of ! previous versions. Whether gcc 2.5.0 or newer works is not tested yet. ! See also 'SVR3 shared libraries' and /usr/X386/lib/X11/etc/INSTALL. ! You should have ran the `fixincludes' script from the gcc distribution, ! otherwise some non-ANSI-compilant declarations in ISC's ! will cause generating of false arguments for the SIOCIFCONF, etc. ! ioctl's which will affect the server and xdm. 9 - SVR3 shared libraries --- 406,418 ---- for using in the shared Xlib. For information how to obtain a copy of mit/lib/Xdmcp/Wraphelp.c look into mit/RELNOTES.TXT. ! 6. We highly recommend gcc 2.4.5 or a recent 2.5.x version to build XFree86. ! It fixes several bugs of previous versions. See also 'SVR3 shared ! libraries' and /usr/X386/lib/X11/etc/INSTALL. You should have ran the ! `fixincludes' script from the gcc distribution, otherwise some ! non-ANSI-compliant declarations in ISC's will cause ! generating of false arguments for the SIOCIFCONF, etc. ioctl's which ! will affect the server and xdm. 9 - SVR3 shared libraries *************** *** 501,505 **** - Rich Murphey for writing README.386BSD which this README is based on - All the ISC users who have been patient for all these months ! $XFree86: mit/server/ddx/x386/README.SVR3,v 2.1 1993/10/24 13:44:11 dawes Exp $ --- 498,502 ---- - Rich Murphey for writing README.386BSD which this README is based on - All the ISC users who have been patient for all these months ! $XFree86: mit/server/ddx/x386/README.SVR3,v 2.5 1994/03/08 08:31:23 dawes Exp $ diff -c mit/server/ddx/x386/README.SVR4:2.1 mit/server/ddx/x386/README.SVR4:2.2 *** mit/server/ddx/x386/README.SVR4:2.1 Fri Mar 11 23:35:45 1994 --- mit/server/ddx/x386/README.SVR4 Fri Mar 11 23:35:45 1994 *************** *** 23,29 **** XFree86 has been tested on the following versions of SVR4.0: Microport: 2.2, 3.1, 4.1, 4.2 ! Esix: 4.0.3A, 4.0.4 Dell: 2.1, 2.2 UHC: 2.0, 3.6 Consensys: 1.2 --- 23,29 ---- XFree86 has been tested on the following versions of SVR4.0: Microport: 2.2, 3.1, 4.1, 4.2 ! Esix: 4.0.3A, 4.0.4, 4.0.4.1 Dell: 2.1, 2.2 UHC: 2.0, 3.6 Consensys: 1.2 *************** *** 121,127 **** 4 - Notes for building XFree86 on SVR4 -------------------------------------- 1. If you are using gcc-2.0 or 2.1 with SVR4, we highly recommend that you ! upgrade to the latest release (currently gcc-2.4.5). If this is not possible, you MUST apply the following patch to 'fixinc.svr4', and rerun it. This problem is fixed in gcc-2.2. --- 121,127 ---- 4 - Notes for building XFree86 on SVR4 -------------------------------------- 1. If you are using gcc-2.0 or 2.1 with SVR4, we highly recommend that you ! upgrade to gcc-2.4.5 (or a later stable release). If this is not possible, you MUST apply the following patch to 'fixinc.svr4', and rerun it. This problem is fixed in gcc-2.2. *************** *** 278,290 **** 3. A lot of clients make use of BSD functions like bcopy(), etc. The default configuration files are set up to link with libXbsd.a which contains emulation for bcopy(), bzero(), bcmp(), ffs(), random(), ! seed(). ffs() is not required (it is already in libnsl.so), and a ! better way of providing the 'b' functions is to include ! in source files that call them. Xfuncs.h provides macro definitions ! for these in terms of the SYSV 'mem' functions. If you require more ! efficient versions of random(), seed() you should supply your own macro ! definitions. If you are linking with a vendor supplied library which ! calls some of these functions, then you should link with libXbsd.a If you want to change this default, you can edit your x386.cf file. If you want to change the behaviour on a per client basis, you can add a --- 278,294 ---- 3. A lot of clients make use of BSD functions like bcopy(), etc. The default configuration files are set up to link with libXbsd.a which contains emulation for bcopy(), bzero(), bcmp(), ffs(), random(), ! seed(), str[n]casecmp() and a fully BSD-compatible select(). ffs() ! is not required (it is already in libnsl.so), and a better way of ! providing the 'b' functions is to include in source ! files that call them. Xfuncs.h provides macro definitions for ! these in terms of the SYSV 'mem' functions. To make use of the ! select() in libXbsd, must be included after defining ! X_BSDSELECT. This is not required on most SVR4 versions. If you ! require more efficient versions of random(), seed() you should ! supply your own macro definitions. If you are linking with a ! vendor supplied library which calls some of these functions, then ! you should link with libXbsd.a If you want to change this default, you can edit your x386.cf file. If you want to change the behaviour on a per client basis, you can add a *************** *** 409,412 **** information. ! $XFree86: mit/server/ddx/x386/README.SVR4,v 2.1 1993/10/24 13:44:13 dawes Exp $ --- 413,416 ---- information. ! $XFree86: mit/server/ddx/x386/README.SVR4,v 2.2 1994/03/05 08:22:43 dawes Exp $ diff -c mit/server/ddx/x386/XF86_Acc.man:2.11 mit/server/ddx/x386/XF86_Acc.man:2.16 *** mit/server/ddx/x386/XF86_Acc.man:2.11 Fri Mar 11 23:35:46 1994 --- mit/server/ddx/x386/XF86_Acc.man Fri Mar 11 23:35:46 1994 *************** *** 1,6 **** ! .\" $XFree86: mit/server/ddx/x386/XF86_Acc.man,v 2.11 1993/10/21 15:53:56 dawes Exp $ .\" $XConsortium: X386.man,v 1.3 91/08/26 15:31:19 gildea Exp $ ! .TH XF86_Accel 1 "Version 2.0" "XFree86" .SH NAME XF86_Accel - 8 bit accelerated X Window System servers for UNIX on x86 platforms with an S3, Mach8, Mach32 or 8514/A accelerator board --- 1,6 ---- ! .\" $XFree86: mit/server/ddx/x386/XF86_Acc.man,v 2.16 1994/03/08 04:46:29 dawes Exp $ .\" $XConsortium: X386.man,v 1.3 91/08/26 15:31:19 gildea Exp $ ! .TH XF86_Accel 1 "Version 2.1" "XFree86" .SH NAME XF86_Accel - 8 bit accelerated X Window System servers for UNIX on x86 platforms with an S3, Mach8, Mach32 or 8514/A accelerator board *************** *** 64,74 **** .PP For S3 virtual resolutions up to (approximately) 1152x800 are supported, using (up to) 1Mb of display memory ! (the S3 uses an internal width of 1280, hence 1Mb can't support ! 1152x900). ! Physical resolutions up to 1280x1024 are possible using 2Mb or ! more of display memory (virtual resolution is dependent solely on the ! amount of memory installed). Similar resolutions are supported on the Mach32. For the Mach32, the maximum virtual width is 1536, and the maximum virtual height is 1280. --- 64,75 ---- .PP For S3 virtual resolutions up to (approximately) 1152x800 are supported, using (up to) 1Mb of display memory ! (the S3 uses an internal width of 1280 except for new revisions of some of ! the chips, hence 1Mb can't support 1152x900). ! Physical resolutions up to 1280x1024 (1600x1280 on some cards) are ! possible using 2Mb or more of display memory (virtual resolution is ! dependent solely on the amount of memory installed, with the maximum ! virtual width being 2048, and max virtual height is 4096). Similar resolutions are supported on the Mach32. For the Mach32, the maximum virtual width is 1536, and the maximum virtual height is 1280. *************** *** 107,113 **** XF86_S3: .RS 1.5i .TP 12 ! generic_s3 (for a standard IO driven server) .TP 12 mmio_928 --- 108,114 ---- XF86_S3: .RS 1.5i .TP 12 ! s3_generic (for a standard IO driven server) .TP 12 mmio_928 *************** *** 146,175 **** is important. It must match the order in which they are selected on the graphics board. Multiple \fBclocks\fP lines may be specified. For programmable clock chips the name of the clockchip is given. ! Possible values include \fB"icd2061a"\fP and \fB"icd2061a_slow"\fP. These are currently only supported by the S3 server. .TP 8 .B option \fI"optionstring"\fP allows the user to select certain options provided by the drivers. Currently the following strings are recognized: .sp ! \fBnomemaccess\fP - (S3) disable direct access to video memory. This is the ! default for localbus cards when linear mapping is not possible. .sp - \fBmemaccess\fP - (S3) prevent direct video memory access being disabled - for localbus cards when linear mapping is not possible. - .sp \fBnolinear\fP - (S3 and Mach32) disable use of a linear-mapped framebuffer. .sp \fBbt485\fP - (S3) Card has a BrookTree Bt485 RAMDAC. This option is required if the server fails to detect the Bt485. .sp ! \fBno_bt485\fP - (S3) Card does not have a BrookTree Bt485 RAMDAC. This ! option is only required if the server detects a Bt485 when none is present. .sp ! \fBbt485_curs\fP - (S3) Enables the Bt485's internal HW cursor. .sp \fBsw_cursor\fP - (Mach32) Disable the hardware cursor. .PP Note that \fIXFree86\fP has some internal capabilities to determine what hardware --- 147,232 ---- is important. It must match the order in which they are selected on the graphics board. Multiple \fBclocks\fP lines may be specified. For programmable clock chips the name of the clockchip is given. ! Possible values include \fB"icd2061a"\fP and \fB"sc11412"\fP. These are currently only supported by the S3 server. .TP 8 + .B membase \fImemaddress\fP + specifies the hard-wired part of the linear framebuffer base address. This + option is only used by the S3 and Mach32 servers (and only when using a + linear framebuffer). For the S3 server, the hard-wired part is the high + 6 bits of the 32-bit address (ie \fImemaddress\fP is masked with + \fI0xFC000000\fP). For the Mach32 server, the mask is \fI0xF8000000\fP + (except for PCI cards, where the membase setting is ignored). + .sp + Note: The S3 server will normally probe for this address automatically. + Setting this option overrides that probe. This is not normally recommended + because the failure of the server's probe usually indicates problems in + using the linear framebuffer. + .TP 8 .B option \fI"optionstring"\fP allows the user to select certain options provided by the drivers. Currently the following strings are recognized: .sp ! \fBnomemaccess\fP - (S3) disable direct access to video memory. .sp \fBnolinear\fP - (S3 and Mach32) disable use of a linear-mapped framebuffer. .sp + \fBnormal_dac\fP - (S3) Card does not have one of the other RAMDACs mentioned + here. This option is only required if the server incorrectly detects one + of those other RAMDACs. + .sp + \fBatt_20c490_1\fP - (S3) Card has an AT&T 20C490 or AT&T 20C491 RAMDAC. + This option when combined with the \fBdac_8_bit\fP option allows these + RAMDACs to be operated in 8 bit per RGB mode. There is currently no + auto-detection for these RAMDACs. Note that 8 bit per RGB mode does not + appear to work with the Winbond 82C490 RAMDACs (which SuperProbe identifies + as AT&T 20C492). + .sp + \fBsc15025\fP - (S3) Card has a Sierra SC15025 or SC15026 RAMDAC. + This option when combined with the \fBdac_8_bit\fP option allows these + RAMDACs to be operated in 8 bit per RGB mode. There is currently no + auto-detection for these RAMDACs. + .sp \fBbt485\fP - (S3) Card has a BrookTree Bt485 RAMDAC. This option is required if the server fails to detect the Bt485. .sp ! \fB20c505\fP - (S3) Card has an AT&T 20C505 RAMDAC. This option is required ! either if the server fails to detect the 20C505, or if the card has a Bt485 ! RAMDAC and there are problems using clocks higher than 67.5Mhz. ! .sp ! \fBbt485_curs\fP - (S3) Enables the Bt485's internal HW cursor. This option ! may be used for cards with Bt485 or AT&T 20C505 RAMDACs. .sp ! \fBti3020\fP - (S3) Card has a TI ViewPoint Ti3020 135MHz RAMDAC. This option ! is required if the server fails to detect the Ti3020. This is the default if ! a Ti3020 RAMDAC is detected and the ti3020_fast option is not set. Note that ! pixel multiplexing will be used for this RAMDAC if any mode requires a ! dot clock higher than 70MHz. Pixel multiplexing with this RAMDAC does not ! support physical mode widths less than 1024 or interlaced modes. Also, the ! only logical line widths that work when operating in pixel multiplex mode ! are 1024 and 2048. .sp + \fBti3020_fast\fP - (S3) Card has a TI ViewPoint Ti3020 200MHz RAMDAC. + .sp + \fBti3020_curs\fP - (S3) Enables the Ti3020's internal HW cursor. (Default) + .sp + \fBno_ti3020_curs\fP - (S3) Disables the Ti3020's internal HW cursor. + .sp \fBsw_cursor\fP - (Mach32) Disable the hardware cursor. + .sp + \fBdac_8_bit\fP - (S3, Mach32) Enables 8-bit per RGB. Currently only + supported with the Ti3020, AT&T 20C490/1, Sierra SC15025/6 (S3 server) + and ATI68875/TLC34075/Bt885 (Mach32 server) RAMDACs. + .sp + \fBintel_gx\fP - (Mach32) Sets the hard-wired offset for the linear + framebuffer correctly for the Intel GX Pro cards. This option is equivalent + to setting the \fBmembase\fP to \fI0x78000000\fP. + .sp + \fBspea_mercury\fP - (S3) Enables pixel multiplex support for SPEA Mercury + cards (928 + Bt485 RAMDAC). For these cards, pixel multiplexing is required + in order to use dot clocks higher than 67.5 MHz and to access more than + 1MB of video memory. Pixel multiplexing is currently supported only for + non-interlaced modes, and modes with a physical width no smaller than 1024. .PP Note that \fIXFree86\fP has some internal capabilities to determine what hardware *************** *** 183,190 **** \fBIt is recommended that all parameters, especially Clock values, be specified in the Xconfig file.\fP .PP - Note: the Mach32 server will not auto-detect the clocks. - .PP The last section is the \fBTABLE OF VIDEO MODES\fP which starts with the keyword \fBmodedb\fP. This is covered in the .I Xconfig(4/5) --- 240,245 ---- *************** *** 236,241 **** --- 291,297 ---- David Wexelblat, \fIdwex@goblin.org\fP, \fIdwex@aib.com\fP David Dawes, \fIdawes@physics.su.oz.au\fP Amancio Hasty, \fIhasty@netcom.com\fP + Robin Cutshaw, \fIrobin@paros.com\fP .fi .RS 8 Development and improvement of the S3 specific code. *************** *** 257,262 **** --- 313,319 ---- Rik Faith, \fIfaith@cs.unc.edu\fP Mike Bernson, \fImike@mbsun.mlb.org\fP Mark Weaver, \fIMark_Weaver@brown.edu\fP + Craig Groeschel, \fIcraig@adikia.sccsi.com\fP .fi .RS 8 Development and improvement of the Mach32 specific code. *************** *** 267,273 **** manual page. .SH BUGS .PP ! S3 cards with Bt485 ramdacs and ATI cards are currently restricted to dot-clocks less than 85MHz. This restriction is because the servers don't yet support operating the ramdacs in multiplexed mode. .SH CONTACT INFO --- 324,330 ---- manual page. .SH BUGS .PP ! S3 cards with Bt485 ramdacs are currently restricted to dot-clocks less than 85MHz. This restriction is because the servers don't yet support operating the ramdacs in multiplexed mode. .SH CONTACT INFO diff -c mit/server/ddx/x386/XF86_Mono.man:2.9 mit/server/ddx/x386/XF86_Mono.man:2.10 *** mit/server/ddx/x386/XF86_Mono.man:2.9 Fri Mar 11 23:35:46 1994 --- mit/server/ddx/x386/XF86_Mono.man Fri Mar 11 23:35:46 1994 *************** *** 1,6 **** ! .\" $XFree86: mit/server/ddx/x386/XF86_Mono.man,v 2.9 1993/10/18 12:16:10 dawes Exp $ .\" $XConsortium: X386.man,v 1.3 91/08/26 15:31:19 gildea Exp $ ! .TH XF86_Mono 1 "Version 2.0" "XFree86" .SH NAME XF86_Mono - 1 bit non-accelerated X Window System servers for UNIX on x86 platforms --- 1,6 ---- ! .\" $XFree86: mit/server/ddx/x386/XF86_Mono.man,v 2.10 1994/02/27 05:17:21 dawes Exp $ .\" $XConsortium: X386.man,v 1.3 91/08/26 15:31:19 gildea Exp $ ! .TH XF86_Mono 1 "Version 2.1" "XFree86" .SH NAME XF86_Mono - 1 bit non-accelerated X Window System servers for UNIX on x86 platforms *************** *** 50,57 **** .RE .PP Additionally it ! supports generic VGA cards, Hercules monochrome graphics cards, and the Hyundai ! HGC1280 card. .PP On supported SVGA chipsets, .I XF86_Mono --- 50,57 ---- .RE .PP Additionally it ! supports generic VGA cards, Hercules monochrome graphics cards, the Hyundai ! HGC1280 card, Sigma LaserView, and Visa monochrome cards. .PP On supported SVGA chipsets, .I XF86_Mono *************** *** 145,150 **** --- 145,156 ---- .TP 4 Hyundai: hgc1280 + .TP 4 + Sigma: + sigmalview + .TP 4 + Visa: + visa6845 .RE .TP 8 .B clocks \fIclock\fP ... *************** *** 153,158 **** --- 159,170 ---- stored internally to the nearest kHz. The ordering of the clocks is important. It must match the order in which they are selected on the graphics board. Multiple \fBclocks\fP lines may be specified. + .TP 8 + .B membase \fImemaddress\fP + specifies the base address of the video memory. This option is only used + for the Sigma LaserView cards. Valid addresses for these cards are + \fI0xA0000\fP, \fI0xB0000\fP, \fI0xC0000\fP, \fI0xD0000\fP, \fI0xE0000\fP. + The default is \fI0xE0000\fP. .TP 8 .B black \fIred green blue\fP sets the ``black'' colour to the rgb values specified. These values must be diff -c mit/server/ddx/x386/XF86_SVGA.man:2.7 mit/server/ddx/x386/XF86_SVGA.man:2.10 *** mit/server/ddx/x386/XF86_SVGA.man:2.7 Fri Mar 11 23:35:47 1994 --- mit/server/ddx/x386/XF86_SVGA.man Fri Mar 11 23:35:47 1994 *************** *** 1,6 **** ! .\" $XFree86: mit/server/ddx/x386/XF86_SVGA.man,v 2.7 1993/10/21 15:53:57 dawes Exp $ .\" $XConsortium: X386.man,v 1.3 91/08/26 15:31:19 gildea Exp $ ! .TH XF86_SVGA 1 "Version 2.0" "XFree86" .SH NAME XF86_SVGA - 8 bit non-accelerated X Window System servers for UNIX on x86 platforms --- 1,6 ---- ! .\" $XFree86: mit/server/ddx/x386/XF86_SVGA.man,v 2.10 1994/03/06 13:04:17 dawes Exp $ .\" $XConsortium: X386.man,v 1.3 91/08/26 15:31:19 gildea Exp $ ! .TH XF86_SVGA 1 "Version 2.1" "XFree86" .SH NAME XF86_SVGA - 8 bit non-accelerated X Window System servers for UNIX on x86 platforms *************** *** 62,68 **** OTI067, OTI077 .RE .PP ! Accelerated support is included for the Cirrus CLGD5426, CLGD5428, and the Western Digital WD90C31 chipsets. Accelerated support for the ET4000/W32 is NOT yet implemented. Users of boards based on ATI's Mach8 and Mach32 chipsets should refer to the \fIXF86_Mach8(1)\fP and --- 62,68 ---- OTI067, OTI077 .RE .PP ! Accelerated support is included for most of the Cirrus chipsets, and for the Western Digital WD90C31 chipsets. Accelerated support for the ET4000/W32 is NOT yet implemented. Users of boards based on ATI's Mach8 and Mach32 chipsets should refer to the \fIXF86_Mach8(1)\fP and *************** *** 174,179 **** --- 174,193 ---- .sp \fBnoaccel\fP - for Cirrus and WD chipsets. This option disables the accelerated features for the clgd5426, clgd5428 and wd90c31 chipsets. + .sp + \fBfifo_conservative\fP - for Cirrus chipsets. This option sets the CRT + FIFO threshold to a conservative value for dot clocks above 65MHz. This + reduces performance, but may help in eliminating problems with ``streaks'' + on the screen during BitBLT operations + .sp + \fBfifo_aggressive\fP - for Cirrus chipsets. This option sets the CRT + FIFO threshold to an aggressive value for dot clocks above 65MHz. This + increases performance, and is probably only appropriate for the clgd5434 + chip. + .sp + \fBno_2mb_banksel\fP - for Cirrus chipsets. This option is required for + Cirrus cards with 2MB of videoram which is in the form of 512kx8 DRAMs + (4 chips) rather than 256kx4 DRAMs (16 chips). .ig intern_disp (use internal display for laptops -- WD90C2x) extern_disp (use external display for laptops -- WD90C2x) diff -c mit/server/ddx/x386/XF86_VGA16.man:2.3 mit/server/ddx/x386/XF86_VGA16.man:2.5 *** mit/server/ddx/x386/XF86_VGA16.man:2.3 Fri Mar 11 23:35:47 1994 --- mit/server/ddx/x386/XF86_VGA16.man Fri Mar 11 23:35:48 1994 *************** *** 1,6 **** ! .\" $XFree86: mit/server/ddx/x386/XF86_VGA16.man,v 2.3 1993/10/18 12:16:13 dawes Exp $ .\" $XConsortium: X386.man,v 1.3 91/08/26 15:31:19 gildea Exp $ ! .TH XF86_VGA16 1 "Version 2.0" "XFree86" .SH NAME XF86_VGA16 - 4 bit non-accelerated X Window System server for UNIX on x86 platforms --- 1,6 ---- ! .\" $XFree86: mit/server/ddx/x386/XF86_VGA16.man,v 2.5 1994/03/07 13:55:45 dawes Exp $ .\" $XConsortium: X386.man,v 1.3 91/08/26 15:31:19 gildea Exp $ ! .TH XF86_VGA16 1 "Version 2.1" "XFree86" .SH NAME XF86_VGA16 - 4 bit non-accelerated X Window System server for UNIX on x86 platforms *************** *** 32,37 **** --- 32,40 ---- .TP 4 Tseng: ET4000 + .TP 4 + Trident: + TVGA8800CS, TVGA8900B, TVGA8900C, TVGA8900CL, TVGA9000 .RE .PP Additionally it *************** *** 38,46 **** supports generic VGA cards. .PP .I XF86_VGA16 - will use up to 256Kb of display memory which yields a - maximum virtual resolution of (approximately) 800x650. - .I XF86_VGA16 does not support the accelerated functions of the supported chipsets. .SH OPTIONS In addition to the normal server options described in the \fIXserver(1)\fP --- 41,46 ---- *************** *** 76,81 **** --- 76,84 ---- .TP 4 Tseng: et4000 + .TP 4 + Trident: + tvga8800cs, tvga8900b, tvga8900c, tvga8900cl, tvga9000 .TP 4 Generic VGA: generic diff -c mit/server/ddx/x386/XF86kbd.man:2.1 mit/server/ddx/x386/XF86kbd.man:2.2 *** mit/server/ddx/x386/XF86kbd.man:2.1 Fri Mar 11 23:35:48 1994 --- mit/server/ddx/x386/XF86kbd.man Fri Mar 11 23:35:48 1994 *************** *** 1,7 **** '\" t ! '\" $XFree86: mit/server/ddx/x386/XF86kbd.man,v 2.1 1993/10/21 15:53:59 dawes Exp $ '\" ! .TH XFree86kbd 1 "Version 2.0" "XFree86" .SH NAME XFree86kbd - Description of keymapping capabilities of XFree86 servers .SH DESCRIPTION --- 1,7 ---- '\" t ! '\" $XFree86: mit/server/ddx/x386/XF86kbd.man,v 2.2 1994/02/27 05:17:26 dawes Exp $ '\" ! .TH XFree86kbd 1 "Version 2.1" "XFree86" .SH NAME XFree86kbd - Description of keymapping capabilities of XFree86 servers .SH DESCRIPTION diff -c mit/server/ddx/x386/XFree86.man:2.9 mit/server/ddx/x386/XFree86.man:2.11 *** mit/server/ddx/x386/XFree86.man:2.9 Fri Mar 11 23:35:49 1994 --- mit/server/ddx/x386/XFree86.man Fri Mar 11 23:35:49 1994 *************** *** 1,6 **** ! .\" $XFree86: mit/server/ddx/x386/XFree86.man,v 2.9 1993/10/21 15:54:01 dawes Exp $ .\" $XConsortium: X386.man,v 1.3 91/08/26 15:31:19 gildea Exp $ ! .TH XFree86 1 "Version 2.0" "XFree86" .SH NAME XFree86 - X11R5 Enhancement Package for UNIX on x86 platforms .SH DESCRIPTION --- 1,6 ---- ! .\" $XFree86: mit/server/ddx/x386/XFree86.man,v 2.11 1994/03/08 08:07:18 dawes Exp $ .\" $XConsortium: X386.man,v 1.3 91/08/26 15:31:19 gildea Exp $ ! .TH XFree86 1 "Version 2.1" "XFree86" .SH NAME XFree86 - X11R5 Enhancement Package for UNIX on x86 platforms .SH DESCRIPTION *************** *** 30,37 **** .br -- SVR4.2: Consensys, Univel (UnixWare) .br ! -- 386BSD version 0.1, FreeBSD 1.0, NetBSD 0.9 (i386 port only) .br -- BSD/386 version 1.0 .br -- Mach (from CMU) --- 30,39 ---- .br -- SVR4.2: Consensys, Univel (UnixWare) .br ! -- Solaris (x86) 2.1 .br + -- 386BSD version 0.1, FreeBSD 1.0, 1.1, NetBSD 0.9 (i386 port only) + .br -- BSD/386 version 1.0 .br -- Mach (from CMU) *************** *** 302,307 **** --- 304,315 ---- Orest Zborowski, \fIorestz@microsoft.com\fP Ported to \fBLinux\fP. .TP 8 + Doug Anson, \fIdanson@lgc.com\fP + Ported to \fBSolaris x86\fP. + .TP 8 + David Holland, \fIdavidh@use.com\fP + Ported to \fBSolaris x86\fP. + .TP 8 David McCullough, \fIdavidm@stallion.oz.au\fP Ported to \fBSCO SVR3\fP. .TP 8 *************** *** 321,326 **** --- 329,337 ---- Jon Tombs, \fIjon@gtex02.us.es\fP S3 server and accelerated server coordination. .TP 8 + Robin Cutshaw, \fIrobin@paros.com\fP + S3 server ramdac support. + .TP 8 Kevin Martin, \fImartin@cs.unc.edu\fP Overall work on the base accelerated servers (ATI and 8514/A). .TP 8 *************** *** 339,346 **** --- 350,363 ---- Mark Weaver, \fIMark_Weaver@brown.edu\fP Mach32 server development. .TP 8 + Craig Groeschel, \fIcraig@adikia.sccsi.com\fP + Mach32 server development. + .TP 8 Simon Cooper, \fIscooper@vizlab.rutgers.edu\fP Cirrus accelerated code (based on work by Bill Reynolds). + .TP 8 + Harm Hanemaayer, \fIhhanemaa@cs.ruu.nl\fP + Cirrus accelerated code. .TP 8 Mike Tierney, \fIfloyd@eng.umd.edu\fP WD accelerated code. diff -c mit/server/ddx/x386/Xconfig.man:2.5 mit/server/ddx/x386/Xconfig.man:2.9 *** mit/server/ddx/x386/Xconfig.man:2.5 Fri Mar 11 23:35:50 1994 --- mit/server/ddx/x386/Xconfig.man Fri Mar 11 23:35:50 1994 *************** *** 1,6 **** ! .\" $XFree86: mit/server/ddx/x386/Xconfig.man,v 2.5 1993/10/18 12:16:17 dawes Exp $ .\" $XConsortium: X386.man,v 1.3 91/08/26 15:31:19 gildea Exp $ ! .TH Xconfig 4/5 "Version 2.0" "XFree86" .SH NAME Xconfig - Configuration File for XFree86 .SH DESCRIPTION --- 1,6 ---- ! .\" $XFree86: mit/server/ddx/x386/Xconfig.man,v 2.9 1994/03/08 08:07:19 dawes Exp $ .\" $XConsortium: X386.man,v 1.3 91/08/26 15:31:19 gildea Exp $ ! .TH Xconfig 4/5 "Version 2.1" "XFree86" .SH NAME Xconfig - Configuration File for XFree86 .SH DESCRIPTION *************** *** 124,129 **** --- 124,133 ---- makes \fIled\fP available for clients instead of using the traditional function (Scroll Lock, Caps Lock & Num Lock) .TP 8 + .B vtsysreq + enables the SYSV-style VT switch sequence for non-SYSV systems which support + VT switching. This sequence is Alt-SysRq followed by a function key (Fn). + .TP 8 .B vtinit \fI"command"\fP Runs \fIcommand\fP after the VT used by the server has been opened. The command string is passed to "/bin/sh -c", and is run with the real user's id *************** *** 186,195 **** currently only supported for logitech mice. .TP 8 .B cleardtr ! This options clears the DTR line on the serial port used by the mouse. This option is only valid for a mouse using the \fBmousesystems\fP protocol. Some dual-protocol mice require DTR to be cleared to operate in mousesystems ! mode. .PP The \fBGRAPHICS DRIVER SETUP\fP section depends on the actually used server. Here only the general features are explained, for more detail --- 190,208 ---- currently only supported for logitech mice. .TP 8 .B cleardtr ! This option clears the DTR line on the serial port used by the mouse. This option is only valid for a mouse using the \fBmousesystems\fP protocol. Some dual-protocol mice require DTR to be cleared to operate in mousesystems ! mode. Note, in versions of XFree86 prior to 2.1, this option also cleared ! the RTS line. A separate \fBclearrts\fP option has been added for mice ! which require this. ! .TP 8 ! .B clearrts ! This option clears the RTS line on the serial port used by the mouse. This ! option is only valid for a mouse using the \fBmousesystems\fP protocol. ! Some dual-protocol mice require both DTR and RTS to be cleared to operate ! in mousesystems mode. Both the \fBcleardtr\fP and \fBclearrts\fP options ! should be used for such mice. .PP The \fBGRAPHICS DRIVER SETUP\fP section depends on the actually used server. Here only the general features are explained, for more detail *************** *** 210,216 **** .B staticgray,grayscale,staticcolor,pseudocolor,truecolor,directcolor sets the visual class for the root window of the screen. Note that the monochrome server only supports a \fIstaticgray\fP visual, and the 16 colour ! VGA server only supports a \fIpseudocolor\fP visual. .br .ne 3i .TP 8 --- 223,230 ---- .B staticgray,grayscale,staticcolor,pseudocolor,truecolor,directcolor sets the visual class for the root window of the screen. Note that the monochrome server only supports a \fIstaticgray\fP visual, and the 16 colour ! VGA server only supports \fIpseudocolor\fP, \fIstaticgray\fP and ! \fIgrayscale\fP visuals. .br .ne 3i .TP 8 diff -c mit/server/ddx/x386/LinkKit/Imakefile.LK:2.15 mit/server/ddx/x386/LinkKit/Imakefile.LK:2.17 *** mit/server/ddx/x386/LinkKit/Imakefile.LK:2.15 Fri Mar 11 23:35:54 1994 --- mit/server/ddx/x386/LinkKit/Imakefile.LK Fri Mar 11 23:35:54 1994 *************** *** 1,4 **** ! XCOMM $XFree86: mit/server/ddx/x386/LinkKit/Imakefile.LK,v 2.15 1993/10/02 07:13:55 dawes Exp $ /* * Server Makefile for Link Kit */ --- 1,4 ---- ! XCOMM $XFree86: mit/server/ddx/x386/LinkKit/Imakefile.LK,v 2.17 1994/03/09 02:18:34 dawes Exp $ /* * Server Makefile for Link Kit */ *************** *** 47,63 **** EXTRASYSLIBS = /usr/misc/.mach/lib/libmach.a #endif #endif - #if HasSdbm - DBMLIB = -lsdbm - #else - #if !i386Bsd - DBMLIB = -ldbm - #endif - #endif #if NeedLibGcc GCCLIB = -lgcc #endif ! SYSLIBS = -lm $(DBMLIB) $(MALLOCLIBS) $(EXTRASYSLIBS) $(GCCLIB) CBRT = lib/cbrt.o IRULESRC = $(CONFIGDIR) --- 47,56 ---- EXTRASYSLIBS = /usr/misc/.mach/lib/libmach.a #endif #endif #if NeedLibGcc GCCLIB = -lgcc #endif ! SYSLIBS = -lm $(MALLOCLIBS) $(EXTRASYSLIBS) $(GCCLIB) CBRT = lib/cbrt.o IRULESRC = $(CONFIGDIR) *************** *** 323,329 **** #endif /* Only these servers have subdirs */ ! #if XF86SVGAServer || XF86MonoServer SUBDIRS = $(SUBDIRS0) $(SUBDIRS1) $(SUBDIRS2) $(SUBDIRS3) $(SUBDIRS4) $(SUBDIRS5) $(SUBDIRS6) --- 316,322 ---- #endif /* Only these servers have subdirs */ ! #if XF86SVGAServer || XF86MonoServer || XF86VGA16Server || XF86S3Server SUBDIRS = $(SUBDIRS0) $(SUBDIRS1) $(SUBDIRS2) $(SUBDIRS3) $(SUBDIRS4) $(SUBDIRS5) $(SUBDIRS6) *************** *** 339,344 **** DependTarget() ! #endif /* XF86SVGAServer || XF86MonoServer */ #endif /* Init */ --- 332,337 ---- DependTarget() ! #endif /* XF86SVGAServer || XF86MonoServer || XF86VGA16Server || XF86S3Server */ #endif /* Init */ diff -c mit/server/ddx/x386/LinkKit/site.def.LK:2.9 mit/server/ddx/x386/LinkKit/site.def.LK:2.10 *** mit/server/ddx/x386/LinkKit/site.def.LK:2.9 Fri Mar 11 23:35:54 1994 --- mit/server/ddx/x386/LinkKit/site.def.LK Fri Mar 11 23:35:54 1994 *************** *** 1,4 **** ! XCOMM $XFree86: mit/server/ddx/x386/LinkKit/site.def.LK,v 2.9 1993/10/16 17:30:15 dawes Exp $ /* Configuration file for Server Link Kit */ --- 1,4 ---- ! XCOMM $XFree86: mit/server/ddx/x386/LinkKit/site.def.LK,v 2.10 1994/03/09 02:18:36 dawes Exp $ /* Configuration file for Server Link Kit */ *************** *** 53,58 **** --- 53,59 ---- #define FontRenderers Speedo Type1 #define X386Vga2Drivers et4000 et3000 pvga1 gvga tvga8900 ncr \ compaq oak generic + #define X386Vga16Drivers et4000 tvga8900 generic #define X386Vga256Drivers et4000 et3000 pvga1 gvga ati tvga8900 cirrus \ ncr compaq oak #define X386Hga2Drivers /**/ *************** *** 63,72 **** * To include the generic banked monochrome driver in the monochrome server, * uncomment this with one of the following low level drivers * hgc1280 [Hyundai HGC-1280 1280x1024] * ... * (list is subject to grow) */ ! /* #define X386Bdm2Drivers hgc1280 */ /* #define XF86S3Drivers mmio_928 s3_generic */ /* --- 64,75 ---- * To include the generic banked monochrome driver in the monochrome server, * uncomment this with one of the following low level drivers * hgc1280 [Hyundai HGC-1280 1280x1024] + * sigma [Sigma L-View] + * visa [???] * ... * (list is subject to grow) */ ! /* #define X386Bdm2Drivers hgc1280 sigma visa */ /* #define XF86S3Drivers mmio_928 s3_generic */ /* diff -c mit/server/ddx/x386/SuperProbe/00README:2.4 mit/server/ddx/x386/SuperProbe/00README:2.8 *** mit/server/ddx/x386/SuperProbe/00README:2.4 Fri Mar 11 23:36:01 1994 --- mit/server/ddx/x386/SuperProbe/00README Fri Mar 11 23:36:02 1994 *************** *** 1,6 **** README file for SuperProbe -------------------------- ! Version 1.0 David E Wexelblat dwex@goblin.org --- 1,6 ---- README file for SuperProbe -------------------------- ! Version 2.0 David E Wexelblat dwex@goblin.org *************** *** 9,19 **** ----------- SuperProbe is a program for Intel-based Unix machines. It is used to determine the type of video hardware installed in the machine, including, ! where it can be determined, which specific chipset. The current version ! supports EISA/ISA machines running SVR3, SVR4, Linux, 386BSD, Minix-386, ! and Mach (MicroChannel machines are not currently supported; hopefully ! this support will be included in a future release. These may work ! anyhow, though, with the -no_bios option). Adding support for other operating systems should be fairly trivial, as the OS dependencies are isolated to a single file for each OS. --- 9,20 ---- ----------- SuperProbe is a program for Intel-based Unix machines. It is used to determine the type of video hardware installed in the machine, including, ! where it can be determined, which specific chipset, what type of ! RAMDAC is attached, and how much video memory resides on the board. ! The current version supports EISA/ISA/VLB machines running SVR3, ! SVR4, Linux, *BSD*, Minix-386, and Mach (MicroChannel and PCI machines ! are believed to work as well, although the BIOS checking may need to ! be disabled via the '-no_bios' option). Adding support for other operating systems should be fairly trivial, as the OS dependencies are isolated to a single file for each OS. *************** *** 47,55 **** Credits ------- Finn Thoegersen ! For providing the vgadoc2.zip video hardware documentation package ! and sample code, and for allowing me to port his code to the Unix ! environment. David Dawes For lots of help on the initial design, and writing the 386BSD OS --- 48,56 ---- Credits ------- Finn Thoegersen ! For providing the vgadoc2.zip and vgadoc3.zip video hardware ! documentation packages and sample code, and for allowing me ! to port his code to the Unix environment. David Dawes For lots of help on the initial design, and writing the 386BSD OS *************** *** 72,75 **** For helping test and debug this software. ! $XFree86: mit/server/ddx/x386/SuperProbe/00README,v 2.4 1993/10/07 13:54:42 dawes Exp $ --- 73,76 ---- For helping test and debug this software. ! $XFree86: mit/server/ddx/x386/SuperProbe/00README,v 2.8 1994/03/02 08:04:48 dawes Exp $ diff -c mit/server/ddx/x386/SuperProbe/8514.c:2.1 mit/server/ddx/x386/SuperProbe/8514.c:2.3 *** mit/server/ddx/x386/SuperProbe/8514.c:2.1 Fri Mar 11 23:36:02 1994 --- mit/server/ddx/x386/SuperProbe/8514.c Fri Mar 11 23:36:02 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/8514.c,v 2.1 1993/09/21 15:20:23 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/8514.c,v 2.3 1994/02/28 14:09:09 dawes Exp $ */ #include "Probe.h" *************** *** 33,38 **** --- 33,40 ---- static Word Ports[] = {SUBSYS_CNTL,ERR_TERM}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_8514 __STDCARGS((int)); + Chip_Descriptor IBM8514_Descriptor = { "8514/A", Probe_8514, *************** *** 40,54 **** NUMPORTS, TRUE, FALSE, ! FALSE }; - #ifdef __STDC__ - Bool Probe_8514(int *Chipset) - #else Bool Probe_8514(Chipset) int *Chipset; - #endif { Bool result = FALSE; --- 42,53 ---- NUMPORTS, TRUE, FALSE, ! FALSE, ! MemProbe_8514, }; Bool Probe_8514(Chipset) int *Chipset; { Bool result = FALSE; *************** *** 74,80 **** outpw(ERR_TERM, 0x5555); if (inpw(ERR_TERM) == 0x5555) { ! *Chipset = CHIP_8514; result = TRUE; } } --- 73,86 ---- outpw(ERR_TERM, 0x5555); if (inpw(ERR_TERM) == 0x5555) { ! if (tstrg(EXT_CONF_3, 0xF0)) ! { ! *Chipset = CHIP_CT480; ! } ! else ! { ! *Chipset = CHIP_8514; ! } result = TRUE; } } *************** *** 81,84 **** --- 87,111 ---- DisableIOPorts(NUMPORTS, Ports); return(result); + } + + /* ARGSUSED */ + static int MemProbe_8514(Chipset) + int Chipset; + { + int Mem; + + EnableIOPorts(NUMPORTS, Ports); + + if (inpw(SUBSYS_CNTL) & 0x0080) + { + Mem = 1024; + } + else + { + Mem = 512; + } + + DisableIOPorts(NUMPORTS, Ports); + return(Mem); } diff -c mit/server/ddx/x386/SuperProbe/AL.c:2.1 mit/server/ddx/x386/SuperProbe/AL.c:2.4 *** mit/server/ddx/x386/SuperProbe/AL.c:2.1 Fri Mar 11 23:36:03 1994 --- mit/server/ddx/x386/SuperProbe/AL.c Fri Mar 11 23:36:03 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,50 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/AL.c,v 2.1 1993/09/21 15:20:24 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x000, 0x000, 0x8286, 0x3CE, 0x3CF}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor AL_Descriptor = { "AL", Probe_AL, Ports, NUMPORTS, ! TRUE, FALSE, ! FALSE }; - #ifdef __STDC__ - Bool Probe_AL(int *Chipset) - #else Bool Probe_AL(Chipset) int *Chipset; - #endif { Bool result = FALSE; /* Add CRTC to enabled ports */ --- 21,50 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/AL.c,v 2.4 1994/03/02 08:04:51 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x000, 0x000}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_AL __STDCARGS((int)); + Chip_Descriptor AL_Descriptor = { "AL", Probe_AL, Ports, NUMPORTS, ! FALSE, FALSE, ! FALSE, ! MemProbe_AL, }; Bool Probe_AL(Chipset) int *Chipset; { + Byte old; Bool result = FALSE; /* Add CRTC to enabled ports */ *************** *** 51,63 **** Ports[0] = CRTC_IDX; Ports[1] = CRTC_REG; EnableIOPorts(NUMPORTS, Ports); ! if (testinx2(CRTC_IDX, 0x1F, 0x3B) && ! testinx2(0x3CE, 0x0D, 0x0F) && ! tstrg(0x8286, 0xFF)) { ! result = TRUE; ! *Chipset = CHIP_AL2101; } DisableIOPorts(NUMPORTS, Ports); return(result); } --- 51,114 ---- Ports[0] = CRTC_IDX; Ports[1] = CRTC_REG; EnableIOPorts(NUMPORTS, Ports); ! ! old = rdinx(CRTC_IDX, 0x1A); ! clrinx(CRTC_IDX, 0x1A, 0x10); ! if (!testinx(CRTC_IDX, 0x19)) { ! setinx(CRTC_IDX, 0x1A, 0x10); ! if ((testinx(CRTC_IDX, 0x19) && ! (testinx2(CRTC_IDX, 0x1A, 0x3F)))) ! { ! result = TRUE; ! *Chipset = CHIP_AL2101; ! } } + wrinx(CRTC_IDX, 0x1A, old); + DisableIOPorts(NUMPORTS, Ports); return(result); + } + + /* ARGSUSED */ + static int MemProbe_AL(Chipset) + int Chipset; + { + Byte old; + int Mem; + + EnableIOPorts(NUMPORTS, Ports); + + /* + * Unlock + */ + old = rdinx(CRTC_IDX, 0x1A); + setinx(CRTC_IDX, 0x1A, 0x10); + + /* + * Check + */ + switch (rdinx(CRTC_IDX, 0x1E) & 0x03) + { + case 0x00: + Mem = 256; + break; + case 0x01: + Mem = 512; + break; + case 0x02: + Mem = 1024; + break; + case 0x03: + Mem = 2048; + break; + } + + /* + * Lock + */ + wrinx(CRTC_IDX, 0x1A, old); + + DisableIOPorts(NUMPORTS, Ports); + return(Mem); } diff -c mit/server/ddx/x386/SuperProbe/ATI.c:2.3 mit/server/ddx/x386/SuperProbe/ATI.c:2.7 *** mit/server/ddx/x386/SuperProbe/ATI.c:2.3 Fri Mar 11 23:36:03 1994 --- mit/server/ddx/x386/SuperProbe/ATI.c Fri Mar 11 23:36:03 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,30 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/ATI.c,v 2.3 1993/09/27 12:23:11 dawes Exp $ */ #include "Probe.h" Chip_Descriptor ATI_Descriptor = { "ATI", Probe_ATI, --- 21,32 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/ATI.c,v 2.7 1994/03/07 13:56:04 dawes Exp $ */ #include "Probe.h" + static int MemProbe_ATI __STDCARGS((int)); + Chip_Descriptor ATI_Descriptor = { "ATI", Probe_ATI, *************** *** 32,38 **** 0, FALSE, TRUE, ! TRUE }; #ifdef __STDC__ --- 34,41 ---- 0, FALSE, TRUE, ! TRUE, ! MemProbe_ATI, }; #ifdef __STDC__ *************** *** 45,50 **** --- 48,54 ---- Bool result = FALSE; Byte bios[10]; Byte *signature = (Byte *)"761295520"; + Word GUP; if (ReadBIOS(0x31, bios, 9) != 9) { *************** *** 80,89 **** *Chipset = CHIP_ATI28800_5; break; case 'a': ! *Chipset = CHIP_ATI28800_A; ! break; case 'c': ! *Chipset = CHIP_ATI28800_C; /* XLR? */ break; default: Chip_data = bios[3]; --- 84,122 ---- *Chipset = CHIP_ATI28800_5; break; case 'a': ! case 'b': case 'c': ! /* ! * 68800-?? ! * ! * Chipset ID encoded as: ! * Bits 0-4 - low letter ! * Bits 5-9 - high letter ! * Add 0x41 to each to get ascii letter. ! * ! * Started at 68800-6, so 0 shows up for the ! * 68800-3. ! */ ! GUP = inpw(CHIP_ID); ! switch (GUP & 0x03FF) ! { ! case 0x0000: ! *Chipset = CHIP_ATI68800_3; ! break; ! case 0x02F7: /* XX */ ! *Chipset = CHIP_ATI68800_6; ! break; ! case 0x0177: /* LX */ ! *Chipset = CHIP_ATI68800LX; ! break; ! case 0x0017: /* AX */ ! *Chipset = CHIP_ATI68800AX; ! break; ! default: ! Chip_data = ((GUP >> 5) & 0x1F) + 0x41; ! *Chipset = CHIP_ATI_UNK; ! break; ! } break; default: Chip_data = bios[3]; *************** *** 93,96 **** --- 126,209 ---- } } return(result); + } + + static int MemProbe_ATI(Chipset) + int Chipset; + { + Word Ports[3] = {0x000, 0x000, MISC_OPTIONS}; + Byte bios[20]; + int Mem = 0; + + if (ReadBIOS(0x40, bios, 20) != 20) + { + fprintf(stderr, "%s: Failed to read ATI BIOS data\n", MyName); + return(0); + } + Ports[0] = *((Word *)bios + 0x08); + Ports[1] = Ports[0] + 1; + EnableIOPorts(3, Ports); + + switch (Chipset) + { + case CHIP_ATI18800: + case CHIP_ATI18800_1: + if (rdinx(Ports[0], 0xBB) & 0x20) + { + Mem = 512; + } + else + { + Mem = 256; + } + break; + case CHIP_ATI28800_2: + if (rdinx(Ports[0], 0xB0) & 0x10) + { + Mem = 512; + } + else + { + Mem = 256; + } + break; + case CHIP_ATI28800_4: + case CHIP_ATI28800_5: + switch (rdinx(Ports[0], 0xB0) & 0x18) + { + case 0x00: + Mem = 256; + break; + case 0x10: + Mem = 512; + break; + case 0x08: + case 0x18: + Mem = 1024; + break; + } + break; + default: + /* GUP */ + switch ((inpw(MISC_OPTIONS) & 0x000C) >> 2) + { + case 0x00: + Mem = 512; + break; + case 0x01: + Mem = 1024; + break; + case 0x02: + Mem = 2048; + break; + case 0x03: + Mem = 4096; + break; + } + break; + } + + DisableIOPorts(3, Ports); + return(Mem); + } diff -c mit/server/ddx/x386/SuperProbe/ATIMach.c:2.3 mit/server/ddx/x386/SuperProbe/ATIMach.c:2.7 *** mit/server/ddx/x386/SuperProbe/ATIMach.c:2.3 Fri Mar 11 23:36:04 1994 --- mit/server/ddx/x386/SuperProbe/ATIMach.c Fri Mar 11 23:36:04 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,33 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/ATIMach.c,v 2.3 1993/09/25 05:01:39 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {ROM_ADDR_1,DESTX_DIASTP,READ_SRC_X}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor ATIMach_Descriptor = { "ATI_Mach", Probe_ATIMach, --- 21,36 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/ATIMach.c,v 2.7 1994/03/07 13:56:07 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {ROM_ADDR_1,DESTX_DIASTP,READ_SRC_X, ! CONFIG_STATUS_1,MISC_OPTIONS}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_ATIMach __STDCARGS((int)); + Chip_Descriptor ATIMach_Descriptor = { "ATI_Mach", Probe_ATIMach, *************** *** 35,41 **** NUMPORTS, TRUE, FALSE, ! FALSE }; #define WaitIdleEmpty() { int i; \ --- 38,45 ---- NUMPORTS, TRUE, FALSE, ! FALSE, ! MemProbe_ATIMach, }; #define WaitIdleEmpty() { int i; \ *************** *** 44,55 **** break; \ } - #ifdef __STDC__ - Bool Probe_ATIMach(int *Chipset) - #else Bool Probe_ATIMach(Chipset) int *Chipset; - #endif { Bool result = FALSE; Word tmp; --- 48,55 ---- *************** *** 124,127 **** --- 124,166 ---- DisableIOPorts(NUMPORTS, Ports); return(result); + } + + static int MemProbe_ATIMach(Chipset) + int Chipset; + { + int Mem = 0; + + EnableIOPorts(NUMPORTS, Ports); + if (Chipset == CHIP_MACH8) + { + if (inpw(CONFIG_STATUS_1) & 0x0020) + { + Mem = 1024; + } + else + { + Mem = 512; + } + } + else + { + switch ((inpw(MISC_OPTIONS) & 0x000C) >> 2) + { + case 0x00: + Mem = 512; + break; + case 0x01: + Mem = 1024; + break; + case 0x02: + Mem = 2048; + break; + case 0x03: + Mem = 4096; + break; + } + } + DisableIOPorts(NUMPORTS, Ports); + return(Mem); } diff -c mit/server/ddx/x386/SuperProbe/AcuMos.c:2.1 mit/server/ddx/x386/SuperProbe/AcuMos.c:removed *** mit/server/ddx/x386/SuperProbe/AcuMos.c:2.1 Fri Mar 11 23:36:04 1994 --- mit/server/ddx/x386/SuperProbe/AcuMos.c Fri Mar 11 23:36:04 1994 *************** *** 1,62 **** - /* - * Copyright 1993 by David Wexelblat - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, 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 David Wexelblat not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. David Wexelblat makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - */ - - /* $XFree86: mit/server/ddx/x386/SuperProbe/AcuMos.c,v 2.1 1993/09/21 15:20:27 dawes Exp $ */ - - #include "Probe.h" - - static Word Ports[] = {0x3C4, 0x3C5, 0x3CE, 0x3CF}; - #define NUMPORTS (sizeof(Ports)/sizeof(Word)) - - Chip_Descriptor AcuMos_Descriptor = { - "AcuMos", - Probe_AcuMos, - Ports, - NUMPORTS, - FALSE, - FALSE, - TRUE - }; - - #ifdef __STDC__ - Bool Probe_AcuMos(int *Chipset) - #else - Bool Probe_AcuMos(Chipset) - int *Chipset; - #endif - { - Bool result = FALSE; - Byte old; - - EnableIOPorts(NUMPORTS, Ports); - old = rdinx(0x3C4, 0x06); - wrinx(0x3C4, 0x06, 0x12); - if (testinx2(0x3CE, 0x09, 0x30)) - { - result = TRUE; - *Chipset = CHIP_ACUMOS; - } - wrinx(0x3C4, 0x06, old); - DisableIOPorts(NUMPORTS, Ports); - return(result); - } --- 0 ---- diff -c mit/server/ddx/x386/SuperProbe/Ahead.c:2.2 mit/server/ddx/x386/SuperProbe/Ahead.c:2.5 *** mit/server/ddx/x386/SuperProbe/Ahead.c:2.2 Fri Mar 11 23:36:05 1994 --- mit/server/ddx/x386/SuperProbe/Ahead.c Fri Mar 11 23:36:05 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,33 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Ahead.c,v 2.2 1993/09/27 12:23:12 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x3CE, 0x3CF}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor Ahead_Descriptor = { "Ahead", Probe_Ahead, --- 21,35 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Ahead.c,v 2.5 1994/03/02 08:04:53 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {GRC_IDX, GRC_REG}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_Ahead __STDCARGS((int)); + Chip_Descriptor Ahead_Descriptor = { "Ahead", Probe_Ahead, *************** *** 35,63 **** NUMPORTS, FALSE, FALSE, ! TRUE }; - #ifdef __STDC__ - Bool Probe_Ahead(int *Chipset) - #else Bool Probe_Ahead(Chipset) int *Chipset; - #endif { Bool result = FALSE; Byte old, tmp; EnableIOPorts(NUMPORTS, Ports); ! old = rdinx(0x3CE, 0x0F); ! wrinx(0x3CE, 0x0F, 0); ! if (!testinx2(0x3CE, 0x0C, 0xFB)) { ! wrinx(0x3CE, 0x0F, 0x20); ! if (testinx2(0x3CE, 0x0C, 0xFB)) { result = TRUE; ! tmp = rdinx(0x3CE, 0x0F) & 0x0F; switch (tmp) { case 0x01: --- 37,62 ---- NUMPORTS, FALSE, FALSE, ! TRUE, ! MemProbe_Ahead, }; Bool Probe_Ahead(Chipset) int *Chipset; { Bool result = FALSE; Byte old, tmp; EnableIOPorts(NUMPORTS, Ports); ! old = rdinx(GRC_IDX, 0x0F); ! wrinx(GRC_IDX, 0x0F, 0); ! if (!testinx2(GRC_IDX, 0x0C, 0xFB)) { ! wrinx(GRC_IDX, 0x0F, 0x20); ! if (testinx2(GRC_IDX, 0x0C, 0xFB)) { result = TRUE; ! tmp = rdinx(GRC_IDX, 0x0F) & 0x0F; switch (tmp) { case 0x01: *************** *** 73,79 **** } } } ! wrinx(0x3CE, 0x0F, old); DisableIOPorts(NUMPORTS, Ports); return(result); } --- 72,118 ---- } } } ! wrinx(GRC_IDX, 0x0F, old); DisableIOPorts(NUMPORTS, Ports); return(result); + } + + /* ARGSUSED */ + static int MemProbe_Ahead(Chipset) + int Chipset; + { + Byte old; + int Mem = 0; + + EnableIOPorts(NUMPORTS, Ports); + + /* + * Unlock + */ + old = rdinx(GRC_IDX, 0x0F); + setinx(GRC_IDX, 0x0F, 0x20); + + /* + * Check + */ + switch (rdinx(GRC_IDX, 0x1F) & 0x03) + { + case 0x00: + Mem = 256; + break; + case 0x01: + Mem = 512; + break; + case 0x03: + Mem = 1024; + break; + } + + /* + * Lock + */ + wrinx(GRC_IDX, 0x0F, old); + + DisableIOPorts(NUMPORTS, Ports); + return(Mem); } diff -c mit/server/ddx/x386/SuperProbe/Amake.srclist:1.1 mit/server/ddx/x386/SuperProbe/Amake.srclist:2.1 *** mit/server/ddx/x386/SuperProbe/Amake.srclist:1.1 Fri Mar 11 23:36:05 1994 --- mit/server/ddx/x386/SuperProbe/Amake.srclist Fri Mar 11 23:36:05 1994 *************** *** 1,10 **** ! # $XFree86: mit/server/ddx/x386/SuperProbe/Amake.srclist,v 1.1 1993/05/04 10:16:47 dawes Exp $ X11R5_MIT_SERVER_DDX_X386_SUPERPROBE= { $PWD/AL.c, $PWD/ATI.c, ! $PWD/AcuMos.c, $PWD/Ahead.c, $PWD/CGA.c, $PWD/ChipsTech.c, --- 1,11 ---- ! # $XFree86: mit/server/ddx/x386/SuperProbe/Amake.srclist,v 2.1 1994/02/28 14:09:16 dawes Exp $ X11R5_MIT_SERVER_DDX_X386_SUPERPROBE= { + $PWD/8514.c, $PWD/AL.c, $PWD/ATI.c, ! $PWD/ATIMach.c, $PWD/Ahead.c, $PWD/CGA.c, $PWD/ChipsTech.c, *************** *** 12,20 **** --- 13,23 ---- $PWD/Compaq.c, $PWD/Genoa.c, $PWD/Herc.c, + $PWD/HMC.c, $PWD/MDA.c, $PWD/MX.c, $PWD/Main.c, + $PWD/MemProbe.c, $PWD/NCR.c, $PWD/OS_Minix.c, $PWD/Oak.c, *************** *** 25,33 **** --- 28,38 ---- $PWD/S3.c, $PWD/Trident.c, $PWD/Tseng.c, + $PWD/UMC.c, $PWD/Utils.c, $PWD/VGA.c, $PWD/Video7.c, $PWD/WD.c, + $PWD/Weitek.c, $PWD/Yamaha.c, }; diff -c mit/server/ddx/x386/SuperProbe/CGA.c:1.2 mit/server/ddx/x386/SuperProbe/CGA.c:2.0 *** mit/server/ddx/x386/SuperProbe/CGA.c:1.2 Fri Mar 11 23:36:06 1994 --- mit/server/ddx/x386/SuperProbe/CGA.c Fri Mar 11 23:36:06 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/CGA.c,v 1.2 1993/05/04 10:16:49 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/CGA.c,v 2.0 1994/02/28 14:09:17 dawes Exp $ */ #include "Probe.h" *************** *** 33,44 **** static Word Ports[] = {0x3D4, 0x3D5}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) - #ifdef __STDC__ - Bool Probe_CGA(int *Chipset) - #else Bool Probe_CGA(Chipset) int *Chipset; - #endif { Bool result = FALSE; Byte tmp; --- 33,40 ---- diff -c mit/server/ddx/x386/SuperProbe/ChangeLog:2.8 mit/server/ddx/x386/SuperProbe/ChangeLog:2.12 *** mit/server/ddx/x386/SuperProbe/ChangeLog:2.8 Fri Mar 11 23:36:06 1994 --- mit/server/ddx/x386/SuperProbe/ChangeLog Fri Mar 11 23:36:06 1994 *************** *** 64,66 **** --- 64,92 ---- Version 1.0 - Add in Cirrus 62x5, 642x chipsets - Call it "done" for XFree86 2.0 + + Version 1.1 + - Add AT&T 20C505/504 checks to the RAMDAC probe + - Add Solaris x86 support (from David Holland ) + - Add -no_dac option to skip RAMDAC probe, in case it's nuking things. + - Long and short RamDac names. + - If the video BIOS can't be located, don't fail. Assume that there's + no EGA/VGA, and probe for old hardware. + - Put architecture in place for doing installed memory probes. + + Version 1.2 - Jan 2, 1994 + - More work on memory probes. Add support for probing memory + by mapping 0xA0000-0xAFFFF and switching banks. Support + memory probe via this mechanism for Trident and ET4000AX. + - Add probes for Trident 9200CXr, 9400CXi. + - Add support for USL-style VTs on bsd-du-jour (from J"org Wunsch). + - Add -no_mem option to skip memory probe + + Version 2.0 - Feb 27, 1994 + - Add memory probes for everything that can be accomplished by + reading registers. Nothing is currently using the physical + memory probe. + - Bazillions of changes from vgadoc3.zip (thanks, Finn). Added + HMC, UMC, Weitek probes. Added more chipsets for Cirrus, + NCR, Oak, RealTek, S3, Trident, Tseng, Video7, WD. Made some + changes to the probes for ATI & Compaq. diff -c mit/server/ddx/x386/SuperProbe/ChipsTech.c:2.2 mit/server/ddx/x386/SuperProbe/ChipsTech.c:2.4 *** mit/server/ddx/x386/SuperProbe/ChipsTech.c:2.2 Fri Mar 11 23:36:07 1994 --- mit/server/ddx/x386/SuperProbe/ChipsTech.c Fri Mar 11 23:36:07 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/ChipsTech.c,v 2.2 1993/09/27 12:23:15 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/ChipsTech.c,v 2.4 1994/02/28 14:09:20 dawes Exp $ */ #include "Probe.h" *************** *** 28,33 **** --- 28,35 ---- static Word Ports[] = {0x3D6, 0x3D7}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_CT __STDCARGS((int)); + Chip_Descriptor CT_Descriptor = { "CT", Probe_CT, *************** *** 36,41 **** --- 38,44 ---- FALSE, FALSE, TRUE, + MemProbe_CT, }; #ifdef __STDC__ *************** *** 96,99 **** --- 99,179 ---- } DisableIOPorts(NUMPORTS, Ports); return(result); + } + + static int MemProbe_CT(Chipset) + int Chipset; + { + int Mem = 0; + + EnableIOPorts(NUMPORTS, Ports); + + switch (Chipset) + { + case CHIP_CT450: + case CHIP_CT456: + if (rdinx(0x3D6, 0x04) & 0x01) + { + Mem = 512; + } + else + { + Mem = 256; + } + break; + case CHIP_CT451: + case CHIP_CT455: + case CHIP_CT457: + Mem = 256; + break; + case CHIP_CT452: + switch (rdinx(0x3D6, 0x04) & 0x03) + { + case 0x00: + Mem = 256; + break; + case 0x01: + Mem = 512; + break; + case 0x02: + Mem = 1024; + break; + } + break; + case CHIP_CT453: + switch ((rdinx(0x3D6, 0x24) >> 1) & 0x03) + { + case 0x01: + Mem = 512; + break; + case 0x02: + Mem = 1024; + break; + case 0x03: + Mem = 256; + break; + } + break; + case CHIP_CTF65510: + Mem = 512; + break; + case CHIP_CTF65520: + case CHIP_CTF65530: + switch (rdinx(0x3D6, 0x04) & 0x03) + { + case 0x00: + Mem = 256; + break; + case 0x01: + Mem = 512; + break; + case 0x03: + Mem = 1024; + break; + } + break; + } + + DisableIOPorts(NUMPORTS, Ports); + return(Mem); } diff -c mit/server/ddx/x386/SuperProbe/Cirrus.c:2.4 mit/server/ddx/x386/SuperProbe/Cirrus.c:2.7 *** mit/server/ddx/x386/SuperProbe/Cirrus.c:2.4 Fri Mar 11 23:36:07 1994 --- mit/server/ddx/x386/SuperProbe/Cirrus.c Fri Mar 11 23:36:07 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,31 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Cirrus.c,v 2.4 1993/10/07 13:54:45 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x000, 0x000, 0x3C4, 0x3C5, 0x3CE, 0x3CF}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor Cirrus_Descriptor = { --- 21,31 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Cirrus.c,v 2.7 1994/03/02 08:04:54 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x000, 0x000, SEQ_IDX, SEQ_REG, GRC_IDX, GRC_REG}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor Cirrus_Descriptor = { *************** *** 35,197 **** NUMPORTS, FALSE, FALSE, ! TRUE }; #ifdef __STDC__ ! Bool Probe_Cirrus(int *Chipset) #else Bool Probe_Cirrus(Chipset) int *Chipset; ! #endif { Bool result = FALSE; ! Byte old, old1, tmp; /* Add CRTC to enabled ports */ Ports[0] = CRTC_IDX; Ports[1] = CRTC_REG; EnableIOPorts(NUMPORTS, Ports); ! /* ! * First the old Cirrus chips. ! */ ! old = rdinx(CRTC_IDX, 0x0C); ! old1 = rdinx(0x3C4, 0x06); ! wrinx(CRTC_IDX,0x0C,0); ! tmp = rdinx(CRTC_IDX, 0x1F); ! wrinx(0x3C4, 0x06, (tmp >> 4) | (tmp << 4)); ! if (inp(0x3C5) == 0) ! { ! outp(0x3C5, tmp); ! if (inp(0x3C5) == 1) ! { ! result = TRUE; ! switch (tmp) ! { ! case 0xEC: ! *Chipset = CHIP_CL510; ! break; ! case 0xCA: ! *Chipset = CHIP_CL610; ! break; ! case 0xEA: ! *Chipset = CHIP_CLV7; ! break; ! default: ! Chip_data = tmp; ! *Chipset = CHIP_CL_UNKNOWN; ! break; ! } ! } ! } ! wrinx(0x3C4, 0x06, old1); ! wrinx(CRTC_IDX, 0x0C, old); ! /* ! * Now the new Cirrus chips ! */ ! if (!result) { ! old = rdinx(0x3C4, 0x06); ! wrinx(0x3C4, 0x06, 0x12); ! if ((rdinx(0x3C4, 0x06) == 0x12) && ! (testinx2(0x3C4, 0x1E, 0x3F)) && ! (testinx2(CRTC_IDX, 0x1B, 0xE3))) { ! result = TRUE; ! if (testinx(CRTC_IDX, 0x21)) { ! /* 62x5 */ ! tmp = rdinx(CRTC_IDX, 0x27); ! switch ((tmp & 0xF0) >> 4) { ! case 0x00: ! *Chipset = CHIP_CL6205; break; ! case 0x08: ! *Chipset = CHIP_CL6215; ! break; ! case 0x0C: ! *Chipset = CHIP_CL6225; break; ! case 0x01: ! *Chipset = CHIP_CL6235; break; default: ! Chip_data = tmp; *Chipset = CHIP_CL_UNKNOWN; break; } } ! else { ! /* 542x */ ! tmp = rdinx(CRTC_IDX, 0x27); ! switch ((tmp & 0xFC) >> 2) { ! case 0x22: ! switch (tmp & 0x03) { case 0x00: ! *Chipset = CHIP_CL5402; break; case 0x01: ! *Chipset = CHIP_CL5402R1; break; case 0x02: ! *Chipset = CHIP_CL5420; break; case 0x03: ! *Chipset = CHIP_CL5420R1; break; } break; ! case 0x23: ! *Chipset = CHIP_CL5422; break; ! case 0x25: ! *Chipset = CHIP_CL5424; break; ! case 0x24: ! *Chipset = CHIP_CL5426; break; ! case 0x26: ! *Chipset = CHIP_CL5428; break; default: ! Chip_data = tmp; *Chipset = CHIP_CL_UNKNOWN; break; } } } ! wrinx(0x3C4, 0x06, old); } ! if (!result) { ! old = rdinx(0x3CE, 0x0A); ! wrinx(0x3CE, 0x0A, 0xEC); ! if (rdinx(0x3CE, 0x0A) == 0x01) { ! result = TRUE; ! if (rdinx(0x3CE, 0xAB) == 0x6F) ! { ! /* 6420 */ ! if (testinx2(0x3CE, 0x87, 0x90)) ! { ! *Chipset = CHIP_CL6420B; ! } ! else ! { ! *Chipset = CHIP_CL6420A; ! } ! } ! else ! { ! *Chipset = CHIP_CL6410; /* I think */ ! } } ! wrinx(0x3CE, 0x0A, old); } DisableIOPorts(NUMPORTS, Ports); ! return(result); } --- 35,376 ---- NUMPORTS, FALSE, FALSE, ! TRUE, ! NULL, }; + static int MemProbe_Cirrus54 __STDCARGS((int)); + + Chip_Descriptor Cirrus54_Descriptor = { + "Cirrus54", + Probe_Cirrus54, + Ports, + NUMPORTS, + FALSE, + FALSE, + TRUE, + MemProbe_Cirrus54, + }; + + static int MemProbe_Cirrus64 __STDCARGS((int)); + + Chip_Descriptor Cirrus64_Descriptor = { + "Cirrus64", + Probe_Cirrus64, + Ports, + NUMPORTS, + FALSE, + FALSE, + TRUE, + MemProbe_Cirrus64, + }; + + #define CLASS_OLD 0 + #define CLASS_54XX 1 + #define CLASS_64XX 2 + #ifdef __STDC__ ! static Bool Probe_Cirrus_Class(int *, int); #else + static Bool Probe_Cirrus_Class(); + #endif + Bool Probe_Cirrus(Chipset) int *Chipset; ! { ! return(Probe_Cirrus_Class(Chipset, CLASS_OLD)); ! } ! ! Bool Probe_Cirrus54(Chipset) ! int *Chipset; ! { ! return(Probe_Cirrus_Class(Chipset, CLASS_54XX)); ! } ! ! Bool Probe_Cirrus64(Chipset) ! int *Chipset; ! { ! return(Probe_Cirrus_Class(Chipset, CLASS_64XX)); ! } ! ! static Bool Probe_Cirrus_Class(Chipset, Class) ! int *Chipset; ! int Class; { Bool result = FALSE; ! Byte old, old1, Ver; /* Add CRTC to enabled ports */ Ports[0] = CRTC_IDX; Ports[1] = CRTC_REG; EnableIOPorts(NUMPORTS, Ports); ! ! if (Class == CLASS_OLD) { ! old = rdinx(CRTC_IDX, 0x0C); ! old1 = rdinx(SEQ_IDX, 0x06); ! wrinx(CRTC_IDX,0x0C,0); ! Ver = rdinx(CRTC_IDX, 0x1F); ! wrinx(SEQ_IDX, 0x06, (Ver >> 4) | (Ver << 4)); ! if (inp(SEQ_REG) == 0) { ! outp(SEQ_REG, Ver); ! if (inp(SEQ_REG) == 1) { ! result = TRUE; ! switch (Ver) { ! case 0xEC: ! *Chipset = CHIP_CL510; break; ! case 0xCA: ! *Chipset = CHIP_CL610; break; ! case 0xEA: ! *Chipset = CHIP_CLV7; break; default: ! Chip_data = Ver; *Chipset = CHIP_CL_UNKNOWN; break; } } ! } ! wrinx(SEQ_IDX, 0x06, old1); ! wrinx(CRTC_IDX, 0x0C, old); ! } ! else if (Class == CLASS_54XX) ! { ! /* ! * Cirrus 542x, 543x, 62x5 chips ! */ ! old = rdinx(SEQ_IDX, 0x06); ! wrinx(SEQ_IDX, 0x06, 0x00); ! if (rdinx(SEQ_IDX, 0x06) == 0x0F) ! { ! wrinx(SEQ_IDX, 0x06, 0x12); ! if ((rdinx(SEQ_IDX, 0x06) == 0x12) && ! (testinx2(SEQ_IDX, 0x1E, 0x3F))) { ! result = TRUE; ! Ver = rdinx(CRTC_IDX, 0x27); ! if (testinx(CRTC_IDX, 0x09)) ! { ! /* 542x */ ! switch ((Ver & 0xFC) >> 2) ! { ! case 0x02: ! *Chipset = CHIP_CLAVGA2; ! break; ! case 0x22: ! switch (Ver & 0x03) ! { ! case 0x00: ! *Chipset=CHIP_CL5402; ! break; ! case 0x01: ! *Chipset=CHIP_CL5402R1; ! break; ! case 0x02: ! *Chipset=CHIP_CL5420; ! break; ! case 0x03: ! *Chipset=CHIP_CL5420R1; ! break; ! } ! break; ! case 0x23: ! *Chipset = CHIP_CL5422; ! break; ! case 0x25: ! *Chipset = CHIP_CL5424; ! break; ! case 0x24: ! *Chipset = CHIP_CL5426; ! break; ! case 0x26: ! *Chipset = CHIP_CL5428; ! break; ! case 0x29: ! *Chipset = CHIP_CL543X; ! break; ! default: ! Chip_data = Ver; ! *Chipset = CHIP_CL_UNKNOWN; ! break; ! } ! } ! else if (testinx(SEQ_IDX, 0x19)) { ! /* 62x5 */ ! switch ((Ver & 0xC0) >> 6) { case 0x00: ! *Chipset = CHIP_CL6205; break; case 0x01: ! *Chipset = CHIP_CL6235; break; case 0x02: ! *Chipset = CHIP_CL6215; break; case 0x03: ! *Chipset = CHIP_CL6225; break; } + } + else + { + *Chipset = CHIP_CLAVGA2; + } + } + } + wrinx(SEQ_IDX, 0x06, old); + } + else + { + /* + * The Cirrus 64xx chips. + */ + old = rdinx(GRC_IDX, 0x0A); + wrinx(GRC_IDX, 0x0A, 0xCE); + if (rdinx(GRC_IDX, 0x0A) == 0x00) + { + wrinx(GRC_IDX, 0x0A, 0xEC); + if (rdinx(GRC_IDX, 0x0A) == 0x01) + { + result = TRUE; + Ver = rdinx(GRC_IDX, 0xAA); + switch ((Ver & 0xF0) >> 4) + { + case 0x04: + *Chipset = CHIP_CL6440; break; ! case 0x05: ! *Chipset = CHIP_CL6412; break; ! case 0x06: ! *Chipset = CHIP_CL5410; break; ! case 0x07: ! if (testinx2(0x3CE, 0x87, 0x90)) ! { ! *Chipset = CHIP_CL6420B; ! } ! else ! { ! *Chipset = CHIP_CL6420A; ! } break; ! case 0x08: ! *Chipset = CHIP_CL6410; break; default: ! Chip_data = Ver; *Chipset = CHIP_CL_UNKNOWN; break; } } } ! wrinx(GRC_IDX, 0x0A, old); } ! ! DisableIOPorts(NUMPORTS, Ports); ! return(result); ! } ! ! static int MemProbe_Cirrus54(Chipset) ! int Chipset; ! { ! Byte old; ! int Mem = 0; ! ! EnableIOPorts(NUMPORTS, Ports); ! ! /* ! * Unlock ! */ ! old = rdinx(SEQ_IDX, 0x06); ! wrinx(SEQ_IDX, 0x06, 0x12); ! ! /* ! * Check ! */ ! switch (Chipset) { ! case CHIP_CL6205: ! case CHIP_CL6215: ! case CHIP_CL6225: ! case CHIP_CL6235: ! Mem = 512; ! break; ! default: ! switch ((rdinx(SEQ_IDX, 0x0A) & 0x18) >> 3) { ! case 0x00: ! Mem = 256; ! break; ! case 0x01: ! Mem = 512; ! break; ! case 0x02: ! Mem = 1024; ! break; ! case 0x03: ! Mem = 2048; ! break; } ! break; } + + /* + * Lock + */ + wrinx(SEQ_IDX, 0x06, old); + DisableIOPorts(NUMPORTS, Ports); ! return(Mem); ! } ! ! /* ARGSUSED */ ! static int MemProbe_Cirrus64(Chipset) ! int Chipset; ! { ! Byte old; ! int Mem = 0; ! ! EnableIOPorts(NUMPORTS, Ports); ! ! /* ! * Unlock ! */ ! old = rdinx(GRC_IDX, 0x0A); ! wrinx(GRC_IDX, 0x0A, 0xEC); ! ! /* ! * Check ! */ ! switch (rdinx(GRC_IDX, 0xBB) >> 6) ! { ! case 0x00: ! Mem = 256; ! break; ! case 0x01: ! Mem = 512; ! break; ! case 0x02: ! Mem = 768; ! break; ! case 0x03: ! Mem = 1024; ! break; ! } ! ! /* ! * Lock ! */ ! wrinx(GRC_IDX, 0x0A, old); ! ! DisableIOPorts(NUMPORTS, Ports); ! return(Mem); } diff -c mit/server/ddx/x386/SuperProbe/Compaq.c:2.3 mit/server/ddx/x386/SuperProbe/Compaq.c:2.6 *** mit/server/ddx/x386/SuperProbe/Compaq.c:2.3 Fri Mar 11 23:36:08 1994 --- mit/server/ddx/x386/SuperProbe/Compaq.c Fri Mar 11 23:36:08 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,136 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Compaq.c,v 2.3 1993/09/27 12:23:17 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x3CE, 0x3CF, 0x33C8, 0x53C8}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor Compaq_Descriptor = { "Compaq", Probe_Compaq, Ports, NUMPORTS, ! TRUE, ! TRUE, ! FALSE }; - #ifdef __STDC__ - Bool Probe_Compaq(int *Chipset) - #else Bool Probe_Compaq(Chipset) int *Chipset; - #endif { Bool result = FALSE; ! Byte addr, bios[6]; ! Byte *signature = (Byte *)"COMPAQ"; ! Byte old, old1, old2, old3; ! Byte tmp, tmp1; ! Word port; EnableIOPorts(NUMPORTS, Ports); ! if (ReadBIOS(0x02, &addr, 1) != 1) ! { ! fprintf(stderr, "%s: Failed to find get Compaq BIOS address\n", ! MyName); ! return(FALSE); ! } ! if (addr > 64) ! { ! /* Out of range */ ! return(FALSE); ! } ! if (ReadBIOS((unsigned)((addr<<9)-0x16), bios, 6) != 6) ! { ! fprintf(stderr, "%s: Failed to read Compaq BIOS signature\n", ! MyName); ! return(FALSE); ! } ! if (memcmp(bios, signature, 6) == 0) { ! old = rdinx(0x3CE, 0x00); ! old1 = rdinx(0x3CE, 0x03); ! old2 = rdinx(0x3CE, 0x0F); ! wrinx(0x3CE, 0x0F, 0x05); ! old3 = rdinx(0x3CE, 0x10); ! tmp = old3 & 0x0F; ! wrinx(0x3CE, 0x00, ~old); ! tmp1 = rdinx(0x3CE, 0x10) & 0x0F; ! if ((tmp != old) || (tmp1 != ~old)) { ! wrinx(0x3CE, 0x10, old3 | 0x08); ! port = (old3 & 0x04) ? 0x53C8 : 0x33C8; ! tmp = inp(port); ! wrinx(0x3CE, 0x03, (~old1 & 0x07)); ! tmp1 = inp(port); ! if (tmp == (old1 & 0x07) && (tmp1 == (~old1 & 0x07))) { ! /* ! * OK. It's an AVGA or QVision. Let's ! * see which one. ! */ ! result = TRUE; ! tmp = rdinx(0x3CE, 0x0C); ! tmp1 = (tmp & 0xF8) >> 3; ! switch (tmp1) { - case 0x05: - case 0x10: - *Chipset = CHIP_CPQ_AVGA; - break; - case 0x06: *Chipset = CHIP_CPQ_Q1024; - break; - case 0x0E: - /* - * QVision. Now see which one. - */ - tmp = rdinx(0x3CE, 0x56); - if (tmp & 0x04) - { - *Chipset = CHIP_CPQ_Q1280; - } - else - { - *Chipset = CHIP_CPQ_Q1024; - } - break; - default: - Chip_data = tmp1; - *Chipset = CHIP_CPQ_UNK; - break; } } } - wrinx(0x3CE, 0x10, old3); - wrinx(0x3CE, 0x0F, old2); - wrinx(0x3CE, 0x03, old1); - wrinx(0x3CE, 0x00, old); } DisableIOPorts(NUMPORTS, Ports); return(result); } --- 21,152 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Compaq.c,v 2.6 1994/03/02 08:04:55 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {GRC_IDX, GRC_REG}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_Compaq __STDCARGS((int)); + Chip_Descriptor Compaq_Descriptor = { "Compaq", Probe_Compaq, Ports, NUMPORTS, ! FALSE, ! FALSE, ! FALSE, ! MemProbe_Compaq, }; Bool Probe_Compaq(Chipset) int *Chipset; { Bool result = FALSE; ! Byte old, ver; EnableIOPorts(NUMPORTS, Ports); ! ! old = rdinx(GRC_IDX, 0x0F); ! wrinx(GRC_IDX, 0x0F, 0x00); ! if (!testinx(GRC_IDX, 0x45)) { ! wrinx(GRC_IDX, 0x0F, 0x05); ! if (testinx(GRC_IDX, 0x45)) { ! result = TRUE; ! ver = rdinx(GRC_IDX, 0x0C) >> 3; ! switch (ver) { ! case 0x03: ! *Chipset = CHIP_CPQ_IVGS; ! break; ! case 0x05: ! *Chipset = CHIP_CPQ_AVGA; ! break; ! case 0x06: ! *Chipset = CHIP_CPQ_Q1024; ! break; ! case 0x0E: ! if (rdinx(GRC_IDX, 0x56) & 0x04) ! { ! *Chipset = CHIP_CPQ_Q1280; ! } ! else { *Chipset = CHIP_CPQ_Q1024; } + break; + case 0x10: + *Chipset = CHIP_CPQ_AVGA_P; + break; + default: + Chip_data = ver >> 3; + *Chipset = CHIP_CPQ_UNK; + break; } } } DisableIOPorts(NUMPORTS, Ports); return(result); + } + + static int MemProbe_Compaq(Chipset) + int Chipset; + { + Byte old, temp; + int Mem = 0; + + EnableIOPorts(NUMPORTS, Ports); + + /* + * Unlock. + */ + old = rdinx(GRC_IDX, 0x0F); + wrinx(GRC_IDX, 0x0F, 0x05); + + /* + * Check + */ + switch (Chipset) + { + case CHIP_CPQ_IVGS: + Mem = 256; + break; + case CHIP_CPQ_AVGA: + case CHIP_CPQ_AVGA_P: + Mem = 512; + break; + case CHIP_CPQ_Q1024: + case CHIP_CPQ_Q1280: + temp = rdinx(GRC_IDX, 0x0F); + wrinx(GRC_IDX, 0x0F, 0x05); + switch (rdinx(GRC_IDX, 0x54)) + { + case 0x00: + Mem = 1024; + break; + case 0x02: + Mem = 512; + break; + case 0x04: + Mem = 1024; + break; + case 0x08: + Mem = 2048; + break; + } + wrinx(GRC_IDX, 0x0F, temp); + break; + } + + /* + * Lock + */ + wrinx(GRC_IDX, 0x0F, 0x05); + + DisableIOPorts(NUMPORTS, Ports); + return(Mem); } diff -c mit/server/ddx/x386/SuperProbe/Genoa.c:2.1 mit/server/ddx/x386/SuperProbe/Genoa.c:2.3 *** mit/server/ddx/x386/SuperProbe/Genoa.c:2.1 Fri Mar 11 23:36:09 1994 --- mit/server/ddx/x386/SuperProbe/Genoa.c Fri Mar 11 23:36:09 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,30 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Genoa.c,v 2.1 1993/09/21 15:20:33 dawes Exp $ */ #include "Probe.h" Chip_Descriptor Genoa_Descriptor = { "Genoa", Probe_Genoa, --- 21,32 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Genoa.c,v 2.3 1994/02/28 14:09:23 dawes Exp $ */ #include "Probe.h" + static int MemProbe_Genoa __STDCARGS((int)); + Chip_Descriptor Genoa_Descriptor = { "Genoa", Probe_Genoa, *************** *** 32,46 **** 0, FALSE, TRUE, ! TRUE }; - #ifdef __STDC__ - Bool Probe_Genoa(int *Chipset) - #else Bool Probe_Genoa(Chipset) int *Chipset; - #endif { Bool result = FALSE; Byte addr, data[4]; --- 34,45 ---- 0, FALSE, TRUE, ! TRUE, ! MemProbe_Genoa, }; Bool Probe_Genoa(Chipset) int *Chipset; { Bool result = FALSE; Byte addr, data[4]; *************** *** 82,85 **** --- 81,103 ---- } } return(result); + } + + static int MemProbe_Genoa(Chipset) + int Chipset; + { + int Mem = 0; + + switch (Chipset) + { + case CHIP_G_6100: + case CHIP_G_6200: + Mem = 256; + break; + case CHIP_G_6400: + Mem = 512; + break; + } + + return(Mem); } diff -c /dev/null mit/server/ddx/x386/SuperProbe/HMC.c:2.0 *** /dev/null Fri Mar 11 23:36:09 1994 --- mit/server/ddx/x386/SuperProbe/HMC.c Fri Mar 11 23:36:09 1994 *************** *** 0 **** --- 1,80 ---- + /* + * Copyright 1994 by David Wexelblat + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, 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 David Wexelblat not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. David Wexelblat makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + */ + + /* $XFree86: mit/server/ddx/x386/SuperProbe/HMC.c,v 2.0 1994/02/28 14:09:25 dawes Exp $ */ + + #include "Probe.h" + + static Word Ports[] = {SEQ_IDX, SEQ_REG}; + #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + + static int MemProbe_HMC __STDCARGS((int)); + + Chip_Descriptor HMC_Descriptor = { + "HMC", + Probe_HMC, + Ports, + NUMPORTS, + FALSE, + FALSE, + TRUE, + MemProbe_HMC, + }; + + Bool Probe_HMC(Chipset) + int *Chipset; + { + Bool result = FALSE; + + EnableIOPorts(NUMPORTS, Ports); + + if (testinx(SEQ_IDX, 0xE7) && testinx(SEQ_IDX, 0xEE)) + { + result = TRUE; + *Chipset = CHIP_HM86304; + } + + DisableIOPorts(NUMPORTS, Ports); + return(result); + } + + /* ARGSUSED */ + static int MemProbe_HMC(Chipset) + int Chipset; + { + int Mem = 0; + + EnableIOPorts(NUMPORTS, Ports); + + if (rdinx(SEQ_IDX, 0xE7) & 0x10) + { + Mem = 512; + } + else + { + Mem = 256; + } + + DisableIOPorts(NUMPORTS, Ports); + return(Mem); + } diff -c mit/server/ddx/x386/SuperProbe/Herc.c:1.2 mit/server/ddx/x386/SuperProbe/Herc.c:2.0 *** mit/server/ddx/x386/SuperProbe/Herc.c:1.2 Fri Mar 11 23:36:10 1994 --- mit/server/ddx/x386/SuperProbe/Herc.c Fri Mar 11 23:36:10 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Herc.c,v 1.2 1993/05/04 10:16:55 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Herc.c,v 2.0 1994/02/28 14:09:26 dawes Exp $ */ #include "Probe.h" *************** *** 31,42 **** #define DSP_VSYNC_MASK 0x80 #define DSP_ID_MASK 0x70 - #ifdef __STDC__ - Bool Probe_Herc(int *Chipset) - #else Bool Probe_Herc(Chipset) int *Chipset; - #endif { Bool result = FALSE; int i, cnt = 0; --- 31,38 ---- diff -c mit/server/ddx/x386/SuperProbe/Imakefile:2.0 mit/server/ddx/x386/SuperProbe/Imakefile:2.4 *** mit/server/ddx/x386/SuperProbe/Imakefile:2.0 Fri Mar 11 23:36:10 1994 --- mit/server/ddx/x386/SuperProbe/Imakefile Fri Mar 11 23:36:10 1994 *************** *** 1,8 **** ! XCOMM $XFree86: mit/server/ddx/x386/SuperProbe/Imakefile,v 2.0 1993/07/25 05:49:03 dawes Exp $ #if defined(i386SVR3Architecture) || defined(i386SVR4Architecture) # define OSModule OS_SYSV #endif #if defined(LinuxArchitecture) # define OSModule OS_Linux #endif --- 1,13 ---- ! XCOMM $XFree86: mit/server/ddx/x386/SuperProbe/Imakefile,v 2.4 1994/02/28 14:09:27 dawes Exp $ #if defined(i386SVR3Architecture) || defined(i386SVR4Architecture) # define OSModule OS_SYSV #endif + #if defined(i386SVR4Solarisx86) && !HasGcc + # include + OS_IO_SRC = SolX86IO.s + OS_IO_OBJ = SolX86IO.o + #endif #if defined(LinuxArchitecture) # define OSModule OS_Linux #endif *************** *** 22,37 **** # define OSModule OS_Mach #endif ! OS_SRC = OSModule.c ! OS_OBJ = OSModule.o ! BASE_SRC = MDA.c Herc.c CGA.c VGA.c RamDac.c ! BASE_OBJ = MDA.o Herc.o CGA.o VGA.o RamDac.o SVGA_SRC = Tseng.c WD.c ChipsTech.c Video7.c Genoa.c Trident.c Oak.c \ ! Cirrus.c Ahead.c ATI.c S3.c AL.c Yamaha.c NCR.c AcuMos.c MX.c \ ! RealTek.c Primus.c Compaq.c SVGA_OBJ = Tseng.o WD.o ChipsTech.o Video7.o Genoa.o Trident.o Oak.o \ ! Cirrus.o Ahead.o ATI.o S3.o AL.o Yamaha.o NCR.o AcuMos.o MX.o \ ! RealTek.o Primus.o Compaq.o COPROC_SRC = 8514.c ATIMach.c COPROC_OBJ = 8514.o ATIMach.o SRCS = Main.c $(SVGA_SRC) $(COPROC_SRC) $(BASE_SRC) Print.c Utils.c $(OS_SRC) --- 27,42 ---- # define OSModule OS_Mach #endif ! OS_SRC = OSModule.c $(OS_IO_SRC) ! OS_OBJ = OSModule.o $(OS_IO_OBJ) ! BASE_SRC = MDA.c Herc.c CGA.c VGA.c RamDac.c MemProbe.c ! BASE_OBJ = MDA.o Herc.o CGA.o VGA.o RamDac.o MemProbe.o SVGA_SRC = Tseng.c WD.c ChipsTech.c Video7.c Genoa.c Trident.c Oak.c \ ! Cirrus.c Ahead.c ATI.c S3.c AL.c Yamaha.c NCR.c MX.c \ ! RealTek.c Primus.c Compaq.c HMC.c UMC.c Weitek.c SVGA_OBJ = Tseng.o WD.o ChipsTech.o Video7.o Genoa.o Trident.o Oak.o \ ! Cirrus.o Ahead.o ATI.o S3.o AL.o Yamaha.o NCR.o MX.o \ ! RealTek.o Primus.o Compaq.o HMC.o UMC.o Weitek.o COPROC_SRC = 8514.c ATIMach.c COPROC_OBJ = 8514.o ATIMach.o SRCS = Main.c $(SVGA_SRC) $(COPROC_SRC) $(BASE_SRC) Print.c Utils.c $(OS_SRC) diff -c mit/server/ddx/x386/SuperProbe/MDA.c:1.2 mit/server/ddx/x386/SuperProbe/MDA.c:2.0 *** mit/server/ddx/x386/SuperProbe/MDA.c:1.2 Fri Mar 11 23:36:11 1994 --- mit/server/ddx/x386/SuperProbe/MDA.c Fri Mar 11 23:36:11 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/MDA.c,v 1.2 1993/05/04 10:16:57 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/MDA.c,v 2.0 1994/02/28 14:09:28 dawes Exp $ */ #include "Probe.h" *************** *** 33,44 **** static Word Ports[] = {0x3B4, 0x3B5}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) - #ifdef __STDC__ - Bool Probe_MDA(int *Chipset) - #else Bool Probe_MDA(Chipset) int *Chipset; - #endif { Bool result = FALSE; Byte tmp; --- 33,40 ---- diff -c mit/server/ddx/x386/SuperProbe/MX.c:2.1 mit/server/ddx/x386/SuperProbe/MX.c:2.4 *** mit/server/ddx/x386/SuperProbe/MX.c:2.1 Fri Mar 11 23:36:11 1994 --- mit/server/ddx/x386/SuperProbe/MX.c Fri Mar 11 23:36:11 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,33 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/MX.c,v 2.1 1993/09/21 15:20:34 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x3C4, 0x3C5}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor MX_Descriptor = { "MX", Probe_MX, --- 21,35 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/MX.c,v 2.4 1994/03/02 08:04:56 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {SEQ_REG, SEQ_IDX}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_MX __STDCARGS((int)); + Chip_Descriptor MX_Descriptor = { "MX", Probe_MX, *************** *** 35,66 **** NUMPORTS, FALSE, FALSE, ! TRUE }; - #ifdef __STDC__ - Bool Probe_MX(int *Chipset) - #else Bool Probe_MX(Chipset) int *Chipset; - #endif { Bool result = FALSE; Byte old; EnableIOPorts(NUMPORTS, Ports); ! old = rdinx(0x3C4, 0xA7); ! wrinx(0x3C4, 0xA7, 0x00); ! if (!testinx(0x3C4, 0xC5)) { ! wrinx(0x3C4, 0xA7, 0x87); ! if (testinx(0x3C4, 0xC5)) { result = TRUE; ! *Chipset = CHIP_MX68010; } } ! wrinx(0x3C4, 0xA7, old); DisableIOPorts(NUMPORTS, Ports); return(result); } --- 37,114 ---- NUMPORTS, FALSE, FALSE, ! TRUE, ! MemProbe_MX, }; Bool Probe_MX(Chipset) int *Chipset; { Bool result = FALSE; Byte old; EnableIOPorts(NUMPORTS, Ports); ! ! old = rdinx(SEQ_IDX, 0xA7); ! wrinx(SEQ_IDX, 0xA7, 0x00); ! if (!testinx(SEQ_IDX, 0xC5)) { ! wrinx(SEQ_IDX, 0xA7, 0x87); ! if (testinx(SEQ_IDX, 0xC5)) { result = TRUE; ! if ((rdinx(SEQ_IDX, 0x26) & 0x01) == 0) ! { ! *Chipset = CHIP_MX68010; ! } ! else ! { ! *Chipset = CHIP_MX68000; ! } } } ! wrinx(SEQ_IDX, 0xA7, old); ! DisableIOPorts(NUMPORTS, Ports); return(result); + } + + /* ARGSUSED */ + static int MemProbe_MX(Chipset) + int Chipset; + { + Byte old; + int Mem = 0; + + EnableIOPorts(NUMPORTS, Ports); + + /* + * Unlock + */ + old = rdinx(SEQ_IDX, 0xA7); + wrinx(SEQ_IDX, 0xA7, 0x87); + + /* + * Check + */ + switch ((rdinx(SEQ_IDX, 0xC2) >> 2) & 0x03) + { + case 0x00: + Mem = 256; + break; + case 0x01: + Mem = 512; + break; + case 0x02: + Mem = 1024; + break; + } + + /* + * Lock + */ + wrinx(SEQ_IDX, 0xA7, old); + + DisableIOPorts(NUMPORTS, Ports); + return(Mem); } diff -c mit/server/ddx/x386/SuperProbe/Main.c:2.4 mit/server/ddx/x386/SuperProbe/Main.c:2.7 *** mit/server/ddx/x386/SuperProbe/Main.c:2.4 Fri Mar 11 23:36:12 1994 --- mit/server/ddx/x386/SuperProbe/Main.c Fri Mar 11 23:36:12 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Main.c,v 2.4 1993/10/07 13:54:46 dawes Exp $ */ #include "Probe.h" #include "PatchLevel.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Main.c,v 2.7 1994/03/05 01:58:46 dawes Exp $ */ #include "Probe.h" #include "PatchLevel.h" *************** *** 44,68 **** static Chip_Descriptor *SVGA_Descriptors[] = { &WD_Descriptor, &Video7_Descriptor, &Genoa_Descriptor, &Trident_Descriptor, &ATI_Descriptor, &Ahead_Descriptor, &NCR_Descriptor, &S3_Descriptor, ! &Cirrus_Descriptor, ! &MX_Descriptor, ! &AcuMos_Descriptor, &Tseng_Descriptor, &RealTek_Descriptor, &Primus_Descriptor, &Yamaha_Descriptor, &Oak_Descriptor, &Compaq_Descriptor, &CT_Descriptor, /* I think this is screwing people up, so put it last */ - #if 0 - &AL_Descriptor, /* I think this is dangerous, & no one has heard of it */ - #endif NULL }; --- 44,70 ---- static Chip_Descriptor *SVGA_Descriptors[] = { &WD_Descriptor, &Video7_Descriptor, + &MX_Descriptor, &Genoa_Descriptor, + &UMC_Descriptor, &Trident_Descriptor, &ATI_Descriptor, &Ahead_Descriptor, &NCR_Descriptor, &S3_Descriptor, ! &AL_Descriptor, ! &Cirrus54_Descriptor, ! &Cirrus64_Descriptor, ! &Weitek_Descriptor, &Tseng_Descriptor, &RealTek_Descriptor, &Primus_Descriptor, &Yamaha_Descriptor, &Oak_Descriptor, + &Cirrus_Descriptor, &Compaq_Descriptor, + &HMC_Descriptor, &CT_Descriptor, /* I think this is screwing people up, so put it last */ NULL }; *************** *** 72,77 **** --- 74,85 ---- NULL }; + static int num_tokens __STDCARGS((char *, char)); + static void ParseExclusionList __STDCARGS((Range *, char *)); + static Bool TestChip __STDCARGS((Chip_Descriptor *, int *)); + static void PrintInfo __STDCARGS((void)); + static Byte *FindBios __STDCARGS((void)); + #ifdef __STDC__ static int num_tokens(char *list, char delim) #else *************** *** 91,103 **** return(cnt); } - #ifdef __STDC__ - static void ParseExclusionList(Range *excl_list, char *list) - #else static void ParseExclusionList(excl_list, list) Range *excl_list; char *list; - #endif { char *p = list, *p1, c; Bool done = FALSE, lo = TRUE; --- 99,107 ---- *************** *** 170,182 **** excl_list[i].lo = (Word)-1; } - #ifdef __STDC__ - static Bool TestChip(Chip_Descriptor *chip_p, int *Chipset) - #else static Bool TestChip(chip_p, Chipset) Chip_Descriptor *chip_p; int *Chipset; - #endif { char *p, *p1, name[64]; --- 174,182 ---- *************** *** 247,257 **** return(FALSE); } - #ifdef __STDC__ - static void PrintInfo(void) - #else static void PrintInfo() - #endif { Chip_Descriptor *chip_p; int i, len; --- 247,253 ---- *************** *** 291,303 **** printf("%s, ", chip_p->name); } putchar('\n'); } - #ifdef __STDC__ - static Byte *FindBios(void) - #else static Byte *FindBios() - #endif { int i, score[7]; Byte buf[3]; --- 287,309 ---- printf("%s, ", chip_p->name); } putchar('\n'); + printf("%s can detect the following RAMDACs:\n", MyName); + len = 0; + putchar('\t'); + for (i=0; i < DAC_MAX; i++) + { + len += strlen(RamDac_Names[i+1].Short) + 2; + if (len > 70) + { + printf("\n\t"); + len = strlen(RamDac_Names[i+1].Short) + 2; + } + printf("%s, ", RamDac_Names[i+1].Short); + } + putchar('\n'); } static Byte *FindBios() { int i, score[7]; Byte buf[3]; *************** *** 329,341 **** return(base); } - #ifdef __STDC__ - int main(int argc, char *argv[]) - #else int main(argc, argv) int argc; char *argv[]; - #endif { char *p, *order = NULL; Byte copyright[3]; --- 335,343 ---- *************** *** 344,351 **** --- 346,359 ---- int Secondary = -1; int RamDac = -1; int CoProc = -1; + int MemVGA = -1; + int MemCoProc = -1; int i, cnt; Chip_Descriptor *chip_p, *matched; + Bool Probe_DAC = TRUE; + Bool Probe_Mem = TRUE; + Bool NoEGA = FALSE; + Bool Check_CoProc; Bool flag; p = strrchr(argv[0], '/'); *************** *** 444,449 **** --- 452,465 ---- { NoBIOS = TRUE; } + else if (strncmp(argv[i], "-no_dac", 7) == 0) + { + Probe_DAC = FALSE; + } + else if (strncmp(argv[i], "-no_mem", 7) == 0) + { + Probe_Mem = FALSE; + } else if (strncmp(argv[i], "-in", 3) == 0) { PrintInfo(); *************** *** 464,469 **** --- 480,487 ---- printf("\t-noprobe list\tDon't probe for any chipsets specified\n"); printf("\t-bios base\tSet BIOS base address to 'base'\n"); printf("\t-no_bios\tDon't read BIOS & assume EGA/VGA as primary\n"); + printf("\t-no_dac\t\tDon't probe for RAMDAC type\n"); + printf("\t-no_mem\t\tDon't probe for video memory\n"); printf("\t-info\t\tPrint a list of the capabilities of %s\n", MyName); printf("\nRefer to the manual page '%s.1' for complete details\n", *************** *** 478,510 **** } PRINT_VERSION; ! printf("\tCopyright 1993 by David Wexelblat \n"); ! printf("\n\tThis work is derived from the 'vgadoc2.zip' documentation\n"); ! printf("\tpackage produced by Finn Thoergersen, and released with\n"); ! printf("\tall appropriate permissions having been obtained. Additional\n"); ! printf("\tinformation obtained from 'Programmer's Guide to the EGA and\n"); ! printf("\tVGA, 2nd ed', by Richard Ferraro, and from manufacturer's\n"); ! printf("\tdata books\n\n"); printf("The author welcomes bug reports and other comments mailed to\n"); printf("the electronic mail address above. In particular, reports of\n"); printf("chipsets that this program fails to correctly detect are\n"); ! printf("appreciated\n\n"); { FILE *f; f = fopen("/dev/tty", "w"); ! putc('\007', f); ! putc('\007', f); ! putc('\007', f); ! fprintf(f, "WARNING - THIS SOFTWARE COULD HANG YOUR MACHINE.\n"); ! fprintf(f, " READ THE SUPERPROBE.1 MANUAL PAGE BEFORE RUNNING.\n"); ! fprintf(f, " INTERRUPT WITHIN FIVE SECONDS TO ABORT!\n\n"); ! putc('\007', f); ! putc('\007', f); ! putc('\007', f); ! fflush(f); ! sleep(5); } if (OpenVideo() < 0) --- 496,532 ---- } PRINT_VERSION; ! printf("\tCopyright 1993,1994 by David Wexelblat \n"); ! printf("\n\tThis work is derived from the 'vgadoc2.zip' and\n"); ! printf("\t'vgadoc3.zip' documentation packages produced by Finn\n"); ! printf("\tThoergersen, and released with all appropriate permissions\n"); ! printf("\thaving been obtained. Additional information obtained from\n"); ! printf("\t'Programmer's Guide to the EGA and VGA, 2nd ed', by Richard\n"); ! printf("\tFerraro, and from manufacturer's data books\n\n"); printf("The author welcomes bug reports and other comments mailed to\n"); printf("the electronic mail address above. In particular, reports of\n"); printf("chipsets that this program fails to correctly detect are\n"); ! printf("appreciated.\n\n"); { FILE *f; f = fopen("/dev/tty", "w"); ! if (f != (FILE *)NULL) ! { ! putc('\007', f); ! putc('\007', f); ! putc('\007', f); ! fprintf(f, "WARNING - THIS SOFTWARE COULD HANG YOUR MACHINE.\n"); ! fprintf(f, " READ THE SuperProbe.1 MANUAL PAGE BEFORE\n"); ! fprintf(f, " RUNNING THIS PROGRAM.\n\n"); ! fprintf(f, " INTERRUPT WITHIN FIVE SECONDS TO ABORT!\n\n"); ! putc('\007', f); ! putc('\007', f); ! putc('\007', f); ! fflush(f); ! sleep(5); ! } } if (OpenVideo() < 0) *************** *** 520,528 **** Bios_Base = FindBios(); if (Bios_Base == (Byte *)0) { ! fprintf(stderr, "%s: Could not determine BIOS base address\n", ! MyName); ! return(-1); } } } --- 542,554 ---- Bios_Base = FindBios(); if (Bios_Base == (Byte *)0) { ! if (Verbose) ! { ! printf("%s: Could not determine BIOS base address; %s", ! MyName, " assuming no EGA/VGA present\n"); ! fflush(stdout); ! } ! NoEGA = TRUE; } } } *************** *** 534,545 **** } else { ! printf("BIOS Base address = 0x%x\n\n", (int)Bios_Base); } fflush(stdout); } ! if (!NoBIOS) { /* * Look for 'IBM' at Bios_Base+0x1E of the BIOS. It will be there for --- 560,571 ---- } else { ! printf("BIOS Base address = 0x%X\n\n", (int)Bios_Base); } fflush(stdout); } ! if ((!NoBIOS) && (!NoEGA)) { /* * Look for 'IBM' at Bios_Base+0x1E of the BIOS. It will be there for *************** *** 548,560 **** if (ReadBIOS(COPYRIGHT_BASE, copyright, 3) < 0) { fprintf(stderr, "%s: Failed to read BIOS\n", MyName); return(1); } } ! if ((NoBIOS) || ! ((copyright[0] == 'I') && ! (copyright[1] == 'B') && ! (copyright[2] == 'M'))) { /* * It's an EGA or VGA --- 574,588 ---- if (ReadBIOS(COPYRIGHT_BASE, copyright, 3) < 0) { fprintf(stderr, "%s: Failed to read BIOS\n", MyName); + CloseVideo(); return(1); } } ! if ((!NoEGA) && ! ((NoBIOS) || ! ((copyright[0] == 'I') && ! (copyright[1] == 'B') && ! (copyright[2] == 'M')))) { /* * It's an EGA or VGA *************** *** 583,588 **** --- 611,617 ---- if (!Probe_VGA(&Primary)) { Primary = CHIP_EGA; + Check_CoProc = TRUE; } /* *************** *** 652,657 **** --- 681,706 ---- p = order; } } + + Check_CoProc = matched->check_coproc; + + if (Probe_Mem) + { + if (matched->memcheck != (MemCheckFunc)NULL) + { + MemVGA = (*matched->memcheck)(Primary); + } + else if (Verbose) + { + printf("Memory probe not supported for this chipset.\n"); + fflush(stdout); + } + } + else if (Verbose) + { + printf("Skipping memory probe\n"); + fflush(stdout); + } } /* *************** *** 658,664 **** * If this chipset doesn't exclude probing for a coprocessor, * then look for one. */ ! if (matched->check_coproc) { if (Verbose) { --- 707,713 ---- * If this chipset doesn't exclude probing for a coprocessor, * then look for one. */ ! if (Check_CoProc) { if (Verbose) { *************** *** 673,678 **** --- 722,748 ---- break; } } + if (CoProc_Descriptors[i] != NULL) + { + if (Probe_Mem) + { + if (matched->memcheck != (MemCheckFunc)NULL) + { + MemCoProc = (*matched->memcheck)(CoProc); + } + else if (Verbose) + { + printf("Memory probe not supported "); + printf("for this chipset.\n"); + fflush(stdout); + } + } + else if (Verbose) + { + printf("Skipping memory probe\n"); + fflush(stdout); + } + } } } else if (Probe_MDA(&Primary)) *************** *** 725,737 **** { printf("Super-VGA\n"); Print_SVGA_Name(Primary); ! Probe_RamDac(Primary, &RamDac); ! Print_RamDac_Name(RamDac); } if (CoProc != -1) { printf("\tAttached graphics coprocessor:\n"); Print_CoProc_Name(CoProc); } } if (Secondary != -1) --- 795,822 ---- { printf("Super-VGA\n"); Print_SVGA_Name(Primary); ! if (MemVGA > -1) ! { ! printf("\tMemory: %d Kbytes\n", MemVGA); ! } ! if (Probe_DAC) ! { ! Probe_RamDac(Primary, &RamDac); ! Print_RamDac_Name(RamDac); ! } ! else if (Verbose) ! { ! printf("Skipping RAMDAC probe\n"); ! } } if (CoProc != -1) { printf("\tAttached graphics coprocessor:\n"); Print_CoProc_Name(CoProc); + if (MemCoProc > -1) + { + printf("\t\tMemory: %d Kbytes\n", MemCoProc); + } } } if (Secondary != -1) diff -c mit/server/ddx/x386/SuperProbe/Makefile.std:2.3 mit/server/ddx/x386/SuperProbe/Makefile.std:2.8 *** mit/server/ddx/x386/SuperProbe/Makefile.std:2.3 Fri Mar 11 23:36:13 1994 --- mit/server/ddx/x386/SuperProbe/Makefile.std Fri Mar 11 23:36:13 1994 *************** *** 1,4 **** ! # $XFree86: mit/server/ddx/x386/SuperProbe/Makefile.std,v 2.3 1993/09/17 16:13:27 dawes Exp $ # # Installation parameters # --- 1,4 ---- ! # $XFree86: mit/server/ddx/x386/SuperProbe/Makefile.std,v 2.8 1994/02/28 14:09:32 dawes Exp $ # # Installation parameters # *************** *** 15,41 **** #OS_DEF = -DSYSV #OS_DEF = -DSYSV -DSCO #OS_DEF = -DSYSV -DESIX OS_DEF = -DSYSV -DSVR4 OS_SRC = OS_SYSV.c OS_OBJ = OS_SYSV.o # Linux #OS_DEF = -Dlinux -DGCCUSESGAS #OS_SRC = OS_Linux.c #OS_OBJ = OS_Linux.o # 386BSD ! #OS_DEF = -D__386BSD__ -DGCCUSESGAS #OS_SRC = OS_386BSD.c #OS_OBJ = OS_386BSD.o # NetBSD ! #OS_DEF = -D__386BSD__ -D__NetBSD__ -DGCCUSESGAS #OS_SRC = OS_386BSD.c #OS_OBJ = OS_386BSD.o # FreeBSD ! #OS_DEF = -D__386BSD__ -DFreeBSD -DGCCUSESGAS #OS_SRC = OS_386BSD.c #OS_OBJ = OS_386BSD.o # BSD/386 ! #OS_DEF = -D__386BSD__ -D__bsdi__ -DGCCUSESGAS #OS_SRC = OS_386BSD.c #OS_OBJ = OS_386BSD.o # Minix --- 15,45 ---- #OS_DEF = -DSYSV #OS_DEF = -DSYSV -DSCO #OS_DEF = -DSYSV -DESIX + #OS_DEF = -DSYSV -DSVR4 -DSOLX86 OS_DEF = -DSYSV -DSVR4 OS_SRC = OS_SYSV.c OS_OBJ = OS_SYSV.o + # For Solarix x86 with ProWorks compiler only + #IO_SRC = SolX86IO.s + #IO_OBJ = SolX86IO.o # Linux #OS_DEF = -Dlinux -DGCCUSESGAS #OS_SRC = OS_Linux.c #OS_OBJ = OS_Linux.o # 386BSD ! #OS_DEF = -D__BSD__ -D__386BSD__ -DGCCUSESGAS #OS_SRC = OS_386BSD.c #OS_OBJ = OS_386BSD.o # NetBSD ! #OS_DEF = -D__BSD__ -D__NetBSD__ -DGCCUSESGAS #OS_SRC = OS_386BSD.c #OS_OBJ = OS_386BSD.o # FreeBSD ! #OS_DEF = -D__BSD__ -D__FreeBSD__ -DGCCUSESGAS #OS_SRC = OS_386BSD.c #OS_OBJ = OS_386BSD.o # BSD/386 ! #OS_DEF = -D__BSD__ -D__bsdi__ -DGCCUSESGAS #OS_SRC = OS_386BSD.c #OS_OBJ = OS_386BSD.o # Minix *************** *** 54,80 **** #OS_LIB = /usr/misc/.mach/lib/libmach.a HDRS = Probe.h ! BASE_SRC = MDA.c Herc.c CGA.c VGA.c RamDac.c ! BASE_OBJ = MDA.o Herc.o CGA.o VGA.o RamDac.o SVGA_SRC = Tseng.c WD.c ChipsTech.c Video7.c Genoa.c Trident.c Oak.c \ ! Cirrus.c Ahead.c ATI.c S3.c AL.c Yamaha.c NCR.c AcuMos.c MX.c \ ! RealTek.c Primus.c Compaq.c SVGA_OBJ = Tseng.o WD.o ChipsTech.o Video7.o Genoa.o Trident.o Oak.o \ ! Cirrus.o Ahead.o ATI.o S3.o AL.o Yamaha.o NCR.o AcuMos.o MX.o \ ! RealTek.o Primus.o Compaq.o COPROC_SRC = 8514.c ATIMach.c COPROC_OBJ = 8514.o ATIMach.o ! SRCS = Main.c $(SVGA_SRC) $(COPROC_SRC) $(BASE_SRC) Print.c Utils.c $(OS_SRC) ! OBJS = Main.o $(SVGA_OBJ) $(COPROC_OBJ) $(BASE_OBJ) Print.o Utils.o $(OS_OBJ) LIBS = $(OS_LIB) PROG = SuperProbe CC = gcc CCOPTS = -m486 -ansi -pedantic DEBUG_OR_OPT = -g -Wall #DEBUG_OR_OPT = -O2 CFLAGS = $(CCOPTS) $(DEBUG_OR_OPT) $(OS_DEF) all: $(PROG) --- 58,105 ---- #OS_LIB = /usr/misc/.mach/lib/libmach.a HDRS = Probe.h ! BASE_SRC = MDA.c Herc.c CGA.c VGA.c RamDac.c MemProbe.c ! BASE_OBJ = MDA.o Herc.o CGA.o VGA.o RamDac.o MemProbe.o SVGA_SRC = Tseng.c WD.c ChipsTech.c Video7.c Genoa.c Trident.c Oak.c \ ! Cirrus.c Ahead.c ATI.c S3.c AL.c Yamaha.c NCR.c MX.c \ ! RealTek.c Primus.c Compaq.c HMC.c UMC.c Weitek.c SVGA_OBJ = Tseng.o WD.o ChipsTech.o Video7.o Genoa.o Trident.o Oak.o \ ! Cirrus.o Ahead.o ATI.o S3.o AL.o Yamaha.o NCR.o MX.o \ ! RealTek.o Primus.o Compaq.o HMC.o UMC.o Weitek.o COPROC_SRC = 8514.c ATIMach.c COPROC_OBJ = 8514.o ATIMach.o ! SRCS = Main.c $(SVGA_SRC) $(COPROC_SRC) $(BASE_SRC) Print.c \ ! Utils.c $(OS_SRC) $(IO_SRC) ! OBJS = Main.o $(SVGA_OBJ) $(COPROC_OBJ) $(BASE_OBJ) Print.o \ ! Utils.o $(OS_OBJ) $(IO_OBJ) LIBS = $(OS_LIB) PROG = SuperProbe + # Options for gcc CC = gcc CCOPTS = -m486 -ansi -pedantic DEBUG_OR_OPT = -g -Wall #DEBUG_OR_OPT = -O2 + + # Options for ProWorks compiler on Solaris 2.x + #PROWORKSHOME = /opt/SUNWspro + #CC = $(PROWORKSHOME)/bin/cc + #AS = /usr/ccs/bin/as + #CCOPTS = -Xa + #DEBUG_OR_OPT = -g + #DEBUG_OR_OPT = -O + CFLAGS = $(CCOPTS) $(DEBUG_OR_OPT) $(OS_DEF) + + # + # Assemblier -> object format rule (Solaris x86 ProWorks compiler only) + # NOTE: AS must be defined to the assemblier to be used. Currently only + # the default assemblier supplied with Solaris/ProWorks is supported + # + .s.o: + $(RM) $@ + $(AS) -o $*.o $*.s all: $(PROG) diff -c /dev/null mit/server/ddx/x386/SuperProbe/MemProbe.c:2.1 *** /dev/null Fri Mar 11 23:36:13 1994 --- mit/server/ddx/x386/SuperProbe/MemProbe.c Fri Mar 11 23:36:13 1994 *************** *** 0 **** --- 1,147 ---- + /* + * Copyright 1993,1994 by David Wexelblat + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, 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 David Wexelblat not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. David Wexelblat makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + */ + + /* $XFree86: mit/server/ddx/x386/SuperProbe/MemProbe.c,v 2.1 1994/02/28 14:09:34 dawes Exp $ */ + + #include "Probe.h" + + static Word Ports[] = {SEQ_IDX, SEQ_REG, GRC_IDX, GRC_REG}; + #define NUMPORTS (sizeof(Ports)/sizeof(Ports[0])) + + #define SAVESIZE 100 + #define BYTE_AT(s,i,j) (*((s)+((i)*SAVESIZE)+(j))) + #define TAG "SuperProbe" + + int Probe_Mem(Check) + MemCheck_Descriptor Check; + { + Byte Save256; + Byte SaveMap; + Byte SaveSeq; + Byte SaveMask; + Byte *Mem; + Byte *Store; + int BankNum; + register int i, j; + Bool IsMem = TRUE; + int SaveRBank; + int SaveWBank; + int Total; + + Store = (Byte *)malloc((Check.max_bank+1)*SAVESIZE); + if (Store == (Byte *)0) + { + return(0); + } + Mem = MapVGA(); + if (Mem == (Byte *)0) + { + return(0); + } + EnableIOPorts(NUMPORTS, Ports); + Save256 = rdinx(GRC_IDX, 0x05); + SaveMap = rdinx(GRC_IDX, 0x06); + SaveMask = rdinx(SEQ_IDX, 0x02); + SaveSeq = rdinx(SEQ_IDX, 0x04); + wrinx(GRC_IDX, 0x05, ((Save256 & 0x0F) | 0x40)); + wrinx(GRC_IDX, 0x06, (SaveMap & 0xF0) | 0x05); + wrinx(SEQ_IDX, 0x02, (SaveMask & 0xF0) | 0x0F); + wrinx(SEQ_IDX, 0x04, (SaveSeq | 0x0E)); + Check.get_bank(Check.chipset, &SaveRBank, &SaveWBank); + for (BankNum = 0; ((BankNum <= Check.max_bank) && (IsMem)); BankNum++) + { + Check.set_bank(Check.chipset, BankNum, BankNum); + /* + * See if this bank is tagged. + */ + if (strncmp((char *)Mem, TAG, strlen(TAG)) == 0) + { + break; + } + for (i=0; i < SAVESIZE; i++) + { + BYTE_AT(Store,BankNum,i) = Mem[i]; + Mem[i] ^= 0xAA; + } + IsMem = TRUE; + for (i=0; i < SAVESIZE; i++) + { + if (Mem[i] != (BYTE_AT(Store,BankNum,i) ^ 0xAA)) + { + IsMem = FALSE; + break; + } + } + for (i = 0; i < SAVESIZE; i++) + { + Mem[i] = BYTE_AT(Store,BankNum,i); + } + if (IsMem) + { + for (i=0; i < SAVESIZE; i++) + { + Mem[i] ^= 0x55; + } + IsMem = TRUE; + for (i=0; i < SAVESIZE; i++) + { + if (Mem[i] != (BYTE_AT(Store,BankNum,i) ^ 0x55)) + { + IsMem = FALSE; + break; + } + } + for (i = 0; i < SAVESIZE; i++) + { + Mem[i] = BYTE_AT(Store,BankNum,i); + } + } + if (IsMem) + { + /* + * Tag this bank + */ + strcpy((char *)Mem, TAG); + } + } + Total = (BankNum * Check.bank_size) / 1024; + + for (j=0; j < BankNum; j++) + { + Check.set_bank(Check.chipset, j, j); + for (i=0; i < SAVESIZE; i++) + { + Mem[i] = BYTE_AT(Store,j,i); + } + } + + Check.set_bank(Check.chipset, SaveRBank, SaveWBank); + wrinx(SEQ_IDX, 0x04, SaveSeq); + wrinx(SEQ_IDX, 0x02, SaveMask); + wrinx(GRC_IDX, 0x06, SaveMap); + wrinx(GRC_IDX, 0x05, Save256); + DisableIOPorts(NUMPORTS, Ports); + UnMapVGA(Mem); + + return(Total); + } diff -c mit/server/ddx/x386/SuperProbe/NCR.c:2.2 mit/server/ddx/x386/SuperProbe/NCR.c:2.4 *** mit/server/ddx/x386/SuperProbe/NCR.c:2.2 Fri Mar 11 23:36:14 1994 --- mit/server/ddx/x386/SuperProbe/NCR.c Fri Mar 11 23:36:14 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,31 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/NCR.c,v 2.2 1993/09/27 12:23:19 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x3C4, 0x3C5}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor NCR_Descriptor = { --- 21,31 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/NCR.c,v 2.4 1994/02/28 14:09:35 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {SEQ_IDX, SEQ_REG}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor NCR_Descriptor = { *************** *** 35,65 **** NUMPORTS, FALSE, FALSE, ! TRUE }; - #ifdef __STDC__ - Bool Probe_NCR(int *Chipset) - #else Bool Probe_NCR(Chipset) int *Chipset; - #endif { Bool result = FALSE; Byte old, tmp; EnableIOPorts(NUMPORTS, Ports); ! if (testinx2(0x3C4, 0x05, 0x05)) { ! old = rdinx(0x3C4, 0x05); wrinx(0x3C4, 0x05, 0x00); ! if (!testinx2(0x3C4, 0x10, 0xFF)) { ! wrinx(0x3C4, 0x05, 0x01); ! if (testinx2(0x3C4, 0x10, 0xFF)) { result = TRUE; ! tmp = rdinx(0x3C4, 0x08) >> 4; if (tmp == 0) { *Chipset = CHIP_NCR77C22; --- 35,63 ---- NUMPORTS, FALSE, FALSE, ! TRUE, ! NULL, }; Bool Probe_NCR(Chipset) int *Chipset; { Bool result = FALSE; Byte old, tmp; EnableIOPorts(NUMPORTS, Ports); ! ! if (testinx2(SEQ_IDX, 0x05, 0x05)) { ! old = rdinx(SEQ_IDX, 0x05); wrinx(0x3C4, 0x05, 0x00); ! if (!testinx2(SEQ_IDX, 0x10, 0xFF)) { ! wrinx(SEQ_IDX, 0x05, 0x01); ! if (testinx2(SEQ_IDX, 0x10, 0xFF)) { result = TRUE; ! tmp = rdinx(SEQ_IDX, 0x08) >> 4; if (tmp == 0) { *Chipset = CHIP_NCR77C22; *************** *** 72,77 **** --- 70,79 ---- { *Chipset = CHIP_NCR77C22E; } + else if (tmp == 3) + { + *Chipset = CHIP_NCR77C32B; + } else if ((tmp >= 8) && (tmp <= 15)) { *Chipset = CHIP_NCR77C22EP; *************** *** 83,90 **** } } } ! wrinx(0x3C4, 0x05, old); } DisableIOPorts(NUMPORTS, Ports); return(result); } --- 85,93 ---- } } } ! wrinx(SEQ_IDX, 0x05, old); } + DisableIOPorts(NUMPORTS, Ports); return(result); } diff -c mit/server/ddx/x386/SuperProbe/OS_386BSD.c:2.4 mit/server/ddx/x386/SuperProbe/OS_386BSD.c:2.7 *** mit/server/ddx/x386/SuperProbe/OS_386BSD.c:2.4 Fri Mar 11 23:36:14 1994 --- mit/server/ddx/x386/SuperProbe/OS_386BSD.c Fri Mar 11 23:36:14 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Dawes * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Dawes * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/OS_386BSD.c,v 2.4 1993/10/03 10:24:31 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/OS_386BSD.c,v 2.7 1994/02/28 14:09:36 dawes Exp $ */ #include "Probe.h" *************** *** 28,33 **** --- 28,34 ---- #include #include #include + #include #ifdef __bsdi__ # include *************** *** 35,42 **** # define CONSOLE_X_MODE_OFF PCCONIOCCOOK #else /* This header is part of codrv */ ! # if defined(FreeBSD) || defined(__NetBSD__) # include # else # include # endif --- 36,45 ---- # define CONSOLE_X_MODE_OFF PCCONIOCCOOK #else /* This header is part of codrv */ ! # if defined(__FreeBSD__) || defined(__NetBSD__) # include + /* both, Free and NetBSD have syscons */ + # include # else # include # endif *************** *** 50,55 **** --- 53,59 ---- static int BIOS_fd = -1; static Bool HasCodrv = FALSE; + static Bool HasUslVt = FALSE; /* * OpenVideo -- *************** *** 58,68 **** * IO protection, since this is currently the only way to access any * IO registers. */ - #ifdef __STDC__ - int OpenVideo(void) - #else int OpenVideo() - #endif { if (geteuid() != 0) { --- 62,68 ---- *************** *** 107,115 **** " and try again\n"); return(-1); } ! if ((CONS_fd = open("/dev/vga", O_RDWR, 0)) < 0) { ! fprintf(stderr, "%s: Cannot open /dev/vga\n", MyName); return(-1); } --- 107,117 ---- " and try again\n"); return(-1); } ! if ((CONS_fd = open("/dev/vga", O_RDWR, 0)) < 0 ! && (CONS_fd = open("/dev/ttyv0", O_RDWR, 0)) < 0) { ! fprintf(stderr, ! "%s: Cannot open /dev/vga nor /dev/ttyv0\n", MyName); return(-1); } *************** *** 143,150 **** ioctl(CONS_fd, VGATAKECTRL, 0); } else #endif ! if (ioctl(CONS_fd, CONSOLE_X_MODE_ON, 0) < 0) { fprintf(stderr, "%s: CONSOLE_X_MODE_ON failed\n", MyName); --- 145,171 ---- ioctl(CONS_fd, VGATAKECTRL, 0); } else + { + /* + * not codrv and not BSDI; first look if we have a console + * driver that understands USL-style VT commands + */ + int vt_num; + + if (ioctl(CONS_fd, VT_GETACTIVE, &vt_num) == 0) + { + /* yes, so we don't use the old stuff */ + HasUslVt = TRUE; + if (ioctl(CONS_fd, KDENABIO, 0) < 0) + { + fprintf(stderr, "%s: KDENABIO failed\n", + MyName); + return(-1); + } + } + else #endif ! if (ioctl(CONS_fd, CONSOLE_X_MODE_ON, 0) < 0) { fprintf(stderr, "%s: CONSOLE_X_MODE_ON failed\n", MyName); *************** *** 152,157 **** --- 173,180 ---- } #ifdef __bsdi__ ioctl(CONS_fd, PCCONENABIOPL, 0); + #else + } #endif return(CONS_fd); } *************** *** 162,172 **** * Disable access to the video hardware. For 386BSD, we re-enable * IO protection. */ - #ifdef __STDC__ - void CloseVideo(void) - #else void CloseVideo() - #endif { if (CONS_fd != -1) { --- 185,191 ---- *************** *** 178,183 **** --- 197,204 ---- ioctl(CONS_fd, VGAGIVECTRL, 0); ioctl(CONS_fd, CONSOLE_X_MODE, &onoff); } + else if(HasUslVt) + ioctl(CONS_fd, KDDISABIO, 0); else #endif ioctl(CONS_fd, CONSOLE_X_MODE_OFF, 0); *************** *** 192,210 **** } /* * ReadBIOS -- * * Read 'Len' bytes from the video BIOS at address 'Bios_Base'+'Offset' into * buffer 'Buffer'. */ - #ifdef __STDC__ - int ReadBIOS(const unsigned Offset, Byte *Buffer, const int Len) - #else int ReadBIOS(Offset, Buffer, Len) unsigned Offset; Byte *Buffer; int Len; - #endif { Word tmp; Byte *Base = Bios_Base + Offset; --- 213,265 ---- } /* + * MapVGA -- + * + * Map the VGA memory window (0xA0000-0xAFFFF) as read/write memory for + * the process for use in probing memory. + */ + Byte *MapVGA() + { + int fd; + Byte *base; + + if ((fd = open("/dev/vga", O_RDWR)) < 0) + { + fprintf(stderr, "%s: Failed to open /dev/vga\n", MyName); + return((Byte *)0); + } + base = (Byte *)mmap((caddr_t)0, 0x10000, PROT_READ|PROT_WRITE, + MAP_FILE, fd, 0); + close(fd); + if ((long)base == -1) + { + fprintf(stderr, "%s: Failed to mmap framebuffer\n", MyName); + return((Byte *)0); + } + return(base); + } + + /* + * UnMapVGA -- + * + * Unmap the VGA memory window. + */ + void UnMapVGA(base) + Byte *base; + { + munmap((caddr_t)base, 0x10000); + } + + /* * ReadBIOS -- * * Read 'Len' bytes from the video BIOS at address 'Bios_Base'+'Offset' into * buffer 'Buffer'. */ int ReadBIOS(Offset, Buffer, Len) unsigned Offset; Byte *Buffer; int Len; { Word tmp; Byte *Base = Bios_Base + Offset; *************** *** 251,265 **** * Enable access to 'NumPorts' IO ports listed in array 'Ports'. For 386BSD, * we've disabled IO protections so this is a no-op. */ - #ifdef __STDC__ - /*ARGSUSED*/ - int EnableIOPorts(const int NumPorts, const Word *Ports) - #else /*ARGSUSED*/ int EnableIOPorts(NumPorts, Ports) ! int NumPorts; ! Word *Ports; ! #endif { return(0); } --- 306,315 ---- * Enable access to 'NumPorts' IO ports listed in array 'Ports'. For 386BSD, * we've disabled IO protections so this is a no-op. */ /*ARGSUSED*/ int EnableIOPorts(NumPorts, Ports) ! CONST int NumPorts; ! CONST Word *Ports; { return(0); } *************** *** 270,284 **** * Disable access to 'NumPorts' IO ports listed in array 'Ports'. For 386BSD, * we've disabled IO protections so this is a no-op. */ - #ifdef __STDC__ /*ARGSUSED*/ - int DisableIOPorts(const int NumPorts, const Word *Port) - #else /*ARGSUSED*/ int DisableIOPorts(NumPorts, Port) ! int NumPorts; ! Word *Port; ! #endif { return(0); } --- 320,330 ---- * Disable access to 'NumPorts' IO ports listed in array 'Ports'. For 386BSD, * we've disabled IO protections so this is a no-op. */ /*ARGSUSED*/ /*ARGSUSED*/ int DisableIOPorts(NumPorts, Port) ! CONST int NumPorts; ! CONST Word *Port; { return(0); } *************** *** 288,299 **** * * Sleep for the number of milliseconds specified in 'Delay'. */ - #ifdef __STDC__ - void ShortSleep(const int Delay) - #else void ShortSleep(Delay) int Delay; - #endif { usleep(Delay * 1000); } --- 334,341 ---- diff -c mit/server/ddx/x386/SuperProbe/OS_Linux.c:2.0 mit/server/ddx/x386/SuperProbe/OS_Linux.c:2.3 *** mit/server/ddx/x386/SuperProbe/OS_Linux.c:2.0 Fri Mar 11 23:36:15 1994 --- mit/server/ddx/x386/SuperProbe/OS_Linux.c Fri Mar 11 23:36:15 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by Orest Zborowski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by Orest Zborowski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/OS_Linux.c,v 2.0 1993/08/30 15:20:31 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/OS_Linux.c,v 2.3 1994/02/28 14:09:37 dawes Exp $ */ #include "Probe.h" *************** *** 28,33 **** --- 28,34 ---- #include #include #include + #include static int VT_fd = -1; static int VT_num = -1; *************** *** 41,51 **** * VT, and disable IO protection, since we may need to get at extended * registers (full 16-bit decoding). */ - #ifdef __STDC__ - int OpenVideo(void) - #else int OpenVideo() - #endif { int fd; char fn[20]; --- 42,48 ---- *************** *** 121,131 **** * Disable access to the video hardware. For Linux, close the VT, and * re-enable IO protection. */ - #ifdef __STDC__ - void CloseVideo(void) - #else void CloseVideo() - #endif { int fd; --- 118,124 ---- *************** *** 145,163 **** } /* * ReadBIOS -- * * Read 'Len' bytes from the video BIOS at address 'Bios_Base'+'Offset' into * buffer 'Buffer'. */ - #ifdef __STDC__ - int ReadBIOS(const unsigned Offset, Byte *Buffer, const int Len) - #else int ReadBIOS(Offset, Buffer, Len) unsigned Offset; Byte *Buffer; int Len; - #endif { Word tmp; Byte *Base = Bios_Base + Offset; --- 138,191 ---- } /* + * MapVGA -- + * + * Map the VGA memory window (0xA0000-0xAFFFF) as read/write memory for + * the process for use in probing memory. + */ + Byte *MapVGA() + { + int fd; + Byte *base; + + if ((fd = open("/dev/mem", O_RDWR)) < 0) + { + fprintf(stderr, "%s: Failed to open /dev/mem\n", MyName); + return((Byte *)0); + } + base = (Byte *)mmap((caddr_t)0, 0x10000, PROT_READ|PROT_WRITE, + MAP_SHARED, fd, (off_t)0xA0000); + close(fd); + if ((long)base == -1) + { + fprintf(stderr, "%s: Failed to mmap framebuffer\n", MyName); + return((Byte *)0); + } + return(base); + } + + /* + * UnMapVGA -- + * + * Unmap the VGA memory window. + */ + void UnMapVGA(base) + Byte *base; + { + munmap((caddr_t)base, 0x10000); + return; + } + + /* * ReadBIOS -- * * Read 'Len' bytes from the video BIOS at address 'Bios_Base'+'Offset' into * buffer 'Buffer'. */ int ReadBIOS(Offset, Buffer, Len) unsigned Offset; Byte *Buffer; int Len; { Word tmp; Byte *Base = Bios_Base + Offset; *************** *** 204,218 **** * Enable access to 'NumPorts' IO ports listed in array 'Ports'. For Linux, * we've disabled IO protections so this is a no-op. */ - #ifdef __STDC__ /*ARGSUSED*/ - int EnableIOPorts(const int NumPorts, const Word *Ports) - #else - /*ARGSUSED*/ int EnableIOPorts(NumPorts, Ports) ! int NumPorts; ! Word *Ports; ! #endif { return(0); } --- 232,241 ---- * Enable access to 'NumPorts' IO ports listed in array 'Ports'. For Linux, * we've disabled IO protections so this is a no-op. */ /*ARGSUSED*/ int EnableIOPorts(NumPorts, Ports) ! CONST int NumPorts; ! CONST Word *Ports; { return(0); } *************** *** 223,237 **** * Disable access to 'NumPorts' IO ports listed in array 'Ports'. For Linux, * we've disabled IO protections so this is a no-op. */ - #ifdef __STDC__ - /*ARGSUSED*/ - int DisableIOPorts(const int NumPorts, const Word *Port) - #else /*ARGSUSED*/ int DisableIOPorts(NumPorts, Port) ! int NumPorts; ! Word *Port; ! #endif { return(0); } --- 246,255 ---- * Disable access to 'NumPorts' IO ports listed in array 'Ports'. For Linux, * we've disabled IO protections so this is a no-op. */ /*ARGSUSED*/ int DisableIOPorts(NumPorts, Port) ! CONST int NumPorts; ! CONST Word *Port; { return(0); } *************** *** 241,252 **** * * Sleep for the number of milliseconds specified in 'Delay'. */ - #ifdef __STDC__ - void ShortSleep(const int Delay) - #else void ShortSleep(Delay) int Delay; - #endif { usleep(Delay * 1000); } --- 259,266 ---- diff -c mit/server/ddx/x386/SuperProbe/OS_Mach.c:2.1 mit/server/ddx/x386/SuperProbe/OS_Mach.c:2.4 *** mit/server/ddx/x386/SuperProbe/OS_Mach.c:2.1 Fri Mar 11 23:36:16 1994 --- mit/server/ddx/x386/SuperProbe/OS_Mach.c Fri Mar 11 23:36:16 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by Robert V. Baron * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by Robert V. Baron * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/OS_Mach.c,v 2.1 1993/10/16 17:30:37 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/OS_Mach.c,v 2.4 1994/02/28 14:09:39 dawes Exp $ */ #include "Probe.h" *************** *** 49,59 **** */ int screen_addr; - #ifdef __STDC__ - int OpenVideo(void) - #else int OpenVideo() - #endif { int ret; #define C /*Bios_Base*/ 0xc0000 --- 49,55 ---- *************** *** 84,94 **** * Disable access to the video hardware. For Mach, we re-enable * IO protection. */ - #ifdef __STDC__ - void CloseVideo(void) - #else void CloseVideo() - #endif { if (KERN_SUCESS != vm_deallocate(task_self(), screen_addr, S)) { fprintf(stderr, "Failed vmdeallocate %x\n", S); --- 80,86 ---- *************** *** 97,115 **** } /* * ReadBIOS -- * * Read 'Len' bytes from the video BIOS at address 'Bios_Base'+'Offset' into * buffer 'Buffer'. */ - #ifdef __STDC__ - int ReadBIOS(const unsigned Offset, Byte *Buffer, const int Len) - #else int ReadBIOS(Offset, Buffer, Len) unsigned Offset; Byte *Buffer; int Len; - #endif { Word tmp; Byte *Base = (Byte *)(screen_addr + Bios_Base + Offset); --- 89,125 ---- } /* + * MapVGA -- + * + * Map the VGA memory window (0xA0000-0xAFFFF) as read/write memory for + * the process for use in probing memory. + */ + Byte *MapVGA() + { + return((Byte *)0); + } + + /* + * UnMapVGA -- + * + * Unmap the VGA memory window. + */ + void UnMapVGA(base) + Byte *base; + { + return; + } + + /* * ReadBIOS -- * * Read 'Len' bytes from the video BIOS at address 'Bios_Base'+'Offset' into * buffer 'Buffer'. */ int ReadBIOS(Offset, Buffer, Len) unsigned Offset; Byte *Buffer; int Len; { Word tmp; Byte *Base = (Byte *)(screen_addr + Bios_Base + Offset); *************** *** 133,147 **** * Enable access to 'NumPorts' IO ports listed in array 'Ports'. For Mach, * we've disabled IO protections so this is a no-op. */ - #ifdef __STDC__ /*ARGSUSED*/ - int EnableIOPorts(const int NumPorts, const Word *Ports) - #else - /*ARGSUSED*/ int EnableIOPorts(NumPorts, Ports) ! int NumPorts; ! Word *Ports; ! #endif { return(0); } --- 143,152 ---- * Enable access to 'NumPorts' IO ports listed in array 'Ports'. For Mach, * we've disabled IO protections so this is a no-op. */ /*ARGSUSED*/ int EnableIOPorts(NumPorts, Ports) ! CONST int NumPorts; ! CONST Word *Ports; { return(0); } *************** *** 152,166 **** * Disable access to 'NumPorts' IO ports listed in array 'Ports'. For Mach, * we've disabled IO protections so this is a no-op. */ - #ifdef __STDC__ - /*ARGSUSED*/ - int DisableIOPorts(const int NumPorts, const Word *Port) - #else /*ARGSUSED*/ int DisableIOPorts(NumPorts, Port) ! int NumPorts; ! Word *Port; ! #endif { return(0); } --- 157,166 ---- * Disable access to 'NumPorts' IO ports listed in array 'Ports'. For Mach, * we've disabled IO protections so this is a no-op. */ /*ARGSUSED*/ int DisableIOPorts(NumPorts, Port) ! CONST int NumPorts; ! CONST Word *Port; { return(0); } *************** *** 170,181 **** * * Sleep for the number of milliseconds specified in 'Delay'. */ - #ifdef __STDC__ - void ShortSleep(const int Delay) - #else void ShortSleep(Delay) int Delay; - #endif { #ifdef MACH3 struct trial { --- 170,177 ---- diff -c mit/server/ddx/x386/SuperProbe/OS_Minix.c:1.2 mit/server/ddx/x386/SuperProbe/OS_Minix.c:2.1 *** mit/server/ddx/x386/SuperProbe/OS_Minix.c:1.2 Fri Mar 11 23:36:16 1994 --- mit/server/ddx/x386/SuperProbe/OS_Minix.c Fri Mar 11 23:36:16 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by Philip Homburg * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by Philip Homburg * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/OS_Minix.c,v 1.2 1993/05/04 15:01:47 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/OS_Minix.c,v 2.1 1994/02/28 14:09:40 dawes Exp $ */ #include "Probe.h" *************** *** 39,49 **** * Enable access to the installed video hardware. This also gives us * access to all I/O registers and the interrupt enable/disable bit. */ - #ifdef __STDC__ - int OpenVideo(void) - #else int OpenVideo() - #endif { void *base; u32_t aligned_base; --- 39,45 ---- *************** *** 91,101 **** * Disable access to the video hardware. For Minix, this removes access * to I/O registers. */ - #ifdef __STDC__ - void CloseVideo(void) - #else void CloseVideo() - #endif { if (CONS_fd > 0) { --- 87,93 ---- *************** *** 105,123 **** } /* * ReadBIOS -- * * Read 'Len' bytes from the video BIOS at address 'Bios_Base'+'Offset' into * buffer 'Buffer'. */ - #ifdef __STDC__ - int ReadBIOS(const unsigned Offset, Byte *Buffer, const int Len) - #else int ReadBIOS(Offset, Buffer, Len) unsigned Offset; Byte *Buffer; int Len; - #endif { Word tmp; Byte *Base = Bios_Base + Offset; --- 97,133 ---- } /* + * MapVGA -- + * + * Map the VGA memory window (0xA0000-0xAFFFF) as read/write memory for + * the process for use in probing memory. + */ + Byte *MapVGA() + { + return((Byte *)0); + } + + /* + * UnMapVGA -- + * + * Unmap the VGA memory window. + */ + void UnMapVGA(base) + Byte *base; + { + return; + } + + /* * ReadBIOS -- * * Read 'Len' bytes from the video BIOS at address 'Bios_Base'+'Offset' into * buffer 'Buffer'. */ int ReadBIOS(Offset, Buffer, Len) unsigned Offset; Byte *Buffer; int Len; { Word tmp; Byte *Base = Bios_Base + Offset; *************** *** 164,178 **** * Enable access to 'NumPorts' IO ports listed in array 'Ports'. For Minix, * we've disabled IO protections so this is a no-op. */ - #ifdef __STDC__ - /*ARGSUSED*/ - int EnableIOPorts(const int NumPorts, const Word *Ports) - #else /*ARGSUSED*/ int EnableIOPorts(NumPorts, Ports) ! int NumPorts; ! Word *Ports; ! #endif { if (CONS_fd == -1) abort(); --- 174,183 ---- * Enable access to 'NumPorts' IO ports listed in array 'Ports'. For Minix, * we've disabled IO protections so this is a no-op. */ /*ARGSUSED*/ int EnableIOPorts(NumPorts, Ports) ! CONST int NumPorts; ! CONST Word *Ports; { if (CONS_fd == -1) abort(); *************** *** 185,199 **** * Disable access to 'NumPorts' IO ports listed in array 'Ports'. For Minix, * we've disabled IO protections so this is a no-op. */ - #ifdef __STDC__ - /*ARGSUSED*/ - int DisableIOPorts(const int NumPorts, const Word *Port) - #else /*ARGSUSED*/ int DisableIOPorts(NumPorts, Port) ! int NumPorts; ! Word *Port; ! #endif { return(0); } --- 190,199 ---- * Disable access to 'NumPorts' IO ports listed in array 'Ports'. For Minix, * we've disabled IO protections so this is a no-op. */ /*ARGSUSED*/ int DisableIOPorts(NumPorts, Port) ! CONST int NumPorts; ! CONST Word *Port; { return(0); } *************** *** 203,214 **** * * Sleep for the number of milliseconds specified in 'Delay'. */ - #ifdef __STDC__ - void ShortSleep(const int Delay) - #else void ShortSleep(Delay) int Delay; - #endif { usleep(Delay * 1000); } --- 203,210 ---- diff -c mit/server/ddx/x386/SuperProbe/OS_SYSV.c:2.3 mit/server/ddx/x386/SuperProbe/OS_SYSV.c:2.8 *** mit/server/ddx/x386/SuperProbe/OS_SYSV.c:2.3 Fri Mar 11 23:36:17 1994 --- mit/server/ddx/x386/SuperProbe/OS_SYSV.c Fri Mar 11 23:36:17 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/OS_SYSV.c,v 2.3 1993/09/21 15:20:38 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/OS_SYSV.c,v 2.8 1994/03/01 09:51:12 dawes Exp $ */ #include "Probe.h" *************** *** 40,51 **** #endif #ifdef SCO # include #else # include # include #endif #include ! #include #include #include #include --- 40,56 ---- #endif #ifdef SCO # include + # include #else # include + #ifndef SOLX86 # include #endif + #endif #include ! #ifndef SOLX86 ! # include ! #endif #include #include #include *************** *** 53,58 **** --- 58,66 ---- # include #endif #include + #ifdef SOLX86 + # include + #endif #ifdef __STDC__ int sysi86(int, ...); *************** *** 66,72 **** #ifdef SVR4 # include ! # define DEV_MEM "/dev/pmem" #else # define DEV_MEM "/dev/mem" #endif --- 74,84 ---- #ifdef SVR4 # include ! # ifdef SOLX86 ! # define DEV_MEM "/dev/fb" ! # else ! # define DEV_MEM "/dev/pmem" ! # endif #else # define DEV_MEM "/dev/mem" #endif *************** *** 82,92 **** * VT if not running on a VT. Also, disable IO protection, since we may * need to get at extended registers. */ - #ifdef __STDC__ - int OpenVideo(void) - #else int OpenVideo() - #endif { int fd; char fn[20]; --- 94,100 ---- *************** *** 104,110 **** } else { ! if ((fd = open("/dev/console", O_WRONLY, 0)) < 0) { fprintf(stderr, "%s: Cannot open /dev/console\n", MyName); --- 112,120 ---- } else { ! ! #ifndef SOLX86 ! if ((fd = open("/dev/console", O_RDWR, 0)) < 0) { fprintf(stderr, "%s: Cannot open /dev/console\n", MyName); *************** *** 117,122 **** --- 127,136 ---- } close(fd); sprintf(fn, "/dev/vt%02d", VT_num); + #else + sprintf(fn, "/dev/fb"); + #endif + if ((VT_fd = open(fn, O_RDWR|O_NDELAY, 0)) < 0) { fprintf(stderr, "%s: Could not open VT %s\n", *************** *** 123,129 **** MyName, fn); return(-1); } ! #ifndef SCO if (ioctl(VT_fd, VT_WAITACTIVE, VT_num) != 0) { fprintf(stderr, "%s: VT_WAITACTIVE failed!\n", MyName); --- 137,143 ---- MyName, fn); return(-1); } ! #if !defined(SCO) && !defined(SOLX86) if (ioctl(VT_fd, VT_WAITACTIVE, VT_num) != 0) { fprintf(stderr, "%s: VT_WAITACTIVE failed!\n", MyName); *************** *** 145,155 **** * Disable access to the video hardware. For SYSV, close the VT if it's open. * Also, re-enable IO protection. */ - #ifdef __STDC__ - void CloseVideo(void) - #else void CloseVideo() - #endif { if (VT_fd != -1) { --- 159,165 ---- *************** *** 162,180 **** } /* * ReadBIOS -- * * Read 'Len' bytes from the video BIOS at address 'Bios_Base'+'Offset' into * buffer 'Buffer'. */ - #ifdef __STDC__ - int ReadBIOS(const unsigned Offset, Byte *Buffer, const int Len) - #else int ReadBIOS(Offset, Buffer, Len) unsigned Offset; Byte *Buffer; int Len; - #endif { #ifndef SVR4 Word tmp; --- 172,257 ---- } /* + * MapVGA -- + * + * Map the VGA memory window (0xA0000-0xAFFFF) as read/write memory for + * the process for use in probing memory. + */ + Byte *MapVGA() + { + #if defined(SVR4) + int fd; + Byte *base; + + if ((fd = open(DEV_MEM, O_RDWR)) < 0) + { + fprintf(stderr, "%s: Failed to open %s\n", MyName, DEV_MEM); + return((Byte *)0); + } + base = (Byte *)mmap((caddr_t)0, 0x10000, PROT_READ|PROT_WRITE, + MAP_SHARED, fd, (off_t)0xA0000); + close(fd); + if ((long)base == -1) + { + fprintf(stderr, "%s: Failed to mmap framebuffer\n", MyName); + return((Byte *)0); + } + #elif defined(SCO) + static Byte *base = (Byte *)0; + ioctl(VT_fd, KDSETMODE, KD_GRAPHICS); + if (base == (Byte *) 0) + base = (Byte *) ioctl(VT_fd, MAPCONS, 0L); + #else /* SVR4 */ + static Byte *base = (Byte *)0; + static struct kd_memloc vgaDSC; + + ioctl(VT_fd, KDSETMODE, KD_GRAPHICS); + if (base == (Byte *)0) + { + base = (Byte *)(((unsigned int)malloc(0x11000) & ~0xFFF) + + 0x1000); + vgaDSC.vaddr = (char *)base; + vgaDSC.physaddr = (char *)0xA0000; + vgaDSC.length = 0x10000; + vgaDSC.ioflg = 1; + } + if (ioctl(VT_fd, KDMAPDISP, &vgaDSC) < 0) + { + fprintf(stderr, "%s: Failed to mmap framebuffer\n", MyName); + return((Byte *)0); + } + #endif /* SVR4 */ + return(base); + } + + /* + * UnMapVGA -- + * + * Unmap the VGA memory window. + */ + void UnMapVGA(base) + Byte *base; + { + #ifdef SVR4 + munmap((caddr_t)base, 0x10000); + #else /* SVR4 */ + # ifndef SCO + ioctl(VT_fd, KDUNMAPDISP, 0); + # endif + ioctl(VT_fd, KDSETMODE, KD_TEXT); + #endif + } + + /* * ReadBIOS -- * * Read 'Len' bytes from the video BIOS at address 'Bios_Base'+'Offset' into * buffer 'Buffer'. */ int ReadBIOS(Offset, Buffer, Len) unsigned Offset; Byte *Buffer; int Len; { #ifndef SVR4 Word tmp; *************** *** 271,285 **** * Enable access to 'NumPorts' IO ports listed in array 'Ports'. For SYSV, * we've disabled IO protections so this is a no-op. */ - #ifdef __STDC__ /*ARGSUSED*/ - int EnableIOPorts(const int NumPorts, const Word *Ports) - #else - /*ARGSUSED*/ int EnableIOPorts(NumPorts, Ports) ! int NumPorts; ! Word *Ports; ! #endif { return(0); } --- 348,357 ---- * Enable access to 'NumPorts' IO ports listed in array 'Ports'. For SYSV, * we've disabled IO protections so this is a no-op. */ /*ARGSUSED*/ int EnableIOPorts(NumPorts, Ports) ! CONST int NumPorts; ! CONST Word *Ports; { return(0); } *************** *** 290,304 **** * Disable access to 'NumPorts' IO ports listed in array 'Ports'. For SYSV, * we've disabled IO protections so this is a no-op. */ - #ifdef __STDC__ - /*ARGSUSED*/ - int DisableIOPorts(const int NumPorts, const Word *Port) - #else /*ARGSUSED*/ int DisableIOPorts(NumPorts, Port) ! int NumPorts; ! Word *Port; ! #endif { return(0); } --- 362,371 ---- * Disable access to 'NumPorts' IO ports listed in array 'Ports'. For SYSV, * we've disabled IO protections so this is a no-op. */ /*ARGSUSED*/ int DisableIOPorts(NumPorts, Port) ! CONST int NumPorts; ! CONST Word *Port; { return(0); } *************** *** 308,319 **** * * Sleep for the number of milliseconds specified in 'Delay'. */ - #ifdef __STDC__ - void ShortSleep(const int Delay) - #else void ShortSleep(Delay) int Delay; - #endif { syscall(3112, Delay); } --- 375,382 ---- diff -c mit/server/ddx/x386/SuperProbe/Oak.c:2.3 mit/server/ddx/x386/SuperProbe/Oak.c:2.5 *** mit/server/ddx/x386/SuperProbe/Oak.c:2.3 Fri Mar 11 23:36:18 1994 --- mit/server/ddx/x386/SuperProbe/Oak.c Fri Mar 11 23:36:18 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Oak.c,v 2.3 1993/09/27 12:23:20 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Oak.c,v 2.5 1994/02/28 14:09:43 dawes Exp $ */ #include "Probe.h" *************** *** 28,33 **** --- 28,35 ---- static Word Ports[] = {0x3DE, 0x3DF}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_Oak __STDCARGS((int)); + Chip_Descriptor Oak_Descriptor = { "Oak", Probe_Oak, *************** *** 35,69 **** NUMPORTS, FALSE, FALSE, ! TRUE }; - #ifdef __STDC__ - Bool Probe_Oak(int *Chipset) - #else Bool Probe_Oak(Chipset) int *Chipset; - #endif { Byte temp; Bool result = FALSE; EnableIOPorts(NUMPORTS, Ports); if (testinx2(0x3DE, 0x0D, 0x38)) { result = TRUE; ! if (testinx2(0x3DE, 0x11, 0x77)) { ! temp = inp(0x3DE) & 0xE0; switch (temp) { ! case 0x40: *Chipset = CHIP_OAK067; break; ! case 0xA0: *Chipset = CHIP_OAK077; break; ! case 0xE0: *Chipset = CHIP_OAK057; break; default: --- 37,83 ---- NUMPORTS, FALSE, FALSE, ! TRUE, ! MemProbe_Oak, }; Bool Probe_Oak(Chipset) int *Chipset; { Byte temp; Bool result = FALSE; EnableIOPorts(NUMPORTS, Ports); + if (testinx2(0x3DE, 0x0D, 0x38)) { result = TRUE; ! if (testinx2(0x3DE, 0x23, 0x1F)) ! { ! if ((rdinx(0x3DE, 0x00) & 0x02) == 0x00) ! { ! *Chipset = CHIP_OAK087; ! } ! else ! { ! *Chipset = CHIP_OAK083; ! } ! } ! else { ! temp = inp(0x3DE) >> 5; switch (temp) { ! case 0x00: ! *Chipset = CHIP_OAK037C; ! break; ! case 0x02: *Chipset = CHIP_OAK067; break; ! case 0x05: *Chipset = CHIP_OAK077; break; ! case 0x07: *Chipset = CHIP_OAK057; break; default: *************** *** 72,82 **** break; } } ! else { ! *Chipset = CHIP_OAK037C; } } DisableIOPorts(NUMPORTS, Ports); ! return(result); } --- 86,141 ---- break; } } ! } ! ! DisableIOPorts(NUMPORTS, Ports); ! return(result); ! } ! ! static int MemProbe_Oak(Chipset) ! int Chipset; ! { ! int Mem = 0; ! ! EnableIOPorts(NUMPORTS, Ports); ! ! switch (Chipset) ! { ! case CHIP_OAK083: ! case CHIP_OAK087: ! switch (rdinx(0x3DE, 0x02) & 0x06) ! { ! case 0x00: ! Mem = 256; ! break; ! case 0x02: ! Mem = 512; ! break; ! case 0x04: ! Mem = 1024; ! break; ! case 0x06: ! Mem = 2048; ! break; ! } ! break; ! default: ! switch (rdinx(0x3DE, 0x0D) >> 6) { ! case 0x00: ! Mem = 256; ! break; ! case 0x02: ! Mem = 512; ! break; ! case 0x01: ! case 0x03: ! Mem = 1024; ! break; } + break; } + DisableIOPorts(NUMPORTS, Ports); ! return(Mem); } diff -c mit/server/ddx/x386/SuperProbe/PatchLevel.h:2.6 mit/server/ddx/x386/SuperProbe/PatchLevel.h:2.9 *** mit/server/ddx/x386/SuperProbe/PatchLevel.h:2.6 Fri Mar 11 23:36:18 1994 --- mit/server/ddx/x386/SuperProbe/PatchLevel.h Fri Mar 11 23:36:18 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,28 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/PatchLevel.h,v 2.6 1993/10/07 13:54:47 dawes Exp $ */ ! #define VERSION 1 #define PATCHLEV 0 #define PRINT_VERSION printf("\n%s Version %d.%d\n",MyName,VERSION,PATCHLEV) --- 21,28 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/PatchLevel.h,v 2.9 1994/02/28 14:09:44 dawes Exp $ */ ! #define VERSION 2 #define PATCHLEV 0 #define PRINT_VERSION printf("\n%s Version %d.%d\n",MyName,VERSION,PATCHLEV) diff -c mit/server/ddx/x386/SuperProbe/Primus.c:2.1 mit/server/ddx/x386/SuperProbe/Primus.c:2.3 *** mit/server/ddx/x386/SuperProbe/Primus.c:2.1 Fri Mar 11 23:36:19 1994 --- mit/server/ddx/x386/SuperProbe/Primus.c Fri Mar 11 23:36:19 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,31 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Primus.c,v 2.1 1993/09/21 15:20:41 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x3CE, 0x3CF, 0x3D6, 0x3D7}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor Primus_Descriptor = { --- 21,31 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Primus.c,v 2.3 1994/02/28 14:09:45 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {GRC_IDX, GRC_REG, 0x3D6, 0x3D7}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor Primus_Descriptor = { *************** *** 35,54 **** NUMPORTS, FALSE, FALSE, ! TRUE }; - #ifdef __STDC__ - Bool Probe_Primus(int *Chipset) - #else Bool Probe_Primus(Chipset) int *Chipset; - #endif { Bool result = FALSE; EnableIOPorts(NUMPORTS, Ports); ! if (testinx2(0x3CE, 0x3D, 0x3F) && tstrg(0x3D6, 0x1F) && tstrg(0x3D7, 0x1F)) { --- 35,52 ---- NUMPORTS, FALSE, FALSE, ! TRUE, ! NULL, }; Bool Probe_Primus(Chipset) int *Chipset; { Bool result = FALSE; EnableIOPorts(NUMPORTS, Ports); ! ! if (testinx2(GRC_IDX, 0x3D, 0x3F) && tstrg(0x3D6, 0x1F) && tstrg(0x3D7, 0x1F)) { *************** *** 55,60 **** --- 53,59 ---- result = TRUE; *Chipset = CHIP_P2000; } + DisableIOPorts(NUMPORTS, Ports); return(result); } diff -c mit/server/ddx/x386/SuperProbe/Print.c:2.9 mit/server/ddx/x386/SuperProbe/Print.c:2.14 *** mit/server/ddx/x386/SuperProbe/Print.c:2.9 Fri Mar 11 23:36:20 1994 --- mit/server/ddx/x386/SuperProbe/Print.c Fri Mar 11 23:36:20 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,46 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Print.c,v 2.9 1993/10/07 13:54:49 dawes Exp $ */ #include "Probe.h" - #ifdef __STDC__ - # define CONST const - #else - # define CONST - #endif - static CONST char *SVGA_Names[NUM_VENDORS+1][CHPS_PER_VENDOR] = { /* dummy */ { "" }, - /* AcuMos */ { "AcuMos AVGA2" }, /* Ahead */ { "Ahead (chipset unknown)", "Ahead V5000 Version A", "Ahead V5000 Version B" }, /* ATI */ { "ATI (chipset unknown)", "ATI 18800", "ATI 18800-1", "ATI 28800-2", "ATI 28800-4", "ATI 28800-5", ! "ATI 28800-A", "ATI 28800-C" }, /* AL */ { "Avance Logic 2101" }, /* CT */ { "Chips & Tech (chipset unknown)", "Chips & Tech 82c450", "Chips & Tech 82c451", --- 21,40 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Print.c,v 2.14 1994/02/28 14:09:47 dawes Exp $ */ #include "Probe.h" static CONST char *SVGA_Names[NUM_VENDORS+1][CHPS_PER_VENDOR] = { /* dummy */ { "" }, /* Ahead */ { "Ahead (chipset unknown)", "Ahead V5000 Version A", "Ahead V5000 Version B" }, /* ATI */ { "ATI (chipset unknown)", "ATI 18800", "ATI 18800-1", "ATI 28800-2", "ATI 28800-4", "ATI 28800-5", ! "ATI 68800-3", "ATI 68800-6", ! "ATI 68800-LX", "ATI 68800-AX" }, /* AL */ { "Avance Logic 2101" }, /* CT */ { "Chips & Tech (chipset unknown)", "Chips & Tech 82c450", "Chips & Tech 82c451", *************** *** 51,99 **** /* Cirrus */ { "Cirrus (chipset unknown)", "Cirrus CL-GD 510/520", "Cirrus CL-GD 610/620", "Cirrus Video7 OEM", "Cirrus CL-GD5402", "Cirrus CL-GD5402 Rev 1", "Cirrus CL-GD5420", "Cirrus CL-GD5420 Rev 1", "Cirrus CL-GD5422", "Cirrus CL-GD5424", "Cirrus CL-GD5426", "Cirrus CL-GD5428", "Cirrus CL-GD6205", "Cirrus CL-GD6215", "Cirrus CL-GD6225", "Cirrus CL-GD6235", ! "Cirrus CL-GD6410", ! "Cirrus CL-GD6420A", "Cirrus CL-GD6420B" }, /* Compaq */ { "Compaq (chipset unknown)", "Compaq Advanced VGA", ! "Compaq QVision/1024", "Compaq QVision/1280" }, /* Genoa */ { "Genoa GVGA 6100", "Genoa GVGA 6200/6300", "Genoa GVGA 6400/6600" }, ! /* MX */ { "MX 68010" }, /* NCR */ { "NCR (chipset unknown)", ! "NCR 77C21", "NCR 77C22", "NCR 77C22E", "NCR 77C22E+" }, /* Oak */ { "Oak (chipset unknown)", "Oak OTI037C", ! "Oak OTI-057", "Oak OTI-067", "Oak OTI-077" }, /* Primus */ { "Primus P2000" }, ! /* Realtek */ { "Realtek RT 3106" }, /* S3 */ { "S3 (chipset unknown)", "S3 86C911", "S3 86C924", "S3 86C801, A or B-step", ! "S3 86C801, C-step", "S3 86C801, D-step", "S3 86C805, A or B-step", "S3 86C805, C-step", "S3 86C805, D-step", "S3 86C928, A,B,C, or D-step", "S3 86C928, E-step", "S3 86C928PCI" }, /* Trident */ { "Trident (chipset unknown)", "Trident 8800BR", "Trident 8800CS", ! "Trident 8900B", "Trident 8900C", "Trident 8900CL", ! "Trident 9000", "Trident LCD9100", "Trident LX9200" }, ! /* Tseng */ { "Tseng ET3000", "Tseng ET4000", "Tseng ET4000/W32" }, /* Video7 */ { "Video7 (chipset unknown)", ! "Video7 VEGA", "Video7 FastWrite/VRAM", ! "Video7 VRAM II", "Video7 1024i" }, ! /* WD */ { "WD/Paradise PVGA1", "WD/Paradise 90C00", "WD/Paradise 90C10", "WD/Paradise 90C11", "WD/Paradise 90C20", "WD/Paradise 90C20A", "WD/Paradise 90C22", "WD/Paradise 90C24", "WD/Paradise 90C26", ! "WD/Paradise 90C30", "WD/Paradise 90C31" }, /* Yamaha */ { "Yamaha 6388 VPDC" }, }; --- 45,119 ---- /* Cirrus */ { "Cirrus (chipset unknown)", "Cirrus CL-GD 510/520", "Cirrus CL-GD 610/620", "Cirrus Video7 OEM", + "Cirrus/AcuMos AVGA2", "Cirrus CL-GD5402", "Cirrus CL-GD5402 Rev 1", "Cirrus CL-GD5420", "Cirrus CL-GD5420 Rev 1", "Cirrus CL-GD5422", "Cirrus CL-GD5424", "Cirrus CL-GD5426", "Cirrus CL-GD5428", + "Cirrus CL-GD543x", "Cirrus CL-GD6205", "Cirrus CL-GD6215", "Cirrus CL-GD6225", "Cirrus CL-GD6235", ! "Cirrus CL-GD5410", ! "Cirrus CL-GD6410", "Cirrus CL-GD6412", ! "Cirrus CL-GD6420A", "Cirrus CL-GD6420B" ! "Cirrus CL-GD6440" }, /* Compaq */ { "Compaq (chipset unknown)", + "Compaq Int. Vid. Graphics Sys.", "Compaq Advanced VGA", ! "Compaq QVision/1024", "Compaq QVision/1280", ! "Compaq Advanced VGA, Portable" }, /* Genoa */ { "Genoa GVGA 6100", "Genoa GVGA 6200/6300", "Genoa GVGA 6400/6600" }, ! /* HMC */ { "HMC HM86304" }, ! /* MX */ { "MX 68000", "MX 68010" }, /* NCR */ { "NCR (chipset unknown)", ! "NCR 77C21", "NCR 77C22", "NCR 77C22E", "NCR 77C22E+", ! "NCR 77C32BLT" }, /* Oak */ { "Oak (chipset unknown)", "Oak OTI037C", ! "Oak OTI-057", "Oak OTI-067", "Oak OTI-077", ! "Oak OTI-083", "Oak OTI-087" }, /* Primus */ { "Primus P2000" }, ! /* Realtek */ { "Realtek (chipset unknown)", ! "Realtek RT-3103", "Realtek RT-3105", "Realtek RT-3106" }, /* S3 */ { "S3 (chipset unknown)", "S3 86C911", "S3 86C924", "S3 86C801, A or B-step", ! "S3 86C801, C-step", "S3 86C801, D-step", ! "S3 86C801i", "S3 86C805, A or B-step", "S3 86C805, C-step", "S3 86C805, D-step", + "S3 86C805i", "S3 86C928, A,B,C, or D-step", "S3 86C928, E-step", "S3 86C928PCI" }, /* Trident */ { "Trident (chipset unknown)", + "Trident LX8200", "Trident 8800BR", "Trident 8800CS", ! "Trident 8900B", "Trident 8900C", "Trident 8900CL/8900D", ! "Trident 9000", "Trident 9000i", ! "Trident LCD9100B", "Trident 9200CXr", "Trident LCD9320", ! "Trident 9400CXi", "Trident GUI9420" }, ! /* Tseng */ { "Tseng (chipset unknown(", ! "Tseng ET3000", "Tseng ET4000", ! "Tseng ET4000/W32", ! "Tseng ET4000/W32i", "Tseng ET4000/W32p" }, ! /* UMC */ { "UMC 85c408" }, /* Video7 */ { "Video7 (chipset unknown)", ! "Video7 FastWrite/VRAM (HT208)", "Video7 1024i (HT208A)", ! "Video7 VRAM II (HT208B)", "Video7 VRAM II (HT208C,D)", ! "Video7 HT216B,C", "Video7 HT216D", ! "Video7 HT216E", "Video7 HT216E", ! "Video7 VEGA" }, ! /* WD */ { "WD/Paradise (chipset unknown)", ! "WD/Paradise PVGA1", "WD/Paradise 90C00", "WD/Paradise 90C10", "WD/Paradise 90C11", "WD/Paradise 90C20", "WD/Paradise 90C20A", "WD/Paradise 90C22", "WD/Paradise 90C24", "WD/Paradise 90C26", ! "WD/Paradise 90C30", "WD/Paradise 90C31", ! "WD/Paradise 90C33" }, ! /* Weitek */ { "Weitek (chipset unknown)", ! "Weitek 5086", "Weitek 5186", "Weitek 5286" }, /* Yamaha */ { "Yamaha 6388 VPDC" }, }; *************** *** 105,127 **** "InColor", }; ! static CONST char *RamDac_Names[] = { ! "Generic 8-bit pseudo-color", ! "Avance Logc ALG1101", ! "Diamond SS2410", ! "Sierra 15-bit HiColor", ! "Sierra 15/16-bit HiColor", ! "AcuMos ADAC1 15/16/24-bit DAC", ! "ATI 68830/75 15/16/24-bit DAC", ! "Cirrus Logic Built-in 8-bit pseudo-color DAC", ! "Cirrus Logic Built-in 15/16/24-bit DAC", ! "AT&T 20C490 15/16/24-bit DAC", ! "AT&T 20C491 15/16/24-bit DAC with gamma correction", ! "AT&T 20C492 15/16/18-bit DAC with gamma correction", ! "AT&T 20C493 15/16/18-bit DAC", ! "AT&T 20C497 24-bit wide, 8-bit pseudo-color DAC", ! "BrookTree Bt485 24-bit TrueColor DAC w/cursor,pixel-interleave" }; static CONST char *CoProc_Names[NUM_CP_TYPES][CHPS_PER_CPTYPE] = --- 125,162 ---- "InColor", }; ! struct RamDac_Name RamDac_Names[] = { ! { "Unknown", "Non-standard but unknown DAC" }, ! { "Generic", "Generic 8-bit pseudo-color DAC" }, ! { "ALG1101", "Avance Logc ALG1101" }, ! { "SS2410", "Diamond SS2410 15/16/24-bit DAC" }, ! { "Sierra15", "Sierra SC1148{1,6,8} 15-bit HiColor DAC" }, ! { "Sierra16", ! "Sierra SC1148{2,3,4} 15-bit or SC1148{5,7,9} 15/16-bit HiColor" }, ! { "Sierra24", "Sierra 1502{5,6} 15/16/24-bit DAC" }, ! { "MU9C4870", "MUSIC MU9C4870 15/16-bit HiColor DAC" }, ! { "MU9C4910", "MUSIC MU9C4910 15/16/24-bit DAC" }, ! { "ADAC1", "AcuMos ADAC1 15/16/24-bit DAC" }, ! { "68830", "ATI 68830 15/16-bit HiColor DAC" }, ! { "68860", "ATI 68860 15/15/24-bit DAC w/pixel-mux" }, ! { "68875", "ATI-68875/Bt885/TLC34075 15/16/24-bit DAC w/pixel-mux" }, ! { "ATIMisc", ! "ATI Misc 3rd-party {AT&T, BT, Sierra} 15/16/24-bit DAC" }, ! { "Cirrus8", "Cirrus Logic Built-in 8-bit pseudo-color DAC" }, ! { "Cirrus24B", "Cirrus Logic Built-in 15/16/24-bit DAC" }, ! { "Cirrus24", "Cirrus Logic 15/16/24-bit DAC" }, ! { "20C490", "AT&T 20C490 15/16/24-bit DAC" }, ! { "20C491", "AT&T 20C491 15/16/24-bit DAC with gamma correction" }, ! { "20C492", "AT&T 20C492 15/16/18-bit DAC with gamma correction" }, ! { "20C493", "AT&T 20C493 15/16/18-bit DAC" }, ! { "20C497", "AT&T 20C497 24-bit wide, 8-bit pseudo-color DAC" }, ! { "Bt485", "BrookTree Bt485 24-bit TrueColor DAC w/cursor,pixel-mux" }, ! { "20C504", "AT&T 20C504 24-bit TrueColor DAC w/cursor,pixel-mux" }, ! { "20C505", "AT&T 20C505 24-bit TrueColor DAC w/cursor,pixel-mux" }, ! { "TVP3020", ! "TI ViewPoint3020 24-bit TrueColor DAC w/cursor,pixel-mux" }, ! { "EDSUN", "EDSUN CEG DAC" }, }; static CONST char *CoProc_Names[NUM_CP_TYPES][CHPS_PER_CPTYPE] = *************** *** 128,142 **** { /* 8514 */ { "8514/A (or true clone)", "ATI Mach-8", "ATI Mach-32", ! "Chips & Technologies 82C480" }, }; - #ifdef __STDC__ - void Print_SVGA_Name(int Chipset) - #else void Print_SVGA_Name(Chipset) int Chipset; - #endif { int vendor = SVGA_VENDOR(Chipset); int chip = SVGA_CHIP(Chipset); --- 163,173 ---- { /* 8514 */ { "8514/A (or true clone)", "ATI Mach-8", "ATI Mach-32", ! "Chips & Technologies 82C480 (8514/A clone)" }, }; void Print_SVGA_Name(Chipset) int Chipset; { int vendor = SVGA_VENDOR(Chipset); int chip = SVGA_CHIP(Chipset); *************** *** 148,172 **** } } - #ifdef __STDC__ - void Print_Herc_Name(int Chipset) - #else void Print_Herc_Name(Chipset) int Chipset; - #endif { int chip = HERC_CHIP(Chipset); printf("\tChipset: %s\n", Herc_Names[chip]); } - #ifdef __STDC__ - void Print_RamDac_Name(int RamDac) - #else void Print_RamDac_Name(RamDac) int RamDac; - #endif { ! printf("\tRAMDAC: %s\n", RamDac_Names[DAC_CHIP(RamDac)]); if (RamDac & DAC_8BIT) { printf("\t\t (with 8-bit wide lookup tables)\n"); --- 179,195 ---- } } void Print_Herc_Name(Chipset) int Chipset; { int chip = HERC_CHIP(Chipset); printf("\tChipset: %s\n", Herc_Names[chip]); } void Print_RamDac_Name(RamDac) int RamDac; { ! printf("\tRAMDAC: %s\n", RamDac_Names[DAC_CHIP(RamDac)].Long); if (RamDac & DAC_8BIT) { printf("\t\t (with 8-bit wide lookup tables)\n"); *************** *** 182,193 **** } } - #ifdef __STDC__ - void Print_CoProc_Name(int CoProc) - #else void Print_CoProc_Name(CoProc) int CoProc; - #endif { int class = COPROC_CLASS(CoProc); int chip = COPROC_CHIP(CoProc); --- 205,212 ---- diff -c mit/server/ddx/x386/SuperProbe/Probe.h:2.9 mit/server/ddx/x386/SuperProbe/Probe.h:2.14 *** mit/server/ddx/x386/SuperProbe/Probe.h:2.9 Fri Mar 11 23:36:21 1994 --- mit/server/ddx/x386/SuperProbe/Probe.h Fri Mar 11 23:36:21 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Probe.h,v 2.9 1993/10/07 13:54:50 dawes Exp $ */ /* * Includes --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Probe.h,v 2.14 1994/02/28 14:09:49 dawes Exp $ */ /* * Includes *************** *** 51,56 **** --- 51,64 ---- #endif /* _MINIX */ #endif + #ifdef __STDC__ + # define CONST const + # define __STDCARGS(a) a + #else + # define CONST + # define __STDCARGS(a) () + #endif + /* * Types */ *************** *** 60,72 **** typedef int Bool; #define FALSE 0 #define TRUE 1 typedef struct { Word lo, hi; } Range; ! typedef Bool (*ProbeFunc)(int *); typedef struct { char *name; /* Chipset vendor/class name */ ProbeFunc f; /* Probe function */ Word *ports; /* List of ports used by probe */ --- 68,94 ---- typedef int Bool; #define FALSE 0 #define TRUE 1 + #ifndef NULL + # define NULL (void *)0 + #endif + typedef struct { Word lo, hi; } Range; ! typedef Bool (*ProbeFunc) __STDCARGS((int *)); ! typedef int (*MemCheckFunc) __STDCARGS((int)); ! typedef void (*SetBank) __STDCARGS((int, int, int)); ! typedef void (*GetBank) __STDCARGS((int, int *, int *)); typedef struct { + int chipset; /* Chipset for bank operations */ + SetBank set_bank; /* Set a read/write bank */ + GetBank get_bank; /* Get the current bank number */ + int bank_size; /* Size of a memory bank */ + int max_bank; /* Maximum bank number */ + } MemCheck_Descriptor; + typedef struct { char *name; /* Chipset vendor/class name */ ProbeFunc f; /* Probe function */ Word *ports; /* List of ports used by probe */ *************** *** 74,79 **** --- 96,102 ---- Bool bit16; /* Does probe use 16-bit ports? */ Bool uses_bios; /* Does probe read the BIOS? */ Bool check_coproc; /* Check for attached coprocessor */ + MemCheckFunc memcheck; /* For doing memory check */ } Chip_Descriptor; /* *************** *** 81,218 **** */ /* OS_xxxx.c */ ! #ifdef __STDC__ ! int OpenVideo(void); ! void CloseVideo(void); ! int ReadBIOS(const unsigned, Byte *, const int); ! int EnableIOPorts(const int, const Word *); ! int DisableIOPorts(const int, const Word *); ! void ShortSleep(const int Delay); ! #else /* __STDC__ */ ! int OpenVideo(); ! void CloseVideo(); ! int ReadBIOS(); ! int EnableIOPorts(); ! int DisableIOPorts(); ! void ShortSleep(); ! #endif /* __STDC__ */ /* Utils.c */ ! #ifdef __STDC__ ! Byte inp(Word); ! Word inpw(Word); ! void outp(Word, Byte); ! void outpw(Word, Word); ! Byte rdinx(Word, Byte); ! void wrinx(Word, Byte, Byte); ! void modinx(Word, Byte, Byte, Byte); ! Bool tstrg(Word, Byte); ! Bool testinx2(Word, Byte, Byte); ! Bool testinx(Word, Byte); ! void dactopel(void); ! Byte dactocomm(void); ! Bool Excluded(Range *, Chip_Descriptor *, Bool); ! int StrCaseCmp(char *, char *); ! unsigned int StrToUL(const char *); ! #else /* __STDC__ */ ! Byte inp(); ! Word inpw(); ! void outp(); ! void outpw(); ! Byte rdinx(); ! void wrinx(); ! void modinx(); ! Bool tstrg(); ! Bool testinx2(); ! Bool testinx(); ! void dactopel(); ! Byte dactocomm(); ! Bool Excluded(); ! int StrCaseCmp(); ! unsigned int StrToUL(); ! #endif /* __STDC__ */ /* * Ident functions */ ! #ifdef __STDC__ ! void Probe_RamDac(int, int *); ! Bool Probe_MDA(int *); ! Bool Probe_Herc(int *); ! Bool Probe_CGA(int *); ! Bool Probe_VGA(int *); ! /* SVGA */ ! Bool Probe_Tseng(int *); ! Bool Probe_WD(int *); ! Bool Probe_CT(int *); ! Bool Probe_Video7(int *); ! Bool Probe_Genoa(int *); ! Bool Probe_Trident(int *); ! Bool Probe_Oak(int *); ! Bool Probe_Cirrus(int *); ! Bool Probe_Ahead(int *); ! Bool Probe_ATI(int *); ! Bool Probe_S3(int *); ! Bool Probe_AL(int *); ! Bool Probe_Yamaha(int *); ! Bool Probe_NCR(int *); ! Bool Probe_AcuMos(int *); ! Bool Probe_MX(int *); ! Bool Probe_Primus(int *); ! Bool Probe_RealTek(int *); ! Bool Probe_Compaq(int *); ! /* CoProc */ ! Bool Probe_8514(int *); ! Bool Probe_ATIMach(int *); ! #else /* __STDC__ */ ! void Probe_RamDac(); ! Bool Probe_MDA(); ! Bool Probe_Herc(); ! Bool Probe_CGA(); ! Bool Probe_VGA(); /* SVGA */ ! Bool Probe_Tseng(); ! Bool Probe_WD(); ! Bool Probe_CT(); ! Bool Probe_Video7(); ! Bool Probe_Genoa(); ! Bool Probe_Trident(); ! Bool Probe_Oak(); ! Bool Probe_Cirrus(); ! Bool Probe_Ahead(); ! Bool Probe_ATI(); ! Bool Probe_S3(); ! Bool Probe_AL(); ! Bool Probe_Yamaha(); ! Bool Probe_NCR(); ! Bool Probe_AcuMos(); ! Bool Probe_MX(); ! Bool Probe_Primus(); ! Bool Probe_RealTek(); ! Bool Probe_Compaq(); /* CoProc */ ! Bool Probe_8514(); ! Bool Probe_ATIMach(); ! #endif /* __STDC__ */ /* * Print functions */ ! #ifdef __STDC__ ! void Print_SVGA_Name(int); ! void Print_Herc_Name(int); ! void Print_RamDac_Name(int); ! void Print_CoProc_Name(int); ! #else /* __STDC__ */ ! void Print_SVGA_Name(); ! void Print_Herc_Name(); ! void Print_RamDac_Name(); ! void Print_CoProc_Name(); ! #endif /* __STDC__ */ ! ! #ifndef __STDC__ ! #define const /**/ ! #endif /* * Globals --- 104,189 ---- */ /* OS_xxxx.c */ ! int OpenVideo __STDCARGS((void)); ! void CloseVideo __STDCARGS((void)); ! Byte *MapVGA __STDCARGS((void)); ! void UnMapVGA __STDCARGS((Byte *)); ! int ReadBIOS __STDCARGS((const unsigned, Byte *, const int)); ! int EnableIOPorts __STDCARGS((const int, const Word *)); ! int DisableIOPorts __STDCARGS((const int, const Word *)); ! void ShortSleep __STDCARGS((const int Delay)); /* Utils.c */ ! Byte inp __STDCARGS((Word)); ! Word inpw __STDCARGS((Word)); ! void outp __STDCARGS((Word, Byte)); ! void outpw __STDCARGS((Word, Word)); ! Byte rdinx __STDCARGS((Word, Byte)); ! void wrinx __STDCARGS((Word, Byte, Byte)); ! void wrinx2 __STDCARGS((Word, Byte, Word)); ! void wrinx3 __STDCARGS((Word, Byte, Long)); ! void wrinx2m __STDCARGS((Word, Byte, Word)); ! void wrinx3m __STDCARGS((Word, Byte, Long)); ! void modinx __STDCARGS((Word, Byte, Byte, Byte)); ! void modreg __STDCARGS((Word, Byte, Byte)); ! void setinx __STDCARGS((Word, Byte, Byte)); ! void clrinx __STDCARGS((Word, Byte, Byte)); ! Bool tstrg __STDCARGS((Word, Byte)); ! Bool testinx2 __STDCARGS((Word, Byte, Byte)); ! Bool testinx __STDCARGS((Word, Byte)); ! void dactopel __STDCARGS((void)); ! Byte trigdac __STDCARGS((void)); ! Byte dactocomm __STDCARGS((void)); ! Byte getdaccomm __STDCARGS((void)); ! void waitforretrace __STDCARGS((void)); ! Bool Excluded __STDCARGS((Range *, Chip_Descriptor *, Bool)); ! int StrCaseCmp __STDCARGS((char *, char *)); ! unsigned int StrToUL __STDCARGS((const char *)); /* * Ident functions */ ! int Probe_Mem __STDCARGS((MemCheck_Descriptor)); ! void Probe_RamDac __STDCARGS((int, int *)); ! Bool Probe_MDA __STDCARGS((int *)); ! Bool Probe_Herc __STDCARGS((int *)); ! Bool Probe_CGA __STDCARGS((int *)); ! Bool Probe_VGA __STDCARGS((int *)); /* SVGA */ ! Bool Probe_Tseng __STDCARGS((int *)); ! Bool Probe_WD __STDCARGS((int *)); ! Bool Probe_CT __STDCARGS((int *)); ! Bool Probe_Video7 __STDCARGS((int *)); ! Bool Probe_Genoa __STDCARGS((int *)); ! Bool Probe_Trident __STDCARGS((int *)); ! Bool Probe_Oak __STDCARGS((int *)); ! Bool Probe_Cirrus __STDCARGS((int *)); ! Bool Probe_Cirrus54 __STDCARGS((int *)); ! Bool Probe_Cirrus64 __STDCARGS((int *)); ! Bool Probe_Ahead __STDCARGS((int *)); ! Bool Probe_ATI __STDCARGS((int *)); ! Bool Probe_S3 __STDCARGS((int *)); ! Bool Probe_AL __STDCARGS((int *)); ! Bool Probe_Yamaha __STDCARGS((int *)); ! Bool Probe_NCR __STDCARGS((int *)); ! Bool Probe_MX __STDCARGS((int *)); ! Bool Probe_Primus __STDCARGS((int *)); ! Bool Probe_RealTek __STDCARGS((int *)); ! Bool Probe_Compaq __STDCARGS((int *)); ! Bool Probe_HMC __STDCARGS((int *)); ! Bool Probe_UMC __STDCARGS((int *)); ! Bool Probe_Weitek __STDCARGS((int *)); /* CoProc */ ! Bool Probe_8514 __STDCARGS((int *)); ! Bool Probe_ATIMach __STDCARGS((int *)); /* * Print functions */ ! void Print_SVGA_Name __STDCARGS((int)); ! void Print_Herc_Name __STDCARGS((int)); ! void Print_RamDac_Name __STDCARGS((int)); ! void Print_CoProc_Name __STDCARGS((int)); /* * Globals *************** *** 228,239 **** extern Chip_Descriptor AL_Descriptor; extern Chip_Descriptor ATI_Descriptor; - extern Chip_Descriptor AcuMos_Descriptor; extern Chip_Descriptor Ahead_Descriptor; extern Chip_Descriptor CT_Descriptor; extern Chip_Descriptor Cirrus_Descriptor; extern Chip_Descriptor Compaq_Descriptor; extern Chip_Descriptor Genoa_Descriptor; extern Chip_Descriptor MX_Descriptor; extern Chip_Descriptor NCR_Descriptor; extern Chip_Descriptor Oak_Descriptor; --- 199,212 ---- extern Chip_Descriptor AL_Descriptor; extern Chip_Descriptor ATI_Descriptor; extern Chip_Descriptor Ahead_Descriptor; extern Chip_Descriptor CT_Descriptor; extern Chip_Descriptor Cirrus_Descriptor; + extern Chip_Descriptor Cirrus54_Descriptor; + extern Chip_Descriptor Cirrus64_Descriptor; extern Chip_Descriptor Compaq_Descriptor; extern Chip_Descriptor Genoa_Descriptor; + extern Chip_Descriptor HMC_Descriptor; extern Chip_Descriptor MX_Descriptor; extern Chip_Descriptor NCR_Descriptor; extern Chip_Descriptor Oak_Descriptor; *************** *** 242,249 **** --- 215,224 ---- extern Chip_Descriptor S3_Descriptor; extern Chip_Descriptor Trident_Descriptor; extern Chip_Descriptor Tseng_Descriptor; + extern Chip_Descriptor UMC_Descriptor; extern Chip_Descriptor Video7_Descriptor; extern Chip_Descriptor WD_Descriptor; + extern Chip_Descriptor Weitek_Descriptor; extern Chip_Descriptor Yamaha_Descriptor; extern Chip_Descriptor IBM8514_Descriptor; *************** *** 256,263 **** --- 231,251 ---- #define COPYRIGHT_BASE (0x1E) #define CRTC_IDX (vgaIOBase+0x04) #define CRTC_REG (vgaIOBase+0x05) + #define GRC_IDX (0x3CE) + #define GRC_REG (0x3CF) + #define SEQ_IDX (0x3C4) + #define SEQ_REG (0x3C5) + #define ATR_IDX (0x3C0) + #define ATR_REG_W (0x3C0) + #define ATR_REG_R (0x3C1) + #define MISC_OUT_W (0x3C2) + #define MISC_OUT_R (0x3CC) /* 8514 */ + #define CONFIG_STATUS_1 0x12EE + #define MISC_OPTIONS 0x36EE + #define CHIP_ID 0xFAEE #define SUBSYS_CNTL 0x42E8 + #define EXT_CONF_3 0x5EE8 #define ERR_TERM 0x92E8 #define GPCTRL_ENAB 0x4000 #define GPCTRL_RESET 0x8000 *************** *** 271,291 **** /* * RAMDAC Types */ ! #define DAC_STANDARD 0 /* Standard 8-bit pseudo-color DAC */ ! #define DAC_ALG1101 1 /* Avance Logic ALG1101 */ ! #define DAC_SS24 2 /* Diamond SS2410 */ ! #define DAC_SIERRA15 3 /* Sierra 15-bit HiColor */ ! #define DAC_SIERRA15_16 4 /* Sierra 15/16-bit HiColor */ ! #define DAC_ACUMOS 5 /* AcuMos ADAC1 15/16/24-bit DAC */ ! #define DAC_ATI 6 /* ATI 68830/75 15/16/24-bit DAC */ ! #define DAC_CIRRUSA 7 /* Cirrus 5420 8-bit pseudo-color DAC */ ! #define DAC_CIRRUSB 8 /* Cirrus 542{2,4,6} 15/16/24-bit DAC */ ! #define DAC_ATT490 9 /* AT&T 20C490 15/16/24-bit DAC */ ! #define DAC_ATT491 10 /* AT&T 20C491 15/16/24-bit DAC w/gamma corr */ ! #define DAC_ATT492 11 /* AT&T 20C492 15/16/18-bit DAC w/gamma corr */ ! #define DAC_ATT493 12 /* AT&T 20C493 15/16/18-bit DAC */ ! #define DAC_ATT497 13 /* AT&T 20C497 8-bit PseudoColor,24-bit wide */ ! #define DAC_BT485 14 /* BrookTree 485 RAMDAC */ #define DAC_6_8_PROGRAM 0x40 /* RAMDAC programmable for 6/8-bit tables */ #define DAC_8BIT 0x80 /* RAMDAC with 8-bit wide lookup tables */ --- 259,293 ---- /* * RAMDAC Types */ ! #define DAC_UNKNOWN 0 /* Non-standard, but unknown */ ! #define DAC_STANDARD 1 /* Standard 8-bit pseudo-color DAC */ ! #define DAC_ALG1101 2 /* Avance Logic ALG1101 */ ! #define DAC_SS24 3 /* Diamond SS2410 */ ! #define DAC_SIERRA15 4 /* Sierra 15-bit HiColor */ ! #define DAC_SIERRA15_16 5 /* Sierra 15/16-bit HiColor */ ! #define DAC_SIERRA24 6 /* Sierra 15/16/24-bit DAC */ ! #define DAC_MUSIC4870 7 /* MUSIC 15/16-bit HiColor DAC */ ! #define DAC_MUSIC4910 8 /* MUSIC 15/16/24-bit DAC */ ! #define DAC_ACUMOS 9 /* AcuMos ADAC1 15/16/24-bit DAC */ ! #define DAC_ATI68830 10 /* ATI 68830 15/16-bit DAC */ ! #define DAC_ATI68860 11 /* ATI 68860 15/16/24-bit DAC, mux */ ! #define DAC_ATI68875 12 /* ATI 68875 15/16/24-bit DAC, mux */ ! #define DAC_ATIMISC24 13 /* ATI Miscellaneous 3'rd party DACs */ ! #define DAC_CIRRUSA 14 /* Cirrus 5420 8-bit pseudo-color DAC */ ! #define DAC_CIRRUSB 15 /* Cirrus 542{2,4,6,8} 15/16/24-bit DAC */ ! #define DAC_CIRRUS24 16 /* Cirrus 15/16/24-bit separate DAC */ ! #define DAC_ATT490 17 /* AT&T 20C490 15/16/24-bit DAC */ ! #define DAC_ATT491 18 /* AT&T 20C491 15/16/24-bit DAC w/gamma corr */ ! #define DAC_ATT492 19 /* AT&T 20C492 15/16/18-bit DAC w/gamma corr */ ! #define DAC_ATT493 20 /* AT&T 20C493 15/16/18-bit DAC */ ! #define DAC_ATT497 21 /* AT&T 20C497 8-bit PseudoColor,24-bit wide */ ! #define DAC_BT485 22 /* BrookTree 485 RAMDAC */ ! #define DAC_ATT504 23 /* AT&T 20C504 (Bt484 clone, I think) */ ! #define DAC_ATT505 24 /* AT&T 20C505 (Bt485 clone) */ ! #define DAC_TVP3020 25 /* TI ViewPoint TVP3020 RAMDAC */ ! #define DAC_EDSUN 26 /* EDSUN CEG DAC */ ! ! #define DAC_MAX DAC_EDSUN /* UPDATE THIS! */ #define DAC_6_8_PROGRAM 0x40 /* RAMDAC programmable for 6/8-bit tables */ #define DAC_8BIT 0x80 /* RAMDAC with 8-bit wide lookup tables */ *************** *** 294,299 **** --- 296,311 ---- /* + * RAMDAC names + */ + + struct RamDac_Name { + CONST char *Short; + CONST char *Long; + }; + extern struct RamDac_Name RamDac_Names[]; + + /* * Base chipset classes */ #define CHIP_MDA 0 /* Monochrome Display Adapter */ *************** *** 316,329 **** * SVGA cards */ #define SVGA_TYPE(v,n) (((v) << 16) | ((n) << 8) | CHIP_VGA) ! #define V_ACUMOS 1 ! #define V_AHEAD 2 ! #define V_ATI 3 ! #define V_AL 4 ! #define V_CT 5 ! #define V_CIRRUS 6 ! #define V_COMPAQ 7 ! #define V_GENOA 8 #define V_MX 9 #define V_NCR 10 #define V_OAK 11 --- 328,341 ---- * SVGA cards */ #define SVGA_TYPE(v,n) (((v) << 16) | ((n) << 8) | CHIP_VGA) ! #define V_AHEAD 1 ! #define V_ATI 2 ! #define V_AL 3 ! #define V_CT 4 ! #define V_CIRRUS 5 ! #define V_COMPAQ 6 ! #define V_GENOA 7 ! #define V_HMC 8 #define V_MX 9 #define V_NCR 10 #define V_OAK 11 *************** *** 332,345 **** #define V_S3 14 #define V_TRIDENT 15 #define V_TSENG 16 ! #define V_VIDEO7 17 ! #define V_WD 18 ! #define V_YAMAHA 19 ! #define NUM_VENDORS 19 ! #define CHPS_PER_VENDOR 20 - #define CHIP_ACUMOS SVGA_TYPE(V_ACUMOS,0) /* AcuMos AVGA2 */ #define CHIP_AHEAD_UNK SVGA_TYPE(V_AHEAD,0) /* Ahead unknown */ #define CHIP_AHEAD_A SVGA_TYPE(V_AHEAD,1) /* Ahead V5000 Version A*/ #define CHIP_AHEAD_B SVGA_TYPE(V_AHEAD,2) /* Ahead V5000 Version B*/ --- 344,358 ---- #define V_S3 14 #define V_TRIDENT 15 #define V_TSENG 16 ! #define V_UMC 17 ! #define V_VIDEO7 18 ! #define V_WD 19 ! #define V_WEITEK 20 ! #define V_YAMAHA 21 ! #define NUM_VENDORS 21 ! #define CHPS_PER_VENDOR 25 #define CHIP_AHEAD_UNK SVGA_TYPE(V_AHEAD,0) /* Ahead unknown */ #define CHIP_AHEAD_A SVGA_TYPE(V_AHEAD,1) /* Ahead V5000 Version A*/ #define CHIP_AHEAD_B SVGA_TYPE(V_AHEAD,2) /* Ahead V5000 Version B*/ *************** *** 349,356 **** #define CHIP_ATI28800_2 SVGA_TYPE(V_ATI,3) /* ATI 28800-2 */ #define CHIP_ATI28800_4 SVGA_TYPE(V_ATI,4) /* ATI 28800-4 */ #define CHIP_ATI28800_5 SVGA_TYPE(V_ATI,5) /* ATI 28800-5 */ ! #define CHIP_ATI28800_A SVGA_TYPE(V_ATI,6) /* ATI 28800-A */ ! #define CHIP_ATI28800_C SVGA_TYPE(V_ATI,7) /* ATI 28800-C (XLR?) */ #define CHIP_AL2101 SVGA_TYPE(V_AL,0) /* Avance Logic 2101 */ #define CHIP_CT_UNKNOWN SVGA_TYPE(V_CT,0) /* C&T unknown */ #define CHIP_CT450 SVGA_TYPE(V_CT,1) /* C&T 82c450 */ --- 362,371 ---- #define CHIP_ATI28800_2 SVGA_TYPE(V_ATI,3) /* ATI 28800-2 */ #define CHIP_ATI28800_4 SVGA_TYPE(V_ATI,4) /* ATI 28800-4 */ #define CHIP_ATI28800_5 SVGA_TYPE(V_ATI,5) /* ATI 28800-5 */ ! #define CHIP_ATI68800_3 SVGA_TYPE(V_ATI,6) /* ATI 68800-3 */ ! #define CHIP_ATI68800_6 SVGA_TYPE(V_ATI,7) /* ATI 68800-6 */ ! #define CHIP_ATI68800LX SVGA_TYPE(V_ATI,8) /* ATI 68800-LX */ ! #define CHIP_ATI68800AX SVGA_TYPE(V_ATI,9) /* ATI 68800-AX */ #define CHIP_AL2101 SVGA_TYPE(V_AL,0) /* Avance Logic 2101 */ #define CHIP_CT_UNKNOWN SVGA_TYPE(V_CT,0) /* C&T unknown */ #define CHIP_CT450 SVGA_TYPE(V_CT,1) /* C&T 82c450 */ *************** *** 367,407 **** #define CHIP_CL510 SVGA_TYPE(V_CIRRUS,1) /* Cirrus CL-GD 510/520 */ #define CHIP_CL610 SVGA_TYPE(V_CIRRUS,2) /* Cirrus CL-GD 610/620 */ #define CHIP_CLV7 SVGA_TYPE(V_CIRRUS,3) /* Cirrus Video 7 OEM */ ! #define CHIP_CL5402 SVGA_TYPE(V_CIRRUS,4) /* Cirrus 5402 */ ! #define CHIP_CL5402R1 SVGA_TYPE(V_CIRRUS,5) /* Cirrus 5402 rev 1 */ ! #define CHIP_CL5420 SVGA_TYPE(V_CIRRUS,6) /* Cirrus 5420 */ ! #define CHIP_CL5420R1 SVGA_TYPE(V_CIRRUS,7) /* Cirrus 5420 rev 1 */ ! #define CHIP_CL5422 SVGA_TYPE(V_CIRRUS,8) /* Cirrus 5422 */ ! #define CHIP_CL5424 SVGA_TYPE(V_CIRRUS,9) /* Cirrus 5424 */ ! #define CHIP_CL5426 SVGA_TYPE(V_CIRRUS,10) /* Cirrus 5426 */ ! #define CHIP_CL5428 SVGA_TYPE(V_CIRRUS,11) /* Cirrus 5428 */ ! #define CHIP_CL6205 SVGA_TYPE(V_CIRRUS,12) /* Cirrus 6205 */ ! #define CHIP_CL6215 SVGA_TYPE(V_CIRRUS,13) /* Cirrus 6215 */ ! #define CHIP_CL6225 SVGA_TYPE(V_CIRRUS,14) /* Cirrus 6225 */ ! #define CHIP_CL6235 SVGA_TYPE(V_CIRRUS,15) /* Cirrus 6235 */ ! #define CHIP_CL6410 SVGA_TYPE(V_CIRRUS,16) /* Cirrus 6410 */ ! #define CHIP_CL6420A SVGA_TYPE(V_CIRRUS,17) /* Cirrus 6420A */ ! #define CHIP_CL6420B SVGA_TYPE(V_CIRRUS,18) /* Cirrus 6420B */ #define CHIP_CPQ_UNK SVGA_TYPE(V_COMPAQ,0) /* Compaq unknown */ ! #define CHIP_CPQ_AVGA SVGA_TYPE(V_COMPAQ,1) /* Compaq Advanced VGA */ ! #define CHIP_CPQ_Q1024 SVGA_TYPE(V_COMPAQ,2) /* Compaq QVision/1024 */ ! #define CHIP_CPQ_Q1280 SVGA_TYPE(V_COMPAQ,3) /* Compaq QVision/1280 */ #define CHIP_G_6100 SVGA_TYPE(V_GENOA,0) /* Genoa GVGA 6100 */ #define CHIP_G_6200 SVGA_TYPE(V_GENOA,1) /* Genoa GVGA 6200 */ #define CHIP_G_6400 SVGA_TYPE(V_GENOA,2) /* Genoa GVGA 6400 */ ! #define CHIP_MX68010 SVGA_TYPE(V_MX,0) /* MX 68010 */ #define CHIP_NCR_UNK SVGA_TYPE(V_NCR,0) /* NCR unknown */ #define CHIP_NCR77C21 SVGA_TYPE(V_NCR,1) /* NCR 77C21 */ #define CHIP_NCR77C22 SVGA_TYPE(V_NCR,2) /* NCR 77C22 */ #define CHIP_NCR77C22E SVGA_TYPE(V_NCR,3) /* NCR 77C22E */ #define CHIP_NCR77C22EP SVGA_TYPE(V_NCR,4) /* NCR 77C22E+ */ #define CHIP_OAK_UNK SVGA_TYPE(V_OAK,0) /* OAK unknown */ #define CHIP_OAK037C SVGA_TYPE(V_OAK,1) /* OAK OTI037C */ #define CHIP_OAK057 SVGA_TYPE(V_OAK,2) /* OAK OTI-057 */ #define CHIP_OAK067 SVGA_TYPE(V_OAK,3) /* OAK OTI-067 */ #define CHIP_OAK077 SVGA_TYPE(V_OAK,4) /* OAK OTI-077 */ #define CHIP_P2000 SVGA_TYPE(V_PRIMUS,0) /* Primus P2000 */ ! #define CHIP_REALTEK SVGA_TYPE(V_REALTEK,0) /* Realtek RT 3106 */ #define CHIP_S3_UNKNOWN SVGA_TYPE(V_S3,0) /* S3 unknown */ #define CHIP_S3_911 SVGA_TYPE(V_S3,1) /* S3 86c911 */ #define CHIP_S3_924 SVGA_TYPE(V_S3,2) /* S3 86c924 or 911A */ --- 382,437 ---- #define CHIP_CL510 SVGA_TYPE(V_CIRRUS,1) /* Cirrus CL-GD 510/520 */ #define CHIP_CL610 SVGA_TYPE(V_CIRRUS,2) /* Cirrus CL-GD 610/620 */ #define CHIP_CLV7 SVGA_TYPE(V_CIRRUS,3) /* Cirrus Video 7 OEM */ ! #define CHIP_CLAVGA2 SVGA_TYPE(V_CIRRUS,4) /* Cirrus/AcuMos AVGA2 */ ! #define CHIP_CL5402 SVGA_TYPE(V_CIRRUS,5) /* Cirrus 5402 */ ! #define CHIP_CL5402R1 SVGA_TYPE(V_CIRRUS,6) /* Cirrus 5402 rev 1 */ ! #define CHIP_CL5420 SVGA_TYPE(V_CIRRUS,7) /* Cirrus 5420 */ ! #define CHIP_CL5420R1 SVGA_TYPE(V_CIRRUS,8) /* Cirrus 5420 rev 1 */ ! #define CHIP_CL5422 SVGA_TYPE(V_CIRRUS,9) /* Cirrus 5422 */ ! #define CHIP_CL5424 SVGA_TYPE(V_CIRRUS,10) /* Cirrus 5424 */ ! #define CHIP_CL5426 SVGA_TYPE(V_CIRRUS,11) /* Cirrus 5426 */ ! #define CHIP_CL5428 SVGA_TYPE(V_CIRRUS,12) /* Cirrus 5428 */ ! #define CHIP_CL543X SVGA_TYPE(V_CIRRUS,13) /* Cirrus 543x */ ! #define CHIP_CL6205 SVGA_TYPE(V_CIRRUS,14) /* Cirrus 6205 */ ! #define CHIP_CL6215 SVGA_TYPE(V_CIRRUS,15) /* Cirrus 6215 */ ! #define CHIP_CL6225 SVGA_TYPE(V_CIRRUS,16) /* Cirrus 6225 */ ! #define CHIP_CL6235 SVGA_TYPE(V_CIRRUS,17) /* Cirrus 6235 */ ! #define CHIP_CL5410 SVGA_TYPE(V_CIRRUS,18) /* Cirrus 6510 */ ! #define CHIP_CL6410 SVGA_TYPE(V_CIRRUS,19) /* Cirrus 6410 */ ! #define CHIP_CL6412 SVGA_TYPE(V_CIRRUS,20) /* Cirrus 6412 */ ! #define CHIP_CL6420A SVGA_TYPE(V_CIRRUS,21) /* Cirrus 6420A */ ! #define CHIP_CL6420B SVGA_TYPE(V_CIRRUS,22) /* Cirrus 6420B */ ! #define CHIP_CL6440 SVGA_TYPE(V_CIRRUS,23) /* Cirrus 6440 */ #define CHIP_CPQ_UNK SVGA_TYPE(V_COMPAQ,0) /* Compaq unknown */ ! #define CHIP_CPQ_IVGS SVGA_TYPE(V_COMPAQ,1) /* Compaq Int Vid Gr Sys*/ ! #define CHIP_CPQ_AVGA SVGA_TYPE(V_COMPAQ,2) /* Compaq Advanced VGA */ ! #define CHIP_CPQ_Q1024 SVGA_TYPE(V_COMPAQ,3) /* Compaq QVision/1024 */ ! #define CHIP_CPQ_Q1280 SVGA_TYPE(V_COMPAQ,4) /* Compaq QVision/1280 */ ! #define CHIP_CPQ_AVGA_P SVGA_TYPE(V_COMPAQ,5) /* Compaq AVGA Portable */ #define CHIP_G_6100 SVGA_TYPE(V_GENOA,0) /* Genoa GVGA 6100 */ #define CHIP_G_6200 SVGA_TYPE(V_GENOA,1) /* Genoa GVGA 6200 */ #define CHIP_G_6400 SVGA_TYPE(V_GENOA,2) /* Genoa GVGA 6400 */ ! #define CHIP_HM86304 SVGA_TYPE(V_HMC,0) /* HMC HM86304 */ ! #define CHIP_MX68000 SVGA_TYPE(V_MX,0) /* MX 68000 */ ! #define CHIP_MX68010 SVGA_TYPE(V_MX,1) /* MX 68010 */ #define CHIP_NCR_UNK SVGA_TYPE(V_NCR,0) /* NCR unknown */ #define CHIP_NCR77C21 SVGA_TYPE(V_NCR,1) /* NCR 77C21 */ #define CHIP_NCR77C22 SVGA_TYPE(V_NCR,2) /* NCR 77C22 */ #define CHIP_NCR77C22E SVGA_TYPE(V_NCR,3) /* NCR 77C22E */ #define CHIP_NCR77C22EP SVGA_TYPE(V_NCR,4) /* NCR 77C22E+ */ + #define CHIP_NCR77C32B SVGA_TYPE(V_NCR,5) /* NCR 77C32BLT */ #define CHIP_OAK_UNK SVGA_TYPE(V_OAK,0) /* OAK unknown */ #define CHIP_OAK037C SVGA_TYPE(V_OAK,1) /* OAK OTI037C */ #define CHIP_OAK057 SVGA_TYPE(V_OAK,2) /* OAK OTI-057 */ #define CHIP_OAK067 SVGA_TYPE(V_OAK,3) /* OAK OTI-067 */ #define CHIP_OAK077 SVGA_TYPE(V_OAK,4) /* OAK OTI-077 */ + #define CHIP_OAK083 SVGA_TYPE(V_OAK,5) /* OAK OTI-083 */ + #define CHIP_OAK087 SVGA_TYPE(V_OAK,6) /* OAK OTI-087 */ #define CHIP_P2000 SVGA_TYPE(V_PRIMUS,0) /* Primus P2000 */ ! #define CHIP_RT_UNK SVGA_TYPE(V_REALTEK,0) /* Realtek unknown */ ! #define CHIP_RT_3103 SVGA_TYPE(V_REALTEK,1) /* Realtek RT3103 */ ! #define CHIP_RT_3105 SVGA_TYPE(V_REALTEK,2) /* Realtek RT3105 */ ! #define CHIP_RT_3106 SVGA_TYPE(V_REALTEK,3) /* Realtek RT3106 */ #define CHIP_S3_UNKNOWN SVGA_TYPE(V_S3,0) /* S3 unknown */ #define CHIP_S3_911 SVGA_TYPE(V_S3,1) /* S3 86c911 */ #define CHIP_S3_924 SVGA_TYPE(V_S3,2) /* S3 86c924 or 911A */ *************** *** 408,447 **** #define CHIP_S3_801B SVGA_TYPE(V_S3,3) /* S3 86c801 A-B step */ #define CHIP_S3_801C SVGA_TYPE(V_S3,4) /* S3 86c801 C step */ #define CHIP_S3_801D SVGA_TYPE(V_S3,5) /* S3 86c801 D step */ ! #define CHIP_S3_805B SVGA_TYPE(V_S3,6) /* S3 86c805 A-B step */ ! #define CHIP_S3_805C SVGA_TYPE(V_S3,7) /* S3 86c805 C step */ ! #define CHIP_S3_805D SVGA_TYPE(V_S3,8) /* S3 86c805 D step */ ! #define CHIP_S3_928D SVGA_TYPE(V_S3,9) /* S3 86c928 A-D step */ ! #define CHIP_S3_928E SVGA_TYPE(V_S3,10) /* S3 86c928 E-step */ ! #define CHIP_S3_928P SVGA_TYPE(V_S3,11) /* S3 86c928PCI */ #define CHIP_TVGA_UNK SVGA_TYPE(V_TRIDENT,0) /* Trident unknown */ ! #define CHIP_TVGA8800BR SVGA_TYPE(V_TRIDENT,1) /* Trident 8800BR */ ! #define CHIP_TVGA8800CS SVGA_TYPE(V_TRIDENT,2) /* Trident 8800CS */ ! #define CHIP_TVGA8900B SVGA_TYPE(V_TRIDENT,3) /* Trident 8900B */ ! #define CHIP_TVGA8900C SVGA_TYPE(V_TRIDENT,4) /* Trident 8900C */ ! #define CHIP_TVGA8900CL SVGA_TYPE(V_TRIDENT,5) /* Trident 8900CL */ ! #define CHIP_TVGA9000 SVGA_TYPE(V_TRIDENT,6) /* Trident 9000 */ ! #define CHIP_TVGA9100 SVGA_TYPE(V_TRIDENT,7) /* Trident LCD9100 */ ! #define CHIP_TVGA9200 SVGA_TYPE(V_TRIDENT,8) /* Trident LX9200 */ ! #define CHIP_ET3000 SVGA_TYPE(V_TSENG,0) /* Tseng ET3000 */ ! #define CHIP_ET4000 SVGA_TYPE(V_TSENG,1) /* Tseng ET4000 */ ! #define CHIP_ET4000_W32 SVGA_TYPE(V_TSENG,2) /* Tseng ET4000/W32 */ #define CHIP_V7_UNKNOWN SVGA_TYPE(V_VIDEO7,0) /* Video7 unknown */ ! #define CHIP_V7_VEGA SVGA_TYPE(V_VIDEO7,1) /* Video7 VEGA */ ! #define CHIP_V7_FWRITE SVGA_TYPE(V_VIDEO7,2) /* Video7 Fastwrite/VRAM*/ ! #define CHIP_V7_VRAM2 SVGA_TYPE(V_VIDEO7,3) /* Video7 VRAM II */ ! #define CHIP_V7_1024i SVGA_TYPE(V_VIDEO7,4) /* Video7 1024i */ ! #define CHIP_WD_PVGA1 SVGA_TYPE(V_WD,0) /* WD PVGA1 */ ! #define CHIP_WD_90C00 SVGA_TYPE(V_WD,1) /* WD 90C00 */ ! #define CHIP_WD_90C10 SVGA_TYPE(V_WD,2) /* WD 90C10 */ ! #define CHIP_WD_90C11 SVGA_TYPE(V_WD,3) /* WD 90C11 */ ! #define CHIP_WD_90C20 SVGA_TYPE(V_WD,4) /* WD 90C20 */ ! #define CHIP_WD_90C20A SVGA_TYPE(V_WD,5) /* WD 90C20A */ ! #define CHIP_WD_90C22 SVGA_TYPE(V_WD,6) /* WD 90C22 */ ! #define CHIP_WD_90C24 SVGA_TYPE(V_WD,7) /* WD 90C24 */ ! #define CHIP_WD_90C26 SVGA_TYPE(V_WD,8) /* WD 90C26 */ ! #define CHIP_WD_90C30 SVGA_TYPE(V_WD,9) /* WD 90C30 */ ! #define CHIP_WD_90C31 SVGA_TYPE(V_WD,10) /* WD 90C31 */ #define CHIP_YAMAHA6388 SVGA_TYPE(V_YAMAHA,0) /* Yamaha 6388 VPDC */ /* --- 438,499 ---- #define CHIP_S3_801B SVGA_TYPE(V_S3,3) /* S3 86c801 A-B step */ #define CHIP_S3_801C SVGA_TYPE(V_S3,4) /* S3 86c801 C step */ #define CHIP_S3_801D SVGA_TYPE(V_S3,5) /* S3 86c801 D step */ ! #define CHIP_S3_801I SVGA_TYPE(V_S3,6) /* S3 86c801i (?) */ ! #define CHIP_S3_805B SVGA_TYPE(V_S3,7) /* S3 86c805 A-B step */ ! #define CHIP_S3_805C SVGA_TYPE(V_S3,8) /* S3 86c805 C step */ ! #define CHIP_S3_805D SVGA_TYPE(V_S3,9) /* S3 86c805 D step */ ! #define CHIP_S3_805I SVGA_TYPE(V_S3,10) /* S3 86c805i */ ! #define CHIP_S3_928D SVGA_TYPE(V_S3,11) /* S3 86c928 A-D step */ ! #define CHIP_S3_928E SVGA_TYPE(V_S3,12) /* S3 86c928 E-step */ ! #define CHIP_S3_928P SVGA_TYPE(V_S3,13) /* S3 86c928PCI */ #define CHIP_TVGA_UNK SVGA_TYPE(V_TRIDENT,0) /* Trident unknown */ ! #define CHIP_TVGA8200 SVGA_TYPE(V_TRIDENT,1) /* Trident LX8200 */ ! #define CHIP_TVGA8800BR SVGA_TYPE(V_TRIDENT,2) /* Trident 8800BR */ ! #define CHIP_TVGA8800CS SVGA_TYPE(V_TRIDENT,3) /* Trident 8800CS */ ! #define CHIP_TVGA8900B SVGA_TYPE(V_TRIDENT,4) /* Trident 8900B */ ! #define CHIP_TVGA8900C SVGA_TYPE(V_TRIDENT,5) /* Trident 8900C */ ! #define CHIP_TVGA8900CL SVGA_TYPE(V_TRIDENT,6) /* Trident 8900CL */ ! #define CHIP_TVGA9000 SVGA_TYPE(V_TRIDENT,7) /* Trident 9000 */ ! #define CHIP_TVGA9000I SVGA_TYPE(V_TRIDENT,8) /* Trident 9000i */ ! #define CHIP_TVGA9100B SVGA_TYPE(V_TRIDENT,9) /* Trident LCD9100B */ ! #define CHIP_TVGA9200CX SVGA_TYPE(V_TRIDENT,10) /* Trident 9200CXr */ ! #define CHIP_TVGA9320 SVGA_TYPE(V_TRIDENT,11) /* Trident LCD9320 */ ! #define CHIP_TVGA9400CX SVGA_TYPE(V_TRIDENT,12) /* Trident 9400CXi */ ! #define CHIP_TVGA9420 SVGA_TYPE(V_TRIDENT,13) /* Trident GUI9420 */ ! #define CHIP_TSENG_UNK SVGA_TYPE(V_TSENG,0) /* Tseng unknown */ ! #define CHIP_ET3000 SVGA_TYPE(V_TSENG,1) /* Tseng ET3000 */ ! #define CHIP_ET4000 SVGA_TYPE(V_TSENG,2) /* Tseng ET4000 */ ! #define CHIP_ET4000W32 SVGA_TYPE(V_TSENG,3) /* Tseng ET4000/W32 */ ! #define CHIP_ET4000W32I SVGA_TYPE(V_TSENG,4) /* Tseng ET4000/W32i */ ! #define CHIP_ET4000W32P SVGA_TYPE(V_TSENG,5) /* Tseng ET4000/W32p */ ! #define CHIP_UMC_408 SVGA_TYPE(V_UMC,0) /* UMC 85c408 */ #define CHIP_V7_UNKNOWN SVGA_TYPE(V_VIDEO7,0) /* Video7 unknown */ ! #define CHIP_V7_FWRITE SVGA_TYPE(V_VIDEO7,1) /* Video7 Fastwrite/VRAM*/ ! #define CHIP_V7_1024i SVGA_TYPE(V_VIDEO7,2) /* Video7 1024i */ ! #define CHIP_V7_VRAM2_B SVGA_TYPE(V_VIDEO7,3) /* Video7 VRAM II (B) */ ! #define CHIP_V7_VRAM2_C SVGA_TYPE(V_VIDEO7,4) /* Video7 VRAM II (C,D) */ ! #define CHIP_HT216BC SVGA_TYPE(V_VIDEO7,5) /* Video7 HT216B,C */ ! #define CHIP_HT216D SVGA_TYPE(V_VIDEO7,6) /* Video7 HT216D */ ! #define CHIP_HT216E SVGA_TYPE(V_VIDEO7,7) /* Video7 HT216E */ ! #define CHIP_HT216F SVGA_TYPE(V_VIDEO7,8) /* Video7 HT216F */ ! #define CHIP_V7_VEGA SVGA_TYPE(V_VIDEO7,9) /* Video7 VEGA */ ! #define CHIP_WD_UNK SVGA_TYPE(V_WD,0) /* WD unknown */ ! #define CHIP_WD_PVGA1 SVGA_TYPE(V_WD,1) /* WD PVGA1 */ ! #define CHIP_WD_90C00 SVGA_TYPE(V_WD,2) /* WD 90C00 */ ! #define CHIP_WD_90C10 SVGA_TYPE(V_WD,3) /* WD 90C10 */ ! #define CHIP_WD_90C11 SVGA_TYPE(V_WD,4) /* WD 90C11 */ ! #define CHIP_WD_90C20 SVGA_TYPE(V_WD,5) /* WD 90C20 */ ! #define CHIP_WD_90C20A SVGA_TYPE(V_WD,6) /* WD 90C20A */ ! #define CHIP_WD_90C22 SVGA_TYPE(V_WD,7) /* WD 90C22 */ ! #define CHIP_WD_90C24 SVGA_TYPE(V_WD,8) /* WD 90C24 */ ! #define CHIP_WD_90C26 SVGA_TYPE(V_WD,9) /* WD 90C26 */ ! #define CHIP_WD_90C30 SVGA_TYPE(V_WD,10) /* WD 90C30 */ ! #define CHIP_WD_90C31 SVGA_TYPE(V_WD,11) /* WD 90C31 */ ! #define CHIP_WD_90C33 SVGA_TYPE(V_WD,12) /* WD 90C33 */ ! #define CHIP_WEIT_UNK SVGA_TYPE(V_WEITEK,0) /* Weitek unknown */ ! #define CHIP_WEIT_5086 SVGA_TYPE(V_WEITEK,1) /* Weitek 5086 */ ! #define CHIP_WEIT_5186 SVGA_TYPE(V_WEITEK,2) /* Weitek 5186 */ ! #define CHIP_WEIT_5286 SVGA_TYPE(V_WEITEK,3) /* Weitek 5286 */ #define CHIP_YAMAHA6388 SVGA_TYPE(V_YAMAHA,0) /* Yamaha 6388 VPDC */ /* *************** *** 458,466 **** #define CHIP_MACH8 COPROC_TYPE(C_8514,1) /* ATI Mach-8 */ #define CHIP_MACH32 COPROC_TYPE(C_8514,2) /* ATI Mach-32 */ #define CHIP_CT480 COPROC_TYPE(C_8514,3) /* C&T 82c480 */ - - #define NUM_COPROC_TYPE 1 - #define CHPS_PER_TYPE 6 /* * Useful macros --- 510,515 ---- diff -c mit/server/ddx/x386/SuperProbe/RamDac.c:2.3 mit/server/ddx/x386/SuperProbe/RamDac.c:2.10 *** mit/server/ddx/x386/SuperProbe/RamDac.c:2.3 Fri Mar 11 23:36:22 1994 --- mit/server/ddx/x386/SuperProbe/RamDac.c Fri Mar 11 23:36:23 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,39 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/RamDac.c,v 2.3 1993/09/27 12:23:25 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0, 0, 0x3C6, 0x3C7, 0x3C8, 0x3C9}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) ! #if __STDC__ ! static Bool Width8Check(void) #else static Bool Width8Check() #endif { int i; Byte save[3]; Bool result = FALSE; --- 21,650 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/RamDac.c,v 2.10 1994/03/05 01:58:49 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x000, 0x000, 0x3C6, 0x3C7, 0x3C8, 0x3C9}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) ! #define RED 0 ! #define GREEN 1 ! #define BLUE 2 ! ! static void ReadPelReg __STDCARGS((Byte, Byte *)); ! static void WritePelReg __STDCARGS((Byte, Byte *)); ! static Byte SetComm __STDCARGS((Byte)); ! static Bool Width8Check __STDCARGS((void)); ! static Bool TestDACBit __STDCARGS((Byte, Byte, Byte)); ! static Bool S3_Bt485Check __STDCARGS((int *)); ! static Bool S3_TVP3020Check __STDCARGS((int *)); ! static void CheckMach32 __STDCARGS((int *)); ! ! #ifdef __STDC__ ! static void ReadPelReg(Byte Index, Byte *Pixel) ! #else ! static void ReadPelReg(Index, Pixel) ! Byte Index; ! Byte *Pixel; ! #endif ! { ! outp(0x3C7, Index); ! Pixel[RED] = inp(0x3C9); ! Pixel[GREEN] = inp(0x3C9); ! Pixel[BLUE] = inp(0x3C9); ! ! return; ! } ! ! #ifdef __STDC__ ! static void WritePelReg(Byte Index, Byte *Pixel) ! #else ! static void WritePelReg(Index, Pixel) ! Byte Index; ! Byte *Pixel; ! #endif ! { ! outp(0x3C8, Index); ! outp(0x3C9, Pixel[RED]); ! outp(0x3C9, Pixel[GREEN]); ! outp(0x3C9, Pixel[BLUE]); ! return; ! } ! ! #ifdef __STDC__ ! static Byte SetComm(Byte Comm) #else + static Byte SetComm(Comm) + Byte Comm; + #endif + { + (void) dactocomm(); + outp(0x3C6, Comm); + (void) dactocomm(); + return(inp(0x3C6)); + } + static Bool Width8Check() + { + Byte old, x, v; + Byte pix[3]; + + old = inp(0x3C8); + ReadPelReg(0xFF, pix); + v = pix[RED]; + pix[RED]= 0xFF; + WritePelReg(0xFF, pix); + ReadPelReg(0xFF, pix); + x = pix[RED]; + pix[RED] = v; + WritePelReg(0xFF, pix); + outp(0x3C8, old); + return(x == 0xFF); + } + + #ifdef __STDC__ + static Bool TestDACBit(Byte Bit, Byte OldComm, Byte OldPel) + #else + static Bool TestDACBit(Bit, OldComm, OldPel) + Byte Bit; + Byte OldComm; + Byte OldPel; #endif { + Byte tmp; + + dactopel(); + outp(0x3C6, OldPel & (Bit ^ 0xFF)); + (void) dactocomm(); + outp(0x3C6, OldComm | Bit); + tmp = inp(0x3C6); + outp(0x3C6, tmp & (Bit ^ 0xFF)); + return((tmp & Bit) != 0); + } + + static Bool S3_Bt485Check(RamDac) + int *RamDac; + { + Byte old1, old2, old3, old4; + Byte lock1, lock2; + Bool Found = FALSE; + Bool DoChecks = FALSE; + + lock1 = rdinx(CRTC_IDX, 0x38); + lock2 = rdinx(CRTC_IDX, 0x39); + wrinx(CRTC_IDX, 0x38, 0x48); + wrinx(CRTC_IDX, 0x39, 0xA5); + + old1 = inp(0x3C6); + old2 = rdinx(CRTC_IDX, 0x55); + outp(0x3C6, 0x0F); + wrinx(CRTC_IDX, 0x55, (old2 & 0xFC) | 0x02); + old3 = inp(0x3C6); + if ((old3 & 0x80) == 0x80) + { + Found = TRUE; + if ((old3 & 0xC0) == 0x80) + { + *RamDac = DAC_BT485; + DoChecks = TRUE; + } + else if ((old3 & 0xF0) == 0xD0) + { + DoChecks = TRUE; + *RamDac = DAC_ATT505; + } + else + { + *RamDac = DAC_UNKNOWN; + } + } + else if ((old3 & 0xF0) == 0x40) + { + Found = TRUE; + *RamDac = DAC_ATT504; + DoChecks = TRUE; + } + else + { + /* Perhaps status reg is hidden behind CR3 */ + wrinx(CRTC_IDX, 0x55, (old2 & 0xFC) | 0x01); + old3 = inp(0x3C6); + if ((old3 & 0x80) == 0x80) + { + /* OK. CR3 is active... */ + wrinx(CRTC_IDX, 0x55, (old2 & 0xFC) | 0x00); + old3 = inp(0x3C8); + outp(0x3C8, 0x00); + wrinx(CRTC_IDX, 0x55, (old2 & 0xFC) | 0x02); + old4 = inp(0x3C6); + if ((old4 & 0x80) == 0x80) + { + Found = TRUE; + if ((old4 & 0xC0) == 0x80) + { + *RamDac = DAC_BT485; + } + else if ((old4 & 0xF0) == 0xD0) + { + *RamDac = DAC_ATT505; + } + else + { + *RamDac = DAC_UNKNOWN; + } + } + else if ((old4 & 0xF0) == 0x40) + { + Found = TRUE; + *RamDac = DAC_ATT504; + } + if ((Found) && (*RamDac != DAC_UNKNOWN)) + { + *RamDac |= DAC_6_8_PROGRAM; + if (Width8Check()) + { + *RamDac |= DAC_8BIT; + } + } + wrinx(CRTC_IDX, 0x55, (old2 & 0xFC) | 0x00); + outp(0x3C8, old3); + } + } + if (DoChecks) + { + *RamDac |= DAC_6_8_PROGRAM; + if (Width8Check()) + { + *RamDac |= DAC_8BIT; + } + } + wrinx(CRTC_IDX, 0x55, old2); + outp(0x3C6, old1); + + wrinx(CRTC_IDX, 0x39, lock2); + wrinx(CRTC_IDX, 0x38, lock1); + + return(Found); + } + + static Bool S3_TVP3020Check(RamDac) + int *RamDac; + { + Byte old1, old2, old3, old4; + Byte lock1, lock2; + Bool Found = FALSE; + + /* + * TI ViewPoint TVP3020 support - Robin Cutshaw + * + * The 3020 has 8 direct registers accessed through standard + * VGA registers 0x3C8, 0x3C9, 0x3C6, and 0x3C7. Bit 0 of + * CR55 is used to map these four register to the low four + * or high four direct 3020 registers. The high register set + * includes index and data registers which are used to address + * indirect registers 0x00-0x3F and 0xFF. Indirect register + * 0x3F is the chip ID register which will always return 0x20. + */ + + lock1 = rdinx(CRTC_IDX, 0x38); + lock2 = rdinx(CRTC_IDX, 0x39); + wrinx(CRTC_IDX, 0x38, 0x48); + wrinx(CRTC_IDX, 0x39, 0xA5); + + old1 = inp(0x3C6); + old2 = rdinx(CRTC_IDX, 0x55); + + wrinx(CRTC_IDX, 0x55, (old2 & 0xFC) | 0x01); /* high four registers */ + old3 = inp(0x3C6); /* read current index register value */ + + outp(0x3C6, 0x3F); /* write ID register index to index register */ + old4 = inp(0x3C7); /* read ID register from data register */ + if (old4 == 0x20) { + Found = TRUE; + *RamDac = DAC_TVP3020; + *RamDac |= DAC_6_8_PROGRAM; + wrinx(CRTC_IDX, 0x55, (old2 & 0xFC) | 0x00); /* regular VGA */ + if (Width8Check()) + { + *RamDac |= DAC_8BIT; + } + } + + wrinx(CRTC_IDX, 0x55, (old2 & 0xFC) | 0x01); /* high four registers */ + outp(0x3C6, old3); /* restore index register value */ + + wrinx(CRTC_IDX, 0x55, old2); + outp(0x3C6, old1); + + wrinx(CRTC_IDX, 0x39, lock2); + wrinx(CRTC_IDX, 0x38, lock1); + + return(Found); + } + + static void CheckMach32(RamDac) + int *RamDac; + { + Word Port = CONFIG_STATUS_1; + + EnableIOPorts(1, &Port); + + switch ((inpw(CONFIG_STATUS_1) & 0x0E00) >> 9) + { + case 0x00: + *RamDac = DAC_ATI68830; + break; + case 0x01: + *RamDac = DAC_SIERRA15_16; + break; + case 0x02: + *RamDac = DAC_ATI68875; + *RamDac |= DAC_6_8_PROGRAM; + if (Width8Check()) + { + *RamDac |= DAC_8BIT; + } + break; + case 0x03: + *RamDac = DAC_STANDARD; + break; + case 0x04: + *RamDac = DAC_ATIMISC24; + *RamDac |= DAC_6_8_PROGRAM; + if (Width8Check()) + { + *RamDac |= DAC_8BIT; + } + break; + case 0x05: + *RamDac = DAC_ATI68860; + *RamDac |= DAC_6_8_PROGRAM; + if (Width8Check()) + { + *RamDac |= DAC_8BIT; + } + break; + default: + *RamDac = DAC_UNKNOWN; + break; + } + + DisableIOPorts(1, &Port); + return; + } + + void Probe_RamDac(Chipset, RamDac) + int Chipset; + int *RamDac; + { + Byte x, y, z, u, v, oldcomm, oldpel, notcomm; + Bool dac8, dac8now; + + *RamDac = DAC_STANDARD; + Ports[0] = CRTC_IDX; + Ports[1] = CRTC_REG; + EnableIOPorts(NUMPORTS, Ports); + + /* + * Handle special cases. + */ + if (Chipset == CHIP_AL2101) + { + *RamDac = DAC_ALG1101; + if (Width8Check()) + { + *RamDac |= DAC_8BIT; + } + DisableIOPorts(NUMPORTS, Ports); + return; + } + else if (SVGA_VENDOR(Chipset) == V_ATI) + { + if (Chipset < CHIP_ATI68800_3) + { + if (ReadBIOS(0x44, &x, 1) != 1) + { + fprintf(stderr, "%s: Failed to read ATI BIOS data\n", + MyName); + DisableIOPorts(NUMPORTS, Ports); + return; + } + if (x & 0x80) + { + *RamDac = DAC_ATI68830; + if (Width8Check()) + { + *RamDac |= DAC_8BIT; + } + DisableIOPorts(NUMPORTS, Ports); + return; + } + } + else + { + CheckMach32(RamDac); + DisableIOPorts(NUMPORTS, Ports); + return; + } + } + else if ((SVGA_VENDOR(Chipset) == V_CIRRUS) && + (Chipset >= CHIP_CL5420)) + { + if ((Chipset == CHIP_CL5420) || (Chipset >= CHIP_CL5410)) + { + *RamDac = DAC_CIRRUSA; + } + else + { + *RamDac = DAC_CIRRUSB; + } + if (Width8Check()) + { + *RamDac |= DAC_8BIT; + } + DisableIOPorts(NUMPORTS, Ports); + return; + } + else if ((SVGA_VENDOR(Chipset) == V_S3) && (Chipset >= CHIP_S3_928D)) + { + if (S3_Bt485Check(RamDac)) + { + DisableIOPorts(NUMPORTS, Ports); + return; + } + if (S3_TVP3020Check(RamDac)) + { + DisableIOPorts(NUMPORTS, Ports); + return; + } + } + + /* + * Save current state. + */ + (void) dactocomm(); + oldcomm = inp(0x3C6); + dactopel(); + oldpel = inp(0x3C6); + + /* + * Do 8-bit-wide check. + */ + (void) dactocomm(); + outp(0x3C6, 0x00); + dac8 = Width8Check(); + dactopel(); + + /* + * Check whether this DAC has a HiColor-style command register. + */ + notcomm = ~oldcomm; + outp(0x3C6, notcomm); + (void) dactocomm(); + v = inp(0x3C6); + if (v != notcomm) + { + /* + * Check for early-generation HiColor-style DAC. + */ + if ((SetComm(0xE0) & 0xE0) != 0xE0) + { + dactopel(); + x = inp(0x3C6); + do + { + /* + * Wait for same value twice. + */ + y = x; + x = inp(0x3C6); + } + while (x != y); + z = x; + u = dactocomm(); + if (u != 0x8E) + { + /* + * If command register is 0x8E, we've got an SS24; + */ + y = 8; + do + { + x = inp(0x3C6); + y--; + } + while ((x != 0x8E) && (y != 0)); + } + else + { + x = u; + } + if (x == 0x8E) + { + *RamDac = DAC_SS24; + } + else + { + /* + * Sierra SC11486 + */ + *RamDac = DAC_SIERRA15; + } + dactopel(); + } + else + { + /* + * New generation of advanced DACs + */ + if ((SetComm(0x60) & 0xE0) == 0x00) + { + /* + * AT&T 20C490/20C493 + */ + if ((SetComm(0x02) & 0x02) != 0x00) + { + *RamDac = DAC_ATT490; + *RamDac |= DAC_6_8_PROGRAM; + } + else + { + *RamDac = DAC_ATT493; + } + } + else + { + x = SetComm(oldcomm); + if (inp(0x3C6) == notcomm) + { + if (SetComm(0xFF) != 0xFF) + { + *RamDac = DAC_ACUMOS; + } + else + { + dactocomm(); + outp(0x3C6, (oldcomm | 0x02) & 0xFE); + dac8now = Width8Check(); + if (dac8now) + { + if (Width8Check()) + { + *RamDac = DAC_ATT491; + *RamDac |= DAC_6_8_PROGRAM; + } + else + { + *RamDac = DAC_CIRRUS24; + } + } + else + { + *RamDac = DAC_ATT492; + } + } + } + else + { + if (trigdac() == notcomm) + { + *RamDac = DAC_CIRRUS24; + } + else + { + dactopel(); + outp(0x3C6, 0xFF); + switch (trigdac()) + { + case 0x44: + *RamDac = DAC_MUSIC4870; + break; + case 0x82: + *RamDac = DAC_MUSIC4910; + break; + case 0x8E: + *RamDac = DAC_SS24; + break; + default: + if (TestDACBit(0x10,oldcomm,oldpel)) + { + *RamDac = DAC_SIERRA24; + *RamDac |= DAC_6_8_PROGRAM; + } + else if (TestDACBit(0x04,oldcomm,oldpel)) + { + *RamDac = DAC_UNKNOWN; + } + else + { + *RamDac = DAC_SIERRA15_16; + } + break; + } + } + } + } + } + dactocomm(); + outp(0x3C6, oldcomm); + } + dactopel(); + outp(0x3C6, oldpel); + + /* + * If no special DAC found, check for the EDSUN DAC. + */ + if (*RamDac == DAC_STANDARD) + { + /* + * Write "CEGEDSUN" + mode to DAC index 0xDE (222) + */ + waitforretrace(); + outp(0x3C8, 0xDE); + outp(0x3C9, (Byte)'C'); + outp(0x3C9, (Byte)'E'); + outp(0x3C9, (Byte)'G'); + outp(0x3C8, 0xDE); + outp(0x3C9, (Byte)'E'); + outp(0x3C9, (Byte)'D'); + outp(0x3C9, (Byte)'S'); + outp(0x3C8, 0xDE); + outp(0x3C9, (Byte)'U'); + outp(0x3C9, (Byte)'N'); + outp(0x3C9, (Byte)'\n'); + /* + * Should be in CEG mode now. + */ + outp(0x3C6, 0xFF); + x = (inp(0x3C6) >> 4) & 0x07; + if (x < 0x07) + { + *RamDac = DAC_EDSUN; + waitforretrace(); + outp(0x3C8, 0xDF); + outp(0x3C9, 0x00); + } + } + + /* + * Remember if DAC was in 8-bit mode. + */ + if (dac8) + { + *RamDac |= DAC_8BIT; + } + + DisableIOPorts(NUMPORTS, Ports); + return; + } + + #ifdef OLD_DAC_CODE /* { */ + + static void CheckATT __STDCARGS((int *)); + + static Bool Width8Check() + { int i; Byte save[3]; Bool result = FALSE; *************** *** 69,80 **** return(result); } - #ifdef __STDC__ - static void CheckATT(int *RamDac) - #else static void CheckATT(RamDac) int *RamDac; - #endif { Byte savecomm, tmp; --- 680,687 ---- *************** *** 130,209 **** outp(0x3C6, savecomm); } - #ifdef __STDC__ - static Bool S3_Bt485Check(int *RamDac) - #else - static Bool S3_Bt485Check(RamDac) - int *RamDac; - #endif - { - Byte old1, old2, old3, old4; - Byte lock1, lock2; - Bool Found = FALSE; - - lock1 = rdinx(CRTC_IDX, 0x38); - lock2 = rdinx(CRTC_IDX, 0x39); - wrinx(CRTC_IDX, 0x38, 0x48); - wrinx(CRTC_IDX, 0x39, 0xA5); - - old1 = inp(0x3C6); - old2 = rdinx(CRTC_IDX, 0x55); - outp(0x3C6, 0xFF); - wrinx(CRTC_IDX, 0x55, (old2 & 0xFC) | 0x02); - old3 = inp(0x3C6); - if ((old3 & 0xC0) == 0x80) - { - Found = TRUE; - *RamDac = DAC_BT485; - *RamDac |= DAC_6_8_PROGRAM; - if (Width8Check()) - { - *RamDac |= DAC_8BIT; - } - } - else - { - /* Perhaps status reg is hidden behind CR3 */ - wrinx(CRTC_IDX, 0x55, (old2 & 0xFC) | 0x01); - old3 = inp(0x3C6); - if ((old3 & 0x80) == 0x80) - { - /* OK. CR3 is active... */ - wrinx(CRTC_IDX, 0x55, (old2 & 0xFC) | 0x00); - old3 = inp(0x3C8); - outp(0x3C8, 0x00); - wrinx(CRTC_IDX, 0x55, (old2 & 0xFC) | 0x02); - old4 = inp(0x3C6); - if ((old4 & 0xC0) == 0x80) - { - Found = TRUE; - *RamDac = DAC_BT485; - *RamDac |= DAC_6_8_PROGRAM; - if (Width8Check()) - { - *RamDac |= DAC_8BIT; - } - } - wrinx(CRTC_IDX, 0x55, (old2 & 0xFC) | 0x00); - outp(0x3C8, old3); - } - } - wrinx(CRTC_IDX, 0x55, old2); - outp(0x3C6, old1); - - wrinx(CRTC_IDX, 0x39, lock2); - wrinx(CRTC_IDX, 0x38, lock1); - - return(Found); - } - - #ifdef __STDC__ - void Probe_RamDac(int Chipset, int *RamDac) - #else void Probe_RamDac(Chipset, RamDac) int Chipset; int *RamDac; - #endif { Byte x, y, z, v, oldcommreg, oldpelreg; --- 737,745 ---- *************** *** 233,239 **** } if (x & 0x80) { ! *RamDac = DAC_ATI; if (Width8Check()) { *RamDac |= DAC_8BIT; --- 769,775 ---- } if (x & 0x80) { ! *RamDac = DAC_ATI68830; if (Width8Check()) { *RamDac |= DAC_8BIT; *************** *** 268,273 **** --- 804,814 ---- DisableIOPorts(NUMPORTS, Ports); return; } + if (S3_TVP3020Check(RamDac)) + { + DisableIOPorts(NUMPORTS, Ports); + return; + } } dactopel(); x = inp(0x3C6); *************** *** 357,359 **** --- 898,902 ---- DisableIOPorts(NUMPORTS, Ports); return; } + + #endif /* OLD_DAC_CODE } */ diff -c mit/server/ddx/x386/SuperProbe/RealTek.c:2.1 mit/server/ddx/x386/SuperProbe/RealTek.c:2.3 *** mit/server/ddx/x386/SuperProbe/RealTek.c:2.1 Fri Mar 11 23:36:24 1994 --- mit/server/ddx/x386/SuperProbe/RealTek.c Fri Mar 11 23:36:24 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/RealTek.c,v 2.1 1993/09/21 15:20:45 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/RealTek.c,v 2.3 1994/02/28 14:09:53 dawes Exp $ */ #include "Probe.h" *************** *** 28,33 **** --- 28,35 ---- static Word Ports[] = {0x000, 0x000, 0x3D6, 0x3D7}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_RealTek __STDCARGS((int)); + Chip_Descriptor RealTek_Descriptor = { "RealTek", Probe_RealTek, *************** *** 35,41 **** NUMPORTS, FALSE, FALSE, ! TRUE }; #ifdef __STDC__ --- 37,44 ---- NUMPORTS, FALSE, FALSE, ! TRUE, ! MemProbe_RealTek, }; #ifdef __STDC__ *************** *** 46,63 **** #endif { Bool result = FALSE; /* Add CRTC to enabled ports */ Ports[0] = CRTC_IDX; Ports[1] = CRTC_REG; EnableIOPorts(NUMPORTS, Ports); if (testinx2(CRTC_IDX, 0x1F, 0x3F) && tstrg(0x3D6, 0x0F) && tstrg(0x3D7, 0x0F)) { result = TRUE; ! *Chipset = CHIP_REALTEK; } DisableIOPorts(NUMPORTS, Ports); return(result); } --- 49,135 ---- #endif { Bool result = FALSE; + Byte ver; /* Add CRTC to enabled ports */ Ports[0] = CRTC_IDX; Ports[1] = CRTC_REG; EnableIOPorts(NUMPORTS, Ports); + if (testinx2(CRTC_IDX, 0x1F, 0x3F) && tstrg(0x3D6, 0x0F) && tstrg(0x3D7, 0x0F)) { result = TRUE; ! ver = rdinx(CRTC_IDX, 0x1A) >> 6; ! switch (ver) ! { ! case 0x00: ! *Chipset = CHIP_RT_3103; ! break; ! case 0x01: ! *Chipset = CHIP_RT_3105; ! break; ! case 0x02: ! *Chipset = CHIP_RT_3106; ! break; ! default: ! Chip_data = ver; ! *Chipset = CHIP_RT_UNK; ! break; ! } } + DisableIOPorts(NUMPORTS, Ports); return(result); + } + + static int MemProbe_RealTek(Chipset) + int Chipset; + { + int Mem = 0; + + EnableIOPorts(NUMPORTS, Ports); + + switch (Chipset) + { + case CHIP_RT_3103: + switch (rdinx(CRTC_IDX, 0x1E) & 0x03) + { + case 0x00: + Mem = 256; + break; + case 0x01: + Mem = 512; + break; + case 0x02: + Mem = 768; + break; + case 0x03: + Mem = 1024; + break; + } + break; + case CHIP_RT_3105: + case CHIP_RT_3106: + switch (rdinx(CRTC_IDX, 0x1E) & 0x03) + { + case 0x00: + Mem = 256; + break; + case 0x01: + Mem = 512; + break; + case 0x02: + Mem = 1024; + break; + case 0x03: + Mem = 2048; + break; + } + break; + } + + DisableIOPorts(NUMPORTS, Ports); + return(Mem); } diff -c mit/server/ddx/x386/SuperProbe/S3.c:2.4 mit/server/ddx/x386/SuperProbe/S3.c:2.6 *** mit/server/ddx/x386/SuperProbe/S3.c:2.4 Fri Mar 11 23:36:24 1994 --- mit/server/ddx/x386/SuperProbe/S3.c Fri Mar 11 23:36:25 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/S3.c,v 2.4 1993/09/27 12:23:26 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/S3.c,v 2.6 1994/02/28 14:10:50 dawes Exp $ */ #include "Probe.h" *************** *** 28,33 **** --- 28,35 ---- static Word Ports[] = {0x000, 0x000}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_S3 __STDCARGS((int)); + Chip_Descriptor S3_Descriptor = { "S3", Probe_S3, *************** *** 35,49 **** NUMPORTS, FALSE, FALSE, ! FALSE }; - #ifdef __STDC__ - Bool Probe_S3(int *Chipset) - #else Bool Probe_S3(Chipset) int *Chipset; - #endif { Bool result = FALSE; Byte old, tmp, rev; --- 37,48 ---- NUMPORTS, FALSE, FALSE, ! FALSE, ! MemProbe_S3, }; Bool Probe_S3(Chipset) int *Chipset; { Bool result = FALSE; Byte old, tmp, rev; *************** *** 102,107 **** --- 101,109 ---- case 0x05: *Chipset = CHIP_S3_805D; break; + case 0x08: + *Chipset = CHIP_S3_805I; + break; default: /* Call >0x05 D step for now */ *Chipset = CHIP_S3_805D; *************** *** 127,132 **** --- 129,137 ---- case 0x05: *Chipset = CHIP_S3_801D; break; + case 0x08: + *Chipset = CHIP_S3_801I; + break; default: /* Call >0x05 D step for now */ *Chipset = CHIP_S3_801D; *************** *** 181,184 **** --- 186,243 ---- wrinx(CRTC_IDX, 0x38, old); DisableIOPorts(NUMPORTS, Ports); return(result); + } + + static int MemProbe_S3(Chipset) + int Chipset; + { + Byte config, old; + int Mem = 0; + + EnableIOPorts(NUMPORTS, Ports); + + old = rdinx(CRTC_IDX, 0x38); + wrinx(CRTC_IDX, 0x38, 0x00); + if (!testinx2(CRTC_IDX, 0x35, 0x0F)) + { + wrinx(CRTC_IDX, 0x38, 0x48); + if (testinx2(CRTC_IDX, 0x35, 0x0F)) + { + config = rdinx(CRTC_IDX, 0x36); + if ((config & 0x20) != 0) + { + Mem = 512; + } + else + { + if ((Chipset == CHIP_S3_911) || + (Chipset == CHIP_S3_924)) + { + Mem = 1024; + } + else + { + switch((config & 0xC0) >> 6) + { + case 0: + Mem = 4096; + break; + case 1: + Mem = 3072; + break; + case 2: + Mem = 2048; + break; + case 3: + Mem = 1024; + break; + } + } + } + } + } + wrinx(CRTC_IDX, 0x38, old); + + DisableIOPorts(NUMPORTS, Ports); + return(Mem); } diff -c /dev/null mit/server/ddx/x386/SuperProbe/SolX86IO.s:2.2 *** /dev/null Fri Mar 11 23:36:25 1994 --- mit/server/ddx/x386/SuperProbe/SolX86IO.s Fri Mar 11 23:36:25 1994 *************** *** 0 **** --- 1,99 ---- + / + / File: SolX86IO.s + / + / Purpose: Provide inb(), inw(), inl(), outb(), outw(), outl() functions + / for Solaris x86 using the ProWorks compiler by SunPro + / + / Author: Installed into XFree86 SuperProbe by Doug Anson (danson@lgc.com) + / Portions donated to XFree86 by Steve Dever (Steve.Dever@Eng.Sun.Com) + / + / Synopsis: (c callable external declarations) + / extern unsigned char inb(int port); + / extern unsigned short inw(int port); + / extern unsigned long inl(int port); + / extern void outb(int port, unsigned char value); + / extern void outw(int port, unsigned short value); + / extern void outl(int port, unsigned long value); + / + / $XFree86: mit/server/ddx/x386/SuperProbe/SolX86IO.s,v 2.2 1994/02/01 13:51:04 dawes Exp $ + + .file "SolX86IO.s" + .text + + .globl inb + .globl inw + .globl inl + .globl outb + .globl outw + .globl outl + + / + / unsigned char inb(int port); + / + .align 4 + inb: + movl 4(%esp),%edx + subl %eax,%eax + inb (%dx) + ret + .type inb,@function + .size inb,.-inb + + / + / unsigned short inw(int port); + / + .align 4 + inw: + movl 4(%esp),%edx + subl %eax,%eax + inw (%dx) + ret + .type inw,@function + .size inw,.-inw + + / + / unsigned long inl(int port); + / + .align 4 + inl: + movl 4(%esp),%edx + inl (%dx) + ret + .type inl,@function + .size inl,.-inl + + / + / void outb(int port, unsigned char value); + / + .align 4 + outb: + movl 4(%esp),%edx + movl 8(%esp),%eax + outb (%dx) + ret + .type outb,@function + .size outb,.-outb + + / + / void outw(int port, unsigned short value); + / + .align 4 + outw: + movl 4(%esp),%edx + movl 8(%esp),%eax + outw (%dx) + ret + .type outw,@function + .size outw,.-outw + + / + / void outl(int port, unsigned long value); + / + .align 4 + outl: + movl 4(%esp),%edx + movl 8(%esp),%eax + outl (%dx) + ret + .type outl,@function + .size outl,.-outl diff -c mit/server/ddx/x386/SuperProbe/SuperProbe.man:2.4 mit/server/ddx/x386/SuperProbe/SuperProbe.man:2.8 *** mit/server/ddx/x386/SuperProbe/SuperProbe.man:2.4 Fri Mar 11 23:36:26 1994 --- mit/server/ddx/x386/SuperProbe/SuperProbe.man Fri Mar 11 23:36:26 1994 *************** *** 1,5 **** ! .\" $XFree86: mit/server/ddx/x386/SuperProbe/SuperProbe.man,v 2.4 1993/10/07 13:54:52 dawes Exp $ ! .TH SuperProbe 1 "Version 1.0" "" .SH NAME SuperProbe - probe for and identify installed video hardware. .SH SYNOPSIS --- 1,5 ---- ! .\" $XFree86: mit/server/ddx/x386/SuperProbe/SuperProbe.man,v 2.8 1994/03/05 08:23:05 dawes Exp $ ! .TH SuperProbe 1 "Version 2.0" "" .SH NAME SuperProbe - probe for and identify installed video hardware. .SH SYNOPSIS *************** *** 6,29 **** .B SuperProbe [-verbose] [-no16] [-excl \fIlist\fP] [-mask10] .if n .br ! [-order \fIlist\fP] [-noprobe \fIlist\fP] [-bios \fIbase\fP] .br ! [-no_bios] [-info] .SH DESCRIPTION .PP .I SuperProbe is a a program that will attempt to determine the type of video hardware ! installed in an EISA/ISA-bus system by checking for known registers in various ! combinations at various locations (MicroChannel machines are not currently ! supported). This is an error-prone process, especially on Unix (which usually has a lot more esoteric hardware installed than MS-DOS system do), so SuperProbe may likely need help from the user. .PP .I SuperProbe ! runs on SVR3, SVR4, Linux, 386BSD, Minix-386, and Mach. It should be trivial ! to extend it to work on any other Unix-like operating system, and even ! non-Unix operating systems. All of the OS dependencies are isolated to a ! single file for each OS. .PP At this time, .I SuperProbe --- 6,31 ---- .B SuperProbe [-verbose] [-no16] [-excl \fIlist\fP] [-mask10] .if n .br ! [-order \fIlist\fP] [-noprobe \fIlist\fP] [-bios \fIbase\fP] .br ! [-no_bios] [-no_dac] [-no_mem] [-info] .SH DESCRIPTION .PP .I SuperProbe is a a program that will attempt to determine the type of video hardware ! installed in an EISA/ISA/VLB-bus system by checking for known registers ! in various combinations at various locations (MicroChannel and PCI machines ! may not be fully supported; many work with the use of the ! .B -no_bios ! option). This is an error-prone process, especially on Unix (which usually has a lot more esoteric hardware installed than MS-DOS system do), so SuperProbe may likely need help from the user. .PP .I SuperProbe ! runs on SVR3, SVR4, Linux, 386BSD/FreeBSD/NetBSD, Minix-386, and Mach. It ! should be trivial to extend it to work on any other Unix-like operating ! system, and even non-Unix operating systems. All of the OS dependencies ! are isolated to a single file for each OS. .PP At this time, .I SuperProbe *************** *** 31,37 **** SVGA chipsets (see the .I -info option, below). It can also identify several HiColor/True-color RAMDACs ! in use on SVGA boards. It can identify 8514/A and some derivatives, but not XGA, or PGC (although the author intends to add those capabilities). Nor can it identify other esoteric video hardware (like Targa, TIGA, or Microfield boards). --- 33,40 ---- SVGA chipsets (see the .I -info option, below). It can also identify several HiColor/True-color RAMDACs ! in use on SVGA boards, and the amount of video memory installed (for many ! chipsets). It can identify 8514/A and some derivatives, but not XGA, or PGC (although the author intends to add those capabilities). Nor can it identify other esoteric video hardware (like Targa, TIGA, or Microfield boards). *************** *** 119,128 **** option can be used to specify the base. .TP 8 .B "-no_bios" ! Disallow reading of the video BIOS and ! sssume that an EGA or later (VGA, SVGA) board is present as the primary ! video hardware. .TP 8 .B "-info" .I SuperProbe will print out a listing of all the video hardware that it knows how to --- 122,136 ---- option can be used to specify the base. .TP 8 .B "-no_bios" ! Disallow reading of the video BIOS and assume that an EGA or later ! (VGA, SVGA) board is present as the primary video hardware. .TP 8 + .B "-no_dac" + Skip probing for the RAMDAC type when an (S)VGA is identified. + .TP 8 + .B "-no_mem" + Skip probing for the amount of installed video memory. + .TP 8 .B "-info" .I SuperProbe will print out a listing of all the video hardware that it knows how to *************** *** 185,191 **** .SH SEE ALSO .PP The ! .I vgadoc2.zip documentation package by Finn Thoegersen, available in the MS-DOS archives of many FTP repositories. .PP --- 193,199 ---- .SH SEE ALSO .PP The ! .I vgadoc3.zip documentation package by Finn Thoegersen, available in the MS-DOS archives of many FTP repositories. .PP diff -c mit/server/ddx/x386/SuperProbe/Trident.c:2.2 mit/server/ddx/x386/SuperProbe/Trident.c:2.5 *** mit/server/ddx/x386/SuperProbe/Trident.c:2.2 Fri Mar 11 23:36:26 1994 --- mit/server/ddx/x386/SuperProbe/Trident.c Fri Mar 11 23:36:26 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,33 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Trident.c,v 2.2 1993/09/27 12:23:28 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x3C4, 0x3C5}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor Trident_Descriptor = { "Trident", Probe_Trident, --- 21,35 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Trident.c,v 2.5 1994/02/28 14:09:56 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x000, 0x000, SEQ_IDX, SEQ_REG}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_Trident __STDCARGS((int)); + Chip_Descriptor Trident_Descriptor = { "Trident", Probe_Trident, *************** *** 35,61 **** NUMPORTS, FALSE, FALSE, ! TRUE }; - #ifdef __STDC__ - Bool Probe_Trident(int *Chipset) - #else Bool Probe_Trident(Chipset) int *Chipset; - #endif { Bool result = FALSE; Byte chip, old, old1, val; EnableIOPorts(NUMPORTS, Ports); ! old = rdinx(0x3C4, 0x0B); ! wrinx(0x3C4, 0x0B, 0x00); ! chip = inp(0x3C5); ! old1 = rdinx(0x3C4, 0x0E); ! outp(0x3C5, 0); ! val = inp(0x3C5); ! outp(0x3C5, (old1 ^ 0x02)); wrinx(0x3C4, 0x0B, old); if ((val & 0x0F) == 2) { --- 37,63 ---- NUMPORTS, FALSE, FALSE, ! TRUE, ! MemProbe_Trident, }; Bool Probe_Trident(Chipset) int *Chipset; { Bool result = FALSE; Byte chip, old, old1, val; + Ports[0] = CRTC_IDX; + Ports[1] = CRTC_REG; EnableIOPorts(NUMPORTS, Ports); ! ! old = rdinx(SEQ_IDX, 0x0B); ! wrinx(SEQ_IDX, 0x0B, 0x00); ! chip = inp(SEQ_REG); ! old1 = rdinx(SEQ_IDX, 0x0E); ! outp(SEQ_REG, 0); ! val = inp(SEQ_REG); ! outp(SEQ_REG, (old1 ^ 0x02)); wrinx(0x3C4, 0x0B, old); if ((val & 0x0F) == 2) { *************** *** 62,68 **** result = TRUE; switch (chip) { ! case 0x01: *Chipset = CHIP_TVGA8800BR; break; case 0x02: --- 64,70 ---- result = TRUE; switch (chip) { ! case 0x01: /* Can't happen - no "new mode" */ *Chipset = CHIP_TVGA8800BR; break; case 0x02: *************** *** 81,92 **** case 0x33: *Chipset = CHIP_TVGA8900CL; break; case 0x83: ! *Chipset = CHIP_TVGA9200; break; case 0x93: ! *Chipset = CHIP_TVGA9100; break; default: Chip_data = chip; *Chipset = CHIP_TVGA_UNK; --- 83,110 ---- case 0x33: *Chipset = CHIP_TVGA8900CL; break; + case 0x43: + *Chipset = CHIP_TVGA9000I; + break; + case 0x53: + *Chipset = CHIP_TVGA9200CX; + break; + case 0x63: + *Chipset = CHIP_TVGA9100B; + break; + case 0x73: + case 0xF3: + *Chipset = CHIP_TVGA9420; + break; case 0x83: ! *Chipset = CHIP_TVGA8200; break; case 0x93: ! *Chipset = CHIP_TVGA9400CX; break; + case 0xA3: + *Chipset = CHIP_TVGA9320; + break; default: Chip_data = chip; *Chipset = CHIP_TVGA_UNK; *************** *** 93,99 **** --- 111,168 ---- break; } } + else if ((chip == 1) && (testinx2(SEQ_IDX, 0x0E, 0x06))) + { + result = TRUE; + *Chipset = CHIP_TVGA8800BR; + } + DisableIOPorts(NUMPORTS, Ports); return(result); } + static int MemProbe_Trident(Chipset) + int Chipset; + { + int Mem = 0; + + EnableIOPorts(NUMPORTS, Ports); + + switch (Chipset) + { + case CHIP_TVGA8800BR: + case CHIP_TVGA8800CS: + if (rdinx(CRTC_IDX, 0x1F) & 0x02) + { + Mem = 512; + } + else + { + Mem = 256; + } + break; + default: + switch (rdinx(CRTC_IDX, 0x1F) & 0x07) + { + case 0x00: + Mem = 256; + break; + case 0x01: + Mem = 512; + break; + case 0x02: + Mem = 768; + break; + case 0x03: + Mem = 1024; + break; + case 0x07: + Mem = 2048; + break; + } + break; + } + + DisableIOPorts(NUMPORTS, Ports); + return(Mem); + } diff -c mit/server/ddx/x386/SuperProbe/Tseng.c:2.2 mit/server/ddx/x386/SuperProbe/Tseng.c:2.6 *** mit/server/ddx/x386/SuperProbe/Tseng.c:2.2 Fri Mar 11 23:36:27 1994 --- mit/server/ddx/x386/SuperProbe/Tseng.c Fri Mar 11 23:36:27 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,33 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Tseng.c,v 2.2 1993/09/21 15:20:50 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x000, 0x000, 0x000, 0x3BF, 0x3CD}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor Tseng_Descriptor = { "Tseng", Probe_Tseng, --- 21,36 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Tseng.c,v 2.6 1994/03/02 08:04:57 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x000, 0x000, 0x000, 0x3BF, 0x3CB, 0x3CD, ! ATR_IDX, ATR_REG_R, SEQ_IDX, SEQ_REG}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_Tseng __STDCARGS((int)); + Chip_Descriptor Tseng_Descriptor = { "Tseng", Probe_Tseng, *************** *** 35,58 **** NUMPORTS, FALSE, FALSE, ! TRUE }; - #ifdef __STDC__ - Bool Probe_Tseng(int *Chipset) - #else Bool Probe_Tseng(Chipset) int *Chipset; - #endif { Bool result = FALSE; ! Byte old, old1; /* Add CRTC to enabled ports */ Ports[0] = CRTC_IDX; Ports[1] = CRTC_REG; ! Ports[2] = inp(0x3CC) & 0x01 ? 0x3D8 : 0x3B8; EnableIOPorts(NUMPORTS, Ports); old = inp(0x3BF); old1 = inp(Ports[2]); outp(0x3BF, 0x03); --- 38,59 ---- NUMPORTS, FALSE, FALSE, ! TRUE, ! MemProbe_Tseng, }; Bool Probe_Tseng(Chipset) int *Chipset; { Bool result = FALSE; ! Byte old, old1, ver; /* Add CRTC to enabled ports */ Ports[0] = CRTC_IDX; Ports[1] = CRTC_REG; ! Ports[2] = inp(MISC_OUT_R) & 0x01 ? 0x3D8 : 0x3B8; EnableIOPorts(NUMPORTS, Ports); + old = inp(0x3BF); old1 = inp(Ports[2]); outp(0x3BF, 0x03); *************** *** 59,74 **** outp(Ports[2], 0xA0); if (tstrg(0x3CD, 0x3F)) { - /* - * It is a Tseng; now figure out which one, and - * set Chipset. - */ result = TRUE; ! if (!testinx(CRTC_IDX, 0x1B)) { ! if (testinx2(CRTC_IDX, 0x30, 0x1F)) { ! *Chipset = CHIP_ET4000_W32; } else { --- 60,87 ---- outp(Ports[2], 0xA0); if (tstrg(0x3CD, 0x3F)) { result = TRUE; ! if (testinx2(CRTC_IDX, 0x33, 0x0F)) { ! if (tstrg(0x3CB, 0x33)) { ! ver = rdinx(0x217A, 0xEC); ! switch (ver >> 4) ! { ! case 0x00: ! *Chipset = CHIP_ET4000W32; ! break; ! case 0x02: ! *Chipset = CHIP_ET4000W32P; ! break; ! case 0x03: ! *Chipset = CHIP_ET4000W32I; ! break; ! default: ! Chip_data = ver >> 4; ! *Chipset = CHIP_TSENG_UNK; ! break; ! } } else { *************** *** 82,87 **** --- 95,173 ---- } outp(Ports[2], old1); outp(0x3BF, old); + DisableIOPorts(NUMPORTS, Ports); return(result); + } + + static int MemProbe_Tseng(Chipset) + int Chipset; + { + Byte Save[2]; + int Mem = 0; + + EnableIOPorts(NUMPORTS, Ports); + + /* + * Unlock + */ + Save[0] = inp(0x3BF); + Save[1] = inp(vgaIOBase + 8); + outp(0x3BF, 0x03); + outp(vgaIOBase + 8, 0xA0); + + /* + * Check + */ + switch (Chipset) + { + case CHIP_ET4000: + switch (rdinx(CRTC_IDX, 0x37) & 0x0B) + { + case 0x03: + case 0x05: + Mem = 256; + break; + case 0x0A: + Mem = 512; + break; + case 0x0B: + Mem = 1024; + break; + } + break; + case CHIP_ET4000W32: + case CHIP_ET4000W32I: + case CHIP_ET4000W32P: + switch (rdinx(CRTC_IDX, 0x37) & 0x09) + { + case 0x00: + Mem = 2048; + break; + case 0x01: + Mem = 4096; + break; + case 0x08: + Mem = 512; + break; + case 0x09: + Mem = 1024; + break; + } + if ((Chipset != CHIP_ET4000W32) && + (rdinx(CRTC_IDX, 0x32) & 0x80)) + { + Mem *= 2; + } + break; + } + + /* + * Lock + */ + outp(vgaIOBase + 8, Save[1]); + outp(0x3BF, Save[0]); + DisableIOPorts(NUMPORTS, Ports); + + return(Mem); } diff -c /dev/null mit/server/ddx/x386/SuperProbe/UMC.c:2.1 *** /dev/null Fri Mar 11 23:36:27 1994 --- mit/server/ddx/x386/SuperProbe/UMC.c Fri Mar 11 23:36:27 1994 *************** *** 0 **** --- 1,108 ---- + /* + * Copyright 1994 by David Wexelblat + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, 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 David Wexelblat not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. David Wexelblat makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + */ + + /* $XFree86: mit/server/ddx/x386/SuperProbe/UMC.c,v 2.1 1994/03/02 08:04:58 dawes Exp $ */ + + #include "Probe.h" + + static Word Ports[] = {0x3BF, SEQ_IDX, SEQ_REG}; + #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + + static int MemProbe_UMC __STDCARGS((int)); + + Chip_Descriptor UMC_Descriptor = { + "UMC", + Probe_UMC, + Ports, + NUMPORTS, + FALSE, + FALSE, + TRUE, + MemProbe_UMC, + }; + + Bool Probe_UMC(Chipset) + int *Chipset; + { + Bool result = FALSE; + Byte old; + + EnableIOPorts(NUMPORTS, Ports); + + old = inp(0x3BF); + outp(0x3BF, 0x03); + if (!testinx(SEQ_IDX, 0x06)) + { + outp(0x3BF, 0xAC); + if (testinx(SEQ_IDX, 0x06)) + { + result = TRUE; + *Chipset = CHIP_UMC_408; + } + } + outp(0x3BF, old); + + DisableIOPorts(NUMPORTS, Ports); + return(result); + } + + /* ARGSUSED */ + static int MemProbe_UMC(Chipset) + int Chipset; + { + Byte old; + int Mem = 0; + + EnableIOPorts(NUMPORTS, Ports); + + /* + * Unlock + */ + old = inp(0x3BF); + outp(0x3BF, 0xAC); + + /* + * Check + */ + switch(rdinx(SEQ_IDX, 0x07) >> 6) + { + case 0x00: + Mem = 256; + break; + case 0x01: + Mem = 512; + break; + case 0x02: + case 0x03: + Mem = 1024; + break; + } + + /* + * Lock + */ + outp(0x3BF, old); + + DisableIOPorts(NUMPORTS, Ports); + return(Mem); + } diff -c mit/server/ddx/x386/SuperProbe/Utils.c:2.2 mit/server/ddx/x386/SuperProbe/Utils.c:2.4 *** mit/server/ddx/x386/SuperProbe/Utils.c:2.2 Fri Mar 11 23:36:28 1994 --- mit/server/ddx/x386/SuperProbe/Utils.c Fri Mar 11 23:36:28 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Utils.c,v 2.2 1993/09/27 12:23:29 dawes Exp $ */ #include "Probe.h" #include "AsmMacros.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Utils.c,v 2.4 1994/03/03 12:42:31 dawes Exp $ */ #include "Probe.h" #include "AsmMacros.h" *************** *** 91,103 **** #endif { Byte tmp; ! Word Port = (inp(0x3CC) & 0x01) ? 0x3DA : 0x3BA; ! if (port == 0x3C0) { ! EnableIOPorts(1, &Port); ! tmp = inb(Port); /* Reset Attribute Reg flip-flop */ ! DisableIOPorts(1, &Port); } outb(port, index); return(inb(port+1)); --- 91,105 ---- #endif { Byte tmp; ! Word Port[2] = {MISC_OUT_R, 0x000}; ! if (port == ATR_IDX) { ! EnableIOPorts(1, Port); ! Port[1] = (inp(MISC_OUT_R) & 0x01) ? 0x3DA : 0x3BA; ! EnableIOPorts(2, Port); ! tmp = inp(Port[1]); /* Reset Attribute Reg flip-flop */ ! DisableIOPorts(2, Port); } outb(port, index); return(inb(port+1)); *************** *** 115,122 **** Byte val; #endif { ! outb(port, index); ! outb(port+1, val); } /* --- 117,208 ---- Byte val; #endif { ! Byte tmp; ! Word Port[2] = {MISC_OUT_R, 0x000}; ! ! if (port == ATR_REG_W) ! { ! EnableIOPorts(1, Port); ! Port[1] = (inp(MISC_OUT_R) & 0x01) ? 0x3DA : 0x3BA; ! EnableIOPorts(2, Port); ! tmp = inp(Port[1]); ! DisableIOPorts(2, Port); ! outp(port, index); ! outp(port, val); ! } ! else ! { ! outb(port, index); ! outb(port+1, val); ! } ! } ! ! /* ! * Set the word register 'port', index 'index' to 'val' ! */ ! #ifdef __STDC__ ! void wrinx2(Word port, Byte index, Word val) ! #else ! void wrinx2(port, index, val) ! Word port; ! Byte index; ! Word val; ! #endif ! { ! wrinx(port, index, (val) & 0xFF); ! wrinx(port, index+1, (val >> 8) & 0xFF); ! } ! ! /* ! * Set the longword register 'port', index 'index' to 'val' (3 bytes, actually) ! */ ! #ifdef __STDC__ ! void wrinx3(Word port, Byte index, Long val) ! #else ! void wrinx3(port, index, val) ! Word port; ! Byte index; ! Long val; ! #endif ! { ! wrinx(port, index, (val) & 0xFF); ! wrinx(port, index+1, (val >> 8) & 0xFF); ! wrinx(port, index+2, (val >> 16) & 0xFF); ! } ! ! /* ! * Set the word register 'port', index 'index' to 'val' (Motorola (big-endian) ! * byte order) ! */ ! #ifdef __STDC__ ! void wrinx2m(Word port, Byte index, Word val) ! #else ! void wrinx2m(port, index, val) ! Word port; ! Byte index; ! Word val; ! #endif ! { ! wrinx(port, index, (val >> 8) & 0xFF); ! wrinx(port, index+1, (val) & 0xFF); ! } ! ! /* ! * Set the longword register 'port', index 'index' to 'val' (3 bytes, actually) ! * (Motorola (big-endian) byte order) ! */ ! #ifdef __STDC__ ! void wrinx3m(Word port, Byte index, Long val) ! #else ! void wrinx3m(port, index, val) ! Word port; ! Byte index; ! Long val; ! #endif ! { ! wrinx(port, index, (val >> 16) & 0xFF); ! wrinx(port, index+1, (val >> 8) & 0xFF); ! wrinx(port, index+2, (val) & 0xFF); } /* *************** *** 140,145 **** --- 226,285 ---- } /* + * In register 'port' sets the bits in 'mask' as in 'nvw'. Other bits are + * left unchanged. + */ + #ifdef __STDC__ + void modreg(Word port, Byte mask, Byte nvw) + #else + void modreg(port, mask, nvw) + Word port; + Byte mask; + Byte nvw; + #endif + { + Byte tmp; + + tmp = (inp(port) & (~mask)) | (nvw & mask); + outp(port, tmp); + } + + /* + * Sets the bits in register 'port', index 'index' that are also set in 'val' + */ + #ifdef __STDC__ + void setinx(Word port, Byte index, Byte val) + #else + void setinx(port, index, val) + Word port; + Byte index; + Byte val; + #endif + { + Byte tmp; + + tmp = rdinx(port, index); + wrinx(port, index, tmp | val); + } + + /* + * Clears the bits in register 'port', index 'index' that are set in 'val' + */ + #ifdef __STDC__ + void clrinx(Word port, Byte index, Byte val) + #else + void clrinx(port, index, val) + Word port; + Byte index; + Byte val; + #endif + { + Byte tmp; + + tmp = rdinx(port, index); + wrinx(port, index, tmp & ~val); + } + /* * Return TRUE iff the bits in 'mask' of register 'port' are read/write. */ #ifdef __STDC__ *************** *** 193,199 **** #else Bool testinx(port, index) Word port; ! Word index; #endif { return(testinx2(port, index, 0xFF)); --- 333,339 ---- #else Bool testinx(port, index) Word port; ! Byte index; #endif { return(testinx2(port, index, 0xFF)); *************** *** 202,226 **** /* * Force DAC back to PEL mode */ - #ifdef __STDC__ - void dactopel(void) - #else void dactopel() - #endif { (void)inp(0x3C8); } /* ! * Enter command mode of HiColor DACs (result is stored in extern DACcommand) */ ! #ifdef __STDC__ ! Byte dactocomm(void) ! #else ! Byte dactocomm() ! #endif { - dactopel(); (void)inp(0x3C6); (void)inp(0x3C6); (void)inp(0x3C6); --- 342,357 ---- /* * Force DAC back to PEL mode */ void dactopel() { (void)inp(0x3C8); } /* ! * Trigger HiColor DACs to change mode. */ ! Byte trigdac() { (void)inp(0x3C6); (void)inp(0x3C6); (void)inp(0x3C6); *************** *** 228,243 **** } /* * Check chip descriptor against exclusion list */ - #ifdef __STDC__ - Bool Excluded(Range *ExList, Chip_Descriptor *Chip, Bool Mask10) - #else Bool Excluded(ExList, Chip, Mask10) Range *ExList; Chip_Descriptor *Chip; Bool Mask10; - #endif { int i, j; Word mask = (Mask10 ? 0x3FF : 0xFFFF); --- 359,417 ---- } /* + * Enter command mode of HiColor DACs. + */ + Byte dactocomm() + { + dactopel(); + return(trigdac()); + } + + /* + * Get the HiColor DAC command register and return to PEL mode. + */ + Byte getdaccomm() + { + Byte ret; + + dactocomm(); + ret = inp(0x3C6); + dactopel(); + + return(ret); + } + + /* + * Wait for vertical retrace interval. + */ + void waitforretrace() + { + Word Port[2] = {MISC_OUT_R, 0x000}; + + EnableIOPorts(1, Port); + + Port[1] = (inp(MISC_OUT_R) & 0x01) ? 0x3DA : 0x3BA; + EnableIOPorts(2, Port); + while ((inp(Port[1]) & 0x08) != 0) + { + /* Idle */ + } + while ((inp(Port[1]) & 0x08) == 0) + { + /* Idle */ + } + + DisableIOPorts(2, Port); + return; + } + + /* * Check chip descriptor against exclusion list */ Bool Excluded(ExList, Chip, Mask10) Range *ExList; Chip_Descriptor *Chip; Bool Mask10; { int i, j; Word mask = (Mask10 ? 0x3FF : 0xFFFF); *************** *** 278,290 **** return(FALSE); } - #ifdef __STDC__ - int StrCaseCmp(char *s1, char *s2) - #else int StrCaseCmp(s1, s2) char *s1; char *s2; - #endif { char c1, c2; --- 452,460 ---- *************** *** 308,322 **** return(c1 - c2); } - #ifdef __STDC__ - unsigned int StrToUL(const char *str) - #else unsigned int StrToUL(str) ! char *str; ! #endif { int base = 10; ! const char *p = str; unsigned int tot = 0; if (*p == '0') --- 478,488 ---- return(c1 - c2); } unsigned int StrToUL(str) ! CONST char *str; { int base = 10; ! CONST char *p = str; unsigned int tot = 0; if (*p == '0') diff -c mit/server/ddx/x386/SuperProbe/VGA.c:2.2 mit/server/ddx/x386/SuperProbe/VGA.c:2.4 *** mit/server/ddx/x386/SuperProbe/VGA.c:2.2 Fri Mar 11 23:36:29 1994 --- mit/server/ddx/x386/SuperProbe/VGA.c Fri Mar 11 23:36:29 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/VGA.c,v 2.2 1993/09/21 15:20:51 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/VGA.c,v 2.4 1994/02/28 14:10:02 dawes Exp $ */ #include "Probe.h" *************** *** 32,37 **** --- 32,39 ---- static Word Ports[] = {0x3C0, 0x3C1}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_VGA __STDCARGS((int)); + Chip_Descriptor VGA_Descriptor = { "VGA", Probe_VGA, *************** *** 39,53 **** NUMPORTS, FALSE, FALSE, ! TRUE }; - #ifdef __STDC__ - Bool Probe_VGA(int *Chipset) - #else Bool Probe_VGA(Chipset) int *Chipset; - #endif { Bool result = FALSE; Byte origVal, newVal; --- 41,52 ---- NUMPORTS, FALSE, FALSE, ! TRUE, ! MemProbe_VGA, }; Bool Probe_VGA(Chipset) int *Chipset; { Bool result = FALSE; Byte origVal, newVal; *************** *** 64,67 **** --- 63,73 ---- *Chipset = CHIP_VGA; } return(result); + } + + /* ARGSUSED */ + static int MemProbe_VGA(Chipset) + int Chipset; + { + return(256); } diff -c mit/server/ddx/x386/SuperProbe/Video7.c:2.2 mit/server/ddx/x386/SuperProbe/Video7.c:2.4 *** mit/server/ddx/x386/SuperProbe/Video7.c:2.2 Fri Mar 11 23:36:29 1994 --- mit/server/ddx/x386/SuperProbe/Video7.c Fri Mar 11 23:36:29 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,31 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Video7.c,v 2.2 1993/09/27 12:23:30 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x000, 0x000, 0x3C4, 0x3C5}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor Video7_Descriptor = { --- 21,31 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Video7.c,v 2.4 1994/02/28 14:10:03 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x000, 0x000, SEQ_IDX, SEQ_REG}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor Video7_Descriptor = { *************** *** 35,57 **** NUMPORTS, FALSE, FALSE, ! TRUE }; - #ifdef __STDC__ - Bool Probe_Video7(int *Chipset) - #else Bool Probe_Video7(Chipset) int *Chipset; - #endif { Bool result = FALSE; ! Byte old, old1, id; /* Add CRTC to enabled ports */ Ports[0] = CRTC_IDX; Ports[1] = CRTC_REG; EnableIOPorts(NUMPORTS, Ports); old = rdinx(0x3C4, 0x06); wrinx(0x3C4, 0x06, 0xEA); /* enable extensions */ old1 = rdinx(CRTC_IDX, 0x0C); --- 35,56 ---- NUMPORTS, FALSE, FALSE, ! TRUE, ! NULL, }; Bool Probe_Video7(Chipset) int *Chipset; { Bool result = FALSE; ! Byte old, old1; ! Word id; /* Add CRTC to enabled ports */ Ports[0] = CRTC_IDX; Ports[1] = CRTC_REG; EnableIOPorts(NUMPORTS, Ports); + old = rdinx(0x3C4, 0x06); wrinx(0x3C4, 0x06, 0xEA); /* enable extensions */ old1 = rdinx(CRTC_IDX, 0x0C); *************** *** 64,85 **** * It's Video7 */ result = TRUE; ! id = rdinx(0x3C4, 0x8E); ! if ((id < 0xFF) && (id >= 0x80)) { ! *Chipset = CHIP_V7_VEGA; } ! else if ((id < 0x7F) && (id >= 0x70)) { ! *Chipset = CHIP_V7_FWRITE; } ! else if ((id < 0x5A) && (id >= 0x50)) { ! *Chipset = CHIP_V7_VRAM2; } ! else if ((id < 0x4A) && (id >= 0x40)) { ! *Chipset = CHIP_V7_1024i; } else { --- 63,104 ---- * It's Video7 */ result = TRUE; ! id = (rdinx(SEQ_IDX, 0x8F) << 8) | rdinx(0x3C4, 0x8E); ! if ((id >= 0x7000) && (id <= 0x70FF)) { ! *Chipset = CHIP_V7_FWRITE; } ! else if ((id >= 0x7140) && (id <= 0x714F)) { ! *Chipset = CHIP_V7_1024i; } ! else if (id == 0x7151) { ! *Chipset = CHIP_V7_VRAM2_B; } ! else if (id == 0x7152) { ! *Chipset = CHIP_V7_VRAM2_C; ! } ! else if (id == 0x7760) ! { ! *Chipset = CHIP_HT216BC; ! } ! else if (id == 0x7763) ! { ! *Chipset = CHIP_HT216D; ! } ! else if (id == 0x7764) ! { ! *Chipset = CHIP_HT216E; ! } ! else if (id == 0x7765) ! { ! *Chipset = CHIP_HT216F; ! } ! else if ((id >= 0x8000) && (id < 0xFFFF)) ! { ! *Chipset = CHIP_V7_VEGA; } else { diff -c mit/server/ddx/x386/SuperProbe/WD.c:2.2 mit/server/ddx/x386/SuperProbe/WD.c:2.5 *** mit/server/ddx/x386/SuperProbe/WD.c:2.2 Fri Mar 11 23:36:30 1994 --- mit/server/ddx/x386/SuperProbe/WD.c Fri Mar 11 23:36:30 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,33 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/WD.c,v 2.2 1993/09/22 15:42:22 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x000, 0x000, 0x3CE, 0x3CF, 0x3C4, 0x3C5}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) Chip_Descriptor WD_Descriptor = { "WD", Probe_WD, --- 21,35 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/WD.c,v 2.5 1994/03/02 08:05:00 dawes Exp $ */ #include "Probe.h" ! static Word Ports[] = {0x000, 0x000, GRC_IDX, GRC_REG, SEQ_IDX, SEQ_REG}; #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + static int MemProbe_WD __STDCARGS((int)); + Chip_Descriptor WD_Descriptor = { "WD", Probe_WD, *************** *** 35,51 **** NUMPORTS, FALSE, FALSE, ! TRUE }; - #ifdef __STDC__ - Bool Probe_WD(int *Chipset) - #else Bool Probe_WD(Chipset) int *Chipset; - #endif { ! Byte old, old1, old2, old3; Bool result = FALSE; /* Add CRTC to enabled ports */ --- 37,51 ---- NUMPORTS, FALSE, FALSE, ! TRUE, ! MemProbe_WD, }; Bool Probe_WD(Chipset) int *Chipset; { ! Byte old, old1, old2; ! Word ver; Bool result = FALSE; /* Add CRTC to enabled ports */ *************** *** 52,63 **** Ports[0] = CRTC_IDX; Ports[1] = CRTC_REG; EnableIOPorts(NUMPORTS, Ports); ! old = rdinx(0x3CE, 0x0F); ! modinx(0x3CE, 0x0F, 0x17, 0x00); /* Lock registers */ ! if (!testinx2(0x3CE, 0x09, 0x7F)) { ! wrinx(0x3CE, 0x0F, 0x05); /* Unlock them again */ ! if (testinx2(0x3CE, 0x09, 0x7F)) { result = TRUE; old2 = rdinx(CRTC_IDX, 0x29); --- 52,64 ---- Ports[0] = CRTC_IDX; Ports[1] = CRTC_REG; EnableIOPorts(NUMPORTS, Ports); ! ! old = rdinx(GRC_IDX, 0x0F); ! setinx(GRC_IDX, 0x0F, 0x17); /* Lock registers */ ! if (!testinx2(GRC_IDX, 0x09, 0x7F)) { ! wrinx(GRC_IDX, 0x0F, 0x05); /* Unlock them again */ ! if (testinx2(GRC_IDX, 0x09, 0x7F)) { result = TRUE; old2 = rdinx(CRTC_IDX, 0x29); *************** *** 69,81 **** } else { ! old1 = rdinx(0x3C4, 0x06); ! wrinx(0x3C4, 0x06, 0x48); ! if (!testinx2(0x3C4, 0x07, 0xF0)) { *Chipset = CHIP_WD_90C00; } ! else if (!testinx(0x3C4, 0x10)) { if (testinx2(CRTC_IDX, 0x31, 0x68)) { --- 70,82 ---- } else { ! old1 = rdinx(SEQ_IDX, 0x06); ! wrinx(SEQ_IDX, 0x06, 0x48); ! if (!testinx2(SEQ_IDX, 0x07, 0xF0)) { *Chipset = CHIP_WD_90C00; } ! else if (!testinx(SEQ_IDX, 0x10)) { if (testinx2(CRTC_IDX, 0x31, 0x68)) { *************** *** 90,121 **** *Chipset = CHIP_WD_90C20; } wrinx(CRTC_IDX, 0x34, 0xA6); ! if (rdinx(CRTC_IDX, 0x32)) { wrinx(CRTC_IDX, 0x34, 0x00); } } ! else if (testinx(0x3C4, 0x25)) ! { ! *Chipset = CHIP_WD_90C24; ! } ! else if (testinx2(0x3C4, 0x14, 0x0F)) { ! old3 = rdinx(CRTC_IDX, 0x34); ! wrinx(CRTC_IDX, 0x34, 0xA0); ! if (testinx(CRTC_IDX, 0x31)) ! { *Chipset = CHIP_WD_90C26; ! } ! else if (rdinx(CRTC_IDX, 0x37) == 0x31) ! { ! *Chipset = CHIP_WD_90C31; ! } ! else ! { *Chipset = CHIP_WD_90C30; } - wrinx(CRTC_IDX, 0x34, old3); } else if (!testinx2(0x3C4, 0x10, 0x04)) { --- 91,127 ---- *Chipset = CHIP_WD_90C20; } wrinx(CRTC_IDX, 0x34, 0xA6); ! if (rdinx(CRTC_IDX, 0x32) & 0x20) { wrinx(CRTC_IDX, 0x34, 0x00); } } ! else if (testinx2(SEQ_IDX, 0x14, 0x0F)) { ! ver = ((rdinx(CRTC_IDX, 0x36) << 8) | ! (rdinx(CRTC_IDX, 0x37))); ! switch (ver) ! { ! case 0x3234: ! *Chipset = CHIP_WD_90C24; ! break; ! case 0x3236: *Chipset = CHIP_WD_90C26; ! break; ! case 0x3330: *Chipset = CHIP_WD_90C30; + break; + case 0x3331: + *Chipset = CHIP_WD_90C31; + break; + case 0x3333: + *Chipset = CHIP_WD_90C33; + break; + default: + Chip_data = ver & 0xFF; + *Chipset = CHIP_WD_UNK; + break; } } else if (!testinx2(0x3C4, 0x10, 0x04)) { *************** *** 131,136 **** --- 137,189 ---- } } wrinx(0x3CE, 0x0F, old); + DisableIOPorts(NUMPORTS, Ports); return(result); + } + + static int MemProbe_WD(Chipset) + int Chipset; + { + Byte old; + int Mem = 0; + + EnableIOPorts(NUMPORTS, Ports); + + /* + * Unlock + */ + old = rdinx(GRC_IDX, 0x0F); + wrinx(GRC_IDX, 0x0F, 0x05); + + /* + * Check + */ + switch (rdinx(GRC_IDX, 0x0B) >> 6) + { + case 0x00: + case 0x01: + Mem = 256; + break; + case 0x02: + Mem = 512; + break; + case 0x03: + Mem = 1024; + break; + } + + if ((Chipset >= CHIP_WD_90C33) && + (rdinx(CRTC_IDX, 0x3E) & 0x80)) + { + Mem = 2048; + } + + /* + * Lock + */ + wrinx(GRC_IDX, 0x0F, old); + + DisableIOPorts(NUMPORTS, Ports); + return(Mem); } diff -c /dev/null mit/server/ddx/x386/SuperProbe/Weitek.c:2.1 *** /dev/null Fri Mar 11 23:36:30 1994 --- mit/server/ddx/x386/SuperProbe/Weitek.c Fri Mar 11 23:36:31 1994 *************** *** 0 **** --- 1,119 ---- + /* + * Copyright 1994 by David Wexelblat + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, 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 David Wexelblat not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. David Wexelblat makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + */ + + /* $XFree86: mit/server/ddx/x386/SuperProbe/Weitek.c,v 2.1 1994/03/07 13:56:09 dawes Exp $ */ + + #include "Probe.h" + + static Word Ports[] = {0x3CD, SEQ_IDX, SEQ_REG}; + #define NUMPORTS (sizeof(Ports)/sizeof(Word)) + + Chip_Descriptor Weitek_Descriptor = { + "Weitek", + Probe_Weitek, + Ports, + NUMPORTS, + FALSE, + FALSE, + TRUE, + NULL, + }; + + static Byte WeitekEnable(Flag) + Byte Flag; + { + Byte new, old, x; + + old = rdinx(SEQ_IDX, 0x11); + for (x=0; x < 10; x++) + { + ; + } + outp(SEQ_REG, old); + for (x=0; x < 10; x++) + { + ; + } + outp(SEQ_REG, old); + for (x=0; x < 10; x++) + { + ; + } + new = inp(SEQ_REG); + for (x=0; x < 10; x++) + { + ; + } + outp(SEQ_REG, (new & 0x9F) | Flag); + + return(old); + } + + Bool Probe_Weitek(Chipset) + int *Chipset; + { + Bool result = FALSE; + Byte old, ver; + + EnableIOPorts(NUMPORTS, Ports); + + /* + * Disable extensions + */ + old = WeitekEnable(0x60); + if (!testinx(SEQ_IDX, 0x12)) + { + /* + * Enable extensions + */ + WeitekEnable(0); + if (testinx(SEQ_IDX, 0x12)) + { + if (tstrg(0x3CD, 0xFF)) + { + result = TRUE; + ver = rdinx(SEQ_IDX, 0x07) >> 5; + switch (ver) + { + case 0x00: /* guess */ + *Chipset = CHIP_WEIT_5086; + break; + case 0x01: + *Chipset = CHIP_WEIT_5186; + break; + case 0x02: + *Chipset = CHIP_WEIT_5286; + break; + default: + Chip_data = ver; + *Chipset = CHIP_WEIT_UNK; + break; + } + } + } + } + + wrinx(SEQ_IDX, 0x12, old); + DisableIOPorts(NUMPORTS, Ports); + return(result); + } diff -c mit/server/ddx/x386/SuperProbe/Yamaha.c:2.1 mit/server/ddx/x386/SuperProbe/Yamaha.c:2.3 *** mit/server/ddx/x386/SuperProbe/Yamaha.c:2.1 Fri Mar 11 23:36:31 1994 --- mit/server/ddx/x386/SuperProbe/Yamaha.c Fri Mar 11 23:36:31 1994 *************** *** 1,5 **** /* ! * Copyright 1993 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that --- 1,5 ---- /* ! * Copyright 1993,1994 by David Wexelblat * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Yamaha.c,v 2.1 1993/09/21 15:20:54 dawes Exp $ */ #include "Probe.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/SuperProbe/Yamaha.c,v 2.3 1994/02/28 14:10:07 dawes Exp $ */ #include "Probe.h" *************** *** 35,49 **** NUMPORTS, FALSE, FALSE, ! TRUE }; - #ifdef __STDC__ - Bool Probe_Yamaha(int *Chipset) - #else Bool Probe_Yamaha(Chipset) int *Chipset; - #endif { Bool result = FALSE; --- 35,46 ---- NUMPORTS, FALSE, FALSE, ! TRUE, ! NULL, }; Bool Probe_Yamaha(Chipset) int *Chipset; { Bool result = FALSE; diff -c mit/server/ddx/x386/accel/ibm8514/Imakefile:2.7 mit/server/ddx/x386/accel/ibm8514/Imakefile:2.8 *** mit/server/ddx/x386/accel/ibm8514/Imakefile:2.7 Fri Mar 11 23:36:40 1994 --- mit/server/ddx/x386/accel/ibm8514/Imakefile Fri Mar 11 23:36:40 1994 *************** *** 1,4 **** ! XCOMM $XFree86: mit/server/ddx/x386/accel/ibm8514/Imakefile,v 2.7 1993/09/21 15:21:18 dawes Exp $ #include SRCS = ibm8514.c ibm8514cmap.c ibm8514gc.c ibm8514fs.c ibm8514ss.c \ --- 1,4 ---- ! XCOMM $XFree86: mit/server/ddx/x386/accel/ibm8514/Imakefile,v 2.8 1993/12/03 13:13:47 dawes Exp $ #include SRCS = ibm8514.c ibm8514cmap.c ibm8514gc.c ibm8514fs.c ibm8514ss.c \ *************** *** 7,13 **** ibm8514line.c ibm8514seg.c ibm8514frec.c ibm8514text.c \ ibm8514font.c ibm8514fcac.c \ ibm8514dsln.c ibm8514dssg.c ibm8514ddln.c ibm8514ddsg.c \ ! ibm8514imwr.s ibm8514imrd.s ibm8514imfl.s ibm8514imst.s OBJS = ibm8514.o ibm8514cmap.o ibm8514gc.o ibm8514fs.o ibm8514ss.o \ ibm8514gs.o ibm8514win.o ibm8514init.o ibm8514im.o ibm8514bsto.o \ --- 7,14 ---- ibm8514line.c ibm8514seg.c ibm8514frec.c ibm8514text.c \ ibm8514font.c ibm8514fcac.c \ ibm8514dsln.c ibm8514dssg.c ibm8514ddln.c ibm8514ddsg.c \ ! ibm8514imwr.s ibm8514imrd.s ibm8514imfl.s ibm8514imst.s \ ! ibm8514gtim.c OBJS = ibm8514.o ibm8514cmap.o ibm8514gc.o ibm8514fs.o ibm8514ss.o \ ibm8514gs.o ibm8514win.o ibm8514init.o ibm8514im.o ibm8514bsto.o \ *************** *** 15,21 **** ibm8514line.o ibm8514seg.o ibm8514frec.o ibm8514text.o \ ibm8514font.o ibm8514fcac.o \ ibm8514dsln.o ibm8514dssg.o ibm8514ddln.o ibm8514ddsg.o \ ! ibm8514imwr.o ibm8514imrd.o ibm8514imfl.o ibm8514imst.o INCLUDES = -I../../common -I../../os-support -I. \ -I../../../mfb -I../../../mi -I../../../../include \ --- 16,23 ---- ibm8514line.o ibm8514seg.o ibm8514frec.o ibm8514text.o \ ibm8514font.o ibm8514fcac.o \ ibm8514dsln.o ibm8514dssg.o ibm8514ddln.o ibm8514ddsg.o \ ! ibm8514imwr.o ibm8514imrd.o ibm8514imfl.o ibm8514imst.o \ ! ibm8514gtim.o INCLUDES = -I../../common -I../../os-support -I. \ -I../../../mfb -I../../../mi -I../../../../include \ diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514.c:2.11 mit/server/ddx/x386/accel/ibm8514/ibm8514.c:2.15 *** mit/server/ddx/x386/accel/ibm8514/ibm8514.c:2.11 Fri Mar 11 23:36:40 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514.c Fri Mar 11 23:36:40 1994 *************** *** 27,35 **** * Header: /proj/X11/mit/server/ddx/x386/vga/RCS/vga.c,v 1.2 1991/06/27 00:02:49 root Exp */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514.c,v 2.11 1993/10/02 07:14:07 dawes Exp $ */ #include "X.h" #include "input.h" #include "pixmapstr.h" #include "scrnintstr.h" --- 27,36 ---- * Header: /proj/X11/mit/server/ddx/x386/vga/RCS/vga.c,v 1.2 1991/06/27 00:02:49 root Exp */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514.c,v 2.15 1994/01/09 03:30:03 dawes Exp $ */ #include "X.h" + #include "Xmd.h" #include "input.h" #include "pixmapstr.h" #include "scrnintstr.h" *************** *** 40,45 **** --- 41,47 ---- #include "x386.h" #include "x386Priv.h" + #include "x386Procs.h" #include "xf86_OSlib.h" #include "ibm8514.h" #include "reg8514.h" *************** *** 47,52 **** --- 49,57 ---- extern Bool x386Exiting, x386Resetting, x386ProbeFailed, x386Verbose; extern void NoopDDA(); + extern Bool mfbRegisterCopyPlaneProc(); + extern Bool miDCInitialize(); + extern void SetTimeSinceLastInputEvent(); ScrnInfoRec ibm8514InfoRec = { FALSE, /* Bool configured */ *************** *** 74,79 **** --- 79,85 ---- 0, /* int maxClock */ 0, /* int videoRam */ 0, /* int BIOSbase, 1.3 new */ + 0, /* unsigned long MemBase, unused for this driver */ 240, 180, /* int width, height */ 0, /* unsigned long speedup */ NULL, /* DisplayModePtr modes */ *************** *** 113,120 **** static int ibm8514ScreenMode; static ScreenPtr savepScreen = NULL; - static unsigned ibm8514_IOPorts[] = { DAC_MASK, DAC_R_INDEX, DAC_W_INDEX, DAC_DATA, DISP_STAT, H_TOTAL, H_DISP, H_SYNC_STRT, H_SYNC_WID, --- 119,126 ---- static int ibm8514ScreenMode; static ScreenPtr savepScreen = NULL; + static PixmapPtr ppix = NULL; static unsigned ibm8514_IOPorts[] = { DAC_MASK, DAC_R_INDEX, DAC_W_INDEX, DAC_DATA, DISP_STAT, H_TOTAL, H_DISP, H_SYNC_STRT, H_SYNC_WID, *************** *** 204,209 **** --- 210,218 ---- int argc; /* The number of the Server's arguments. */ char **argv; /* The arguments themselves. Don't change! */ { + int displayResolution = 75; /* default to 75dpi */ + extern int monitorResolution; + if (ibm8514InfoRec.virtualX == 1024 && ibm8514InfoRec.virtualY == 768) { ibm8514ScreenMode = MODE_1024; } else if (ibm8514InfoRec.virtualX == 640 && *************** *** 232,241 **** ibm8514ImageInit(); if (!ibm8514ScreenInit(pScreen, (pointer) 0, ibm8514InfoRec.virtualX, ibm8514InfoRec.virtualY, ! 75, 75, ibm8514InfoRec.virtualX)) return(FALSE); --- 241,257 ---- ibm8514ImageInit(); + /* + * Take display resolution from the -dpi flag if specified + */ + + if (monitorResolution) + displayResolution = monitorResolution; + if (!ibm8514ScreenInit(pScreen, (pointer) 0, ibm8514InfoRec.virtualX, ibm8514InfoRec.virtualY, ! displayResolution, displayResolution, ibm8514InfoRec.virtualX)) return(FALSE); *************** *** 266,272 **** int screen_idx; { PixmapPtr pspix; - static PixmapPtr ppix = NULL; ScreenPtr pScreen = savepScreen; if (!x386Resetting && !x386Exiting) --- 282,287 ---- *************** *** 308,314 **** ibm8514ImageRead(0, 0, pScreen->width, pScreen->height, ppix->devPrivate.ptr, PixmapBytePad(pScreen->width, pScreen->rootDepth), ! 0, 0); pspix->devPrivate.ptr = ppix->devPrivate.ptr; } } --- 323,329 ---- ibm8514ImageRead(0, 0, pScreen->width, pScreen->height, ppix->devPrivate.ptr, PixmapBytePad(pScreen->width, pScreen->rootDepth), ! 0, 0, 0xff); pspix->devPrivate.ptr = ppix->devPrivate.ptr; } } *************** *** 345,350 **** --- 360,373 ---- x386Exiting = TRUE; if (x386VTSema) ibm8514EnterLeaveVT(LEAVE, screen_idx); + else if (ppix) { + /* + * 7-Jan-94 CEG: The server is not running on the current vt. + * Free the screen snapshot taken when the server vt was left. + */ + (savepScreen->DestroyPixmap)(ppix); + ppix = NULL; + } return(TRUE); } diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514.h:2.3 mit/server/ddx/x386/accel/ibm8514/ibm8514.h:2.6 *** mit/server/ddx/x386/accel/ibm8514/ibm8514.h:2.3 Fri Mar 11 23:36:41 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514.h Fri Mar 11 23:36:41 1994 *************** *** 22,28 **** * Modified by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514.h,v 2.3 1993/09/21 15:21:19 dawes Exp $ */ #ifndef IBM8514_H #define IBM8514_H --- 22,28 ---- * Modified by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514.h,v 2.6 1993/12/25 13:57:09 dawes Exp $ */ #ifndef IBM8514_H #define IBM8514_H *************** *** 41,46 **** --- 41,47 ---- extern Bool ibm8514SaveScreen(); extern Bool ibm8514CloseScreen(); + extern Bool ibm8514ScreenInit(); extern void ibm8514RestoreDACvalues(); extern int ibm8514ListInstalledColormaps(); *************** *** 56,62 **** extern void ibm8514ImageWrite(); extern void ibm8514ImageFill(); extern void ibm8514ImageStipple(); - extern void ibm8514ImageOpStipple(); extern void ibm8514CacheInit(); extern void ibm8514FontCache8Init(); --- 57,62 ---- *************** *** 104,109 **** --- 104,111 ---- extern void ibm8514RestoreAreas(); extern Bool ibm8514CreateGC(); + + extern void ibm8514GetImage(); extern ScrnInfoRec ibm8514InfoRec; diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514blt.c:2.3 mit/server/ddx/x386/accel/ibm8514/ibm8514blt.c:2.7 *** mit/server/ddx/x386/accel/ibm8514/ibm8514blt.c:2.3 Fri Mar 11 23:36:42 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514blt.c Fri Mar 11 23:36:42 1994 *************** *** 27,33 **** */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514blt.c,v 2.3 1993/09/12 11:24:51 dawes Exp $ */ /* $XConsortium: cfbbitblt.c,v 5.39 91/05/24 16:33:25 keith Exp $ */ --- 27,33 ---- */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514blt.c,v 2.7 1994/02/25 14:57:03 dawes Exp $ */ /* $XConsortium: cfbbitblt.c,v 5.39 91/05/24 16:33:25 keith Exp $ */ *************** *** 47,57 **** #include "reg8514.h" #include "ibm8514.h" ! void ibm8514FindOrdering(); - static unsigned long bitBltPlane = 0; - - RegionPtr ibm8514CopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty) --- 47,54 ---- #include "reg8514.h" #include "ibm8514.h" ! extern RegionPtr cfbBitBlt(); RegionPtr ibm8514CopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty) *************** *** 356,362 **** for (i = numRects; --i >= 0; pbox++) ibm8514ImageRead(pbox->x1 + dx, pbox->y1 + dy, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, ! pdst, pixWidth, pbox->x1, pbox->y1); } else if (pSrcDrawable->type != DRAWABLE_WINDOW && pDstDrawable->type == DRAWABLE_WINDOW) { /* Pixmap --> Window */ int pixWidth = PixmapBytePad(pSrcDrawable->width, pSrcDrawable->depth); --- 353,359 ---- for (i = numRects; --i >= 0; pbox++) ibm8514ImageRead(pbox->x1 + dx, pbox->y1 + dy, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, ! pdst, pixWidth, pbox->x1, pbox->y1, 0xff); } else if (pSrcDrawable->type != DRAWABLE_WINDOW && pDstDrawable->type == DRAWABLE_WINDOW) { /* Pixmap --> Window */ int pixWidth = PixmapBytePad(pSrcDrawable->width, pSrcDrawable->depth); *************** *** 521,528 **** (void) cfbBitBlt(pSrcDrawable, (DrawablePtr)pBitmap, pGC1, srcx, srcy, width, height, 0, 0, cfbCopyPlane8to1, bitPlane); pSrcDrawable = (DrawablePtr)pBitmap; ! } ! else if (((pSrcDrawable->type == DRAWABLE_WINDOW) && (pDstDrawable->type != DRAWABLE_WINDOW)) || ((pSrcDrawable->type != DRAWABLE_WINDOW) && (pDstDrawable->type == DRAWABLE_WINDOW) && --- 518,550 ---- (void) cfbBitBlt(pSrcDrawable, (DrawablePtr)pBitmap, pGC1, srcx, srcy, width, height, 0, 0, cfbCopyPlane8to1, bitPlane); pSrcDrawable = (DrawablePtr)pBitmap; ! } else if ((pSrcDrawable->type == DRAWABLE_WINDOW) && ! (pDstDrawable->type != DRAWABLE_WINDOW)) { ! /* ! * Shortcut - we can do Window->Pixmap by copying the window to ! * a pixmap, then we have a Pixmap->Pixmap operation ! */ ! GCPtr pGC1; ! RegionPtr retval; ! PixmapPtr pPixmap; ! ! pPixmap=(*pSrcDrawable->pScreen->CreatePixmap)(pSrcDrawable->pScreen, ! width, height, 8); ! if (!pPixmap) ! return(NULL); ! pGC1 = GetScratchGC(8, pSrcDrawable->pScreen); ! if (!pGC1) { ! (*pSrcDrawable->pScreen->DestroyPixmap)(pPixmap); ! return(NULL); ! } ! ValidateGC((DrawablePtr)pPixmap, pGC1); ! ibm8514CopyArea(pSrcDrawable, pPixmap, pGC1, srcx, srcy, width, height, ! 0, 0); ! retval = cfbCopyPlane((DrawablePtr)pPixmap, pDstDrawable, pGC, ! 0, 0, width, height, dstx, dsty, bitPlane); ! (*pSrcDrawable->pScreen->DestroyPixmap)(pPixmap); ! return(retval); ! } else if (((pSrcDrawable->type == DRAWABLE_WINDOW) && (pDstDrawable->type != DRAWABLE_WINDOW)) || ((pSrcDrawable->type != DRAWABLE_WINDOW) && (pDstDrawable->type == DRAWABLE_WINDOW) && *************** *** 797,808 **** psrc = pix->devPrivate.ptr; for (i = numRects; --i >= 0; pbox++) { ! ibm8514ImageOpStipple(pbox->x1, pbox->y1, ! pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, ! psrc, pixWidth, ! pix->drawable.width, pix->drawable.height, ! -dx, -dy, pGC->fgPixel, pGC->bgPixel, ! ibm8514alu[pGC->alu], (short) pGC->planemask); } } else { /* Pixmap --> Pixmap */ --- 819,831 ---- psrc = pix->devPrivate.ptr; for (i = numRects; --i >= 0; pbox++) { ! ibm8514ImageStipple(pbox->x1, pbox->y1, ! pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, ! psrc, pixWidth, ! pix->drawable.width, pix->drawable.height, ! -dx, -dy, pGC->fgPixel, pGC->bgPixel, ! ibm8514alu[pGC->alu], ! (short) pGC->planemask, 1); } } else { /* Pixmap --> Pixmap */ diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514bsto.c:2.3 mit/server/ddx/x386/accel/ibm8514/ibm8514bsto.c:2.4 *** mit/server/ddx/x386/accel/ibm8514/ibm8514bsto.c:2.3 Fri Mar 11 23:36:43 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514bsto.c Fri Mar 11 23:36:43 1994 *************** *** 25,31 **** * Modified by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514bsto.c,v 2.3 1993/08/17 16:14:42 dawes Exp $ */ #include "cfb.h" #include "X.h" --- 25,31 ---- * Modified by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514bsto.c,v 2.4 1993/12/03 13:13:53 dawes Exp $ */ #include "cfb.h" #include "X.h" *************** *** 64,70 **** ibm8514ImageRead(pBox->x1 + xorg, pBox->y1 + yorg, pBox->x2 - pBox->x1, pBox->y2 - pBox->y1, pPixmap->devPrivate.ptr, pixWidth, ! pBox->x1, pBox->y1); pBox++; } } --- 64,70 ---- ibm8514ImageRead(pBox->x1 + xorg, pBox->y1 + yorg, pBox->x2 - pBox->x1, pBox->y2 - pBox->y1, pPixmap->devPrivate.ptr, pixWidth, ! pBox->x1, pBox->y1, 0xff); pBox++; } } diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514dsln.c:2.1 mit/server/ddx/x386/accel/ibm8514/ibm8514dsln.c:2.2 *** mit/server/ddx/x386/accel/ibm8514/ibm8514dsln.c:2.1 Fri Mar 11 23:36:44 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514dsln.c Fri Mar 11 23:36:44 1994 *************** *** 26,32 **** ******************************************************************/ /* 14-sep-93 TCG: ibm8514dsln.c based on ibm8514line.c */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514dsln.c,v 2.1 1993/10/18 12:16:33 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ --- 26,32 ---- ******************************************************************/ /* 14-sep-93 TCG: ibm8514dsln.c based on ibm8514line.c */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514dsln.c,v 2.2 1993/12/25 13:57:13 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ *************** *** 105,112 **** unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - unsigned long *addrl; /* address of destination pixmap */ - int nlwidth; /* width in longwords of destination pixmap */ int xorg, yorg; /* origin of window */ int adx; /* abs values of dx and dy */ --- 105,110 ---- *************** *** 124,136 **** unsigned char *pDash; Bool dashupdated; /* a bunch of temporaries */ - int tmp; register int y1, y2; register int x1, x2; RegionPtr cclip; cfbPrivGCPtr devPriv; - unsigned long xor, and; - int alu; /* 4-5-93 TCG : is VT visible */ if (!x386VTSema) --- 122,131 ---- diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514dssg.c:2.1 mit/server/ddx/x386/accel/ibm8514/ibm8514dssg.c:2.2 *** mit/server/ddx/x386/accel/ibm8514/ibm8514dssg.c:2.1 Fri Mar 11 23:36:45 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514dssg.c Fri Mar 11 23:36:45 1994 *************** *** 26,32 **** ******************************************************************/ /* 16-sep-93 TCG: ibm8514dssg.c from ibm8514dsln.c */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514dssg.c,v 2.1 1993/10/18 12:16:35 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ --- 26,32 ---- ******************************************************************/ /* 16-sep-93 TCG: ibm8514dssg.c from ibm8514dsln.c */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514dssg.c,v 2.2 1993/12/25 13:57:15 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ *************** *** 103,110 **** unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - unsigned long *addrl; /* address of destination pixmap */ - int nlwidth; /* width in longwords of destination pixmap */ int xorg, yorg; /* origin of window */ int adx; /* abs values of dx and dy */ --- 103,108 ---- *************** *** 121,133 **** int dash0len, dashidx, dashstartidx, dashnum, dashrem; unsigned char *pDash; /* a bunch of temporaries */ - int tmp; register int y1, y2; register int x1, x2; RegionPtr cclip; cfbPrivGCPtr devPriv; - unsigned long xor, and; - int alu; /* 4-5-93 TCG : is VT visible */ if (!x386VTSema) --- 119,128 ---- diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514fcac.c:2.5 mit/server/ddx/x386/accel/ibm8514/ibm8514fcac.c:2.7 *** mit/server/ddx/x386/accel/ibm8514/ibm8514fcac.c:2.5 Fri Mar 11 23:36:45 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514fcac.c Fri Mar 11 23:36:45 1994 *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514fcac.c,v 2.5 1993/09/27 12:23:43 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514fcac.c,v 2.7 1993/12/25 13:57:17 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 39,44 **** --- 39,46 ---- #define FC_MAX_WIDTH 24 #define FC_MAX_HEIGHT 32 + extern void QueryGlyphExtents(); + typedef struct { FontPtr font; unsigned int lru; *************** *** 148,161 **** *pb++ = *pglyph++; pb = pbits; } ! ibm8514ImageOpStipple(ibm8514FC_X+(c%32)*FC_MAX_WIDTH, ! ibm8514FC_Y+(c/32)*FC_MAX_HEIGHT, ! gWidth, gHeight, ! pb, nbyGlyphWidth, gWidth, gHeight, ! ibm8514FC_X+(c%32)*FC_MAX_WIDTH, ! ibm8514FC_Y+(c/32)*FC_MAX_HEIGHT, ! 0xff, 0, ibm8514alu[GXcopy], ! (1 << ret)); } } } --- 150,163 ---- *pb++ = *pglyph++; pb = pbits; } ! ibm8514ImageStipple(ibm8514FC_X+(c%32)*FC_MAX_WIDTH, ! ibm8514FC_Y+(c/32)*FC_MAX_HEIGHT, ! gWidth, gHeight, ! pb, nbyGlyphWidth, gWidth, gHeight, ! ibm8514FC_X+(c%32)*FC_MAX_WIDTH, ! ibm8514FC_Y+(c/32)*FC_MAX_HEIGHT, ! 0xff, 0, ibm8514alu[GXcopy], ! (1 << ret), 1); } } } diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514frec.c:2.3 mit/server/ddx/x386/accel/ibm8514/ibm8514frec.c:2.4 *** mit/server/ddx/x386/accel/ibm8514/ibm8514frec.c:2.3 Fri Mar 11 23:36:46 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514frec.c Fri Mar 11 23:36:46 1994 *************** *** 28,34 **** Modified by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514frec.c,v 2.3 1993/08/17 16:14:45 dawes Exp $ */ /* $XConsortium: cfbfillrct.c,v 5.13 90/05/15 18:40:19 keith Exp $ */ --- 28,34 ---- Modified by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514frec.c,v 2.4 1993/11/24 12:33:08 dawes Exp $ */ /* $XConsortium: cfbfillrct.c,v 5.13 90/05/15 18:40:19 keith Exp $ */ *************** *** 291,298 **** pboxClipped->y2 - pboxClipped->y1, pPix->devPrivate.ptr, pixWidth, width, height, xrot, yrot, ! pGC->fgPixel, ! ibm8514alu[pGC->alu], pGC->planemask); pboxClipped++; } } --- 291,299 ---- pboxClipped->y2 - pboxClipped->y1, pPix->devPrivate.ptr, pixWidth, width, height, xrot, yrot, ! pGC->fgPixel, 0, ! ibm8514alu[pGC->alu], ! pGC->planemask, 0); pboxClipped++; } } *************** *** 321,334 **** } } else { while (n--) { ! ibm8514ImageOpStipple(pboxClipped->x1, pboxClipped->y1, ! pboxClipped->x2 - pboxClipped->x1, ! pboxClipped->y2 - pboxClipped->y1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, xrot, yrot, ! pGC->fgPixel, pGC->bgPixel, ! ibm8514alu[pGC->alu], ! pGC->planemask); pboxClipped++; } } --- 322,335 ---- } } else { while (n--) { ! ibm8514ImageStipple(pboxClipped->x1, pboxClipped->y1, ! pboxClipped->x2 - pboxClipped->x1, ! pboxClipped->y2 - pboxClipped->y1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, xrot, yrot, ! pGC->fgPixel, pGC->bgPixel, ! ibm8514alu[pGC->alu], ! pGC->planemask, 1); pboxClipped++; } } diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514fs.c:2.2 mit/server/ddx/x386/accel/ibm8514/ibm8514fs.c:2.3 *** mit/server/ddx/x386/accel/ibm8514/ibm8514fs.c:2.2 Fri Mar 11 23:36:47 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514fs.c Fri Mar 11 23:36:47 1994 *************** *** 62,68 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514fs.c,v 2.2 1993/08/17 16:14:46 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 62,68 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514fs.c,v 2.3 1993/11/24 12:33:10 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 329,336 **** while (n--) { ibm8514ImageStipple(ppt->x, ppt->y, *pwidth, 1, pPix->devPrivate.ptr, pixWidth, width, height, ! xrot, yrot, pGC->fgPixel, ! ibm8514alu[pGC->alu], pGC->planemask); ppt++; pwidth++; } --- 329,336 ---- while (n--) { ibm8514ImageStipple(ppt->x, ppt->y, *pwidth, 1, pPix->devPrivate.ptr, pixWidth, width, height, ! xrot, yrot, pGC->fgPixel, 0, ! ibm8514alu[pGC->alu], pGC->planemask, 0); ppt++; pwidth++; } *************** *** 419,429 **** } } else { while (n--) { ! ibm8514ImageOpStipple(ppt->x, ppt->y, *pwidth, 1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, ! xrot, yrot, pGC->fgPixel, pGC->bgPixel, ! ibm8514alu[pGC->alu], pGC->planemask); ppt++; pwidth++; } --- 419,429 ---- } } else { while (n--) { ! ibm8514ImageStipple(ppt->x, ppt->y, *pwidth, 1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, ! xrot, yrot, pGC->fgPixel, pGC->bgPixel, ! ibm8514alu[pGC->alu], pGC->planemask, 1); ppt++; pwidth++; } diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514gc.c:2.2 mit/server/ddx/x386/accel/ibm8514/ibm8514gc.c:2.4 *** mit/server/ddx/x386/accel/ibm8514/ibm8514gc.c:2.2 Fri Mar 11 23:36:48 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514gc.c Fri Mar 11 23:36:48 1994 *************** *** 24,30 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514gc.c,v 2.2 1993/09/21 15:21:24 dawes Exp $ */ /* $XConsortium: cfbgc.c,v 1.2 91/07/18 23:00:53 keith Exp $ */ --- 24,30 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514gc.c,v 2.4 1993/12/25 13:57:19 dawes Exp $ */ /* $XConsortium: cfbgc.c,v 1.2 91/07/18 23:00:53 keith Exp $ */ *************** *** 50,56 **** static void cfbValidateGC(), cfbChangeGC(), cfbCopyGC(), cfbDestroyGC(); static void cfbChangeClip(), cfbDestroyClip(), cfbCopyClip(); ! static cfbDestroyOps(); static GCFuncs cfbFuncs = { cfbValidateGC, --- 50,56 ---- static void cfbValidateGC(), cfbChangeGC(), cfbCopyGC(), cfbDestroyGC(); static void cfbChangeClip(), cfbDestroyClip(), cfbCopyClip(); ! static void cfbDestroyOps(); static GCFuncs cfbFuncs = { cfbValidateGC, *************** *** 65,71 **** static GCOps ibm8514Ops = { ibm8514SolidFSpans, ibm8514SetSpans, ! miPutImage, ibm8514CopyArea, ibm8514CopyPlane, ibm8514PolyPoint, --- 65,71 ---- static GCOps ibm8514Ops = { ibm8514SolidFSpans, ibm8514SetSpans, ! cfbPutImage, ibm8514CopyArea, ibm8514CopyPlane, ibm8514PolyPoint, *************** *** 318,324 **** return ret; } ! static cfbDestroyOps (ops) GCOps *ops; { --- 318,324 ---- return ret; } ! static void cfbDestroyOps (ops) GCOps *ops; { diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514gs.c:2.2 mit/server/ddx/x386/accel/ibm8514/ibm8514gs.c:2.4 *** mit/server/ddx/x386/accel/ibm8514/ibm8514gs.c:2.2 Fri Mar 11 23:36:48 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514gs.c Fri Mar 11 23:36:48 1994 *************** *** 25,31 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514gs.c,v 2.2 1993/08/17 16:14:47 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 25,31 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514gs.c,v 2.4 1993/12/25 13:57:21 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 58,64 **** { int j; unsigned char *pdst; /* where to put the bits */ - unsigned char *psrc; /* where to get the bits */ int pixmapStride; /* 4-5-93 TCG : is VT visible */ --- 58,63 ---- *************** *** 89,95 **** pdst = (unsigned char *)pdstStart; for (; nspans--; ppt++, pwidth++) { ! ibm8514ImageRead(ppt->x, ppt->y, j = *pwidth, 1, pdst, pixmapStride, 0, 0); pdst += j; /* width is in 32 bit words */ j = (-j) & 3; while (j--) /* Pad out to 32-bit boundary */ --- 88,95 ---- pdst = (unsigned char *)pdstStart; for (; nspans--; ppt++, pwidth++) { ! ibm8514ImageRead(ppt->x, ppt->y, j = *pwidth, 1, pdst, pixmapStride, ! 0, 0, 0xff); pdst += j; /* width is in 32 bit words */ j = (-j) & 3; while (j--) /* Pad out to 32-bit boundary */ diff -c /dev/null mit/server/ddx/x386/accel/ibm8514/ibm8514gtim.c:2.0 *** /dev/null Fri Mar 11 23:36:49 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514gtim.c Fri Mar 11 23:36:49 1994 *************** *** 0 **** --- 1,82 ---- + /* + * Copyright 1993 by David Wexelblat + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, 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 David Wexelblat not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. David Wexelblat makes + * no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE + * OR PERFORMANCE OF THIS SOFTWARE. + * + */ + /* + * Stolen from the S3 server and adapted to the 8514 server. + * Hans Nasten. (nasten@everyware.se). + */ + + /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514gtim.c,v 2.0 1993/12/03 13:13:56 dawes Exp $ */ + + #include "X.h" + #include "windowstr.h" + #include "scrnintstr.h" + #include "pixmapstr.h" + #include "cfb.h" + #include "cfbmskbits.h" + #include "ibm8514.h" + + extern void mfbGetImage(); + + void + ibm8514GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine) + DrawablePtr pDrawable; + int sx, sy, w, h; + unsigned int format; + unsigned long planeMask; + pointer pdstLine; + { + int width; + + if ((w == 0) || (h == 0)) + return; + + if (pDrawable->bitsPerPixel == 1) + { + mfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); + return; + } + + if (pDrawable->type != DRAWABLE_WINDOW) + { + cfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); + return; + } + + width = PixmapBytePad(w, pDrawable->depth); + if (format == ZPixmap) + { + ibm8514ImageRead(sx+pDrawable->x, sy+pDrawable->y, w, h, + pdstLine, width, 0, 0, planeMask); + } + else + { + /* + * Worry about this later (much!). Should be straighforward, though. + * Read an image into a dummy pixmap, then use cfbCopyPlane8to1 to + * copy each plane in planeMask into the destination. At least + * this is the theory. + */ + miGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); + } + } + diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514im.c:2.7 mit/server/ddx/x386/accel/ibm8514/ibm8514im.c:2.11 *** mit/server/ddx/x386/accel/ibm8514/ibm8514im.c:2.7 Fri Mar 11 23:36:50 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514im.c Fri Mar 11 23:36:50 1994 *************** *** 22,35 **** * Modified by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514im.c,v 2.7 1993/09/21 15:21:26 dawes Exp $ */ #include "os.h" #include "reg8514.h" #include "ibm8514im.h" #define ASM_IMAGE #define reorder(a) ( \ (a & 0x80) >> 7 | \ (a & 0x40) >> 5 | \ --- 22,38 ---- * Modified by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514im.c,v 2.11 1993/12/25 13:57:23 dawes Exp $ */ #include "os.h" #include "reg8514.h" #include "ibm8514im.h" + #include "ibm8514.h" #define ASM_IMAGE + extern void ibm8514RealImageFill(); + #define reorder(a) ( \ (a & 0x80) >> 7 | \ (a & 0x40) >> 5 | \ *************** *** 145,151 **** } void ! ibm8514ImageRead(x, y, w, h, psrc, pwidth, px, py) int x; int y; int w; --- 148,154 ---- } void ! ibm8514ImageRead(x, y, w, h, psrc, pwidth, px, py, planemask) int x; int y; int w; *************** *** 154,159 **** --- 157,163 ---- int pwidth; int px; int py; + short planemask; { int i,j; unsigned short *sp; *************** *** 171,183 **** outw(CMD, CMD_RECT | INC_Y | INC_X | DRAW | BYTSEQ |_16BIT | PCDATA); sp = (unsigned short*)(psrc + pwidth * py + px); pwidth = pwidth / 2 - w / 2; WaitDataReady(); if( w & 1 ) { w /= 2; for (j = 0; j < h; j++) { for (i = 0; i < w; i++) ! *sp++ = inw(PIX_TRANS); ! *((unsigned char *)(sp)) = (unsigned char)(inw(PIX_TRANS)); sp += pwidth; } } --- 175,189 ---- outw(CMD, CMD_RECT | INC_Y | INC_X | DRAW | BYTSEQ |_16BIT | PCDATA); sp = (unsigned short*)(psrc + pwidth * py + px); pwidth = pwidth / 2 - w / 2; + planemask = (planemask & 0x00ff) | ((planemask << 8) & 0xff00); WaitDataReady(); if( w & 1 ) { w /= 2; for (j = 0; j < h; j++) { for (i = 0; i < w; i++) ! *sp++ = inw(PIX_TRANS) & planemask; ! *((unsigned char *)(sp)) = (unsigned char)(inw(PIX_TRANS)) ! & (unsigned char)(planemask); sp += pwidth; } } *************** *** 185,191 **** w /= 2; for (j = 0; j < h; j++) { for (i = 0; i < w; i++) ! *sp++ = inw(PIX_TRANS); sp += pwidth; } } --- 191,197 ---- w /= 2; for (j = 0; j < h; j++) { for (i = 0; i < w; i++) ! *sp++ = inw(PIX_TRANS) & planemask; sp += pwidth; } } *************** *** 281,287 **** } void ! ibm8514RealImageStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, fgPixel, bgPixel, alu, planemask, opaque) int x; int y; --- 287,293 ---- } void ! ibm8514ImageStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, fgPixel, bgPixel, alu, planemask, opaque) int x; int y; *************** *** 325,379 **** outw(CUR_Y, (short)y); outw(CMD, CMD_RECT | PCDATA | _16BIT | INC_Y | INC_X | YMAJAXIS | DRAW | PLANAR | WRTDATA); - WaitQueue(8); modulus(x - pox, pw, x); modulus(y - poy, ph, y); ! while( h > 0 ) { ! srch = ( y+h > ph ? ph - y : h ); ! while( srch > 0 ) { ! dstw = w; ! srcx = x; ! ptmp = (unsigned short *)(psrc + pwidth * y); ! while( dstw > 0 ) { ! int np, x2; ! unsigned short *pnt, pix; ! /* ! * Assemble 16 bits and feed them to the draw engine. ! */ ! np = pw - srcx; /* No. pixels left in bitmap.*/ ! pnt =(unsigned short *)((unsigned char *)(ptmp) + (srcx >> 3)); ! x2 = srcx & 7; /* Offset within byte. */ ! if( np >= 16 ) { ! pix = (unsigned short)(*((unsigned int *)(pnt)) >> x2); ! } ! else if( pw >= 16 ) { ! pix = (unsigned short)((*((unsigned int *)(pnt)) >> x2) & MSKBIT(np)) | (*ptmp << np); ! } ! else if( pw >= 8 ) { ! pix = ((*pnt >> x2) & MSKBIT(np)) | (*ptmp << np) | (*pnt << (np+pw)); ! } ! else { ! pix = (*ptmp >> x2) & MSKBIT(np); ! while( np < 16 && np < dstw ) { ! pix |= *ptmp << np; ! np += pw; } } ! outw( PIX_TRANS, ibm8514stipple_tab[ pix & 0xff ] ); ! if( dstw > 8 ) ! outw( PIX_TRANS, ibm8514stipple_tab[( pix >> 8 ) & 0xff] ); ! srcx += 16; ! if( srcx >= pw ) ! srcx -= pw; ! dstw -= 16; } ! y++; ! h--; ! srch--; } - y = 0; } WaitQueue(5); outw(FRGD_MIX, FSS_FRGDCOL | MIX_SRC); --- 331,408 ---- outw(CUR_Y, (short)y); outw(CMD, CMD_RECT | PCDATA | _16BIT | INC_Y | INC_X | YMAJAXIS | DRAW | PLANAR | WRTDATA); modulus(x - pox, pw, x); modulus(y - poy, ph, y); ! WaitQueue(8); ! /* ! * When the source bitmap is properly aligned, max 16 pixels wide, ! * and nonrepeating use this faster loop instead. ! * This speeds up all copying to the font cache. ! */ ! if( (x & 7) == 0 && w <= 16 && x+w <= pw && y+h <= ph ) { ! unsigned short pix; ! unsigned char *pnt; ! ! pnt = (unsigned char *)(psrc + pwidth * y + (x >> 3)); ! while( h-- > 0 ) { ! pix = *((unsigned short *)(pnt)); ! outw( PIX_TRANS, ibm8514stipple_tab[ pix & 0xff ] ); ! if( w > 8 ) ! outw( PIX_TRANS, ibm8514stipple_tab[ ( pix >> 8 ) & 0xff ] ); ! ! pnt += pwidth; ! } ! } ! else { ! while( h > 0 ) { ! srch = ( y+h > ph ? ph - y : h ); ! while( srch > 0 ) { ! dstw = w; ! srcx = x; ! ptmp = (unsigned short *)(psrc + pwidth * y); ! while( dstw > 0 ) { ! int np, x2; ! unsigned short *pnt, pix; ! /* ! * Assemble 16 bits and feed them to the draw engine. ! */ ! np = pw - srcx; /* No. pixels left in bitmap.*/ ! pnt =(unsigned short *) ! ((unsigned char *)(ptmp) + (srcx >> 3)); ! x2 = srcx & 7; /* Offset within byte. */ ! if( np >= 16 ) { ! pix = (unsigned short)(*((unsigned int *)(pnt)) >> x2); ! } ! else if( pw >= 16 ) { ! pix = (unsigned short)((*((unsigned int *)(pnt)) >> x2) & MSKBIT(np)) | (*ptmp << np); ! } ! else if( pw >= 8 ) { ! pix = ((*pnt >> x2) & MSKBIT(np)) | (*ptmp << np) | (*pnt << (np+pw)); ! } ! else { ! pix = (*ptmp >> x2) & MSKBIT(np); ! while( np < 16 && np < dstw ) { ! pix |= *ptmp << np; ! np += pw; ! } } + outw( PIX_TRANS, ibm8514stipple_tab[ pix & 0xff ] ); + if( dstw > 8 ) + outw( PIX_TRANS, + ibm8514stipple_tab[ ( pix >> 8 ) & 0xff ] ); + srcx += 16; + if( srcx >= pw ) + srcx -= pw; + dstw -= 16; } ! y++; ! h--; ! srch--; } ! y = 0; } } WaitQueue(5); outw(FRGD_MIX, FSS_FRGDCOL | MIX_SRC); *************** *** 384,424 **** } #endif /* ASM_IMAGE */ - - void - ibm8514ImageStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, fgPixel, alu, planemask) - int x; - int y; - int w; - int h; - unsigned char *psrc; - int pwidth; - int pw, ph, pox, poy; - int fgPixel; - short alu; - short planemask; - { - - ibm8514RealImageStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, - fgPixel, 0, alu, planemask, 0); - } - - void - ibm8514ImageOpStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, fgPixel, bgPixel, alu, planemask) - int x; - int y; - int w; - int h; - unsigned char *psrc; - int pw, ph, pox, poy; - int pwidth; - int fgPixel; - int bgPixel; - short alu; - short planemask; - { - - ibm8514RealImageStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, - fgPixel, bgPixel, alu, planemask, 1); - - } --- 413,415 ---- diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514imrd.s:2.1 mit/server/ddx/x386/accel/ibm8514/ibm8514imrd.s:2.3 *** mit/server/ddx/x386/accel/ibm8514/ibm8514imrd.s:2.1 Fri Mar 11 23:36:50 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514imrd.s Fri Mar 11 23:36:50 1994 *************** *** 4,10 **** Written by Hans Nasten ( nasten@everyware.se ) AUG 29, 1993. void ! ibm8514ImageRead(x, y, w, h, psrc, pwidth, px, py) int x; int y; int w; --- 4,10 ---- Written by Hans Nasten ( nasten@everyware.se ) AUG 29, 1993. void ! ibm8514ImageRead(x, y, w, h, psrc, pwidth, px, py, planemask) int x; int y; int w; *************** *** 13,22 **** int pwidth; int px; int py; ******************************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514imrd.s,v 2.1 1993/09/09 06:00:56 dawes Exp $ */ #define _8514_ASM_ #include "assyntax.h" --- 13,23 ---- int pwidth; int px; int py; + short planemask; ******************************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514imrd.s,v 2.3 1993/12/06 10:35:37 dawes Exp $ */ #define _8514_ASM_ #include "assyntax.h" *************** *** 35,40 **** --- 36,42 ---- #define pwidth_arg REGOFF(28,EBP) #define px_arg REGOFF(32,EBP) #define py_arg REGOFF(36,EBP) + #define planemask_arg REGOFF(40,EBP) SEG_TEXT *************** *** 138,143 **** --- 140,202 ---- SUB_L (EBX,ESI) SHL_L (CONST(1),ESI) + MOV_W (planemask_arg,BX) + CMP_W (CONST(0xff),BX) + JZ (.get_all_planes) + + MOV_L (ESI,pwidth_arg) + MOV_L (h_arg,ESI) + MOV_B (BL,BH) + TEST_W (CONST(1),w_arg) + JNZ (.odd_width_masked) + /* + * Even number of pixels on each line, but some of the bitplanes + * should be masked out. + */ + SHR_L (CONST(1),w_arg) + .next_even_line_masked: + MOV_L (w_arg,ECX) + .next_even_word_masked: + IN_W + AND_W (BX,AX) + STOS_W + LOOP (.next_even_word_masked) + + ADD_L (pwidth_arg,EDI) + DEC_W (SI) + JNZ (.next_even_line_masked) + + JMP (.all_done) + /* + * Odd number of pixels on each line, but some of the bitplanes + * should be masked out. Read an additional pixel on each line. + */ + .odd_width_masked: + SHR_L (CONST(1),w_arg) + .next_odd_line_masked: + MOV_L (w_arg,ECX) + AND_L (ECX,ECX) + JZ (.odd_masked_skip) + + .next_odd_word_masked: + IN_W + AND_W (BX,AX) + STOS_W + LOOP (.next_odd_word_masked) + + .odd_masked_skip: + IN_W + AND_B (BL,AL) + MOV_B (AL,REGIND(EDI)) + ADD_L (pwidth_arg,EDI) + DEC_W (SI) + JNZ (.next_odd_line_masked) + + JMP (.all_done) + /* + * All bitplanes is to be stored. Skip planemask anding. + */ + .get_all_planes: MOV_W (h_arg,BX) TEST_W (CONST(1),w_arg) JNZ (.odd_width) diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514imst.s:2.2 mit/server/ddx/x386/accel/ibm8514/ibm8514imst.s:2.4 *** mit/server/ddx/x386/accel/ibm8514/ibm8514imst.s:2.2 Fri Mar 11 23:36:51 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514imst.s Fri Mar 11 23:36:51 1994 *************** *** 1,114 **** /****************************************************************************** ! This is a assembly language version of the ibm8514RealImageStipple routine. Written by Hans Nasten ( nasten@everyware.se ) SEP 16, 1993. ! $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514imst.s,v 2.2 1993/09/27 12:23:45 dawes Exp $ ! The equivalent C-code looks like this. - void - ibm8514RealImageStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, - fgPixel, bgPixel, alu, planemask, opaque) - int x; - int y; - int w; - int h; - unsigned char *psrc; - int pw, ph, pox, poy; - int pwidth; - int fgPixel; - int bgPixel; - short alu; - short planemask; - int opaque; - { - int srcx, srch, dstw; - unsigned short *ptmp; - - - if (alu == MIX_DST || w == 0 || h == 0) - return; - - WaitQueue(6); - outw(MULTIFUNC_CNTL, SCISSORS_L | x); - outw(MULTIFUNC_CNTL, SCISSORS_R | (x+w-1)); - outw(MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_EXPPC | COLCMPOP_F); - outw(MULTIFUNC_CNTL, MIN_AXIS_PCNT | h-1); - outw(WRT_MASK, planemask); - outw(FRGD_MIX, FSS_FRGDCOL | alu); - WaitQueue(7); - if( opaque ) { - outw(BKGD_MIX, BSS_BKGDCOL | alu); - outw(BKGD_COLOR, (short)bgPixel); - } - else - outw(BKGD_MIX, BSS_BKGDCOL | MIX_DST); - outw(FRGD_COLOR, (short)fgPixel); - w += (x & 3); - x &= ~3; - outw(MAJ_AXIS_PCNT, (short)(((w + 7) & ~7)-1)); - outw(CUR_X, (short)x); - outw(CUR_Y, (short)y); - outw(CMD, CMD_RECT | PCDATA | _16BIT | INC_Y | INC_X | - YMAJAXIS | DRAW | PLANAR | WRTDATA); - WaitQueue(8); - modulus(x - pox, pw, x); - modulus(y - poy, ph, y); - while( h > 0 ) { - srch = ( y+h > ph ? ph - y : h ); - while( srch > 0 ) { - dstw = w; - srcx = x; - ptmp = (unsigned short *)(psrc + pwidth * y); - while( dstw > 0 ) { - int np, x2; - unsigned short *pnt, pix; - - np = pw - srcx; - pnt =(unsigned short *)((unsigned char *)(ptmp) + (srcx >> 3)); - x2 = srcx & 7; - if( np >= 16 ) { - pix = (unsigned short)(*((unsigned int *)(pnt)) >> x2); - } - else if( pw >= 16 ) { - pix = (unsigned short)((*((unsigned int *)(pnt)) >> x2) - & MSKBIT(np)) | (*ptmp << np); - } - else if( pw >= 8 ) { - pix = ((*pnt >> x2) & MSKBIT(np)) | (*ptmp << np) - | (*pnt << (np+pw)); - } - else { - pix = (*ptmp >> x2) & MSKBIT(np); - while( np < 16 && np < dstw ) { - pix |= *ptmp << np; - np += pw; - } - } - outw( PIX_TRANS, ibm8514stipple_tab[ pix & 0xff ] ); - if( dstw > 8 ) - outw( PIX_TRANS, ibm8514stipple_tab[( pix >> 8 ) & 0xff] ); - srcx += 16; - if( srcx >= pw ) - srcx -= pw; - dstw -= 16; - } - y++; - h--; - srch--; - } - y = 0; - } - WaitQueue(5); - outw(FRGD_MIX, FSS_FRGDCOL | MIX_SRC); - outw(BKGD_MIX, BSS_BKGDCOL | MIX_SRC); - outw(MULTIFUNC_CNTL, SCISSORS_L | 0); - outw(MULTIFUNC_CNTL, SCISSORS_R | 1023); - outw(MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_FRGDMIX | COLCMPOP_F); - } - ******************************************************************************/ #define _8514_ASM_ --- 1,13 ---- /****************************************************************************** ! This is a assembly language version of the ibm8514ImageStipple routine. Written by Hans Nasten ( nasten@everyware.se ) SEP 16, 1993. ! $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514imst.s,v 2.4 1993/11/24 12:33:14 dawes Exp $ ! This is a assembly language version of the C code in ibm8514im.c ******************************************************************************/ #define _8514_ASM_ *************** *** 168,176 **** D_WORD 0x0000 ! GLOBL GLNAME(ibm8514RealImageStipple) ! GLNAME(ibm8514RealImageStipple): PUSH_L (EBP) MOV_L (ESP,EBP) SUB_L (CONST(12),ESP) --- 67,75 ---- D_WORD 0x0000 ! GLOBL GLNAME(ibm8514ImageStipple) ! GLNAME(ibm8514ImageStipple): PUSH_L (EBP) MOV_L (ESP,EBP) SUB_L (CONST(12),ESP) *************** *** 312,318 **** ADD_L (ph_arg,EDX) .mod1: MOV_L (EDX,y_arg) - /* * Wait until the fifo is empty. */ --- 211,216 ---- *************** *** 322,327 **** --- 220,292 ---- TEST_W (CONST(1),AX) JNZ (.wait_queue_2) /* + * When the source bitmap is properly aligned, max 16 pixels wide, + * and nonrepeating use this faster loop instead. + * This speeds up all copying to the font cache. + */ + MOV_L (x_arg,EAX) + AND_L (CONST(7),EAX) + JNZ (.next_bitmap_vertical) + + MOV_L (w_arg,EAX) + CMP_L (CONST(16),EAX) + JG (.next_bitmap_vertical) + + ADD_L (x_arg,EAX) + CMP_L (pw_arg,EAX) + JG (.next_bitmap_vertical) + + MOV_L (y_arg,EAX) + ADD_L (h_arg,EAX) + CMP_L (ph_arg,EAX) + JG (.next_bitmap_vertical) + + MOV_L (y_arg,EAX) + MUL_L (pwidth_arg) + MOV_L (x_arg,EDX) + SHR_L (CONST(3),EDX) + ADD_L (EDX,EAX) + MOV_L (psrc_arg,ESI) + ADD_L (EAX,ESI) + MOV_L (PIX_TRANS,EDX) + MOV_L (h_arg,EDI) + CMP_L (CONST(8),w_arg) + JLE (.fast_loop_8) + /* + * This loop is for max 16 pixels wide bitmaps. + */ + .fast_loop_16: + MOV_W (REGIND(ESI),CX) + XOR_L (EBX,EBX) + MOV_B (CL,BL) + SHL_L (CONST(1),EBX) + MOV_W (REGOFF(GLNAME(ibm8514stipple_tab),EBX),AX) + OUT_W + XOR_L (EBX,EBX) + MOV_B (CH,BL) + SHL_L (CONST(1),EBX) + MOV_W (REGOFF(GLNAME(ibm8514stipple_tab),EBX),AX) + OUT_W + ADD_L (pwidth_arg,ESI) + DEC_L (EDI) + JNZ (.fast_loop_16) + + JMP (.stipple_exit) + /* + * This loop is for max 8 pixels wide bitmaps. + */ + .fast_loop_8: + XOR_L (EBX,EBX) + MOV_B (REGIND(ESI),BL) + SHL_L (CONST(1),EBX) + MOV_W (REGOFF(GLNAME(ibm8514stipple_tab),EBX),AX) + OUT_W + ADD_L (pwidth_arg,ESI) + DEC_L (EDI) + JNZ (.fast_loop_8) + + JMP (.stipple_exit) + /* * Process all lines on screen repeating the bitmap if needed. * This loop paints from the present y location to the end of * the bitmap. ( or to the end of the screen area if the bitmap *************** *** 568,573 **** --- 533,539 ---- /* * Wait until room for 5 entries in the fifo. */ + .stipple_exit: MOV_L (GP_STAT,EDX) .wait_queue_3: IN_W diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514init.c:2.4 mit/server/ddx/x386/accel/ibm8514/ibm8514init.c:2.5 *** mit/server/ddx/x386/accel/ibm8514/ibm8514init.c:2.4 Fri Mar 11 23:36:52 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514init.c Fri Mar 11 23:36:52 1994 *************** *** 18,28 **** * Modified by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514init.c,v 2.4 1993/10/16 17:30:46 dawes Exp $ */ ! #include "misc.h" #include "reg8514.h" #include "ibm8514.h" static short numPlanes = -1; static short resolution = -1; --- 18,31 ---- * Modified by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514init.c,v 2.5 1993/12/25 13:57:24 dawes Exp $ */ ! #include "X.h" ! #include "input.h" #include "reg8514.h" #include "ibm8514.h" + #include "x386.h" + #include "xf86_OSlib.h" static short numPlanes = -1; static short resolution = -1; diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514line.c:2.4 mit/server/ddx/x386/accel/ibm8514/ibm8514line.c:2.5 *** mit/server/ddx/x386/accel/ibm8514/ibm8514line.c:2.4 Fri Mar 11 23:36:52 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514line.c Fri Mar 11 23:36:53 1994 *************** *** 25,31 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514line.c,v 2.4 1993/09/21 15:21:29 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ --- 25,31 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514line.c,v 2.5 1993/12/25 13:57:26 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ *************** *** 100,107 **** unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - unsigned long *addrl; /* address of destination pixmap */ - int nlwidth; /* width in longwords of destination pixmap */ int xorg, yorg; /* origin of window */ int adx; /* abs values of dx and dy */ --- 100,105 ---- *************** *** 121,128 **** register int x1, x2; RegionPtr cclip; cfbPrivGCPtr devPriv; - unsigned long xor, and; - int alu; /* 4-5-93 TCG : is VT visible */ if (!x386VTSema) --- 119,124 ---- diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514pcac.c:2.3 mit/server/ddx/x386/accel/ibm8514/ibm8514pcac.c:2.5 *** mit/server/ddx/x386/accel/ibm8514/ibm8514pcac.c:2.3 Fri Mar 11 23:36:53 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514pcac.c Fri Mar 11 23:36:53 1994 *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514pcac.c,v 2.3 1993/08/14 05:09:04 dawes Exp $ */ /* Offscreen memory organization: * --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514pcac.c,v 2.5 1993/12/25 13:57:28 dawes Exp $ */ /* Offscreen memory organization: * *************** *** 214,223 **** else pci->id = pix->cacheId = NEXT_CACHE_ID; ! ibm8514ImageOpStipple(pci->x, pci->y, pci->pix_w, pci->pix_h, ! pix->devPrivate.ptr, pix->devKind, ! pci->pix_w, pci->pix_h, pci->x, pci->y, ! 255, 0, MIX_SRC, 0xffff); DoCacheExpandPixmap(pci); } --- 214,223 ---- else pci->id = pix->cacheId = NEXT_CACHE_ID; ! ibm8514ImageStipple(pci->x, pci->y, pci->pix_w, pci->pix_h, ! pix->devPrivate.ptr, pix->devKind, ! pci->pix_w, pci->pix_h, pci->x, pci->y, ! 255, 0, MIX_SRC, 0xffff, 1); DoCacheExpandPixmap(pci); } *************** *** 399,405 **** int xwmid, ywmid, orig_xwmid; int startx, starty, endx, endy; int orig_x = x; - int i; if (w == 0 || h == 0) return; --- 399,404 ---- diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514scri.c:2.2 mit/server/ddx/x386/accel/ibm8514/ibm8514scri.c:2.5 *** mit/server/ddx/x386/accel/ibm8514/ibm8514scri.c:2.2 Fri Mar 11 23:36:54 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514scri.c Fri Mar 11 23:36:54 1994 *************** *** 36,42 **** ********************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514scri.c,v 2.2 1993/09/04 16:27:07 dawes Exp $ */ /* $XConsortium: cfbscrinit.c,v 5.18 90/09/24 17:46:11 rws Exp $ */ --- 36,42 ---- ********************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514scri.c,v 2.5 1993/12/25 13:57:30 dawes Exp $ */ /* $XConsortium: cfbscrinit.c,v 5.18 90/09/24 17:46:11 rws Exp $ */ *************** *** 58,63 **** --- 58,65 ---- extern RegionPtr mfbPixmapToRegion(); extern Bool mfbAllocatePrivates(); + extern Bool mfbRegisterCopyPlaneProc(); + extern Bool miScreenInit(); extern int defaultColorVisualClass; *************** *** 97,104 **** #define NUMDEPTHS ((sizeof depths)/(sizeof depths[0])) - int cfbWindowPrivateIndex; - int cfbGCPrivateIndex; static unsigned long cfbGeneration = 0; miBSFuncRec ibm8514BSFuncRec = { --- 99,104 ---- *************** *** 154,160 **** pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0; pScreen->QueryBestSize = mfbQueryBestSize; /* SaveScreen */ ! pScreen->GetImage = miGetImage; pScreen->GetSpans = ibm8514GetSpans; pScreen->CreateWindow = cfbCreateWindow; pScreen->DestroyWindow = cfbDestroyWindow; --- 154,160 ---- pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0; pScreen->QueryBestSize = mfbQueryBestSize; /* SaveScreen */ ! pScreen->GetImage = ibm8514GetImage; pScreen->GetSpans = ibm8514GetSpans; pScreen->CreateWindow = cfbCreateWindow; pScreen->DestroyWindow = cfbDestroyWindow; diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514seg.c:2.4 mit/server/ddx/x386/accel/ibm8514/ibm8514seg.c:2.5 *** mit/server/ddx/x386/accel/ibm8514/ibm8514seg.c:2.4 Fri Mar 11 23:36:55 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514seg.c Fri Mar 11 23:36:55 1994 *************** *** 25,31 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514seg.c,v 2.4 1993/09/21 15:21:30 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ --- 25,31 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514seg.c,v 2.5 1993/12/25 13:57:34 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ *************** *** 97,104 **** unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - unsigned long *addrl; /* address of destination pixmap */ - int nlwidth; /* width in longwords of destination pixmap */ int xorg, yorg; /* origin of window */ int adx; /* abs values of dx and dy */ --- 97,102 ---- *************** *** 118,125 **** register int x1, x2; RegionPtr cclip; cfbPrivGCPtr devPriv; - unsigned long xor, and; - int alu; /* 4-5-93 TCG : is VT visible */ if (!x386VTSema) --- 116,121 ---- diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514text.c:2.2 mit/server/ddx/x386/accel/ibm8514/ibm8514text.c:2.3 *** mit/server/ddx/x386/accel/ibm8514/ibm8514text.c:2.2 Fri Mar 11 23:36:55 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514text.c Fri Mar 11 23:36:55 1994 *************** *** 22,28 **** * Modified by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514text.c,v 2.2 1993/09/09 06:01:00 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 22,28 ---- * Modified by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514text.c,v 2.3 1993/12/25 13:57:37 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 33,39 **** --- 33,43 ---- #include "scrnintstr.h" #include "pixmapstr.h" #include "dixfontstr.h" + #include "mi.h" #include "ibm8514.h" + + extern int ibm8514CPolyText8(); + extern int ibm8514CImageText8(); int ibm8514PolyText8(pDraw, pGC, x, y, count, chars) diff -c mit/server/ddx/x386/accel/ibm8514/ibm8514win.c:2.2 mit/server/ddx/x386/accel/ibm8514/ibm8514win.c:2.3 *** mit/server/ddx/x386/accel/ibm8514/ibm8514win.c:2.2 Fri Mar 11 23:36:56 1994 --- mit/server/ddx/x386/accel/ibm8514/ibm8514win.c Fri Mar 11 23:36:56 1994 *************** *** 25,31 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514win.c,v 2.2 1993/08/17 16:14:54 dawes Exp $ */ #include "X.h" #include "input.h" --- 25,31 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/ibm8514/ibm8514win.c,v 2.3 1993/12/25 13:57:38 dawes Exp $ */ #include "X.h" #include "input.h" *************** *** 40,45 **** --- 40,46 ---- #include "x386.h" #include "x386Priv.h" #include "reg8514.h" + #include "ibm8514.h" void ibm8514CopyWindow(pWin, ptOldOrg, prgnSrc) diff -c mit/server/ddx/x386/accel/mach32/Imakefile:2.2 mit/server/ddx/x386/accel/mach32/Imakefile:2.8 *** mit/server/ddx/x386/accel/mach32/Imakefile:2.2 Fri Mar 11 23:37:00 1994 --- mit/server/ddx/x386/accel/mach32/Imakefile Fri Mar 11 23:37:00 1994 *************** *** 1,30 **** ! XCOMM $XFree86: mit/server/ddx/x386/accel/mach32/Imakefile,v 2.2 1993/10/02 07:14:18 dawes Exp $ #include SRCS = mach32.c mach32cmap.c mach32gc.c mach32fs.c mach32ss.c \ mach32gs.c mach32win.c mach32init.c mach32im.c mach32bstor.c \ mach32scrin.c mach32blt.c mach32pcach.c mach32plypt.c \ ! mach32line.c mach32seg.c mach32frect.c mach32text.c \ mach32font.c mach32fcach.c mach32pntwn.c ativga.c \ ! mach32curs.c OBJS = mach32.o mach32cmap.o mach32gc.o mach32fs.o mach32ss.o \ mach32gs.o mach32win.o mach32init.o mach32im.o mach32bstor.o \ mach32scrin.o mach32blt.o mach32pcach.o mach32plypt.o \ ! mach32line.o mach32seg.o mach32frect.o mach32text.o \ mach32font.o mach32fcach.o mach32pntwn.o ativga.o \ ! mach32curs.o INCLUDES = -I../../common -I. \ -I../../../mfb -I../../../mi -I../../../../include \ ! -I../../../cfb -I$(INCLUDESRC) -I$(FONTSRC)/include \ ! -I$(FONTSRC)/lib/font/include -I../../os-support NormalLibraryObjectRule() NormalAsmObjectRule() NormalLibraryTarget(mach32,$(OBJS)) InstallLinkKitLibrary(mach32,$(LINKKITDIR)/drivers) --- 1,37 ---- ! XCOMM $XFree86: mit/server/ddx/x386/accel/mach32/Imakefile,v 2.8 1994/03/01 09:51:26 dawes Exp $ #include SRCS = mach32.c mach32cmap.c mach32gc.c mach32fs.c mach32ss.c \ mach32gs.c mach32win.c mach32init.c mach32im.c mach32bstor.c \ mach32scrin.c mach32blt.c mach32pcach.c mach32plypt.c \ ! mach32line.c mach32line1r.c mach32seg.c mach32frect.c mach32text.c \ mach32font.c mach32fcach.c mach32pntwn.c ativga.c \ ! mach32curs.c mach32gtimg.c mach32mem.c mach32dline.c mach32dseg.c \ ! vgaHW.c OBJS = mach32.o mach32cmap.o mach32gc.o mach32fs.o mach32ss.o \ mach32gs.o mach32win.o mach32init.o mach32im.o mach32bstor.o \ mach32scrin.o mach32blt.o mach32pcach.o mach32plypt.o \ ! mach32line.o mach32line1r.o mach32seg.o mach32frect.o mach32text.o \ mach32font.o mach32fcach.o mach32pntwn.o ativga.o \ ! mach32curs.o mach32gtimg.o mach32mem.o mach32dline.o mach32dseg.o \ ! vgaHW.o INCLUDES = -I../../common -I. \ -I../../../mfb -I../../../mi -I../../../../include \ ! -I../../vga256/vga -I../../../cfb -I$(INCLUDESRC) -I$(FONTSRC)/include \ ! -I$(FONTSRC)/lib/font/include -I../../os-support -I../../common_hw + DEFINES = -DMACH32_SERVER + NormalLibraryObjectRule() NormalAsmObjectRule() NormalLibraryTarget(mach32,$(OBJS)) + + ObjectFromSpecialSource(vgaHW,../../vga256/vga/vgaHW,/**/) + ObjectFromSpecialSource(mach32line1r,mach32line,-DONE_RECT) InstallLinkKitLibrary(mach32,$(LINKKITDIR)/drivers) diff -c mit/server/ddx/x386/accel/mach32/ativga.c:2.5 mit/server/ddx/x386/accel/mach32/ativga.c:2.6 *** mit/server/ddx/x386/accel/mach32/ativga.c:2.5 Fri Mar 11 23:37:00 1994 --- mit/server/ddx/x386/accel/mach32/ativga.c Fri Mar 11 23:37:01 1994 *************** *** 40,77 **** * Modified for the Mach32 by Kevin E. Martin (martin@cs.unc.edu) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/ativga.c,v 2.5 1993/10/02 07:14:19 dawes Exp $ */ #include "X.h" #include "misc.h" #include "input.h" #include "os.h" #include "xf86_OSlib.h" #include "regmach32.h" - #if !defined(linux) && !defined(SVR4) && !defined(SYSV) - #define SAVE_TEXT - #endif - #define SAVE_FONT1 - typedef struct { ! unsigned char MiscOutReg; ! unsigned char CRTC[25]; /* Crtc Controller */ ! unsigned char Sequencer[5]; /* video Sequencer */ ! unsigned char Graphics[9]; /* Video Graphics */ ! unsigned char Attribute[21]; /* Video Atribute */ ! unsigned char DAC[768]; /* Internal Colorlookuptable */ ! void *FontInfo1; /* Fonts */ ! unsigned char *TextInfo; /* Screen text */ unsigned char ATIExtRegBank[11]; /* ATI Registers B0,B1,B2,B3, B5, B6,B8,B9, BE,A6,A7 */ } SaveBlock; ! pointer vgaBase = NULL; ! static SaveBlock save = { 0, }; ! static short ATIExtReg = 0x1ce; ! unsigned short vgaIOBase; #define ER_B0 0 /* Extended Register indices (ATIExtRegBank) */ #define ER_B1 1 --- 40,72 ---- * Modified for the Mach32 by Kevin E. Martin (martin@cs.unc.edu) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/ativga.c,v 2.6 1994/02/13 04:04:58 dawes Exp $ */ #include "X.h" #include "misc.h" #include "input.h" #include "os.h" + #include "vga.h" #include "xf86_OSlib.h" #include "regmach32.h" typedef struct { ! vgaHWRec std; unsigned char ATIExtRegBank[11]; /* ATI Registers B0,B1,B2,B3, B5, B6,B8,B9, BE,A6,A7 */ } SaveBlock; ! pointer vgaBase = NULL; ! pointer vgaNewVideoState = NULL; ! ! #define save ((SaveBlock *)vgaNewVideoState) ! ! static short ATIExtReg = 0x1ce; ! int vgaIOBase; ! int vgaInterlaceType = VGA_DIVIDE_VERT; ! /* Define dummy to keep vgaHW.c happy */ ! void (*vgaSaveScreenFunc)() = NoopDDA; #define ER_B0 0 /* Extended Register indices (ATIExtRegBank) */ #define ER_B1 1 *************** *** 109,115 **** { unsigned char b2_save; unsigned char b8_save; - int i; if (!vgaBase) { vgaBase = xf86MapVidMem(screen_idx, VGA_REGION, (pointer)0xa0000, --- 104,109 ---- *************** *** 116,331 **** 64 * 1024); } - /* The rest of this routine is mostly from ATISave() in - x386/vga256/drivers/ati/driver.c */ - vgaIOBase = (inb(0x3cc) & 0x01) ? 0x3D0 : 0x3B0; ! /* Disable video */ ! inb(vgaIOBase + 0x0A); /* reset flip-flop */ ! outb( 0x3c0, 0x00 ); /* Unlock ATI specials */ outb(ATIExtReg, (((b8_save = inATI(0xb8)) & 0xC0) << 8) | 0xb8); - save.MiscOutReg = inb(0x3CC); - b2_save = inATI(0xb2); outb(ATIExtReg, 0x00b2); /* segment select 0 */ ! save.ATIReg0 = inATI(0xb0); ! save.ATIReg1 = inATI(0xb1); ! save.ATIReg2 = b2_save; ! save.ATIReg3 = inATI(0xb3); ! save.ATIReg5 = inATI(0xb5); ! save.ATIReg6 = inATI(0xb6); ! save.ATIReg8 = b8_save; ! save.ATIRegE = inATI(0xbe); ! save.ATIReg9 = inATI(0xb9); ! save.ATIRegA6 = inATI(0xa6); ! save.ATIRegA7 = inATI(0xa7); ! ! for (i=0; i<25; i++) { ! outb(vgaIOBase + 4,i); ! save.CRTC[i] = inb(vgaIOBase + 5); ! } ! ! for (i=0; i<21; i++) { ! inb(vgaIOBase + 0x0A); /* reset flip-flop */ ! outb(0x3C0,i); ! save.Attribute[i] = inb(0x3C1); ! } ! ! for (i=0; i<9; i++) { ! outb(0x3CE,i); ! save.Graphics[i] = inb(0x3CF); ! } ! for (i=0; i<5; i++) { ! outb(0x3C4,i); ! save.Sequencer[i] = inb(0x3C5); ! } ! ! /* ! * save the colorlookuptable ! */ ! outb(0x3C6,0xFF); ! outb(0x3C7,0x00); ! for (i=0; i<768; i++) ! save.DAC[i] = inb(0x3C9); ! ! /* Save fonts */ ! ! #ifdef SAVE_FONT1 ! if (!save.FontInfo1) ! save.FontInfo1 = (void *)xalloc(8192); ! inb(vgaIOBase + 0x0A); /* reset flip-flop */ ! outb(0x3C0,0x10); outb(0x3C0, 0x01); /* graphics mode */ ! outw(0x3C4, 0x0402); /* write to plane 2 */ ! outw(0x3C4, 0x0604); /* enable plane graphics */ ! outw(0x3CE, 0x0204); /* read plane 2 */ ! outw(0x3CE, 0x0005); /* write mode 0, read mode 0 */ ! outw(0x3CE, 0x0506); /* set graphics */ ! bcopy(vgaBase, save.FontInfo1, 8192); ! #endif /* SAVE_FONT1 */ ! ! #ifdef SAVE_TEXT ! if (!save.TextInfo) ! save.TextInfo = (unsigned char *)xalloc(8192); ! inb(vgaIOBase + 0x0A); /* reset flip-flop */ ! outb(0x3C0,0x10); outb(0x3C0, 0x01); /* graphics mode */ ! outw(0x3C4, 0x0102); /* write to plane 0 */ ! outw(0x3C4, 0x0604); /* enable plane graphics */ ! outw(0x3CE, 0x0004); /* read plane 0 */ ! outw(0x3CE, 0x0005); /* write mode 0, read mode 0 */ ! outw(0x3CE, 0x0506); /* set graphics */ ! bcopy(vgaBase, save.TextInfo, 4096); ! outw(0x3C4, 0x0202); /* write to plane 1 */ ! outw(0x3C4, 0x0604); /* enable plane graphics */ ! outw(0x3CE, 0x0104); /* read plane 1 */ ! outw(0x3CE, 0x0005); /* write mode 0, read mode 0 */ ! outw(0x3CE, 0x0506); /* set graphics */ ! bcopy(vgaBase, save.TextInfo + 4096, 4096); ! #endif /* SAVE_TEXT */ ! /* Enable video */ inb(vgaIOBase + 0x0A); /* reset flip-flop */ outb( 0x3c0, 0x20 ); } void mach32RestoreVGAInfo() { /* This routine is mostly from ATIRestore() in ! x386/vga256/drivers/ati/driver.c */ ! ! int i; ! ! if (vgaIOBase == 0x3B0) ! save.MiscOutReg &= 0xFE; ! else ! save.MiscOutReg |= 0x01; ! ! /* Disable video */ ! (void) inb(vgaIOBase + 0x0A); /* reset flip-flop */ ! outb(0x3C0, 0x00); /* Unlock ATI specials */ outw(ATIExtReg, ((inATI(0xb8) & 0xC0) << 8) | 0xb8); ! /* Load Miscellaneous Output External Register */ ! outb(0x3C2, save.MiscOutReg); ! ! outw(ATIExtReg, 0x00b2); /* segment select 0 */ ! ! if (save.FontInfo1 || save.TextInfo) { ! inb(vgaIOBase + 0x0A); /* reset flip-flop */ ! outb(0x3C0,0x10); outb(0x3C0, 0x01); /* graphics mode */ ! ! if (save.FontInfo1) { ! outw(0x3C4, 0x0402); /* write to plane 2 */ ! outw(0x3C4, 0x0604); /* enable plane graphics */ ! outw(0x3CE, 0x0204); /* read plane 2 */ ! outw(0x3CE, 0x0005); /* write mode 0, read mode 0 */ ! outw(0x3CE, 0x0506); /* set graphics */ ! bcopy(save.FontInfo1, vgaBase, 8192); ! } ! if (save.TextInfo) { ! outw(0x3C4, 0x0102); /* write to plane 0 */ ! outw(0x3C4, 0x0604); /* enable plane graphics */ ! outw(0x3CE, 0x0004); /* read plane 0 */ ! outw(0x3CE, 0x0005); /* write mode 0, read mode 0 */ ! outw(0x3CE, 0x0506); /* set graphics */ ! bcopy(save.TextInfo, vgaBase, 4096); ! outw(0x3C4, 0x0202); /* write to plane 1 */ ! outw(0x3C4, 0x0604); /* enable plane graphics */ ! outw(0x3CE, 0x0104); /* read plane 1 */ ! outw(0x3CE, 0x0005); /* write mode 0, read mode 0 */ ! outw(0x3CE, 0x0506); /* set graphics */ ! bcopy(save.TextInfo + 4096, vgaBase, 4096); ! } ! } ! ! /* This sequence is from the "VGA Wonder Programmer's ! Reference Manual." I assume it is correct :-) ! faith@cs.unc.edu (7Aug92) */ ! ! /* Place Sequencer into Reset condition using its Reset Register */ ! outw(0x3C4, 0x0100); ! ! /* Load ATI Extended Registers */ ! outw(ATIExtReg, (save.ATIReg0 << 8) | 0xb0); ! outw(ATIExtReg, (save.ATIReg1 << 8) | 0xb1); ! outw(ATIExtReg, (save.ATIReg2 << 8) | 0xb2); ! outw(ATIExtReg, (save.ATIReg5 << 8) | 0xb5); ! outw(ATIExtReg, (save.ATIReg6 << 8) | 0xb6); ! outw(ATIExtReg, (save.ATIRegE << 8) | 0xbe); ! outw(ATIExtReg, (save.ATIReg3 << 8) | 0xb3); ! outw(ATIExtReg, (save.ATIReg8 << 8) | 0xb8); ! outw(ATIExtReg, (save.ATIReg9 << 8) | 0xb9); ! outw(ATIExtReg, (save.ATIRegA6 << 8) | 0xa6); ! outw(ATIExtReg, (save.ATIRegA7 << 8) | 0xa7); ! ! /* Load Miscellaneous Output External Register */ ! outb(0x3C2, save.MiscOutReg); ! ! /* Load Sequence Registers 1 through 4 */ ! for (i=1; i<5; i++) ! outw(0x3C4, (save.Sequencer[i] << 8) | i); ! ! /* Restart Sequencer using Reset Register */ ! outw(0x3C4, 0x0300); ! ! /* Load all 25 CRT Control Registers */ ! /* But first, unlock CRTC registers 0 to 7 */ ! outw(vgaIOBase + 4, ((save.CRTC[0x11] & 0x7F) << 8) | 0x11); ! for (i=0; i<25; i++) ! outw(vgaIOBase + 4,(save.CRTC[i] << 8) | i); ! ! /* Reset Attribute Controller address/data flip-flop */ ! (void) inb(vgaIOBase + 0x0A); ! ! /* Load all 20 Attribute Controller Registers */ ! for (i=0; i<21; i++) { ! (void) inb(vgaIOBase + 0x0A); ! outb(0x3C0,i); ! outb(0x3C0, save.Attribute[i]); ! } ! /* Load all 9 Graphics Controller Registers */ ! for (i=0; i<9; i++) ! outw(0x3CE, (save.Graphics[i] << 8) | i); ! ! /* Load all 768 DAC Registers */ ! outb(0x3C8,0x00); ! for (i=0; i<768; i++) ! outb(0x3C9, save.DAC[i]); ! ! /* Reset Attribute Controller address/data flip-flop */ ! (void) inb(vgaIOBase + 0x0A); ! ! /* Turn Attribute Controller on */ ! outb(0x3C0, 0x20); ! } /* --- 110,183 ---- 64 * 1024); } vgaIOBase = (inb(0x3cc) & 0x01) ? 0x3D0 : 0x3B0; ! /* This part is copied from ATISave() in ! * x386/vga256/drivers/ati/driver.c ! */ /* Unlock ATI specials */ outb(ATIExtReg, (((b8_save = inATI(0xb8)) & 0xC0) << 8) | 0xb8); b2_save = inATI(0xb2); outb(ATIExtReg, 0x00b2); /* segment select 0 */ ! vgaNewVideoState = vgaHWSave(vgaNewVideoState, sizeof(SaveBlock)); ! save->ATIReg0 = inATI(0xb0); ! save->ATIReg1 = inATI(0xb1); ! save->ATIReg2 = b2_save; ! save->ATIReg5 = inATI(0xb5); ! save->ATIReg6 = inATI(0xb6); ! save->ATIReg3 = inATI(0xb3); ! save->ATIReg8 = b8_save; ! save->ATIRegE = inATI(0xbe); ! save->ATIReg9 = inATI(0xb9); ! save->ATIRegA6 = inATI(0xa6); ! save->ATIRegA7 = inATI(0xa7); ! ! #if 0 ! /* ! * TvR: don't know whether this is neccesary for mach32 ! * Should be removed if it isn't needed. ! */ /* Enable video */ inb(vgaIOBase + 0x0A); /* reset flip-flop */ outb( 0x3c0, 0x20 ); + #endif } void mach32RestoreVGAInfo() { /* This routine is mostly from ATIRestore() in ! * x386/vga256/drivers/ati/driver.c ! */ /* Unlock ATI specials */ outw(ATIExtReg, ((inATI(0xb8) & 0xC0) << 8) | 0xb8); ! /* Load ATI Extended registers */ ! outw(ATIExtReg, (save->ATIReg0 << 8) | 0xb0); ! outw(ATIExtReg, (save->ATIReg1 << 8) | 0xb1); ! outw(ATIExtReg, (save->ATIReg2 << 8) | 0xb2); ! outw(ATIExtReg, (save->ATIReg3 << 8) | 0xb3); ! outw(ATIExtReg, (save->ATIReg5 << 8) | 0xb5); ! outw(ATIExtReg, (save->ATIReg6 << 8) | 0xb6); ! outw(ATIExtReg, (save->ATIRegE << 8) | 0xbE); ! outw(ATIExtReg, (save->ATIReg9 << 8) | 0xb9); ! outw(ATIExtReg, (save->ATIRegA6 << 8) | 0xa6); ! outw(ATIExtReg, (save->ATIRegA7 << 8) | 0xa7); ! ! /* ! * Last but not least ATIReg8 -- according to vgadoc's this lock the ! * ATI special registers ! */ ! outw(ATIExtReg, (save->ATIReg8 << 8) | 0xb8); ! /* ! * Restore the generic vga registers ! */ ! vgaHWRestore(save); } /* diff -c mit/server/ddx/x386/accel/mach32/mach32.c:2.25 mit/server/ddx/x386/accel/mach32/mach32.c:2.47 *** mit/server/ddx/x386/accel/mach32/mach32.c:2.25 Fri Mar 11 23:37:02 1994 --- mit/server/ddx/x386/accel/mach32/mach32.c Fri Mar 11 23:37:02 1994 *************** *** 29,37 **** * Header: /proj/X11/mit/server/ddx/x386/vga/RCS/vga.c,v 1.2 1991/06/27 00:02:49 root Exp */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32.c,v 2.25 1993/10/18 12:17:03 dawes Exp $ */ #include "X.h" #include "input.h" #include "scrnintstr.h" #include "pixmapstr.h" --- 29,38 ---- * Header: /proj/X11/mit/server/ddx/x386/vga/RCS/vga.c,v 1.2 1991/06/27 00:02:49 root Exp */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32.c,v 2.47 1994/03/03 12:43:18 dawes Exp $ */ #include "X.h" + #include "Xmd.h" #include "input.h" #include "scrnintstr.h" #include "pixmapstr.h" *************** *** 42,48 **** --- 43,51 ---- #include "x386.h" #include "x386Priv.h" + #include "x386Procs.h" #include "xf86_OSlib.h" + #include "xf86_HWlib.h" #include "mach32.h" #include "regmach32.h" #include "cfb.h" *************** *** 51,61 **** --- 54,68 ---- #include "xf86_Config.h" extern int mach32MaxClock; + extern int mach32MaxTlc34075Clock; extern Bool x386Verbose, x386Resetting, x386Exiting, x386ProbeFailed; extern void NoopDDA(); extern void mach32QueryBestSize(); extern void mach32WarpCursor(); extern void mach32RepositionCursor(); + extern Bool miDCInitialize(); + extern void SetTimeSinceLastInputEvent(); + unsigned short mach32MemorySize = 0; ScrnInfoRec mach32InfoRec = { FALSE, /* Bool configured */ *************** *** 83,88 **** --- 90,96 ---- 0, /* int maxClock */ 0, /* int videoRam */ 0xC0000, /* int BIOSbase */ + 0, /* unsigned long MemBase */ 240, 180, /* int width, height */ 0, /* unsigned long speedup */ NULL, /* DisplayModePtr modes */ *************** *** 123,130 **** short mach32MaxX, mach32MaxY; short mach32VirtX, mach32VirtY; ! Bool mach32Use4MbAperture; static unsigned Mach32_IOPorts[] = { /* VGA Registers */ 0x3B4, 0x3B5, 0x3BA, 0x3C0, 0x3C1, 0x3C2, 0x3C4, 0x3C5, 0x3C6, 0x3C7, --- 131,141 ---- short mach32MaxX, mach32MaxY; short mach32VirtX, mach32VirtY; ! Bool mach32Use4MbAperture = FALSE; ! Bool mach32DAC8Bit = FALSE; + Bool mach32clkprobedif4fix = FALSE; + static unsigned Mach32_IOPorts[] = { /* VGA Registers */ 0x3B4, 0x3B5, 0x3BA, 0x3C0, 0x3C1, 0x3C2, 0x3C4, 0x3C5, 0x3C6, 0x3C7, *************** *** 146,151 **** --- 157,165 ---- EXT_SCISSOR_L, EXT_SCISSOR_R, EXT_SCISSOR_T, EXT_SCISSOR_B, MISC_OPTIONS, CONFIG_STATUS_1, CONFIG_STATUS_2, MEM_CFG, MEM_BNDRY, ROM_ADDR_1, READ_SRC_X, CHIP_ID, EXT_FIFO_STATUS, + R_EXT_GE_CONFIG, EXT_GE_CONFIG, DP_CONFIG, DEST_X_START, DEST_X_END, + DEST_Y_END, ALU_FG_FN, MISC_CNTL, R_MISC_CNTL, HORZ_OVERSCAN, + VERT_OVERSCAN, EXT_GE_STATUS, LINEDRAW, LINEDRAW_OPT, LINEDRAW_INDEX, }; static int Num_Mach32_IOPorts = (sizeof(Mach32_IOPorts)/ sizeof(Mach32_IOPorts[0])); *************** *** 152,157 **** --- 166,172 ---- static mach32CRTCRegRec mach32CRTCRegs; static ScreenPtr savepScreen = NULL; + static PixmapPtr ppix = NULL; /* * ATI Hardware Probe *************** *** 177,182 **** --- 192,212 ---- int DAC_Type; } ATIInformationBlock; + int mach32Ramdac; + char *mach32ramdac_names[] = { + "ATI-68830", + "IMS-G173/SC1148[368]", + "ATI68875/TLC34075/Bt885", + "Bt47[68]/INMOS17[68]", + "AT&T20C49[01]/Bt48[12]/IMS-G174/MU9C{1880,4910}/SC1502[56]", + "ATI-68860", + "unknown", + "unknown", + }; + + + int mach32BusType; + static ATIInformationBlock *GetATIInformationBlock() { #define BIOS_DATA_SIZE 0x70 *************** *** 221,232 **** tmp = inw( ROM_ADDR_1 ); outw( ROM_ADDR_1, 0x5555 ); ! WaitIdleEmpty(); if (inw( ROM_ADDR_1 ) != 0x5555) { info.ATI_Accelerator_Present = 0; } else { outw( ROM_ADDR_1, 0x2a2a ); ! WaitIdleEmpty(); if (inw( ROM_ADDR_1 ) != 0x2a2a) { info.ATI_Accelerator_Present = 0; } --- 251,262 ---- tmp = inw( ROM_ADDR_1 ); outw( ROM_ADDR_1, 0x5555 ); ! ProbeWaitIdleEmpty(); if (inw( ROM_ADDR_1 ) != 0x5555) { info.ATI_Accelerator_Present = 0; } else { outw( ROM_ADDR_1, 0x2a2a ); ! ProbeWaitIdleEmpty(); if (inw( ROM_ADDR_1 ) != 0x2a2a) { info.ATI_Accelerator_Present = 0; } *************** *** 280,305 **** tmp = inw( CONFIG_STATUS_1 ); info.Bus_Type = tmp & BUS_TYPE; info.Mem_Type = tmp & MEM_TYPE; ! info.DAC_Type = tmp & DACTYPE; tmp = inw( CONFIG_STATUS_2 ); ! if ((info.Bus_Type == ISA_16_BIT ! || info.Bus_Type == ISA_8_BIT) ! && !(tmp & ISA_16_ENA)) info.Bus_8bit_Only = 1; tmp = inw( MISC_OPTIONS ); ! switch ((tmp & MEM_SIZE_ALIAS) >> 2) { ! case 0: info.Mem_Size = 512; break; ! case 1: info.Mem_Size = 1024; break; ! case 2: info.Mem_Size = 2*1024; break; ! case 3: info.Mem_Size = 4*1024; break; } --- 310,333 ---- tmp = inw( CONFIG_STATUS_1 ); info.Bus_Type = tmp & BUS_TYPE; info.Mem_Type = tmp & MEM_TYPE; ! info.DAC_Type = (tmp & DACTYPE) >> 9; tmp = inw( CONFIG_STATUS_2 ); ! if ((info.Bus_Type == ISA_16_BIT) && !(tmp & ISA_16_ENA)) info.Bus_8bit_Only = 1; tmp = inw( MISC_OPTIONS ); ! switch (tmp & MEM_SIZE_ALIAS) { ! case MEM_SIZE_512K: info.Mem_Size = 512; break; ! case MEM_SIZE_1M: info.Mem_Size = 1024; break; ! case MEM_SIZE_2M: info.Mem_Size = 2*1024; break; ! case MEM_SIZE_4M: info.Mem_Size = 4*1024; break; } *************** *** 315,321 **** Bool mach32Probe() { ! int i; DisplayModePtr pMode, pEnd; ATIInformationBlock *info; int extra_ram; --- 343,349 ---- Bool mach32Probe() { ! int i, j; DisplayModePtr pMode, pEnd; ATIInformationBlock *info; int extra_ram; *************** *** 322,329 **** int extra_caches; Bool sw_cursor_supplied; OFlagSet validOptions; - mach32InfoRec.maxClock = mach32MaxClock; xf86ClearIOPortList(mach32InfoRec.scrnIndex); xf86AddIOPorts(mach32InfoRec.scrnIndex, Num_Mach32_IOPorts, Mach32_IOPorts); --- 350,357 ---- int extra_caches; Bool sw_cursor_supplied; OFlagSet validOptions; + int tx, ty; xf86ClearIOPortList(mach32InfoRec.scrnIndex); xf86AddIOPorts(mach32InfoRec.scrnIndex, Num_Mach32_IOPorts, Mach32_IOPorts); *************** *** 331,350 **** xf86EnableIOPorts(mach32InfoRec.scrnIndex); info = GetATIInformationBlock(); - if (!info || !info->Mach32_Present) { xf86DisableIOPorts(mach32InfoRec.scrnIndex); return(FALSE); } OFLG_ZERO(&validOptions); OFLG_SET(OPTION_SW_CURSOR, &validOptions); OFLG_SET(OPTION_NOLINEAR_MODE, &validOptions); xf86VerifyOptions(&validOptions, &mach32InfoRec); mach32InfoRec.chipset = "mach32"; x386ProbeFailed = FALSE; if (x386Verbose) { ErrorF("%s ",OFLG_ISSET(XCONFIG_CLOCKS,&mach32InfoRec.xconfigFlag) ? XCONFIG_GIVEN : XCONFIG_PROBED); --- 359,461 ---- xf86EnableIOPorts(mach32InfoRec.scrnIndex); info = GetATIInformationBlock(); if (!info || !info->Mach32_Present) { xf86DisableIOPorts(mach32InfoRec.scrnIndex); return(FALSE); } + switch(info->DAC_Type) { + case DAC_TLC34075: + mach32InfoRec.maxClock = mach32MaxTlc34075Clock; + break; + default: + mach32InfoRec.maxClock = mach32MaxClock; + break; + } + OFLG_ZERO(&validOptions); OFLG_SET(OPTION_SW_CURSOR, &validOptions); OFLG_SET(OPTION_NOLINEAR_MODE, &validOptions); + OFLG_SET(OPTION_CSYNC, &validOptions); + OFLG_SET(OPTION_INTEL_GX, &validOptions); + OFLG_SET(OPTION_DAC_8_BIT, &validOptions); xf86VerifyOptions(&validOptions, &mach32InfoRec); mach32InfoRec.chipset = "mach32"; x386ProbeFailed = FALSE; + mach32BusType = info->Bus_Type; + if (x386Verbose) + { + ErrorF("%s %s: card type: ", XCONFIG_PROBED, mach32InfoRec.name); + switch(mach32BusType) + { + case EISA: + ErrorF("EISA\n"); + break; + case LOCAL_386SX: + ErrorF("localbus (386SX)\n"); + break; + case LOCAL_386DX: + ErrorF("localbus (386DX)\n"); + break; + case LOCAL_486: + ErrorF("localbus (486)\n"); + break; + case PCI: + ErrorF("PCI\n"); + break; + default: + ErrorF("ISA\n"); + } + } + + if (!mach32InfoRec.clocks) + { + outb(DISP_CNTL, DISPEN_DISAB /*| INTERLACE*/ | MEMCFG_4 | ODDBNKENAB); + /* 13-jun-93 TCG : set up dummy video mode */ + outw(SHADOW_SET, 1); + outw(SHADOW_CTL, 0); + outw(SHADOW_SET, 2); + outw(SHADOW_CTL, 0); + outw(SHADOW_SET, 0); + outw(ADVFUNC_CNTL, DISABPASSTHRU); + + /* vt: 480 488 +31 528 hz: 640 656 +248 920 */ + outw(V_TOTAL, 0x420); + outw(V_DISP, 0x3c0); + outw(V_SYNC_STRT, 0x3d0); + outw(V_SYNC_WID, 0x1f); + outb(H_TOTAL, 0x72); + outw(H_DISP, 0x4f); + outb(H_SYNC_STRT, 0x51); + outb(H_SYNC_WID, 0x1f); + + outb(DAC_MASK, 0x00); + outb(DISP_CNTL, DISPEN_ENAB | MEMCFG_4 | ODDBNKENAB); + + /* 2-oct-93 TCG : detect clocks with dif4 fix */ + mach32clkprobedif4fix = TRUE; + xf86GetClocks(16, mach32ClockSelect, NoopDDA, NoopDDA, + DISP_STAT, 2, 7, 44900, &mach32InfoRec); + outw(CLOCK_SEL, 0); /* reset pass-through */ + mach32clkprobedif4fix = FALSE; + + outw(SHADOW_SET, 1); + outw(SHADOW_CTL, 0x3f); + outw(SHADOW_SET, 2); + outw(SHADOW_CTL, 0x3f); + outw(SHADOW_SET, 0); + + outb(DAC_MASK, 0xff); + + for (j = 0; j < 16; j++) + mach32InfoRec.clock[j + 16] = mach32InfoRec.clock[j] / 2; + + mach32InfoRec.clocks = 32; + } + + if (x386Verbose) { ErrorF("%s ",OFLG_ISSET(XCONFIG_CLOCKS,&mach32InfoRec.xconfigFlag) ? XCONFIG_GIVEN : XCONFIG_PROBED); *************** *** 362,376 **** ErrorF("\n"); } pMode = pEnd = mach32InfoRec.modes; do { x386LookupMode(pMode, &mach32InfoRec); pMode = pMode->next; } while (pMode != pEnd); ! mach32VirtX = (mach32InfoRec.virtualX+7) & 0xfff8; mach32VirtY = mach32InfoRec.virtualY; /* * Limitation of 8514 drawing commands (taking into account 256 lines * required by the cache) --- 473,494 ---- ErrorF("\n"); } + tx = mach32InfoRec.virtualX; + ty = mach32InfoRec.virtualY; pMode = pEnd = mach32InfoRec.modes; do { x386LookupMode(pMode, &mach32InfoRec); + mach32InfoRec.virtualX = max(mach32InfoRec.virtualX, pMode->HDisplay); + mach32InfoRec.virtualY = max(mach32InfoRec.virtualY, pMode->VDisplay); pMode = pMode->next; } while (pMode != pEnd); ! mach32VirtX = mach32InfoRec.virtualX = (mach32InfoRec.virtualX+7) & 0xfff8; mach32VirtY = mach32InfoRec.virtualY; + if ((tx != mach32InfoRec.virtualX) || (ty != mach32InfoRec.virtualY)) + OFLG_CLR(XCONFIG_VIRTUAL,&mach32InfoRec.xconfigFlag); + /* * Limitation of 8514 drawing commands (taking into account 256 lines * required by the cache) *************** *** 402,422 **** return(FALSE); } ! if (!mach32InfoRec.videoRam) ! mach32InfoRec.videoRam = info->Mem_Size; ! ! /* XXXX we normally allow the Xconfig to completely override probed info */ ! if (mach32InfoRec.videoRam > info->Mem_Size) { ! ErrorF( "Illegal value for videoRam (max is %d)\n", info->Mem_Size ); ! xf86DisableIOPorts(mach32InfoRec.scrnIndex); ! return(FALSE); ! } ! if (x386Verbose) { ! ErrorF("%s %s: %d kb memory available (using %d kb)\n", OFLG_ISSET(XCONFIG_VIDEORAM, &mach32InfoRec.xconfigFlag) ? ! XCONFIG_GIVEN : XCONFIG_PROBED, mach32InfoRec.name, ! info->Mem_Size, mach32InfoRec.videoRam ); } if (((mach32MaxX+1)*(mach32MaxY+1)) > (mach32InfoRec.videoRam*1024)) { --- 520,548 ---- return(FALSE); } ! if (!mach32InfoRec.videoRam) { ! #ifdef NEW_MEM_DETECT ! mach32InfoRec.videoRam = mach32GetMemSize(); ! #else ! mach32InfoRec.videoRam = info->Mem_Size; ! #endif ! } ! ! /* Set mach32MemorySize to required MEM_SIZE value in MISC_OPTIONS */ ! if (mach32InfoRec.videoRam <= 512) ! mach32MemorySize = MEM_SIZE_512K; ! else if (mach32InfoRec.videoRam <= 1024) ! mach32MemorySize = MEM_SIZE_1M; ! else if (mach32InfoRec.videoRam <= 2048) ! mach32MemorySize = MEM_SIZE_2M; ! else ! mach32MemorySize = MEM_SIZE_4M; ! if (x386Verbose) { ! ErrorF("%s %s: videoram: %dk\n", OFLG_ISSET(XCONFIG_VIDEORAM, &mach32InfoRec.xconfigFlag) ? ! XCONFIG_GIVEN : XCONFIG_PROBED, mach32InfoRec.name, ! mach32InfoRec.videoRam ); } if (((mach32MaxX+1)*(mach32MaxY+1)) > (mach32InfoRec.videoRam*1024)) { *************** *** 468,477 **** (info->Bus_Type == LOCAL_386SX || info->Bus_Type == LOCAL_386DX || info->Bus_Type == LOCAL_486 || ! info->Bus_Type == EISA) && xf86LinearVidMem(); ! if (x386Verbose) if (mach32Use4MbAperture) { ErrorF("%s %s: Using 4 MB aperture\n", XCONFIG_PROBED, mach32InfoRec.name); --- 594,606 ---- (info->Bus_Type == LOCAL_386SX || info->Bus_Type == LOCAL_386DX || info->Bus_Type == LOCAL_486 || ! info->Bus_Type == EISA || ! info->Bus_Type == PCI) && xf86LinearVidMem(); ! mach32Ramdac = info->DAC_Type; ! ! if (x386Verbose) { if (mach32Use4MbAperture) { ErrorF("%s %s: Using 4 MB aperture\n", XCONFIG_PROBED, mach32InfoRec.name); *************** *** 480,485 **** --- 609,630 ---- OFLG_ISSET(OPTION_NOLINEAR_MODE, &mach32InfoRec.options) ? XCONFIG_GIVEN : XCONFIG_PROBED, mach32InfoRec.name); } + ErrorF("%s %s: Ramdac is %s\n", XCONFIG_PROBED, mach32InfoRec.name, + mach32ramdac_names[mach32Ramdac]); + } + + /* The Type 2 RAMDACS can support 8 bits per RGB value, not just the + * VGA-standard 6 bits; however, according to ATI, this is not an + * official feature of the mach32. + */ + mach32DAC8Bit = OFLG_ISSET(OPTION_DAC_8_BIT, &mach32InfoRec.options) + && (info->DAC_Type == DAC_TLC34075); + + if (x386Verbose) + ErrorF("%s %s: Using %d bits per RGB value\n", + (info->DAC_Type == DAC_TLC34075) ? XCONFIG_GIVEN : + XCONFIG_PROBED, mach32InfoRec.name, + mach32DAC8Bit ? 8 : 6); return(TRUE); } *************** *** 512,517 **** --- 657,665 ---- int argc; /* The number of the Server's arguments. */ char **argv; /* The arguments themselves. Don't change! */ { + int displayResolution = 75; /* default to 75dpi */ + extern int monitorResolution; + mach32InitDisplay(scr_index); mach32InitAperture(scr_index); mach32CalcCRTCRegs(&mach32CRTCRegs, mach32InfoRec.modes); *************** *** 536,544 **** WaitIdleEmpty(); /* Make sure that all commands have finished */ if (!mach32ScreenInit(pScreen, mach32VideoMem, mach32VirtX, mach32VirtY, ! 75, 75, mach32VirtX)) return(FALSE); --- 684,699 ---- WaitIdleEmpty(); /* Make sure that all commands have finished */ + /* + * Take display resolution from the -dpi flag if specified + */ + + if (monitorResolution) + displayResolution = monitorResolution; + if (!mach32ScreenInit(pScreen, mach32VideoMem, mach32VirtX, mach32VirtY, ! displayResolution, displayResolution, mach32VirtX)) return(FALSE); *************** *** 574,580 **** int screen_idx; { PixmapPtr pspix; - static PixmapPtr ppix = NULL; ScreenPtr pScreen = savepScreen; pspix = (PixmapPtr)pScreen->devPrivate; --- 729,734 ---- *************** *** 640,646 **** ppix->devPrivate.ptr, PixmapBytePad(pScreen->width, pScreen->rootDepth), ! 0, 0); pspix->devPrivate.ptr = ppix->devPrivate.ptr; } } --- 794,800 ---- ppix->devPrivate.ptr, PixmapBytePad(pScreen->width, pScreen->rootDepth), ! 0, 0, ~0); pspix->devPrivate.ptr = ppix->devPrivate.ptr; } } *************** *** 667,672 **** --- 821,828 ---- mach32CloseScreen(screen_idx) int screen_idx; { + extern void mach32ClearSavedCursor(); + /* * Hmm... The server may shut down even if it is not running on the * current vt. Let's catch this case here. *************** *** 674,680 **** x386Exiting = TRUE; if (x386VTSema) mach32EnterLeaveVT(LEAVE, screen_idx); ! return(TRUE); } --- 830,844 ---- x386Exiting = TRUE; if (x386VTSema) mach32EnterLeaveVT(LEAVE, screen_idx); ! else if (ppix) { ! /* 7-Jan-94 CEG: The server is not running on the current vt. ! * Free the screen snapshot taken when the server vt was left. ! */ ! (savepScreen->DestroyPixmap)(ppix); ! ppix = NULL; ! } ! mach32ClearSavedCursor(screen_idx); ! savepScreen = NULL; return(TRUE); } *************** *** 688,700 **** ScreenPtr pScreen; Bool on; { if (on) SetTimeSinceLastInputEvent(); if (x386VTSema) { if (on) { mach32RestoreColor0(pScreen); ! outw(DAC_MASK, 0xff); } else { outb(DAC_W_INDEX, 0); outb(DAC_DATA, 0); --- 852,873 ---- ScreenPtr pScreen; Bool on; { + int ext_ge_config; + if (on) SetTimeSinceLastInputEvent(); + if (x386VTSema) { + /* + * Make sure that register 0-3 are addressed + */ + ext_ge_config = inw(R_EXT_GE_CONFIG) & ~0x3000; + outw(EXT_GE_CONFIG, ext_ge_config); + if (on) { mach32RestoreColor0(pScreen); ! outb(DAC_MASK, 0xff); } else { outb(DAC_W_INDEX, 0); outb(DAC_DATA, 0); *************** *** 701,707 **** outb(DAC_DATA, 0); outb(DAC_DATA, 0); ! outw(DAC_MASK, 0x00); } } --- 874,880 ---- outb(DAC_DATA, 0); outb(DAC_DATA, 0); ! outb(DAC_MASK, 0x00); } } *************** *** 736,739 **** --- 909,934 ---- mach32SetCRTCRegs(&mach32CRTCRegs); return(TRUE); + } + + /* + * mach32ClockSelect + */ + Bool + mach32ClockSelect(no) + int no; + { + switch(no) + { + case CLK_REG_SAVE: + break; + case CLK_REG_RESTORE: + break; + default: + if (mach32clkprobedif4fix) + outw(CLOCK_SEL, (no << 2) | 0xac1); + else + outw(CLOCK_SEL, (no << 2) | 0xa01); + } + return(TRUE); } diff -c mit/server/ddx/x386/accel/mach32/mach32.h:2.4 mit/server/ddx/x386/accel/mach32/mach32.h:2.13 *** mit/server/ddx/x386/accel/mach32/mach32.h:2.4 Fri Mar 11 23:37:04 1994 --- mit/server/ddx/x386/accel/mach32/mach32.h Fri Mar 11 23:37:04 1994 *************** *** 23,29 **** * Modified for the Mach32 by Kevin E. Martin (martin@cs.unc.edu) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32.h,v 2.4 1993/10/08 15:57:23 dawes Exp $ */ #ifndef MACH32_H #define MACH32_H --- 23,29 ---- * Modified for the Mach32 by Kevin E. Martin (martin@cs.unc.edu) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32.h,v 2.13 1994/03/01 09:51:30 dawes Exp $ */ #ifndef MACH32_H #define MACH32_H *************** *** 33,38 **** --- 33,40 ---- #define MACH32_CURSBYTES 1024 #define MACH32_CURSMAX 64 + #define NEW_MEM_DETECT + #include "X.h" #include "misc.h" #include "x386.h" *************** *** 45,55 **** --- 47,70 ---- extern void mach32AdjustFrame(); extern Bool mach32SwitchMode(); extern void mach32PrintIdent(); + extern Bool mach32ClockSelect(); + + extern void mach32Dline(); + extern void mach32Dsegment(); extern Bool mach32SaveScreen(); extern Bool mach32CloseScreen(); extern Bool mach32ScreenInit(); + extern void mach32InitDisplay(); + extern void mach32InitAperture(); + extern void mach32InitEnvironment(); + extern void mach32CalcCRTCRegs(); + extern void mach32SetCRTCRegs(); + extern void mach32SaveLUT(); + extern void mach32RestoreLUT(); + extern void mach32CleanUp(); + extern void mach32SetRamdac(); extern int mach32ListInstalledColormaps(); extern int mach32GetInstalledColormaps(); *************** *** 84,95 **** extern int mach32CacheFont8(); extern void mach32UnCacheFont8(); - extern int mach32IsCached(); extern int mach32CPolyText8(); extern void mach32CImageText8(); extern void mach32PolyPoint(); extern void mach32Line(); extern void mach32Segment(); extern void mach32SetSpans(); --- 99,110 ---- extern int mach32CacheFont8(); extern void mach32UnCacheFont8(); extern int mach32CPolyText8(); extern void mach32CImageText8(); extern void mach32PolyPoint(); extern void mach32Line(); + extern void mach32Line1Rect(); extern void mach32Segment(); extern void mach32SetSpans(); *************** *** 111,116 **** --- 126,132 ---- extern RegionPtr mach32CopyArea(); extern RegionPtr mach32CopyPlane(); extern void mach32CopyWindow(); + extern void mach32GetImage(); extern void mach32PaintWindow(); extern void mach32FillBoxSolid(); *************** *** 120,125 **** --- 136,148 ---- extern Bool mach32CreateGC(); + extern Bool mach32CursorInit(); + extern void mach32RestoreCursor(); + extern void mach32CursorOff(); + extern void mach32RenewCursorColor(); + + extern int mach32GetMemSize(); + extern pointer mach32VideoMem; extern pointer vgaBase; extern Bool x386VTSema; *************** *** 126,131 **** --- 149,158 ---- extern short mach32MaxX, mach32MaxY; extern short mach32VirtX, mach32VirtY; extern Bool mach32Use4MbAperture; + extern Bool mach32DAC8Bit; + + extern int mach32Ramdac; + extern int mach32BusType; /* == 0 --> no boundary crossing on this line */ /* > 0 --> x value of first pixel in video aperture */ diff -c mit/server/ddx/x386/accel/mach32/mach32blt.c:2.3 mit/server/ddx/x386/accel/mach32/mach32blt.c:2.7 *** mit/server/ddx/x386/accel/mach32/mach32blt.c:2.3 Fri Mar 11 23:37:05 1994 --- mit/server/ddx/x386/accel/mach32/mach32blt.c Fri Mar 11 23:37:05 1994 *************** *** 29,35 **** */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32blt.c,v 2.3 1993/09/23 15:44:05 dawes Exp $ */ /* $XConsortium: cfbbitblt.c,v 5.39 91/05/24 16:33:25 keith Exp $ */ --- 29,35 ---- */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32blt.c,v 2.7 1994/02/25 14:58:17 dawes Exp $ */ /* $XConsortium: cfbbitblt.c,v 5.39 91/05/24 16:33:25 keith Exp $ */ *************** *** 50,58 **** #include "mach32.h" void mach32FindOrdering(); - static unsigned long bitBltPlane = 0; - RegionPtr mach32CopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty) --- 50,57 ---- #include "mach32.h" void mach32FindOrdering(); + extern RegionPtr cfbBitBlt(); RegionPtr mach32CopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty) *************** *** 345,353 **** if (dy > 0) direction |= INC_Y; WaitQueue(3); ! outw(FRGD_MIX, FSS_BITBLT | MIX_SRC); outw(BKGD_MIX, BSS_BKGDCOL | MIX_SRC); ! outw(WRT_MASK, 0xffff); if (direction == (INC_X | INC_Y)) { for (i = 0; i < numRects; i++) { --- 344,352 ---- if (dy > 0) direction |= INC_Y; WaitQueue(3); ! outw(FRGD_MIX, FSS_BITBLT | mach32alu[pGC->alu]); outw(BKGD_MIX, BSS_BKGDCOL | MIX_SRC); ! outw(WRT_MASK, pGC->planemask); if (direction == (INC_X | INC_Y)) { for (i = 0; i < numRects; i++) { *************** *** 414,420 **** for (i = numRects; --i >= 0; pbox++) (mach32ImageReadFunc)(pbox->x1 + dx, pbox->y1 + dy, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, ! pdst, pixWidth, pbox->x1, pbox->y1); } else if (pSrcDrawable->type != DRAWABLE_WINDOW && pDstDrawable->type == DRAWABLE_WINDOW) { /* Pixmap --> Window */ int pixWidth = PixmapBytePad(pSrcDrawable->width, pSrcDrawable->depth); --- 413,420 ---- for (i = numRects; --i >= 0; pbox++) (mach32ImageReadFunc)(pbox->x1 + dx, pbox->y1 + dy, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, ! pdst, pixWidth, pbox->x1, pbox->y1, ! pGC->planemask); } else if (pSrcDrawable->type != DRAWABLE_WINDOW && pDstDrawable->type == DRAWABLE_WINDOW) { /* Pixmap --> Window */ int pixWidth = PixmapBytePad(pSrcDrawable->width, pSrcDrawable->depth); *************** *** 581,588 **** (void) cfbBitBlt(pSrcDrawable, (DrawablePtr)pBitmap, pGC1, srcx, srcy, width, height, 0, 0, cfbCopyPlane8to1, bitPlane); pSrcDrawable = (DrawablePtr)pBitmap; ! } ! else if (((pSrcDrawable->type == DRAWABLE_WINDOW) && (pDstDrawable->type != DRAWABLE_WINDOW)) || ((pSrcDrawable->type != DRAWABLE_WINDOW) && (pDstDrawable->type == DRAWABLE_WINDOW) && --- 581,613 ---- (void) cfbBitBlt(pSrcDrawable, (DrawablePtr)pBitmap, pGC1, srcx, srcy, width, height, 0, 0, cfbCopyPlane8to1, bitPlane); pSrcDrawable = (DrawablePtr)pBitmap; ! } else if ((pSrcDrawable->type == DRAWABLE_WINDOW) && ! (pDstDrawable->type != DRAWABLE_WINDOW)) { ! /* ! * Shortcut - we can do Window->Pixmap by copying the window to ! * a pixmap, then we have a Pixmap->Pixmap operation ! */ ! GCPtr pGC1; ! RegionPtr retval; ! PixmapPtr pPixmap; ! ! pPixmap=(*pSrcDrawable->pScreen->CreatePixmap)(pSrcDrawable->pScreen, ! width, height, 8); ! if (!pPixmap) ! return(NULL); ! pGC1 = GetScratchGC(8, pSrcDrawable->pScreen); ! if (!pGC1) { ! (*pSrcDrawable->pScreen->DestroyPixmap)(pPixmap); ! return(NULL); ! } ! ValidateGC((DrawablePtr)pPixmap, pGC1); ! mach32CopyArea(pSrcDrawable, pPixmap, pGC1, srcx, srcy, width, height, ! 0, 0); ! retval = cfbCopyPlane((DrawablePtr)pPixmap, pDstDrawable, pGC, ! 0, 0, width, height, dstx, dsty, bitPlane); ! (*pSrcDrawable->pScreen->DestroyPixmap)(pPixmap); ! return(retval); ! } else if (((pSrcDrawable->type == DRAWABLE_WINDOW) && (pDstDrawable->type != DRAWABLE_WINDOW)) || ((pSrcDrawable->type != DRAWABLE_WINDOW) && (pDstDrawable->type == DRAWABLE_WINDOW) && diff -c mit/server/ddx/x386/accel/mach32/mach32bstor.c:2.2 mit/server/ddx/x386/accel/mach32/mach32bstor.c:2.3 *** mit/server/ddx/x386/accel/mach32/mach32bstor.c:2.2 Fri Mar 11 23:37:06 1994 --- mit/server/ddx/x386/accel/mach32/mach32bstor.c Fri Mar 11 23:37:06 1994 *************** *** 27,33 **** * Modified for the Mach32 by Kevin E. Martin (martin@cs.unc.edu) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32bstor.c,v 2.2 1993/09/23 15:44:06 dawes Exp $ */ #include "cfb.h" #include "X.h" --- 27,33 ---- * Modified for the Mach32 by Kevin E. Martin (martin@cs.unc.edu) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32bstor.c,v 2.3 1994/02/12 11:05:31 dawes Exp $ */ #include "cfb.h" #include "X.h" *************** *** 64,70 **** (mach32ImageReadFunc)(pBox->x1 + xorg, pBox->y1 + yorg, pBox->x2 - pBox->x1, pBox->y2 - pBox->y1, pPixmap->devPrivate.ptr, pixWidth, ! pBox->x1, pBox->y1); pBox++; } --- 64,70 ---- (mach32ImageReadFunc)(pBox->x1 + xorg, pBox->y1 + yorg, pBox->x2 - pBox->x1, pBox->y2 - pBox->y1, pPixmap->devPrivate.ptr, pixWidth, ! pBox->x1, pBox->y1, ~0); pBox++; } diff -c mit/server/ddx/x386/accel/mach32/mach32cmap.c:2.3 mit/server/ddx/x386/accel/mach32/mach32cmap.c:2.5 *** mit/server/ddx/x386/accel/mach32/mach32cmap.c:2.3 Fri Mar 11 23:37:07 1994 --- mit/server/ddx/x386/accel/mach32/mach32cmap.c Fri Mar 11 23:37:07 1994 *************** *** 30,36 **** * Header: /proj/X11/mit/server/ddx/x386/vga/RCS/vgaCmap.c,v 1.2 1991/06/27 00:03:01 root Exp */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32cmap.c,v 2.3 1993/10/12 15:30:08 dawes Exp $ */ #include "X.h" #include "Xproto.h" --- 30,36 ---- * Header: /proj/X11/mit/server/ddx/x386/vga/RCS/vgaCmap.c,v 1.2 1991/06/27 00:03:01 root Exp */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32cmap.c,v 2.5 1994/01/09 03:30:15 dawes Exp $ */ #include "X.h" #include "Xproto.h" *************** *** 88,101 **** } for (i = 0; i < ndef; i++) { ! mach32savedLUT[pdefs[i].pixel].r = pdefs[i].red >> 10; ! mach32savedLUT[pdefs[i].pixel].g = pdefs[i].green >> 10; ! mach32savedLUT[pdefs[i].pixel].b = pdefs[i].blue >> 10; if (x386VTSema) { outb(DAC_W_INDEX, pdefs[i].pixel); ! outb(DAC_DATA, pdefs[i].red >> 10); ! outb(DAC_DATA, pdefs[i].green >> 10); ! outb(DAC_DATA, pdefs[i].blue >> 10); } } } --- 88,116 ---- } for (i = 0; i < ndef; i++) { ! /* Return the n most significant bits from a 16-bit value. ! * For VGA, n = 6. For 8-bit DACs, n = 8. ! */ ! if (mach32DAC8Bit) { ! mach32savedLUT[pdefs[i].pixel].r = pdefs[i].red >> 8; ! mach32savedLUT[pdefs[i].pixel].g = pdefs[i].green >> 8; ! mach32savedLUT[pdefs[i].pixel].b = pdefs[i].blue >> 8; ! } else { ! mach32savedLUT[pdefs[i].pixel].r = pdefs[i].red >> 10; ! mach32savedLUT[pdefs[i].pixel].g = pdefs[i].green >> 10; ! mach32savedLUT[pdefs[i].pixel].b = pdefs[i].blue >> 10; ! } if (x386VTSema) { outb(DAC_W_INDEX, pdefs[i].pixel); ! if (mach32DAC8Bit) { ! outb(DAC_DATA, pdefs[i].red >> 8); ! outb(DAC_DATA, pdefs[i].green >> 8); ! outb(DAC_DATA, pdefs[i].blue >> 8); ! } else { ! outb(DAC_DATA, pdefs[i].red >> 10); ! outb(DAC_DATA, pdefs[i].green >> 10); ! outb(DAC_DATA, pdefs[i].blue >> 10); ! } } } } *************** *** 188,194 **** QueryColors(InstalledMaps[pScreen->myNum], 1, &pix, &rgb); outb(DAC_W_INDEX, 0); ! outb(DAC_DATA, rgb.red >> 10); ! outb(DAC_DATA, rgb.green >> 10); ! outb(DAC_DATA, rgb.blue >> 10); } --- 203,215 ---- QueryColors(InstalledMaps[pScreen->myNum], 1, &pix, &rgb); outb(DAC_W_INDEX, 0); ! if (mach32DAC8Bit) { ! outb(DAC_DATA, rgb.red >> 8); ! outb(DAC_DATA, rgb.green >> 8); ! outb(DAC_DATA, rgb.blue >> 8); ! } else { ! outb(DAC_DATA, rgb.red >> 10); ! outb(DAC_DATA, rgb.green >> 10); ! outb(DAC_DATA, rgb.blue >> 10); ! } } diff -c mit/server/ddx/x386/accel/mach32/mach32curs.c:2.4 mit/server/ddx/x386/accel/mach32/mach32curs.c:2.11 *** mit/server/ddx/x386/accel/mach32/mach32curs.c:2.4 Fri Mar 11 23:37:07 1994 --- mit/server/ddx/x386/accel/mach32/mach32curs.c Fri Mar 11 23:37:07 1994 *************** *** 29,35 **** */ /* Header: /home/src/xfree86/server/ddx/x386/accel/s3/RCS/s3Cursor.c,v 2.4 1993/07/06 10:23:47 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32curs.c,v 2.4 1993/10/17 14:40:32 dawes Exp $ */ #include --- 29,35 ---- */ /* Header: /home/src/xfree86/server/ddx/x386/accel/s3/RCS/s3Cursor.c,v 2.4 1993/07/06 10:23:47 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32curs.c,v 2.11 1994/02/20 01:54:44 dawes Exp $ */ #include *************** *** 44,54 **** --- 44,56 ---- #include #include #include + #include "mfb.h" #include "x386.h" #include "inputstr.h" #include "x386Priv.h" #include "xf86_Option.h" #include "xf86_OSlib.h" + #include "xf86_HWlib.h" #include "mach32.h" #include "regmach32.h" *************** *** 68,74 **** static void mach32MoveCursor(); static void mach32RecolorCursor(); ! extern miPointerScreenFuncRec x386PointerScreenFuncs; static int xhot, yhot; --- 70,76 ---- static void mach32MoveCursor(); static void mach32RecolorCursor(); ! extern void mach32SetVGAPage(); extern miPointerScreenFuncRec x386PointerScreenFuncs; static int xhot, yhot; *************** *** 188,201 **** { register int i; register int j; ! unsigned short *pServMsk; ! unsigned short *pServSrc; int index = pScr->myNum; Mach32CursPriv *cursPriv; pointer *pPriv = &pCurs->bits->devPriv[index]; int w; int h; - int lastLine; unsigned short *ram; CursorBitsPtr bits = pCurs->bits; --- 190,202 ---- { register int i; register int j; ! unsigned char *pServMsk; ! unsigned char *pServSrc; int index = pScr->myNum; Mach32CursPriv *cursPriv; pointer *pPriv = &pCurs->bits->devPriv[index]; int w; int h; unsigned short *ram; CursorBitsPtr bits = pCurs->bits; *************** *** 208,242 **** return (FALSE); ram = cursPriv->data; ! pServSrc = (unsigned short *)bits->source; ! pServMsk = (unsigned short *)bits->mask; - lastLine = -1; h = bits->height; if (h > MACH32_CURSMAX) h = MACH32_CURSMAX; ! w = PixmapBytePad(bits->width, 1)/2; ! if(w > MACH32_CURSMAX / 16) ! w = MACH32_CURSMAX / 16; for(i = 0; i < h; i++) { ! for(j = 0; j < w; j++) { ! ram[0] = cursor_mask[*pServMsk & 0xff] | ! cursor_lookup[*pServSrc & 0xff]; ! ram[1] = cursor_mask[*pServMsk++ >> 8] | ! cursor_lookup[*pServSrc++ >> 8]; ! if(ram[0] != 0xaaaa || ram[1] != 0xaaaa) ! lastLine = i; ! ram += 2; ! } ! for(; j < MACH32_CURSMAX / 16; j++) { ! *ram++ = 0xaaaa; *ram++ = 0xaaaa; - } } memset(ram, 0xaa, (MACH32_CURSMAX-h)*16); ! cursPriv->yExtra = MACH32_CURSMAX - i - 1; return(TRUE); } --- 209,235 ---- return (FALSE); ram = cursPriv->data; ! pServSrc = (unsigned char *)bits->source; ! pServMsk = (unsigned char *)bits->mask; h = bits->height; if (h > MACH32_CURSMAX) h = MACH32_CURSMAX; ! w = PixmapBytePad(bits->width, 1) + 1; ! if(w > MACH32_CURSMAX / 8) ! w = MACH32_CURSMAX / 8; for(i = 0; i < h; i++) { ! *ram++ = 0xaaaa; ! for(j = 1; j < w; j++) ! *ram++ = cursor_mask[*pServMsk++] | cursor_lookup[*pServSrc++]; ! for(; j < MACH32_CURSMAX / 8; j++) *ram++ = 0xaaaa; } memset(ram, 0xaa, (MACH32_CURSMAX-h)*16); ! ! cursPriv->yExtra = MACH32_CURSMAX - h - 1; return(TRUE); } *************** *** 272,278 **** cursPriv = (Mach32CursPriv *)pCurs->bits->devPriv[index]; if(!mach32Use4MbAperture) ! SetVGAPage(mach32CursorOffset >> 16); MemToBus(mach32CursorMemory, cursPriv->data, MACH32_CURSBYTES); mach32CursYExtra = cursPriv->yExtra; --- 265,271 ---- cursPriv = (Mach32CursPriv *)pCurs->bits->devPriv[index]; if(!mach32Use4MbAperture) ! mach32SetVGAPage(mach32CursorOffset >> 16); MemToBus(mach32CursorMemory, cursPriv->data, MACH32_CURSBYTES); mach32CursYExtra = cursPriv->yExtra; *************** *** 279,294 **** mach32MoveCursor(0, x, y); mach32RecolorCursor(pScr, pCurs); outw(CURSOR_OFFSET_LO, mach32CursorOffset >> 2); outw(CURSOR_OFFSET_HI, 0x8000 | (mach32CursorOffset >> 18)); } void ! mach32SetCursor(pScr, pCurs, x, y, generateEvent) ScreenPtr pScr; CursorPtr pCurs; int x, y; - Bool generateEvent; { int index = pScr->myNum; --- 272,288 ---- mach32MoveCursor(0, x, y); mach32RecolorCursor(pScr, pCurs); + #if 0 outw(CURSOR_OFFSET_LO, mach32CursorOffset >> 2); outw(CURSOR_OFFSET_HI, 0x8000 | (mach32CursorOffset >> 18)); + #endif } void ! mach32SetCursor(pScr, pCurs, x, y) ScreenPtr pScr; CursorPtr pCurs; int x, y; { int index = pScr->myNum; *************** *** 295,301 **** if(!pCurs) return; ! xhot = pCurs->bits->xhot; yhot = pCurs->bits->yhot; mach32SaveCursors[index] = pCurs; --- 289,295 ---- if(!pCurs) return; ! xhot = pCurs->bits->xhot + 8; yhot = pCurs->bits->yhot; mach32SaveCursors[index] = pCurs; *************** *** 334,349 **** int xoff; int yoff; int enabled; x -= xhot + mach32InfoRec.frameX0; y -= yhot + mach32InfoRec.frameY0; ! if (x < 0) { ! xoff = -x; ! x = 0; ! } else { ! xoff = 0; ! } if (y < 0) { yoff = -y; --- 328,342 ---- int xoff; int yoff; int enabled; + + if (!x386VTSema) + return; x -= xhot + mach32InfoRec.frameX0; y -= yhot + mach32InfoRec.frameY0; ! xoff = (x < 0) ? -x : (x & 1); ! x += xoff; if (y < 0) { yoff = -y; *************** *** 368,374 **** outb(HORZ_CURSOR_OFFSET, xoff); outb(VERT_CURSOR_OFFSET, mach32CursYExtra + yoff); - outw(CURSOR_OFFSET_LO, (mach32CursorOffset + yoff * 16) >> 2); if (!mach32CursLastEnabled) outw(CURSOR_OFFSET_HI, 0x8000 | (mach32CursorOffset >> 18)); --- 361,366 ---- *************** *** 383,388 **** --- 375,383 ---- mach32RenewCursorColor(pScr) ScreenPtr pScr; { + if (!x386VTSema) + return; + if (mach32SaveCursors[pScr->myNum]) mach32RecolorCursor(pScr, mach32SaveCursors[pScr->myNum], TRUE); } *************** *** 393,399 **** CursorPtr pCurs; Bool displayed; { - unsigned char color_0, color_1; ColormapPtr pmap; xColorItem sourceColor; xColorItem maskColor; --- 388,393 ---- *************** *** 457,459 **** --- 451,459 ---- mach32CursLastEnabled = 0; } + void + mach32ClearSavedCursor(scr_index) + int scr_index; + { + mach32SaveCursors[scr_index] = NULL; + } diff -c /dev/null mit/server/ddx/x386/accel/mach32/mach32dline.c:2.3 *** /dev/null Fri Mar 11 23:37:08 1994 --- mit/server/ddx/x386/accel/mach32/mach32dline.c Fri Mar 11 23:37:08 1994 *************** *** 0 **** --- 1,614 ---- + /*********************************************************** + Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, + and the Massachusetts Institute of Technology, Cambridge, Massachusetts. + + 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 names of Digital or MIT not be + used in advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + DIGITAL AND KEVIN E. MARTIN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, + IN NO EVENT SHALL DIGITAL OR KEVIN E. MARTIN BE LIABLE FOR ANY SPECIAL, + INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + + Modified for the 8514/A by Kevin E. Martin (martin@cs.unc.edu) + Modified for the mach32 by Mike Bernson (mike@mbsun.mlb.org) + + ******************************************************************/ + /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ + + /* s3dline.c from s3line.c with help from cfbresd.c and cfbline.c - Jon */ + /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32dline.c,v 2.3 1994/02/28 14:10:32 dawes Exp $ */ + + #include "X.h" + + #include "gcstruct.h" + #include "windowstr.h" + #include "pixmapstr.h" + #include "regionstr.h" + #include "scrnintstr.h" + #include "mistruct.h" + + #include "cfb.h" + #include "cfbmskbits.h" + #include "misc.h" + #include "x386.h" + #include "mach32.h" + #include "regmach32.h" + + /* + * single-pixel lines on a color frame buffer + * + * NON-SLOPED LINES horizontal lines are always drawn left to right; we have to + * move the endpoints right by one after they're swapped. horizontal lines + * will be confined to a single band of a region. the code finds that band + * (giving up if the lower bound of the band is above the line we're + * drawing); then it finds the first box in that band that contains part of + * the line. we clip the line to subsequent boxes in that band. vertical + * lines are always drawn top to bottom (y-increasing.) this requires adding + * one to the y-coordinate of each endpoint after swapping. + * + * SLOPED LINES when clipping a sloped line, we bring the second point inside + * the clipping box, rather than one beyond it, and then add 1 to the length + * of the line before drawing it. this lets us use the same box for finding + * the outcodes for both endpoints. since the equation for clipping the + * second endpoint to an edge gives us 1 beyond the edge, we then have to + * move the point towards the first point by one step on the major axis. + * eventually, there will be a diagram here to explain what's going on. the + * method uses Cohen-Sutherland outcodes to determine outsideness, and a + * method similar to Pike's layers for doing the actual clipping. + * + */ + + #define OUTCODES(result, x, y, pbox) \ + if (x < pbox->x1) \ + result |= OUT_LEFT; \ + else if (x >= pbox->x2) \ + result |= OUT_RIGHT; \ + if (y < pbox->y1) \ + result |= OUT_ABOVE; \ + else if (y >= pbox->y2) \ + result |= OUT_BELOW; + + #define NextDash {\ + dashIndexTmp++; \ + if (dashIndexTmp == numInDashList) \ + dashIndexTmp = 0; \ + dashRemaining = pDash[dashIndexTmp]; \ + thisDash = dashRemaining; \ + } + + #define FillDashPat {\ + int i; \ + \ + for (i = 0; i < 16; i++) {\ + dashPat <<= 1;\ + if (tmp + i < len) {\ + if (!(dashIndexTmp & 1))\ + dashPat |= 1;\ + if (--thisDash == 0)\ + NextDash\ + }\ + }\ + } + + static int low_translate[16] = + { + 0x0000, 0x0010, 0x0008, 0x0018, + 0x0004, 0x0014, 0x000c, 0x001c, + 0x0006, 0x001c, 0x000e, 0x001e, + 0x0002, 0x001a, 0x000a, 0x001a + }; + + static int high_translate[16] = + { + 0x0000, 0x1000, 0x0800, 0x1800, + 0x0400, 0x1400, 0x0c00, 0x1c00, + 0x0600, 0x1c00, 0x0e00, 0x1e00, + 0x0200, 0x1a00, 0x0a00, 0x1a00 + }; + + + + #define HIGH_HIGH_NIBLE(x) high_translate[((x) >> 12) & 0x0f] + #define LOW_HIGH_NIBLE(x) low_translate[((x) >> 8) & 0x0f] + #define HIGH_LOW_NIBLE(x) high_translate[((x) >> 4) & 0x0f] + #define LOW_LOW_NIBLE(x) low_translate[(x) & 0x0f] + + /* + * Dashed lines through the graphics engine. + * Known Bugs: Jon 13/9/93 + * - Dash offset isn't caclulated correctly for clipped lines. [fixed?] + * - Dash offset isn't updated correctly. [fixed?] + * - Dash patters which are a power of 2 and < 16 can be done faster through + * the color compare register. + * - DoubleDashed lines are are probably very incorrect. + * - line caps are possible wrong too. + * - Caclulating the dashes could probably be done more optimally, + * e.g. We could producing the pattern stipple before hand? + */ + void + mach32Dline(pDrawable, pGC, mode, npt, pptInit) + DrawablePtr pDrawable; + GCPtr pGC; + int mode; /* Origin or Previous */ + int npt; /* number of points */ + DDXPointPtr pptInit; + { + int nboxInit; + register int nbox; + BoxPtr pboxInit; + register BoxPtr pbox; + register DDXPointPtr ppt; /* pointer to list of translated points */ + + unsigned int oc1; /* outcode of point 1 */ + unsigned int oc2; /* outcode of point 2 */ + + int xorg, yorg; /* origin of window */ + + int adx; /* abs values of dx and dy */ + int ady; + int signdx; /* sign of dx and dy */ + int signdy; + int e, e1, e2; /* bresenham error and increments */ + int len; /* length of segment */ + int axis; /* major axis */ + short direction; + unsigned char *pDash; + int dashOffset; + int numInDashList; + int dashIndex; + int dashIndexTmp, dashOffsetTmp, thisDash, dashRemaining; + int unclippedlen; + short dashPat; + /* a bunch of temporaries */ + int tmp; + register int y1, y2; + register int x1, x2; + RegionPtr cclip; + cfbPrivGCPtr devPriv; + short fix; + + if (!x386VTSema) + { + cfbLineSD(pDrawable, pGC, mode, npt, pptInit); + return; + } + + devPriv = (cfbPrivGC *) (pGC->devPrivates[cfbGCPrivateIndex].ptr); + cclip = devPriv->pCompositeClip; + pboxInit = REGION_RECTS(cclip); + nboxInit = REGION_NUM_RECTS(cclip); + + WaitQueue(6); + outw(FRGD_MIX, FSS_FRGDCOL | mach32alu[pGC->alu]); + if (pGC->lineStyle == LineDoubleDash) { + outw(BKGD_COLOR, (short)pGC->bgPixel); + outw(BKGD_MIX, BSS_BKGDCOL | mach32alu[pGC->alu]); + } else + outw(BKGD_MIX, BSS_BKGDCOL | MIX_DST); + outw(WRT_MASK, (short)pGC->planemask); + outw(FRGD_COLOR, (short)pGC->fgPixel); + outw (MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_EXPPC | COLCMPOP_F); + + xorg = pDrawable->x; + yorg = pDrawable->y; + ppt = pptInit; + + x2 = ppt->x + xorg; + y2 = ppt->y + yorg; + + pDash = (unsigned char *) pGC->dash; + numInDashList = pGC->numInDashList; + + dashIndex = 0; + dashOffset = 0; + miStepDash ((int)pGC->dashOffset, &dashIndex, pDash, + numInDashList, &dashOffset); + + dashRemaining = pDash[dashIndex] - dashOffset; + thisDash = dashRemaining ; + + + while (--npt) { + nbox = nboxInit; + pbox = pboxInit; + + x1 = x2; + y1 = y2; + ++ppt; + if (mode == CoordModePrevious) { + xorg = x1; + yorg = y1; + } + x2 = ppt->x + xorg; + y2 = ppt->y + yorg; + + #ifdef fastaxislinesfixed + if (x1 == x2) { + + if (y1 > y2) { + unclippedlen = y1 = y2; + } else { + direction |= INC_X; + unclippedlen = y2 - y1; + } + + /* get to first band that might contain part of line */ + while ((nbox) && (pbox->y2 <= y1)) { + pbox++; + nbox--; + } + + if (nbox) { + /* stop when lower edge of box is beyond end of line */ + while ((nbox) && (y2 >= pbox->y1)) { + if ((x1 >= pbox->x1) && (x1 < pbox->x2)) { + int y1t, y2t; + + + /* this box has part of the line in it */ + y1t = max(y1, pbox->y1); + y2t = min(y2, pbox->y2); + if (y1t != y2t) { + /* use tmp dash index and offsets */ + dashIndexTmp = dashIndex; + dashOffsetTmp = dashOffset; + + if (y1t != y1) { /* advance the dash index */ + miStepDash (y1t - y1, &dashIndexTmp, pDash, + numInDashList, &dashOffsetTmp); + } + dashRemaining = pDash[dashIndexTmp] - dashOffsetTmp; + thisDash = dashRemaining ; + + WaitQueue(4); + outw(CUR_X, (short)x1); + outw(CUR_Y, (short)y1t); + len = y2t - y1t; + outw(MAJ_AXIS_PCNT, (short)(len - 1)); + outw(CMD, CMD_LINE | DRAW | LINETYPE | PLANAR | + PCDATA | _16BIT | WRTDATA | INC_Y | YMAJAXIS); + + for (tmp = 0 ; tmp < len; tmp+=16) { + #ifdef NEVER + + FillDashPat; + outw(PIX_TRANS, dashPat); + #else + outw(PIX_TRANS, HIGH_HIGH_NIBLE(dashPat) | LOW_HIGH_NIBLE(dashPat)); + outw(PIX_TRANS, HIGH_LOW_NIBLE(dashPat) | LOW_LOW_NIBLE(dashPat)); + #endif + + } + } + } + nbox--; + pbox++; + } + } + y2 = ppt->y + yorg; + } else if (y1 == y2) { + + /* + * force line from left to right, keeping endpoint semantics + */ + if (x1 > x2) { + register int tmp; + + tmp = x2; + x2 = x1 + 1; + x1 = tmp + 1; + } + unclippedlen = x2 - x1; + /* find the correct band */ + while ((nbox) && (pbox->y2 <= y1)) { + pbox++; + nbox--; + } + + /* try to draw the line, if we haven't gone beyond it */ + if ((nbox) && (pbox->y1 <= y1)) { + /* when we leave this band, we're done */ + tmp = pbox->y1; + while ((nbox) && (pbox->y1 == tmp)) { + int x1t, x2t; + + if (pbox->x2 <= x1) { + /* skip boxes until one might contain start point */ + nbox--; + pbox++; + continue; + } + /* stop if left of box is beyond right of line */ + if (pbox->x1 >= x2) { + nbox = 0; + break; + } + x1t = max(x1, pbox->x1); + x2t = min(x2, pbox->x2); + if (x1t != x2t) { + dashIndexTmp = dashIndex; + dashOffsetTmp = dashOffset; + + if (x1t != x1) { /* advance the dash index */ + miStepDash (x1t - x1, &dashIndexTmp, pDash, + numInDashList, &dashOffsetTmp); + } + dashRemaining = pDash[dashIndexTmp] - dashOffsetTmp; + thisDash = dashRemaining ; + + WaitQueue(4); + outw(CUR_X, (short)x1t); + outw(CUR_Y, (short)y1); + len = x2t - x1t; + outw(MAJ_AXIS_PCNT, (short)(len - 1)); + outw(CMD, CMD_LINE | DRAW | LINETYPE | PLANAR | + PCDATA | _16BIT | WRTDATA); + for (tmp = 0 ; tmp < len; tmp+=16) { + #ifdef NEVER + FillDashPat; + outw(PIX_TRANS, dashPat); + #else + outw(PIX_TRANS, HIGH_HIGH_NIBLE(dashPat) | LOW_HIGH_NIBLE(dashPat)); + outw(PIX_TRANS, HIGH_LOW_NIBLE(dashPat) | LOW_LOW_NIBLE(dashPat)); + + #endif + } + } + nbox--; + pbox++; + } + } + x2 = ppt->x + xorg; + } + else + #endif + { /* sloped line */ + direction = 0x0000; + signdx = 1; + if ((adx = x2 - x1) < 0) { + adx = -adx; + signdx = -1; + fix = 0; + } else { + direction |= INC_X; + fix = -1; + } + signdy = 1; + if ((ady = y2 - y1) < 0) { + ady = -ady; + signdy = -1; + } else { + direction |= INC_Y; + } + + if (adx > ady) { + axis = X_AXIS; + e1 = ady << 1; + e2 = e1 - (adx << 1); + e = e1 - adx; + unclippedlen = adx; + } else { + axis = Y_AXIS; + e1 = adx << 1; + e2 = e1 - (ady << 1); + e = e1 - ady; + direction |= YMAJAXIS; + unclippedlen = ady; + } + + /* + * we have bresenham parameters and two points. all we have to do now + * is clip and draw. + */ + + while (nbox--) { + oc1 = 0; + oc2 = 0; + OUTCODES(oc1, x1, y1, pbox); + OUTCODES(oc2, x2, y2, pbox); + if ((oc1 | oc2) == 0) { + if (axis == X_AXIS) + len = adx; + else + len = ady; + dashIndexTmp = dashIndex; + dashOffsetTmp = dashOffset; + /* No need to adjust dash offset */ + /* + * NOTE: The 8514/A hardware routines for generating lines do + * not match the software generated lines of mi, cfb, and mfb. + * This is a problem, and if I ever get time, I'll figure out + * the 8514/A algorithm and implement it in software for mi, + * cfb, and mfb. + * 2-sep-93 TCG: apparently only change needed is + * addition of 'fix' stuff in cfbline.c + */ + WaitQueue(7); + outw(CUR_X, (short)x1); + outw(CUR_Y, (short)y1); + outw(ERR_TERM, (short)(e + fix)); + outw(DESTY_AXSTP, (short)e1); + outw(DESTX_DIASTP, (short)e2); + outw(MAJ_AXIS_PCNT, (short)len); + outw(CMD, CMD_LINE | DRAW | LASTPIX | PLANAR | direction | + PCDATA | _16BIT | WRTDATA); + for (tmp = 0 ; tmp < len; tmp+=16) { + #ifdef NEVER + FillDashPat; + outw(PIX_TRANS, dashPat); + #else + outw(PIX_TRANS, HIGH_HIGH_NIBLE(dashPat) | LOW_HIGH_NIBLE(dashPat)); + outw(PIX_TRANS, HIGH_LOW_NIBLE(dashPat) | LOW_LOW_NIBLE(dashPat)); + #endif + } + break; + } else if (oc1 & oc2) { + pbox++; + } else { + + /* + * let the mfb helper routine do our work; better than + * duplicating code... + */ + BoxRec box; + DDXPointRec pt1Copy; /* clipped start point */ + DDXPointRec pt2Copy; /* clipped end point */ + int err; /* modified bresenham error term */ + int clip1, clip2; /* clippedness of the endpoints */ + + int clipdx, clipdy; /* difference between clipped and + * unclipped start point */ + DDXPointRec pt1; + int dlen; + + pt1.x = pt1Copy.x = x1; + pt1.y = pt1Copy.y = y1; + pt2Copy.x = x2; + pt2Copy.y = y2; + box.x1 = pbox->x1; + box.y1 = pbox->y1; + box.x2 = pbox->x2 - 1; + box.y2 = pbox->y2 - 1; + clip1 = 0; + clip2 = 0; + + if (mfbClipLine(pbox, box, + &pt1, &pt1Copy, &pt2Copy, + adx, ady, signdx, signdy, axis, + &clip1, &clip2) == 1) { + dashIndexTmp = dashIndex; + dashOffsetTmp = dashOffset; + + if (axis == X_AXIS) { + dlen = abs(pt1Copy.x - x1); + len = abs(pt2Copy.x - pt1Copy.x); + } else { + dlen = abs(pt1Copy.y - y1); + len = abs(pt2Copy.y - pt1Copy.y); + } + + len += (clip2 != 0); + if (len) { + /* unwind bresenham error term to first point */ + if (clip1) { + clipdx = abs(pt1Copy.x - x1); + clipdy = abs(pt1Copy.y - y1); + if (axis == X_AXIS) + err = e + ((clipdy * e2) + ((clipdx - clipdy) * e1)); + else + err = e + ((clipdx * e2) + ((clipdy - clipdx) * e1)); + } else + err = e; + + /* + * Here is a problem, the unwound error terms could be + * upto 16bit now. The poor MACH32 is only 12 or 13 bit. + * The rounding error is probably small I favor scaling + * the error terms, although re-evaluation is also an + * option I think it might give visable errors + * - Jon 12/9/93. + */ + + if (abs(err) > 4096 || abs(e1) > 4096 || abs(e2) > 4096) { + #if 1 + int div; + + if (abs(err) > abs(e1)) + div = (abs(err) > abs(e2)) ? + (abs(err) + 4095)/ 4096 : (abs(e2) + 4095)/ 4096; + else + div = (abs(e1) > abs(e2)) ? + (abs(e1) + 4095)/ 4096 : (abs(e2) + 4095)/ 4096; + + err /= div; + e1 /= div; + e2 /= div; + #else + int minor; + if (axis == X_AXIS) { + minor = abs(pt2Copy.y - pt1Copy.y); + err = 2 * minor - len; + } else { + minor = abs(pt2Copy.x - pt1Copy.x); + err = 2 * minor - len - 1; + } + e1 = minor << 1; + e2 = e1 - (len << 1); + #endif + } + miStepDash (dlen, &dashIndexTmp, pDash, + numInDashList, &dashOffsetTmp); + WaitQueue(7); + outw(CUR_X, (short)pt1Copy.x); + outw(CUR_Y, (short)pt1Copy.y); + outw(ERR_TERM, (short)(err + fix)); + outw(DESTY_AXSTP, (short)e1); + outw(DESTX_DIASTP, (short)e2); + outw(MAJ_AXIS_PCNT, (short)len); + outw(CMD, CMD_LINE | DRAW | LASTPIX | PLANAR | + direction | PCDATA | _16BIT | WRTDATA); + + for (tmp = 0 ; tmp < len; tmp+=16) { + #ifdef NEVER + + FillDashPat; + outw(PIX_TRANS, dashPat); + #else + outw(PIX_TRANS, HIGH_HIGH_NIBLE(dashPat) | LOW_HIGH_NIBLE(dashPat)); + outw(PIX_TRANS, HIGH_LOW_NIBLE(dashPat) | LOW_LOW_NIBLE(dashPat)); + #endif + } + } + } + pbox++; + } + } /* while (nbox--) */ + }/* sloped line */ + miStepDash (unclippedlen, &dashIndex, pDash, + numInDashList, &dashOffset); + } /* while (nline--) */ + + /* + * paint the last point if the end style isn't CapNotLast. (Assume that a + * projecting, butt, or round cap that is one pixel wide is the same as the + * single pixel of the endpoint.) + */ + + if ((pGC->capStyle != CapNotLast) && + ((ppt->x + xorg != pptInit->x + pDrawable->x) || + (ppt->y + yorg != pptInit->y + pDrawable->y) || + (ppt == pptInit + 1))) { + nbox = nboxInit; + pbox = pboxInit; + while (nbox--) { + if ((x2 >= pbox->x1) && + (y2 >= pbox->y1) && + (x2 < pbox->x2) && + (y2 < pbox->y2)) { + WaitQueue(4); + outw(CUR_X, (short)x2); + outw(CUR_Y, (short)y2); + outw(MAJ_AXIS_PCNT, 0); + outw(CMD, CMD_LINE | DRAW | LINETYPE | PLANAR | WRTDATA); + + break; + } else + pbox++; + } + } + WaitQueue(3); + outw(FRGD_MIX, FSS_FRGDCOL | MIX_SRC); + outw(BKGD_MIX, BSS_BKGDCOL | MIX_SRC); + outw (MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_FRGDMIX | COLCMPOP_F); + } diff -c /dev/null mit/server/ddx/x386/accel/mach32/mach32dseg.c:2.1 *** /dev/null Fri Mar 11 23:37:09 1994 --- mit/server/ddx/x386/accel/mach32/mach32dseg.c Fri Mar 11 23:37:09 1994 *************** *** 0 **** --- 1,534 ---- + /*********************************************************** + Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, + and the Massachusetts Institute of Technology, Cambridge, Massachusetts. + + 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 names of Digital or MIT not be + used in advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + DIGITAL AND KEVIN E. MARTIN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, + IN NO EVENT SHALL DIGITAL OR KEVIN E. MARTIN BE LIABLE FOR ANY SPECIAL, + INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + + Modified for the 8514/A by Kevin E. Martin (martin@cs.unc.edu) + Modified for the mach32 by Mike Bernson (mike@mbsun.mlb.org) + ******************************************************************/ + /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ + + /* s3dline.c from s3line.c with help from cfbresd.c and cfbline.c - Jon */ + /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32dseg.c,v 2.1 1993/12/25 13:58:03 dawes Exp $ */ + + #include "X.h" + + #include "gcstruct.h" + #include "windowstr.h" + #include "pixmapstr.h" + #include "regionstr.h" + #include "scrnintstr.h" + #include "mistruct.h" + + #include "cfb.h" + #include "cfbmskbits.h" + #include "misc.h" + #include "x386.h" + #include "mach32.h" + #include "regmach32.h" + + /* + * single-pixel lines on a color frame buffer + * + * NON-SLOPED LINES horizontal lines are always drawn left to right; we have to + * move the endpoints right by one after they're swapped. horizontal lines + * will be confined to a single band of a region. the code finds that band + * (giving up if the lower bound of the band is above the line we're + * drawing); then it finds the first box in that band that contains part of + * the line. we clip the line to subsequent boxes in that band. vertical + * lines are always drawn top to bottom (y-increasing.) this requires adding + * one to the y-coordinate of each endpoint after swapping. + * + * SLOPED LINES when clipping a sloped line, we bring the second point inside + * the clipping box, rather than one beyond it, and then add 1 to the length + * of the line before drawing it. this lets us use the same box for finding + * the outcodes for both endpoints. since the equation for clipping the + * second endpoint to an edge gives us 1 beyond the edge, we then have to + * move the point towards the first point by one step on the major axis. + * eventually, there will be a diagram here to explain what's going on. the + * method uses Cohen-Sutherland outcodes to determine outsideness, and a + * method similar to Pike's layers for doing the actual clipping. + * + */ + + #define OUTCODES(result, x, y, pbox) \ + if (x < pbox->x1) \ + result |= OUT_LEFT; \ + else if (x >= pbox->x2) \ + result |= OUT_RIGHT; \ + if (y < pbox->y1) \ + result |= OUT_ABOVE; \ + else if (y >= pbox->y2) \ + result |= OUT_BELOW; + + #define NextDash {\ + dashIndexTmp++; \ + if (dashIndexTmp == numInDashList) \ + dashIndexTmp = 0; \ + dashRemaining = pDash[dashIndexTmp]; \ + thisDash = dashRemaining; \ + } + + #define FillDashPat {\ + int i; \ + \ + for (i = 0; i < 16; i++) {\ + dashPat <<= 1;\ + if (tmp + i < len) {\ + if (!(dashIndexTmp & 1))\ + dashPat |= 1;\ + if (--thisDash == 0)\ + NextDash\ + }\ + }\ + } + /* + * Dashed lines through the graphics engine. + * Known Bugs: Jon 13/9/93 + * - Dash offset isn't caclulated correctly for clipped lines. [fixed?] + * - Dash offset isn't updated correctly. [fixed?] + * - Dash patters which are a power of 2 and < 16 can be done faster through + * the color compare register. + * - DoubleDashed lines are are probably very incorrect. + * - line caps are possible wrong too. + * - Caclulating the dashes could probably be done more optimally, + * e.g. We could producing the pattern stipple before hand? + */ + void + mach32Dsegment (pDrawable, pGC, nseg, pSeg) + DrawablePtr pDrawable; + GCPtr pGC; + int nseg; + register xSegment *pSeg; + { + int nboxInit; + register int nbox; + BoxPtr pboxInit; + register BoxPtr pbox; + + unsigned int oc1; /* outcode of point 1 */ + unsigned int oc2; /* outcode of point 2 */ + + int xorg, yorg; /* origin of window */ + + int adx; /* abs values of dx and dy */ + int ady; + int signdx; /* sign of dx and dy */ + int signdy; + int e, e1, e2; /* bresenham error and increments */ + int len; /* length of segment */ + int axis; /* major axis */ + short direction; + unsigned char *pDash; + int dashOffset; + int numInDashList; + int dashIndex; + int dashIndexTmp, dashOffsetTmp, thisDash, dashRemaining; + int unclippedlen; + short dashPat; + /* a bunch of temporaries */ + int tmp; + register int y1, y2; + register int x1, x2; + RegionPtr cclip; + cfbPrivGCPtr devPriv; + short fix; + + if (!x386VTSema) + { + cfbSegmentSD(pDrawable, pGC, nseg, pSeg); + return; + } + + devPriv = (cfbPrivGC *) (pGC->devPrivates[cfbGCPrivateIndex].ptr); + cclip = devPriv->pCompositeClip; + pboxInit = REGION_RECTS(cclip); + nboxInit = REGION_NUM_RECTS(cclip); + + WaitQueue(6); + outw(FRGD_MIX, FSS_FRGDCOL | mach32alu[pGC->alu]); + if (pGC->lineStyle == LineDoubleDash) { + outw(BKGD_COLOR, (short)pGC->bgPixel); + outw(BKGD_MIX, BSS_BKGDCOL | mach32alu[pGC->alu]); + } else + outw(BKGD_MIX, BSS_BKGDCOL | MIX_DST); + outw(WRT_MASK, (short)pGC->planemask); + outw(FRGD_COLOR, (short)pGC->fgPixel); + outw (MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_EXPPC | COLCMPOP_F); + + xorg = pDrawable->x; + yorg = pDrawable->y; + + pDash = (unsigned char *) pGC->dash; + numInDashList = pGC->numInDashList; + + dashIndex = 0; + dashOffset = 0; + miStepDash ((int)pGC->dashOffset, &dashIndex, pDash, + numInDashList, &dashOffset); + + dashRemaining = pDash[dashIndex] - dashOffset; + thisDash = dashRemaining ; + + + while (nseg--) { + nbox = nboxInit; + pbox = pboxInit; + + x1 = pSeg->x1 + xorg; + y1 = pSeg->y1 + yorg; + x2 = pSeg->x2 + xorg; + y2 = pSeg->y2 + yorg; + + pSeg++; + /* The following code doesn't work as it can change the direction of + * the line in order to simplify the cliping. Dashed lines need to + * be drawn in the order given in order to caclulate the dash offset + * correctly. + */ + #ifdef fastaxislinesfixed + if (x1 == x2) { + + if (y1 > y2) { + unclippedlen = y1 = y2; + } else { + direction |= INC_X; + unclippedlen = y2 - y1; + } + + /* get to first band that might contain part of line */ + while ((nbox) && (pbox->y2 <= y1)) { + pbox++; + nbox--; + } + + if (nbox) { + /* stop when lower edge of box is beyond end of line */ + while ((nbox) && (y2 >= pbox->y1)) { + if ((x1 >= pbox->x1) && (x1 < pbox->x2)) { + int y1t, y2t; + + + /* this box has part of the line in it */ + y1t = max(y1, pbox->y1); + y2t = min(y2, pbox->y2); + if (y1t != y2t) { + /* use tmp dash index and offsets */ + dashIndexTmp = dashIndex; + dashOffsetTmp = dashOffset; + + if (y1t != y1) { /* advance the dash index */ + miStepDash (y1t - y1, &dashIndexTmp, pDash, + numInDashList, &dashOffsetTmp); + } + dashRemaining = pDash[dashIndexTmp] - dashOffsetTmp; + thisDash = dashRemaining ; + + WaitQueue(4); + outw(CUR_X, (short)x1); + outw(CUR_Y, (short)y1t); + len = y2t - y1t; + outw(MAJ_AXIS_PCNT, (short)(len - 1)); + outw(CMD, CMD_LINE | DRAW | LINETYPE | PLANAR | + PCDATA | _16BIT |WRTDATA | (6 << 5)); + + for (tmp = 0 ; tmp < len; tmp+=16) { + FillDashPat; + outw(PIX_TRANS, dashPat); + } + } + } + nbox--; + pbox++; + } + } + } else if (y1 == y2) { + + /* + * force line from left to right, keeping endpoint semantics + */ + if (x1 > x2) { + register int tmp; + + tmp = x2; + x2 = x1 + 1; + x1 = tmp + 1; + } + unclippedlen = x2 - x1; + /* find the correct band */ + while ((nbox) && (pbox->y2 <= y1)) { + pbox++; + nbox--; + } + + /* try to draw the line, if we haven't gone beyond it */ + if ((nbox) && (pbox->y1 <= y1)) { + /* when we leave this band, we're done */ + tmp = pbox->y1; + while ((nbox) && (pbox->y1 == tmp)) { + int x1t, x2t; + + if (pbox->x2 <= x1) { + /* skip boxes until one might contain start point */ + nbox--; + pbox++; + continue; + } + /* stop if left of box is beyond right of line */ + if (pbox->x1 >= x2) { + nbox = 0; + break; + } + x1t = max(x1, pbox->x1); + x2t = min(x2, pbox->x2); + if (x1t != x2t) { + dashIndexTmp = dashIndex; + dashOffsetTmp = dashOffset; + + if (x1t != x1) { /* advance the dash index */ + miStepDash (x1t - x1, &dashIndexTmp, pDash, + numInDashList, &dashOffsetTmp); + } + dashRemaining = pDash[dashIndexTmp] - dashOffsetTmp; + thisDash = dashRemaining ; + + WaitQueue(4); + outw(CUR_X, (short)x1t); + outw(CUR_Y, (short)y1); + len = x2t - x1t; + outw(MAJ_AXIS_PCNT, (short)(len - 1)); + outw(CMD, CMD_LINE | DRAW | LINETYPE | PLANAR | + PCDATA | _16BIT | WRTDATA); + for (tmp = 0 ; tmp < len; tmp+=16) { + FillDashPat; + outw(PIX_TRANS, dashPat); + } + } + nbox--; + pbox++; + } + } + } + else + #endif + { /* sloped line */ + direction = 0x0000; + signdx = 1; + if ((adx = x2 - x1) < 0) { + adx = -adx; + signdx = -1; + fix = 0; + } else { + direction |= INC_X; + fix = -1; + } + signdy = 1; + if ((ady = y2 - y1) < 0) { + ady = -ady; + signdy = -1; + } else { + direction |= INC_Y; + } + + if (adx > ady) { + axis = X_AXIS; + e1 = ady << 1; + e2 = e1 - (adx << 1); + e = e1 - adx; + unclippedlen = adx; + } else { + axis = Y_AXIS; + e1 = adx << 1; + e2 = e1 - (ady << 1); + e = e1 - ady; + direction |= YMAJAXIS; + unclippedlen = ady; + } + + /* + * we have bresenham parameters and two points. all we have to do now + * is clip and draw. + */ + + while (nbox--) { + oc1 = 0; + oc2 = 0; + OUTCODES(oc1, x1, y1, pbox); + OUTCODES(oc2, x2, y2, pbox); + if ((oc1 | oc2) == 0) { + if (axis == X_AXIS) + len = adx; + else + len = ady; + + if (pGC->capStyle != CapNotLast) { + unclippedlen++; + len++; + } + dashIndexTmp = dashIndex; + dashOffsetTmp = dashOffset; + /* No need to adjust dash offset */ + /* + * NOTE: The 8514/A hardware routines for generating lines do + * not match the software generated lines of mi, cfb, and mfb. + * This is a problem, and if I ever get time, I'll figure out + * the 8514/A algorithm and implement it in software for mi, + * cfb, and mfb. + * 2-sep-93 TCG: apparently only change needed is + * addition of 'fix' stuff in cfbline.c + */ + WaitQueue(7); + outw(CUR_X, (short)x1); + outw(CUR_Y, (short)y1); + outw(ERR_TERM, (short)(e + fix)); + outw(DESTY_AXSTP, (short)e1); + outw(DESTX_DIASTP, (short)e2); + outw(MAJ_AXIS_PCNT, (short)len); + outw(CMD, CMD_LINE | DRAW | LASTPIX | PLANAR | direction | + PCDATA | _16BIT | WRTDATA); + for (tmp = 0 ; tmp < len; tmp+=16) { + FillDashPat; + outw(PIX_TRANS, dashPat); + } + break; + } else if (oc1 & oc2) { + pbox++; + } else { + + /* + * let the mfb helper routine do our work; better than + * duplicating code... + */ + BoxRec box; + DDXPointRec pt1Copy; /* clipped start point */ + DDXPointRec pt2Copy; /* clipped end point */ + int err; /* modified bresenham error term */ + int clip1, clip2; /* clippedness of the endpoints */ + + int clipdx, clipdy; /* difference between clipped and + * unclipped start point */ + DDXPointRec pt1; + int dlen; + + pt1.x = pt1Copy.x = x1; + pt1.y = pt1Copy.y = y1; + pt2Copy.x = x2; + pt2Copy.y = y2; + box.x1 = pbox->x1; + box.y1 = pbox->y1; + box.x2 = pbox->x2 - 1; + box.y2 = pbox->y2 - 1; + clip1 = 0; + clip2 = 0; + + if (mfbClipLine(pbox, box, + &pt1, &pt1Copy, &pt2Copy, + adx, ady, signdx, signdy, axis, + &clip1, &clip2) == 1) { + dashIndexTmp = dashIndex; + dashOffsetTmp = dashOffset; + + if (axis == X_AXIS) { + dlen = abs(pt1Copy.x - x1); + len = abs(pt2Copy.x - pt1Copy.x); + } else { + dlen = abs(pt1Copy.y - y1); + len = abs(pt2Copy.y - pt1Copy.y); + } + + if (clip2 != 0 || pGC->capStyle != CapNotLast) + len++; + if (len) { + /* unwind bresenham error term to first point */ + if (clip1) { + clipdx = abs(pt1Copy.x - x1); + clipdy = abs(pt1Copy.y - y1); + if (axis == X_AXIS) + err = e + ((clipdy * e2) + ((clipdx - clipdy) * e1)); + else + err = e + ((clipdx * e2) + ((clipdy - clipdx) * e1)); + } else + err = e; + + /* + * Here is a problem, the unwound error terms could be + * upto 16bit now. The poor MACH32 is only 12 or 13 bit. + * The rounding error is probably small I favor scaling + * the error terms, although re-evaluation is also an + * option I think it might give visable errors + * - Jon 12/9/93. + */ + + if (abs(err) > 4096 || abs(e1) > 4096 || abs(e2) > 4096) { + #if 1 + int div; + + if (abs(err) > abs(e1)) + div = (abs(err) > abs(e2)) ? + (abs(err) + 4095)/ 4096 : (abs(e2) + 4095)/ 4096; + else + div = (abs(e1) > abs(e2)) ? + (abs(e1) + 4095)/ 4096 : (abs(e2) + 4095)/ 4096; + + err /= div; + e1 /= div; + e2 /= div; + #else + int minor; + if (axis == X_AXIS) { + minor = abs(pt2Copy.y - pt1Copy.y); + err = 2 * minor - len; + } else { + minor = abs(pt2Copy.x - pt1Copy.x); + err = 2 * minor - len - 1; + } + e1 = minor << 1; + e2 = e1 - (len << 1); + #endif + } + miStepDash (dlen, &dashIndexTmp, pDash, + numInDashList, &dashOffsetTmp); + WaitQueue(7); + outw(CUR_X, (short)pt1Copy.x); + outw(CUR_Y, (short)pt1Copy.y); + outw(ERR_TERM, (short)(err + fix)); + outw(DESTY_AXSTP, (short)e1); + outw(DESTX_DIASTP, (short)e2); + outw(MAJ_AXIS_PCNT, (short)len); + outw(CMD, CMD_LINE | DRAW | LASTPIX | PLANAR | + direction | PCDATA | _16BIT | WRTDATA); + + for (tmp = 0 ; tmp < len; tmp+=16) { + FillDashPat; + outw(PIX_TRANS, dashPat); + } + } + } + pbox++; + } + } /* while (nbox--) */ + }/* sloped line */ + } /* while (nline--) */ + + WaitQueue(3); + outw(FRGD_MIX, FSS_FRGDCOL | MIX_SRC); + outw(BKGD_MIX, BSS_BKGDCOL | MIX_SRC); + outw (MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_FRGDMIX | COLCMPOP_F); + } diff -c mit/server/ddx/x386/accel/mach32/mach32fcach.c:2.4 mit/server/ddx/x386/accel/mach32/mach32fcach.c:2.5 *** mit/server/ddx/x386/accel/mach32/mach32fcach.c:2.4 Fri Mar 11 23:37:10 1994 --- mit/server/ddx/x386/accel/mach32/mach32fcach.c Fri Mar 11 23:37:10 1994 *************** *** 25,31 **** * Dynamic cache allocation added by Rickard E. Faith (faith@cs.unc.edu) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32fcach.c,v 2.4 1993/10/04 05:00:57 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 25,31 ---- * Dynamic cache allocation added by Rickard E. Faith (faith@cs.unc.edu) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32fcach.c,v 2.5 1993/12/25 13:58:05 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 59,64 **** --- 59,66 ---- static int NumFonts; short mach32ReadMask[8] = { 2, 4, 8, 16, 32, 64, 128, 1 }; + extern void QueryGlyphExtents(); + void mach32FontCache8Init(x,y) int x, y; *************** *** 96,101 **** --- 98,104 ---- } } + #if 0 int mach32IsCached(font) FontPtr font; *************** *** 106,111 **** --- 109,115 ---- if (mach32FontCache[i].font == font) return i; } + #endif void mach32UnCacheFont8(font) diff -c mit/server/ddx/x386/accel/mach32/mach32gc.c:2.0 mit/server/ddx/x386/accel/mach32/mach32gc.c:2.4 *** mit/server/ddx/x386/accel/mach32/mach32gc.c:2.0 Fri Mar 11 23:37:11 1994 --- mit/server/ddx/x386/accel/mach32/mach32gc.c Fri Mar 11 23:37:11 1994 *************** *** 27,33 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32gc.c,v 2.0 1993/08/07 08:19:17 dawes Exp $ */ /* $XConsortium: cfbgc.c,v 1.2 91/07/18 23:00:53 keith Exp $ */ --- 27,33 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32gc.c,v 2.4 1994/03/01 09:51:32 dawes Exp $ */ /* $XConsortium: cfbgc.c,v 1.2 91/07/18 23:00:53 keith Exp $ */ *************** *** 54,60 **** static void cfbValidateGC(), cfbChangeGC(), cfbCopyGC(), cfbDestroyGC(); static void cfbChangeClip(), cfbDestroyClip(), cfbCopyClip(); ! static cfbDestroyOps(); static GCFuncs cfbFuncs = { cfbValidateGC, --- 54,60 ---- static void cfbValidateGC(), cfbChangeGC(), cfbCopyGC(), cfbDestroyGC(); static void cfbChangeClip(), cfbDestroyClip(), cfbCopyClip(); ! static void cfbDestroyOps(); static GCFuncs cfbFuncs = { cfbValidateGC, *************** *** 69,75 **** static GCOps mach32Ops = { mach32SolidFSpans, mach32SetSpans, ! miPutImage, mach32CopyArea, mach32CopyPlane, mach32PolyPoint, --- 69,75 ---- static GCOps mach32Ops = { mach32SolidFSpans, mach32SetSpans, ! cfbPutImage, mach32CopyArea, mach32CopyPlane, mach32PolyPoint, *************** *** 93,99 **** static GCOps mach32MemApertureOps = { mach32SolidFSpans, mach32SetSpans, ! miPutImage, mach32CopyArea, cfbCopyPlane, mach32PolyPoint, --- 93,99 ---- static GCOps mach32MemApertureOps = { mach32SolidFSpans, mach32SetSpans, ! cfbPutImage, mach32CopyArea, cfbCopyPlane, mach32PolyPoint, *************** *** 346,352 **** return ret; } ! static cfbDestroyOps (ops) GCOps *ops; { --- 346,352 ---- return ret; } ! static void cfbDestroyOps (ops) GCOps *ops; { *************** *** 774,780 **** { if (pGC->fillStyle == FillSolid) { ! pGC->ops->Polylines = mach32Line; pGC->ops->PolySegment = mach32Segment; } else --- 774,783 ---- { if (pGC->fillStyle == FillSolid) { ! if (devPriv->oneRect) ! pGC->ops->Polylines = mach32Line1Rect; ! else ! pGC->ops->Polylines = mach32Line; pGC->ops->PolySegment = mach32Segment; } else *************** *** 785,797 **** break; case LineOnOffDash: case LineDoubleDash: ! if (mach32Use4MbAperture && ! (pGC->lineWidth == 0) && (pGC->fillStyle == FillSolid)) ! { ! pGC->ops->Polylines = cfbLineSD; ! pGC->ops->PolySegment = cfbSegmentSD; ! } else ! pGC->ops->Polylines = miWideDash; break; } } else { --- 788,801 ---- break; case LineOnOffDash: case LineDoubleDash: ! if (pGC->lineWidth == 0) { ! if (pGC->fillStyle == FillSolid) { ! pGC->ops->Polylines = mach32Dline; ! pGC->ops->PolySegment = mach32Dsegment; ! } else ! pGC->ops->Polylines = miWideDash; ! } else ! pGC->ops->Polylines = miWideDash; break; } } else { diff -c mit/server/ddx/x386/accel/mach32/mach32gs.c:2.1 mit/server/ddx/x386/accel/mach32/mach32gs.c:2.3 *** mit/server/ddx/x386/accel/mach32/mach32gs.c:2.1 Fri Mar 11 23:37:12 1994 --- mit/server/ddx/x386/accel/mach32/mach32gs.c Fri Mar 11 23:37:12 1994 *************** *** 27,33 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32gs.c,v 2.1 1993/09/23 15:44:10 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 27,33 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32gs.c,v 2.3 1994/02/12 11:05:34 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 60,66 **** { int j; unsigned char *pdst; /* where to put the bits */ - unsigned char *psrc; /* where to get the bits */ int pixmapStride; if ((pDrawable->type != DRAWABLE_WINDOW) || (!x386VTSema)) { --- 60,65 ---- *************** *** 84,90 **** pdst = (unsigned char *)pdstStart; for (; nspans--; ppt++, pwidth++) { ! (mach32ImageReadFunc)(ppt->x, ppt->y, j = *pwidth, 1, pdst, pixmapStride, 0, 0); pdst += j; /* width is in 32 bit words */ j = (-j) & 3; while (j--) /* Pad out to 32-bit boundary */ --- 83,90 ---- pdst = (unsigned char *)pdstStart; for (; nspans--; ppt++, pwidth++) { ! (mach32ImageReadFunc)(ppt->x, ppt->y, j = *pwidth, 1, pdst, ! pixmapStride, 0, 0, ~0); pdst += j; /* width is in 32 bit words */ j = (-j) & 3; while (j--) /* Pad out to 32-bit boundary */ diff -c /dev/null mit/server/ddx/x386/accel/mach32/mach32gtimg.c:2.1 *** /dev/null Fri Mar 11 23:37:12 1994 --- mit/server/ddx/x386/accel/mach32/mach32gtimg.c Fri Mar 11 23:37:12 1994 *************** *** 0 **** --- 1,81 ---- + /* + * Copyright 1993 by David Wexelblat + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, 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 David Wexelblat not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. David Wexelblat makes + * no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE + * OR PERFORMANCE OF THIS SOFTWARE. + * + * Code Modify for mach32 server By mike@mbsun.mlb.org + * Changes for mach32 server only changed the s3 -> mach32 + * + */ + + /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32gtimg.c,v 2.1 1994/02/23 14:17:09 dawes Exp $ */ + + #include "X.h" + #include "windowstr.h" + #include "scrnintstr.h" + #include "pixmapstr.h" + #include "cfb.h" + #include "cfbmskbits.h" + #include "mach32.h" + + extern void mfbGetImage(); + + void + mach32GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine) + DrawablePtr pDrawable; + int sx, sy, w, h; + unsigned int format; + unsigned long planeMask; + pointer pdstLine; + { + int width; + + if ((w == 0) || (h == 0)) + return; + + if (pDrawable->bitsPerPixel == 1) + { + mfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); + return; + } + + if (!x386VTSema || pDrawable->type != DRAWABLE_WINDOW) + { + cfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); + return; + } + + width = PixmapBytePad(w, pDrawable->depth); + if (format == ZPixmap) + { + (mach32ImageReadFunc)(sx+pDrawable->x, sy+pDrawable->y, w, h, + pdstLine, width, 0, 0, planeMask); + } + else + { + /* + * Worry about this later (much!). Should be straighforward, though. + * Read an image into a dummy pixmap, then use cfbCopyPlane8to1 to + * copy each plane in planeMask into the destination. At least + * this is the theory. + */ + miGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); + } + } + diff -c mit/server/ddx/x386/accel/mach32/mach32im.c:2.9 mit/server/ddx/x386/accel/mach32/mach32im.c:2.12 *** mit/server/ddx/x386/accel/mach32/mach32im.c:2.9 Fri Mar 11 23:37:13 1994 --- mit/server/ddx/x386/accel/mach32/mach32im.c Fri Mar 11 23:37:13 1994 *************** *** 27,34 **** * Added outsw code. */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32im.c,v 2.9 1993/10/04 05:00:59 dawes Exp $ */ #include "mach32.h" #include "regmach32.h" #include "mach32im.h" --- 27,38 ---- * Added outsw code. */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32im.c,v 2.12 1994/02/12 11:05:35 dawes Exp $ */ + #include "X.h" + #include "misc.h" + #include "x386.h" + #include "xf86_HWlib.h" #include "mach32.h" #include "regmach32.h" #include "mach32im.h" *************** *** 64,84 **** #define __inline__ /**/ #endif ! static void __inline__ outsw(void *buf, short count, unsigned short port) { __asm__ __volatile__ ("cld;rep;outsw" ::"d" (port),"S" (buf),"c" (count):"cx","si"); } ! void __inline__ SetVGAPage(int page) { outw(ATIEXT, bank_to_page_1[page]); outw(ATIEXT, bank_to_page_2[page]); } ! void __inline__ XYSetVGAPage(int x, int y) { ! SetVGAPage((x + y * (mach32MaxX+1)) >> 16); } #else /* __GNUC__ */ --- 68,88 ---- #define __inline__ /**/ #endif ! static __inline__ void outsw(void *buf, short count, unsigned short port) { __asm__ __volatile__ ("cld;rep;outsw" ::"d" (port),"S" (buf),"c" (count):"cx","si"); } ! __inline__ void mach32SetVGAPage(int page) { outw(ATIEXT, bank_to_page_1[page]); outw(ATIEXT, bank_to_page_2[page]); } ! static __inline__ void XYSetVGAPage(int x, int y) { ! mach32SetVGAPage((x + y * (mach32MaxX+1)) >> 16); } #else /* __GNUC__ */ *************** *** 95,101 **** outw(port, *(p++)); } ! void SetVGAPage(page) int page; { outw(ATIEXT, bank_to_page_1[page]); --- 99,105 ---- outw(port, *(p++)); } ! void mach32SetVGAPage(page) int page; { outw(ATIEXT, bank_to_page_1[page]); *************** *** 106,112 **** int x; int y; { ! SetVGAPage((x + y * (mach32MaxX+1)) >> 16); } --- 110,116 ---- int x; int y; { ! mach32SetVGAPage((x + y * (mach32MaxX+1)) >> 16); } *************** *** 208,213 **** --- 212,218 ---- int offset; int bank; int left; + int count; if ((w == 0) || (h == 0)) return; *************** *** 228,262 **** bank = offset / mach32BankSize; offset &= (mach32BankSize-1); curvm = &mach32VideoMem[offset]; ! SetVGAPage(bank); ! while(h--) { ! if (offset + w > mach32BankSize) { ! if (offset < mach32BankSize) { ! left = mach32BankSize - offset; MemToBus(curvm, psrc, left); bank++; ! SetVGAPage(bank); MemToBus(mach32VideoMem, psrc+left, w-left); psrc += pwidth; ! offset = (offset + mach32VirtX) & (mach32BankSize-1); ! curvm = &mach32VideoMem[offset]; } else { bank++; ! SetVGAPage(bank); ! offset &= (mach32BankSize-1); ! curvm = &mach32VideoMem[offset]; ! MemToBus(curvm, psrc, w); ! offset += mach32VirtX; ! curvm += mach32VirtX; ! psrc += pwidth; } ! } else { ! MemToBus(curvm, psrc, w); ! offset += mach32VirtX; ! curvm += mach32VirtX; ! psrc += pwidth; } } } --- 233,284 ---- bank = offset / mach32BankSize; offset &= (mach32BankSize-1); curvm = &mach32VideoMem[offset]; ! mach32SetVGAPage(bank); ! ! while(h) { ! /* ! * calc number of line before need to switch banks ! */ ! count = (mach32BankSize - offset) / mach32VirtX; ! if (count >= h) { ! count = h; ! h = 0; ! } else { ! offset += (count * mach32VirtX); ! if (offset + w < mach32BankSize) { ! count++; ! offset += mach32VirtX; ! } ! h -= count; ! } ! ! /* ! * Output line till back switch ! */ ! while(count--) { ! MemToBus(curvm, psrc, w); ! curvm += mach32VirtX; ! psrc += pwidth; ! } ! ! if (h) { ! if (offset < mach32BankSize) { ! h--; ! left = mach32BankSize - offset; MemToBus(curvm, psrc, left); bank++; ! mach32SetVGAPage(bank); MemToBus(mach32VideoMem, psrc+left, w-left); psrc += pwidth; ! offset += mach32VirtX; } else { bank++; ! mach32SetVGAPage(bank); } ! offset &= (mach32BankSize-1); ! curvm = &mach32VideoMem[offset]; } } } *************** *** 315,321 **** static void ! mach32ImageRead(x, y, w, h, psrc, pwidth, px, py) int x; int y; int w; --- 337,343 ---- static void ! mach32ImageRead(x, y, w, h, psrc, pwidth, px, py, planemask) int x; int y; int w; *************** *** 324,337 **** int pwidth; int px; int py; { ! int i,j; ! short pix; pointer curvm; if ((w == 0) || (h == 0)) return; WaitIdleEmpty(); psrc += pwidth * py + px; --- 346,364 ---- int pwidth; int px; int py; + short planemask; { ! int j; pointer curvm; if ((w == 0) || (h == 0)) return; + if ((planemask & 0xff) != 0xff) { + mach32ImageReadNoMem(x, y, w, h, psrc, pwidth, px, py, planemask); + return; + } + WaitIdleEmpty(); psrc += pwidth * py + px; *************** *** 344,350 **** } static void ! mach32ImageReadBank(x, y, w, h, psrc, pwidth, px, py) int x; int y; int w; --- 371,377 ---- } static void ! mach32ImageReadBank(x, y, w, h, psrc, pwidth, px, py, planemask) int x; int y; int w; *************** *** 353,358 **** --- 380,386 ---- int pwidth; int px; int py; + short planemask; { pointer curvm; int offset; *************** *** 362,367 **** --- 390,400 ---- if ((w == 0) || (h == 0)) return; + if ((planemask & 0xff) != 0xff) { + mach32ImageReadNoMem(x, y, w, h, psrc, pwidth, px, py, planemask); + return; + } + WaitIdleEmpty(); psrc += pwidth * py + px; *************** *** 369,375 **** bank = offset / mach32BankSize; offset &= (mach32BankSize-1); curvm = &mach32VideoMem[offset]; ! SetVGAPage(bank); while(h--) { if (offset + w > mach32BankSize) { --- 402,408 ---- bank = offset / mach32BankSize; offset &= (mach32BankSize-1); curvm = &mach32VideoMem[offset]; ! mach32SetVGAPage(bank); while(h--) { if (offset + w > mach32BankSize) { *************** *** 377,383 **** left = mach32BankSize - offset; BusToMem(psrc, curvm, left); bank++; ! SetVGAPage(bank); BusToMem(psrc+left, mach32VideoMem, w-left); psrc += pwidth; --- 410,416 ---- left = mach32BankSize - offset; BusToMem(psrc, curvm, left); bank++; ! mach32SetVGAPage(bank); BusToMem(psrc+left, mach32VideoMem, w-left); psrc += pwidth; *************** *** 385,391 **** curvm = &mach32VideoMem[offset]; } else { bank++; ! SetVGAPage(bank); offset &= (mach32BankSize-1); curvm = &mach32VideoMem[offset]; BusToMem(psrc, curvm, w); --- 418,424 ---- curvm = &mach32VideoMem[offset]; } else { bank++; ! mach32SetVGAPage(bank); offset &= (mach32BankSize-1); curvm = &mach32VideoMem[offset]; BusToMem(psrc, curvm, w); *************** *** 403,409 **** } static void ! mach32ImageReadNoMem(x, y, w, h, psrc, pwidth, px, py) int x; int y; int w; --- 436,442 ---- } static void ! mach32ImageReadNoMem(x, y, w, h, psrc, pwidth, px, py, planemask) int x; int y; int w; *************** *** 412,417 **** --- 445,451 ---- int pwidth; int px; int py; + short planemask; { int j; int i; *************** *** 418,428 **** short pix; WaitIdleEmpty(); outw(FRGD_MIX, FSS_PCDATA | MIX_SRC); outw(CUR_X, (short)x); outw(CUR_Y, (short)y); ! outw(MAJ_AXIS_PCNT, (short)w-1); ! outw(MULTIFUNC_CNTL, MIN_AXIS_PCNT | h-1); outw(CMD, CMD_RECT | INC_Y | INC_X | DRAW | PCDATA); --- 452,463 ---- short pix; WaitIdleEmpty(); + outw(MULTIFUNC_CNTL, PIX_CNTL | 0); outw(FRGD_MIX, FSS_PCDATA | MIX_SRC); outw(CUR_X, (short)x); outw(CUR_Y, (short)y); ! outw(MAJ_AXIS_PCNT, (short)(w - 1)); ! outw(MULTIFUNC_CNTL, MIN_AXIS_PCNT | (h - 1)); outw(CMD, CMD_RECT | INC_Y | INC_X | DRAW | PCDATA); *************** *** 434,440 **** for (j = 0; j < h; j++) { for (i = px; i < w; i++) { pix = inw(PIX_TRANS); ! psrc[i] = (char)pix; } psrc += pwidth; } --- 469,475 ---- for (j = 0; j < h; j++) { for (i = px; i < w; i++) { pix = inw(PIX_TRANS); ! psrc[i] = (unsigned char)(pix & planemask); } psrc += pwidth; } *************** *** 444,450 **** } - static void mach32ImageFill(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, alu, planemask) int x; --- 479,484 ---- *************** *** 673,683 **** short alu; short planemask; { ! int i,j; unsigned char *pline; ! int x1, x2, y1, y2, width, pix, ypix, need; ! short data; ! short lo, hi; unsigned char *newsrc = NULL, *newline; if ((w == 0) || (h == 0)) --- 707,715 ---- short alu; short planemask; { ! int i; unsigned char *pline; ! int x1, x2, y1, y2, width; unsigned char *newsrc = NULL, *newline; if ((w == 0) || (h == 0)) *************** *** 694,700 **** width = x2 - x1; if (pw <= 8) { ! newsrc = (unsigned char *)malloc(2*ph*sizeof(char)); if (!newsrc) { return; } --- 726,732 ---- width = x2 - x1; if (pw <= 8) { ! newsrc = (unsigned char *)ALLOCATE_LOCAL(2*ph*sizeof(char)); if (!newsrc) { return; } *************** *** 799,805 **** outw(MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_FRGDMIX | COLCMPOP_F); if (newsrc) ! free(newsrc); } void --- 831,837 ---- outw(MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_FRGDMIX | COLCMPOP_F); if (newsrc) ! DEALLOCATE_LOCAL(newsrc); } void *************** *** 819,829 **** short alu; short planemask; { ! int i,j; unsigned char *pline; ! int x1, x2, y1, y2, width, pix, ypix, need; ! short data; ! short lo, hi; unsigned char *newsrc = NULL, *newline; if ((w == 0) || (h == 0)) --- 851,859 ---- short alu; short planemask; { ! int i; unsigned char *pline; ! int x1, x2, y1, y2, width; unsigned char *newsrc = NULL, *newline; if ((w == 0) || (h == 0)) *************** *** 840,846 **** width = x2 - x1; if (pw <= 8) { ! newsrc = (unsigned char *)malloc(2*ph*sizeof(char)); if (!newsrc) { return; } --- 870,876 ---- width = x2 - x1; if (pw <= 8) { ! newsrc = (unsigned char *)ALLOCATE_LOCAL(2*ph*sizeof(char)); if (!newsrc) { return; } *************** *** 945,949 **** outw(MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_FRGDMIX | COLCMPOP_F); if (newsrc) ! free(newsrc); } --- 975,979 ---- outw(MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_FRGDMIX | COLCMPOP_F); if (newsrc) ! DEALLOCATE_LOCAL(newsrc); } diff -c mit/server/ddx/x386/accel/mach32/mach32init.c:2.7 mit/server/ddx/x386/accel/mach32/mach32init.c:2.19 *** mit/server/ddx/x386/accel/mach32/mach32init.c:2.7 Fri Mar 11 23:37:14 1994 --- mit/server/ddx/x386/accel/mach32/mach32init.c Fri Mar 11 23:37:14 1994 *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32init.c,v 2.7 1993/10/06 14:54:32 dawes Exp $ */ #include "X.h" #include "input.h" --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32init.c,v 2.19 1994/02/27 05:20:32 dawes Exp $ */ #include "X.h" #include "input.h" *************** *** 35,44 **** --- 35,50 ---- #include "xf86_Config.h" extern Bool x386Verbose; + extern int mach32MaxClock; + static LUTENTRY oldlut[256]; static Bool LUTInited = FALSE; static short old_DAC_MASK; + static short old_DAC_in_clock; + static short old_DAC_out_clock; + static short old_DAC_mux_clock; + static short old_clock_sel; static Bool mach32Inited = FALSE; *************** *** 47,56 **** static char old_ATI2E, old_ATI32, old_ATI36; static char old_GRA06, old_SEQ02, old_SEQ04; ! static short old_MEM_BNDRY; int mach32VideoPageBoundary[MACH32_MAX_Y+1]; /* mach32CalcCRTCRegs(crtcRegs, mode) Initializes the Mach32 for the currently selected CRTC parameters. --- 53,68 ---- static char old_ATI2E, old_ATI32, old_ATI36; static char old_GRA06, old_SEQ02, old_SEQ04; ! static unsigned short old_MEM_BNDRY; ! static unsigned short old_MISC_OPTIONS; ! static unsigned short old_EXT_GE_CONFIG; ! static unsigned short old_MISC_CNTL; ! extern unsigned short mach32MemorySize; int mach32VideoPageBoundary[MACH32_MAX_Y+1]; + extern void mach32SetVGAPage(); + /* mach32CalcCRTCRegs(crtcRegs, mode) Initializes the Mach32 for the currently selected CRTC parameters. *************** *** 93,98 **** --- 105,113 ---- if (mode->Flags & V_INTERLACE) crtcRegs->disp_cntl |= INTERLACE; crtcRegs->clock_sel = (mode->Clock << 2) | VFIFO_DEPTH_6 | DISABPASSTHRU; + if (mode->Flags & V_CSYNC) crtcRegs->clock_sel |= COMPOSITE_SYNC; + if (OFLG_ISSET(OPTION_CSYNC, &mach32InfoRec.options)) + crtcRegs->clock_sel |= COMPOSITE_SYNC; } /* mach32SetCRTCRegs(crtcRegs) *************** *** 102,120 **** void mach32SetCRTCRegs(crtcRegs) mach32CRTCRegPtr crtcRegs; { - /* Blank the screen temporarily to display color 0 by turning the - * display of all planes off - */ - outb(DAC_MASK, 0x00); /* * Reset controller while setting CRTC registers * This is recommended by the mach32 programmer's guide - * - * (Setting the DAC_MASK to 0 above is probably useless now - * that this is here, but it doesn't hurt) */ outb(DISP_CNTL, DISPEN_DISAB); /* Now initialize the display controller part of the Mach32. * The CRTC registers are passed in from the calling routine. --- 117,130 ---- void mach32SetCRTCRegs(crtcRegs) mach32CRTCRegPtr crtcRegs; { /* * Reset controller while setting CRTC registers * This is recommended by the mach32 programmer's guide */ + WaitQueue(1); outb(DISP_CNTL, DISPEN_DISAB); + WaitIdleEmpty(); /* Now initialize the display controller part of the Mach32. * The CRTC registers are passed in from the calling routine. *************** *** 134,151 **** /* Set the width of the display -- useful for future extensions */ outw(CRT_PITCH, mach32VirtX >> 3); outw(GE_PITCH, mach32VirtX >> 3); /* Clock select register */ outw(CLOCK_SEL, crtcRegs->clock_sel); /* Display control register -- this one turns on the display */ outb(DISP_CNTL, crtcRegs->disp_cntl); - - /* Now reenable the screen, but only the planes that actually exist. - * Otherwise, you end up with bus noise on the display. - */ - outb(DAC_MASK, 0xff); } /* mach32SaveLUT(lut) --- 144,165 ---- /* Set the width of the display -- useful for future extensions */ outw(CRT_PITCH, mach32VirtX >> 3); + outw(GE_PITCH, mach32VirtX >> 3); /* Clock select register */ outw(CLOCK_SEL, crtcRegs->clock_sel); + /* Zero overscan register to insure proper color */ + outw(HORZ_OVERSCAN, 0); + outw(VERT_OVERSCAN, 0); + + /* Set the DAC for the currect mode */ + mach32SetRamdac(crtcRegs->clock_sel); + /* Display control register -- this one turns on the display */ + WaitIdleEmpty(); outb(DISP_CNTL, crtcRegs->disp_cntl); } /* mach32SaveLUT(lut) *************** *** 257,279 **** int screen_idx; { int i; - int fd; if (!mach32VideoMem) { if (mach32Use4MbAperture) { int apaddr; ! apaddr = inw(MEM_CFG) >> 8; ! if (!apaddr) apaddr = 0x7c; if (x386Verbose) { ! ErrorF("%s %s: Aperture mapped to 0x%x\n", XCONFIG_PROBED, ! mach32InfoRec.name, apaddr << 20); } ! outw(MEM_CFG, (apaddr << 8) | 0x02); mach32VideoMem = xf86MapVidMem(screen_idx, LINEAR_REGION, ! (pointer)(apaddr << 20), 4 * 1024 * 1024); /* Initialize the mach32VideoPageBoundary array */ --- 271,312 ---- int screen_idx; { int i; if (!mach32VideoMem) { if (mach32Use4MbAperture) { int apaddr; + int mem_cfg_shift; + unsigned long hw_offset = 0; + + /* For PCI, there is no hw_offset */ + if (mach32BusType != PCI) { + if (OFLG_ISSET(OPTION_INTEL_GX, &mach32InfoRec.options)) { + hw_offset = 0x78000000; + } else if (mach32InfoRec.MemBase != 0) { + hw_offset = mach32InfoRec.MemBase & 0xf8000000; + } + } + + if (mach32BusType == PCI) + mem_cfg_shift = 4; + else + mem_cfg_shift = 8; ! apaddr = inw(MEM_CFG) >> mem_cfg_shift; ! ! if (!apaddr && !hw_offset) apaddr = 0x7c; if (x386Verbose) { ! ErrorF("%s %s: Aperture mapped to 0x%x + 0x%x\n", ! XCONFIG_PROBED, mach32InfoRec.name, apaddr << 20, ! hw_offset); } ! /* XXXX probably should restore MEM_CFG at exit */ ! outw(MEM_CFG, (apaddr << mem_cfg_shift) | 0x02); mach32VideoMem = xf86MapVidMem(screen_idx, LINEAR_REGION, ! (pointer)((apaddr << 20) + ! hw_offset), 4 * 1024 * 1024); /* Initialize the mach32VideoPageBoundary array */ *************** *** 289,294 **** --- 322,328 ---- /* Initialize the mach32VideoPageBoundary array */ for (i = 0; i <= mach32MaxY; i++) { + mach32VideoPageBoundary[i] = 65536 - ((i*mach32VirtX) - ((i*mach32VirtX)&0xffff0000)); if (mach32VideoPageBoundary[i] >= mach32MaxX) *************** *** 298,303 **** --- 332,421 ---- } } + /* + * From the _Programmer's Guide to the mach32 Registers_: + * MISC_CNTL[8:9] BLANK_ADJUST Type 2 DAC only: Delays BLANK by 1 or 2 PCLK + * MISC_CNTL[10:11] PIXEL_DELAY Adjusts pixel data skew from PCLK (adjusts + * setup and hold times to suit different DACs) + * + * So x should have blank adjust in bits 0:1; pixel delay in 2:3. + */ + #define SET_BLANK_ADJ(x) {\ + unsigned short tmp; \ + tmp = inw(R_MISC_CNTL) & 0xf0f0; \ + outw(MISC_CNTL, tmp | (((x) & 0x0f) << 8)); \ + } + + void mach32SetRamdac(clock) + int clock; + { + int old_EXT_GE_CONFIG; + + switch(mach32Ramdac) { + + case DAC_TLC34075: + /* get the current value */ + old_EXT_GE_CONFIG = inw(R_EXT_GE_CONFIG) & ~0x3100; + + if (mach32InfoRec.clock[(clock >> 2) & 0xf] > 80000) { + + /* Guarantee low pixel clock */ + outw(CLOCK_SEL, 0x11); + + /* Make sure that upper 2 address bit are ok */ + outw(EXT_GE_CONFIG, old_EXT_GE_CONFIG | 0x2000); + + /* pixel clock is SCLK/2 and VCLK/2 */ + outb(OUTPUT_CLK_SEL, 0x09); + + /* set MUX contol 8/16 to 16 */ + outb(MUX_CNTL, 0x1d); + + /* Set clock source */ + outb(INPUT_CLK_SEL, 1); + + /* set multiplex_pixels */ + outw(EXT_GE_CONFIG, old_EXT_GE_CONFIG | 0x0100); + + /*set the blank adj and pixel delay values */ + SET_BLANK_ADJ(1); + + /* allow all 8 bit to go though dac */ + outb(DAC_MASK, 0xff); + + /* restore the pixel clock */ + outw(CLOCK_SEL, clock); + } else { + /* Guarantee low pixel clock */ + outw(CLOCK_SEL, 0x11); + + /*set the blank adj and pixel delay values */ + SET_BLANK_ADJ(0x0c); + + /* Make sure that upper 2 address bit are ok */ + outw(EXT_GE_CONFIG, old_EXT_GE_CONFIG | 0x2000); + + /* Set clock source */ + outb(INPUT_CLK_SEL, 0); + + /* pixel clock is SCLK/1 and VCLK */ + outb(OUTPUT_CLK_SEL, 0x30); + + /* set MUX contol 8/16 to 16 */ + outb(MUX_CNTL, 0x2d); + + /* allow all 8 bit to go though dac none mux */ + outw(EXT_GE_CONFIG, old_EXT_GE_CONFIG); + + outb(DAC_MASK, 0xff); + + /* restore the pixel clock */ + outw(CLOCK_SEL, clock); + } + break; + } + } + /* mach32InitDisplay(screen_idx) Initializes the display for the Mach32. *************** *** 330,342 **** /* Set the VGA display buffer to 0xa0000 */ outw(VGAGRA, GRA06 | 0x05 << 8); ! SetVGAPage(0); old_DAC_MASK = inb(DAC_MASK); old_MEM_BNDRY = inw(MEM_BNDRY); outw(MEM_BNDRY, 0); /* Turn off the memory boundary */ /* Reset the 8514/A, and disable all interrupts. */ outw(SUBSYS_CNTL, GPCTRL_RESET | CHPTEST_NORMAL); outw(SUBSYS_CNTL, GPCTRL_ENAB | CHPTEST_NORMAL); --- 448,483 ---- /* Set the VGA display buffer to 0xa0000 */ outw(VGAGRA, GRA06 | 0x05 << 8); ! mach32SetVGAPage(0); ! ! old_MISC_CNTL = inw(R_MISC_CNTL); ! old_EXT_GE_CONFIG = inw(R_EXT_GE_CONFIG); + outw(EXT_GE_CONFIG, old_EXT_GE_CONFIG & ~0x3000); old_DAC_MASK = inb(DAC_MASK); old_MEM_BNDRY = inw(MEM_BNDRY); outw(MEM_BNDRY, 0); /* Turn off the memory boundary */ + old_MISC_OPTIONS = inw(MISC_OPTIONS); + outw(MISC_OPTIONS, (old_MISC_OPTIONS & ~MEM_SIZE_ALIAS) | mach32MemorySize); + + old_clock_sel = inw(CLOCK_SEL); + switch(mach32Ramdac) { + + case DAC_TLC34075: + outw(EXT_GE_CONFIG, (old_EXT_GE_CONFIG & ~0x3000) | 0x2000); + outw(CLOCK_SEL, 0x11); + + old_DAC_in_clock = inb(INPUT_CLK_SEL); + old_DAC_out_clock = inb(OUTPUT_CLK_SEL); + old_DAC_mux_clock = inb(MUX_CNTL); + + outw(EXT_GE_CONFIG, (old_EXT_GE_CONFIG & ~0x3000)); + outw(CLOCK_SEL, old_clock_sel); + break; + } + /* Reset the 8514/A, and disable all interrupts. */ outw(SUBSYS_CNTL, GPCTRL_RESET | CHPTEST_NORMAL); outw(SUBSYS_CNTL, GPCTRL_ENAB | CHPTEST_NORMAL); *************** *** 356,361 **** --- 497,505 ---- outw(SHADOW_CTL, 0); outw(SHADOW_SET, 0); + if (mach32DAC8Bit) + outw(EXT_GE_CONFIG, old_EXT_GE_CONFIG | DAC_8_BIT_EN); + WaitIdleEmpty(); /* Make sure that all commands have finished */ mach32Inited = TRUE; *************** *** 367,377 **** */ void mach32CleanUp() { - int i; - if (!mach32Inited) return; outw(SHADOW_SET, 1); outw(SHADOW_CTL, 0x3f); outw(SHADOW_SET, 2); --- 511,534 ---- */ void mach32CleanUp() { if (!mach32Inited) return; + switch(mach32Ramdac) { + + case DAC_TLC34075: + SET_BLANK_ADJ(0x0c); + outw(CLOCK_SEL, 0x11); + outw(EXT_GE_CONFIG, (old_EXT_GE_CONFIG & ~0x3000) | 0x2000); + outb(INPUT_CLK_SEL, old_DAC_in_clock); + outb(OUTPUT_CLK_SEL, old_DAC_out_clock); + outb(MUX_CNTL, old_DAC_mux_clock); + outw(EXT_GE_CONFIG, old_EXT_GE_CONFIG & ~0x3000); + outb(DAC_MASK, 0xff); + outw(CLOCK_SEL, old_clock_sel); + break; + } + outw(SHADOW_SET, 1); outw(SHADOW_CTL, 0x3f); outw(SHADOW_SET, 2); *************** *** 391,398 **** --- 548,559 ---- outw(VGASEQ, SEQ02 | old_SEQ02 << 8); outw(VGASEQ, SEQ04 | old_SEQ04 << 8); + outw(EXT_GE_CONFIG, (old_EXT_GE_CONFIG & ~0x3000)); outb(DAC_MASK, old_DAC_MASK); outw(MEM_BNDRY, old_MEM_BNDRY); + outw(MISC_OPTIONS, old_MISC_OPTIONS); + + outw(MISC_CNTL, old_MISC_CNTL); WaitIdleEmpty(); /* Make sure that all commands have finished */ *************** *** 402,407 **** --- 563,569 ---- outw(CRT_OFFSET_HI, 0); mach32CursorOff(); + mach32RestoreVGAInfo(); diff -c mit/server/ddx/x386/accel/mach32/mach32line.c:2.4 mit/server/ddx/x386/accel/mach32/mach32line.c:2.6 *** mit/server/ddx/x386/accel/mach32/mach32line.c:2.4 Fri Mar 11 23:37:15 1994 --- mit/server/ddx/x386/accel/mach32/mach32line.c Fri Mar 11 23:37:15 1994 *************** *** 13,33 **** used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. ! DIGITAL AND KEVIN E. MARTIN AND RICKARD E. FAITH DISCLAIM ALL WARRANTIES ! WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF ! MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL OR KEVIN E. MARTIN ! BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ! WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ! ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR ! IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Modified for the 8514/A by Kevin E. Martin (martin@cs.unc.edu) Modified for the Mach-8 by Rickard E. Faith (faith@cs.unc.edu) Modified for the Mach32 by Kevin E. Martin (martin@cs.unc.edu) ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32line.c,v 2.4 1993/09/21 15:21:39 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ --- 13,36 ---- used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. ! DIGITAL AND KEVIN E. MARTIN AND RICKARD E. FAITH AND CRAIG E. GROESCHEL ! DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED ! WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL OR ! KEVIN E. MARTIN OR RICKARD E. FAITH OR CRAIG E. GROESCHEL BE LIABLE FOR ANY ! SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING ! FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE ! OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR ! PERFORMANCE OF THIS SOFTWARE. Modified for the 8514/A by Kevin E. Martin (martin@cs.unc.edu) Modified for the Mach-8 by Rickard E. Faith (faith@cs.unc.edu) Modified for the Mach32 by Kevin E. Martin (martin@cs.unc.edu) + mach32Line1Rect by Craig E. Groeschel (craig@adikia.sccsi.com), + based on an ATI preclipping code example ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32line.c,v 2.6 1994/03/01 09:51:35 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ *************** *** 86,92 **** --- 89,99 ---- void + #ifdef ONE_RECT + mach32Line1Rect(pDrawable, pGC, mode, npt, pptInit) + #else mach32Line(pDrawable, pGC, mode, npt, pptInit) + #endif DrawablePtr pDrawable; GCPtr pGC; int mode; /* Origin or Previous */ *************** *** 102,109 **** unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - unsigned long *addrl; /* address of destination pixmap */ - int nlwidth; /* width in longwords of destination pixmap */ int xorg, yorg; /* origin of window */ int adx; /* abs values of dx and dy */ --- 109,114 ---- *************** *** 123,134 **** register int x1, x2; RegionPtr cclip; cfbPrivGCPtr devPriv; - unsigned long xor, and; - int alu; if (!x386VTSema) { cfbLineSS(pDrawable, pGC, mode, npt, pptInit); return; } --- 128,141 ---- register int x1, x2; RegionPtr cclip; cfbPrivGCPtr devPriv; if (!x386VTSema) { + #ifdef ONE_RECT + cfb8LineSS1Rect(pDrawable, pGC, mode, npt, pptInit); + #else cfbLineSS(pDrawable, pGC, mode, npt, pptInit); + #endif return; } *************** *** 137,143 **** --- 144,159 ---- pboxInit = REGION_RECTS(cclip); nboxInit = REGION_NUM_RECTS(cclip); + #ifdef ONE_RECT + WaitQueue(11); + outw(LINEDRAW_OPT, CLIP_MODE_1 | LASTPIX); + outw(EXT_SCISSOR_L, pboxInit->x1); + outw(EXT_SCISSOR_T, pboxInit->y1); + outw(EXT_SCISSOR_R, pboxInit->x2-1); + outw(EXT_SCISSOR_B, pboxInit->y2-1); + #else WaitQueue(3); + #endif outw(FRGD_MIX, FSS_FRGDCOL | mach32alu[pGC->alu]); outw(WRT_MASK, (short)pGC->planemask); outw(FRGD_COLOR, (short)pGC->fgPixel); *************** *** 147,157 **** ppt = pptInit; x2 = ppt->x + xorg; y2 = ppt->y + yorg; while(--npt) { ! nbox = nboxInit; ! pbox = pboxInit; ! x1 = x2; y1 = y2; ++ppt; --- 163,229 ---- ppt = pptInit; x2 = ppt->x + xorg; y2 = ppt->y + yorg; + #ifdef ONE_RECT + outw(LINEDRAW_INDEX, 0); /* reset the state machine; set current x,y */ + outw(LINEDRAW, x2); + outw(LINEDRAW, y2); + #endif + while(--npt) { ! #ifdef ONE_RECT ! /* Send a burst of endpoints before checking for a clip exception */ ! int overrun; ! int nburst = min(14, npt); ! npt -= nburst - 1; ! ! while (nburst--) ! { ! #endif ! x1 = x2; ! y1 = y2; ! ++ppt; ! if (mode == CoordModePrevious) ! { ! xorg = x1; ! yorg = y1; ! } ! x2 = ppt->x + xorg; ! y2 = ppt->y + yorg; ! #ifdef ONE_RECT ! WaitQueue(2); ! outw(LINEDRAW, x2); /* write destination x,y; draw line */ ! outw(LINEDRAW, y2); ! } /* while (nburst--) */ ! ! WaitIdleEmpty(); /* 8-( */ ! /* ! * Read CLIP_OVERRUN and, if an exception has occurred, put the endpoints ! * of the offending line into (x1, y1),(x2, y2) and let the software ! * clip and draw. ! */ ! if ((overrun = (inw(EXT_GE_STATUS) & 0x0f))) { ! ppt -= overrun; ! ! /* Put the start point of the line that caused the clip exception ! * into (x2, y2). If (mode == CoordModePrevious), we have to start ! * from the beginning (pptInit) to calculate xorg and yorg. ! */ ! x2 = pDrawable->x; ! y2 = pDrawable->y; ! if (mode == CoordModePrevious) { ! DDXPointPtr ppt_tmp; ! for (ppt_tmp = pptInit; ppt_tmp != ppt; ppt_tmp++) { ! xorg = x2; ! yorg = y2; ! x2 = ppt_tmp->x + xorg; ! y2 = ppt_tmp->y + yorg; ! } ! } ! x2 += ppt->x; ! y2 += ppt->y; ! ! /* Now draw the line that caused the clip exception. */ x1 = x2; y1 = y2; ++ppt; *************** *** 162,167 **** --- 234,243 ---- } x2 = ppt->x + xorg; y2 = ppt->y + yorg; + #endif + + nbox = nboxInit; + pbox = pboxInit; if (x1 == x2) { *************** *** 422,428 **** } } /* while (nbox--) */ } /* sloped line */ ! } /* while (nline--) */ /* paint the last point if the end style isn't CapNotLast. (Assume that a projecting, butt, or round cap that is one --- 498,519 ---- } } /* while (nbox--) */ } /* sloped line */ ! #ifdef ONE_RECT ! npt += overrun - 1; ! WaitQueue(3); ! outw(LINEDRAW_INDEX, 0); /* clear CLIP_OVERRUN; write current x,y */ ! outw(LINEDRAW, x2); ! outw(LINEDRAW, y2); ! } /* if (overrun) */ ! #endif ! } /* while (--npt) */ ! ! #ifdef ONE_RECT ! WaitQueue(10); ! outw(LINEDRAW_OPT, CLIP_MODE_0); ! #else ! WaitQueue(5); ! #endif /* paint the last point if the end style isn't CapNotLast. (Assume that a projecting, butt, or round cap that is one *************** *** 443,449 **** (x2 < pbox->x2) && (y2 < pbox->y2)) { - WaitQueue(4); outw(CUR_X, (short)x2); outw(CUR_Y, (short)y2); outw(MAJ_AXIS_PCNT, 0); --- 534,539 ---- *************** *** 456,464 **** } } ! WaitQueue(2); outw(FRGD_MIX, FSS_FRGDCOL | MIX_SRC); - outw(BKGD_MIX, BSS_BKGDCOL | MIX_SRC); WaitIdleEmpty(); /* Make sure that all commands have finished */ } --- 546,558 ---- } } ! #ifdef ONE_RECT ! outw(EXT_SCISSOR_L, 0); ! outw(EXT_SCISSOR_T, 0); ! outw(EXT_SCISSOR_R, mach32MaxX); ! outw(EXT_SCISSOR_B, mach32MaxY); ! #endif outw(FRGD_MIX, FSS_FRGDCOL | MIX_SRC); WaitIdleEmpty(); /* Make sure that all commands have finished */ } diff -c /dev/null mit/server/ddx/x386/accel/mach32/mach32mem.c:2.3 *** /dev/null Fri Mar 11 23:37:16 1994 --- mit/server/ddx/x386/accel/mach32/mach32mem.c Fri Mar 11 23:37:16 1994 *************** *** 0 **** --- 1,391 ---- + /* + * Copyright 1993 ATI + * + * Used by XFree86 with permission + * + * Modified heavily by Mark_Weaver@brown.edu for XFree86 + */ + + /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32mem.c,v 2.3 1994/02/10 21:24:51 dawes Exp $ */ + + + #include "compiler.h" + #include "mach32.h" + + #ifdef NEW_MEM_DETECT + + static void SetupRestoreEngine_m(); + static unsigned short ReadPixel_m(); + static void WritePixel_m(); + + /* + * Private definitions + */ + #define SETUP_ENGINE 0 + #define RESTORE_ENGINE 1 + + #define MAX_TEST_PIXELS 4 + + typedef unsigned short MyPixel; + + static struct { + int memSize; /* Mem in kb if this test succeeds */ + struct { + short x, y; /* One entry for each pixel */ + } pt[MAX_TEST_PIXELS + 1]; /* Terminated by x < 0 */ + } testCases[] = { + /* + * Given the engine settings used, only a 4M card will have + * enough memory to back up the 1025th line of the display. + * Since the pixel coordinates are zero-based, line 1024 will + * be the first one which is only backed on 4M cards. + * + * : + * In case memory is being wrapped, (0,0) and (0,1024) + * to make sure they can each hold a unique value. + */ + {4096, {{0,0}, {0,1024}, {-1,-1}}}, + + /* + * We know this card has 2M or less. On a 1M card, the first 2M + * of the card's memory will have even doublewords backed by + * physical memory and odd doublewords unbacked. + * + * Pixels 0 and 1 of a row will be in the zeroth doubleword, while + * pixels 2 and 3 will be in the first. Check both pixels 2 and 3 + * in case this is a pseudo-1M card (one chip pulled to turn a 2M + * card into a 1M card). + * + * : + * I don't have a 1M card, so I'm taking a stab in the dark. + * Maybe memory wraps every 512 lines, or maybe odd doublewords + * are aliases of their even doubleword counterparts. I try + * everything here. + */ + {2048, {{0,0}, {0,512}, {2,0}, {3,0}, {-1,-1}}}, + + /* + * This is a either a 1M card or a 512k card. Test pixel 1, since + * it is an odd word in an even doubleword. + * + * NOTE: We have not received 512k cards for testing - this is an + * extrapolation of the 1M/2M determination code. + * + * : + * This is the same idea as the test above. + */ + {1024, {{0,0}, {0,256}, {1,0}, {-1,-1}}}, + + /* + * We assume it is a 512k card by default, since that is the + * minimum configuration. + */ + {512, {{-1,-1}}} + }; + + #define NUM_TEST_CASES (sizeof(testCases) / sizeof(testCases[0])) + + /* + * Bit patterns which are extremely unlikely to show up when reading + * from nonexistant memory (which normally shows up as either all + * bits set or all bits clear). + */ + + static MyPixel testColor[MAX_TEST_PIXELS]={0x5aa5, 0x55aa, 0xa55a, 0xca53}; + + + /*************************************************************************** + * + * int mach32GetMemSize(void); + * + * DESCRIPTION: + * Determine the amount of video memory installed on the graphics card. + * This is done because the 68800-6 contains a bug which causes MISC_OPTIONS + * to report 1M rather than the true amount of memory. + * + * RETURN VALUE: + * Amount of memory in kb + * + * GLOBALS CHANGED: + * none + * + * BASED ON CODE BY: + * Robert Wolff + * + * CHANGE HISTORY: + * Modified for use with XFree86 (David Dawes) + * Rewritten for XFree86 (Mark_Weaver@brown.edu) + * + * TEST HISTORY: + * + ***************************************************************************/ + + /* + * I believe that redundancy is the root of all evil in the world. + * These are few macros to make things below little less redundant. + * + */ + #define TestPixel testCases[caseNum].pt[pixelNum] + #define ForEachTestPixel \ + for (pixelNum = 0; TestPixel.x >= 0; ++pixelNum) + + int mach32GetMemSize() + { + MyPixel savedPixel[MAX_TEST_PIXELS]; + int caseNum, pixelNum; + int success; + + /* + * Switch into accelerator mode, and initialize the engine to + * a pitch of 1024 pixels in 16BPP. + */ + SetupRestoreEngine_m(SETUP_ENGINE); + + for (caseNum = 0; caseNum < NUM_TEST_CASES; ++caseNum) { + /* + * If you're confused, see the #defines above this routine + */ + + /* Save all the pixel values */ + ForEachTestPixel + savedPixel[pixelNum] = ReadPixel_m(TestPixel.x, TestPixel.y); + + /* Write the test patterns */ + ForEachTestPixel + WritePixel_m(TestPixel.x, TestPixel.y, testColor[pixelNum]); + + /* See if any of the pixels forgot what we wrote */ + success = 1; + ForEachTestPixel { + if (ReadPixel_m(TestPixel.x, TestPixel.y) != testColor[pixelNum]) + success = 0; + } + + /* Regardless of the outcome, restore all the values */ + ForEachTestPixel + WritePixel_m(TestPixel.x, TestPixel.y, savedPixel[pixelNum]); + + if (success) { + /* + * If the test was successful, we're done. + * Restore the engine, and return the appropriate value + */ + SetupRestoreEngine_m(RESTORE_ENGINE); + return testCases[caseNum].memSize; + } + } + + /* + * We shouldn't ever get here. But just in case we do. + */ + SetupRestoreEngine_m(RESTORE_ENGINE); + return 512; + + } + + #undef TestPixel + #undef ForEachTestPixel + + /*************************************************************************** + * + * void SetupRestoreEngine_m(DesiredStatus); + * + * int DesiredStatus; Whether the user wants to set up or restore + * + * DESCRIPTION: + * Set engine to 1024 pitch 16BPP with 512k of VGA memory, + * or restore the engine and boundary status, as selected by the user. + * + * GLOBALS CHANGED: + * none + * + * CALLED BY: + * GetTrueMemSize_m() + * + * AUTHOR: + * Robert Wolff + * + * CHANGE HISTORY: + * + * TEST HISTORY: + * + ***************************************************************************/ + static void SetupRestoreEngine_m(DesiredStatus) + int DesiredStatus; + { + static unsigned short MiscOptions; /* Contents of MISC_OPTIONS register */ + static unsigned short ExtGeConfig; /* Contents of EXT_GE_CONFIG register */ + static unsigned short MemBndry; /* Contents of MEM_BNDRY register */ + unsigned short tmp; + + + if (DesiredStatus == SETUP_ENGINE) { + + tmp = inw(CLOCK_SEL); + outw(CLOCK_SEL, tmp | 0x0001); + /* Passth8514_m(SHOW_ACCEL); */ + + /* + * Set up a 512k VGA boundary so "blue screen" writes that happen + * when we are in accelerator mode won't show up in the wrong place. + */ + MemBndry = inw(MEM_BNDRY); /* Set up shared memory */ + outw(MEM_BNDRY, 0); + + /* + * Save the contents of the MISC_OPTIONS register, then + * tell it that we have 4M of video memory. Otherwise, + * video memory will wrap when it hits the boundary + * in the MEM_SIZE_ALIAS field. + */ + MiscOptions = inw(MISC_OPTIONS); + outw(MISC_OPTIONS, MiscOptions | MEM_SIZE_4M); + + /* + * Set 16BPP with pitch of 1024. Only set up the drawing + * engine, and not the CRT, since the results of this test + * are not intended to be seen. + */ + ExtGeConfig = inw(R_EXT_GE_CONFIG); + outw(EXT_GE_CONFIG, PIX_WIDTH_16BPP | ORDER_16BPP_565 | 0x000A); + outw(GE_PITCH, (1024 >> 3)); + outw(GE_OFFSET_HI, 0); + outw(GE_OFFSET_LO, 0); + } else { /* DesiredStatus == RESTORE_ENGINE */ + /* + * Restore the memory boundary, MISC_OPTIONS register, + * and EXT_GE_CONFIG. It is not necessary to reset the + * drawing engine pitch and offset, because they don't + * affect what is displayed and they will be set to + * whatever values are needed when the desired video + * mode is set. + */ + outw(EXT_GE_CONFIG, ExtGeConfig); + outw(MISC_OPTIONS, MiscOptions); + outw(MEM_BNDRY, MemBndry); + + /* + * Give the VGA control of the screen. + */ + tmp = inw(CLOCK_SEL); + outw(CLOCK_SEL, tmp & ~0x0001); + /* Passth8514_m(SHOW_VGA); */ + } + return; + + } /* SetupRestoreEngine_m() */ + + + + /*************************************************************************** + * + * MyPixel ReadPixel_m(XPos, YPos); + * + * short XPos; X coordinate of pixel to read + * short YPos; Y coordinate of pixel to read + * + * DESCRIPTION: + * Read a single pixel from the screen. + * + * RETURN VALUE: + * Colour of pixel at the desired location. + * + * GLOBALS CHANGED: + * none + * + * CALLED BY: + * GetTrueMemSize_m() + * + * AUTHOR: + * Robert Wolff + * + * CHANGE HISTORY: + * + * TEST HISTORY: + * + ***************************************************************************/ + + static MyPixel ReadPixel_m(XPos, YPos) + short XPos, YPos; + { + MyPixel RetVal; + + /* + * Don't read if the engine is busy. + */ + WaitIdleEmpty(); + + /* + * Set up the engine to read colour data from the screen. + */ + WaitQueue(7); + outw(RD_MASK, 0x0FFFF); + outw(DP_CONFIG, FG_COLOR_SRC_BLIT | DATA_WIDTH | DRAW | DATA_ORDER); + outw(CUR_X, XPos); + outw(CUR_Y, YPos); + outw(DEST_X_START, XPos); + outw(DEST_X_END, XPos+1); + outw(DEST_Y_END, YPos+1); + + /* + * Wait for the engine to process the orders we just gave it and + * start asking for data. + */ + WaitQueue(16); + while (!(inw(GE_STAT) & DATA_READY)); + + RetVal = inw(PIX_TRANS); + WaitIdleEmpty(); + return RetVal; + + } /* ReadPixel_m() */ + + + + /*************************************************************************** + * + * void WritePixel_m(XPos, YPos, Colour); + * + * short XPos; X coordinate of pixel to read + * short YPos; Y coordinate of pixel to read + * MyPixel Colour; Colour to paint the pixel + * + * DESCRIPTION: + * Write a single pixel to the screen. + * + * GLOBALS CHANGED: + * none + * + * CALLED BY: + * GetTrueMemSize_m() + * + * AUTHOR: + * Robert Wolff + * + * CHANGE HISTORY: + * + * TEST HISTORY: + * + ***************************************************************************/ + + static void WritePixel_m(XPos, YPos, Colour) + short XPos, YPos; + MyPixel Colour; + { + /* + * Set up the engine to paint to the screen. + */ + WaitQueue(8); + outw(DP_CONFIG, FG_COLOR_SRC_FG | DRAW | READ_WRITE); + outw(ALU_FG_FN, MIX_FN_PAINT); + outw(FRGD_COLOR, Colour); + outw(CUR_X, XPos); + outw(CUR_Y, YPos); + outw(DEST_X_START, XPos); + outw(DEST_X_END, XPos+1); + outw(DEST_Y_END, YPos+1); + + return; + + } /* WritePixel_m() */ + #endif /* NEW_MEM_DETECT */ diff -c mit/server/ddx/x386/accel/mach32/mach32pcach.c:2.4 mit/server/ddx/x386/accel/mach32/mach32pcach.c:2.5 *** mit/server/ddx/x386/accel/mach32/mach32pcach.c:2.4 Fri Mar 11 23:37:17 1994 --- mit/server/ddx/x386/accel/mach32/mach32pcach.c Fri Mar 11 23:37:17 1994 *************** *** 25,31 **** * */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32pcach.c,v 2.4 1993/10/04 05:01:03 dawes Exp $ */ /* Offscreen memory organization for one 256-line cache set: * --- 25,31 ---- * */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32pcach.c,v 2.5 1993/12/25 13:58:18 dawes Exp $ */ /* Offscreen memory organization for one 256-line cache set: * *************** *** 655,661 **** int xwmid, ywmid, orig_xwmid; int startx, starty, endx, endy; int orig_x = x; - int i; if (w == 0 || h == 0) return; --- 655,660 ---- diff -c mit/server/ddx/x386/accel/mach32/mach32pntwn.c:2.2 mit/server/ddx/x386/accel/mach32/mach32pntwn.c:2.3 *** mit/server/ddx/x386/accel/mach32/mach32pntwn.c:2.2 Fri Mar 11 23:37:18 1994 --- mit/server/ddx/x386/accel/mach32/mach32pntwn.c Fri Mar 11 23:37:18 1994 *************** *** 25,31 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32pntwn.c,v 2.2 1993/08/17 16:15:17 dawes Exp $ */ #include "X.h" --- 25,31 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32pntwn.c,v 2.3 1993/12/25 13:58:20 dawes Exp $ */ #include "X.h" *************** *** 38,45 **** #include "cfbmskbits.h" #include "mach32.h" #include "regmach32.h" - - static void cfbPaintArea32(), cfbPaintAreaSolid(); extern void miPaintWindow(); --- 38,43 ---- diff -c mit/server/ddx/x386/accel/mach32/mach32scrin.c:2.1 mit/server/ddx/x386/accel/mach32/mach32scrin.c:2.5 *** mit/server/ddx/x386/accel/mach32/mach32scrin.c:2.1 Fri Mar 11 23:37:18 1994 --- mit/server/ddx/x386/accel/mach32/mach32scrin.c Fri Mar 11 23:37:18 1994 *************** *** 40,46 **** ********************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32scrin.c,v 2.1 1993/09/04 16:28:30 dawes Exp $ */ /* $XConsortium: cfbscrinit.c,v 5.18 90/09/24 17:46:11 rws Exp $ */ --- 40,46 ---- ********************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32scrin.c,v 2.5 1993/12/25 13:58:22 dawes Exp $ */ /* $XConsortium: cfbscrinit.c,v 5.18 90/09/24 17:46:11 rws Exp $ */ *************** *** 63,68 **** --- 63,70 ---- extern RegionPtr mfbPixmapToRegion(); extern Bool mfbAllocatePrivates(); + extern Bool mfbRegisterCopyPlaneProc(); + extern Bool miScreenInit(); extern int defaultColorVisualClass; *************** *** 102,109 **** #define NUMDEPTHS ((sizeof depths)/(sizeof depths[0])) - int cfbWindowPrivateIndex; - int cfbGCPrivateIndex; static unsigned long cfbGeneration = 0; miBSFuncRec mach32BSFuncRec = { --- 104,109 ---- *************** *** 131,136 **** --- 131,139 ---- for (i = 0; i < NUMVISUALS; i++) { visuals[i].vid = FakeClientID(0); VIDs[i] = visuals[i].vid; + if (mach32DAC8Bit) { + visuals[i].bitsPerRGBValue = 8; + } } cfbGeneration = serverGeneration; } *************** *** 159,165 **** pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0; pScreen->QueryBestSize = mfbQueryBestSize; /* SaveScreen */ ! pScreen->GetImage = miGetImage; pScreen->GetSpans = mach32GetSpans; pScreen->CreateWindow = cfbCreateWindow; pScreen->DestroyWindow = cfbDestroyWindow; --- 162,168 ---- pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0; pScreen->QueryBestSize = mfbQueryBestSize; /* SaveScreen */ ! pScreen->GetImage = mach32GetImage; pScreen->GetSpans = mach32GetSpans; pScreen->CreateWindow = cfbCreateWindow; pScreen->DestroyWindow = cfbDestroyWindow; diff -c mit/server/ddx/x386/accel/mach32/mach32seg.c:2.4 mit/server/ddx/x386/accel/mach32/mach32seg.c:2.5 *** mit/server/ddx/x386/accel/mach32/mach32seg.c:2.4 Fri Mar 11 23:37:19 1994 --- mit/server/ddx/x386/accel/mach32/mach32seg.c Fri Mar 11 23:37:19 1994 *************** *** 27,33 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32seg.c,v 2.4 1993/09/21 15:21:40 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ --- 27,33 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/mach32seg.c,v 2.5 1993/12/25 13:58:24 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ *************** *** 99,106 **** unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - unsigned long *addrl; /* address of destination pixmap */ - int nlwidth; /* width in longwords of destination pixmap */ int xorg, yorg; /* origin of window */ int adx; /* abs values of dx and dy */ --- 99,104 ---- *************** *** 120,127 **** register int x1, x2; RegionPtr cclip; cfbPrivGCPtr devPriv; - unsigned long xor, and; - int alu; if (!x386VTSema) { --- 118,123 ---- diff -c mit/server/ddx/x386/accel/mach32/regmach32.h:2.6 mit/server/ddx/x386/accel/mach32/regmach32.h:2.16 *** mit/server/ddx/x386/accel/mach32/regmach32.h:2.6 Fri Mar 11 23:37:19 1994 --- mit/server/ddx/x386/accel/mach32/regmach32.h Fri Mar 11 23:37:20 1994 *************** *** 21,27 **** * Modified for the Mach32 by Kevin E. Martin (martin@cs.unc.edu) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/regmach32.h,v 2.6 1993/10/06 14:54:34 dawes Exp $ */ #ifndef REGMACH32_H #define REGMACH32_H --- 21,27 ---- * Modified for the Mach32 by Kevin E. Martin (martin@cs.unc.edu) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach32/regmach32.h,v 2.16 1994/03/03 12:43:20 dawes Exp $ */ #ifndef REGMACH32_H #define REGMACH32_H *************** *** 67,72 **** --- 67,73 ---- #define ERR_TERM 0x92e8 #define MAJ_AXIS_PCNT 0x96e8 #define GP_STAT 0x9ae8 + #define GE_STAT GP_STAT #define CMD 0x9ae8 #define SHORT_STROKE 0x9ee8 #define BKGD_COLOR 0xa2e8 *************** *** 111,116 **** --- 112,118 ---- #define MEMCFG_4 0x0002 #define MEMCFG_6 0x0004 #define MEMCFG_8 0x0006 + #define ODDBNKENAB 0x0001 /* Subsystem Status Register */ #define _8PLANE 0x0080 *************** *** 156,161 **** --- 158,164 ---- /* Graphics Processor Status Register */ #define GPBUSY 0x0200 #define DATDRDY 0x0100 + #define DATA_READY DATDRDY /* Command Register */ #define CMD_NOP 0x0000 *************** *** 234,239 **** --- 237,243 ---- #define MIX_HALF__DST_MINUS_SRC_SAT 0x001c #define MIX_HALF__SRC_MINUS_DST_SAT 0x001e #define MIX_AVERAGE_SAT 0x001f + #define MIX_FN_PAINT MIX_SRC /* Memory Control Register */ #define BUFSWP 0x0010 *************** *** 284,289 **** --- 288,308 ---- #define READ_SRC_X 0xdaee #define CHIP_ID 0xfaee #define EXT_FIFO_STATUS 0x9aee + #define EXT_GE_CONFIG 0x7aee + #define R_EXT_GE_CONFIG 0x8eee + #define EXT_GE_STATUS 0x62ee + #define MISC_CNTL 0x7eee + #define R_MISC_CNTL 0x92ee + #define DP_CONFIG 0xceee + #define DEST_X_START 0xa6ee + #define DEST_X_END 0xaaee + #define DEST_Y_END 0xaeee + #define ALU_FG_FN 0xbaee + #define HORZ_OVERSCAN 0x62ee + #define VERT_OVERSCAN 0x66ee + #define LINEDRAW 0xfeee + #define LINEDRAW_INDEX 0x9aee + #define LINEDRAW_OPT 0xa2ee /* Mach8 config status 1 */ #define CLK_MODE 0x0001 *************** *** 337,344 **** #define LOCAL_386SX 0x0008 #define LOCAL_386DX 0x000a #define LOCAL_486 0x000c ! #define ISA_8_BIT 0x000e /* Mach32 CRT Polarity */ #define H_POLARITY_POS 0x0000 #define H_POLARITY_NEG 0x0020 --- 356,372 ---- #define LOCAL_386SX 0x0008 #define LOCAL_386DX 0x000a #define LOCAL_486 0x000c ! #define PCI 0x000e + /* Mach32 RAMDAC types */ + #define DAC_ATI68830 0 + #define DAC_SC11483 1 + #define DAC_TLC34075 2 + #define DAC_BT476 3 + #define DAC_BT481 4 + #define DAC_ATI68860 5 + #define DAC_ATI68875 DAC_TLC34075 + /* Mach32 CRT Polarity */ #define H_POLARITY_POS 0x0000 #define H_POLARITY_NEG 0x0020 *************** *** 345,350 **** --- 373,381 ---- #define V_POLARITY_POS 0x0000 #define V_POLARITY_NEG 0x0020 + /* Mach32 Composite Sync */ + #define COMPOSITE_SYNC 0x1000 + /* Mach32 Number of Video FIFO entries */ #define VFIFO_DEPTH_1 0x0100 #define VFIFO_DEPTH_2 0x0200 *************** *** 373,378 **** --- 404,445 ---- #define TEST_MODE 0x0100 #define BLK_WR_ENA 0x0400 #define _64_DRAW_ENA 0x0800 + #define MEM_SIZE_512K 0x0000 + #define MEM_SIZE_1M 0x0004 + #define MEM_SIZE_2M 0x0008 + #define MEM_SIZE_4M 0x000c + + /* Mach32 Extended Graphics Engine Configuration Register */ + #define PIXEL_WIDTH_4 0x0000 + #define PIXEL_WIDTH_8 0x0010 + #define PIXEL_WIDTH_16 0x0020 + #define PIXEL_WIDTH_24 0x0030 + #define RGB16_555 0x0000 + #define RGB16_565 0x0040 + #define RGB16_655 0x0080 + #define RGB16_664 0x00c0 + #define MULTIPLEX_PIXELS 0x0100 + #define RGB24 0x0000 + #define RGBx24 0x0200 + #define BGR24 0x0400 + #define xBGR24 0x0600 + #define DAC_8_BIT_EN 0x4000 + #define PIX_WIDTH_16BPP PIXEL_WIDTH_16 + #define ORDER_16BPP_565 RGB16_565 + + /* Mach32 DP_CONFIG register */ + #define FG_COLOR_SRC_BLIT 0x6000 + #define FG_COLOR_SRC_FG 0x2000 + #define DATA_WIDTH 0x0200 + #define DATA_ORDER 0x1000 + #define READ_WRITE 0x0001 + + /* Mach8/Mach32 Linedraw Options register */ + #define BOUNDS_RESET 0x0100 + #define CLIP_MODE_0 0x0000 /* clip exception disabled */ + #define CLIP_MODE_1 0x0200 /* line segments */ + #define CLIP_MODE_2 0x0400 /* polygon boundary lines */ + #define CLIP_MODE_3 0x0600 /* patterned lines */ /* ATI VGA Extended Regsiters */ #define ATIEXT 0x1ce *************** *** 392,397 **** --- 459,468 ---- #define MACH32_MAX_X 2047 #define MACH32_MAX_Y 2047 + /* RAMDAC type 2 registers */ + #define OUTPUT_CLK_SEL 0x2ea + #define MUX_CNTL 0x2eb + #define INPUT_CLK_SEL 0x2ed typedef struct { unsigned char r, g, b; *************** *** 409,414 **** --- 480,495 ---- /* Wait until GP is idle and queue is empty */ #define WaitIdleEmpty() { while (inw(GP_STAT) & (GPBUSY | 1)); } + + /* + * This version is for use in mach8Probe() to prevent a server hang if + * there is no 8514/A-style chip present + */ + #define ProbeWaitIdleEmpty() { int i; \ + for (i = 0; i < 100000; i++) \ + if (!(inw(GP_STAT) & (GPBUSY | 1))) \ + break; \ + } #define SKIP_2(_v) ((((_v)<<1)&0xfff8)|((_v)&0x3)|(((_v)&0x80)>>5)) diff -c mit/server/ddx/x386/accel/mach8/Imakefile:2.5 mit/server/ddx/x386/accel/mach8/Imakefile:2.8 *** mit/server/ddx/x386/accel/mach8/Imakefile:2.5 Fri Mar 11 23:37:24 1994 --- mit/server/ddx/x386/accel/mach8/Imakefile Fri Mar 11 23:37:24 1994 *************** *** 1,4 **** ! XCOMM $XFree86: mit/server/ddx/x386/accel/mach8/Imakefile,v 2.5 1993/09/21 15:21:55 dawes Exp $ #include SRCS = mach8.c mach8cmap.c mach8gc.c mach8fs.c mach8ss.c \ --- 1,4 ---- ! XCOMM $XFree86: mit/server/ddx/x386/accel/mach8/Imakefile,v 2.8 1994/02/19 09:28:55 dawes Exp $ #include SRCS = mach8.c mach8cmap.c mach8gc.c mach8fs.c mach8ss.c \ *************** *** 7,13 **** mach8line.c mach8seg.c mach8frect.c mach8text.c \ mach8font.c mach8fcach.c \ mach8dsln.c mach8dssg.c mach8ddln.c mach8ddsg.c \ ! mach8imwrt.s mach8imrd.s mach8imfl.s mach8imst.s OBJS = mach8.o mach8cmap.o mach8gc.o mach8fs.o mach8ss.o \ mach8gs.o mach8win.o mach8init.o mach8im.o mach8bstor.o \ --- 7,15 ---- mach8line.c mach8seg.c mach8frect.c mach8text.c \ mach8font.c mach8fcach.c \ mach8dsln.c mach8dssg.c mach8ddln.c mach8ddsg.c \ ! mach8imwrt.s mach8imrd.s mach8imfl.s mach8imst.s \ ! mach8imwrd.s mach8imrdd.s mach8imfld.s mach8imstd.s \ ! mach8gtimg.c OBJS = mach8.o mach8cmap.o mach8gc.o mach8fs.o mach8ss.o \ mach8gs.o mach8win.o mach8init.o mach8im.o mach8bstor.o \ *************** *** 15,21 **** mach8line.o mach8seg.o mach8frect.o mach8text.o \ mach8font.o mach8fcach.o \ mach8dsln.o mach8dssg.o mach8ddln.o mach8ddsg.o \ ! mach8imwrt.o mach8imrd.o mach8imfl.o mach8imst.o INCLUDES = -I../../common -I../../common_hw -I../../os-support -I. \ -I../../../mfb -I../../../mi -I../../../../include \ --- 17,25 ---- mach8line.o mach8seg.o mach8frect.o mach8text.o \ mach8font.o mach8fcach.o \ mach8dsln.o mach8dssg.o mach8ddln.o mach8ddsg.o \ ! mach8imwrt.o mach8imrd.o mach8imfl.o mach8imst.o \ ! mach8imwrd.o mach8imrdd.o mach8imfld.o mach8imstd.o \ ! mach8gtimg.o INCLUDES = -I../../common -I../../common_hw -I../../os-support -I. \ -I../../../mfb -I../../../mi -I../../../../include \ *************** *** 32,36 **** --- 36,44 ---- ObjectFromSpecialSource(mach8ddln,mach8dsln,-DMach8DoubleDash) ObjectFromSpecialSource(mach8ddsg,mach8dssg,-DMach8DoubleDash) + ObjectFromSpecialAsmSource(mach8imfld,mach8imfl,-DDRAM_VERSION) + ObjectFromSpecialAsmSource(mach8imrdd,mach8imrd,-DDRAM_VERSION) + ObjectFromSpecialAsmSource(mach8imstd,mach8imst,-DDRAM_VERSION) + ObjectFromSpecialAsmSource(mach8imwrd,mach8imwrt,-DDRAM_VERSION) DependTarget() diff -c mit/server/ddx/x386/accel/mach8/mach8.c:2.23 mit/server/ddx/x386/accel/mach8/mach8.c:2.34 *** mit/server/ddx/x386/accel/mach8/mach8.c:2.23 Fri Mar 11 23:37:25 1994 --- mit/server/ddx/x386/accel/mach8/mach8.c Fri Mar 11 23:37:25 1994 *************** *** 30,38 **** * Header: /proj/X11/mit/server/ddx/x386/vga/RCS/vga.c,v 1.2 1991/06/27 00:02:49 root Exp */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8.c,v 2.23 1993/10/12 15:41:25 dawes Exp $ */ #include "X.h" #include "input.h" #include "pixmapstr.h" #include "scrnintstr.h" --- 30,39 ---- * Header: /proj/X11/mit/server/ddx/x386/vga/RCS/vga.c,v 1.2 1991/06/27 00:02:49 root Exp */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8.c,v 2.34 1994/03/03 12:43:39 dawes Exp $ */ #include "X.h" + #include "Xmd.h" #include "input.h" #include "pixmapstr.h" #include "scrnintstr.h" *************** *** 43,48 **** --- 44,50 ---- #include "x386.h" #include "x386Priv.h" + #include "x386Procs.h" #include "xf86_OSlib.h" #include "xf86_HWlib.h" #include "mach8.h" *************** *** 55,62 **** extern int mach8MaxClock; extern Bool x386Exiting, x386Resetting, x386ProbeFailed, x386Verbose; extern void NoopDDA(); - ScrnInfoRec mach8InfoRec = { FALSE, /* Bool configured */ -1, /* int tmpIndex */ --- 57,66 ---- extern int mach8MaxClock; extern Bool x386Exiting, x386Resetting, x386ProbeFailed, x386Verbose; extern void NoopDDA(); + extern Bool mfbRegisterCopyPlaneProc(); + extern Bool miDCInitialize(); + extern void SetTimeSinceLastInputEvent(); ScrnInfoRec mach8InfoRec = { FALSE, /* Bool configured */ -1, /* int tmpIndex */ *************** *** 83,88 **** --- 87,93 ---- 0, /* int maxClock */ 0, /* int videoRam */ 0, /* int BIOSbase, 1.3 new */ + 0, /* unsigned long MemBase, unused for this driver */ 240, 180, /* int width, height */ 0, /* unsigned long speedup */ NULL, /* DisplayModePtr modes */ *************** *** 117,122 **** --- 122,133 ---- extern miPointerScreenFuncRec x386PointerScreenFuncs; + void (*mach8ImageWriteFunc)(); + void (*mach8ImageReadFunc)(); + void (*mach8RealImageFillFunc)(); + void (*mach8ImageStippleFunc)(); + + static Bool mach8DramUsed = FALSE; static int AlreadyInited = FALSE; Bool mach8clkprobedif4fix = FALSE; *************** *** 124,129 **** --- 135,141 ---- static struct mach8vmodedef mach8ScreenMode; static ScreenPtr savepScreen = NULL; + static PixmapPtr ppix = NULL; static unsigned mach8_IOPorts[] = { /* 8514 Registers */ *************** *** 183,189 **** * entirely arbitrary. */ outw(ERR_TERM, 0x5a5a); ! WaitIdleEmpty(); if (inw(ERR_TERM) != 0x5a5a) { ErrorF("%s: No 8514/A registers detected!\n", mach8InfoRec.name); xf86DisableIOPorts(mach8InfoRec.scrnIndex); --- 195,201 ---- * entirely arbitrary. */ outw(ERR_TERM, 0x5a5a); ! ProbeWaitIdleEmpty(); if (inw(ERR_TERM) != 0x5a5a) { ErrorF("%s: No 8514/A registers detected!\n", mach8InfoRec.name); xf86DisableIOPorts(mach8InfoRec.scrnIndex); *************** *** 191,197 **** } /* 6 mar 93 TCG : let's make certain */ outw(ERR_TERM, 0x2525); ! WaitIdleEmpty(); if (inw(ERR_TERM) != 0x2525) { ErrorF("%s: No 8514/A registers detected!\n", mach8InfoRec.name); xf86DisableIOPorts(mach8InfoRec.scrnIndex); --- 203,209 ---- } /* 6 mar 93 TCG : let's make certain */ outw(ERR_TERM, 0x2525); ! ProbeWaitIdleEmpty(); if (inw(ERR_TERM) != 0x2525) { ErrorF("%s: No 8514/A registers detected!\n", mach8InfoRec.name); xf86DisableIOPorts(mach8InfoRec.scrnIndex); *************** *** 200,206 **** temp = inw(ROM_ADDR_1); outw(ROM_ADDR_1, 0x5555); ! WaitIdleEmpty(); if (inw(ROM_ADDR_1) != 0x5555) { ErrorF("%s: No ATI accelerator detected\n", mach8InfoRec.name); xf86DisableIOPorts(mach8InfoRec.scrnIndex); --- 212,218 ---- temp = inw(ROM_ADDR_1); outw(ROM_ADDR_1, 0x5555); ! ProbeWaitIdleEmpty(); if (inw(ROM_ADDR_1) != 0x5555) { ErrorF("%s: No ATI accelerator detected\n", mach8InfoRec.name); xf86DisableIOPorts(mach8InfoRec.scrnIndex); *************** *** 207,213 **** return(FALSE); } outw(ROM_ADDR_1, 0x2a2a); ! WaitIdleEmpty(); if (inw(ROM_ADDR_1) != 0x2a2a) { ErrorF("%s: No ATI accelerator detected\n", mach8InfoRec.name); xf86DisableIOPorts(mach8InfoRec.scrnIndex); --- 219,225 ---- return(FALSE); } outw(ROM_ADDR_1, 0x2a2a); ! ProbeWaitIdleEmpty(); if (inw(ROM_ADDR_1) != 0x2a2a) { ErrorF("%s: No ATI accelerator detected\n", mach8InfoRec.name); xf86DisableIOPorts(mach8InfoRec.scrnIndex); *************** *** 216,237 **** outw(ROM_ADDR_1, temp); outw(DESTX_DIASTP, 0xaaaa); ! WaitIdleEmpty(); if ((inw(READ_SRC_X) != 0xaaaa) && x386Verbose) { ! ErrorF("%s %s: Mach-8 detected\n", XCONFIG_PROBED, ! mach8InfoRec.name); ! } ! outw(DESTX_DIASTP, 0x5555); ! WaitIdleEmpty(); ! if (inw(READ_SRC_X) == 0x0555) { ! ErrorF("%s %s: Mach-32 detected\n", XCONFIG_PROBED, ! mach8InfoRec.name); ! xf86DisableIOPorts(mach8InfoRec.scrnIndex); ! return(FALSE); } } OFLG_ZERO(&validOptions); xf86VerifyOptions(&validOptions, &mach8InfoRec); if (!mach8InfoRec.clocks) --- 228,249 ---- outw(ROM_ADDR_1, temp); outw(DESTX_DIASTP, 0xaaaa); ! ProbeWaitIdleEmpty(); if ((inw(READ_SRC_X) != 0xaaaa) && x386Verbose) { ! outw(DESTX_DIASTP, 0x5555); ! ProbeWaitIdleEmpty(); ! if (inw(READ_SRC_X) == 0x0555) { ! ErrorF("%s %s: Mach-32 detected, used as a Mach-8\n", ! XCONFIG_PROBED, mach8InfoRec.name); ! } ! else ! ErrorF("%s %s: Mach-8 detected\n", XCONFIG_PROBED, ! mach8InfoRec.name); } } OFLG_ZERO(&validOptions); + OFLG_SET(OPTION_CSYNC, &validOptions); xf86VerifyOptions(&validOptions, &mach8InfoRec); if (!mach8InfoRec.clocks) *************** *** 297,303 **** mach8InfoRec.chipset = "mach8"; x386ProbeFailed = FALSE; ! if (x386Verbose) { ErrorF("%s %s: (mem: %dk %cRAM numclocks: %d)", --- 309,315 ---- mach8InfoRec.chipset = "mach8"; x386ProbeFailed = FALSE; ! mach8DramUsed = (temp & 0x10) != 0; if (x386Verbose) { ErrorF("%s %s: (mem: %dk %cRAM numclocks: %d)", *************** *** 305,311 **** XCONFIG_GIVEN : XCONFIG_PROBED, mach8InfoRec.name, mach8InfoRec.videoRam, ! temp & 0x10 ? 'D' : 'V', mach8InfoRec.clocks); for (j=0; j < mach8InfoRec.clocks; j++) --- 317,323 ---- XCONFIG_GIVEN : XCONFIG_PROBED, mach8InfoRec.name, mach8InfoRec.videoRam, ! mach8DramUsed ? 'D' : 'V', mach8InfoRec.clocks); for (j=0; j < mach8InfoRec.clocks; j++) *************** *** 333,339 **** maxX = maxY = -1; pMode = pEnd = mach8InfoRec.modes; do { ! x386LookupMode(pMode, &mach8InfoRec, mach8InfoRec.name); if (pMode->HDisplay * pMode->VDisplay > memavail) { --- 345,351 ---- maxX = maxY = -1; pMode = pEnd = mach8InfoRec.modes; do { ! x386LookupMode(pMode, &mach8InfoRec); if (pMode->HDisplay * pMode->VDisplay > memavail) { *************** *** 363,370 **** if (mach8InfoRec.virtualX % rounding) { mach8InfoRec.virtualX -= mach8InfoRec.virtualX % rounding; ! ErrorF("%s: Virtual width rounded down to a multiple of %d (%d)\n", ! mach8InfoRec.name, rounding, mach8InfoRec.virtualX); if (mach8InfoRec.virtualX < maxX) { ErrorF( --- 375,383 ---- if (mach8InfoRec.virtualX % rounding) { mach8InfoRec.virtualX -= mach8InfoRec.virtualX % rounding; ! ErrorF("%s %s: Virtual width rounded down to a multiple of %d (%d)\n", ! XCONFIG_PROBED, mach8InfoRec.name, rounding, ! mach8InfoRec.virtualX); if (mach8InfoRec.virtualX < maxX) { ErrorF( *************** *** 381,387 **** ErrorF("%s: Virtual width must be no greater than 1024\n"); return(FALSE); } - if ( mach8InfoRec.virtualX * mach8InfoRec.virtualY > memavail) { if (mach8InfoRec.virtualX != maxX || mach8InfoRec.virtualY != maxY) --- 394,399 ---- *************** *** 425,430 **** --- 437,445 ---- int argc; /* The number of the Server's arguments. */ char **argv; /* The arguments themselves. Don't change! */ { + int displayResolution = 75; /* default to 75dpi */ + extern int monitorResolution; + /* * Convert from XFree mode definitions to Mach8 register values. */ *************** *** 431,448 **** mach8calcvmode(&mach8ScreenMode,mach8InfoRec.modes); mach8Init(&mach8ScreenMode); ! InitEnvironment(); AlreadyInited = TRUE; mach8CacheInit(); mach8FontCache8Init(); ! mach8ImageInit(); if (!mach8ScreenInit(pScreen, (pointer) 0, mach8InfoRec.virtualX, mach8InfoRec.virtualY, ! 75, 75, mach8InfoRec.virtualX)) return(FALSE); --- 446,481 ---- mach8calcvmode(&mach8ScreenMode,mach8InfoRec.modes); mach8Init(&mach8ScreenMode); ! mach8InitEnvironment(); AlreadyInited = TRUE; mach8CacheInit(); mach8FontCache8Init(); ! if( mach8DramUsed ) { ! mach8ImageWriteFunc = mach8ImageWriteDram; ! mach8ImageReadFunc = mach8ImageReadDram; ! mach8RealImageFillFunc = mach8RealImageFillDram; ! mach8ImageStippleFunc = mach8ImageStippleDram; ! } ! else { ! mach8ImageWriteFunc = mach8ImageWrite; ! mach8ImageReadFunc = mach8ImageRead; ! mach8RealImageFillFunc = mach8RealImageFill; ! mach8ImageStippleFunc = mach8ImageStipple; ! } mach8ImageInit(); + /* + * Take display resolution from the -dpi flag if specified + */ + + if (monitorResolution) + displayResolution = monitorResolution; + if (!mach8ScreenInit(pScreen, (pointer) 0, mach8InfoRec.virtualX, mach8InfoRec.virtualY, ! displayResolution, displayResolution, mach8InfoRec.virtualX)) return(FALSE); *************** *** 473,479 **** int screen_idx; { PixmapPtr pspix; - static PixmapPtr ppix = NULL; ScreenPtr pScreen = savepScreen; if (!x386Resetting && !x386Exiting) --- 506,511 ---- *************** *** 484,490 **** if (enter) { xf86EnableIOPorts(mach8InfoRec.scrnIndex); mach8Init(&mach8ScreenMode); ! InitEnvironment(); mach8RestoreDACvalues(); mach8CacheInit(); mach8FontCache8Init(); --- 516,522 ---- if (enter) { xf86EnableIOPorts(mach8InfoRec.scrnIndex); mach8Init(&mach8ScreenMode); ! mach8InitEnvironment(); mach8RestoreDACvalues(); mach8CacheInit(); mach8FontCache8Init(); *************** *** 495,504 **** if ((pointer)pspix->devPrivate.ptr != NULL && ppix) { pspix->devPrivate.ptr = NULL; ! mach8ImageWrite(0, 0, pScreen->width, pScreen->height, ! ppix->devPrivate.ptr, ! PixmapBytePad(pScreen->width, pScreen->rootDepth), ! 0, 0, mach8alu[GXcopy], 0xFF); } if (ppix) { --- 527,537 ---- if ((pointer)pspix->devPrivate.ptr != NULL && ppix) { pspix->devPrivate.ptr = NULL; ! (mach8ImageWriteFunc)(0, 0, pScreen->width, pScreen->height, ! ppix->devPrivate.ptr, ! PixmapBytePad(pScreen->width, ! pScreen->rootDepth), ! 0, 0, mach8alu[GXcopy], 0xFF); } if (ppix) { *************** *** 512,521 **** pScreen->height, pScreen->rootDepth); if (ppix) { ! mach8ImageRead(0, 0, pScreen->width, pScreen->height, ! ppix->devPrivate.ptr, ! PixmapBytePad(pScreen->width, pScreen->rootDepth), ! 0, 0); pspix->devPrivate.ptr = ppix->devPrivate.ptr; } } --- 545,555 ---- pScreen->height, pScreen->rootDepth); if (ppix) { ! (mach8ImageReadFunc)(0, 0, pScreen->width, pScreen->height, ! ppix->devPrivate.ptr, ! PixmapBytePad(pScreen->width, ! pScreen->rootDepth), ! 0, 0, 0xff); pspix->devPrivate.ptr = ppix->devPrivate.ptr; } } *************** *** 558,563 **** --- 592,605 ---- x386Exiting = TRUE; if (x386VTSema) mach8EnterLeaveVT(LEAVE, screen_idx); + else if (ppix) { + /* + * 7-Jan-94 CEG: The server is not running on the current vt. + * Free the screen snapshot taken when the server vt was left. + */ + (savepScreen->DestroyPixmap)(ppix); + ppix = NULL; + } return(TRUE); } *************** *** 606,612 **** * We adjust the CRT offset to pan the display. */ ! offset = (2 + x + mach8InfoRec.virtualX*y) >> 2; outw(CRT_OFFSET_HI, (offset >> 16) & 0xF); outw(CRT_OFFSET_LO, offset & 0xFFFF); --- 648,657 ---- * We adjust the CRT offset to pan the display. */ ! if( mach8InfoRec.videoRam > 512 ) ! offset = (2 + x + 1024*y) >> 2; ! else ! offset = (2 + x + mach8InfoRec.virtualX*y) >> 2; outw(CRT_OFFSET_HI, (offset >> 16) & 0xF); outw(CRT_OFFSET_LO, offset & 0xFFFF); diff -c mit/server/ddx/x386/accel/mach8/mach8.h:2.5 mit/server/ddx/x386/accel/mach8/mach8.h:2.10 *** mit/server/ddx/x386/accel/mach8/mach8.h:2.5 Fri Mar 11 23:37:26 1994 --- mit/server/ddx/x386/accel/mach8/mach8.h Fri Mar 11 23:37:26 1994 *************** *** 25,31 **** * and Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8.h,v 2.5 1993/09/23 15:44:24 dawes Exp $ */ #ifndef MACH8_H #define MACH8_H --- 25,31 ---- * and Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8.h,v 2.10 1994/02/01 13:51:26 dawes Exp $ */ #ifndef MACH8_H #define MACH8_H *************** *** 48,54 **** extern void mach8calcvmode(); extern void mach8Init(); ! extern void InitEnvironment(void); extern void mach8CleanUp(void); extern Bool mach8SaveScreen(); --- 48,55 ---- extern void mach8calcvmode(); extern void mach8Init(); ! extern Bool mach8ScreenInit(); ! extern void mach8InitEnvironment(); extern void mach8CleanUp(void); extern Bool mach8SaveScreen(); *************** *** 64,74 **** extern Bool mach8RealizeFont(); extern Bool mach8UnrealizeFont(); extern void mach8ImageRead(); extern void mach8ImageWrite(); ! extern void mach8ImageFill(); extern void mach8ImageStipple(); ! extern void mach8ImageOpStipple(); extern void mach8CacheInit(); extern void mach8FontCache8Init(); --- 65,80 ---- extern Bool mach8RealizeFont(); extern Bool mach8UnrealizeFont(); + extern void mach8ImageFill(); + extern void mach8ImageRead(); extern void mach8ImageWrite(); ! extern void mach8RealImageFill(); extern void mach8ImageStipple(); ! extern void mach8ImageReadDram(); ! extern void mach8ImageWriteDram(); ! extern void mach8RealImageFillDram(); ! extern void mach8ImageStippleDram(); extern void mach8CacheInit(); extern void mach8FontCache8Init(); *************** *** 82,88 **** extern void mach8CImageOpStipple(); extern void mach8CacheFreeSlot(); ! extern int mach8CacheFont8(); extern void mach8UnCacheFont8(); extern void mach8PolyPoint(); --- 88,94 ---- extern void mach8CImageOpStipple(); extern void mach8CacheFreeSlot(); ! extern void *mach8CacheFont8(); extern void mach8UnCacheFont8(); extern void mach8PolyPoint(); *************** *** 111,116 **** --- 117,123 ---- extern RegionPtr mach8CopyArea(); extern RegionPtr mach8CopyPlane(); extern void mach8CopyWindow(); + extern void mach8FindOrdering(); extern void mach8SaveAreas(); extern void mach8RestoreAreas(); *************** *** 117,126 **** --- 124,140 ---- extern Bool mach8CreateGC(); + extern void mach8GetImage(); + extern ScrnInfoRec mach8InfoRec; extern short mach8alu[]; extern int mach8ValidTokens[]; + + extern void (*mach8ImageWriteFunc)(); + extern void (*mach8ImageReadFunc)(); + extern void (*mach8RealImageFillFunc)(); + extern void (*mach8ImageStippleFunc)(); #endif /* MACH8_H */ diff -c mit/server/ddx/x386/accel/mach8/mach8blt.c:2.3 mit/server/ddx/x386/accel/mach8/mach8blt.c:2.8 *** mit/server/ddx/x386/accel/mach8/mach8blt.c:2.3 Fri Mar 11 23:37:26 1994 --- mit/server/ddx/x386/accel/mach8/mach8blt.c Fri Mar 11 23:37:27 1994 *************** *** 28,34 **** Further modifications by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8blt.c,v 2.3 1993/09/12 11:26:07 dawes Exp $ */ /* $XConsortium: cfbbitblt.c,v 5.39 91/05/24 16:33:25 keith Exp $ */ --- 28,34 ---- Further modifications by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8blt.c,v 2.8 1994/02/25 14:58:26 dawes Exp $ */ /* $XConsortium: cfbbitblt.c,v 5.39 91/05/24 16:33:25 keith Exp $ */ *************** *** 48,57 **** #include "regmach8.h" #include "mach8.h" ! void mach8FindOrdering(); - static unsigned long bitBltPlane = 0; - RegionPtr mach8CopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty) --- 48,55 ---- #include "regmach8.h" #include "mach8.h" ! extern RegionPtr cfbBitBlt(); RegionPtr mach8CopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty) *************** *** 354,362 **** unsigned char *pdst = ((PixmapPtr)pDstDrawable)->devPrivate.ptr; for (i = numRects; --i >= 0; pbox++) ! mach8ImageRead(pbox->x1 + dx, pbox->y1 + dy, ! pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, ! pdst, pixWidth, pbox->x1, pbox->y1); } else if (pSrcDrawable->type != DRAWABLE_WINDOW && pDstDrawable->type == DRAWABLE_WINDOW) { /* Pixmap --> Window */ int pixWidth = PixmapBytePad(pSrcDrawable->width, pSrcDrawable->depth); --- 352,360 ---- unsigned char *pdst = ((PixmapPtr)pDstDrawable)->devPrivate.ptr; for (i = numRects; --i >= 0; pbox++) ! (mach8ImageReadFunc)(pbox->x1 + dx, pbox->y1 + dy, ! pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, ! pdst, pixWidth, pbox->x1, pbox->y1, 0xff); } else if (pSrcDrawable->type != DRAWABLE_WINDOW && pDstDrawable->type == DRAWABLE_WINDOW) { /* Pixmap --> Window */ int pixWidth = PixmapBytePad(pSrcDrawable->width, pSrcDrawable->depth); *************** *** 363,372 **** unsigned char *psrc = ((PixmapPtr)pSrcDrawable)->devPrivate.ptr; for (i = numRects; --i >= 0; pbox++) ! mach8ImageWrite(pbox->x1, pbox->y1, ! pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, ! psrc, pixWidth, pbox->x1 + dx, pbox->y1 + dy, ! mach8alu[pGC->alu], pGC->planemask); } else { /* Pixmap --> Pixmap */ ErrorF("mach8CopyArea: Tried to do a Pixmap to Pixmap copy\n"); --- 361,371 ---- unsigned char *psrc = ((PixmapPtr)pSrcDrawable)->devPrivate.ptr; for (i = numRects; --i >= 0; pbox++) ! (mach8ImageWriteFunc)(pbox->x1, pbox->y1, ! pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, ! psrc, pixWidth, ! pbox->x1 + dx, pbox->y1 + dy, ! mach8alu[pGC->alu], pGC->planemask); } else { /* Pixmap --> Pixmap */ ErrorF("mach8CopyArea: Tried to do a Pixmap to Pixmap copy\n"); *************** *** 521,528 **** (void) cfbBitBlt(pSrcDrawable, (DrawablePtr)pBitmap, pGC1, srcx, srcy, width, height, 0, 0, cfbCopyPlane8to1, bitPlane); pSrcDrawable = (DrawablePtr)pBitmap; ! } ! else if (((pSrcDrawable->type == DRAWABLE_WINDOW) && (pDstDrawable->type != DRAWABLE_WINDOW)) || ((pSrcDrawable->type != DRAWABLE_WINDOW) && (pDstDrawable->type == DRAWABLE_WINDOW) && --- 520,552 ---- (void) cfbBitBlt(pSrcDrawable, (DrawablePtr)pBitmap, pGC1, srcx, srcy, width, height, 0, 0, cfbCopyPlane8to1, bitPlane); pSrcDrawable = (DrawablePtr)pBitmap; ! } else if ((pSrcDrawable->type == DRAWABLE_WINDOW) && ! (pDstDrawable->type != DRAWABLE_WINDOW)) { ! /* ! * Shortcut - we can do Window->Pixmap by copying the window to ! * a pixmap, then we have a Pixmap->Pixmap operation ! */ ! GCPtr pGC1; ! RegionPtr retval; ! PixmapPtr pPixmap; ! ! pPixmap=(*pSrcDrawable->pScreen->CreatePixmap)(pSrcDrawable->pScreen, ! width, height, 8); ! if (!pPixmap) ! return(NULL); ! pGC1 = GetScratchGC(8, pSrcDrawable->pScreen); ! if (!pGC1) { ! (*pSrcDrawable->pScreen->DestroyPixmap)(pPixmap); ! return(NULL); ! } ! ValidateGC((DrawablePtr)pPixmap, pGC1); ! mach8CopyArea(pSrcDrawable, pPixmap, pGC1, srcx, srcy, width, height, ! 0, 0); ! retval = cfbCopyPlane((DrawablePtr)pPixmap, pDstDrawable, pGC, ! 0, 0, width, height, dstx, dsty, bitPlane); ! (*pSrcDrawable->pScreen->DestroyPixmap)(pPixmap); ! return(retval); ! } else if (((pSrcDrawable->type == DRAWABLE_WINDOW) && (pDstDrawable->type != DRAWABLE_WINDOW)) || ((pSrcDrawable->type != DRAWABLE_WINDOW) && (pDstDrawable->type == DRAWABLE_WINDOW) && *************** *** 797,808 **** psrc = pix->devPrivate.ptr; for (i = numRects; --i >= 0; pbox++) { ! mach8ImageOpStipple(pbox->x1, pbox->y1, ! pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, ! psrc, pixWidth, ! pix->drawable.width, pix->drawable.height, ! -dx, -dy, pGC->fgPixel, pGC->bgPixel, ! mach8alu[pGC->alu], (short) pGC->planemask); } } else { /* Pixmap --> Pixmap */ --- 821,833 ---- psrc = pix->devPrivate.ptr; for (i = numRects; --i >= 0; pbox++) { ! (mach8ImageStippleFunc)(pbox->x1, pbox->y1, ! pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, ! psrc, pixWidth, ! pix->drawable.width, pix->drawable.height, ! -dx, -dy, pGC->fgPixel, pGC->bgPixel, ! mach8alu[pGC->alu], ! (short) pGC->planemask, 1); } } else { /* Pixmap --> Pixmap */ diff -c mit/server/ddx/x386/accel/mach8/mach8bstor.c:2.2 mit/server/ddx/x386/accel/mach8/mach8bstor.c:2.4 *** mit/server/ddx/x386/accel/mach8/mach8bstor.c:2.2 Fri Mar 11 23:37:27 1994 --- mit/server/ddx/x386/accel/mach8/mach8bstor.c Fri Mar 11 23:37:27 1994 *************** *** 27,33 **** * Further modifications by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8bstor.c,v 2.2 1993/08/17 16:15:28 dawes Exp $ */ #include "cfb.h" #include "X.h" --- 27,33 ---- * Further modifications by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8bstor.c,v 2.4 1994/02/01 13:51:29 dawes Exp $ */ #include "cfb.h" #include "X.h" *************** *** 62,71 **** pixWidth = PixmapBytePad(pPixmap->drawable.width, pPixmap->drawable.depth); while (i--) { ! mach8ImageRead(pBox->x1 + xorg, pBox->y1 + yorg, ! pBox->x2 - pBox->x1, pBox->y2 - pBox->y1, ! pPixmap->devPrivate.ptr, pixWidth, ! pBox->x1, pBox->y1); pBox++; } } --- 62,71 ---- pixWidth = PixmapBytePad(pPixmap->drawable.width, pPixmap->drawable.depth); while (i--) { ! (mach8ImageReadFunc)(pBox->x1 + xorg, pBox->y1 + yorg, ! pBox->x2 - pBox->x1, pBox->y2 - pBox->y1, ! pPixmap->devPrivate.ptr, pixWidth, ! pBox->x1, pBox->y1, 0xff); pBox++; } } *************** *** 94,104 **** pixWidth = PixmapBytePad(pPixmap->drawable.width, pPixmap->drawable.depth); while (i--) { ! mach8ImageWrite(pBox->x1, pBox->y1, ! pBox->x2 - pBox->x1, pBox->y2 - pBox->y1, ! pPixmap->devPrivate.ptr, pixWidth, ! pBox->x1 - xorg, pBox->y1 - yorg, ! mach8alu[GXcopy], 0xffffffff); pBox++; } } --- 94,104 ---- pixWidth = PixmapBytePad(pPixmap->drawable.width, pPixmap->drawable.depth); while (i--) { ! (mach8ImageWriteFunc)(pBox->x1, pBox->y1, ! pBox->x2 - pBox->x1, pBox->y2 - pBox->y1, ! pPixmap->devPrivate.ptr, pixWidth, ! pBox->x1 - xorg, pBox->y1 - yorg, ! mach8alu[GXcopy], 0xffffffff); pBox++; } } diff -c mit/server/ddx/x386/accel/mach8/mach8dsln.c:2.1 mit/server/ddx/x386/accel/mach8/mach8dsln.c:2.2 *** mit/server/ddx/x386/accel/mach8/mach8dsln.c:2.1 Fri Mar 11 23:37:28 1994 --- mit/server/ddx/x386/accel/mach8/mach8dsln.c Fri Mar 11 23:37:28 1994 *************** *** 26,32 **** ******************************************************************/ /* 17-sep-93 TCG: mach8dsln.c from ibm8514dsln.c */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8dsln.c,v 2.1 1993/10/18 12:17:18 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ --- 26,32 ---- ******************************************************************/ /* 17-sep-93 TCG: mach8dsln.c from ibm8514dsln.c */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8dsln.c,v 2.2 1993/12/25 13:58:47 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ *************** *** 105,112 **** unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - unsigned long *addrl; /* address of destination pixmap */ - int nlwidth; /* width in longwords of destination pixmap */ int xorg, yorg; /* origin of window */ int adx; /* abs values of dx and dy */ --- 105,110 ---- *************** *** 124,136 **** unsigned char *pDash; Bool dashupdated; /* a bunch of temporaries */ - int tmp; register int y1, y2; register int x1, x2; RegionPtr cclip; cfbPrivGCPtr devPriv; - unsigned long xor, and; - int alu; /* 4-5-93 TCG : is VT visible */ if (!x386VTSema) --- 122,131 ---- diff -c mit/server/ddx/x386/accel/mach8/mach8dssg.c:2.1 mit/server/ddx/x386/accel/mach8/mach8dssg.c:2.2 *** mit/server/ddx/x386/accel/mach8/mach8dssg.c:2.1 Fri Mar 11 23:37:29 1994 --- mit/server/ddx/x386/accel/mach8/mach8dssg.c Fri Mar 11 23:37:29 1994 *************** *** 26,32 **** ******************************************************************/ /* 18-sep-93 TCG: mach8dssg.c from ibm8514dssg.c */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8dssg.c,v 2.1 1993/10/18 12:17:19 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ --- 26,32 ---- ******************************************************************/ /* 18-sep-93 TCG: mach8dssg.c from ibm8514dssg.c */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8dssg.c,v 2.2 1993/12/25 13:58:49 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ *************** *** 103,110 **** unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - unsigned long *addrl; /* address of destination pixmap */ - int nlwidth; /* width in longwords of destination pixmap */ int xorg, yorg; /* origin of window */ int adx; /* abs values of dx and dy */ --- 103,108 ---- *************** *** 121,133 **** int dash0len, dashidx, dashstartidx, dashnum, dashrem; unsigned char *pDash; /* a bunch of temporaries */ - int tmp; register int y1, y2; register int x1, x2; RegionPtr cclip; cfbPrivGCPtr devPriv; - unsigned long xor, and; - int alu; /* 4-5-93 TCG : is VT visible */ if (!x386VTSema) --- 119,128 ---- diff -c mit/server/ddx/x386/accel/mach8/mach8fcach.c:2.7 mit/server/ddx/x386/accel/mach8/mach8fcach.c:2.17 *** mit/server/ddx/x386/accel/mach8/mach8fcach.c:2.7 Fri Mar 11 23:37:30 1994 --- mit/server/ddx/x386/accel/mach8/mach8fcach.c Fri Mar 11 23:37:30 1994 *************** *** 20,28 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Modified for the Mach-8 by Rickard E. Faith (faith@cs.unc.edu) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8fcach.c,v 2.7 1993/10/04 05:13:42 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 20,34 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Modified for the Mach-8 by Rickard E. Faith (faith@cs.unc.edu) + * + * Modified to use a dynamic font cache. + * Accelerated text display when no font cache is available added. + * Now using a linked list to store the CacheFont8Rec structs instead + * of a pointer array. + * Hans Nasten. (nasten@everyware.se) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8fcach.c,v 2.17 1994/02/12 11:05:43 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 40,60 **** #include "xf86_Config.h" extern Bool x386Verbose; ! #define NUM_FONTS 8 ! #define FC_MAX_WIDTH 24 ! #define FC_MAX_HEIGHT 32 ! typedef struct { FontPtr font; ! unsigned int lru; CharInfoPtr pci[256]; } CacheFont8Rec; ! CacheFont8Rec mach8FontCache[NUM_FONTS]; ! int mach8FC_X, mach8FC_Y; ! int mach8FC_H, mach8FC_W; short mach8ReadMask[8] = { 2, 4, 8, 16, 32, 64, 128, 1 }; /* * mach8FontCache8Init -- * initialize Mach8 font cache. We need to set the mach8FC* --- 46,196 ---- #include "xf86_Config.h" extern Bool x386Verbose; ! extern void QueryGlyphExtents(); ! #define CACHECELL_WIDTH 48 ! #define CACHECELL_HEIGHT 51 ! #define FC_MAX_WIDTH CACHECELL_WIDTH/2 ! #define FC_MAX_HEIGHT CACHECELL_HEIGHT ! ! struct cachecell { ! struct cachecell *next; ! unsigned short x; ! unsigned short y; ! unsigned short plane; ! }; ! ! struct font_pos { ! unsigned short x; ! unsigned short y; ! unsigned short planemask; ! }; ! ! typedef struct CFRec{ ! struct CFRec *next; FontPtr font; ! struct cachecell *cells; ! struct font_pos pos[256]; CharInfoPtr pci[256]; } CacheFont8Rec; ! CacheFont8Rec *mach8FontCache; short mach8ReadMask[8] = { 2, 4, 8, 16, 32, 64, 128, 1 }; + int mach8FCacheInit = 0; + struct cachecell *mach8CacheFreeList; + int mach8FreeCacheCells; + int mach8TotalCacheCells; + int mach8NumberOfCachedFonts; + + /* + * mach8FreeCellChain + * Add a linked list of cell structs to the front of the free list. + */ + + void + mach8FreeCellChain( chain ) + struct cachecell *chain; + + { + struct cachecell *lastlink; + int n_cells; + + if( chain != NULL ) { + n_cells = 1; + for( lastlink = chain; + lastlink->next != NULL; + lastlink = lastlink->next ) + n_cells++; + + lastlink->next = mach8CacheFreeList; + mach8CacheFreeList = chain; + mach8FreeCacheCells += n_cells; + } + } + + + /* + * mach8AllocCellChain + * Allocate a linked list of cell structs from the front of the free list. + */ + + struct cachecell * + mach8AllocCellChain( n_cells ) + int n_cells; + + { + struct cachecell *cellpnt, *retpnt; + int nc; + + if( mach8FreeCacheCells < n_cells ) + return( NULL ); + + nc = n_cells; + retpnt = cellpnt = mach8CacheFreeList; + while( --nc > 0 ) { + if( cellpnt == NULL ) + ErrorF( "Severe cache panic. Reached NULL with n_cells > 0\n" ); + + cellpnt = cellpnt->next; + } + + mach8CacheFreeList = cellpnt->next; + cellpnt->next = NULL; + mach8FreeCacheCells -= n_cells; + return( retpnt ); + + } + + + /* + * mach8AddCacheArea + * Add the specified screen memory to the cache free list. + */ + + void + mach8AddCacheArea( x, y, width, height ) + int x, y, width, height; + { + struct cachecell *chain, *lastcell, *newcell; + int h, w, x2, y2; + unsigned short bitplane; + + chain = lastcell = NULL; + for( bitplane = 0; bitplane < 8; bitplane++ ) { + y2 = y; + h = height; + while( h >= CACHECELL_HEIGHT ) { + x2 = x; + w = width; + while( w >= CACHECELL_WIDTH ) { + if( ( newcell = (struct cachecell *) + (Xalloc( sizeof( struct cachecell ))) ) == NULL ) { + ErrorF("Out of memory when Xallocing cache cell structs\n"); + return; + } + newcell->plane = bitplane; + newcell->x = x2; + newcell->y = y2; + newcell->next = NULL; + if( lastcell == NULL ) + chain = lastcell = newcell; + else { + lastcell->next = newcell; + lastcell = newcell; + } + x2 += CACHECELL_WIDTH; + w -= CACHECELL_WIDTH; + } + y2 += CACHECELL_HEIGHT; + h -= CACHECELL_HEIGHT; + } + } + if( chain != NULL ) + mach8FreeCellChain( chain ); + + } + /* * mach8FontCache8Init -- * initialize Mach8 font cache. We need to set the mach8FC* *************** *** 65,97 **** void mach8FontCache8Init() { ! int i; ! int totalx,totaly,freey,freex; ! totalx=mach8InfoRec.virtualX; ! totaly=(mach8InfoRec.videoRam*1024) / totalx; ! ! if (totaly>2048) totaly=2048; ! ! freex=mach8InfoRec.virtualX; ! freey=totaly-mach8InfoRec.virtualY; ! ! ! mach8FC_X = mach8InfoRec.virtualX>>2; ! mach8FC_Y = mach8InfoRec.virtualY; - mach8FC_H = freey>>3; if(mach8FC_H > 32) mach8FC_H=32; - mach8FC_W = (freex-mach8FC_X)>>5; - if (x386Verbose) - ErrorF("%s %s: fontcache room for %d fonts of %dx%d\n", XCONFIG_PROBED, - mach8InfoRec.name, NUM_FONTS, mach8FC_W, mach8FC_H); - - for (i = 0; i < NUM_FONTS; i++) { - mach8FontCache[i].font = (FontPtr)0; - mach8FontCache[i].lru = 0xffffffff; - } } void --- 201,253 ---- void mach8FontCache8Init() { ! int totaly; ! int first = 1; ! CacheFont8Rec *fpnt, *fpnt2; ! /* ! * If this is a call due to a VT switch, uncache all fonts. ! * I belive this is needed at least when someone starts 2 servers ! * on different VT:s. ! */ ! if( mach8FCacheInit ) { ! for (fpnt = mach8FontCache; fpnt != NULL; fpnt = fpnt2) { ! fpnt2 = fpnt->next; ! Xfree( fpnt ); ! first = 0; ! } ! } ! mach8FCacheInit = 1; ! mach8FontCache = NULL; ! mach8CacheFreeList = NULL; ! mach8FreeCacheCells = 0; ! mach8NumberOfCachedFonts = 0; ! totaly=(mach8InfoRec.videoRam*1024) / mach8InfoRec.virtualX; ! if( totaly > 1024 ) ! totaly = 1024; ! if( mach8InfoRec.videoRam > 512 ) { ! mach8AddCacheArea( 256, mach8InfoRec.virtualY, 768, ! 1024-mach8InfoRec.virtualY > 256 ? 256 : ! 1024-mach8InfoRec.virtualY); ! if( mach8InfoRec.virtualX < 1024 ) ! mach8AddCacheArea( mach8InfoRec.virtualX, 0, ! 1024-mach8InfoRec.virtualX, ! mach8InfoRec.virtualY ); ! } ! else { ! mach8AddCacheArea( 256, mach8InfoRec.virtualY, ! mach8InfoRec.virtualX-256, ! totaly-mach8InfoRec.virtualY > 256 ? 256 : ! totaly-mach8InfoRec.virtualY); ! } ! mach8TotalCacheCells = mach8FreeCacheCells; ! if( x386Verbose && first ) ! ErrorF( "%s %s: Total number of font cache cells (%dx%d) %d\n", ! XCONFIG_PROBED, mach8InfoRec.name, ! CACHECELL_WIDTH, CACHECELL_HEIGHT, mach8FreeCacheCells ); } void *************** *** 99,119 **** FontPtr font; { int i; ! for (i = 0; i < NUM_FONTS; i++) ! if (mach8FontCache[i].font == font) { ! mach8FontCache[i].font = (FontPtr)0; ! mach8FontCache[i].lru = 0xffffffff; ! return; } } ! int mach8CacheFont8(font) FontPtr font; { int i, j, c; - int ret = -1; unsigned long n; unsigned char chr; int width, height; --- 255,292 ---- FontPtr font; { int i; + CacheFont8Rec *fpnt, *fpnt2; ! if( mach8FontCache != NULL ) { ! fpnt = mach8FontCache; ! if( fpnt->font == font ) { ! mach8FontCache = fpnt->next; ! mach8FreeCellChain( fpnt->cells ); ! Xfree( fpnt ); ! mach8NumberOfCachedFonts--; ! } ! else { ! while( fpnt->next != NULL ) { ! fpnt2 = fpnt->next; ! if (fpnt2->font == font) { ! fpnt->next = fpnt2->next; ! mach8FreeCellChain( fpnt2->cells ); ! Xfree( fpnt2 ); ! mach8NumberOfCachedFonts--; ! break; ! } ! fpnt = fpnt2; ! } } + } + } ! void * mach8CacheFont8(font) FontPtr font; { int i, j, c; unsigned long n; unsigned char chr; int width, height; *************** *** 124,162 **** int gWidth, gHeight; int nbyGlyphWidth; int nbyPadGlyph; - for (i = 0; i < NUM_FONTS; i++) - if (mach8FontCache[i].font == font) - ret = i; width = FONTMAXBOUNDS(font,rightSideBearing) - FONTMINBOUNDS(font,leftSideBearing); height = FONTMAXBOUNDS(font,ascent) + FONTMAXBOUNDS(font,descent); ! ! if ((ret == -1) && (width <= mach8FC_W) && (height <= mach8FC_H) && (FONTFIRSTROW(font) == 0) && (FONTLASTROW(font) == 0) && (FONTLASTCOL(font) < 256)) { - ret = 0; - for (i = 1; i < NUM_FONTS; i++) - if (mach8FontCache[i].lru > mach8FontCache[ret].lru) - ret = i; - nbyLine = PixmapBytePad(width, 1); pbits = (unsigned char *)ALLOCATE_LOCAL(height*nbyLine); ! if (!pbits) { ! return -1; ! } ! ! mach8FontCache[ret].font = font; ! mach8FontCache[ret].lru = 0; for (c = 0; c < 256; c++) { chr = (unsigned char)c; GetGlyphs(font, 1, &chr, Linear8Bit, &n, &pci); if (n == 0) { ! mach8FontCache[ret].pci[c] = NULL; } else { ! mach8FontCache[ret].pci[c] = pci; pglyph = FONTGLYPHBITS(pglyphBase, pci); gWidth = GLYPHWIDTHPIXELS(pci); gHeight = GLYPHHEIGHTPIXELS(pci); --- 297,378 ---- int gWidth, gHeight; int nbyGlyphWidth; int nbyPadGlyph; + struct cachecell *cell; + int glyphs_cell, n_cells; + int cell_x, cell_y, cell_width, cell_height; + CacheFont8Rec *fpnt; + for (fpnt = mach8FontCache; fpnt != NULL; fpnt = fpnt->next) { + if( fpnt->font == font ) + return( (void *)(fpnt) ); + } width = FONTMAXBOUNDS(font,rightSideBearing) - FONTMINBOUNDS(font,leftSideBearing); height = FONTMAXBOUNDS(font,ascent) + FONTMAXBOUNDS(font,descent); ! fpnt = NULL; ! if ((width <= FC_MAX_WIDTH) && (height <= FC_MAX_HEIGHT) && (FONTFIRSTROW(font) == 0) && (FONTLASTROW(font) == 0) && (FONTLASTCOL(font) < 256)) { nbyLine = PixmapBytePad(width, 1); pbits = (unsigned char *)ALLOCATE_LOCAL(height*nbyLine); ! if (!pbits) ! return( NULL ); + glyphs_cell = (CACHECELL_WIDTH/width)*(CACHECELL_HEIGHT/height); + n_cells = 256 / glyphs_cell; + if( ( 256 % glyphs_cell ) != 0 ) + n_cells++; + + /* + * Free old fonts until enough cache cells are available. + */ + while( ( cell = mach8AllocCellChain(n_cells) ) == NULL ) { + if( mach8FontCache == NULL ) { + DEALLOCATE_LOCAL(pbits); + return( NULL ); /* No fonts cached and no cache cells free. */ + } + /* + * Find oldest cached font. ( last in linked list ). + */ + for( fpnt = mach8FontCache; fpnt->next != NULL; fpnt = fpnt->next ) + ; + + /* + * Uncache oldest cached font. + */ + mach8UnCacheFont8( fpnt->font ); + } + /* + * Allocate a font cache record and link it first in the chain. + */ + if( ( fpnt = (CacheFont8Rec *) + (Xalloc( sizeof(CacheFont8Rec)))) == NULL ) { + DEALLOCATE_LOCAL(pbits); + return( NULL ); + } + fpnt->next = mach8FontCache; + mach8FontCache = fpnt; + mach8NumberOfCachedFonts++; + + /* + * Now we cache the font. + */ + fpnt->cells = cell; + fpnt->font = font; + cell_x = cell_y = 0; + cell_width = CACHECELL_WIDTH; + cell_height = CACHECELL_HEIGHT; for (c = 0; c < 256; c++) { + fpnt->pos[c].x = cell->x + cell_x; + fpnt->pos[c].y = cell->y + cell_y; + fpnt->pos[c].planemask = mach8ReadMask[cell->plane]; chr = (unsigned char)c; GetGlyphs(font, 1, &chr, Linear8Bit, &n, &pci); if (n == 0) { ! fpnt->pci[c] = NULL; } else { ! fpnt->pci[c] = pci; pglyph = FONTGLYPHBITS(pglyphBase, pci); gWidth = GLYPHWIDTHPIXELS(pci); gHeight = GLYPHHEIGHTPIXELS(pci); *************** *** 178,201 **** *pb++ = *pglyph++; pb = pbits; } ! mach8ImageOpStipple(mach8FC_X+(c%32)*mach8FC_W, ! mach8FC_Y+(c/32)*mach8FC_H, ! gWidth, gHeight, ! pb, nbyGlyphWidth, gWidth, gHeight, ! mach8FC_X+(c%32)*mach8FC_W, ! mach8FC_Y+(c/32)*mach8FC_H, ! 0xff, 0, mach8alu[GXcopy], ! (1 << ret)); } } } } ! ! return ret; } int ! mach8CPolyText8(pDraw, pGC, x, y, count, chars, plane) DrawablePtr pDraw; GCPtr pGC; int x; --- 394,440 ---- *pb++ = *pglyph++; pb = pbits; } ! (mach8ImageStippleFunc)(cell->x + cell_x, ! cell->y + cell_y, ! gWidth, gHeight, ! pb, nbyGlyphWidth, gWidth, gHeight, ! cell->x + cell_x, ! cell->y + cell_y, ! 0xff, 0, mach8alu[GXcopy], ! (1 << cell->plane), 1); } } + /* + * Advance the cache cell pointers from left to right, + * top to bottom, cell by cell. + */ + cell_x += width; + cell_width -= width; + if( cell_width < width ) { + /* + * At right edge. Try to put another row below this one. + */ + cell_width = CACHECELL_WIDTH; + cell_x = 0; + cell_y += height; + cell_height -= height; + if( cell_height < height ) { + /* + * Use next cache cell. + */ + cell_height = CACHECELL_HEIGHT; + cell_y = 0; + cell = cell->next; + } + } } + DEALLOCATE_LOCAL(pbits); } ! return( (void *)(fpnt) ); } int ! mach8CPolyText8(pDraw, pGC, x, y, count, chars, vpnt) DrawablePtr pDraw; GCPtr pGC; int x; *************** *** 202,208 **** int y; int count; unsigned char *chars; ! int plane; { int i; BoxPtr pBox; --- 441,447 ---- int y; int count; unsigned char *chars; ! void *vpnt; { int i; BoxPtr pBox; *************** *** 213,222 **** int minLeftBearing; FontPtr pfont = pGC->font; int xorig; ! CharInfoPtr pci; ! CacheFont8Rec *mach8FCP = &(mach8FontCache[plane]); int ret_x; /* * If miPolyText8() is to be believed, the returned new X value is * completely independent of what happens during rendering. --- 452,466 ---- int minLeftBearing; FontPtr pfont = pGC->font; int xorig; ! CacheFont8Rec *mach8FCP = (CacheFont8Rec *)(vpnt); ! CacheFont8Rec *fpnt; int ret_x; + CharInfoPtr pci; + int ci; + struct font_pos *pos; + unsigned short pmsk, width, height, gwidth, gheight; + /* * If miPolyText8() is to be believed, the returned new X value is * completely independent of what happens during rendering. *************** *** 226,235 **** ret_x += mach8FCP->pci[(int)chars[i]] ? mach8FCP->pci[(int)chars[i]]->metrics.characterWidth : 0; ! for (i = 0; i < NUM_FONTS; i++) ! if (i != plane && mach8FontCache[i].lru != 0xffffffff) ! mach8FontCache[i].lru++; ! x += pDraw->x; y += pDraw->y; --- 470,485 ---- ret_x += mach8FCP->pci[(int)chars[i]] ? mach8FCP->pci[(int)chars[i]]->metrics.characterWidth : 0; ! /* ! * Make sure this font is first in the linked list. ! */ ! if( mach8FCP != mach8FontCache ) { ! for( fpnt = mach8FontCache; fpnt->next != mach8FCP; fpnt = fpnt->next ) ! ; ! fpnt->next = mach8FCP->next; ! mach8FCP->next = mach8FontCache; ! mach8FontCache = mach8FCP; ! } x += pDraw->x; y += pDraw->y; *************** *** 257,270 **** if (!numRects) return ret_x; ! WaitQueue(6); outw(FRGD_COLOR, (short)pGC->fgPixel); outw(MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_EXPBLT | COLCMPOP_F); - outw(RD_MASK, mach8ReadMask[plane]); outw(FRGD_MIX, FSS_FRGDCOL | mach8alu[pGC->alu]); outw(BKGD_MIX, BSS_BKGDCOL | MIX_DST); outw(WRT_MASK, (short)pGC->planemask); - for (xorig = x; --numRects >= 0; ++pBox, x = xorig) { WaitQueue(4); outw(MULTIFUNC_CNTL, SCISSORS_L | (short)pBox->x1); --- 507,518 ---- if (!numRects) return ret_x; ! WaitQueue(5); outw(FRGD_COLOR, (short)pGC->fgPixel); outw(MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_EXPBLT | COLCMPOP_F); outw(FRGD_MIX, FSS_FRGDCOL | mach8alu[pGC->alu]); outw(BKGD_MIX, BSS_BKGDCOL | MIX_DST); outw(WRT_MASK, (short)pGC->planemask); for (xorig = x; --numRects >= 0; ++pBox, x = xorig) { WaitQueue(4); outw(MULTIFUNC_CNTL, SCISSORS_L | (short)pBox->x1); *************** *** 271,292 **** outw(MULTIFUNC_CNTL, SCISSORS_T | (short)pBox->y1); outw(MULTIFUNC_CNTL, SCISSORS_R | (short)(pBox->x2-1)); outw(MULTIFUNC_CNTL, SCISSORS_B | (short)(pBox->y2-1)); ! for (i = 0; i < count; i++) { ! pci = mach8FCP->pci[(int)chars[i]]; ! if (pci != NULL) { ! if (GLYPHHEIGHTPIXELS(pci) && GLYPHWIDTHPIXELS(pci)) ! { ! WaitQueue(7); ! outw(CUR_X, (short)(mach8FC_X+(((int)chars[i])%32)*mach8FC_W)); ! outw(CUR_Y, (short)(mach8FC_Y+(((int)chars[i])/32)*mach8FC_H)); outw(DESTX_DIASTP, (short)(x + pci->metrics.leftSideBearing)); outw(DESTY_AXSTP, (short)(y - pci->metrics.ascent)); ! outw(MAJ_AXIS_PCNT, (short)(GLYPHWIDTHPIXELS(pci)-1)); ! outw(MULTIFUNC_CNTL, MIN_AXIS_PCNT | ! (short)(GLYPHHEIGHTPIXELS(pci)-1)); ! outw(CMD, CMD_BITBLT | INC_X | INC_Y | DRAW | PLANAR | WRTDATA); } x += pci->metrics.characterWidth; } --- 519,553 ---- outw(MULTIFUNC_CNTL, SCISSORS_T | (short)pBox->y1); outw(MULTIFUNC_CNTL, SCISSORS_R | (short)(pBox->x2-1)); outw(MULTIFUNC_CNTL, SCISSORS_B | (short)(pBox->y2-1)); ! pmsk = width = height = 0; for (i = 0; i < count; i++) { ! ci = (int)(chars[i]); ! pci = mach8FCP->pci[ci]; ! pos = &mach8FCP->pos[ci]; if (pci != NULL) { ! if( ( gheight = (short)(GLYPHHEIGHTPIXELS(pci)) ) ! && ( gwidth = (short)(GLYPHWIDTHPIXELS(pci)) ) ) { ! gheight--; ! gwidth--; ! WaitQueue(8); ! if( !pmsk || pmsk != pos->planemask ) { ! pmsk = pos->planemask; ! outw(RD_MASK, pmsk); ! } ! outw(CUR_X, pos->x); ! outw(CUR_Y, pos->y); outw(DESTX_DIASTP, (short)(x + pci->metrics.leftSideBearing)); outw(DESTY_AXSTP, (short)(y - pci->metrics.ascent)); ! if( !width || width != gwidth ) { ! width = gwidth; ! outw(MAJ_AXIS_PCNT, width); ! } ! if( !height || height != gheight ){ ! height = gheight; ! outw(MULTIFUNC_CNTL, MIN_AXIS_PCNT | height); ! } ! outw(CMD, ! CMD_BITBLT | INC_X | INC_Y | DRAW | PLANAR | WRTDATA); } x += pci->metrics.characterWidth; } *************** *** 308,314 **** void ! mach8CImageText8(pDraw, pGC, x, y, count, chars, plane) DrawablePtr pDraw; GCPtr pGC; int x; --- 569,701 ---- void ! mach8AccPolyText8(pDraw, pGC, x, y, count, chars) ! DrawablePtr pDraw; ! GCPtr pGC; ! int x, y; ! int count; ! char *chars; ! { ! int i, j; ! FontPtr font = pGC->font; ! unsigned long n; ! int nbyLine; ! unsigned char *pb, *pbits; ! CharInfoPtr pci; ! unsigned char *pglyph; ! int gWidth, gHeight; ! int nbyGlyphWidth; ! int nbyPadGlyph; ! int maxAscent, maxDescent; ! int minLeftBearing; ! BoxPtr pBox; ! int numRects; ! RegionPtr pRegion; ! int yBand; ! int xorig; ! int clipx, clipy, clipw, cliph, xoff, yoff; ! ! ! gWidth = FONTMAXBOUNDS(font,rightSideBearing) - ! FONTMINBOUNDS(font,leftSideBearing); ! gHeight = FONTMAXBOUNDS(font,ascent) + FONTMAXBOUNDS(font,descent); ! nbyLine = PixmapBytePad(gWidth, 1); ! pbits = (unsigned char *)ALLOCATE_LOCAL(gHeight*nbyLine); ! if (!pbits) ! return; ! ! x += pDraw->x; ! y += pDraw->y; ! ! maxAscent = FONTMAXBOUNDS(font,ascent); ! maxDescent = FONTMAXBOUNDS(font,descent); ! minLeftBearing = FONTMINBOUNDS(font,leftSideBearing); ! ! pRegion = ((cfbPrivGC *)(pGC->devPrivates[cfbGCPrivateIndex].ptr))->pCompositeClip; ! ! pBox = REGION_RECTS(pRegion); ! numRects = REGION_NUM_RECTS (pRegion); ! while (numRects && pBox->y2 <= y - maxAscent) ! { ! ++pBox; ! --numRects; ! } ! if (!numRects || pBox->y1 >= y + maxDescent) { ! DEALLOCATE_LOCAL(pbits); ! return; ! } ! yBand = pBox->y1; ! while (numRects && pBox->y1 == yBand && pBox->x2 <= x + minLeftBearing) ! { ! ++pBox; ! --numRects; ! } ! if (!numRects) { ! DEALLOCATE_LOCAL(pbits); ! return; ! } ! for (xorig = x; --numRects >= 0; ++pBox, x = xorig) { ! for (i = 0; i < count; i++) { ! GetGlyphs(font, 1, &chars[i], Linear8Bit, &n, &pci); ! if (n != 0) { ! pglyph = FONTGLYPHBITS(pglyphBase, pci); ! gWidth = GLYPHWIDTHPIXELS(pci); ! gHeight = GLYPHHEIGHTPIXELS(pci); ! clipx = x + pci->metrics.leftSideBearing; ! clipy = y - pci->metrics.ascent; ! if( gWidth && gHeight ! && clipx + gWidth > pBox->x1 && clipx < pBox->x2 ! && clipy + gHeight > pBox->y1 && clipy < pBox->y2 ) { ! xoff = ( clipx < pBox->x1 ? pBox->x1 - clipx : 0 ); ! if( clipx + gWidth > pBox->x2 ) ! clipw = gWidth - xoff - ((clipx + gWidth) - pBox->x2); ! else ! clipw = gWidth - xoff; ! ! yoff = ( clipy < pBox->y1 ? pBox->y1 - clipy : 0 ); ! if( clipy + gHeight > pBox->y2 ) ! cliph = gHeight-yoff - ((clipy + gHeight) - pBox->y2); ! else ! cliph = gHeight - yoff; ! ! nbyGlyphWidth = GLYPHWIDTHBYTESPADDED(pci); ! nbyPadGlyph = PixmapBytePad(gWidth, 1); ! ! if (nbyGlyphWidth == nbyPadGlyph ! #if GLYPHPADBYTES != 4 ! && (((int) pglyph) & 3) == 0 ! #endif ! ) { ! pb = pglyph; ! } else { ! for (i = 0, pb = pbits; ! i < gHeight; ! i++, pb = pbits+(i*nbyPadGlyph)) ! for (j = 0; j < nbyGlyphWidth; j++) ! *pb++ = *pglyph++; ! pb = pbits; ! } ! (mach8ImageStippleFunc)( clipx + xoff, ! clipy + yoff, ! clipw, cliph, ! pb, nbyGlyphWidth, ! gWidth, gHeight, ! clipx, clipy, ! pGC->fgPixel, pGC->bgPixel, ! mach8alu[pGC->alu], ! pGC->planemask, 1); ! } ! x += pci->metrics.characterWidth; ! } ! } ! } ! DEALLOCATE_LOCAL(pbits); ! ! } ! ! ! void ! mach8CImageText8(pDraw, pGC, x, y, count, chars, vpnt) DrawablePtr pDraw; GCPtr pGC; int x; *************** *** 315,321 **** int y; int count; unsigned char *chars; ! int plane; { ExtentInfoRec info; /* used by QueryGlyphExtents() */ XID gcvals[3]; --- 702,708 ---- int y; int count; unsigned char *chars; ! void *vpnt; { ExtentInfoRec info; /* used by QueryGlyphExtents() */ XID gcvals[3]; *************** *** 364,370 **** gcvals[0] = oldFG; DoChangeGC(pGC, GCForeground, gcvals, 0); ValidateGC(pDraw, pGC); ! (void)mach8CPolyText8(pDraw, pGC, x, y, count, chars, plane); /* put all the toys away when done playing */ gcvals[0] = oldAlu; --- 751,760 ---- gcvals[0] = oldFG; DoChangeGC(pGC, GCForeground, gcvals, 0); ValidateGC(pDraw, pGC); ! if( vpnt == NULL ) ! mach8AccPolyText8(pDraw, pGC, x, y, count, chars ); ! else ! (void)mach8CPolyText8(pDraw, pGC, x, y, count, chars, vpnt); /* put all the toys away when done playing */ gcvals[0] = oldAlu; diff -c mit/server/ddx/x386/accel/mach8/mach8frect.c:2.3 mit/server/ddx/x386/accel/mach8/mach8frect.c:2.5 *** mit/server/ddx/x386/accel/mach8/mach8frect.c:2.3 Fri Mar 11 23:37:32 1994 --- mit/server/ddx/x386/accel/mach8/mach8frect.c Fri Mar 11 23:37:32 1994 *************** *** 31,37 **** */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8frect.c,v 2.3 1993/08/28 07:51:11 dawes Exp $ */ /* $XConsortium: cfbfillrct.c,v 5.13 90/05/15 18:40:19 keith Exp $ */ --- 31,37 ---- */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8frect.c,v 2.5 1994/02/01 13:51:32 dawes Exp $ */ /* $XConsortium: cfbfillrct.c,v 5.13 90/05/15 18:40:19 keith Exp $ */ *************** *** 299,322 **** mach8alu[pGC->alu], pGC->planemask); else ! mach8ImageStipple(pboxClipped->x1, pboxClipped->y1, ! w, h, ! pPix->devPrivate.ptr, pixWidth, ! width, height, xrot, yrot, ! pGC->fgPixel, ! mach8alu[pGC->alu], ! pGC->planemask); pboxClipped++; } } else { while (n--) { ! mach8ImageStipple(pboxClipped->x1, pboxClipped->y1, ! pboxClipped->x2 - pboxClipped->x1, ! pboxClipped->y2 - pboxClipped->y1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, xrot, yrot, ! pGC->fgPixel, ! mach8alu[pGC->alu], pGC->planemask); pboxClipped++; } } --- 299,324 ---- mach8alu[pGC->alu], pGC->planemask); else ! (mach8ImageStippleFunc)(pboxClipped->x1, ! pboxClipped->y1, ! w, h, ! pPix->devPrivate.ptr, pixWidth, ! width, height, xrot, yrot, ! pGC->fgPixel, 0, ! mach8alu[pGC->alu], ! pGC->planemask, 0); pboxClipped++; } } else { while (n--) { ! (mach8ImageStippleFunc)(pboxClipped->x1, pboxClipped->y1, ! pboxClipped->x2 - pboxClipped->x1, ! pboxClipped->y2 - pboxClipped->y1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, xrot, yrot, ! pGC->fgPixel, 0, ! mach8alu[pGC->alu], ! pGC->planemask, 0); pboxClipped++; } } *************** *** 345,370 **** mach8alu[pGC->alu], pGC->planemask); else ! mach8ImageOpStipple(pboxClipped->x1, pboxClipped->y1, ! w, h, ! pPix->devPrivate.ptr, pixWidth, ! width, height, ! xrot, yrot, ! pGC->fgPixel, pGC->bgPixel, ! mach8alu[pGC->alu], ! pGC->planemask); pboxClipped++; } } else { while (n--) { ! mach8ImageOpStipple(pboxClipped->x1, pboxClipped->y1, ! pboxClipped->x2 - pboxClipped->x1, ! pboxClipped->y2 - pboxClipped->y1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, xrot, yrot, ! pGC->fgPixel, pGC->bgPixel, ! mach8alu[pGC->alu], ! pGC->planemask); pboxClipped++; } } --- 347,373 ---- mach8alu[pGC->alu], pGC->planemask); else ! (mach8ImageStippleFunc)(pboxClipped->x1, ! pboxClipped->y1, ! w, h, ! pPix->devPrivate.ptr, pixWidth, ! width, height, ! xrot, yrot, ! pGC->fgPixel, pGC->bgPixel, ! mach8alu[pGC->alu], ! pGC->planemask, 1); pboxClipped++; } } else { while (n--) { ! (mach8ImageStippleFunc)(pboxClipped->x1, pboxClipped->y1, ! pboxClipped->x2 - pboxClipped->x1, ! pboxClipped->y2 - pboxClipped->y1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, xrot, yrot, ! pGC->fgPixel, pGC->bgPixel, ! mach8alu[pGC->alu], ! pGC->planemask, 1); pboxClipped++; } } diff -c mit/server/ddx/x386/accel/mach8/mach8fs.c:2.3 mit/server/ddx/x386/accel/mach8/mach8fs.c:2.6 *** mit/server/ddx/x386/accel/mach8/mach8fs.c:2.3 Fri Mar 11 23:37:33 1994 --- mit/server/ddx/x386/accel/mach8/mach8fs.c Fri Mar 11 23:37:33 1994 *************** *** 64,70 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8fs.c,v 2.3 1993/08/28 07:51:13 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 64,70 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8fs.c,v 2.6 1994/02/01 13:51:33 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 229,235 **** if (mach8CacheTile(pPix)) { while (n--) { ! if (*pwidth < 50) mach8ImageFill(ppt->x, ppt->y, *pwidth, 1, pPix->devPrivate.ptr, pixWidth, width, height, xrot, yrot, --- 229,235 ---- if (mach8CacheTile(pPix)) { while (n--) { ! if (*pwidth < 9) mach8ImageFill(ppt->x, ppt->y, *pwidth, 1, pPix->devPrivate.ptr, pixWidth, width, height, xrot, yrot, *************** *** 326,337 **** if (mach8CacheStipple(pPix)) { while (n--) { ! if (*pwidth < 50) ! mach8ImageStipple(ppt->x, ppt->y, *pwidth, 1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, ! xrot, yrot, pGC->fgPixel, ! mach8alu[pGC->alu], pGC->planemask); else mach8CImageStipple(pPix->slot, ppt->x, ppt->y, *pwidth, 1, xrot, yrot, --- 326,337 ---- if (mach8CacheStipple(pPix)) { while (n--) { ! if (*pwidth < 9) ! (mach8ImageStippleFunc)(ppt->x, ppt->y, *pwidth, 1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, ! xrot, yrot, pGC->fgPixel, 0, ! mach8alu[pGC->alu], pGC->planemask, 0); else mach8CImageStipple(pPix->slot, ppt->x, ppt->y, *pwidth, 1, xrot, yrot, *************** *** 342,351 **** } } else { while (n--) { ! mach8ImageStipple(ppt->x, ppt->y, *pwidth, 1, ! pPix->devPrivate.ptr, pixWidth, width, height, ! xrot, yrot, pGC->fgPixel, ! mach8alu[pGC->alu], pGC->planemask); ppt++; pwidth++; } --- 342,352 ---- } } else { while (n--) { ! (mach8ImageStippleFunc)(ppt->x, ppt->y, *pwidth, 1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, ! xrot, yrot, pGC->fgPixel, 0, ! mach8alu[pGC->alu], pGC->planemask, 0); ppt++; pwidth++; } *************** *** 425,436 **** if (mach8CacheOpStipple(pPix)) { while (n--) { ! if (*pwidth < 50) ! mach8ImageOpStipple(ppt->x, ppt->y, *pwidth, 1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, ! xrot, yrot, pGC->fgPixel, pGC->bgPixel, ! mach8alu[pGC->alu], pGC->planemask); else mach8CImageOpStipple(pPix->slot, ppt->x, ppt->y, *pwidth, 1, xrot, yrot, --- 426,437 ---- if (mach8CacheOpStipple(pPix)) { while (n--) { ! if (*pwidth < 9) ! (mach8ImageStippleFunc)(ppt->x, ppt->y, *pwidth, 1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, ! xrot, yrot, pGC->fgPixel, pGC->bgPixel, ! mach8alu[pGC->alu], pGC->planemask, 1); else mach8CImageOpStipple(pPix->slot, ppt->x, ppt->y, *pwidth, 1, xrot, yrot, *************** *** 441,451 **** } } else { while (n--) { ! mach8ImageOpStipple(ppt->x, ppt->y, *pwidth, 1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, ! xrot, yrot, pGC->fgPixel, pGC->bgPixel, ! mach8alu[pGC->alu], pGC->planemask); ppt++; pwidth++; } --- 442,452 ---- } } else { while (n--) { ! (mach8ImageStippleFunc)(ppt->x, ppt->y, *pwidth, 1, ! pPix->devPrivate.ptr, pixWidth, ! width, height, ! xrot, yrot, pGC->fgPixel, pGC->bgPixel, ! mach8alu[pGC->alu], pGC->planemask, 1); ppt++; pwidth++; } diff -c mit/server/ddx/x386/accel/mach8/mach8gc.c:2.2 mit/server/ddx/x386/accel/mach8/mach8gc.c:2.4 *** mit/server/ddx/x386/accel/mach8/mach8gc.c:2.2 Fri Mar 11 23:37:34 1994 --- mit/server/ddx/x386/accel/mach8/mach8gc.c Fri Mar 11 23:37:34 1994 *************** *** 25,31 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8gc.c,v 2.2 1993/09/21 15:22:07 dawes Exp $ */ /* $XConsortium: cfbgc.c,v 1.2 91/07/18 23:00:53 keith Exp $ */ --- 25,31 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8gc.c,v 2.4 1993/12/25 13:58:54 dawes Exp $ */ /* $XConsortium: cfbgc.c,v 1.2 91/07/18 23:00:53 keith Exp $ */ *************** *** 51,57 **** static void cfbValidateGC(), cfbChangeGC(), cfbCopyGC(), cfbDestroyGC(); static void cfbChangeClip(), cfbDestroyClip(), cfbCopyClip(); ! static cfbDestroyOps(); static GCFuncs cfbFuncs = { cfbValidateGC, --- 51,57 ---- static void cfbValidateGC(), cfbChangeGC(), cfbCopyGC(), cfbDestroyGC(); static void cfbChangeClip(), cfbDestroyClip(), cfbCopyClip(); ! static void cfbDestroyOps(); static GCFuncs cfbFuncs = { cfbValidateGC, *************** *** 66,72 **** static GCOps mach8Ops = { mach8SolidFSpans, mach8SetSpans, ! miPutImage, mach8CopyArea, mach8CopyPlane, mach8PolyPoint, --- 66,72 ---- static GCOps mach8Ops = { mach8SolidFSpans, mach8SetSpans, ! cfbPutImage, mach8CopyArea, mach8CopyPlane, mach8PolyPoint, *************** *** 319,325 **** return ret; } ! static cfbDestroyOps (ops) GCOps *ops; { --- 319,325 ---- return ret; } ! static void cfbDestroyOps (ops) GCOps *ops; { diff -c mit/server/ddx/x386/accel/mach8/mach8gs.c:2.2 mit/server/ddx/x386/accel/mach8/mach8gs.c:2.5 *** mit/server/ddx/x386/accel/mach8/mach8gs.c:2.2 Fri Mar 11 23:37:34 1994 --- mit/server/ddx/x386/accel/mach8/mach8gs.c Fri Mar 11 23:37:35 1994 *************** *** 27,33 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8gs.c,v 2.2 1993/08/17 16:15:34 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 27,33 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8gs.c,v 2.5 1994/02/01 13:51:35 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 60,66 **** { int j; unsigned char *pdst; /* where to put the bits */ - unsigned char *psrc; /* where to get the bits */ int pixmapStride; /* 11-jun-93 TCG : is VT visible */ --- 60,65 ---- *************** *** 91,97 **** pdst = (unsigned char *)pdstStart; for (; nspans--; ppt++, pwidth++) { ! mach8ImageRead(ppt->x, ppt->y, j = *pwidth, 1, pdst, pixmapStride, 0, 0); pdst += j; /* width is in 32 bit words */ j = (-j) & 3; while (j--) /* Pad out to 32-bit boundary */ --- 90,97 ---- pdst = (unsigned char *)pdstStart; for (; nspans--; ppt++, pwidth++) { ! (mach8ImageReadFunc)(ppt->x, ppt->y, j = *pwidth, 1, ! pdst, pixmapStride, 0, 0, 0xff); pdst += j; /* width is in 32 bit words */ j = (-j) & 3; while (j--) /* Pad out to 32-bit boundary */ diff -c /dev/null mit/server/ddx/x386/accel/mach8/mach8gtimg.c:2.1 *** /dev/null Fri Mar 11 23:37:35 1994 --- mit/server/ddx/x386/accel/mach8/mach8gtimg.c Fri Mar 11 23:37:35 1994 *************** *** 0 **** --- 1,82 ---- + /* + * Copyright 1993 by David Wexelblat + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, 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 David Wexelblat not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. David Wexelblat makes + * no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL DAVID WEXELBLAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE + * OR PERFORMANCE OF THIS SOFTWARE. + * + */ + /* + * Stolen from the S3 server and adapted to the Mach8 server. + * Hans Nasten. (nasten@everyware.se). + */ + + /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8gtimg.c,v 2.1 1994/02/01 13:51:36 dawes Exp $ */ + + #include "X.h" + #include "windowstr.h" + #include "scrnintstr.h" + #include "pixmapstr.h" + #include "cfb.h" + #include "cfbmskbits.h" + #include "mach8.h" + + extern void mfbGetImage(); + + void + mach8GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine) + DrawablePtr pDrawable; + int sx, sy, w, h; + unsigned int format; + unsigned long planeMask; + pointer pdstLine; + { + int width; + + if ((w == 0) || (h == 0)) + return; + + if (pDrawable->bitsPerPixel == 1) + { + mfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); + return; + } + + if (pDrawable->type != DRAWABLE_WINDOW) + { + cfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); + return; + } + + width = PixmapBytePad(w, pDrawable->depth); + if (format == ZPixmap) + { + (mach8ImageReadFunc)(sx+pDrawable->x, sy+pDrawable->y, w, h, + pdstLine, width, 0, 0, planeMask); + } + else + { + /* + * Worry about this later (much!). Should be straighforward, though. + * Read an image into a dummy pixmap, then use cfbCopyPlane8to1 to + * copy each plane in planeMask into the destination. At least + * this is the theory. + */ + miGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); + } + } + diff -c mit/server/ddx/x386/accel/mach8/mach8im.c:2.12 mit/server/ddx/x386/accel/mach8/mach8im.c:2.17 *** mit/server/ddx/x386/accel/mach8/mach8im.c:2.12 Fri Mar 11 23:37:36 1994 --- mit/server/ddx/x386/accel/mach8/mach8im.c Fri Mar 11 23:37:36 1994 *************** *** 25,35 **** * A few speedups by Hans Nasten (nasten@everyware.se) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8im.c,v 2.12 1993/09/21 15:22:10 dawes Exp $ */ #include "os.h" #include "regmach8.h" #include "mach8im.h" #define ASM_IMAGE --- 25,36 ---- * A few speedups by Hans Nasten (nasten@everyware.se) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8im.c,v 2.17 1994/02/01 13:51:37 dawes Exp $ */ #include "os.h" #include "regmach8.h" #include "mach8im.h" + #include "mach8.h" #define ASM_IMAGE *************** *** 84,93 **** return; if( pox == 0 && poy == 0 && pw >= x+w && ph >= y+h ) ! mach8ImageWrite(x, y, w, h, psrc, pwidth, x, y, alu, planemask); else ! mach8RealImageFill(x, y, w, h, psrc, pwidth, ! pw, ph, pox, poy, alu, planemask); } #else /* ASM_IMAGE */ --- 85,94 ---- return; if( pox == 0 && poy == 0 && pw >= x+w && ph >= y+h ) ! (mach8ImageWriteFunc)(x, y, w, h, psrc, pwidth, x, y, alu, planemask); else ! (mach8RealImageFillFunc)(x, y, w, h, psrc, pwidth, ! pw, ph, pox, poy, alu, planemask); } #else /* ASM_IMAGE */ *************** *** 143,149 **** } void ! mach8ImageRead(x, y, w, h, psrc, pwidth, px, py) int x; int y; int w; --- 144,150 ---- } void ! mach8ImageRead(x, y, w, h, psrc, pwidth, px, py, planemask) int x; int y; int w; *************** *** 152,157 **** --- 153,159 ---- int pwidth; int px; int py; + short planemask; { int i, j; unsigned short *sp; *************** *** 169,181 **** outw(CMD, CMD_RECT | INC_Y | INC_X | DRAW | BYTSEQ |_16BIT | PCDATA); sp = (unsigned short*)(psrc + pwidth * py + px); pwidth = pwidth / 2 - w / 2; WaitDataReady(); if( w & 1 ) { w /= 2; for (j = 0; j < h; j++) { for (i = 0; i < w; i++) ! *sp++ = inw(PIX_TRANS); ! *((unsigned char *)(sp)) = (unsigned char)(inw(PIX_TRANS)); sp += pwidth; } } --- 171,185 ---- outw(CMD, CMD_RECT | INC_Y | INC_X | DRAW | BYTSEQ |_16BIT | PCDATA); sp = (unsigned short*)(psrc + pwidth * py + px); pwidth = pwidth / 2 - w / 2; + planemask = (planemask & 0x00ff) | ((planemask << 8) & 0xff00); WaitDataReady(); if( w & 1 ) { w /= 2; for (j = 0; j < h; j++) { for (i = 0; i < w; i++) ! *sp++ = inw(PIX_TRANS) & planemask; ! *((unsigned char *)(sp)) = (unsigned char)(inw(PIX_TRANS)) ! & (unsigned char)(planemask); sp += pwidth; } } *************** *** 183,189 **** w /= 2; for (j = 0; j < h; j++) { for (i = 0; i < w; i++) ! *sp++ = inw(PIX_TRANS); sp += pwidth; } } --- 187,193 ---- w /= 2; for (j = 0; j < h; j++) { for (i = 0; i < w; i++) ! *sp++ = inw(PIX_TRANS) & planemask; sp += pwidth; } } *************** *** 276,283 **** } void ! mach8RealImageStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, ! fgPixel, bgPixel, alu, planemask, opaque) int x; int y; int w; --- 280,287 ---- } void ! mach8ImageStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, ! fgPixel, bgPixel, alu, planemask, opaque) int x; int y; int w; *************** *** 319,373 **** outw(CUR_Y, (short)y); outw(CMD, CMD_RECT | PCDATA | _16BIT | INC_Y | INC_X | YMAJAXIS | DRAW | PLANAR | WRTDATA); - WaitQueue(16); modulus(x - pox, pw, x); modulus(y - poy, ph, y); ! while( h > 0 ) { ! srch = ( y+h > ph ? ph - y : h ); ! while( srch > 0 ) { ! dstw = w; ! srcx = x; ! ptmp = (unsigned short *)(psrc + pwidth * y); ! while( dstw > 0 ) { ! int np, x2; ! unsigned short *pnt, pix; ! /* ! * Assemble 16 bits and feed them to the draw engine. ! */ ! np = pw - srcx; /* No. pixels left in bitmap.*/ ! pnt =(unsigned short *)((unsigned char *)(ptmp) + (srcx >> 3)); ! x2 = srcx & 7; /* Offset within byte. */ ! if( np >= 16 ) { ! pix = (unsigned short)(*((unsigned int *)(pnt)) >> x2); ! } ! else if( pw >= 16 ) { ! pix = (unsigned short)((*((unsigned int *)(pnt)) >> x2) & MSKBIT(np)) | (*ptmp << np); ! } ! else if( pw >= 8 ) { ! pix = ((*pnt >> x2) & MSKBIT(np)) | (*ptmp << np) | (*pnt << (np+pw)); - } - else { - pix = (*ptmp >> x2) & MSKBIT(np); - while( np < 16 && np < dstw ) { - pix |= *ptmp << np; - np += pw; } } ! outw( PIX_TRANS, mach8stipple_tab[ pix & 0xff ] ); ! if( dstw > 8 ) ! outw( PIX_TRANS, mach8stipple_tab[ ( pix >> 8 ) & 0xff ] ); ! srcx += 16; ! if( srcx >= pw ) ! srcx -= pw; ! dstw -= 16; } ! y++; ! h--; ! srch--; } - y = 0; } WaitQueue(5); outw(FRGD_MIX, FSS_FRGDCOL | MIX_SRC); --- 323,400 ---- outw(CUR_Y, (short)y); outw(CMD, CMD_RECT | PCDATA | _16BIT | INC_Y | INC_X | YMAJAXIS | DRAW | PLANAR | WRTDATA); modulus(x - pox, pw, x); modulus(y - poy, ph, y); ! WaitQueue(16); ! /* ! * When the source bitmap is properly aligned, max 16 pixels wide, ! * and nonrepeating use this faster loop instead. ! * This speeds up all copying to the font cache. ! */ ! if( (x & 7) == 0 && w <= 16 && x+w <= pw && y+h <= ph ) { ! unsigned short pix; ! unsigned char *pnt; ! ! pnt = (unsigned char *)(psrc + pwidth * y + (x >> 3)); ! while( h-- > 0 ) { ! pix = *((unsigned short *)(pnt)); ! outw( PIX_TRANS, mach8stipple_tab[ pix & 0xff ] ); ! if( w > 8 ) ! outw( PIX_TRANS, mach8stipple_tab[ ( pix >> 8 ) & 0xff ] ); ! ! pnt += pwidth; ! } ! } ! else { ! while( h > 0 ) { ! srch = ( y+h > ph ? ph - y : h ); ! while( srch > 0 ) { ! dstw = w; ! srcx = x; ! ptmp = (unsigned short *)(psrc + pwidth * y); ! while( dstw > 0 ) { ! int np, x2; ! unsigned short *pnt, pix; ! /* ! * Assemble 16 bits and feed them to the draw engine. ! */ ! np = pw - srcx; /* No. pixels left in bitmap.*/ ! pnt =(unsigned short *) ! ((unsigned char *)(ptmp) + (srcx >> 3)); ! x2 = srcx & 7; /* Offset within byte. */ ! if( np >= 16 ) { ! pix = (unsigned short)(*((unsigned int *)(pnt)) >> x2); ! } ! else if( pw >= 16 ) { ! pix = (unsigned short)((*((unsigned int *)(pnt)) >> x2) & MSKBIT(np)) | (*ptmp << np); ! } ! else if( pw >= 8 ) { ! pix = ((*pnt >> x2) & MSKBIT(np)) | (*ptmp << np) | (*pnt << (np+pw)); } + else { + pix = (*ptmp >> x2) & MSKBIT(np); + while( np < 16 && np < dstw ) { + pix |= *ptmp << np; + np += pw; + } + } + outw( PIX_TRANS, mach8stipple_tab[ pix & 0xff ] ); + if( dstw > 8 ) + outw( PIX_TRANS, + mach8stipple_tab[ ( pix >> 8 ) & 0xff ] ); + srcx += 16; + if( srcx >= pw ) + srcx -= pw; + dstw -= 16; } ! y++; ! h--; ! srch--; } ! y = 0; } } WaitQueue(5); outw(FRGD_MIX, FSS_FRGDCOL | MIX_SRC); *************** *** 378,418 **** } #endif /* ASM_IMAGE */ - - void - mach8ImageStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, fgPixel, alu, planemask) - int x; - int y; - int w; - int h; - unsigned char *psrc; - int pwidth; - int pw, ph, pox, poy; - int fgPixel; - short alu; - short planemask; - { - - mach8RealImageStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, - fgPixel, 0, alu, planemask, 0); - } - - void - mach8ImageOpStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, fgPixel, bgPixel, alu, planemask) - int x; - int y; - int w; - int h; - unsigned char *psrc; - int pw, ph, pox, poy; - int pwidth; - int fgPixel; - int bgPixel; - short alu; - short planemask; - { - - mach8RealImageStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, - fgPixel, bgPixel, alu, planemask, 1); - - } --- 405,407 ---- diff -c mit/server/ddx/x386/accel/mach8/mach8imfl.s:2.4 mit/server/ddx/x386/accel/mach8/mach8imfl.s:2.5 *** mit/server/ddx/x386/accel/mach8/mach8imfl.s:2.4 Fri Mar 11 23:37:37 1994 --- mit/server/ddx/x386/accel/mach8/mach8imfl.s Fri Mar 11 23:37:37 1994 *************** *** 8,14 **** 8514 compatible. Written by Hans Nasten ( nasten@everyware.se ) AUG 29, 1993. ! $XFree86: mit/server/ddx/x386/accel/mach8/mach8imfl.s,v 2.4 1993/09/18 04:31:26 dawes Exp $ The equivalent C-code looks like this. --- 8,14 ---- 8514 compatible. Written by Hans Nasten ( nasten@everyware.se ) AUG 29, 1993. ! $XFree86: mit/server/ddx/x386/accel/mach8/mach8imfl.s,v 2.5 1994/02/19 09:28:57 dawes Exp $ The equivalent C-code looks like this. *************** *** 125,140 **** #define srcx_loc REGOFF(-12,EBP) #define srcxsave_loc REGOFF(-16,EBP) SEG_TEXT ALIGNTEXT4 ! ! GLOBL GLNAME(mach8RealImageFill) ! GLNAME(mach8RealImageFill): PUSH_L (EBP) MOV_L (ESP,EBP) ! SUB_L (CONST(16),ESP) PUSH_L (EDI) PUSH_L (ESI) PUSH_L (EBX) --- 125,149 ---- #define srcx_loc REGOFF(-12,EBP) #define srcxsave_loc REGOFF(-16,EBP) + #ifdef DRAM_VERSION + #define tempcount_loc REGOFF(-20,EBP) + #define STACK_USG CONST(20) + #define IMAGEFILL GLNAME(mach8RealImageFillDram) + #else + #define tempcount_loc EAX + #define STACK_USG CONST(16) + #define IMAGEFILL GLNAME(mach8RealImageFill) + #endif + SEG_TEXT ALIGNTEXT4 ! GLOBL IMAGEFILL ! IMAGEFILL: PUSH_L (EBP) MOV_L (ESP,EBP) ! SUB_L (STACK_USG,ESP) PUSH_L (EDI) PUSH_L (ESI) PUSH_L (EBX) *************** *** 321,326 **** --- 330,342 ---- * Yes there was, combine it with the first pixel and write them * to the 8514/Mach engine. */ + #ifdef DRAM_VERSION + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_a: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_a) + #endif MOV_B (CH,AL) MOV_B (REGIND(ESI),AH) MOV_L (PIX_TRANS,EDX) *************** *** 337,347 **** * Move the rest of the line using a "rep outsw" instruction. */ .move_pixels: ! MOV_L (ECX,EAX) SHR_L (CONST(1),ECX) REP OUTS_W ! MOV_L (EAX,ECX) SUB_L (EDI,EBX) /* * Is there a pixel left unwritten ? --- 353,382 ---- * Move the rest of the line using a "rep outsw" instruction. */ .move_pixels: ! MOV_L (ECX,tempcount_loc) SHR_L (CONST(1),ECX) + + #ifndef DRAM_VERSION REP OUTS_W ! #else ! AND_L (ECX,ECX) ! JZ (.move_pixels_3) ! ! .move_pixels_2: ! MOV_L (EXT_FIFO_STATUS,EDX) ! .wait_queue_b: ! IN_W ! TEST_W (CONST(0x8000),AX) ! JNZ (.wait_queue_b) ! ! MOV_L (PIX_TRANS,EDX) ! LODS_W ! OUT_W ! LOOP (.move_pixels_2) ! #endif ! .move_pixels_3: ! MOV_L (tempcount_loc,ECX) SUB_L (EDI,EBX) /* * Is there a pixel left unwritten ? *************** *** 363,368 **** --- 398,411 ---- * Write it and let the scissors cut the unwanted extra pixel. */ .write_pixel: + #ifdef DRAM_VERSION + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_c: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_c) + MOV_L (PIX_TRANS,EDX) + #endif MOV_B (REGIND(ESI),AL) OUT_W /* *************** *** 418,423 **** POP_L (EBX) POP_L (ESI) POP_L (EDI) ! ADD_L (CONST(16),ESP) POP_L (EBP) RET --- 461,466 ---- POP_L (EBX) POP_L (ESI) POP_L (EDI) ! ADD_L (STACK_USG,ESP) POP_L (EBP) RET diff -c mit/server/ddx/x386/accel/mach8/mach8imrd.s:2.1 mit/server/ddx/x386/accel/mach8/mach8imrd.s:2.4 *** mit/server/ddx/x386/accel/mach8/mach8imrd.s:2.1 Fri Mar 11 23:37:37 1994 --- mit/server/ddx/x386/accel/mach8/mach8imrd.s Fri Mar 11 23:37:38 1994 *************** *** 6,12 **** Written by Hans Nasten ( nasten@everyware.se ) AUG 29, 1993. void ! mach8ImageRead(x, y, w, h, psrc, pwidth, px, py) int x; int y; int w; --- 6,12 ---- Written by Hans Nasten ( nasten@everyware.se ) AUG 29, 1993. void ! mach8ImageRead(x, y, w, h, psrc, pwidth, px, py, planemask) int x; int y; int w; *************** *** 15,24 **** int pwidth; int px; int py; ******************************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8imrd.s,v 2.1 1993/09/02 14:25:52 dawes Exp $ */ #define _MACH8_ASM_ #include "assyntax.h" --- 15,25 ---- int pwidth; int px; int py; + short planemask; ******************************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8imrd.s,v 2.4 1994/02/19 09:28:59 dawes Exp $ */ #define _MACH8_ASM_ #include "assyntax.h" *************** *** 37,50 **** #define pwidth_arg REGOFF(28,EBP) #define px_arg REGOFF(32,EBP) #define py_arg REGOFF(36,EBP) SEG_TEXT ALIGNTEXT4 ! GLOBL GLNAME(mach8ImageRead) ! GLNAME(mach8ImageRead): PUSH_L (EBP) MOV_L (ESP,EBP) PUSH_L (EDI) --- 38,57 ---- #define pwidth_arg REGOFF(28,EBP) #define px_arg REGOFF(32,EBP) #define py_arg REGOFF(36,EBP) + #define planemask_arg REGOFF(40,EBP) + #ifdef DRAM_VERSION + #define IMAGEREAD GLNAME(mach8ImageReadDram) + #else + #define IMAGEREAD GLNAME(mach8ImageRead) + #endif SEG_TEXT ALIGNTEXT4 ! GLOBL IMAGEREAD ! IMAGEREAD: PUSH_L (EBP) MOV_L (ESP,EBP) PUSH_L (EDI) *************** *** 131,137 **** --- 138,146 ---- * Read the pixels line by line from the fifo. */ CLD + #ifndef DRAM_VERSION MOV_L (PIX_TRANS,EDX) + #endif MOV_L (pwidth_arg,ESI) SHR_L (CONST(1),ESI) *************** *** 140,145 **** --- 149,238 ---- SUB_L (EBX,ESI) SHL_L (CONST(1),ESI) + MOV_W (planemask_arg,BX) + CMP_W (CONST(0xff),BX) + JZ (.get_all_planes) + + MOV_L (ESI,pwidth_arg) + MOV_L (h_arg,ESI) + MOV_B (BL,BH) + TEST_W (CONST(1),w_arg) + JNZ (.odd_width_masked) + /* + * Even number of pixels on each line, but some of the bitplanes + * should be masked out. + */ + SHR_L (CONST(1),w_arg) + .next_even_line_masked: + MOV_L (w_arg,ECX) + .next_even_word_masked: + #ifdef DRAM_VERSION + MOV_L (GP_STAT,EDX) + .wait_ready_2: + IN_W + TEST_W (DATARDY,AX) + JZ (.wait_ready_2) + + MOV_L (PIX_TRANS,EDX) + #endif + IN_W + AND_W (BX,AX) + STOS_W + LOOP (.next_even_word_masked) + + ADD_L (pwidth_arg,EDI) + DEC_W (SI) + JNZ (.next_even_line_masked) + + JMP (.all_done) + /* + * Odd number of pixels on each line, but some of the bitplanes + * should be masked out. Read an additional pixel on each line. + */ + .odd_width_masked: + SHR_L (CONST(1),w_arg) + .next_odd_line_masked: + MOV_L (w_arg,ECX) + AND_L (ECX,ECX) + JZ (.odd_masked_skip) + + .next_odd_word_masked: + #ifdef DRAM_VERSION + MOV_L (GP_STAT,EDX) + .wait_ready_3: + IN_W + TEST_W (DATARDY,AX) + JZ (.wait_ready_3) + + MOV_L (PIX_TRANS,EDX) + #endif + IN_W + AND_W (BX,AX) + STOS_W + LOOP (.next_odd_word_masked) + + .odd_masked_skip: + #ifdef DRAM_VERSION + MOV_L (GP_STAT,EDX) + .wait_ready_4: + IN_W + TEST_W (DATARDY,AX) + JZ (.wait_ready_4) + + MOV_L (PIX_TRANS,EDX) + #endif + IN_W + AND_B (BL,AL) + MOV_B (AL,REGIND(EDI)) + ADD_L (pwidth_arg,EDI) + DEC_W (SI) + JNZ (.next_odd_line_masked) + + JMP (.all_done) + /* + * All bitplanes is to be stored. Skip planemask anding. + */ + .get_all_planes: MOV_W (h_arg,BX) TEST_W (CONST(1),w_arg) JNZ (.odd_width) *************** *** 151,158 **** --- 244,265 ---- SHR_L (CONST(1),EBP) .next_even_line: MOV_L (EBP,ECX) + #ifndef DRAM_VERSION REP INS_W + #else + .next_even_line_2: + MOV_L (GP_STAT,EDX) + .wait_ready_5: + IN_W + TEST_W (DATARDY,AX) + JZ (.wait_ready_5) + + MOV_L (PIX_TRANS,EDX) + IN_W + STOS_W + LOOP (.next_even_line_2) + #endif ADD_L (ESI,EDI) DEC_W (BX) JNZ (.next_even_line) *************** *** 167,174 **** --- 274,307 ---- SHR_L (CONST(1),EBP) .next_odd_line: MOV_L (EBP,ECX) + #ifndef DRAM_VERSION REP INS_W + #else + AND_L (ECX,ECX) + JZ (.odd_line_skip) + + .next_odd_line_2: + MOV_L (GP_STAT,EDX) + .wait_ready_6: + IN_W + TEST_W (DATARDY,AX) + JZ (.wait_ready_6) + + MOV_L (PIX_TRANS,EDX) + IN_W + STOS_W + LOOP (.next_odd_line_2) + + .odd_line_skip: + MOV_L (GP_STAT,EDX) + .wait_ready_7: + IN_W + TEST_W (DATARDY,AX) + JZ (.wait_ready_7) + + MOV_L (PIX_TRANS,EDX) + #endif IN_W MOV_B (AL,REGIND(EDI)) ADD_L (ESI,EDI) diff -c mit/server/ddx/x386/accel/mach8/mach8imst.s:2.2 mit/server/ddx/x386/accel/mach8/mach8imst.s:2.5 *** mit/server/ddx/x386/accel/mach8/mach8imst.s:2.2 Fri Mar 11 23:37:38 1994 --- mit/server/ddx/x386/accel/mach8/mach8imst.s Fri Mar 11 23:37:39 1994 *************** *** 1,115 **** /****************************************************************************** ! This is a assembly language version of the mach8RealImageStipple routine. Except for the extended fifo status register, everything should be 8514 compatible. Written by Hans Nasten ( nasten@everyware.se ) SEP 16, 1993. ! $XFree86: mit/server/ddx/x386/accel/mach8/mach8imst.s,v 2.2 1993/09/27 12:24:00 dawes Exp $ ! The equivalent C-code looks like this. - void - mach8RealImageStipple(x, y, w, h, psrc, pwidth, pw, ph, pox, poy, - fgPixel, bgPixel, alu, planemask, opaque) - int x; - int y; - int w; - int h; - unsigned char *psrc; - int pw, ph, pox, poy; - int pwidth; - int fgPixel; - int bgPixel; - short alu; - short planemask; - int opaque; - { - int srcx, srch, dstw; - unsigned short *ptmp; - - - if (alu == MIX_DST || w == 0 || h == 0) - return; - - WaitQueue(13); - outw(MULTIFUNC_CNTL, SCISSORS_L | x); - outw(MULTIFUNC_CNTL, SCISSORS_R | (x+w-1)); - outw(MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_EXPPC | COLCMPOP_F); - outw(MULTIFUNC_CNTL, MIN_AXIS_PCNT | h-1); - outw(WRT_MASK, planemask); - outw(FRGD_MIX, FSS_FRGDCOL | alu); - if( opaque ) { - outw(BKGD_MIX, BSS_BKGDCOL | alu); - outw(BKGD_COLOR, (short)bgPixel); - } - else - outw(BKGD_MIX, BSS_BKGDCOL | MIX_DST); - outw(FRGD_COLOR, (short)fgPixel); - w += (x & 3); - x &= ~3; - outw(MAJ_AXIS_PCNT, (short)(((w + 7) & ~7)-1)); - outw(CUR_X, (short)x); - outw(CUR_Y, (short)y); - outw(CMD, CMD_RECT | PCDATA | _16BIT | INC_Y | INC_X | - YMAJAXIS | DRAW | PLANAR | WRTDATA); - WaitQueue(16); - modulus(x - pox, pw, x); - modulus(y - poy, ph, y); - while( h > 0 ) { - srch = ( y+h > ph ? ph - y : h ); - while( srch > 0 ) { - dstw = w; - srcx = x; - ptmp = (unsigned short *)(psrc + pwidth * y); - while( dstw > 0 ) { - int np, x2; - unsigned short *pnt, pix; - - np = pw - srcx; - pnt =(unsigned short *)((unsigned char *)(ptmp) + (srcx >> 3)); - x2 = srcx & 7; - if( np >= 16 ) { - pix = (unsigned short)(*((unsigned int *)(pnt)) >> x2); - } - else if( pw >= 16 ) { - pix = (unsigned short)((*((unsigned int *)(pnt)) >> x2) - & MSKBIT(np)) | (*ptmp << np); - } - else if( pw >= 8 ) { - pix = ((*pnt >> x2) & MSKBIT(np)) | (*ptmp << np) - | (*pnt << (np+pw)); - } - else { - pix = (*ptmp >> x2) & MSKBIT(np); - while( np < 16 && np < dstw ) { - pix |= *ptmp << np; - np += pw; - } - } - outw( PIX_TRANS, mach8stipple_tab[ pix & 0xff ] ); - if( dstw > 8 ) - outw( PIX_TRANS, mach8stipple_tab[ ( pix >> 8 ) & 0xff ] ); - srcx += 16; - if( srcx >= pw ) - srcx -= pw; - dstw -= 16; - } - y++; - h--; - srch--; - } - y = 0; - } - WaitQueue(5); - outw(FRGD_MIX, FSS_FRGDCOL | MIX_SRC); - outw(BKGD_MIX, BSS_BKGDCOL | MIX_SRC); - outw(MULTIFUNC_CNTL, SCISSORS_L | 0); - outw(MULTIFUNC_CNTL, SCISSORS_R | MACH8_MAX_X); - outw(MULTIFUNC_CNTL, PIX_CNTL | MIXSEL_FRGDMIX | COLCMPOP_F); - } - ******************************************************************************/ #define _MACH8_ASM_ --- 1,15 ---- /****************************************************************************** ! This is a assembly language version of the mach8ImageStipple routine. Except for the extended fifo status register, everything should be 8514 compatible. Written by Hans Nasten ( nasten@everyware.se ) SEP 16, 1993. ! $XFree86: mit/server/ddx/x386/accel/mach8/mach8imst.s,v 2.5 1994/02/19 09:29:00 dawes Exp $ ! This is a assembly language version of the C code in mach8im.c ******************************************************************************/ #define _MACH8_ASM_ *************** *** 144,149 **** --- 44,54 ---- #define srch_loc REGOFF(-8,EBP) #define dstw_loc REGOFF(-12,EBP) + #ifdef DRAM_VERSION + #define IMAGESTIPPLE GLNAME(mach8ImageStippleDram) + #else + #define IMAGESTIPPLE GLNAME(mach8ImageStipple) + #endif SEG_TEXT ALIGNTEXT4 *************** *** 169,177 **** D_WORD 0x0000 ! GLOBL GLNAME(mach8RealImageStipple) ! GLNAME(mach8RealImageStipple): PUSH_L (EBP) MOV_L (ESP,EBP) SUB_L (CONST(12),ESP) --- 74,82 ---- D_WORD 0x0000 ! GLOBL IMAGESTIPPLE ! IMAGESTIPPLE: PUSH_L (EBP) MOV_L (ESP,EBP) SUB_L (CONST(12),ESP) *************** *** 305,311 **** ADD_L (ph_arg,EDX) .mod1: MOV_L (EDX,y_arg) - /* * Wait until the fifo is empty. */ --- 210,215 ---- *************** *** 315,320 **** --- 219,321 ---- TEST_W (CONST(1),AX) JNZ (.wait_queue_1) /* + * When the source bitmap is properly aligned, max 16 pixels wide, + * and nonrepeating use this faster loop instead. + * This speeds up all copying to the font cache. + */ + MOV_L (x_arg,EAX) + AND_L (CONST(7),EAX) + JNZ (.next_bitmap_vertical) + + MOV_L (w_arg,EAX) + CMP_L (CONST(16),EAX) + JG (.next_bitmap_vertical) + + ADD_L (x_arg,EAX) + CMP_L (pw_arg,EAX) + JG (.next_bitmap_vertical) + + MOV_L (y_arg,EAX) + ADD_L (h_arg,EAX) + CMP_L (ph_arg,EAX) + JG (.next_bitmap_vertical) + + MOV_L (y_arg,EAX) + MUL_L (pwidth_arg) + MOV_L (x_arg,EDX) + SHR_L (CONST(3),EDX) + ADD_L (EDX,EAX) + MOV_L (psrc_arg,ESI) + ADD_L (EAX,ESI) + #ifndef DRAM_VERSION + MOV_L (PIX_TRANS,EDX) + #endif + MOV_L (h_arg,EDI) + CMP_L (CONST(8),w_arg) + JLE (.fast_loop_8) + /* + * This loop is for max 16 pixels wide bitmaps. + */ + .fast_loop_16: + MOV_W (REGIND(ESI),CX) + XOR_L (EBX,EBX) + MOV_B (CL,BL) + SHL_L (CONST(1),EBX) + #ifdef DRAM_VERSION + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_a: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_a) + + MOV_L (PIX_TRANS,EDX) + #endif + MOV_W (REGOFF(GLNAME(mach8stipple_tab),EBX),AX) + OUT_W + XOR_L (EBX,EBX) + MOV_B (CH,BL) + SHL_L (CONST(1),EBX) + #ifdef DRAM_VERSION + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_b: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_b) + + MOV_L (PIX_TRANS,EDX) + #endif + MOV_W (REGOFF(GLNAME(mach8stipple_tab),EBX),AX) + OUT_W + ADD_L (pwidth_arg,ESI) + DEC_L (EDI) + JNZ (.fast_loop_16) + + JMP (.stipple_exit) + /* + * This loop is for max 8 pixels wide bitmaps. + */ + .fast_loop_8: + XOR_L (EBX,EBX) + MOV_B (REGIND(ESI),BL) + SHL_L (CONST(1),EBX) + #ifdef DRAM_VERSION + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_c: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_c) + + MOV_L (PIX_TRANS,EDX) + #endif + MOV_W (REGOFF(GLNAME(mach8stipple_tab),EBX),AX) + OUT_W + ADD_L (pwidth_arg,ESI) + DEC_L (EDI) + JNZ (.fast_loop_8) + + JMP (.stipple_exit) + + /* * Process all lines on screen repeating the bitmap if needed. * This loop paints from the present y location to the end of * the bitmap. ( or to the end of the screen area if the bitmap *************** *** 385,390 **** --- 386,400 ---- XOR_L (EBX,EBX) MOV_B (AL,BL) SHL_L (CONST(1),EBX) + #ifdef DRAM_VERSION + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_d: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_d) + + MOV_L (PIX_TRANS,EDX) + #endif MOV_W (REGOFF(GLNAME(mach8stipple_tab),EBX),AX) OUT_W CMP_L (CONST(8),dstw_loc) *************** *** 393,398 **** --- 403,417 ---- XOR_L (EBX,EBX) MOV_B (CH,BL) SHL_L (CONST(1),EBX) + #ifdef DRAM_VERSION + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_e: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_e) + + MOV_L (PIX_TRANS,EDX) + #endif MOV_W (REGOFF(GLNAME(mach8stipple_tab),EBX),AX) OUT_W SUB_L (CONST(16),dstw_loc) *************** *** 429,434 **** --- 448,462 ---- XOR_L (EBX,EBX) MOV_B (AL,BL) SHL_L (CONST(1),EBX) + #ifdef DRAM_VERSION + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_f: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_f) + + MOV_L (PIX_TRANS,EDX) + #endif MOV_W (REGOFF(GLNAME(mach8stipple_tab),EBX),AX) OUT_W CMP_L (CONST(8),dstw_loc) *************** *** 437,442 **** --- 465,479 ---- XOR_L (EBX,EBX) MOV_B (CH,BL) SHL_L (CONST(1),EBX) + #ifdef DRAM_VERSION + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_g: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_g) + + MOV_L (PIX_TRANS,EDX) + #endif MOV_W (REGOFF(GLNAME(mach8stipple_tab),EBX),AX) OUT_W SUB_L (CONST(16),dstw_loc) *************** *** 477,482 **** --- 514,528 ---- XOR_L (EBX,EBX) MOV_B (AL,BL) SHL_L (CONST(1),EBX) + #ifdef DRAM_VERSION + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_h: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_h) + + MOV_L (PIX_TRANS,EDX) + #endif MOV_W (REGOFF(GLNAME(mach8stipple_tab),EBX),AX) OUT_W CMP_L (CONST(8),dstw_loc) *************** *** 485,490 **** --- 531,545 ---- XOR_L (EBX,EBX) MOV_B (CH,BL) SHL_L (CONST(1),EBX) + #ifdef DRAM_VERSION + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_i: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_i) + + MOV_L (PIX_TRANS,EDX) + #endif MOV_W (REGOFF(GLNAME(mach8stipple_tab),EBX),AX) OUT_W SUB_L (CONST(16),dstw_loc) *************** *** 534,539 **** --- 589,603 ---- XOR_L (EBX,EBX) MOV_B (AL,BL) SHL_L (CONST(1),EBX) + #ifdef DRAM_VERSION + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_j: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_j) + + MOV_L (PIX_TRANS,EDX) + #endif MOV_W (REGOFF(GLNAME(mach8stipple_tab),EBX),AX) OUT_W CMP_L (CONST(8),dstw_loc) *************** *** 542,547 **** --- 606,620 ---- XOR_L (EBX,EBX) MOV_B (CH,BL) SHL_L (CONST(1),EBX) + #ifdef DRAM_VERSION + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_k: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_k) + + MOV_L (PIX_TRANS,EDX) + #endif MOV_W (REGOFF(GLNAME(mach8stipple_tab),EBX),AX) OUT_W SUB_L (CONST(16),dstw_loc) *************** *** 561,566 **** --- 634,640 ---- /* * Wait until room for 5 entries in the fifo. */ + .stipple_exit: MOV_L (EXT_FIFO_STATUS,EDX) .wait_queue_2: IN_W diff -c mit/server/ddx/x386/accel/mach8/mach8imwrt.s:2.2 mit/server/ddx/x386/accel/mach8/mach8imwrt.s:2.3 *** mit/server/ddx/x386/accel/mach8/mach8imwrt.s:2.2 Fri Mar 11 23:37:39 1994 --- mit/server/ddx/x386/accel/mach8/mach8imwrt.s Fri Mar 11 23:37:40 1994 *************** *** 20,26 **** ******************************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8imwrt.s,v 2.2 1993/09/18 04:31:28 dawes Exp $ */ #define _MACH8_ASM_ #include "assyntax.h" --- 20,26 ---- ******************************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8imwrt.s,v 2.3 1994/02/19 09:29:02 dawes Exp $ */ #define _MACH8_ASM_ #include "assyntax.h" *************** *** 42,53 **** #define alu_arg REGOFF(40,EBP) #define planemask_arg REGOFF(44,EBP) SEG_TEXT ALIGNTEXT4 ! GLOBL GLNAME(mach8ImageWrite) ! GLNAME(mach8ImageWrite): PUSH_L (EBP) MOV_L (ESP,EBP) PUSH_L (EDI) --- 42,59 ---- #define alu_arg REGOFF(40,EBP) #define planemask_arg REGOFF(44,EBP) + #ifdef DRAM_VERSION + #define IMAGEWRITE GLNAME(mach8ImageWriteDram) + #else + #define IMAGEWRITE GLNAME(mach8ImageWrite) + #endif + SEG_TEXT ALIGNTEXT4 ! GLOBL IMAGEWRITE ! IMAGEWRITE: PUSH_L (EBP) MOV_L (ESP,EBP) PUSH_L (EDI) *************** *** 148,153 **** --- 154,160 ---- /* * Copy the pixels line by line to the fifo. */ + #ifndef DRAM_VERSION CLD MOV_L (PIX_TRANS,EDX) MOV_W (h_arg,BX) *************** *** 163,168 **** --- 170,200 ---- ADD_L (EAX,EDI) DEC_W (BX) JNZ (.next_line) + #else + CLD + MOV_L (w_arg,EBX) + INC_L (EBX) + SHR_L (CONST(1),EBX) + .next_line: + MOV_L (EDI,ESI) + MOV_L (EBX,ECX) + + .next_line_2: + MOV_L (EXT_FIFO_STATUS,EDX) + .wait_queue_a: + IN_W + TEST_W (CONST(0x8000),AX) + JNZ (.wait_queue_a) + + MOV_L (PIX_TRANS,EDX) + LODS_W + OUT_W + LOOP (.next_line_2) + + ADD_L (pwidth_arg,EDI) + DEC_W (h_arg) + JNZ (.next_line) + #endif /* * Wait until room for 3 entries in the fifo. */ diff -c mit/server/ddx/x386/accel/mach8/mach8init.c:2.7 mit/server/ddx/x386/accel/mach8/mach8init.c:2.10 *** mit/server/ddx/x386/accel/mach8/mach8init.c:2.7 Fri Mar 11 23:37:40 1994 --- mit/server/ddx/x386/accel/mach8/mach8init.c Fri Mar 11 23:37:40 1994 *************** *** 21,31 **** * and Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8init.c,v 2.7 1993/10/15 15:39:13 dawes Exp $ */ ! #include "misc.h" #include "mach8.h" #include "regmach8.h" #define XCONFIG_FLAGS_ONLY #include "xf86_Config.h" --- 21,34 ---- * and Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8init.c,v 2.10 1994/02/01 14:25:03 dawes Exp $ */ ! #include "X.h" ! #include "input.h" #include "mach8.h" #include "regmach8.h" + #include "x386.h" + #include "xf86_OSlib.h" #define XCONFIG_FLAGS_ONLY #include "xf86_Config.h" *************** *** 94,99 **** --- 97,105 ---- if(pMode->Flags & V_INTERLACE) vmdef->dc |= INTERLACE; + if(pMode->Flags & V_CSYNC) + vmdef->clk |= COMPOSITE_SYNC; + /* ErrorF("Mach8calcvmode: (%x,%x,%x,%x),(%x,%x,%x,%x),(%x,%x)\n", vmdef->hd,vmdef->hss,vmdef->hsw,vmdef->ht, *************** *** 124,132 **** * virtualX. */ ! outw(CRT_PITCH, mach8InfoRec.virtualX >> 3); ! outw(GE_PITCH, mach8InfoRec.virtualX >> 3); ! outw(H_TOTAL,vmdef->ht); outw(H_DISP,vmdef->hd); outw(H_SYNC_STRT,vmdef->hss); --- 130,143 ---- * virtualX. */ ! if( mach8InfoRec.videoRam > 512 ) { ! outw( CRT_PITCH, 1024 >> 3 ); ! outw( GE_PITCH, 1024 >> 3 ); ! } ! else { ! outw(CRT_PITCH, mach8InfoRec.virtualX >> 3); ! outw(GE_PITCH, mach8InfoRec.virtualX >> 3); ! } outw(H_TOTAL,vmdef->ht); outw(H_DISP,vmdef->hd); outw(H_SYNC_STRT,vmdef->hss); *************** *** 151,157 **** outw(CRT_OFFSET_LO,0); } ! (void) mach8ClockSelect(vmdef->clk); outw(DISP_CNTL,vmdef->dc); } --- 162,173 ---- outw(CRT_OFFSET_LO,0); } ! if (OFLG_ISSET(OPTION_CSYNC, &mach8InfoRec.options)) ! outw(CLOCK_SEL, ((vmdef->clk & 0x00ff) << 2) | 0xa01 | COMPOSITE_SYNC); ! else ! outw(CLOCK_SEL, ! ((vmdef->clk & 0x00ff) << 2) | 0xa01 | (vmdef->clk & COMPOSITE_SYNC)); ! outw(DISP_CNTL,vmdef->dc); } *************** *** 270,280 **** } } ! /* InitEnvironment() Initializes the Mach-8's drawing environment and clears the display. */ ! void InitEnvironment(void) { /* Current mixes, src, foreground active */ outw(FRGD_MIX, FSS_FRGDCOL | MIX_SRC); --- 286,296 ---- } } ! /* mach8InitEnvironment() Initializes the Mach-8's drawing environment and clears the display. */ ! void mach8InitEnvironment() { /* Current mixes, src, foreground active */ outw(FRGD_MIX, FSS_FRGDCOL | MIX_SRC); diff -c mit/server/ddx/x386/accel/mach8/mach8line.c:2.4 mit/server/ddx/x386/accel/mach8/mach8line.c:2.5 *** mit/server/ddx/x386/accel/mach8/mach8line.c:2.4 Fri Mar 11 23:37:41 1994 --- mit/server/ddx/x386/accel/mach8/mach8line.c Fri Mar 11 23:37:41 1994 *************** *** 27,33 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8line.c,v 2.4 1993/09/21 15:22:13 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ --- 27,33 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8line.c,v 2.5 1993/12/25 13:59:01 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ *************** *** 112,119 **** unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - unsigned long *addrl; /* address of destination pixmap */ - int nlwidth; /* width in longwords of destination pixmap */ int xorg, yorg; /* origin of window */ int adx; /* abs values of dx and dy */ --- 112,117 ---- *************** *** 133,140 **** register int x1, x2; RegionPtr cclip; cfbPrivGCPtr devPriv; - unsigned long xor, and; - int alu; /* 11-jun-93 TCG : is VT visible */ if (!x386VTSema) --- 131,136 ---- diff -c mit/server/ddx/x386/accel/mach8/mach8pcach.c:2.4 mit/server/ddx/x386/accel/mach8/mach8pcach.c:2.10 *** mit/server/ddx/x386/accel/mach8/mach8pcach.c:2.4 Fri Mar 11 23:37:42 1994 --- mit/server/ddx/x386/accel/mach8/mach8pcach.c Fri Mar 11 23:37:42 1994 *************** *** 20,41 **** * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Modified for the Mach-8 by Rickard E. Faith */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8pcach.c,v 2.4 1993/10/04 05:13:45 dawes Exp $ */ ! /* Offscreen memory organization: * ! * 128 128 768 ! * +-------+-------+-----------------------------------------------+ ! * | | | | ! * 128 | 0 | 1 | | ! * | | | | ! * +---+---+---+---+ FONTS | 256 ! * 64 | 2 | 3 | 4 | 5 | | ! * +---+---+---+---+ | ! * 64 | 6 | 7 | 8 | 9 | | ! * +---+---+---+---+-----------------------------------------------+ * * \_______________/ * Pixmap Cache --- 20,44 ---- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Modified for the Mach-8 by Rickard E. Faith + * Small fix to enable use without font or pixmap cache. + * Hans Nasten. (nasten@everyware.se) + * */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8pcach.c,v 2.10 1994/02/01 14:25:05 dawes Exp $ */ ! /* Offscreen memory organization at 1024x768: * ! * 128 64 64 768 ! * +-------+---+---+-----------------------------------------------+ ! * | | 2 | 3 | | ! * 128 | 0 +---+---+ | ! * | | 4 | 5 | | ! * +-------+---+---+ FONTS | 256 ! * | | 6 | 7 | | ! * 128 | 1 +---+---+ | ! * | | 8 | 9 | | ! * +-------+---+---+-----------------------------------------------+ * * \_______________/ * Pixmap Cache *************** *** 108,125 **** int count128 = 0,count64 = 0; int next=0; ! totalx=mach8InfoRec.virtualX; ! totaly=(mach8InfoRec.videoRam*1024) / totalx; if (totaly>1024) totaly=1024; ! freex=mach8InfoRec.virtualX; ! freey=totaly-mach8InfoRec.virtualY; ! if (x386Verbose) ! ErrorF("%s %s: Total memory %dx%d (%dx%d in cache)\n", XCONFIG_PROBED, ! mach8InfoRec.name, totalx, totaly, freex, freey); ! for (i = 0; i < MAX_SLOTS; i++) { cInfo[i].id = -2; cInfo[i].lru = 0; --- 111,139 ---- int count128 = 0,count64 = 0; int next=0; ! if( mach8InfoRec.videoRam > 512 ) ! totalx = 1024; ! else ! totalx = mach8InfoRec.virtualX; + totaly = (mach8InfoRec.videoRam*1024) / totalx; + if (totaly>1024) totaly=1024; ! freex = totalx; ! freey = totaly-mach8InfoRec.virtualY; ! if (x386Verbose) { ! if( mach8InfoRec.videoRam > 512 && mach8InfoRec.virtualX < 1024 ) ! ErrorF("%s %s: Total memory %dx%d (%dx%d + %dx%d in cache)\n", ! XCONFIG_PROBED, mach8InfoRec.name, ! totalx, totaly, freex, freey, ! 1024 - mach8InfoRec.virtualX, mach8InfoRec.virtualY); ! else ! ErrorF("%s %s: Total memory %dx%d (%dx%d in cache)\n", ! XCONFIG_PROBED, mach8InfoRec.name, ! totalx, totaly, freex, freey); ! } for (i = 0; i < MAX_SLOTS; i++) { cInfo[i].id = -2; cInfo[i].lru = 0; *************** *** 209,214 **** --- 223,231 ---- cInfo[pix->slot].id == pix->cacheId) return 1; + if( !CacheSlots ) + return( 0 ); + if (pix->drawable.width <= 64 && pix->drawable.height <= 64) { next = CacheSlots-1; for (i = CacheFirst64; i < CacheSlots; i++) *************** *** 276,284 **** else pci->id = pix->cacheId = NEXT_CACHE_ID; ! mach8ImageWrite(pci->x, pci->y, pci->pix_w, pci->pix_h, ! pix->devPrivate.ptr, pix->devKind, 0, 0, ! MIX_SRC, 0xffff); DoCacheExpandPixmap(pci); } --- 293,301 ---- else pci->id = pix->cacheId = NEXT_CACHE_ID; ! (mach8ImageWriteFunc)(pci->x, pci->y, pci->pix_w, pci->pix_h, ! pix->devPrivate.ptr, pix->devKind, 0, 0, ! MIX_SRC, 0xffff); DoCacheExpandPixmap(pci); } *************** *** 302,311 **** else pci->id = pix->cacheId = NEXT_CACHE_ID; ! mach8ImageOpStipple(pci->x, pci->y, pci->pix_w, pci->pix_h, ! pix->devPrivate.ptr, pix->devKind, ! pci->pix_w, pci->pix_h, pci->x, pci->y, ! 255, 0, MIX_SRC, 0xffff); DoCacheExpandPixmap(pci); } --- 319,328 ---- else pci->id = pix->cacheId = NEXT_CACHE_ID; ! (mach8ImageStippleFunc)(pci->x, pci->y, pci->pix_w, pci->pix_h, ! pix->devPrivate.ptr, pix->devKind, ! pci->pix_w, pci->pix_h, pci->x, pci->y, ! 255, 0, MIX_SRC, 0xffff, 1); DoCacheExpandPixmap(pci); } *************** *** 487,493 **** int xwmid, ywmid, orig_xwmid; int startx, starty, endx, endy; int orig_x = x; - int i; if (w == 0 || h == 0) return; --- 504,509 ---- diff -c mit/server/ddx/x386/accel/mach8/mach8scrin.c:2.1 mit/server/ddx/x386/accel/mach8/mach8scrin.c:2.4 *** mit/server/ddx/x386/accel/mach8/mach8scrin.c:2.1 Fri Mar 11 23:37:43 1994 --- mit/server/ddx/x386/accel/mach8/mach8scrin.c Fri Mar 11 23:37:43 1994 *************** *** 38,44 **** ********************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8scrin.c,v 2.1 1993/09/04 16:28:37 dawes Exp $ */ /* $XConsortium: cfbscrinit.c,v 5.18 90/09/24 17:46:11 rws Exp $ */ --- 38,44 ---- ********************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8scrin.c,v 2.4 1993/12/25 13:59:05 dawes Exp $ */ /* $XConsortium: cfbscrinit.c,v 5.18 90/09/24 17:46:11 rws Exp $ */ *************** *** 60,65 **** --- 60,67 ---- extern RegionPtr mfbPixmapToRegion(); extern Bool mfbAllocatePrivates(); + extern Bool mfbRegisterCopyPlaneProc(); + extern Bool miScreenInit(); extern int defaultColorVisualClass; *************** *** 99,106 **** #define NUMDEPTHS ((sizeof depths)/(sizeof depths[0])) - int cfbWindowPrivateIndex; - int cfbGCPrivateIndex; static unsigned long cfbGeneration = 0; miBSFuncRec mach8BSFuncRec = { --- 101,106 ---- *************** *** 156,162 **** pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0; pScreen->QueryBestSize = mfbQueryBestSize; /* SaveScreen */ ! pScreen->GetImage = miGetImage; pScreen->GetSpans = mach8GetSpans; pScreen->CreateWindow = cfbCreateWindow; pScreen->DestroyWindow = cfbDestroyWindow; --- 156,162 ---- pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0; pScreen->QueryBestSize = mfbQueryBestSize; /* SaveScreen */ ! pScreen->GetImage = mach8GetImage; pScreen->GetSpans = mach8GetSpans; pScreen->CreateWindow = cfbCreateWindow; pScreen->DestroyWindow = cfbDestroyWindow; diff -c mit/server/ddx/x386/accel/mach8/mach8seg.c:2.5 mit/server/ddx/x386/accel/mach8/mach8seg.c:2.6 *** mit/server/ddx/x386/accel/mach8/mach8seg.c:2.5 Fri Mar 11 23:37:44 1994 --- mit/server/ddx/x386/accel/mach8/mach8seg.c Fri Mar 11 23:37:44 1994 *************** *** 27,33 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8seg.c,v 2.5 1993/10/08 15:57:41 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ --- 27,33 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8seg.c,v 2.6 1993/12/25 13:59:07 dawes Exp $ */ /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ *************** *** 109,116 **** unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - unsigned long *addrl; /* address of destination pixmap */ - int nlwidth; /* width in longwords of destination pixmap */ int xorg, yorg; /* origin of window */ int adx; /* abs values of dx and dy */ --- 109,114 ---- *************** *** 131,138 **** register int x1, x2; RegionPtr cclip; cfbPrivGCPtr devPriv; - unsigned long xor, and; - int alu; /* 11-jun-93 TCG : is VT visible */ if (!x386VTSema) --- 129,134 ---- diff -c mit/server/ddx/x386/accel/mach8/mach8ss.c:2.2 mit/server/ddx/x386/accel/mach8/mach8ss.c:2.3 *** mit/server/ddx/x386/accel/mach8/mach8ss.c:2.2 Fri Mar 11 23:37:44 1994 --- mit/server/ddx/x386/accel/mach8/mach8ss.c Fri Mar 11 23:37:45 1994 *************** *** 27,33 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8ss.c,v 2.2 1993/08/17 16:15:42 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 27,33 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8ss.c,v 2.3 1994/02/01 13:51:45 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 149,157 **** cfbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu, pdstBase, widthDst, pGC->planemask); ***************/ ! mach8ImageWrite(xStart, ppt->y, xEnd-xStart, 1, ! psrc + (xStart-ppt->x), xEnd-xStart, 0, 0, ! mach8alu[alu], pGC->planemask); if(ppt->x + *pwidth <= pbox->x2) { /* End of the line, as it were */ --- 149,157 ---- cfbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu, pdstBase, widthDst, pGC->planemask); ***************/ ! (mach8ImageWriteFunc)(xStart, ppt->y, xEnd-xStart, 1, ! psrc + (xStart-ppt->x), xEnd-xStart, ! 0, 0, mach8alu[alu], pGC->planemask); if(ppt->x + *pwidth <= pbox->x2) { /* End of the line, as it were */ *************** *** 198,206 **** cfbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu, pdstBase, widthDst, pGC->planemask); **************/ ! mach8ImageWrite(xStart, ppt->y, xEnd-xStart, 1, ! psrc + (xStart-ppt->x), xEnd-xStart, 0, 0, ! mach8alu[alu], pGC->planemask); } } --- 198,207 ---- cfbSetScanline(ppt->y, ppt->x, xStart, xEnd, psrc, alu, pdstBase, widthDst, pGC->planemask); **************/ ! (mach8ImageWriteFunc)(xStart, ppt->y, xEnd-xStart, 1, ! psrc + (xStart-ppt->x), ! xEnd-xStart, 0, 0, ! mach8alu[alu], pGC->planemask); } } diff -c mit/server/ddx/x386/accel/mach8/mach8text.c:2.2 mit/server/ddx/x386/accel/mach8/mach8text.c:2.5 *** mit/server/ddx/x386/accel/mach8/mach8text.c:2.2 Fri Mar 11 23:37:45 1994 --- mit/server/ddx/x386/accel/mach8/mach8text.c Fri Mar 11 23:37:45 1994 *************** *** 22,30 **** * * Modified for the Mach-8 by Rickard E. Faith (faith@cs.unc.edu) * Further modifications by Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8text.c,v 2.2 1993/09/09 06:01:21 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 22,33 ---- * * Modified for the Mach-8 by Rickard E. Faith (faith@cs.unc.edu) * Further modifications by Tiago Gons (tiago@comosjn.hobby.nl) + * Adapted to use accelerated text output without font cache. + * Hans Nasten (nasten@everyware.se) + * */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8text.c,v 2.5 1994/01/09 03:30:30 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 35,42 **** --- 38,49 ---- #include "scrnintstr.h" #include "pixmapstr.h" #include "dixfontstr.h" + #include "mi.h" #include "mach8.h" + extern int mach8CPolyText8(); + extern int mach8CImageText8(); + int mach8PolyText8(pDraw, pGC, x, y, count, chars) DrawablePtr pDraw; *************** *** 45,51 **** int count; char *chars; { ! int plane; /* 11-jun-93 TCG : is VT visible */ if (!x386VTSema) --- 52,58 ---- int count; char *chars; { ! void *vpnt; /* 11-jun-93 TCG : is VT visible */ if (!x386VTSema) *************** *** 53,63 **** return miPolyText8(pDraw, pGC, x, y, count, chars); } ! if (((plane = mach8CacheFont8(pGC->font)) == -1) || (pGC->fillStyle != FillSolid)) return miPolyText8(pDraw, pGC, x, y, count, chars); else ! return mach8CPolyText8(pDraw, pGC, x, y, count, chars, plane); } --- 60,70 ---- return miPolyText8(pDraw, pGC, x, y, count, chars); } ! if (((vpnt = mach8CacheFont8(pGC->font)) == NULL) || (pGC->fillStyle != FillSolid)) return miPolyText8(pDraw, pGC, x, y, count, chars); else ! return mach8CPolyText8(pDraw, pGC, x, y, count, chars, vpnt); } *************** *** 81,88 **** int count; char *chars; { - int plane; - /* 11-jun-93 TCG : is VT visible */ if (!x386VTSema) { --- 88,93 ---- *************** *** 91,100 **** } /* Don't need to check fill style here - it isn't used in image text */ ! if ((plane = mach8CacheFont8(pGC->font)) == -1) ! miImageText8(pDraw, pGC, x, y, count, chars); ! else ! mach8CImageText8(pDraw, pGC, x, y, count, chars, plane); } --- 96,105 ---- } /* Don't need to check fill style here - it isn't used in image text */ ! ! mach8CImageText8( pDraw, pGC, x, y, count, chars, ! mach8CacheFont8(pGC->font) ); ! } diff -c mit/server/ddx/x386/accel/mach8/mach8win.c:2.2 mit/server/ddx/x386/accel/mach8/mach8win.c:2.3 *** mit/server/ddx/x386/accel/mach8/mach8win.c:2.2 Fri Mar 11 23:37:45 1994 --- mit/server/ddx/x386/accel/mach8/mach8win.c Fri Mar 11 23:37:46 1994 *************** *** 27,33 **** ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8win.c,v 2.2 1993/08/17 16:15:44 dawes Exp $ */ #include "X.h" #include "input.h" --- 27,33 ---- ******************************************************************/ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/mach8win.c,v 2.3 1993/12/25 13:59:10 dawes Exp $ */ #include "X.h" #include "input.h" *************** *** 42,47 **** --- 42,48 ---- #include "x386.h" #include "x386Priv.h" #include "regmach8.h" + #include "mach8.h" void mach8CopyWindow(pWin, ptOldOrg, prgnSrc) diff -c mit/server/ddx/x386/accel/mach8/regmach8.h:2.8 mit/server/ddx/x386/accel/mach8/regmach8.h:2.10 *** mit/server/ddx/x386/accel/mach8/regmach8.h:2.8 Fri Mar 11 23:37:46 1994 --- mit/server/ddx/x386/accel/mach8/regmach8.h Fri Mar 11 23:37:46 1994 *************** *** 22,28 **** * and Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/regmach8.h,v 2.8 1993/10/02 16:51:20 dawes Exp $ */ #ifndef _MACH8_ASM_ #include "compiler.h" --- 22,28 ---- * and Tiago Gons (tiago@comosjn.hobby.nl) */ ! /* $XFree86: mit/server/ddx/x386/accel/mach8/regmach8.h,v 2.10 1994/03/03 12:43:41 dawes Exp $ */ #ifndef _MACH8_ASM_ #include "compiler.h" *************** *** 96,101 **** --- 96,104 ---- #define PIX_CNTL 0xa000 #define PIX_TRANS 0xe2e8 + /* Composite sync bit in clock select register. */ + #define COMPOSITE_SYNC 0x1000 + /* Display Status Bit Fields */ #define HORTOG 0x0004 #define VBLANK 0x0002 *************** *** 281,286 **** --- 284,299 ---- /* Wait until GP is idle and queue is empty */ #define WaitIdleEmpty() { while (inw(GP_STAT) & (GPBUSY | 1)); } + + /* + * This version is for use in mach8Probe() to prevent a server hang if + * there is no 8514/A-style chip present + */ + #define ProbeWaitIdleEmpty() { int i; \ + for (i = 0; i < 100000; i++) \ + if (!(inw(GP_STAT) & (GPBUSY | 1))) \ + break; \ + } /* Wait until GP has data available */ #define WaitDataReady() { while (!(inw(GP_STAT) & DATARDY)); } diff -c mit/server/ddx/x386/accel/s3/Imakefile:2.10 mit/server/ddx/x386/accel/s3/Imakefile:2.11 *** mit/server/ddx/x386/accel/s3/Imakefile:2.10 Fri Mar 11 23:37:52 1994 --- mit/server/ddx/x386/accel/s3/Imakefile Fri Mar 11 23:37:53 1994 *************** *** 1,4 **** ! XCOMM $XFree86: mit/server/ddx/x386/accel/s3/Imakefile,v 2.10 1993/09/23 15:44:34 dawes Exp $ XCOMM Id: Imakefile,v 1.1 1993/06/18 13:32:08 jon Exp jon #include --- 1,4 ---- ! XCOMM $XFree86: mit/server/ddx/x386/accel/s3/Imakefile,v 2.11 1994/01/09 03:30:47 dawes Exp $ XCOMM Id: Imakefile,v 1.1 1993/06/18 13:32:08 jon Exp jon #include *************** *** 12,18 **** s3scrin.c s3blt.c s3pcach.c s3plypt.c \ s3line.c s3seg.c s3frect.c s3text.c \ s3font.c s3fcach.c s3Cursor.c s3BtCursor.c vgaHW.c s3dline.c \ ! s3dseg.c s3bcach.c s3gtimg.c OBJS = s3.o s3misc.o s3cmap.o s3gc.o s3fs.o s3ss.o \ s3gs.o s3win.o s3init.o s3im.o s3bstor.o \ --- 12,18 ---- s3scrin.c s3blt.c s3pcach.c s3plypt.c \ s3line.c s3seg.c s3frect.c s3text.c \ s3font.c s3fcach.c s3Cursor.c s3BtCursor.c vgaHW.c s3dline.c \ ! s3dseg.c s3bcach.c s3gtimg.c s3TiCursor.c OBJS = s3.o s3misc.o s3cmap.o s3gc.o s3fs.o s3ss.o \ s3gs.o s3win.o s3init.o s3im.o s3bstor.o \ *************** *** 19,25 **** s3scrin.o s3blt.o s3pcach.o s3plypt.o \ s3line.o s3seg.o s3frect.o s3text.o \ s3font.o s3fcach.o s3Cursor.o s3BtCursor.o vgaHW.o s3dline.o \ ! s3dseg.o s3bcach.o s3gtimg.o INCLUDES = -I../.. -I. -I../../../mfb -I../../../mi -I../../../../include \ -I../../../cfb -I$(INCLUDESRC) -I$(FONTSRC)/include \ --- 19,25 ---- s3scrin.o s3blt.o s3pcach.o s3plypt.o \ s3line.o s3seg.o s3frect.o s3text.o \ s3font.o s3fcach.o s3Cursor.o s3BtCursor.o vgaHW.o s3dline.o \ ! s3dseg.o s3bcach.o s3gtimg.o s3TiCursor.o INCLUDES = -I../.. -I. -I../../../mfb -I../../../mi -I../../../../include \ -I../../../cfb -I$(INCLUDESRC) -I$(FONTSRC)/include \ diff -c mit/server/ddx/x386/accel/s3/regs3.h:2.9 mit/server/ddx/x386/accel/s3/regs3.h:2.13 *** mit/server/ddx/x386/accel/s3/regs3.h:2.9 Fri Mar 11 23:37:53 1994 --- mit/server/ddx/x386/accel/s3/regs3.h Fri Mar 11 23:37:53 1994 *************** *** 19,25 **** * */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/regs3.h,v 2.9 1993/09/22 15:43:18 dawes Exp $ */ #ifndef _S3_H #define _S3_H --- 19,25 ---- * */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/regs3.h,v 2.13 1994/03/08 10:28:52 dawes Exp $ */ #ifndef _S3_H #define _S3_H *************** *** 70,83 **** #define S3_911_ONLY(chip) (chip==0x81) #define S3_924_ONLY(chip) (chip==0x82) - #if 0 - /* XXXX These are NOT valid. These will only detect certains steps */ - #define S3_801_ONLY(chip) (chip==0xa0) - #define S3_928_ONLY(chip) (chip==0x90) - #endif #define S3_911_SERIES(chip) ((chip&0xf0)==0x80) #define S3_801_SERIES(chip) ((chip&0xf0)==0xa0) #define S3_928_SERIES(chip) (((chip&0xf0)==0x90)||((chip&0xf0)==0xb0)) #define S3_801_928_SERIES(chip) (S3_801_SERIES(chip)||S3_928_SERIES(chip)) #define S3_8XX_9XX_SERIES(chip) (S3_911_SERIES(chip)||S3_801_928_SERIES(chip)) #define S3_ANY_SERIES(chip) (S3_8XX_9XX_SERIES(chip)) --- 70,81 ---- #define S3_911_ONLY(chip) (chip==0x81) #define S3_924_ONLY(chip) (chip==0x82) #define S3_911_SERIES(chip) ((chip&0xf0)==0x80) #define S3_801_SERIES(chip) ((chip&0xf0)==0xa0) + #define S3_801_I_SERIES(chip) (S3_801_SERIES(chip) && ((chip) & 0x08)) + #define S3_801_REV_C(chip) (S3_801_SERIES(chip) && ((chip) & 0x07) >= 2) #define S3_928_SERIES(chip) (((chip&0xf0)==0x90)||((chip&0xf0)==0xb0)) + #define S3_928_REV_E(chip) (S3_928_SERIES(chip) && ((chip) & 0x0F) >= 4) #define S3_801_928_SERIES(chip) (S3_801_SERIES(chip)||S3_928_SERIES(chip)) #define S3_8XX_9XX_SERIES(chip) (S3_911_SERIES(chip)||S3_801_928_SERIES(chip)) #define S3_ANY_SERIES(chip) (S3_8XX_9XX_SERIES(chip)) diff -c mit/server/ddx/x386/accel/s3/s3.c:2.51 mit/server/ddx/x386/accel/s3/s3.c:2.79 *** mit/server/ddx/x386/accel/s3/s3.c:2.51 Fri Mar 11 23:37:54 1994 --- mit/server/ddx/x386/accel/s3/s3.c Fri Mar 11 23:37:54 1994 *************** *** 31,37 **** * Id: s3.c,v 2.6 1993/08/09 06:17:57 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3.c,v 2.51 1993/10/16 17:31:09 dawes Exp $ */ #include "cfb.h" #include "pixmapstr.h" --- 31,37 ---- * Id: s3.c,v 2.6 1993/08/09 06:17:57 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3.c,v 2.79 1994/03/08 10:28:57 dawes Exp $ */ #include "cfb.h" #include "pixmapstr.h" *************** *** 46,53 **** #include "vga.h" #include "s3linear.h" #include "s3Bt485.h" ! extern int s3MaxClock, s3MaxBt485Clock; char s3Mbanks; extern void NoopDDA(); void s3PrintIdent(); --- 46,56 ---- #include "vga.h" #include "s3linear.h" #include "s3Bt485.h" + #include "s3Ti3020.h" ! extern int s3MaxClock; ! extern int s3MaxBt485Clock, s3MaxBt485MuxClock; ! extern int s3MaxTi3020Clock, s3MaxTi3020ClockFast; char s3Mbanks; extern void NoopDDA(); void s3PrintIdent(); *************** *** 84,89 **** --- 87,93 ---- 0, /* int maxClock */ 0, /* int videoRam */ 0xC0000, /* int BIOSbase */ + 0, /* unsigned long MemBase */ 240, 180, /* int width, height */ 0, /* unsigned long speedup */ NULL, /* DisplayModePtr modes */ *************** *** 133,138 **** --- 137,143 ---- Bool s3Localbus = FALSE; Bool s3LinearAperture = FALSE; Bool s3Mmio928 = FALSE; + Bool s3DAC8Bit = FALSE; unsigned char s3LinApOpt; int s3BankSize; int s3DisplayWidth; *************** *** 141,154 **** extern Bool x386Exiting, x386Resetting, x386ProbeFailed, x386Verbose; - static Bool AlreadyInited = FALSE; - static Bool s3ModeSwitched = FALSE; - int s3ScissB; unsigned char s3SwapBits[256]; unsigned char s3Port40; unsigned char s3Port51; unsigned char s3Port54; void (*s3ImageReadFunc)(); void (*s3ImageWriteFunc)(); void (*s3ImageFillFunc)(); --- 146,159 ---- extern Bool x386Exiting, x386Resetting, x386ProbeFailed, x386Verbose; int s3ScissB; unsigned char s3SwapBits[256]; unsigned char s3Port40; unsigned char s3Port51; unsigned char s3Port54; + unsigned char s3Port59 = 0x00; + unsigned char s3Port5A = 0x0A; + unsigned char s3Port31 = 0x8d; void (*s3ImageReadFunc)(); void (*s3ImageWriteFunc)(); void (*s3ImageFillFunc)(); *************** *** 157,162 **** --- 162,171 ---- CacheFont8Ptr s3HeadFont, s3FontCache; int s3hotX, s3hotY; Bool s3BlockCursor, s3ReloadCursor; + int s3CursorStartX, s3CursorStartY, s3CursorLines; + int s3RamdacType = UNKNOWN_DAC; + Bool s3UsingPixMux = FALSE; + Bool s3Bt485PixMux = FALSE; /* *************** *** 203,213 **** s3Probe() { DisplayModePtr pMode, pEnd; ! unsigned char config, tmp; int i, j, numClocks; int tx, ty; OFlagSet validOptions; xf86ClearIOPortList(s3InfoRec.scrnIndex); xf86AddIOPorts(s3InfoRec.scrnIndex, Num_VGA_IOPorts, VGA_IOPorts); xf86AddIOPorts(s3InfoRec.scrnIndex, Num_S3_IOPorts, S3_IOPorts); --- 212,253 ---- s3Probe() { DisplayModePtr pMode, pEnd; ! unsigned char config, tmp, tmp1; int i, j, numClocks; int tx, ty; + int maxDisplayWidth, maxDisplayHeight; OFlagSet validOptions; + /* + * These characterise a RAMDACs pixel multiplexing capabilities and + * requirements: + * + * pixMuxPossible - pixmux is supported for the current RAMDAC + * allowPixMuxInterlace - pixmux supports interlaced modes + * allowPixMuxSwitching - possible to use pixmux for some modes + * and non-pixmux for others + * pixMuxMinWidth - smallest physical width supported in + * pixmux mode + * nonMuxMaxClock - highest dot clock supported without pixmux + * nonMuxMaxMemory - max video memory accessible without pixmux + * pixMuxLimitedWidths - pixmux only works for logical display + * widths 1024 and 2048 + * pixMuxInterlaceOK - FALSE if pixmux isn't possible because + * there is an interlaced mode present + * pixMuxWidthOK - FALSE if pixmux isn't possible because + * there is mode has too small a width + */ + Bool pixMuxPossible = FALSE; + Bool allowPixMuxInterlace = FALSE; + Bool allowPixMuxSwitching = FALSE; + Bool pixMuxNeeded = FALSE; + int pixMuxMinWidth = 1024; + int nonMuxMaxClock = 0; + int nonMuxMaxMemory = 4096; + Bool pixMuxLimitedWidths = TRUE; + Bool pixMuxInterlaceOK = TRUE; + Bool pixMuxWidthOK = TRUE; + xf86ClearIOPortList(s3InfoRec.scrnIndex); xf86AddIOPorts(s3InfoRec.scrnIndex, Num_VGA_IOPorts, VGA_IOPorts); xf86AddIOPorts(s3InfoRec.scrnIndex, Num_S3_IOPorts, S3_IOPorts); *************** *** 279,310 **** OFLG_SET(OPTION_NOLINEAR_MODE, &validOptions); OFLG_SET(OPTION_NO_MEM_ACCESS, &validOptions); OFLG_SET(OPTION_MEM_ACCESS, &validOptions); OFLG_SET(OPTION_BT485, &validOptions); - OFLG_SET(OPTION_NO_BT485, &validOptions); OFLG_SET(OPTION_BT485_CURS, &validOptions); OFLG_SET(OPTION_SHOWCACHE, &validOptions); xf86VerifyOptions(&validOptions, &s3InfoRec); ! if (OFLG_ISSET(OPTION_MEM_ACCESS, &s3InfoRec.options) && ! OFLG_ISSET(OPTION_NO_MEM_ACCESS, &s3InfoRec.options)) { ! ErrorF("%s: Warning: Options \"memaccess\" and \"nomemaccess\" are ", s3InfoRec.name); ! ErrorF("incompatible.\n\t\"nomemaccess\" will be assumed.\n"); } ! s3Localbus = ((config & 0x03) == 1); if (x386Verbose) { ! if ((config & 0x03) == 0) { ErrorF("%s %s: card type: EISA\n", ! XCONFIG_PROBED, s3InfoRec.name); ! } ! if (s3Localbus) { ErrorF("%s %s: card type: 386/486 localbus\n", ! XCONFIG_PROBED, s3InfoRec.name); ! } ! if ((config & 0x03) == 3) { ErrorF("%s %s: card type: ISA\n", ! XCONFIG_PROBED, s3InfoRec.name); } } --- 319,370 ---- OFLG_SET(OPTION_NOLINEAR_MODE, &validOptions); OFLG_SET(OPTION_NO_MEM_ACCESS, &validOptions); OFLG_SET(OPTION_MEM_ACCESS, &validOptions); + OFLG_SET(OPTION_NORMAL_DAC, &validOptions); OFLG_SET(OPTION_BT485, &validOptions); OFLG_SET(OPTION_BT485_CURS, &validOptions); OFLG_SET(OPTION_SHOWCACHE, &validOptions); + OFLG_SET(OPTION_FB_DEBUG, &validOptions); + OFLG_SET(OPTION_TI3020, &validOptions); + OFLG_SET(OPTION_TI3020_CURS, &validOptions); + OFLG_SET(OPTION_NO_TI3020_CURS, &validOptions); + OFLG_SET(OPTION_TI3020_FAST, &validOptions); + OFLG_SET(OPTION_DAC_8_BIT, &validOptions); + OFLG_SET(OPTION_20C505, &validOptions); + OFLG_SET(OPTION_FAST_DRAM, &validOptions); + OFLG_SET(OPTION_MED_DRAM, &validOptions); + OFLG_SET(OPTION_SLOW_DRAM, &validOptions); + OFLG_SET(OPTION_ATT490_1, &validOptions); + OFLG_SET(OPTION_SC15025, &validOptions); + OFLG_SET(OPTION_SPEA_MERCURY, &validOptions); + #ifdef NUMNINETEST + OFLG_SET(OPTION_NUMBER_NINE, &validOptions); + #endif xf86VerifyOptions(&validOptions, &s3InfoRec); ! if (OFLG_ISSET(OPTION_MEM_ACCESS, &s3InfoRec.options)) { ! ErrorF("%s: Warning: the \"memaccess\" option is now redundant\n", s3InfoRec.name); ! ErrorF("\tIt will be removed in the next release\n"); } ! s3Localbus = ((config & 0x03) <= 1); /* LocalBus or EISA */ if (x386Verbose) { ! switch (config & 0x03) { ! case 0: ErrorF("%s %s: card type: EISA\n", ! XCONFIG_PROBED, s3InfoRec.name); ! break; ! case 1: ErrorF("%s %s: card type: 386/486 localbus\n", ! XCONFIG_PROBED, s3InfoRec.name); ! break; ! case 3: ErrorF("%s %s: card type: ISA\n", ! XCONFIG_PROBED, s3InfoRec.name); ! break; ! default: ! ErrorF("%s %s: card type: unknown (%d)\n", ! XCONFIG_PROBED, s3InfoRec.name, config & 0x03); } } *************** *** 312,324 **** if (S3_801_928_SERIES(s3ChipId)) { if (S3_801_SERIES(s3ChipId)) { if (!((config & 0x03) == 3)) ! ErrorF("%s %s: chipset: 805\n", ! XCONFIG_PROBED, s3InfoRec.name); else ! ErrorF("%s %s: chipset: 801\n", ! XCONFIG_PROBED, s3InfoRec.name); } else if (S3_928_SERIES(s3ChipId)) { ! ErrorF("%s %s: chipset: 928 \n", XCONFIG_PROBED, s3InfoRec.name); } } else if (S3_911_SERIES(s3ChipId)) { --- 372,395 ---- if (S3_801_928_SERIES(s3ChipId)) { if (S3_801_SERIES(s3ChipId)) { if (!((config & 0x03) == 3)) ! ErrorF("%s %s: chipset: 805", ! XCONFIG_PROBED, s3InfoRec.name); else ! ErrorF("%s %s: chipset: 801", ! XCONFIG_PROBED, s3InfoRec.name); ! if (S3_801_I_SERIES(s3ChipId)) ! ErrorF("i"); ! ErrorF(", "); ! if (S3_801_REV_C(s3ChipId)) ! ErrorF("rev C or above\n"); ! else ! ErrorF("rev A or B\n"); } else if (S3_928_SERIES(s3ChipId)) { ! if (S3_928_REV_E(s3ChipId)) ! ErrorF("%s %s: chipset: 928, rev E or above\n", ! XCONFIG_PROBED, s3InfoRec.name); ! else ! ErrorF("%s %s: chipset: 928, rev D or below\n", XCONFIG_PROBED, s3InfoRec.name); } } else if (S3_911_SERIES(s3ChipId)) { *************** *** 366,377 **** } } if (x386Verbose) { ! ErrorF("%s %s: videoram: %dk", XCONFIG_PROBED, s3InfoRec.name, s3InfoRec.videoRam); } } else { if (x386Verbose) { ! ErrorF("%s %s: videoram: %dk", XCONFIG_GIVEN, s3InfoRec.name, s3InfoRec.videoRam); } } --- 437,448 ---- } } if (x386Verbose) { ! ErrorF("%s %s: videoram: %dk\n", XCONFIG_PROBED, s3InfoRec.name, s3InfoRec.videoRam); } } else { if (x386Verbose) { ! ErrorF("%s %s: videoram: %dk\n", XCONFIG_GIVEN, s3InfoRec.name, s3InfoRec.videoRam); } } *************** *** 380,416 **** else s3Mbanks = 0; ! if (OFLG_ISSET(OPTION_LEGEND, &s3InfoRec.options)) { ! s3ClockSelectFunc = LegendClockSelect; ! numClocks = 32; } else { ! s3ClockSelectFunc = s3ClockSelect; ! numClocks = 16; } ! if (OFLG_ISSET(CLOCK_OPTION_ICD2061A, &s3InfoRec.clockOptions)) { s3ClockSelectFunc = icd2061ClockSelect; if (x386Verbose) ! ErrorF("\n%s %s: Using ICD2061A programmable clock\n", XCONFIG_GIVEN, s3InfoRec.name); numClocks = 3; } else if (OFLG_ISSET(CLOCK_OPTION_ICD2061ASL, &s3InfoRec.clockOptions)) { s3ClockSelectFunc = icd2061ClockSelect; if (x386Verbose) ! ErrorF("\n%s %s: Using slow ICD2061A programmable clock\n", XCONFIG_GIVEN, s3InfoRec.name); numClocks = 3; ! } else if (!s3InfoRec.clocks) ! vgaGetClocks(numClocks, s3ClockSelectFunc); if (x386Verbose) { if (! OFLG_ISSET(CLOCK_OPTION_PROGRAMABLE, &s3InfoRec.clockOptions)) { for (j = 0; j < s3InfoRec.clocks; j++) { ! if ((j % 8) == 0) ! ErrorF("\n%s %s: clocks:", OFLG_ISSET(XCONFIG_CLOCKS,&s3InfoRec.xconfigFlag) ? XCONFIG_GIVEN : XCONFIG_PROBED , s3InfoRec.name); ErrorF(" %6.2f", (double)s3InfoRec.clock[j] / 1000.0); } ErrorF("\n"); --- 451,707 ---- else s3Mbanks = 0; ! /* ! * Handle RAMDAC Option flags first. ! */ ! if (OFLG_ISSET(OPTION_NORMAL_DAC, &s3InfoRec.options)) { ! s3RamdacType = NORMAL_DAC; ! } ! if (OFLG_ISSET(OPTION_BT485, &s3InfoRec.options)) { ! if (s3RamdacType != UNKNOWN_DAC) { ! ErrorF("%s %s: Only one RAMDAC Option may be specified. %s\n", ! s3InfoRec.name, XCONFIG_PROBED, "Ignoring \"bt485\""); ! } else { ! if (!S3_928_SERIES(s3ChipId)) { ! ErrorF("%s %s: Bt485 is only supported on 928\n", ! XCONFIG_PROBED, s3InfoRec.name); ! OFLG_CLR(OPTION_BT485, &s3InfoRec.options); ! } else { ! ErrorF("%s %s: Programming for BrookTree Bt485 RAMDAC\n", ! XCONFIG_GIVEN, s3InfoRec.name); ! s3RamdacType = BT485_DAC; ! } ! } ! } ! if (OFLG_ISSET(OPTION_20C505, &s3InfoRec.options)) { ! if (s3RamdacType != UNKNOWN_DAC) { ! ErrorF("%s %s: Only one RAMDAC Option may be specified. %s\n", ! s3InfoRec.name, XCONFIG_PROBED, "Ignoring \"20c505\""); ! } else { ! if (!S3_928_SERIES(s3ChipId)) { ! ErrorF("%s %s: 20C505 is only supported on 928\n", ! XCONFIG_PROBED, s3InfoRec.name); ! OFLG_CLR(OPTION_20C505, &s3InfoRec.options); ! } else { ! ErrorF("%s %s: Programming for AT&T 20C505 RAMDAC\n", ! XCONFIG_GIVEN, s3InfoRec.name); ! s3RamdacType = ATT20C505_DAC; ! } ! } ! } ! if (OFLG_ISSET(OPTION_TI3020_FAST, &s3InfoRec.options)) { ! OFLG_SET(OPTION_TI3020, &s3InfoRec.options); ! } ! if (OFLG_ISSET(OPTION_TI3020, &s3InfoRec.options)) { ! if (s3RamdacType != UNKNOWN_DAC) { ! ErrorF("%s %s: Only one RAMDAC Option may be specified. %s\n", ! s3InfoRec.name, XCONFIG_PROBED, "Ignoring \"ti3020\""); ! } else { ! if (!S3_928_SERIES(s3ChipId)) { ! ErrorF("%s %s: Ti3020 is only supported on 928\n", ! XCONFIG_PROBED, s3InfoRec.name); ! OFLG_CLR(OPTION_TI3020, &s3InfoRec.options); ! } else { ! ErrorF("%s %s: Programming for Ti ViewPoint 3020 RAMDAC\n", ! XCONFIG_GIVEN, s3InfoRec.name); ! s3RamdacType = TI3020_DAC; ! } ! } ! } ! ! /* Make sure CR55 is unlocked for Bt485 probe */ ! outb(vgaCRIndex, 0x39); ! outb(vgaCRReg, 0xA5); ! ! /* For chipsets other than 928, there is only one RAMDAC type possible */ ! if (!S3_928_SERIES(s3ChipId)) { ! s3RamdacType = NORMAL_DAC; ! } else if (s3RamdacType == UNKNOWN_DAC) { ! /* Otherwise, probe for the RAMDAC type */ ! /* ! * Bt485/AT&T20C505 first ! * ! * Probe for the bloody thing. Set 0x3C6 to a bogus value, then ! * try to get the Bt485 status register. If it's there, then we will ! * get something else back from this port. ! */ ! unsigned char tmp2; ! tmp = inb(0x3C6); ! outb(0x3C6, 0x0F); ! if (((tmp2 = s3InBtStatReg()) & 0x80) == 0x80) { ! /* ! * Found either a BrookTree Bt485 or AT&T 20C505. ! */ ! if ((tmp2 & 0xF0) == 0xD0) { ! s3RamdacType = ATT20C505_DAC; ! ErrorF("%s %s: Detected an AT&T 20C505 RAMDAC\n", ! XCONFIG_PROBED, s3InfoRec.name); ! } else { ! s3RamdacType = BT485_DAC; ! ErrorF("%s %s: Detected a BrookTree Bt485 RAMDAC\n", ! XCONFIG_PROBED, s3InfoRec.name); ! } ! } ! outb(0x3C6, tmp); ! ! /* If it wasn't a Bt485 or AT&T 20C505, probe for the Ti3020 */ ! if (s3RamdacType == UNKNOWN_DAC) { ! outb(vgaCRIndex, 0x55); ! tmp = inb(vgaCRReg); ! /* toggle to upper 4 direct registers */ ! outb(vgaCRReg, (tmp & 0xFC) | 0x01); ! tmp1 = inb(TI_INDEX_REG); ! outb(TI_INDEX_REG, TI_ID); ! if (inb(TI_DATA_REG) == TI_VIEWPOINT_ID) { ! /* ! * Found TI ViewPoint DAC ! */ ! ErrorF("%s %s: Detected a TI ViewPoint 3020 RAMDAC\n", ! XCONFIG_PROBED, s3InfoRec.name); ! s3RamdacType = TI3020_DAC; ! } ! outb(TI_INDEX_REG, tmp1); ! outb(vgaCRReg, tmp); ! } ! ! /* If it wasn't a Ti3020 either, it must be a "normal" ramdac */ ! if (s3RamdacType == UNKNOWN_DAC) { ! s3RamdacType = NORMAL_DAC; ! } ! } ! ! /* Now handle the various ramdac cursor options */ ! ! if (OFLG_ISSET(OPTION_BT485_CURS, &s3InfoRec.options)) { ! if (DAC_IS_BT485_SERIES) { ! ErrorF("%s %s: Using hardware cursor from Bt485/20C505 RAMDAC\n", ! XCONFIG_GIVEN, s3InfoRec.name); ! } else { ! ErrorF("%s %s: Bt485 cursor requires a Bt485 or 20C505 RAMDAC\n", ! XCONFIG_PROBED, s3InfoRec.name); ! } ! } ! ! if (DAC_IS_TI3020) { ! if (OFLG_ISSET(OPTION_NO_TI3020_CURS, &s3InfoRec.options)) { ! ErrorF("%s %s: Use of Ti3020 cursor disabled in Xconfig\n", ! XCONFIG_GIVEN, s3InfoRec.name); ! OFLG_CLR(OPTION_TI3020_CURS, &s3InfoRec.options); ! } else { ! /* use the ramdac cursor by default */ ! ErrorF("%s %s: Using hardware cursor from Ti3020 RAMDAC\n", ! OFLG_ISSET(OPTION_TI3020_CURS, &s3InfoRec.options) ? ! XCONFIG_GIVEN : XCONFIG_PROBED, s3InfoRec.name); ! OFLG_SET(OPTION_TI3020_CURS, &s3InfoRec.options); ! } } else { ! if (OFLG_ISSET(OPTION_TI3020_CURS, &s3InfoRec.options)) { ! ErrorF("%s %s: Ti30205 cursor requires a Ti3020 RAMDAC\n", ! XCONFIG_PROBED, s3InfoRec.name); ! } } ! /* So far pixmux is only supported on the SPEA Mercury */ ! if (DAC_IS_BT485_SERIES && ! ( ! #ifdef NUMNINETEST ! OFLG_ISSET(OPTION_NUMBER_NINE, &s3InfoRec.options) || ! #endif ! OFLG_ISSET(OPTION_SPEA_MERCURY, &s3InfoRec.options))) ! s3Bt485PixMux = TRUE; ! ! /* pixmux on Bt485 requires use of Bt's cursor */ ! if (s3Bt485PixMux && !OFLG_ISSET(OPTION_BT485_CURS, &s3InfoRec.options)) { ! OFLG_SET(OPTION_BT485_CURS, &s3InfoRec.options); ! ErrorF("%s %s: Using hardware cursor from Bt485/20C505 RAMDAC\n", ! XCONFIG_PROBED, s3InfoRec.name); ! } ! ! /* Set clock limit */ ! switch(s3RamdacType) { ! case BT485_DAC: ! case ATT20C505_DAC: ! if (s3Bt485PixMux) ! s3InfoRec.maxClock = s3MaxBt485MuxClock; ! else ! s3InfoRec.maxClock = s3MaxBt485Clock; ! break; ! case TI3020_DAC: ! if (OFLG_ISSET(OPTION_TI3020_FAST, &s3InfoRec.options)) ! s3InfoRec.maxClock = s3MaxTi3020ClockFast; ! else ! s3InfoRec.maxClock = s3MaxTi3020Clock; ! break; ! default: ! s3InfoRec.maxClock = s3MaxClock; ! } ! ! /* Set the pix-mux description based on the ramdac type */ ! if (DAC_IS_TI3020) { ! pixMuxPossible = TRUE; ! allowPixMuxInterlace = FALSE; ! allowPixMuxSwitching = FALSE; ! nonMuxMaxClock = 70000; ! } else if (s3Bt485PixMux) { ! /* XXXX Are the defaults for the other parameters correct? */ ! pixMuxPossible = TRUE; ! allowPixMuxInterlace = FALSE; /* It doesn't work right (yet) */ ! allowPixMuxSwitching = FALSE; /* XXXX Is this right? */ ! if (OFLG_ISSET(OPTION_SPEA_MERCURY, &s3InfoRec.options)) { ! nonMuxMaxClock = 67500; /* Doubling only works in mux mode */ ! nonMuxMaxMemory = 1024; /* Can't access more without mux */ ! pixMuxLimitedWidths = FALSE; ! /* pixMuxMinWidth = 800; Not sure if this is OK */ ! } else { ! nonMuxMaxClock = 85000; ! } ! } ! ! /* ! * clock options are now done after the ramdacs because the next ! * generation ramdacs will have a built in clock (i.e. TI 3025) ! */ ! ! if (OFLG_ISSET(OPTION_LEGEND, &s3InfoRec.options)) { ! s3ClockSelectFunc = LegendClockSelect; ! numClocks = 32; ! } else if (OFLG_ISSET(CLOCK_OPTION_ICD2061A, &s3InfoRec.clockOptions)) { s3ClockSelectFunc = icd2061ClockSelect; if (x386Verbose) ! ErrorF("%s %s: Using ICD2061A programmable clock\n", XCONFIG_GIVEN, s3InfoRec.name); numClocks = 3; } else if (OFLG_ISSET(CLOCK_OPTION_ICD2061ASL, &s3InfoRec.clockOptions)) { s3ClockSelectFunc = icd2061ClockSelect; if (x386Verbose) ! ErrorF("%s %s: Using ICD2061A programmable clock\n", XCONFIG_GIVEN, s3InfoRec.name); + ErrorF("\tNote: \"icd2061a_slow\" is deprecated; use \"icd2061a\"\n"); numClocks = 3; ! } else if (OFLG_ISSET(CLOCK_OPTION_SC11412, &s3InfoRec.clockOptions)) { ! s3ClockSelectFunc = icd2061ClockSelect; ! if (x386Verbose) ! ErrorF("%s %s: Using Sierra SC11412 programmable clock\n", ! XCONFIG_GIVEN, s3InfoRec.name); ! numClocks = 3; ! } else { ! s3ClockSelectFunc = s3ClockSelect; ! numClocks = 16; ! if (!s3InfoRec.clocks) ! vgaGetClocks(numClocks, s3ClockSelectFunc); ! } if (x386Verbose) { if (! OFLG_ISSET(CLOCK_OPTION_PROGRAMABLE, &s3InfoRec.clockOptions)) { for (j = 0; j < s3InfoRec.clocks; j++) { ! if ((j % 8) == 0) { ! if (j != 0) ! ErrorF("\n"); ! ErrorF("%s %s: clocks:", OFLG_ISSET(XCONFIG_CLOCKS,&s3InfoRec.xconfigFlag) ? XCONFIG_GIVEN : XCONFIG_PROBED , s3InfoRec.name); + } ErrorF(" %6.2f", (double)s3InfoRec.clock[j] / 1000.0); } ErrorF("\n"); *************** *** 417,479 **** } } ! /* ! * Handle Bt485. ! */ ! if (OFLG_ISSET(OPTION_BT485, &s3InfoRec.options)) { ! if (!S3_801_928_SERIES(s3ChipId)) { ! ErrorF("%s %s: Bt485 cannot be supported on 911/924\n", ! XCONFIG_PROBED, s3InfoRec.name); ! OFLG_CLR(OPTION_BT485, &s3InfoRec.options); ! } else { ! ErrorF("%s %s: Programming for BrookTree Bt485 RAMDAC\n", ! XCONFIG_GIVEN, s3InfoRec.name); ! } ! } else if ((!OFLG_ISSET(OPTION_NO_BT485, &s3InfoRec.options)) && ! (S3_801_928_SERIES(s3ChipId))) { ! /* ! * Probe for the bloody thing. Set 0x3C6 to a bogus value, then ! * try to get the Bt485 status register. If it's there, then we will ! * get something else back from this port. ! */ ! tmp = inb(0x3C6); ! outb(0x3C6, 0xFF); ! if ((s3InBtStatReg() & 0xC0) == 0x80) { ! /* ! * Found it. ! */ ! ErrorF("%s %s: Detected a BrookTree Bt485 RAMDAC\n", ! XCONFIG_PROBED, s3InfoRec.name); ! OFLG_SET(OPTION_BT485, &s3InfoRec.options); ! } ! outb(0x3C6, tmp); ! } ! if (OFLG_ISSET(OPTION_BT485_CURS, &s3InfoRec.options)) { ! if (OFLG_ISSET(OPTION_NO_BT485, &s3InfoRec.options)) { ! ErrorF("%s %s: Use of Bt485 disabled in Xconfig; won't use cursor\n", ! XCONFIG_GIVEN, s3InfoRec.name); ! OFLG_CLR(OPTION_BT485_CURS, &s3InfoRec.options); ! } else { ! if (!S3_928_SERIES(s3ChipId)) { ! ErrorF("%s %s: Bt485 is only supported on 928 boards\n", ! XCONFIG_PROBED, s3InfoRec.name); ! OFLG_CLR(OPTION_BT485_CURS, &s3InfoRec.options); ! } else { ! ErrorF("%s %s: Using hardware cursor from Bt485 RAMDAC\n", ! XCONFIG_GIVEN, s3InfoRec.name); ! if (!OFLG_ISSET(OPTION_BT485, &s3InfoRec.options)) { ! ErrorF("%s %s: Assuming Bt485 is present\n", ! XCONFIG_PROBED, s3InfoRec.name); ! OFLG_SET(OPTION_BT485, &s3InfoRec.options); ! } ! } ! } ! } ! ! if (OFLG_ISSET(OPTION_BT485, &s3InfoRec.options)) ! s3InfoRec.maxClock = s3MaxBt485Clock; ! else ! s3InfoRec.maxClock = s3MaxClock; tx = s3InfoRec.virtualX; ty = s3InfoRec.virtualY; --- 708,715 ---- } } ! if (pixMuxPossible && s3InfoRec.videoRam > nonMuxMaxMemory) ! pixMuxNeeded = TRUE; tx = s3InfoRec.virtualX; ty = s3InfoRec.virtualY; *************** *** 491,523 **** } s3InfoRec.virtualX = max(s3InfoRec.virtualX, pMode->HDisplay); s3InfoRec.virtualY = max(s3InfoRec.virtualY, pMode->VDisplay); pMode = pMode->next; } while (pMode != pEnd); if ((tx != s3InfoRec.virtualX) || (ty != s3InfoRec.virtualY)) OFLG_CLR(XCONFIG_VIRTUAL,&s3InfoRec.xconfigFlag); ! /* ! * It would seem the S3 can only do two accelarated screen widths ! */ ! if (s3InfoRec.virtualX <= 1024) { ! s3DisplayWidth = 1024; ! } else if (s3InfoRec.virtualX <= 1280) { ! if (S3_911_SERIES(s3ChipId)) { ! ErrorF("%s: Unsupported width for the S3 911 series chipsets\n", ! s3InfoRec.name); ! ErrorF("%s: Maximum supported width is 1024\n", s3InfoRec.name); xf86DisableIOPorts(s3InfoRec.scrnIndex); ! return (FALSE); } ! s3DisplayWidth = 1280; } else { ErrorF("%s: Illegal screen size: (%dx%d)\n", s3InfoRec.name, s3InfoRec.virtualX, s3InfoRec.virtualY); ! ErrorF(" Virtual width must be no greater than 1280\n"); xf86DisableIOPorts(s3InfoRec.scrnIndex); return (FALSE); } ! if ((s3DisplayWidth * (1 + s3InfoRec.virtualY)) > s3InfoRec.videoRam * 1024) { ErrorF("%s %s: Display size %dx%d is too large: ", OFLG_ISSET(XCONFIG_VIRTUAL,&s3InfoRec.xconfigFlag) ? XCONFIG_GIVEN : XCONFIG_PROBED, --- 727,944 ---- } s3InfoRec.virtualX = max(s3InfoRec.virtualX, pMode->HDisplay); s3InfoRec.virtualY = max(s3InfoRec.virtualY, pMode->VDisplay); + + /* + * Check what impact each mode has on pixel multiplexing, and mark those + * modes for which pixmux must be used. + */ + if (pixMuxPossible) { + if ((s3InfoRec.clock[pMode->Clock] / 1000) > + (nonMuxMaxClock / 1000)) { + pMode->Flags |= V_PIXMUX; + pixMuxNeeded = TRUE; + } + if (s3InfoRec.videoRam > nonMuxMaxMemory) + pMode->Flags |= V_PIXMUX; + + /* + * Check if pixmux can't be used. There are two cases: + * + * 1. No switching between mux and non-mux modes. In this case + * the presence of any mode which can't be used in pixmux + * mode is flagged. + * 2. Switching allowed. In this cases the presence of modes + * which require mux for one feature, but can't use it because + * of another is flagged. + */ + if (!allowPixMuxSwitching || (pMode->Flags & V_PIXMUX)) { + if (pMode->HDisplay < pixMuxMinWidth) + pixMuxWidthOK = FALSE; + if ((pMode->Flags & V_INTERLACE) && !allowPixMuxInterlace) + pixMuxInterlaceOK = FALSE; + } + } pMode = pMode->next; } while (pMode != pEnd); + if ((tx != s3InfoRec.virtualX) || (ty != s3InfoRec.virtualY)) OFLG_CLR(XCONFIG_VIRTUAL,&s3InfoRec.xconfigFlag); ! /* ! * Are we using pixel multiplexing, or does the mode combination mean ! * we can't continue ! */ ! if (pixMuxPossible && pixMuxNeeded) { ! if (!pixMuxWidthOK) { ! if (s3InfoRec.videoRam > nonMuxMaxMemory) { ! ErrorF("To access more than %dkB video memory the RAMDAC must\n", ! nonMuxMaxMemory); ! ErrorF("operate in pixel multiplex mode, but pixel multiplexing\n"); ! ErrorF("cannot be used for modes of width less than %d.\n", ! pixMuxMinWidth); ! ErrorF("Adjust the Modes and/or VideoRam and Virtual lines in\n"); ! ErrorF("your Xconfig to meet these requirements\n"); ! } else { ! ErrorF("Modes with a dot-clock above %dMHz require the RAMDAC to\n", ! nonMuxMaxClock / 1000); ! ErrorF("operate in pixel multiplex mode, but pixel multiplexing\n"); ! ErrorF("cannot be used for modes with width less than %d.\n", ! pixMuxMinWidth); ! ErrorF("Adjust the Modes line in your Xconfig to meet these "); ! ErrorF("requirements.\n"); ! } ! } ! if (!pixMuxInterlaceOK) { ! if (s3InfoRec.videoRam > nonMuxMaxMemory) { ! ErrorF("To access more than %dkB video memory the RAMDAC must\n", ! nonMuxMaxMemory); ! ErrorF("operate in pixel multiplex mode, but pixel multiplexing\n"); ! ErrorF("cannot be used for interlaced modes.\n", ! pixMuxMinWidth); ! ErrorF("Adjust the Modes and/or VideoRam and Virtual lines in\n"); ! ErrorF("your Xconfig to meet these requirements\n"); ! } else { ! ErrorF("Modes with a dot-clock above %dMHz require the RAMDAC to\n", ! nonMuxMaxClock / 1000); ! ErrorF("operate in pixel multiplex mode, but pixel multiplexing\n"); ! ErrorF("cannot be used for interlaced modes.\n"); ! ErrorF("Adjust the Modes line in your Xconfig to meet these "); ! ErrorF("requirements.\n"); ! } ! } ! if (!pixMuxWidthOK || !pixMuxInterlaceOK) { xf86DisableIOPorts(s3InfoRec.scrnIndex); ! return(FALSE); ! } else { ! if (x386Verbose) ! ErrorF("%s %s: Operating RAMDAC in pixel multiplex mode\n", ! XCONFIG_PROBED, s3InfoRec.name); ! s3UsingPixMux = TRUE; ! } ! } ! ! if (s3UsingPixMux && !allowPixMuxSwitching) { ! /* Mark all modes as V_PIXMUX */ ! pEnd = pMode = s3InfoRec.modes; ! do { ! pMode->Flags |= V_PIXMUX; ! pMode = pMode->next; ! } while (pMode != pEnd); ! } ! ! if (DAC_IS_TI3020 && ! OFLG_ISSET(OPTION_DAC_8_BIT, &s3InfoRec.options)) ! s3DAC8Bit = TRUE; ! ! if (OFLG_ISSET(OPTION_ATT490_1, &s3InfoRec.options)) { ! if (x386Verbose) ! ErrorF("%s %s: Using AT&T 20C490/1 RAMDAC\n", ! XCONFIG_GIVEN, s3InfoRec.name); ! if (OFLG_ISSET(OPTION_DAC_8_BIT, &s3InfoRec.options)) { ! s3DAC8Bit = TRUE; ! if (x386Verbose) ! ErrorF("%s %s: Putting RAMDAC into 8-bit mode\n", ! XCONFIG_GIVEN, s3InfoRec.name); ! } ! } ! ! if (OFLG_ISSET(OPTION_SC15025, &s3InfoRec.options)) { ! if (x386Verbose) ! ErrorF("%s %s: Using Sierra SC 15025/6 RAMDAC\n", ! XCONFIG_GIVEN, s3InfoRec.name); ! if (OFLG_ISSET(OPTION_DAC_8_BIT, &s3InfoRec.options)) { ! s3DAC8Bit = TRUE; ! if (x386Verbose) ! ErrorF("%s %s: Putting RAMDAC into 8-bit mode\n", ! XCONFIG_GIVEN, s3InfoRec.name); } ! } ! ! if (S3_911_SERIES(s3ChipId)) { ! maxDisplayWidth = 1024; ! maxDisplayHeight = 1024 - 1; /* Cursor takes exactly 1 line for 911 */ } else { + maxDisplayWidth = 2048; + maxDisplayHeight = 4096 - 3; /* Cursor can take up to 3 lines */ + } + if (s3InfoRec.virtualX > maxDisplayWidth) { + ErrorF("%s: Illegal screen size: (%dx%d)\n", s3InfoRec.name, + s3InfoRec.virtualX, s3InfoRec.virtualY); + ErrorF("\tVirtual width must be no greater than %d\n", maxDisplayWidth); + xf86DisableIOPorts(s3InfoRec.scrnIndex); + return (FALSE); + } + if (s3InfoRec.virtualY > maxDisplayHeight) { ErrorF("%s: Illegal screen size: (%dx%d)\n", s3InfoRec.name, s3InfoRec.virtualX, s3InfoRec.virtualY); ! ErrorF("\tVirtual height must be no greater than %d\n", maxDisplayHeight); xf86DisableIOPorts(s3InfoRec.scrnIndex); return (FALSE); } ! ! /* Select the appropriate logical line width */ ! if (s3UsingPixMux && pixMuxLimitedWidths) { ! if (s3InfoRec.virtualX <= 1024) { ! s3DisplayWidth = 1024; ! } else if (s3InfoRec.virtualX <= 2048) { ! s3DisplayWidth = 2048; ! } else { /* should never get here */ ! ErrorF("Internal error in DisplayWidth check, virtual width = %d\n", ! s3InfoRec.virtualX); ! xf86DisableIOPorts(s3InfoRec.scrnIndex); ! return (FALSE); ! } ! } else if (S3_911_SERIES(s3ChipId)) { ! s3DisplayWidth = 1024; ! } else { ! if (s3InfoRec.virtualX <= 640) { ! s3DisplayWidth = 640; ! } else if (s3InfoRec.virtualX <= 800) { ! s3DisplayWidth = 800; ! } else if (s3InfoRec.virtualX <= 1024) { ! s3DisplayWidth = 1024; ! } else if ((s3InfoRec.virtualX <= 1152) && ! (S3_801_REV_C(s3ChipId) || S3_928_REV_E(s3ChipId))) { ! s3DisplayWidth = 1152; ! } else if (s3InfoRec.virtualX <= 1280) { ! s3DisplayWidth = 1280; ! } else if ((s3InfoRec.virtualX <= 1600) && S3_928_REV_E(s3ChipId)) { ! s3DisplayWidth = 1600; ! } else if (s3InfoRec.virtualX <= 2048) { ! s3DisplayWidth = 2048; ! } else { /* should never get here */ ! ErrorF("Internal error in DisplayWidth check, virtual width = %d\n", ! s3InfoRec.virtualX); ! xf86DisableIOPorts(s3InfoRec.scrnIndex); ! return (FALSE); ! } ! } ! ! /* ! * Work out where to locate S3's HW cursor storage. It must be on a ! * 1k boundary. ! */ ! ! { ! int st_addr = (s3InfoRec.virtualY * s3DisplayWidth + 1023) / 1024 * 1024; ! s3CursorStartX = st_addr % s3DisplayWidth; ! s3CursorStartY = st_addr / s3DisplayWidth; ! s3CursorLines = ((s3CursorStartX + 1023) / s3DisplayWidth) + 1; ! } ! ! /* ! * Reduce the videoRam value if necessary to prevent Y coords exceeding ! * the 12-bit (4096) limit when small display widths are used on cards ! * with a lot of memory ! */ ! if (s3InfoRec.videoRam * 1024 / s3DisplayWidth > 4096) { ! s3InfoRec.videoRam = s3DisplayWidth * 4096 / 1024; ! ErrorF("%s %s: videoram usage reduced to %dk to avoid co-ord overflow\n", ! XCONFIG_PROBED, s3InfoRec.name, s3InfoRec.videoRam); ! } ! ! if ((s3DisplayWidth * (s3CursorStartY + s3CursorLines)) > ! s3InfoRec.videoRam * 1024) { /* XXXX improve this message */ ErrorF("%s %s: Display size %dx%d is too large: ", OFLG_ISSET(XCONFIG_VIRTUAL,&s3InfoRec.xconfigFlag) ? XCONFIG_GIVEN : XCONFIG_PROBED, *************** *** 634,639 **** --- 1055,1064 ---- long freq; Bool result = TRUE; + #define MAX_SC11412_FREQ (DAC_IS_BT485_SERIES ? \ + ((s3RamdacType == ATT20C505_DAC) ? 90000 : 67500) : \ + 100000) + UNLOCK_SYS_REGS; switch(no) { *************** *** 652,691 **** } /* Start with freq in kHz */ freq = s3InfoRec.clock[no]; ! if (OFLG_ISSET(OPTION_BT485, &s3InfoRec.options)) { ! if (freq > s3MaxBt485Clock) { ! ErrorF("%s %s: Specified dot clock (%7.3f) too high for Bt485.", ! XCONFIG_PROBED, s3InfoRec.name, freq / 1000.0); ! ErrorF("\tUsing %7.3Mhz\n", s3MaxBt485Clock / 1000.0); ! freq = s3MaxBt485Clock; ! } ! if (freq > 67500) { /* Use Bt485 clock doubler - Bit 3 of Command Reg 3 */ freq /= 2; s3OutBtRegCom3(0xF7, 0x08); } else { /* No doubler */ s3OutBtRegCom3(0xF7, 0x00); } ! } else { ! if (freq > s3MaxClock) { ! ErrorF("%s %s: Specified dot clock (%7.3f) too high for RAMDAC.", XCONFIG_PROBED, s3InfoRec.name, freq / 1000.0); ! ErrorF("\tUsing %7.3MHz\n", s3MaxClock / 1000.0); ! freq = s3MaxClock; } ! } /* Convert freq to Hz */ freq *= 1000; ! if (OFLG_ISSET(CLOCK_OPTION_ICD2061A, &s3InfoRec.clockOptions)) { ! clockNo = ICD2061ACalcClock(freq, 2); ! ICD2061ASetClock(clockNo); ! ICD2061ASetClock(clockNo); ! ICD2061ASetClock(clockNo); ! } else { AltICD2061SetClock(freq, 2); AltICD2061SetClock(freq, 2); AltICD2061SetClock(freq, 2); } outb(vgaCRIndex, 0x42);/* select the clock */ outb(vgaCRReg, 0x02); --- 1077,1150 ---- } /* Start with freq in kHz */ freq = s3InfoRec.clock[no]; ! /* Check if clock frequency is within range */ ! if ( ! !OFLG_ISSET(OPTION_SPEA_MERCURY, &s3InfoRec.options) && ! OFLG_ISSET(CLOCK_OPTION_SC11412, &s3InfoRec.clockOptions) && ! freq > MAX_SC11412_FREQ) { ! /* SC11412 limit as there is no clockdoubling yet */ ! ErrorF("%s %s: Specified dot clock (%7.3f) too high for SC11412", ! XCONFIG_PROBED, s3InfoRec.name, freq / 1000.0); ! ErrorF("\tUsing %7.3fMHz\n", MAX_SC11412_FREQ / 1000.0); ! freq = MAX_SC11412_FREQ; ! } ! if (freq > s3InfoRec.maxClock) { ! ErrorF("%s %s: Specified dot clock (%7.3f) too high for RAMDAC.", ! XCONFIG_PROBED, s3InfoRec.name, freq / 1000.0); ! ErrorF("\tUsing %7.3fMHz\n", s3InfoRec.maxClock / 1000.0); ! freq = s3InfoRec.maxClock; ! } ! if (DAC_IS_BT485_SERIES && ! ( ! OFLG_ISSET(OPTION_SPEA_MERCURY, &s3InfoRec.options) || ! !OFLG_ISSET(CLOCK_OPTION_SC11412, &s3InfoRec.clockOptions))) { ! if (freq > ((s3RamdacType == ATT20C505_DAC) ? 90000 : 67500)) { /* Use Bt485 clock doubler - Bit 3 of Command Reg 3 */ freq /= 2; + if (s3Bt485PixMux) { + s3OutBtReg(BT_COMMAND_REG_0, 0xFE, 0x01); /* sleep mode */ + s3OutBtReg(BT_COMMAND_REG_2, 0xEF, 0x10); /* pclock 1 */ + } s3OutBtRegCom3(0xF7, 0x08); + if (s3Bt485PixMux) { + s3OutBtReg(BT_COMMAND_REG_0, 0xFE, 0x00); /* wake up */ + } } else { /* No doubler */ + if (s3Bt485PixMux) { + s3OutBtReg(BT_COMMAND_REG_0, 0xFE, 0x01); /* sleep mode */ + s3OutBtReg(BT_COMMAND_REG_2, 0xEF, 0x10); /* pclock 1 */ + } s3OutBtRegCom3(0xF7, 0x00); + if (s3Bt485PixMux) { + s3OutBtReg(BT_COMMAND_REG_0, 0xFE, 0x00); /* wake up */ + } } ! } else if (DAC_IS_TI3020) { ! if (freq > 100000) { ! /* Use Ti3020 clock doubler */ ! ErrorF("%s %s: Specified dot clock (%7.3f) requires clock doubling.\n", XCONFIG_PROBED, s3InfoRec.name, freq / 1000.0); ! freq /= 2; ! s3OutTiIndReg(TI_INPUT_CLOCK_SELECT, 0x00, TI_ICLK_CLK1_DOUBLE); ! } else { ! /* No doubler */ ! s3OutTiIndReg(TI_INPUT_CLOCK_SELECT, 0x00, TI_ICLK_CLK1); } ! } /* Convert freq to Hz */ freq *= 1000; ! /* Use the "Alt" version always since it is more reliable */ ! if (OFLG_ISSET(CLOCK_OPTION_ICD2061A, &s3InfoRec.clockOptions) || ! OFLG_ISSET(CLOCK_OPTION_ICD2061ASL, &s3InfoRec.clockOptions)) { AltICD2061SetClock(freq, 2); AltICD2061SetClock(freq, 2); AltICD2061SetClock(freq, 2); + } else if (OFLG_ISSET(CLOCK_OPTION_SC11412, &s3InfoRec.clockOptions)) { + result = SC11412SetClock((long)freq/1000); + } else { /* Should never get here */ + result = FALSE; + break; } outb(vgaCRIndex, 0x42);/* select the clock */ outb(vgaCRReg, 0x02); diff -c mit/server/ddx/x386/accel/s3/s3.h:2.22 mit/server/ddx/x386/accel/s3/s3.h:2.31 *** mit/server/ddx/x386/accel/s3/s3.h:2.22 Fri Mar 11 23:37:56 1994 --- mit/server/ddx/x386/accel/s3/s3.h Fri Mar 11 23:37:56 1994 *************** *** 27,33 **** * Id: s3.h,v 2.2 1993/06/22 20:54:09 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3.h,v 2.22 1993/09/29 11:10:56 dawes Exp $ */ #ifndef S3_H #define S3_H --- 27,33 ---- * Id: s3.h,v 2.2 1993/06/22 20:54:09 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3.h,v 2.31 1994/03/08 04:48:11 dawes Exp $ */ #ifndef S3_H #define S3_H *************** *** 34,39 **** --- 34,45 ---- #define S3_PATCHLEVEL "0" + /* + * This is included, but it hasn't been tested properly yet. It enables + * the undocumented "number_nine" Option (which will turn on the pixmux code). + */ + #define NUMNINETEST + #ifndef LINKKIT #include "s3name.h" *************** *** 89,94 **** --- 95,101 ---- extern void s3WarpCursor(); extern void s3RestoreCursor(); + extern void s3RenewCursorColor(); extern void s3QueryBestSize(); extern void (*s3ImageReadFunc)(); extern void (*s3ImageWriteFunc)(); *************** *** 127,133 **** DisplayModePtr mode #endif ); ! extern void InitEnvironment( #if NeedFunctionPrototypes void #endif --- 134,140 ---- DisplayModePtr mode #endif ); ! extern void s3InitEnvironment( #if NeedFunctionPrototypes void #endif *************** *** 204,209 **** --- 211,217 ---- extern pointer s3VideoMem; extern pointer vgaBase; extern ScreenPtr s3savepScreen; + extern int s3CursorStartX, s3CursorStartY, s3CursorLines; /* also needed in s3 somebody fix these headers please */ extern Bool mfbRegisterCopyPlaneProc(); *************** *** 223,228 **** --- 231,252 ---- extern int vgaCRReg; extern int s3ValidTokens[]; + + extern int s3RamdacType; + extern Bool s3DAC8Bit; + extern Bool s3UsingPixMux; + extern Bool s3Bt485PixMux; + + #define UNKNOWN_DAC -1 + #define NORMAL_DAC 0 + #define BT485_DAC 1 + #define ATT20C505_DAC 2 + #define TI3020_DAC 3 + + #define DAC_IS_BT485_SERIES (s3RamdacType == BT485_DAC || \ + s3RamdacType == ATT20C505_DAC) + #define DAC_IS_TI3020 (s3RamdacType == TI3020_DAC) + _XFUNCPROTOEND #endif /* !LINKKIT */ diff -c mit/server/ddx/x386/accel/s3/s3BtCursor.c:2.4 mit/server/ddx/x386/accel/s3/s3BtCursor.c:2.7 *** mit/server/ddx/x386/accel/s3/s3BtCursor.c:2.4 Fri Mar 11 23:37:57 1994 --- mit/server/ddx/x386/accel/s3/s3BtCursor.c Fri Mar 11 23:37:57 1994 *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3BtCursor.c,v 2.4 1993/10/03 14:55:02 dawes Exp $ */ #define NEED_EVENTS #include --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3BtCursor.c,v 2.7 1994/01/09 03:30:51 dawes Exp $ */ #define NEED_EVENTS #include *************** *** 132,137 **** --- 132,138 ---- s3OutBtReg(BT_COMMAND_REG_0, 0x7F, 0x80); s3OutBtReg(BT_WRITE_ADDR, 0x00, 0x01); ret = s3InBtReg(BT_STATUS_REG); + return(ret); } /* *************** *** 250,255 **** --- 251,261 ---- *plane1++ = 0x00; } } + /* + * if we still have more bytes on this line (j < wsrc), + * we have to ignore the rest of the line. + */ + while (j++ < wsrc) pServMsk++,pServSrc++; } return TRUE; } *************** *** 364,370 **** int x, y; { int index = pScr->myNum; ! register int i, j, t; unsigned char *ram, *p; if (!x386VTSema) --- 370,376 ---- int x, y; { int index = pScr->myNum; ! register int i, j; unsigned char *ram, *p; if (!x386VTSema) diff -c mit/server/ddx/x386/accel/s3/s3Cursor.c:2.29 mit/server/ddx/x386/accel/s3/s3Cursor.c:2.34 *** mit/server/ddx/x386/accel/s3/s3Cursor.c:2.29 Fri Mar 11 23:37:57 1994 --- mit/server/ddx/x386/accel/s3/s3Cursor.c Fri Mar 11 23:37:57 1994 *************** *** 28,34 **** * Id: s3Cursor.c,v 2.5 1993/08/09 06:17:57 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3Cursor.c,v 2.29 1993/10/17 14:43:29 dawes Exp $ */ /* * Device independent (?) part of HW cursor support --- 28,34 ---- * Id: s3Cursor.c,v 2.5 1993/08/09 06:17:57 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3Cursor.c,v 2.34 1994/02/25 14:58:42 dawes Exp $ */ /* * Device independent (?) part of HW cursor support *************** *** 48,53 **** --- 48,54 ---- #include #include "x386.h" #include "inputstr.h" + #include "mfb.h" #include "x386Priv.h" #include "xf86_Option.h" #include "xf86_OSlib.h" *************** *** 65,71 **** extern void s3BtCursorOff(); extern void s3BtLoadCursor(); extern void s3BtMoveCursor(); ! extern void s3BtRecolorCursor(); extern short s3ChipId; --- 66,76 ---- extern void s3BtCursorOff(); extern void s3BtLoadCursor(); extern void s3BtMoveCursor(); ! extern Bool s3TiRealizeCursor(); ! extern void s3TiCursorOn(); ! extern void s3TiCursorOff(); ! extern void s3TiLoadCursor(); ! extern void s3TiMoveCursor(); extern short s3ChipId; *************** *** 85,90 **** --- 90,103 ---- s3BtMoveCursor, }; + static miPointerSpriteFuncRec s3TiPointerSpriteFuncs = + { + s3TiRealizeCursor, + s3UnrealizeCursor, + s3SetCursor, + s3TiMoveCursor, + }; + extern miPointerScreenFuncRec x386PointerScreenFuncs; extern x386InfoRec x386Info; extern unsigned char s3SwapBits[256]; *************** *** 94,99 **** --- 107,119 ---- extern int s3hotX, s3hotY; + #define VerticalRetraceWait() \ + { \ + while ((inb(vgaIOBase + 0x0A) & 0x08) == 0x00) ; \ + while ((inb(vgaIOBase + 0x0A) & 0x08) == 0x08) ; \ + while ((inb(vgaIOBase + 0x0A) & 0x08) == 0x00) ; \ + } + Bool s3CursorInit(pm, pScr) char *pm; *************** *** 109,114 **** --- 129,138 ---- if (!(miPointerInitialize(pScr, &s3BtPointerSpriteFuncs, &x386PointerScreenFuncs, FALSE))) return FALSE; + } else if (OFLG_ISSET(OPTION_TI3020_CURS, &s3InfoRec.options)) { + if (!(miPointerInitialize(pScr, &s3TiPointerSpriteFuncs, + &x386PointerScreenFuncs, FALSE))) + return FALSE; } else { if (!(miPointerInitialize(pScr, &s3PointerSpriteFuncs, &x386PointerScreenFuncs, FALSE))) *************** *** 125,130 **** --- 149,156 ---- { if (OFLG_ISSET(OPTION_BT485_CURS, &s3InfoRec.options)) s3BtCursorOn(); + else if (OFLG_ISSET(OPTION_TI3020_CURS, &s3InfoRec.options)) + s3TiCursorOn(); /* Nothing to do for integrated cursor */ } *************** *** 133,138 **** --- 159,166 ---- { if (OFLG_ISSET(OPTION_BT485_CURS, &s3InfoRec.options)) s3BtCursorOff(); + else if (OFLG_ISSET(OPTION_TI3020_CURS, &s3InfoRec.options)) + s3TiCursorOff(); /* Nothing to do for integrated cursor */ } *************** *** 218,224 **** int x, y; { int index = pScr->myNum; ! int i, yline; unsigned short *ram; unsigned char tmp; int cpos; --- 246,253 ---- int x, y; { int index = pScr->myNum; ! int i, j; ! int n, bytes_remaining, xpos, ypos, ram_loc; unsigned short *ram; unsigned char tmp; int cpos; *************** *** 230,236 **** return; /* Load storage location. */ ! cpos = (s3DisplayWidth * s3InfoRec.virtualY) / 1024; outb(vgaCRIndex, 0x4d); outb(vgaCRReg, (0xff & cpos)); outb(vgaCRIndex, 0x4c); --- 259,265 ---- return; /* Load storage location. */ ! cpos = (s3DisplayWidth * s3CursorStartY + s3CursorStartX) / 1024; outb(vgaCRIndex, 0x4d); outb(vgaCRReg, (0xff & cpos)); outb(vgaCRIndex, 0x4c); *************** *** 249,283 **** /* s3 stuff */ WaitIdle(); ! WaitQueue(4); S3_OUTW(MULTIFUNC_CNTL, SCISSORS_L | 0); S3_OUTW(MULTIFUNC_CNTL, SCISSORS_T | 0); S3_OUTW(MULTIFUNC_CNTL, SCISSORS_R | (s3DisplayWidth-1)); S3_OUTW(MULTIFUNC_CNTL, SCISSORS_B | s3ScissB); WaitIdle(); ! S3_OUTW(WRT_MASK, 0x0ff); ! S3_OUTW(FRGD_MIX, 0x40 | 0x7); ! S3_OUTW(MULTIFUNC_CNTL, PIX_CNTL + 0x7); ! S3_OUTW(MULTIFUNC_CNTL, 0); ! S3_OUTW(MAJ_AXIS_PCNT, 1023); ! S3_OUTW(CUR_X, 0); ! S3_OUTW(CUR_Y, s3InfoRec.virtualY); ! ! S3_OUTW(CMD, CMD_RECT | _16BIT | BYTSEQ | INC_X | INC_Y ! | PCDATA | DRAW | WRTDATA); ! ! WaitQueue(8); ! for (i = 0; i < 512; i++) { ! S3_OUTW(PIX_TRANS, ram[i]); } UNBLOCK_CURSOR; /* Wait for vertical retrace */ ! while ((inb(vgaIOBase + 0x0A) & 0x08) == 0x00) ; ! while ((inb(vgaIOBase + 0x0A) & 0x08) == 0x08) ; ! while ((inb(vgaIOBase + 0x0A) & 0x08) == 0x00) ; /* position cursor */ s3MoveCursor(0, x, y); --- 278,334 ---- /* s3 stuff */ WaitIdle(); ! WaitQueue(7); S3_OUTW(MULTIFUNC_CNTL, SCISSORS_L | 0); S3_OUTW(MULTIFUNC_CNTL, SCISSORS_T | 0); S3_OUTW(MULTIFUNC_CNTL, SCISSORS_R | (s3DisplayWidth-1)); S3_OUTW(MULTIFUNC_CNTL, SCISSORS_B | s3ScissB); + S3_OUTW(WRT_MASK, 0x0ff); + S3_OUTW(FRGD_MIX, FSS_PCDATA | MIX_SRC); + S3_OUTW(MULTIFUNC_CNTL, PIX_CNTL | 0); WaitIdle(); ! /* ! * This form is general enough for any valid DisplayWidth. The only ! * assumption is that it is even. ! */ ! xpos = s3CursorStartX; ! ypos = s3CursorStartY; ! bytes_remaining = 1024; ! ram_loc = 0; ! while (bytes_remaining > 0) { ! if (s3DisplayWidth - xpos < bytes_remaining) ! n = s3DisplayWidth - xpos; ! else ! n = bytes_remaining; ! ! WaitQueue(5); ! ! S3_OUTW(MULTIFUNC_CNTL, MIN_AXIS_PCNT | 0); ! S3_OUTW(MAJ_AXIS_PCNT, n - 1); ! S3_OUTW(CUR_X, xpos); ! S3_OUTW(CUR_Y, ypos); ! ! S3_OUTW(CMD, CMD_RECT | _16BIT | BYTSEQ | INC_X | INC_Y ! | PCDATA | DRAW | WRTDATA); ! ! WaitQueue(8); ! ! for (i = ram_loc; i < n/2 + ram_loc; i++) { ! S3_OUTW(PIX_TRANS, ram[i]); ! } ! ! ram_loc = i; ! ypos++; ! xpos = 0; ! bytes_remaining -= n; } + UNBLOCK_CURSOR; /* Wait for vertical retrace */ ! VerticalRetraceWait(); /* position cursor */ s3MoveCursor(0, x, y); *************** *** 309,320 **** s3hotY = pCurs->bits->yhot; s3SaveCursors[index] = pCurs; ! if (!s3BlockCursor) if (OFLG_ISSET(OPTION_BT485_CURS, &s3InfoRec.options)) s3BtLoadCursor(pScr, pCurs, x, y); else s3LoadCursor(pScr, pCurs, x, y); ! else s3ReloadCursor = TRUE; } --- 360,373 ---- s3hotY = pCurs->bits->yhot; s3SaveCursors[index] = pCurs; ! if (!s3BlockCursor) { if (OFLG_ISSET(OPTION_BT485_CURS, &s3InfoRec.options)) s3BtLoadCursor(pScr, pCurs, x, y); + else if (OFLG_ISSET(OPTION_TI3020_CURS, &s3InfoRec.options)) + s3TiLoadCursor(pScr, pCurs, x, y); else s3LoadCursor(pScr, pCurs, x, y); ! } else s3ReloadCursor = TRUE; } *************** *** 329,334 **** --- 382,389 ---- miPointerPosition(&x, &y); if (OFLG_ISSET(OPTION_BT485_CURS, &s3InfoRec.options)) s3BtLoadCursor(pScr, s3SaveCursors[index], x, y); + else if (OFLG_ISSET(OPTION_TI3020_CURS, &s3InfoRec.options)) + s3TiLoadCursor(pScr, s3SaveCursors[index], x, y); else s3LoadCursor(pScr, s3SaveCursors[index], x, y); } *************** *** 342,352 **** miPointerPosition(&x, &y); if (OFLG_ISSET(OPTION_BT485_CURS, &s3InfoRec.options)) s3BtMoveCursor(pScr, x, y); else { /* Wait for vertical retrace */ ! while ((inb(vgaIOBase + 0x0A) & 0x08) == 0x00) ; ! while ((inb(vgaIOBase + 0x0A) & 0x08) == 0x08) ; ! while ((inb(vgaIOBase + 0x0A) & 0x08) == 0x00) ; s3MoveCursor(pScr, x, y); } } --- 397,407 ---- miPointerPosition(&x, &y); if (OFLG_ISSET(OPTION_BT485_CURS, &s3InfoRec.options)) s3BtMoveCursor(pScr, x, y); + else if (OFLG_ISSET(OPTION_TI3020_CURS, &s3InfoRec.options)) + s3TiMoveCursor(pScr, x, y); else { /* Wait for vertical retrace */ ! VerticalRetraceWait(); s3MoveCursor(pScr, x, y); } } *************** *** 413,421 **** --- 468,480 ---- LOCK_SYS_REGS; } + void s3RenewCursorColor(pScr) ScreenPtr pScr; { + if (!x386VTSema) + return; + if (s3SaveCursors[pScr->myNum]) s3RecolorCursor(pScr, s3SaveCursors[pScr->myNum], TRUE); } *************** *** 454,462 **** { if (x386VTSema) { /* Wait for vertical retrace */ ! while ((inb(vgaIOBase + 0x0A) & 0x08) == 0x00) ; ! while ((inb(vgaIOBase + 0x0A) & 0x08) == 0x08) ; ! while ((inb(vgaIOBase + 0x0A) & 0x08) == 0x00) ; } miPointerWarpCursor(pScr, x, y); x386Info.currentScreen = pScr; --- 513,519 ---- { if (x386VTSema) { /* Wait for vertical retrace */ ! VerticalRetraceWait(); } miPointerWarpCursor(pScr, x, y); x386Info.currentScreen = pScr; diff -c /dev/null mit/server/ddx/x386/accel/s3/s3Ti3020.h:2.1 *** /dev/null Fri Mar 11 23:37:58 1994 --- mit/server/ddx/x386/accel/s3/s3Ti3020.h Fri Mar 11 23:37:58 1994 *************** *** 0 **** --- 1,134 ---- + /* + * Copyright 1994 by Robin Cutshaw + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, 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 Robin Cutshaw not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Robin Cutshaw makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * ROBIN CUTSHAW DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL ROBIN CUTSHAW BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + */ + + /* $XFree86: mit/server/ddx/x386/accel/s3/s3Ti3020.h,v 2.1 1994/01/15 02:50:40 dawes Exp $ */ + + #include "compiler.h" + #include + + /* + #define MAX_TI3020_CLOCK 135000 + #define MAX_TI3020_CLOCK_FAST 200000 + */ + + /* Direct standard VGA registers, special index and data registers */ + + #define TI_WRITE_ADDR 0x3C8 /* CR55 low bit == 0 */ + #define TI_RAMDAC_DATA 0x3C9 /* CR55 low bit == 0 */ + #define TI_PIXEL_MASK 0x3C6 /* CR55 low bit == 0 */ + #define TI_READ_ADDR 0x3C7 /* CR55 low bit == 0 */ + #define TI_INDEX_REG 0x3C6 /* CR55 low bit == 1 */ + #define TI_DATA_REG 0x3C7 /* CR55 low bit == 1 */ + + /* Indirect indexed registers */ + + #define TI_CURS_X_LOW 0x00 + #define TI_CURS_X_HIGH 0x01 /* only lower 4 bits are used */ + #define TI_CURS_Y_LOW 0x02 + #define TI_CURS_Y_HIGH 0x03 /* only lower 4 bits are used */ + #define TI_SPRITE_ORIGIN_X 0x04 + #define TI_SPRITE_ORIGIN_Y 0x05 + #define TI_CURS_CONTROL 0x06 + #define TI_CURS_SPRITE_ENABLE 0x40 + #define TI_CURS_X_WINDOW_MODE 0x10 + #define TI_CURS_CTRL_MASK (TI_CURS_SPRITE_ENABLE | TI_CURS_X_WINDOW_MODE) + #define TI_CURS_RAM_ADDR_LOW 0x08 + #define TI_CURS_RAM_ADDR_HIGH 0x09 + #define TI_CURS_RAM_DATA 0x0A + #define TI_WINDOW_START_X_LOW 0x10 + #define TI_WINDOW_START_X_HIGH 0x11 + #define TI_WINDOW_STOP_X_LOW 0x12 + #define TI_WINDOW_STOP_X_HIGH 0x13 + #define TI_WINDOW_START_Y_LOW 0x14 + #define TI_WINDOW_START_Y_HIGH 0x15 + #define TI_WINDOW_STOP_Y_LOW 0x16 + #define TI_WINDOW_STOP_Y_HIGH 0x17 + #define TI_MUX_CONTROL_1 0x18 + #define TI_MUX1_PSEUDO_COLOR 0x80 + #define TI_MUX_CONTROL_2 0x19 + #define TI_MUX2_BUS_VGA 0x98 + #define TI_MUX2_BUS_PIX64 0x1C + #define TI_INPUT_CLOCK_SELECT 0x1A + #define TI_ICLK_CLK0 0x00 + #define TI_ICLK_CLK0_DOUBLE 0x10 + #define TI_ICLK_CLK1 0x01 + #define TI_ICLK_CLK1_DOUBLE 0x11 + #define TI_OUTPUT_CLOCK_SELECT 0x1B + #define TI_OCLK_VGA 0x3E + #define TI_OCLK_S_V4_R8 0x53 + #define TI_PALETTE_PAGE 0x1C + #define TI_GENERAL_CONTROL 0x1D + #define TI_OVERSCAN_COLOR_RED 0x20 + #define TI_OVERSCAN_COLOR_GREEN 0x21 + #define TI_OVERSCAN_COLOR_BLUE 0x22 + #define TI_CURSOR_COLOR_0_RED 0x23 + #define TI_CURSOR_COLOR_0_GREEN 0x24 + #define TI_CURSOR_COLOR_0_BLUE 0x25 + #define TI_CURSOR_COLOR_1_RED 0x26 + #define TI_CURSOR_COLOR_1_GREEN 0x27 + #define TI_CURSOR_COLOR_1_BLUE 0x28 + #define TI_AUXILLARY_CONTROL 0x29 + #define TI_AUX_SELF_CLOCK 0x08 + #define TI_AUX_W_CMPL 0x01 + #define TI_GENERAL_IO_CONTROL 0x2A + #define TI_GIC_ALL_BITS 0x1F + #define TI_GENERAL_IO_DATA 0x2B + #define TI_GID_S3_DAC_6BIT 0x1C + #define TI_GID_S3_DAC_8BIT 0x1E + #define TI_GID_TI_DAC_6BIT 0x1D + #define TI_GID_TI_DAC_8BIT 0x1F + #define TI_COLOR_KEY_OLVGA_LOW 0x30 + #define TI_COLOR_KEY_OLVGA_HIGH 0x31 + #define TI_COLOR_KEY_RED_LOW 0x32 + #define TI_COLOR_KEY_RED_HIGH 0x33 + #define TI_COLOR_KEY_GREEN_LOW 0x34 + #define TI_COLOR_KEY_GREEN_HIGH 0x35 + #define TI_COLOR_KEY_BLUE_LOW 0x36 + #define TI_COLOR_KEY_BLUE_HIGH 0x37 + #define TI_COLOR_KEY_CONTROL 0x38 + #define TI_SENSE_TEST 0x3A + #define TI_TEST_DATA 0x3B + #define TI_CRC_LOW 0x3C + #define TI_CRC_HIGH 0x3D + #define TI_CRC_CONTROL 0x3E + #define TI_ID 0x3F + #define TI_VIEWPOINT_ID 0x20 + + + _XFUNCPROTOBEGIN + + extern void s3OutTiIndReg( + #if NeedFunctionPrototypes + unsigned char, + unsigned char, + unsigned char + #endif + ); + + extern unsigned char s3InTiIndReg( + #if NeedFunctionPrototypes + unsigned char + #endif + ); + + _XFUNCPROTOEND diff -c /dev/null mit/server/ddx/x386/accel/s3/s3TiCursor.c:2.1 *** /dev/null Fri Mar 11 23:37:59 1994 --- mit/server/ddx/x386/accel/s3/s3TiCursor.c Fri Mar 11 23:37:59 1994 *************** *** 0 **** --- 1,391 ---- + /* + * Copyright 1994 by Robin Cutshaw + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, 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 Robin Cutshaw not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Robin Cutshaw makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * ROBIN CUTSHAW DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL ROBIN CUTSHAW BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + */ + + + /* $XFree86: mit/server/ddx/x386/accel/s3/s3TiCursor.c,v 2.1 1994/02/12 11:06:15 dawes Exp $ */ + + #define NEED_EVENTS + #include + #include "Xproto.h" + #include + #include + #include + #include + #include + #include + #include + #include "x386.h" + #include "inputstr.h" + #include "x386Priv.h" + #include "xf86_OSlib.h" + #include "s3.h" + #include "regs3.h" + #include "s3Ti3020.h" + + #define MAX_CURS_HEIGHT 64 /* 64 scan lines */ + #define MAX_CURS_WIDTH 64 /* 64 pixels */ + + + #ifndef __GNUC__ + # define __inline__ /**/ + #endif + + /* + * TI ViewPoint 3020 support - Robin Cutshaw + * + * The Ti3020 has 8 direct command registers and indirect registers + * 0x00-0x3F and 0xFF. The low-order two bits of the direct register + * address follow normal VGA DAC addressing conventions (which + * for some reason aren't in numeric order, so we remap them through + * an array). The S3 provides access to the high-order bit via + * the low-order bit of CR55. The indirect registers are accessed + * through the direct index and data registers. See s3Ti3020.h for + * details. + */ + + /* + * s3OutTiIndReg() and s3InTiIndReg() are used to access the indirect + * 3020 registers only. + */ + + #ifdef __STDC__ + void s3OutTiIndReg(unsigned char reg, unsigned char mask, unsigned char data) + #else + void s3OutTiIndReg(reg, mask, data) + unsigned char reg; + unsigned char mask; + unsigned char data; + #endif + { + unsigned char tmp, tmp1, tmp2 = 0x00; + + /* High 2 bits of reg in CR55 bits 0-1 (1 is cleared for the TI ramdac) */ + outb(vgaCRIndex, 0x55); + tmp = inb(vgaCRReg) & 0xFC; + outb(vgaCRReg, tmp | 0x01); /* toggle to upper 4 direct registers */ + tmp1 = inb(TI_INDEX_REG); + outb(TI_INDEX_REG, reg); + + /* Have to map the low two bits to the correct DAC register */ + if (mask != 0x00) + tmp2 = inb(TI_DATA_REG) & mask; + outb(TI_DATA_REG, tmp2 | data); + + /* Now clear 2 high-order bits so that other things work */ + outb(TI_INDEX_REG, tmp1); /* just in case anyone relies on this */ + outb(vgaCRReg, tmp); + } + + #ifdef __STDC__ + unsigned char s3InTiIndReg(unsigned char reg) + #else + unsigned char s3InTiIndReg(reg) + unsigned char reg; + #endif + { + unsigned char tmp, tmp1, ret; + + /* High 2 bits of reg in CR55 bits 0-1 (1 is cleared for the TI ramdac) */ + outb(vgaCRIndex, 0x55); + tmp = inb(vgaCRReg) & 0xFC; + outb(vgaCRReg, tmp | 0x01); /* toggle to upper 4 direct registers */ + tmp1 = inb(TI_INDEX_REG); + outb(TI_INDEX_REG, reg); + + /* Have to map the low two bits to the correct DAC register */ + ret = inb(TI_DATA_REG); + + /* Now clear 2 high-order bits so that other things work */ + outb(TI_INDEX_REG, tmp1); /* just in case anyone relies on this */ + outb(vgaCRReg, tmp); + + return(ret); + } + + /* + * Convert the cursor from server-format to hardware-format. The Ti3020 + * has two planes, plane 0 selects cursor color 0 or 1 and plane 1 + * selects transparent or display cursor. The bits of these planes + * are packed together so that one byte has 4 pixels. The organization + * looks like: + * Byte 0x000 - 0x00F top scan line, left to right + * 0x010 - 0x01F + * . . + * 0x3F0 - 0x3FF bottom scan line + * + * Byte/bit map - D7D6,D5D4,D3D2,D1D0 four pixels, two planes each + * Pixel/bit map - P1P0 (plane 1) == 1 maps to cursor color + * (plane 1) == 0 maps to transparent + * (plane 0) maps to cursor colors 0 and 1 + */ + + Bool + s3TiRealizeCursor(pScr, pCurs) + ScreenPtr pScr; + CursorPtr pCurs; + { + register int i, j; + unsigned char *pServMsk; + unsigned char *pServSrc; + pointer *pPriv; + int wsrc, h; + unsigned char *ram; + + if (pCurs->bits->refcnt > 1) + return TRUE; + + ram = (unsigned char *)xalloc(1024); /* 64x64x2 bits */ + pPriv = &pCurs->bits->devPriv[pScr->myNum]; + *pPriv = (pointer) ram; + + if (!ram) + return FALSE; + + pServSrc = (unsigned char *)pCurs->bits->source; + pServMsk = (unsigned char *)pCurs->bits->mask; + + h = pCurs->bits->height; + if (h > MAX_CURS_HEIGHT) + h = MAX_CURS_HEIGHT; + + wsrc = PixmapBytePad(pCurs->bits->width, 1); /* bytes per line */ + + for (i = 0; i < MAX_CURS_HEIGHT; i++,ram+=16) { + for (j = 0; j < MAX_CURS_WIDTH / 8; j++) { + register unsigned char mask, source; + + if (i < h && j < wsrc) { + /* + * normally we would use s3SwapBits to quickly reverse bits + * but since have to do bit twiddles anyway, there is no need. + * mask byte ABCDEFGH and source byte 12345678 map to two byte + * cursor data H8G7F6E5 D4C3B2A1 + */ + mask = *pServMsk++; + source = *pServSrc++ & mask; + + /* map 1 byte source and mask into two byte cursor data */ + ram[j*2] = ((mask&0x01) << 7) | ((source&0x01) << 6) | + ((mask&0x02) << 4) | ((source&0x02) << 3) | + ((mask&0x04) << 1) | (source&0x04) | + ((mask&0x08) >> 2) | ((source&0x08) >> 3) ; + ram[(j*2)+1] = ((mask&0x10) << 3) | ((source&0x10) << 2) | + (mask&0x20) | ((source&0x20) >> 1) | + ((mask&0x40) >> 3) | ((source&0x40) >> 4) | + ((mask&0x80) >> 6) | ((source&0x80) >> 7) ; + } else { + ram[j*2] = 0x00; + ram[(j*2)+1] = 0x00; + } + } + /* + * if we still have more bytes on this line (j < wsrc), + * we have to ignore the rest of the line. + */ + while (j++ < wsrc) pServMsk++,pServSrc++; + } + return TRUE; + } + + void + s3TiCursorOn() + { + unsigned char tmp; + + UNLOCK_SYS_REGS; + + /* turn on external cursor */ + outb(vgaCRIndex, 0x55); + tmp = inb(vgaCRReg) & 0xDF; + outb(vgaCRReg, tmp | 0x20); + + /* Enable Ti3020 */ + outb(vgaCRIndex, 0x45); + tmp = inb(vgaCRReg) & 0xDF; + outb(vgaCRReg, tmp | 0x20); + + /* Enable cursor - sprite enable, X11 mode */ + s3OutTiIndReg(TI_CURS_CONTROL, + (unsigned char )~TI_CURS_CTRL_MASK, + TI_CURS_SPRITE_ENABLE | TI_CURS_X_WINDOW_MODE); + + LOCK_SYS_REGS; + return; + } + + void + s3TiCursorOff() + { + UNLOCK_SYS_REGS; + + /* + * Don't need to undo the S3 registers here; they will be undone when + * the mode is restored from save registers. If it is done here, it + * causes the cursor to flash each time it is loaded, so don't do that. + */ + + /* Disable cursor */ + s3OutTiIndReg(TI_CURS_CONTROL, + (unsigned char )~TI_CURS_CTRL_MASK, 0x00); + + LOCK_SYS_REGS; + return; + } + + void + s3TiMoveCursor(pScr, x, y) + ScreenPtr pScr; + int x, y; + { + + if (s3BlockCursor) + return; + + x -= s3InfoRec.frameX0; + if (x < 0) + return; + + y -= s3InfoRec.frameY0; + if (y < 0) + return; + + UNLOCK_SYS_REGS; + + /* Output position - "only" 12 bits of location documented */ + s3OutTiIndReg(TI_CURS_X_LOW, 0x00, x & 0xFF); + s3OutTiIndReg(TI_CURS_X_HIGH, 0x00, (x >> 8) & 0x0F); + s3OutTiIndReg(TI_CURS_Y_LOW, 0x00, y & 0xFF); + s3OutTiIndReg(TI_CURS_Y_HIGH, 0x00, (y >> 8) & 0x0F); + + LOCK_SYS_REGS; + return; + } + + void + s3TiRecolorCursor(pScr, pCurs) + ScreenPtr pScr; + CursorPtr pCurs; + { + UNLOCK_SYS_REGS; + + /* The TI 3020 cursor is always 8 bits so shift 8, not 10 */ + + /* Background color */ + s3OutTiIndReg(TI_CURSOR_COLOR_0_RED, 0, (pCurs->backRed >> 8) & 0xFF); + s3OutTiIndReg(TI_CURSOR_COLOR_0_GREEN, 0, (pCurs->backGreen >> 8) &0xFF); + s3OutTiIndReg(TI_CURSOR_COLOR_0_BLUE, 0, (pCurs->backBlue >> 8) & 0xFF); + + /* Foreground color */ + s3OutTiIndReg(TI_CURSOR_COLOR_1_RED, 0, (pCurs->foreRed >> 8) & 0xFF); + s3OutTiIndReg(TI_CURSOR_COLOR_1_GREEN, 0, (pCurs->foreGreen >> 8) & 0xFF); + s3OutTiIndReg(TI_CURSOR_COLOR_1_BLUE, 0, (pCurs->foreBlue >> 8) & 0xFF); + + LOCK_SYS_REGS; + return; + } + + void + s3TiLoadCursor(pScr, pCurs, x, y) + ScreenPtr pScr; + CursorPtr pCurs; + int x, y; + { + extern int s3hotX, s3hotY; + int index = pScr->myNum; + register int i, j; + unsigned char *ram, *p, tmp, tmp1, tmpcurs; + extern int s3InitCursorFlag; + + if (!x386VTSema) + return; + + if (!pCurs) + return; + + /* turn the cursor off */ + if ((tmpcurs = s3InTiIndReg(TI_CURS_CONTROL)) & TI_CURS_SPRITE_ENABLE) + s3TiCursorOff(); + + /* load colormap */ + s3TiRecolorCursor(pScr, pCurs); + + ram = (unsigned char *)pCurs->bits->devPriv[index]; + + UNLOCK_SYS_REGS; + BLOCK_CURSOR; + + /* The hardware cursor is not supported in interlaced mode */ + + /* High 2 bits of reg in CR55 bits 0-1 (1 is cleared for the TI ramdac) */ + outb(vgaCRIndex, 0x55); + tmp = inb(vgaCRReg) & 0xFC; + outb(vgaCRReg, tmp | 0x01); /* toggle to the high four direct registers */ + tmp1 = inb(TI_INDEX_REG); + + outb(TI_INDEX_REG, TI_CURS_RAM_ADDR_LOW); /* must be first */ + outb(TI_DATA_REG, 0x00); + outb(TI_INDEX_REG, TI_CURS_RAM_ADDR_HIGH); + outb(TI_DATA_REG, 0x00); + outb(TI_INDEX_REG, TI_CURS_RAM_DATA); + + /* + * Output the cursor data. The realize function has put the planes into + * their correct order, so we can just blast this out. + */ + p = ram; + for (i = 0; i < 1024; i++,p++) + outb(TI_DATA_REG, *p); + + if (s3hotX >= MAX_CURS_WIDTH) + s3hotX = MAX_CURS_WIDTH - 1; + else if (s3hotX < 0) + s3hotX = 0; + if (s3hotY >= MAX_CURS_HEIGHT) + s3hotY = MAX_CURS_HEIGHT - 1; + else if (s3hotY < 0) + s3hotY = 0; + + outb(TI_INDEX_REG, TI_SPRITE_ORIGIN_X); /* offset into cursor data */ + outb(TI_DATA_REG, s3hotX); + outb(TI_INDEX_REG, TI_SPRITE_ORIGIN_Y); + outb(TI_DATA_REG, s3hotY); + outb(TI_INDEX_REG, tmp1); + + outb(vgaCRIndex, 0x55); + outb(vgaCRReg, tmp); + + UNBLOCK_CURSOR; + LOCK_SYS_REGS; + + /* position cursor */ + s3TiMoveCursor(0, x, y); + + /* turn the cursor on */ + if ((tmpcurs & TI_CURS_SPRITE_ENABLE) || s3InitCursorFlag) + s3TiCursorOn(); + + if (s3InitCursorFlag) + s3InitCursorFlag = FALSE; + + return; + } diff -c mit/server/ddx/x386/accel/s3/s3bcach.c:2.18 mit/server/ddx/x386/accel/s3/s3bcach.c:2.20 *** mit/server/ddx/x386/accel/s3/s3bcach.c:2.18 Fri Mar 11 23:38:00 1994 --- mit/server/ddx/x386/accel/s3/s3bcach.c Fri Mar 11 23:38:00 1994 *************** *** 25,31 **** * Id: s3bcach.c,v 2.3 1993/07/24 13:16:56 jon Exp */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3bcach.c,v 2.18 1993/09/27 12:24:15 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 25,31 ---- * Id: s3bcach.c,v 2.3 1993/07/24 13:16:56 jon Exp */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3bcach.c,v 2.20 1994/01/01 16:24:02 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 50,56 **** --- 50,58 ---- extern int s3FC_MAX_HEIGHT; extern Bool x386Verbose; + #ifdef DEBUG_FCACHE static void showcache(); + #endif /* * TERMS: *************** *** 88,98 **** return; } reEntry = TRUE; ! s3FC_MAX_HEIGHT = s3ScissB - y; ! y++; /* one line for cursor on top */ ! if (s3FC_MAX_HEIGHT < 32) /* no pixmap cache */ s3CacheLen = s3DisplayWidth; else s3CacheLen = 768; --- 90,103 ---- return; } reEntry = TRUE; ! ! /* y now includes the cursor space */ ! s3FC_MAX_HEIGHT = s3ScissB + 1 - y; ! /* Currently no pixmap cache when s3DisplayWidth < 1024 */ ! ! if (s3FC_MAX_HEIGHT < 32 || s3DisplayWidth < 1024) /* no pixmap cache */ s3CacheLen = s3DisplayWidth; else s3CacheLen = 768; *************** *** 369,374 **** --- 374,380 ---- } + #ifdef DEBUG_FCACHE /* * debuging print out, this give a nice picture of the current structure * of linked lists - believe it or not. *************** *** 386,388 **** --- 392,395 ---- ErrorF(":\n"); } } + #endif diff -c mit/server/ddx/x386/accel/s3/s3blt.c:2.12 mit/server/ddx/x386/accel/s3/s3blt.c:2.15 *** mit/server/ddx/x386/accel/s3/s3blt.c:2.12 Fri Mar 11 23:38:01 1994 --- mit/server/ddx/x386/accel/s3/s3blt.c Fri Mar 11 23:38:01 1994 *************** *** 32,38 **** * Id: s3blt.c,v 2.2 1993/06/22 20:54:09 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3blt.c,v 2.12 1993/09/25 05:02:01 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 32,38 ---- * Id: s3blt.c,v 2.2 1993/06/22 20:54:09 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3blt.c,v 2.15 1994/02/25 14:58:44 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 55,60 **** --- 55,61 ---- extern int s3MAX_SLOTS; void s3FindOrdering(); + extern RegionPtr cfbBitBlt(); RegionPtr s3CopyArea(pSrcDrawable, pDstDrawable, *************** *** 539,544 **** --- 540,572 ---- (void) cfbBitBlt(pSrcDrawable, (DrawablePtr)pBitmap, pGC1, srcx, srcy, width, height, 0, 0, cfbCopyPlane8to1, bitPlane); pSrcDrawable = (DrawablePtr)pBitmap; + } + else if ((pSrcDrawable->type == DRAWABLE_WINDOW) && + (pDstDrawable->type != DRAWABLE_WINDOW)) { + /* + * Shortcut - we can do Window->Pixmap by copying the window to + * a pixmap, then we have a Pixmap->Pixmap operation + */ + GCPtr pGC1; + RegionPtr retval; + PixmapPtr pPixmap; + + pPixmap=(*pSrcDrawable->pScreen->CreatePixmap)(pSrcDrawable->pScreen, + width, height, 8); + if (!pPixmap) + return(NULL); + pGC1 = GetScratchGC(8, pSrcDrawable->pScreen); + if (!pGC1) { + (*pSrcDrawable->pScreen->DestroyPixmap)(pPixmap); + return(NULL); + } + ValidateGC((DrawablePtr)pPixmap, pGC1); + s3CopyArea(pSrcDrawable, pPixmap, pGC1, srcx, srcy, width, height, + 0, 0); + retval = cfbCopyPlane((DrawablePtr)pPixmap, pDstDrawable, pGC, + 0, 0, width, height, dstx, dsty, bitPlane); + (*pSrcDrawable->pScreen->DestroyPixmap)(pPixmap); + return(retval); } else if (((pSrcDrawable->type == DRAWABLE_WINDOW) && (pDstDrawable->type != DRAWABLE_WINDOW)) || diff -c mit/server/ddx/x386/accel/s3/s3cmap.c:2.5 mit/server/ddx/x386/accel/s3/s3cmap.c:2.6 *** mit/server/ddx/x386/accel/s3/s3cmap.c:2.5 Fri Mar 11 23:38:02 1994 --- mit/server/ddx/x386/accel/s3/s3cmap.c Fri Mar 11 23:38:02 1994 *************** *** 31,37 **** * Id: s3cmap.c,v 2.2 1993/06/22 20:54:09 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3cmap.c,v 2.5 1993/09/21 15:22:38 dawes Exp $ */ #include "X.h" #include "Xproto.h" --- 31,37 ---- * Id: s3cmap.c,v 2.2 1993/06/22 20:54:09 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3cmap.c,v 2.6 1994/01/09 03:30:56 dawes Exp $ */ #include "X.h" #include "Xproto.h" *************** *** 102,107 **** --- 102,108 ---- { int i; xColorItem directDefs[256]; + extern Bool s3DAC8Bit; if (pmap != InstalledMaps[pmap->pScreen->myNum]) return; *************** *** 112,125 **** } BLOCK_CURSOR; for (i = 0; i < ndef; i++) { ! currents3dac[pdefs[i].pixel].r = pdefs[i].red >> 10; ! currents3dac[pdefs[i].pixel].g = pdefs[i].green >> 10; ! currents3dac[pdefs[i].pixel].b = pdefs[i].blue >> 10; if (x386VTSema) { outb(DAC_W_INDEX, pdefs[i].pixel); ! outb(DAC_DATA, pdefs[i].red >> 10); ! outb(DAC_DATA, pdefs[i].green >> 10); ! outb(DAC_DATA, pdefs[i].blue >> 10); } } UNBLOCK_CURSOR; --- 113,134 ---- } BLOCK_CURSOR; for (i = 0; i < ndef; i++) { ! unsigned char r, g, b; ! ! if (s3DAC8Bit) { ! r = currents3dac[pdefs[i].pixel].r = pdefs[i].red >> 8; ! g = currents3dac[pdefs[i].pixel].g = pdefs[i].green >> 8; ! b = currents3dac[pdefs[i].pixel].b = pdefs[i].blue >> 8; ! } else { ! r = currents3dac[pdefs[i].pixel].r = pdefs[i].red >> 10; ! g = currents3dac[pdefs[i].pixel].g = pdefs[i].green >> 10; ! b = currents3dac[pdefs[i].pixel].b = pdefs[i].blue >> 10; ! } if (x386VTSema) { outb(DAC_W_INDEX, pdefs[i].pixel); ! outb(DAC_DATA, r); ! outb(DAC_DATA, g); ! outb(DAC_DATA, b); } } UNBLOCK_CURSOR; *************** *** 202,208 **** { Pixel pix = 0; xrgb rgb; ! if (InstalledMaps[pScreen->myNum] == NOMAPYET) return; --- 211,218 ---- { Pixel pix = 0; xrgb rgb; ! extern Bool s3DAC8Bit; ! if (InstalledMaps[pScreen->myNum] == NOMAPYET) return; *************** *** 210,217 **** BLOCK_CURSOR; outb(DAC_W_INDEX, 0); ! outb(DAC_DATA, rgb.red >> 10); ! outb(DAC_DATA, rgb.green >> 10); ! outb(DAC_DATA, rgb.blue >> 10); UNBLOCK_CURSOR; } --- 220,233 ---- BLOCK_CURSOR; outb(DAC_W_INDEX, 0); ! if (s3DAC8Bit) { ! outb(DAC_DATA, rgb.red >> 8); ! outb(DAC_DATA, rgb.green >> 8); ! outb(DAC_DATA, rgb.blue >> 8); ! } else { ! outb(DAC_DATA, rgb.red >> 10); ! outb(DAC_DATA, rgb.green >> 10); ! outb(DAC_DATA, rgb.blue >> 10); ! } UNBLOCK_CURSOR; } diff -c mit/server/ddx/x386/accel/s3/s3dline.c:2.10 mit/server/ddx/x386/accel/s3/s3dline.c:2.11 *** mit/server/ddx/x386/accel/s3/s3dline.c:2.10 Fri Mar 11 23:38:02 1994 --- mit/server/ddx/x386/accel/s3/s3dline.c Fri Mar 11 23:38:02 1994 *************** *** 26,32 **** /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ /* s3dline.c from s3line.c with help from cfbresd.c and cfbline.c - Jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3dline.c,v 2.10 1993/09/21 15:22:39 dawes Exp $ */ #include "X.h" --- 26,32 ---- /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ /* s3dline.c from s3line.c with help from cfbresd.c and cfbline.c - Jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3dline.c,v 2.11 1993/12/25 13:59:50 dawes Exp $ */ #include "X.h" *************** *** 376,382 **** */ while (nbox--) { - int dlen; oc1 = 0; oc2 = 0; OUTCODES(oc1, x1, y1, pbox); --- 376,381 ---- diff -c mit/server/ddx/x386/accel/s3/s3dseg.c:2.2 mit/server/ddx/x386/accel/s3/s3dseg.c:2.3 *** mit/server/ddx/x386/accel/s3/s3dseg.c:2.2 Fri Mar 11 23:38:03 1994 --- mit/server/ddx/x386/accel/s3/s3dseg.c Fri Mar 11 23:38:03 1994 *************** *** 26,32 **** /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ /* s3dline.c from s3line.c with help from cfbresd.c and cfbline.c - Jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3dseg.c,v 2.2 1993/09/21 15:22:41 dawes Exp $ */ #include "X.h" --- 26,32 ---- /* $XConsortium: cfbline.c,v 1.19 91/08/13 18:48:42 keith Exp $ */ /* s3dline.c from s3line.c with help from cfbresd.c and cfbline.c - Jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3dseg.c,v 2.3 1993/12/25 13:59:53 dawes Exp $ */ #include "X.h" *************** *** 369,375 **** */ while (nbox--) { - int dlen; oc1 = 0; oc2 = 0; OUTCODES(oc1, x1, y1, pbox); --- 369,374 ---- diff -c mit/server/ddx/x386/accel/s3/s3im.c:2.26 mit/server/ddx/x386/accel/s3/s3im.c:2.28 *** mit/server/ddx/x386/accel/s3/s3im.c:2.26 Fri Mar 11 23:38:04 1994 --- mit/server/ddx/x386/accel/s3/s3im.c Fri Mar 11 23:38:04 1994 *************** *** 27,33 **** * Id: s3im.c,v 2.7 1993/08/10 15:20:03 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3im.c,v 2.26 1993/10/07 13:55:39 dawes Exp $ */ #include "misc.h" #include "x386.h" --- 27,33 ---- * Id: s3im.c,v 2.7 1993/08/10 15:20:03 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3im.c,v 2.28 1993/12/25 13:59:56 dawes Exp $ */ #include "misc.h" #include "x386.h" *************** *** 60,66 **** extern unsigned char s3Port54; extern Bool x386Verbose; extern Bool s3LinearAperture; - extern unsigned char s3LinApOpt; extern void (*s3ImageReadFunc) (), (*s3ImageWriteFunc) (); extern void (*s3ImageFillFunc) (); --- 60,65 ---- *************** *** 457,463 **** short alu; short planemask; { ! int j, i, offset; char bank; char *videobuffer; --- 456,462 ---- short alu; short planemask; { ! int j, offset; char bank; char *videobuffer; *************** *** 527,533 **** int py; short planemask; { ! int j, i; int offset; int bank; char *videobuffer; --- 526,532 ---- int py; short planemask; { ! int j; int offset; int bank; char *videobuffer; *************** *** 588,594 **** short alu; short planemask; { ! int j, i; unsigned char *pline; int ypix, xpix, offset0; int cxpix; --- 587,593 ---- short alu; short planemask; { ! int j; unsigned char *pline; int ypix, xpix, offset0; int cxpix; diff -c mit/server/ddx/x386/accel/s3/s3init.c:2.34 mit/server/ddx/x386/accel/s3/s3init.c:2.58 *** mit/server/ddx/x386/accel/s3/s3init.c:2.34 Fri Mar 11 23:38:05 1994 --- mit/server/ddx/x386/accel/s3/s3init.c Fri Mar 11 23:38:06 1994 *************** *** 23,29 **** * Id: s3init.c,v 2.5 1993/08/09 06:17:57 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3init.c,v 2.34 1993/09/30 17:48:59 dawes Exp $ */ #define USE_VGAHWINIT --- 23,29 ---- * Id: s3init.c,v 2.5 1993/08/09 06:17:57 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3init.c,v 2.58 1994/03/10 07:05:14 dawes Exp $ */ #define USE_VGAHWINIT *************** *** 41,51 **** --- 41,55 ---- #include "s3.h" #include "regs3.h" #include "s3Bt485.h" + #include "s3Ti3020.h" #ifdef NEW_INIT_SAVE_RESTORE typedef struct { vgaHWRec std; /* good old IBM VGA */ + unsigned char SC15025[2]; /* Sierra SC 15025/6 command registers */ + unsigned char ATT490_1; /* AT&T 20C490/1 command register */ unsigned char Bt485[4]; /* Bt485 Command Registers 0-3 */ + unsigned char Ti3020[0x40]; /* Ti3020 Indirect Registers 0x0-0x3F */ unsigned char s3reg[13]; /* Video Atribute (CR30-3C) */ unsigned char s3sysreg[36]; /* Video Atribute (CR40-63) */ unsigned short AdvFuncCntl; /* 0x4AE8 */ *************** *** 54,60 **** --- 58,67 ---- #else typedef struct { vgaHWRec std; /* good old IBM VGA */ + unsigned char SC15025[2]; /* Sierra SC 15025/6 command registers */ + unsigned char ATT490_1; /* AT&T 20C490/1 command register */ unsigned char Bt485[4]; /* Bt485 Command Registers 0-3 */ + unsigned char Ti3020[0x40]; /* Ti3020 Indirect Registers 0x0-0x3F */ unsigned char s3reg[10]; /* Video Atribute (CR30-34, CR38-3C) */ unsigned char s3sysreg[36]; /* Video Atribute (CR40-63)*/ } *************** *** 64,69 **** --- 71,77 ---- int vgaIOBase = 0x3d0; /* These defaults are overriden in s3Probe() */ int vgaCRIndex = 0x3d4; int vgaCRReg = 0x3d5; + int s3InitCursorFlag = TRUE; extern x386InfoRec x386Info; static vgaS3Ptr oldS3 = NULL; *************** *** 102,116 **** * Registers to save/restore in the 0x50 - 0x5f control range */ ! static short reg50_mask = 0x4023; ! extern char s3Port54; ! extern char s3Port51; ! extern char s3Port40; void s3CleanUp(void) { int i; UNLOCK_SYS_REGS; --- 110,129 ---- * Registers to save/restore in the 0x50 - 0x5f control range */ ! static short reg50_mask = 0x6733; /* was 0x4023 */ ! extern unsigned char s3Port54; ! extern unsigned char s3Port51; ! extern unsigned char s3Port40; ! extern unsigned char s3Port59; ! extern unsigned char s3Port5A; ! extern unsigned char s3Port31; ! void s3CleanUp(void) { int i; + unsigned char c, tmp; UNLOCK_SYS_REGS; *************** *** 127,149 **** outb(vgaCRIndex, 0x53); outb(vgaCRReg, 0x00); } - vgaHWRestore(oldS3); /* (s3ClockSelectFunc)(restore->std.NoClock); */ /* * Restore Bt485 registers */ ! if (OFLG_ISSET(OPTION_BT485, &s3InfoRec.options)) { s3OutBtReg(BT_COMMAND_REG_0, 0xFE, 0x01); s3OutBtRegCom3(0x00, oldS3->Bt485[3]); ! #if NOTYET ! s3OutBtReg(BT_COMMAND_REG_2, 0x00, oldS3->Bt485[2]); ! s3OutBtReg(BT_COMMAND_REG_1, 0x00, oldS3->Bt485[1]); ! #endif s3OutBtReg(BT_COMMAND_REG_0, 0x00, oldS3->Bt485[0]); } /* restore s3 special bits */ if (S3_801_928_SERIES(s3ChipId)) { /* restore 801 specific registers */ --- 140,223 ---- outb(vgaCRIndex, 0x53); outb(vgaCRReg, 0x00); } /* (s3ClockSelectFunc)(restore->std.NoClock); */ /* + * Restore AT&T 20C490/1 command register. + */ + if (OFLG_ISSET(OPTION_ATT490_1, &s3InfoRec.options)) { + xf86setdaccomm(oldS3->ATT490_1); + } + + /* + * Restore Sierra SC 15025/6 registers. + */ + if (OFLG_ISSET(OPTION_SC15025, &s3InfoRec.options)) { + c=xf86getdaccomm(); + xf86setdaccomm( c | 0x10 ); /* set internal register access */ + (void)xf86dactocomm(); + outb(0x3c7, 0x8); + outb(0x3c8, oldS3->SC15025[1]); + xf86setdaccomm( c ); + xf86setdaccomm(oldS3->SC15025[0]); + } + + /* * Restore Bt485 registers */ ! if (DAC_IS_BT485_SERIES) { ! ! /* Turn off parallel mode explicitly here */ ! if (s3Bt485PixMux) { ! #ifdef NO_USER_OUT ! /* This might not be SPEA specific */ ! if (OFLG_ISSET(OPTION_SPEA_MERCURY, &s3InfoRec.options)) ! #endif ! { ! outb(vgaCRIndex, 0x5C); ! outb(vgaCRReg, 0x20); ! outb(0x3C7, 0x00); ! /* set s3 reg53 to non-parallel addressing by and'ing 0xDF */ ! outb(vgaCRIndex, 0x53); ! tmp = inb(vgaCRReg); ! outb(vgaCRReg, tmp & 0xDF); ! outb(vgaCRIndex, 0x5C); ! outb(vgaCRReg, 0x00); ! } ! } ! s3OutBtReg(BT_COMMAND_REG_0, 0xFE, 0x01); s3OutBtRegCom3(0x00, oldS3->Bt485[3]); ! if (s3Bt485PixMux) { ! s3OutBtReg(BT_COMMAND_REG_2, 0x00, oldS3->Bt485[2]); ! s3OutBtReg(BT_COMMAND_REG_1, 0x00, oldS3->Bt485[1]); ! } s3OutBtReg(BT_COMMAND_REG_0, 0x00, oldS3->Bt485[0]); } + /* + * Restore Ti3020 registers + */ + if (DAC_IS_TI3020) { + s3OutTiIndReg(TI_CURS_CONTROL, 0x00, oldS3->Ti3020[TI_CURS_CONTROL]); + s3OutTiIndReg(TI_MUX_CONTROL_1, 0x00, oldS3->Ti3020[TI_MUX_CONTROL_1]); + s3OutTiIndReg(TI_MUX_CONTROL_2, 0x00, oldS3->Ti3020[TI_MUX_CONTROL_2]); + s3OutTiIndReg(TI_INPUT_CLOCK_SELECT, 0x00, + oldS3->Ti3020[TI_INPUT_CLOCK_SELECT]); + s3OutTiIndReg(TI_OUTPUT_CLOCK_SELECT, 0x00, + oldS3->Ti3020[TI_OUTPUT_CLOCK_SELECT]); + s3OutTiIndReg(TI_GENERAL_CONTROL, 0x00, + oldS3->Ti3020[TI_GENERAL_CONTROL]); + s3OutTiIndReg(TI_AUXILLARY_CONTROL, 0x00, + oldS3->Ti3020[TI_AUXILLARY_CONTROL]); + s3OutTiIndReg(TI_GENERAL_IO_CONTROL, 0x00, 0x1f); + s3OutTiIndReg(TI_GENERAL_IO_DATA, 0x00, + oldS3->Ti3020[TI_GENERAL_IO_DATA]); + } + + vgaHWRestore(oldS3); + /* restore s3 special bits */ if (S3_801_928_SERIES(s3ChipId)) { /* restore 801 specific registers */ *************** *** 195,203 **** s3Init(mode) DisplayModePtr mode; { - short i; ! int interlacedived = 1; UNLOCK_SYS_REGS; --- 269,279 ---- s3Init(mode) DisplayModePtr mode; { short i; ! int interlacedived = mode->Flags & V_INTERLACE ? 2 : 1; ! int pixel_multiplexing; ! unsigned char tmp, tmp1, tmp2; ! extern Bool s3DAC8Bit; UNLOCK_SYS_REGS; *************** *** 226,247 **** oldS3 = vgaHWSave(oldS3, sizeof(vgaS3Rec)); /* * Save Bt485 Registers */ ! if (OFLG_ISSET(OPTION_BT485, &s3InfoRec.options)) { oldS3->Bt485[0] = s3InBtReg(BT_COMMAND_REG_0); ! #ifdef NOTYET ! oldS3->Bt485[1] = s3InBtReg(BT_COMMAND_REG_1); ! oldS3->Bt485[2] = s3InBtReg(BT_COMMAND_REG_2); ! #endif oldS3->Bt485[3] = s3InBtRegCom3(); } for (i = 0; i < 5; i++) { outb(vgaCRIndex, 0x30 + i); oldS3->s3reg[i] = inb(vgaCRReg); outb(vgaCRIndex, 0x38 + i); oldS3->s3reg[5 + i] = inb(vgaCRReg); } outb(vgaCRIndex, 0x11); /* allow writting? */ --- 302,367 ---- oldS3 = vgaHWSave(oldS3, sizeof(vgaS3Rec)); /* + * Save AT&T 20C490/1 command register. + */ + if (OFLG_ISSET(OPTION_ATT490_1, &s3InfoRec.options)) { + oldS3->ATT490_1 = xf86getdaccomm(); + } + + /* + * Save Sierra SC15025/6 command registers. + */ + LOCK_SYS_REGS; + if (OFLG_ISSET(OPTION_SC15025, &s3InfoRec.options)) { + oldS3->SC15025[0] = xf86getdaccomm(); + xf86setdaccomm((oldS3->SC15025[0] | 0x10)); + (void)xf86dactocomm(); + outb(0x3c7,0x8); + oldS3->SC15025[1] = inb(0x3c8); + xf86setdaccomm(oldS3->SC15025[0]); + } + UNLOCK_SYS_REGS; + /* * Save Bt485 Registers */ ! if (DAC_IS_BT485_SERIES) { oldS3->Bt485[0] = s3InBtReg(BT_COMMAND_REG_0); ! if (s3Bt485PixMux) { ! oldS3->Bt485[1] = s3InBtReg(BT_COMMAND_REG_1); ! oldS3->Bt485[2] = s3InBtReg(BT_COMMAND_REG_2); ! } oldS3->Bt485[3] = s3InBtRegCom3(); } + /* + * Save Ti3020 registers + */ + if (DAC_IS_TI3020) { + oldS3->Ti3020[TI_CURS_CONTROL] = s3InTiIndReg(TI_CURS_CONTROL); + oldS3->Ti3020[TI_MUX_CONTROL_1] = s3InTiIndReg(TI_MUX_CONTROL_1); + oldS3->Ti3020[TI_MUX_CONTROL_2] = s3InTiIndReg(TI_MUX_CONTROL_2); + oldS3->Ti3020[TI_INPUT_CLOCK_SELECT] = + s3InTiIndReg(TI_INPUT_CLOCK_SELECT); + oldS3->Ti3020[TI_OUTPUT_CLOCK_SELECT] = + s3InTiIndReg(TI_OUTPUT_CLOCK_SELECT); + oldS3->Ti3020[TI_GENERAL_CONTROL] = s3InTiIndReg(TI_GENERAL_CONTROL); + oldS3->Ti3020[TI_AUXILLARY_CONTROL] = + s3InTiIndReg(TI_AUXILLARY_CONTROL); + s3OutTiIndReg(TI_GENERAL_IO_CONTROL, 0x00, 0x1f); + oldS3->Ti3020[TI_GENERAL_IO_DATA] = s3InTiIndReg(TI_GENERAL_IO_DATA); + } + for (i = 0; i < 5; i++) { outb(vgaCRIndex, 0x30 + i); oldS3->s3reg[i] = inb(vgaCRReg); + #ifdef REG_DEBUG + ErrorF("CR%X = 0x%02x\n", 0x30 + i, oldS3->s3reg[i]); + #endif outb(vgaCRIndex, 0x38 + i); oldS3->s3reg[5 + i] = inb(vgaCRReg); + #ifdef REG_DEBUG + ErrorF("CR%X = 0x%02x\n", 0x38 + i, oldS3->s3reg[i + 5]); + #endif } outb(vgaCRIndex, 0x11); /* allow writting? */ *************** *** 249,258 **** --- 369,385 ---- for (i = 0; i < 16; i++) { outb(vgaCRIndex, 0x40 + i); oldS3->s3sysreg[i] = inb(vgaCRReg); + #ifdef REG_DEBUG + ErrorF("CR%X = 0x%02x\n", 0x40 + i, oldS3->s3sysreg[i]); + #endif } if (S3_801_928_SERIES(s3ChipId)) for (i = 0; i < 16; i++) { + #ifdef REG_DEBUG + outb(vgaCRIndex, 0x50 + i); + ErrorF("CR%X = 0x%02x\n", 0x50 + i, inb(vgaCRReg)); + #endif if (!((1 << i) & reg50_mask)) continue; outb(vgaCRIndex, 0x50 + i); *************** *** 262,267 **** --- 389,397 ---- for (i = 32; i < 35; i++) { outb(vgaCRIndex, 0x40 + i); oldS3->s3sysreg[i] = inb(vgaCRReg); + #ifdef REG_DEBUG + ErrorF("CR%X = 0x%02x\n", 0x40 + i, oldS3->s3sysreg[i]); + #endif } s3Initialised = 1; *************** *** 270,278 **** --- 400,430 ---- } + if (s3UsingPixMux && (mode->Flags & V_PIXMUX)) + pixel_multiplexing = TRUE; + else + pixel_multiplexing = FALSE; + + + if (pixel_multiplexing) { + /* now divide the horizontal timing parameters by 4 for VCLK/4 */ + mode->HTotal >>= 2; + mode->HDisplay >>= 2; + mode->HSyncStart >>= 2; + mode->HSyncEnd >>= 2; + } + if (!vgaHWInit(mode, sizeof(vgaS3Rec))) return(FALSE); + if (pixel_multiplexing) { + /* put back the horizontal timing parameters */ + mode->HTotal <<= 2; + mode->HDisplay <<= 2; + mode->HSyncStart <<= 2; + mode->HSyncEnd <<= 2; + } + new->MiscOutReg |= 0x0C; /* enable CR42 clock selection */ new->Sequencer[0] = 0x03; /* XXXX shouldn't need this */ new->CRTC[19] = s3DisplayWidth >> 3; *************** *** 287,299 **** else new->MiscOutReg |= 0x01; /* Don't change the clock bits when using an external clock program */ if (new->NoClock < 0) { - unsigned char tmp; - tmp = inb(0x3CC); new->MiscOutReg = (new->MiscOutReg & 0xF3) | (tmp & 0x0C); } outb(0x3C2, new->MiscOutReg); --- 439,721 ---- else new->MiscOutReg |= 0x01; + if (OFLG_ISSET(OPTION_SPEA_MERCURY, &s3InfoRec.options)) { + /* + * Make sure that parallel option is already set correctly before + * changing the clock doubler state. + * XXXX maybe the !pixel_multiplexing bit is not required? + */ + if (pixel_multiplexing) { + outb(vgaCRIndex, 0x5C); + outb(vgaCRReg, 0x20); + outb(0x3C7, 0x21); + /* set s3 reg53 to parallel addressing by or'ing 0x20 */ + outb(vgaCRIndex, 0x53); + tmp = inb(vgaCRReg); + outb(vgaCRReg, tmp | 0x20); + outb(vgaCRIndex, 0x5C); + outb(vgaCRReg, 0x00); + } else { + outb(vgaCRIndex, 0x5C); + outb(vgaCRReg, 0x20); + outb(0x3C7, 0x00); + /* set s3 reg53 to non-parallel addressing by and'ing 0xDF */ + outb(vgaCRIndex, 0x53); + tmp = inb(vgaCRReg); + outb(vgaCRReg, tmp & 0xDF); + outb(vgaCRIndex, 0x5C); + outb(vgaCRReg, 0x00); + } + } + /* Don't change the clock bits when using an external clock program */ if (new->NoClock < 0) { tmp = inb(0x3CC); new->MiscOutReg = (new->MiscOutReg & 0xF3) | (tmp & 0x0C); + } else { + /* XXXX Should we really do something about the return value? */ + (void) (s3ClockSelectFunc) (mode->Clock); + } + + /* + * Set AT&T 20C490/1 command register to 8-bit mode if desired. + */ + if (OFLG_ISSET(OPTION_ATT490_1, &s3InfoRec.options)) { + if (s3DAC8Bit) { + xf86setdaccommbit(0x02); + } else { + xf86clrdaccommbit(0x02); + } + } + + /* + * Set Sierra SC 15025/6 command registers to 8-bit mode if desired. + */ + LOCK_SYS_REGS; + if (OFLG_ISSET(OPTION_SC15025, &s3InfoRec.options)) { + if (s3DAC8Bit) { + tmp2=xf86getdaccomm(); + xf86setdaccomm(tmp2 | 0x10); + (void)xf86dactocomm(); + outb(0x3c7,0x8); + outb(0x3c8,0x01); + xf86setdaccomm(tmp2); + } else { + tmp2=xf86getdaccomm(); + xf86setdaccomm(tmp2 | 0x10); + (void)xf86dactocomm(); + outb(0x3c7,0x8); + outb(0x3c8,0x00); + xf86setdaccomm(tmp2); + } + UNLOCK_SYS_REGS; + } + + + if (s3Bt485PixMux) { + outb(0x3C4, 1); + tmp2 = inb(0x3C5); + outb(0x3C5, tmp2 | 0x20); /* blank the screen */ + + if (pixel_multiplexing) { + /* fun timing mods for pixel-multiplexing! */ + + #ifdef NO_USER_OUT + /* This might not be SPEA specific */ + if (OFLG_ISSET(OPTION_SPEA_MERCURY, &s3InfoRec.options)) + #endif + { + outb(vgaCRIndex, 0x5C); + outb(vgaCRReg, 0x20); + outb(0x3C7, 0x21); + } + /* set s3 reg53 to parallel addressing by or'ing 0x20 */ + outb(vgaCRIndex, 0x53); + tmp = inb(vgaCRReg); + outb(vgaCRReg, tmp | 0x20); + #ifdef NO_USER_OUT + /* This might not be SPEA specific */ + if (OFLG_ISSET(OPTION_SPEA_MERCURY, &s3InfoRec.options)) + #endif + { + outb(vgaCRIndex, 0x5C); + outb(vgaCRReg, 0x00); + } + + /* set s3 reg55 to external serial by or'ing 0x08 */ + outb(vgaCRIndex, 0x55); + tmp = inb(vgaCRReg); + outb(vgaCRReg, tmp | 0x08); + + /* the input clock is already set to clk1 or clk1double (s3.c) */ + + /* set command reg 0 to normal clocking, CR3, sleep, 8bit */ + s3OutBtReg(BT_COMMAND_REG_0, 0x00, 0x83); + + /* clear command reg 1 */ + s3OutBtReg(BT_COMMAND_REG_1, 0x00, 0x00); + + s3OutBtReg(BT_WRITE_ADDR, 0x00, 0x01); + + /* clock double bit already set */ + + /* + * set output clocking to 4:1 multiplexing + */ + s3OutBtReg(BT_COMMAND_REG_1, 0x00, 0x40); + + /* SCLK enable,pclk1,pixport,xcursor */ + if (mode->Flags & V_INTERLACE) + s3OutBtReg(BT_COMMAND_REG_2, 0x00, 0x33 | 0x08); + else + s3OutBtReg(BT_COMMAND_REG_2, 0x00, 0x33); + + /* change to 8-bit DAC if option is set */ + if (s3DAC8Bit) + s3OutBtReg(BT_COMMAND_REG_0, 0x00, 0x02); + else + s3OutBtReg(BT_COMMAND_REG_0, 0x00, 0x00); + } else { + + #ifdef NO_USER_OUT + /* This might not be SPEA specific */ + if (OFLG_ISSET(OPTION_SPEA_MERCURY, &s3InfoRec.options)) + #endif + { + outb(vgaCRIndex, 0x5C); + outb(vgaCRReg, 0x20); + outb(0x3C7, 0x00); + } + + /* set s3 reg53 to non-parallel addressing by and'ing 0xDF */ + outb(vgaCRIndex, 0x53); + tmp = inb(vgaCRReg); + outb(vgaCRReg, tmp & 0xDF); + + #ifdef NO_USER_OUT + /* This might not be SPEA specific */ + if (OFLG_ISSET(OPTION_SPEA_MERCURY, &s3InfoRec.options)) + #endif + { + outb(vgaCRIndex, 0x5C); + outb(vgaCRReg, 0x00); + } + + /* set s3 reg55 to non-external serial by and'ing 0xF7 */ + outb(vgaCRIndex, 0x55); + tmp = inb(vgaCRReg); + outb(vgaCRReg, tmp & 0xF7); + + /* the input clock is already set to clk1 or clk1double (s3.c) */ + + /* set command reg 0 to normal clocking */ + s3OutBtReg(BT_COMMAND_REG_0, 0x00, 0x00); + + /* pclk1 */ + s3OutBtReg(BT_COMMAND_REG_2, 0x00, 0x10); + + /* change to 8-bit DAC if option is set */ + if (s3DAC8Bit) + s3OutBtReg(BT_COMMAND_REG_0, 0x00, 0x02); + else + s3OutBtReg(BT_COMMAND_REG_0, 0x00, 0x00); + } /* end of pixel_multiplexing */ + + outb(0x3C4, 1); + outb(0x3C5, tmp2); /* unblank the screen */ + } else + if (DAC_IS_TI3020) { + outb(0x3C4, 1); + tmp2 = inb(0x3C5); + outb(0x3C5, tmp2 | 0x20); /* blank the screen */ + + /* change polarity on S3 to pass through control to the 3020 */ + tmp = new->MiscOutReg; /* BUG tmp = inb(0x3CC); */ + new->MiscOutReg |= 0xC0; + tmp1 = 0x00; + if (!(tmp & 0x80)) tmp1 |= 0x02; /* invert bits for the 3020 */ + if (!(tmp & 0x40)) tmp1 |= 0x01; + s3OutTiIndReg(TI_GENERAL_CONTROL, 0x00, tmp1); + + if (pixel_multiplexing) { + /* fun timing mods for pixel-multiplexing! */ + + /* set s3 reg53 to parallel addressing by or'ing 0x20 */ + outb(vgaCRIndex, 0x53); + tmp = inb(vgaCRReg); + outb(vgaCRReg, tmp | 0x20); + + /* set s3 reg55 to external serial by or'ing 0x08 */ + outb(vgaCRIndex, 0x55); + tmp = inb(vgaCRReg); + outb(vgaCRReg, tmp | 0x08); + + /* the input clock is already set to clk1 or clk1double (s3.c) */ + + /* set aux control to self clocked, window function complement */ + s3OutTiIndReg(TI_AUXILLARY_CONTROL, 0, + TI_AUX_SELF_CLOCK | TI_AUX_W_CMPL); + + /* + * set output clocking to VCLK/4, RCLK/8 like the fixed Bt485. + * RCLK/8 is used because of the 8:1 pixel-multiplexing below. + * the RCLK output is tied to the LCLK input which is the same + * as SCLK but with no blanking. SCLK is the actual pixel + * shift clock for the pixel bus. + */ + s3OutTiIndReg(TI_OUTPUT_CLOCK_SELECT, 0x00, TI_OCLK_S_V4_R8); + + /* set mux control 1 and 2 to provide pseudocolor sub-mode 4 */ + /* this provides a 64-bit pixel bus with 8:1 multiplexing */ + s3OutTiIndReg(TI_MUX_CONTROL_1, 0x00, TI_MUX1_PSEUDO_COLOR); + s3OutTiIndReg(TI_MUX_CONTROL_2, 0x00, TI_MUX2_BUS_PIX64); + + /* change to 8-bit DAC and re-route the data path and clocking */ + s3OutTiIndReg(TI_GENERAL_IO_CONTROL, 0x00, TI_GIC_ALL_BITS); + if (s3DAC8Bit) + s3OutTiIndReg(TI_GENERAL_IO_DATA, 0x00, TI_GID_TI_DAC_8BIT); + else + s3OutTiIndReg(TI_GENERAL_IO_DATA, 0x00, TI_GID_TI_DAC_6BIT); + } else { + /* set s3 reg53 to non-parallel addressing by and'ing 0xDF */ + outb(vgaCRIndex, 0x53); + tmp = inb(vgaCRReg); + outb(vgaCRReg, tmp & 0xDF); + + /* set s3 reg55 to non-external serial by and'ing 0xF7 */ + outb(vgaCRIndex, 0x55); + tmp = inb(vgaCRReg); + outb(vgaCRReg, tmp & 0xF7); + + /* the input clock is already set to clk1 or clk1double (s3.c) */ + + /* set aux control to self clocked only */ + s3OutTiIndReg(TI_AUXILLARY_CONTROL, 0, TI_AUX_SELF_CLOCK); + + /* + * set output clocking to default of VGA. + */ + s3OutTiIndReg(TI_OUTPUT_CLOCK_SELECT, 0x00, TI_OCLK_VGA); + + /* set mux control 1 and 2 to provide pseudocolor VGA */ + s3OutTiIndReg(TI_MUX_CONTROL_1, 0x00, TI_MUX1_PSEUDO_COLOR); + s3OutTiIndReg(TI_MUX_CONTROL_2, 0x00, TI_MUX2_BUS_VGA); + + /* change to 8-bit DAC and re-route the data path and clocking */ + s3OutTiIndReg(TI_GENERAL_IO_CONTROL, 0x00, TI_GIC_ALL_BITS); + if (s3DAC8Bit) + s3OutTiIndReg(TI_GENERAL_IO_DATA, 0x00, TI_GID_S3_DAC_8BIT); + else + s3OutTiIndReg(TI_GENERAL_IO_DATA, 0x00, TI_GID_S3_DAC_6BIT); + } /* end of pixel_multiplexing */ + + /* for some reason the bios doesn't set this properly */ + s3OutTiIndReg(TI_SENSE_TEST, 0x00, 0x00); + + outb(0x3C4, 1); + outb(0x3C5, tmp2); /* unblank the screen */ + s3InitCursorFlag = TRUE; /* turn on the cursor during the next load */ } outb(0x3C2, new->MiscOutReg); *************** *** 317,324 **** outb(0x3C0, new->Attribute[i]); } outb(vgaCRIndex, 0x31); ! outb(vgaCRReg, 0x8d); outb(vgaCRIndex, 0x32); outb(vgaCRReg, 0x00); outb(vgaCRIndex, 0x33); --- 739,751 ---- outb(0x3C0, new->Attribute[i]); } + if (s3DisplayWidth == 2048) + s3Port31 = 0x8f; + else + s3Port31 = 0x8d; + outb(vgaCRIndex, 0x31); ! outb(vgaCRReg, s3Port31); outb(vgaCRIndex, 0x32); outb(vgaCRReg, 0x00); outb(vgaCRIndex, 0x33); *************** *** 366,372 **** outb(vgaCRIndex, 0x50); i = inb(vgaCRReg); ! i &= 0x3f; switch (s3DisplayWidth) { case 640: outb(vgaCRReg, i | 0x40); --- 793,799 ---- outb(vgaCRIndex, 0x50); i = inb(vgaCRReg); ! i &= ~0xc1; switch (s3DisplayWidth) { case 640: outb(vgaCRReg, i | 0x40); *************** *** 374,411 **** case 800: outb(vgaCRReg, i | 0x80); break; case 1280: outb(vgaCRReg, i | 0xc0); break; ! default: outb(vgaCRReg, i); } outb(vgaCRIndex, 0x51); ! s3Port51 = inb(vgaCRReg) & 0xC0; outb(vgaCRReg, s3Port51); if (s3Mmio928) { ! outb(vgaCRIndex, 0x53); ! outb(vgaCRReg, 0x10); ! } else { /* just to make sure */ ! outb(vgaCRIndex, 0x53); ! outb(vgaCRReg, 0x00); } outb(vgaCRIndex, 0x54); ! if (s3InfoRec.videoRam == 512) s3Port54 = 0x00; else ! s3Port54 = 0xa0; outb(vgaCRReg, s3Port54); outb(vgaCRIndex, 0x55); ! outb(vgaCRReg, 0x40); /* remove mysterious dot at 60Hz */ outb(vgaCRIndex, 0x58); outb(vgaCRReg, 0x00); i = (((mode->VTotal / interlacedived - 2) & 0x400) >> 10) | (((mode->VDisplay / interlacedived - 1) & 0x400) >> 9) | (((mode->VSyncStart / interlacedived) & 0x400) >> 8) | --- 801,863 ---- case 800: outb(vgaCRReg, i | 0x80); break; + case 1152: + outb(vgaCRReg, i | 0x01); + break; case 1280: outb(vgaCRReg, i | 0xc0); break; ! case 1600: ! outb(vgaCRReg, i | 0x81); ! break; ! default: /* 1024 and 2048 */ outb(vgaCRReg, i); } outb(vgaCRIndex, 0x51); ! s3Port51 = (inb(vgaCRReg) & 0xC0) | ((s3DisplayWidth >> 7) & 0x30); outb(vgaCRReg, s3Port51); + outb(vgaCRIndex, 0x53); + tmp = inb(vgaCRReg); if (s3Mmio928) { ! tmp |= 0x10; ! } else { ! /* make sure mmio is off */ ! tmp &= ~0x10; ! } ! /* ! * Now the DRAM interleaving bit for the 801/805 chips ! * Note, we don't touch this bit for 928 chips because they use it ! * for pixel multiplexing control. ! */ ! if (S3_801_SERIES(s3ChipId)) { ! if (S3_801_I_SERIES(s3ChipId)) ! tmp |= 0x20; ! else ! tmp &= ~0x20; } + outb(vgaCRReg, tmp); outb(vgaCRIndex, 0x54); ! if (s3InfoRec.videoRam == 512 || mode->HDisplay > 1200) /* XXXX */ s3Port54 = 0x00; else ! s3Port54 = 0xa0; outb(vgaCRReg, s3Port54); outb(vgaCRIndex, 0x55); ! tmp = inb(vgaCRReg) & 0x08; /* save the external serial bit */ ! outb(vgaCRReg, tmp | 0x40); /* remove mysterious dot at 60Hz */ outb(vgaCRIndex, 0x58); outb(vgaCRReg, 0x00); + outb(vgaCRIndex, 0x59); + outb(vgaCRReg, s3Port59); + outb(vgaCRIndex, 0x5A); + outb(vgaCRReg, s3Port5A); + i = (((mode->VTotal / interlacedived - 2) & 0x400) >> 10) | (((mode->VDisplay / interlacedived - 1) & 0x400) >> 9) | (((mode->VSyncStart / interlacedived) & 0x400) >> 8) | *************** *** 414,443 **** outb(vgaCRIndex, 0x5e); outb(vgaCRReg, i); ! if (s3DisplayWidth == 1280) { ! outb(vgaCRIndex, 0x60); ! outb(vgaCRReg, 0x7f); ! outb(vgaCRIndex, 0x61); ! outb(vgaCRReg, 0x81); ! outb(vgaCRIndex, 0x62); ! outb(vgaCRReg, 0xa1); ! } else { ! outb(vgaCRIndex, 0x60); ! if (s3InfoRec.videoRam == 512) ! outb(vgaCRReg, 0xff); ! else ! outb(vgaCRReg, 0x3f); ! outb(vgaCRIndex, 0x61); ! outb(vgaCRReg, 0x81); ! outb(vgaCRIndex, 0x62); ! outb(vgaCRReg, 0); } - } ! /* Don't use internal clock-select code when using an external clock prog */ ! if (new->NoClock >= 0) { ! /* XXXX Should we really do something about the return value? */ ! (void) (s3ClockSelectFunc) (mode->Clock); } if ((mode->Flags & V_INTERLACE) != 0) { --- 866,954 ---- outb(vgaCRIndex, 0x5e); outb(vgaCRReg, i); ! if (pixel_multiplexing) { ! /* now divide the horizontal timing parameters by 4 for VCLK/4 */ ! mode->HTotal >>= 2; ! mode->HDisplay >>= 2; ! mode->HSyncStart >>= 2; ! mode->HSyncEnd >>= 2; } ! i = ((mode->HTotal & 0x800) >> 11) | ! ((mode->HDisplay & 0x800) >> 10) | ! ((mode->HSyncStart & 0x800) >> 9) | ! ((mode->HSyncStart & 0x800) >> 7); ! ! if (pixel_multiplexing) { ! /* put back the horizontal timing parameters */ ! mode->HTotal <<= 2; ! mode->HDisplay <<= 2; ! mode->HSyncStart <<= 2; ! mode->HSyncEnd <<= 2; ! } ! ! outb(vgaCRIndex, 0x5d); ! tmp = inb(vgaCRReg); ! outb(vgaCRReg, (tmp & ~0x17) | i); ! ! /* ! * Set up CR60 according the the DRAM speed specified in the Xconfig ! * and the selected dot clock. This is all empirical and/or guesswork ! * at this point. ! */ ! ! /* Not sure about the 512k case, so deal with it separately */ ! if (s3InfoRec.videoRam == 512) { ! tmp = 0xff; ! } else { ! /* ! * Default to 0xff except for clocks > 100Mhz unless one of the ! * "dram_..." options is specified (0xff seems to be fine for ! * most (all?) cards). The "dram_..." options are probably not ! * necessary at all, and may be removed in a future release. ! */ ! if (OFLG_ISSET(OPTION_SLOW_DRAM, &s3InfoRec.options)) { ! if (s3InfoRec.clock[mode->Clock] > 69000) { /* guess */ ! tmp = 0xff; ! } else if (s3InfoRec.clock[mode->Clock] > 49000) { /* guess */ ! tmp = 0x7f; ! } else { ! tmp = 0x3f; ! } ! } else if (OFLG_ISSET(OPTION_MED_DRAM, &s3InfoRec.options)) { ! if (s3InfoRec.clock[mode->Clock] > 69000) { /* guess */ ! tmp = 0x7f; ! } else { ! tmp = 0x3f; ! } ! } else if (OFLG_ISSET(OPTION_FAST_DRAM, &s3InfoRec.options)) { ! /* This is from experimentation with an Actix GE32+ 2MB @ 110MHz */ ! if (s3InfoRec.clock[mode->Clock] > 100000) { ! tmp = 0xff; ! } else if (s3InfoRec.clock[mode->Clock] > 79000) { /* guess */ ! tmp = 0x7f; ! } else { ! tmp = 0x3f; ! } ! } else { ! /* Default to 0xff for all modes/clocks -- it seems to be OK */ ! tmp = 0xff; ! } ! } ! outb(vgaCRIndex, 0x60); ! outb(vgaCRReg, tmp); ! ! outb(vgaCRIndex, 0x61); ! outb(vgaCRReg, 0x81); ! ! /* Not really sure about CR62, but this is what we've always had */ ! if (s3DisplayWidth >= 1152) { ! tmp = 0xa1; ! } else { ! tmp = 0x00; ! } ! outb(vgaCRIndex, 0x62); ! outb(vgaCRReg, tmp); } if ((mode->Flags & V_INTERLACE) != 0) { *************** *** 446,451 **** --- 957,987 ---- outb(vgaCRReg, 0x20 | i); } + #ifdef REG_DEBUG + for (i=0; i<10; i++) { + outb(vgaCRIndex, i); + tmp = inb(vgaCRReg); + ErrorF("CR%X = 0x%02x\n", i, tmp); + } + for (i=0x10; i<0x19; i++) { + outb(vgaCRIndex, i); + tmp = inb(vgaCRReg); + ErrorF("CR%X = 0x%02x\n", i, tmp); + } + outb(vgaCRIndex, 0x3b); + tmp = inb(vgaCRReg); + ErrorF("CR%X = 0x%02x\n", 0x3b, tmp); + outb(vgaCRIndex, 0x5d); + tmp = inb(vgaCRReg); + ErrorF("CR%X = 0x%02x\n", 0x5d, tmp); + outb(vgaCRIndex, 0x5e); + tmp = inb(vgaCRReg); + ErrorF("CR%X = 0x%02x\n", 0x5e, tmp); + for (i=0; i<0x40; i++) { + tmp = s3InTiIndReg(i); + ErrorF("TI%X = 0x%02x\n", i, tmp); + } + #endif vgaProtect(FALSE); if (s3DisplayWidth == 1024) /* this is unclear Jon */ *************** *** 479,485 **** /* * Loads the Look-Up Table with all black. Assumes 8-bit board is in use. If ! * 4 bit board, the only the first 16 entries in LUT will be used. */ static void InitLUT() --- 1015,1021 ---- /* * Loads the Look-Up Table with all black. Assumes 8-bit board is in use. If ! * 4 bit board, then only the first 16 entries in LUT will be used. */ static void InitLUT() *************** *** 662,670 **** --- 1198,1212 ---- case 800: new->s3sysreg[0x10] = 0x80; break; + case 1152: + new->s3sysreg[0x10] = 0x01; + break; case 1280: new->s3sysreg[0x10] = 0xC0; break; + case 1600: + new->s3sysreg[0x10] = 0x81; + break; default: new->s3sysreg[0x10] = 0x00; } *************** *** 675,681 **** s3Port54 = 0xA0; new->sysreg[0x14] = s3Port54; new->s3sysreg[0x21] = 0x81; ! if (s3DisplayWidth == 1280) { new->s3sysreg[0x20] = 0x7F; new->s3sysreg[0x22] = 0xA1; new->s3sysreg[0x15] = 0x40; --- 1217,1223 ---- s3Port54 = 0xA0; new->sysreg[0x14] = s3Port54; new->s3sysreg[0x21] = 0x81; ! if (s3DisplayWidth >= 1152) { new->s3sysreg[0x20] = 0x7F; new->s3sysreg[0x22] = 0xA1; new->s3sysreg[0x15] = 0x40; *************** *** 699,709 **** --- 1241,1254 ---- #endif #ifndef NEW_INIT_SAVE_RESTORE + /* s3Save and s3Restore are not currently used */ + #if 0 void s3Restore(restore) vgaS3Ptr restore; { int i; + unsigned char c; UNLOCK_SYS_REGS; *************** *** 749,767 **** outb(vgaCRReg, restore->s3sysreg[i]); } #if 0 /* * Restore Bt485 Registers */ ! if (OFLG_ISSET(OPTION_BT485, &s3InfoRec.options)) { s3OutBtReg(BT_COMMAND_REG_0, 0xFE, 0x01); s3OutBtRegCom3(0x00, restore->Bt485[3]); ! #ifdef NOTYET ! s3OutBtReg(BT_COMMAND_REG_2, 0x00, restore->Bt485[2]); ! s3OutBtReg(BT_COMMAND_REG_1, 0x00, restore->Bt485[1]); ! #endif s3OutBtReg(BT_COMMAND_REG_0, 0x00, restore->Bt485[0]); } #endif --- 1294,1353 ---- outb(vgaCRReg, restore->s3sysreg[i]); } + /* + * Restore AT&T 20C490/1 command register. + */ + if (OFLG_ISSET(OPTION_ATT490_1, &s3InfoRec.options)) { + xf86setdaccomm(oldS3->ATT490_1); + } + /* + * Restore Sierra SC 15025/6 registers. + */ + LOCK_SYS_REGS; + if (OFLG_ISSET(OPTION_SC15025, &s3InfoRec.options)) { + c=xf86getdaccomm(); + xf86setdaccomm( c | 0x10 ); /* set internal register access */ + (void)xf86dactocomm(); + outb(0x3c7, 0x8); + outb(0x3c8, oldS3->SC15025[1]); + xf86setdaccomm( c ); + xf86setdaccomm(oldS3->SC15025[0]); + } + UNLOCK_SYS_REGS; + #if 0 /* * Restore Bt485 Registers */ ! if (DAC_IS_BT485_SERIES) { s3OutBtReg(BT_COMMAND_REG_0, 0xFE, 0x01); s3OutBtRegCom3(0x00, restore->Bt485[3]); ! if (s3Bt485PixMux) { ! s3OutBtReg(BT_COMMAND_REG_2, 0x00, restore->Bt485[2]); ! s3OutBtReg(BT_COMMAND_REG_1, 0x00, restore->Bt485[1]); ! } s3OutBtReg(BT_COMMAND_REG_0, 0x00, restore->Bt485[0]); } + + /* + * Restore Ti3020 registers + */ + if (DAC_IS_TI3020) { + s3OutTiIndReg(TI_CURS_CONTROL, 0x00, restore->Ti3020[TI_CURS_CONTROL]); + s3OutTiIndReg(TI_MUX_CONTROL_1, 0x00, restore->Ti3020[TI_MUX_CONTROL_1]); + s3OutTiIndReg(TI_MUX_CONTROL_2, 0x00, restore->Ti3020[TI_MUX_CONTROL_2]); + s3OutTiIndReg(TI_INPUT_CLOCK_SELECT, 0x00, + restore->Ti3020[TI_INPUT_CLOCK_SELECT]); + s3OutTiIndReg(TI_OUTPUT_CLOCK_SELECT, 0x00, + restore->Ti3020[TI_OUTPUT_CLOCK_SELECT]); + s3OutTiIndReg(TI_GENERAL_CONTROL, 0x00, + restore->Ti3020[TI_GENERAL_CONTROL]); + s3OutTiIndReg(TI_AUXILLARY_CONTROL, 0x00, + restore->Ti3020[TI_AUXILLARY_CONTROL]); + s3OutTiIndReg(TI_GENERAL_IO_CONTROL, 0x00, 0x1f); + s3OutTiIndReg(TI_GENERAL_IO_DATA, 0x00, + restore->Ti3020[TI_GENERAL_IO_DATA]); + } #endif *************** *** 787,803 **** save = vgaHWSave(save, sizeof(vgaS3Rec)); /* * Save Bt485 Registers */ ! if (OFLG_ISSET(OPTION_BT485, &s3InfoRec.options)) { save->Bt485[0] = s3InBtReg(BT_COMMAND_REG_0); ! #ifdef NOTYET ! save->Bt485[1] = s3InBtReg(BT_COMMAND_REG_1); ! save->Bt485[2] = s3InBtReg(BT_COMMAND_REG_2); ! #endif save->Bt485[3] = s3InBtRegCom3(); } for (i = 0; i < 5; i++) { outb(vgaCRIndex, 0x30 + i); save->s3reg[i] = inb(vgaCRReg); --- 1373,1426 ---- save = vgaHWSave(save, sizeof(vgaS3Rec)); /* + * Save AT&T 20C490/1 command register. + */ + if (OFLG_ISSET(OPTION_ATT490_1, &s3InfoRec.options)) { + oldS3->ATT490_1 = xf86getdaccomm(); + } + /* + * Save Sierra SC15025 command register. + */ + LOCK_SYS_REGS; + if (OFLG_ISSET(OPTION_SC15025, &s3InfoRec.options)) { + oldS3->SC15025[0] = xf86getdaccomm(); + xf86setdaccomm((oldS3->SC15025[0] | 0x10)); + (void)xf86dactocomm(); + outb(0x3c7,0x8); + oldS3->SC15025[1] = inb(0x3c8); + xf86setdaccomm(oldS3->SC15025[0]); + } + UNLOCK_SYS_REGS; + + /* * Save Bt485 Registers */ ! if (DAC_IS_BT485_SERIES) { save->Bt485[0] = s3InBtReg(BT_COMMAND_REG_0); ! if (s3Bt485PixMux) { ! save->Bt485[1] = s3InBtReg(BT_COMMAND_REG_1); ! save->Bt485[2] = s3InBtReg(BT_COMMAND_REG_2); ! } save->Bt485[3] = s3InBtRegCom3(); } + /* + * Save Ti3020 registers + */ + if (DAC_IS_TI3020) { + save->Ti3020[TI_CURS_CONTROL] = s3InTiIndReg(TI_CURS_CONTROL); + save->Ti3020[TI_MUX_CONTROL_1] = s3InTiIndReg(TI_MUX_CONTROL_1); + save->Ti3020[TI_MUX_CONTROL_2] = s3InTiIndReg(TI_MUX_CONTROL_2); + save->Ti3020[TI_INPUT_CLOCK_SELECT] = + s3InTiIndReg(TI_INPUT_CLOCK_SELECT); + save->Ti3020[TI_OUTPUT_CLOCK_SELECT] = + s3InTiIndReg(TI_OUTPUT_CLOCK_SELECT); + save->Ti3020[TI_GENERAL_CONTROL] = s3InTiIndReg(TI_GENERAL_CONTROL); + save->Ti3020[TI_AUXILLARY_CONTROL] = s3InTiIndReg(TI_AUXILLARY_CONTROL); + s3OutTiIndReg(TI_GENERAL_IO_CONTROL, 0x00, 0x1f); + save->Ti3020[TI_GENERAL_IO_DATA] = s3InTiIndReg(TI_GENERAL_IO_DATA); + } + for (i = 0; i < 5; i++) { outb(vgaCRIndex, 0x30 + i); save->s3reg[i] = inb(vgaCRReg); *************** *** 830,835 **** --- 1453,1459 ---- LOCK_SYS_REGS; return save; } + #endif #else *************** *** 853,869 **** save = (vgaS3Ptr) vgaHWSave(save, sizeof(vgaS3Rec)); /* * Save Bt485 Registers */ ! if (OFLG_ISSET(OPTION_BT485, &s3InfoRec.options)) { save->Bt485[0] = s3InBtReg(BT_COMMAND_REG_0); ! #ifdef NOTYET ! save->Bt485[1] = s3InBtReg(BT_COMMAND_REG_1); ! save->Bt485[2] = s3InBtReg(BT_COMMAND_REG_2); ! #endif save->Bt485[3] = s3InBtRegCom3(); } for (i = 0; i < 5; i++) { outb(vgaCRIndex, 0x31 + i); save->s3reg[i] = inb(vgaCRReg); --- 1477,1531 ---- save = (vgaS3Ptr) vgaHWSave(save, sizeof(vgaS3Rec)); /* + * Save AT&T 20C490/1 command register. + */ + if (OFLG_ISSET(OPTION_ATT490_1, &s3InfoRec.options)) { + oldS3->ATT490_1 = xf86getdaccomm(); + } + + /* + * Save Sierra SC15025 command register. + */ + LOCK_SYS_REGS; + if (OFLG_ISSET(OPTION_SC15025, &s3InfoRec.options)) { + oldS3->SC15025[0] = xf86getdaccomm(); + xf86setdaccomm((oldS3->SC15025[0] | 0x10)); + (void)xf86dactocomm(); + outb(0x3c7,0x8); + oldS3->SC15025[1] = inb(0x3c8); + xf86setdaccomm(oldS3->SC15025[0]); + } + UNLOCK_SYS_REGS; + + /* * Save Bt485 Registers */ ! if (DAC_IS_BT485_SERIES) { save->Bt485[0] = s3InBtReg(BT_COMMAND_REG_0); ! if (s3Bt485PixMux) { ! save->Bt485[1] = s3InBtReg(BT_COMMAND_REG_1); ! save->Bt485[2] = s3InBtReg(BT_COMMAND_REG_2); ! } save->Bt485[3] = s3InBtRegCom3(); } + /* + * Save Ti3020 registers + */ + if (DAC_IS_TI3020) { + save->Ti3020[TI_CURS_CONTROL] = s3InTiIndReg(TI_CURS_CONTROL); + save->Ti3020[TI_MUX_CONTROL_1] = s3InTiIndReg(TI_MUX_CONTROL_1); + save->Ti3020[TI_MUX_CONTROL_2] = s3InTiIndReg(TI_MUX_CONTROL_2); + save->Ti3020[TI_INPUT_CLOCK_SELECT] = + s3InTiIndReg(TI_INPUT_CLOCK_SELECT); + save->Ti3020[TI_OUTPUT_CLOCK_SELECT] = + s3InTiIndReg(TI_OUTPUT_CLOCK_SELECT); + save->Ti3020[TI_GENERAL_CONTROL] = s3InTiIndReg(TI_GENERAL_CONTROL); + save->Ti3020[TI_AUXILLARY_CONTROL] = s3InTiIndReg(TI_AUXILLARY_CONTROL); + s3OutTiIndReg(TI_GENERAL_IO_CONTROL, 0x00, 0x1f); + save->Ti3020[TI_GENERAL_IO_DATA] = s3InTiIndReg(TI_GENERAL_IO_DATA); + } + for (i = 0; i < 5; i++) { outb(vgaCRIndex, 0x31 + i); save->s3reg[i] = inb(vgaCRReg); *************** *** 960,975 **** } /* * Restore Bt485 Registers */ ! if (OFLG_ISSET(OPTION_BT485, &s3InfoRec.options)) { s3OutBtReg(BT_COMMAND_REG_0, 0xFE, 0x01); s3OutBtRegCom3(0x00, restore->Bt485[3]); ! #ifdef NOTYET ! s3OutBtReg(BT_COMMAND_REG_2, 0x00, restore->Bt485[2]); ! s3OutBtReg(BT_COMMAND_REG_1, 0x00, restore->Bt485[1]); ! #endif s3OutBtReg(BT_COMMAND_REG_0, 0x00, restore->Bt485[0]); } if (restore->std.NoClock >= 0) --- 1622,1679 ---- } /* + * Restore AT&T 20C490/1 command register. + */ + if (OFLG_ISSET(OPTION_ATT490_1, &s3InfoRec.options)) { + xf86setdaccomm(oldS3->ATT490_1); + } + + /* + * Restore Sierra SC15025 command register. + */ + LOCK_SYS_REGS; + if (OFLG_ISSET(OPTION_SC15025, &s3InfoRec.options)) { + i=xf86getdaccomm(); + xf86setdaccomm( i | 0x10 ); /* set internal register access */ + (void)xf86dactocomm(); + outb(0x3c7, 0x8); + outb(0x3c8, oldS3->SC15025[1]); + xf86setdaccomm( i ); + xf86setdaccomm(oldS3->SC15025[0]); + } + UNLOCK_SYS_REGS; + + /* * Restore Bt485 Registers */ ! if (DAC_IS_BT485_SERIES) { s3OutBtReg(BT_COMMAND_REG_0, 0xFE, 0x01); s3OutBtRegCom3(0x00, restore->Bt485[3]); ! if (s3Bt485PixMux) { ! s3OutBtReg(BT_COMMAND_REG_2, 0x00, restore->Bt485[2]); ! s3OutBtReg(BT_COMMAND_REG_1, 0x00, restore->Bt485[1]); ! } s3OutBtReg(BT_COMMAND_REG_0, 0x00, restore->Bt485[0]); + } + + /* + * Restore Ti3020 registers + */ + if (DAC_IS_TI3020) { + s3OutTiIndReg(TI_CURS_CONTROL, 0x00, restore->Ti3020[TI_CURS_CONTROL]); + s3OutTiIndReg(TI_MUX_CONTROL_1, 0x00, restore->Ti3020[TI_MUX_CONTROL_1]); + s3OutTiIndReg(TI_MUX_CONTROL_2, 0x00, restore->Ti3020[TI_MUX_CONTROL_2]); + s3OutTiIndReg(TI_INPUT_CLOCK_SELECT, 0x00, + restore->Ti3020[TI_INPUT_CLOCK_SELECT]); + s3OutTiIndReg(TI_OUTPUT_CLOCK_SELECT, 0x00, + restore->Ti3020[TI_OUTPUT_CLOCK_SELECT]); + s3OutTiIndReg(TI_GENERAL_CONTROL, 0x00, + restore->Ti3020[TI_GENERAL_CONTROL]); + s3OutTiIndReg(TI_AUXILLARY_CONTROL, 0x00, + restore->Ti3020[TI_AUXILLARY_CONTROL]); + s3OutTiIndReg(TI_GENERAL_IO_CONTROL, 0x00, 0x1f); + s3OutTiIndReg(TI_GENERAL_IO_DATA, 0x00, + restore->Ti3020[TI_GENERAL_IO_DATA]); } if (restore->std.NoClock >= 0) diff -c mit/server/ddx/x386/accel/s3/s3linear.h:2.6 mit/server/ddx/x386/accel/s3/s3linear.h:2.7 *** mit/server/ddx/x386/accel/s3/s3linear.h:2.6 Fri Mar 11 23:38:08 1994 --- mit/server/ddx/x386/accel/s3/s3linear.h Fri Mar 11 23:38:08 1994 *************** *** 10,16 **** * Not currently used apart from s3im.c */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3linear.h,v 2.6 1993/09/21 15:22:48 dawes Exp $ */ extern Bool s3LinearAperture; extern unsigned char s3LinApOpt; --- 10,16 ---- * Not currently used apart from s3im.c */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3linear.h,v 2.7 1994/01/09 03:31:00 dawes Exp $ */ extern Bool s3LinearAperture; extern unsigned char s3LinApOpt; *************** *** 22,32 **** /* Some poor compilers don't have inlines */ #ifdef S3_MMIO # define DISABLE_MMIO \ outb(vgaCRIndex, 0x53); \ ! outb(vgaCRReg, 0x00); # define ENABLE_MMIO \ outb(vgaCRIndex, 0x53); \ ! outb(vgaCRReg, 0x10); #else # define DISABLE_MMIO /**/ # define ENABLE_MMIO /**/ --- 22,36 ---- /* Some poor compilers don't have inlines */ #ifdef S3_MMIO # define DISABLE_MMIO \ + { unsigned char tmp; \ outb(vgaCRIndex, 0x53); \ ! tmp = inb(vgaCRReg); \ ! outb(vgaCRReg, tmp & 0xEF); } # define ENABLE_MMIO \ + { unsigned char tmp; \ outb(vgaCRIndex, 0x53); \ ! tmp = inb(vgaCRReg); \ ! outb(vgaCRReg, tmp | 0x10); } #else # define DISABLE_MMIO /**/ # define ENABLE_MMIO /**/ diff -c mit/server/ddx/x386/accel/s3/s3misc.c:2.19 mit/server/ddx/x386/accel/s3/s3misc.c:2.34 *** mit/server/ddx/x386/accel/s3/s3misc.c:2.19 Fri Mar 11 23:38:09 1994 --- mit/server/ddx/x386/accel/s3/s3misc.c Fri Mar 11 23:38:09 1994 *************** *** 31,37 **** * Id: s3.c,v 2.6 1993/08/09 06:17:57 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3misc.c,v 2.19 1993/10/21 15:54:15 dawes Exp $ */ #include "cfb.h" #include "pixmapstr.h" --- 31,37 ---- * Id: s3.c,v 2.6 1993/08/09 06:17:57 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3misc.c,v 2.34 1994/03/08 08:31:42 dawes Exp $ */ #include "cfb.h" #include "pixmapstr.h" *************** *** 47,52 **** --- 47,56 ---- #include "s3linear.h" extern void s3RepositionCursor(); + extern void s3ImageWriteNoMem(); + extern void s3ShowCursor(); + extern void s3HideCursor(); + extern void SetTimeSinceLastInputEvent(); extern char s3Mbanks; extern void NoopDDA(); *************** *** 56,61 **** --- 60,66 ---- extern miPointerScreenFuncRec x386PointerScreenFuncs; static Bool s3TryAddress(); extern ScreenPtr s3savepScreen; + static PixmapPtr ppix = NULL; extern Bool s3Localbus; extern Bool s3LinearAperture; extern unsigned char s3LinApOpt; *************** *** 63,68 **** --- 68,76 ---- extern int s3DisplayWidth; extern pointer vgaBase; extern pointer s3VideoMem; + extern unsigned char s3Port59; + extern unsigned char s3Port5A; + extern unsigned char s3Port31; extern Bool x386Exiting, x386Resetting, x386ProbeFailed, x386Verbose; *************** *** 69,74 **** --- 77,83 ---- static Bool AlreadyInited = FALSE; static Bool s3ModeSwitched = FALSE; + /* * s3Initialize -- Attempt to find and initialize a VGA framebuffer Most of * the elements of the ScreenRec are filled in. The video is enabled for the *************** *** 82,87 **** --- 91,98 ---- int argc; /* The number of the Server's arguments. */ char **argv; /* The arguments themselves. Don't change! */ { + int displayResolution = 75; /* default to 75dpi */ + extern int monitorResolution; s3Unlock(); /* for restarts */ *************** *** 93,101 **** * function */ - /* XXXX need to check how much should be done only for generation #1 */ - /* XXXX this should be mostly OK now */ - if (serverGeneration == 1) { s3BankSize = 0x10000; s3LinApOpt = 0x14; --- 104,109 ---- *************** *** 119,127 **** --- 127,138 ---- long i; long *poker; unsigned long pVal; + unsigned char reg53tmp = 0; + Bool CachedFrameBuffer = FALSE; pVal = 0x12345678; + s3InitEnvironment(); s3ImageWriteNoMem(0, 0, 4, 1, (unsigned char *) &pVal, 4, 0, 0, (short) s3alu[GXcopy], (short) 0xffff); *************** *** 130,136 **** if (s3Mmio928) { /* Due to S3 bugs we must disable mmio */ outb(vgaCRIndex, 0x53); ! outb(vgaCRReg, 0x00); } /* begin 801 sequence for going in to linear mode */ outb (vgaCRIndex, 0x40); --- 141,148 ---- if (s3Mmio928) { /* Due to S3 bugs we must disable mmio */ outb(vgaCRIndex, 0x53); ! reg53tmp = inb(vgaCRReg); ! outb(vgaCRReg, reg53tmp & ~0x10); /* save parallel bit */ } /* begin 801 sequence for going in to linear mode */ outb (vgaCRIndex, 0x40); *************** *** 138,204 **** j = (s3Port40 & 0xf6) | 0x0a; outb (vgaCRReg, (unsigned char) j); outb(vgaCRIndex, 0x59); ! outb(vgaCRReg, 0x02); outb(vgaCRIndex, 0x5a); outb(vgaCRReg, 0x00); outb (vgaCRIndex, 0x58); ! #if 0 ! /* find what size aperture we can manage */ ! if (OFLG_ISSET(OPTION_NOLINEAR_MODE, &s3InfoRec.options)) { ! s3LinApOpt=0x14; ! } else { ! #endif ! if (s3InfoRec.videoRam <= 1024) { ! s3LinApOpt=0x15; ! } else if (s3InfoRec.videoRam <= 2048) { ! s3LinApOpt=0x16; ! } else { ! s3LinApOpt=0x17; ! } ! s3BankSize = s3InfoRec.videoRam * 1024; ! #if 0 } ! #endif /* go on to linear mode */ outb (vgaCRReg, s3LinApOpt); /* end 801 sequence to go into linear mode */ } ! for (i = 0xfc; i >= 0; i-=4) { unsigned long addr; ! ! addr = (i << 24) + (0x2<<24); s3VideoMem = xf86MapVidMem(scr_index, LINEAR_REGION, ! (pointer)addr, s3BankSize); ! poker = (long *) s3VideoMem; ! if (s3TryAddress(poker, pVal)) { ! /* We found some ram, but is it ours? */ ! /* move it up by 16MB */ ! addr += (0x1<<24); ! outb(vgaCRIndex, 0x59); ! outb(vgaCRReg, 0x03); ! if (!s3TryAddress(poker, pVal)) { ! xf86UnMapVidMem(scr_index, LINEAR_REGION, s3VideoMem, ! s3BankSize); ! s3VideoMem = xf86MapVidMem(scr_index, LINEAR_REGION, ! (pointer)addr, s3BankSize); ! if (s3TryAddress((long *)s3VideoMem, pVal)) { ! ErrorF("%s %s: Local bus LAW31-26 is %X\n", ! XCONFIG_PROBED, s3InfoRec.name, i); ! #if 0 ! if (!OFLG_ISSET(OPTION_NOLINEAR_MODE, ! &s3InfoRec.options)) ! #endif ! s3LinearAperture = TRUE; ! break; ! } ! } } - xf86UnMapVidMem(scr_index, LINEAR_REGION, s3VideoMem, - s3BankSize); } /* The UnMap can unmap all mapped regions, so make sure vgaBase is --- 150,244 ---- j = (s3Port40 & 0xf6) | 0x0a; outb (vgaCRReg, (unsigned char) j); outb(vgaCRIndex, 0x59); ! outb(vgaCRReg, 0x03); outb(vgaCRIndex, 0x5a); outb(vgaCRReg, 0x00); outb (vgaCRIndex, 0x58); ! if (s3InfoRec.videoRam <= 1024) { ! s3LinApOpt=0x15; ! } else if (s3InfoRec.videoRam <= 2048) { ! s3LinApOpt=0x16; ! } else { ! s3LinApOpt=0x17; } ! s3BankSize = s3InfoRec.videoRam * 1024; /* go on to linear mode */ outb (vgaCRReg, s3LinApOpt); /* end 801 sequence to go into linear mode */ } ! /* ! * XXXX This is for debugging only. It attempts to find ! * which values of LAW are decoded (see s3TryAddress() below). ! */ ! if (OFLG_ISSET(OPTION_FB_DEBUG, &s3InfoRec.options)) { ! for (i = 0xfc; i >= 0; i-=4) { ! unsigned long addr = (i << 24) + (0x3<<24); ! ! s3VideoMem = xf86MapVidMem(scr_index, LINEAR_REGION, ! (pointer)addr, 4096); ! poker = (long *) s3VideoMem; ! s3TryAddress(poker, pVal, addr, 0); ! xf86UnMapVidMem(scr_index, LINEAR_REGION, s3VideoMem, 4096); ! } ! } ! ! /* ! * If a MemBase value was given in the Xconfig, skip the LAW ! * probe and use the high 6 bits for the hw part of LAW. ! */ ! if (s3InfoRec.MemBase != 0) { unsigned long addr; ! ! /* Software part of LAW is 60MB = 0x3c00000 */ ! addr = (s3InfoRec.MemBase & 0xfc000000) + 0x3c00000; s3VideoMem = xf86MapVidMem(scr_index, LINEAR_REGION, ! (pointer)addr, s3BankSize); ! outb(vgaCRIndex, 0x5a); ! outb(vgaCRReg, 0xC0); ! s3LinearAperture = TRUE; ! ErrorF("%s %s: Local bus LAW31-26 is %X\n", ! XCONFIG_GIVEN, s3InfoRec.name, (addr >> 24) & 0xfc); ! } else { ! for (i = 0xfc; i >= 0; i-=4) { ! unsigned long addr; ! ! /* Start at LAW(hw) + 48MB */ ! addr = (i << 24) + (0x3<<24); ! s3VideoMem = xf86MapVidMem(scr_index, LINEAR_REGION, ! (pointer)addr, s3BankSize); ! poker = (long *) s3VideoMem; ! if (s3TryAddress(poker, pVal, addr, 1)) { ! /* We found some ram, but is it ours? */ ! /* move it up by 12MB to LAW(hw) + 60MB */ ! outb(vgaCRIndex, 0x5a); ! outb(vgaCRReg, 0xC0); ! if (!s3TryAddress(poker, pVal, addr, 2)) { ! addr += (0x0C<<20); ! xf86UnMapVidMem(scr_index, LINEAR_REGION, s3VideoMem, ! s3BankSize); ! s3VideoMem = xf86MapVidMem(scr_index, LINEAR_REGION, ! (pointer)addr, s3BankSize); ! if (s3TryAddress((long *)s3VideoMem, pVal, addr, 3)) { ! ErrorF("%s %s: Local bus LAW31-26 is %X\n", ! XCONFIG_PROBED, s3InfoRec.name, i); ! s3LinearAperture = TRUE; ! break; ! } ! } else { ! ErrorF("%s %s: linear framebuffer found, but", ! XCONFIG_PROBED, s3InfoRec.name); ! ErrorF(" it appears to be in a cachable\n"); ! ErrorF("\t address range.\n"); ! CachedFrameBuffer = TRUE; ! } ! } ! xf86UnMapVidMem(scr_index, LINEAR_REGION, s3VideoMem, ! s3BankSize); } } /* The UnMap can unmap all mapped regions, so make sure vgaBase is *************** *** 206,221 **** xf86MapDisplay(scr_index, VGA_REGION); if (!s3LinearAperture) { ! ErrorF("%s %s: Couldn't find local bus framebuffer -", ! XCONFIG_PROBED, s3InfoRec.name); ErrorF(" linear access disabled\n"); ! if (OFLG_ISSET(OPTION_MEM_ACCESS, &s3InfoRec.options)) { ! s3BankSize = 0x10000; ! } else { ! OFLG_SET(OPTION_NO_MEM_ACCESS, &s3InfoRec.options); ! OFLG_SET(XCONFIG_NOMEMACCESS, &s3InfoRec.xconfigFlag); ! s3BankSize = 0; ! } s3VideoMem = NULL; } if (S3_801_928_SERIES (s3ChipId)) { --- 246,256 ---- xf86MapDisplay(scr_index, VGA_REGION); if (!s3LinearAperture) { ! ErrorF("%s %s: %s local bus framebuffer -", ! XCONFIG_PROBED, s3InfoRec.name, ! (CachedFrameBuffer? "Can't use": "Couldn't find")); ErrorF(" linear access disabled\n"); ! s3BankSize = 0x10000; s3VideoMem = NULL; } if (S3_801_928_SERIES (s3ChipId)) { *************** *** 228,250 **** } if (s3Mmio928) { /* Now re-enable mmio if required */ outb(vgaCRIndex, 0x53); ! outb(vgaCRReg, 0x10); } } - } else { /* No support for linear video memory */ - if (s3Localbus && !S3_924_ONLY(s3ChipId)) { - if (!OFLG_ISSET(OPTION_NO_MEM_ACCESS, &s3InfoRec.options) && - !OFLG_ISSET(OPTION_MEM_ACCESS, &s3InfoRec.options)) { - OFLG_SET(OPTION_NO_MEM_ACCESS, &s3InfoRec.options); - OFLG_SET(XCONFIG_NOMEMACCESS, &s3InfoRec.xconfigFlag); - } - } } /* No linear mapping */ ! if (!s3VideoMem) s3VideoMem = vgaBase; } else s3Init(s3InfoRec.modes); --- 263,292 ---- } if (s3Mmio928) { /* Now re-enable mmio if required */ outb(vgaCRIndex, 0x53); ! outb(vgaCRReg, reg53tmp | 0x10); } } } /* No linear mapping */ ! if (!s3VideoMem) { s3VideoMem = vgaBase; + /* If using VGA aperture, set it up */ + if (s3BankSize == 0x10000) { + outb(vgaCRIndex, 0x59); + outb(vgaCRReg, 0x00); + outb(vgaCRIndex, 0x5a); + outb(vgaCRReg, 0x0a); + s3LinApOpt = 0x14; + } + } + + /* Save CR59, CR5A for future calls to s3Init() */ + outb(vgaCRIndex, 0x59); + s3Port59 = inb(vgaCRReg); + outb(vgaCRIndex, 0x5A); + s3Port5A = inb(vgaCRReg); } else s3Init(s3InfoRec.modes); *************** *** 254,267 **** s3ImageInit(); ! s3CacheInit(s3InfoRec.virtualX, s3InfoRec.virtualY); ! s3BitCache8Init(s3InfoRec.virtualX, s3InfoRec.virtualY); if (!s3ScreenInit(pScreen, (pointer) s3VideoMem, s3InfoRec.virtualX, s3InfoRec.virtualY, ! 75, 75, s3DisplayWidth)) return (FALSE); --- 296,315 ---- s3ImageInit(); ! s3CacheInit(s3InfoRec.virtualX, s3CursorStartY + s3CursorLines); ! s3BitCache8Init(s3InfoRec.virtualX, s3CursorStartY + s3CursorLines); ! ! /* ! * Take display resolution from the -dpi flag if specified ! */ + if (monitorResolution) + displayResolution = monitorResolution; if (!s3ScreenInit(pScreen, (pointer) s3VideoMem, s3InfoRec.virtualX, s3InfoRec.virtualY, ! displayResolution, displayResolution, s3DisplayWidth)) return (FALSE); *************** *** 296,302 **** int screen_idx; { PixmapPtr pspix; - static PixmapPtr ppix = NULL; ScreenPtr pScreen = s3savepScreen; pspix = (PixmapPtr)pScreen->devPrivate; --- 344,349 ---- *************** *** 315,322 **** AlreadyInited = TRUE; s3RestoreDACvalues(); s3ImageInit(); ! s3CacheInit(s3InfoRec.virtualX, s3InfoRec.virtualY); ! s3BitCache8Init(s3InfoRec.virtualX, s3InfoRec.virtualY); s3RestoreColor0(pScreen); (void)s3CursorInit(0, pScreen); s3RestoreCursor(pScreen); --- 362,369 ---- AlreadyInited = TRUE; s3RestoreDACvalues(); s3ImageInit(); ! s3CacheInit(s3InfoRec.virtualX, s3CursorStartY + s3CursorLines); ! s3BitCache8Init(s3InfoRec.virtualX, s3CursorStartY + s3CursorLines); s3RestoreColor0(pScreen); (void)s3CursorInit(0, pScreen); s3RestoreCursor(pScreen); *************** *** 379,384 **** --- 426,439 ---- x386Exiting = TRUE; if (x386VTSema) s3EnterLeaveVT(LEAVE, screen_idx); + else if (ppix) { + /* + * 7-Jan-94 CEG: The server is not running on the current vt. + * Free the screen snapshot taken when the server vt was left. + */ + (s3savepScreen->DestroyPixmap)(ppix); + ppix = NULL; + } return (TRUE); } *************** *** 446,451 **** --- 501,507 ---- s3AdjustFrame(int x, int y) { int Base; + unsigned char tmp; if (OFLG_ISSET(OPTION_SHOWCACHE, &s3InfoRec.options)) { if ( debugcache & 1) *************** *** 455,461 **** Base = (y * s3DisplayWidth + x) >> 2; outb(vgaCRIndex, 0x31); ! outb(vgaCRReg, ((Base & 0x030000) >> 12) | 0x8d); outw(vgaCRIndex, (Base & 0x00FF00) | 0x0C); outw(vgaCRIndex, ((Base & 0x00FF) << 8) | 0x0D); --- 511,523 ---- Base = (y * s3DisplayWidth + x) >> 2; outb(vgaCRIndex, 0x31); ! outb(vgaCRReg, ((Base & 0x030000) >> 12) | s3Port31); ! s3Port51 &= ~0x03; ! s3Port51 |= ((Base & 0x040000) >> 18); ! outb(vgaCRIndex, 0x51); ! /* Don't override current bank selection */ ! tmp = (inb(vgaCRReg) & ~0x03) | ((Base & 0x040000) >> 18); ! outb(vgaCRReg, tmp); outw(vgaCRIndex, (Base & 0x00FF00) | 0x0C); outw(vgaCRIndex, ((Base & 0x00FF) << 8) | 0x0D); *************** *** 473,485 **** * Force optimising compilers to read *addr */ static Bool ! s3TryAddress(long *addr, long value) { long tmp; tmp = *addr; ! /* ErrorF("got %X\n", tmp);*/ if (tmp == value) return TRUE; else --- 535,558 ---- * Force optimising compilers to read *addr */ static Bool ! s3TryAddress(addr, value, physaddr, stage) ! long *addr; ! long value; ! long physaddr; ! int stage; { long tmp; tmp = *addr; ! if (OFLG_ISSET(OPTION_FB_DEBUG, &s3InfoRec.options)) { ! if (stage == 0 && tmp != 0xFFFFFFFF) { ! ErrorF("Memory found at 0x%08X (read 0x%08X)\n", physaddr, tmp); ! } else { ! ErrorF("Stage %d: address = 0x%08X, read 0x%08X\n", stage, physaddr, ! tmp); ! } ! } if (tmp == value) return TRUE; else diff -c mit/server/ddx/x386/accel/s3/s3name.h:2.7 mit/server/ddx/x386/accel/s3/s3name.h:2.8 *** mit/server/ddx/x386/accel/s3/s3name.h:2.7 Fri Mar 11 23:38:11 1994 --- mit/server/ddx/x386/accel/s3/s3name.h Fri Mar 11 23:38:11 1994 *************** *** 22,33 **** * */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3name.h,v 2.7 1993/10/17 14:43:33 dawes Exp $ */ #ifndef S3_NAME_H #define S3_NAME_H ! #if __STDC__ && !defined(UNIXCPP) #define CATNAME(prefix,subname) prefix##subname #else #define CATNAME(prefix,subname) prefix/**/subname --- 22,33 ---- * */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3name.h,v 2.8 1993/12/10 14:35:30 dawes Exp $ */ #ifndef S3_NAME_H #define S3_NAME_H ! #if (__STDC__ && !defined(UNIXCPP)) || (defined (SOLX86) && defined (__STDC__) && !defined (__GNUC__)) #define CATNAME(prefix,subname) prefix##subname #else #define CATNAME(prefix,subname) prefix/**/subname diff -c mit/server/ddx/x386/accel/s3/s3pcach.c:2.15 mit/server/ddx/x386/accel/s3/s3pcach.c:2.17 *** mit/server/ddx/x386/accel/s3/s3pcach.c:2.15 Fri Mar 11 23:38:11 1994 --- mit/server/ddx/x386/accel/s3/s3pcach.c Fri Mar 11 23:38:12 1994 *************** *** 41,47 **** * Pixmap Cache * * sizes cache may be more or less depending on off screen ram size. ! * If the space is less than 32 pixel high, all is used for the fonts. * * If there is space to the right of the display, it is tiled (depending on * width w as: (| or - is 32 pixels) --- 41,48 ---- * Pixmap Cache * * sizes cache may be more or less depending on off screen ram size. ! * If the space is less than 32 pixel high or if DisplayWidth < 1024, ! * all is used for the fonts. * * If there is space to the right of the display, it is tiled (depending on * width w as: (| or - is 32 pixels) *************** *** 74,80 **** * Id: s3pcach.c,v 2.4 1993/08/09 06:17:57 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3pcach.c,v 2.15 1993/09/09 07:29:11 dawes Exp $ */ #include "misc.h" #include "x386.h" --- 75,81 ---- * Id: s3pcach.c,v 2.4 1993/08/09 06:17:57 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3pcach.c,v 2.17 1994/01/01 16:24:08 dawes Exp $ */ #include "misc.h" #include "x386.h" *************** *** 134,141 **** reEntry = TRUE; ! lines = s3ScissB - h; ! h++; /* one line for the cursor */ slots = lines / 64; if (slots > 16) --- 135,142 ---- reEntry = TRUE; ! /* h now includes the cursor space */ ! lines = s3ScissB + 1 - h; slots = lines / 64; if (slots > 16) *************** *** 171,184 **** s3MAX_SLOTS += 8; if (s3DisplayWidth == 1280) { ! s3MAX_SLOTS *= 2; ! FIRST_32_SLOT *= 2; ! FIRST_64_SLOT *= 2; ! FIRST_128_SLOT *= 2; ! num = 4; } else ! num = 2; /* Now look to the left of the display */ leftWidth = s3DisplayWidth - s3InfoRec.virtualX; slots = s3InfoRec.virtualY / 32; --- 172,205 ---- s3MAX_SLOTS += 8; if (s3DisplayWidth == 1280) { ! s3MAX_SLOTS *= 2; ! FIRST_32_SLOT *= 2; ! FIRST_64_SLOT *= 2; ! FIRST_128_SLOT *= 2; ! num = 4; ! } else if (s3DisplayWidth == 1600) { ! s3MAX_SLOTS *= 3; ! FIRST_32_SLOT *= 3; ! FIRST_64_SLOT *= 3; ! FIRST_128_SLOT *= 3; ! num = 6; ! } else if (s3DisplayWidth == 2048) { ! s3MAX_SLOTS *= 5; ! FIRST_32_SLOT *= 5; ! FIRST_64_SLOT *= 5; ! FIRST_128_SLOT *= 5; ! num = 10; } else ! num = 2; + /* For s3DisplayWidth < 1024, no pixmap cache in below-screen area */ + if (s3DisplayWidth < 1024) { + s3MAX_SLOTS = 0; + FIRST_32_SLOT = 0; + FIRST_64_SLOT = 0; + FIRST_128_SLOT = 0; + } + /* Now look to the left of the display */ leftWidth = s3DisplayWidth - s3InfoRec.virtualX; slots = s3InfoRec.virtualY / 32; *************** *** 659,665 **** short alu; short planemask; { - int i; DoCacheImageFill(slot, x, y, w, h, pox, poy, alu, MIX_SRC, FSS_BITBLT, BSS_BITBLT, planemask); --- 680,685 ---- diff -c mit/server/ddx/x386/accel/s3/s3scrin.c:2.4 mit/server/ddx/x386/accel/s3/s3scrin.c:2.5 *** mit/server/ddx/x386/accel/s3/s3scrin.c:2.4 Fri Mar 11 23:38:12 1994 --- mit/server/ddx/x386/accel/s3/s3scrin.c Fri Mar 11 23:38:13 1994 *************** *** 43,49 **** * Id: s3scrin.c,v 2.2 1993/06/22 20:54:09 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3scrin.c,v 2.4 1993/09/25 05:02:04 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 43,49 ---- * Id: s3scrin.c,v 2.2 1993/06/22 20:54:09 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3scrin.c,v 2.5 1994/02/25 14:58:49 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 130,135 **** --- 130,138 ---- for (i = 0; i < NUMVISUALS; i++) { visuals[i].vid = FakeClientID(0); VIDs[i] = visuals[i].vid; + if (s3DAC8Bit) { + visuals[i].bitsPerRGBValue = 8; + } } cfbGeneration = serverGeneration; } diff -c mit/server/ddx/x386/accel/s3/s3text.c:2.6 mit/server/ddx/x386/accel/s3/s3text.c:2.7 *** mit/server/ddx/x386/accel/s3/s3text.c:2.6 Fri Mar 11 23:38:13 1994 --- mit/server/ddx/x386/accel/s3/s3text.c Fri Mar 11 23:38:13 1994 *************** *** 27,33 **** * Id: s3text.c,v 2.3 1993/08/09 06:17:57 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3text.c,v 2.6 1993/09/25 05:02:05 dawes Exp $ */ #include "X.h" #include "Xmd.h" --- 27,33 ---- * Id: s3text.c,v 2.3 1993/08/09 06:17:57 jon Exp jon */ ! /* $XFree86: mit/server/ddx/x386/accel/s3/s3text.c,v 2.7 1993/12/25 14:00:04 dawes Exp $ */ #include "X.h" #include "Xmd.h" *************** *** 39,48 **** --- 39,51 ---- #include "windowstr.h" #include "fontstruct.h" #include "dixfontstr.h" + #include "mi.h" #include "s3.h" #include "regs3.h" #include "s3bcach.h" + int s3NoCPolyText(); + int s3NoCImageText(); extern CacheFont8Ptr s3CacheFont8(); extern unsigned char s3SwapBits[256]; *************** *** 149,158 **** unsigned char *pglyphBase; /* start of array of glyphs */ { int width, height; - PixmapPtr pPixmap; int nbyLine; /* bytes per line of padded pixmap */ FontPtr pfont; - GCPtr pGCtmp; register int i; register int j; unsigned char *pbits; /* buffer for PutImage */ --- 152,159 ---- *************** *** 436,442 **** } if (!numRects || pBox->y1 >= y + maxDescent) { DEALLOCATE_LOCAL(charinfo); ! return; } yBand = pBox->y1; while (numRects && pBox->y1 == yBand && pBox->x2 <= x + minLeftBearing) { --- 437,443 ---- } if (!numRects || pBox->y1 >= y + maxDescent) { DEALLOCATE_LOCAL(charinfo); ! return 0; } yBand = pBox->y1; while (numRects && pBox->y1 == yBand && pBox->x2 <= x + minLeftBearing) { *************** *** 445,451 **** } if (!numRects) { DEALLOCATE_LOCAL(charinfo); ! return; } BLOCK_CURSOR; --- 446,452 ---- } if (!numRects) { DEALLOCATE_LOCAL(charinfo); ! return 0; } BLOCK_CURSOR; diff -c mit/server/ddx/x386/bdm2/BUGS:2.1 mit/server/ddx/x386/bdm2/BUGS:2.2 *** mit/server/ddx/x386/bdm2/BUGS:2.1 Fri Mar 11 23:38:23 1994 --- mit/server/ddx/x386/bdm2/BUGS Fri Mar 11 23:38:23 1994 *************** *** 2,21 **** Pascal Haible 8/93 haible@izfm.uni-stuttgart.de - All bdm2 drivers: - allowed options: - STATICGRAY: (anyway) - CHIPSET: supported - SCREENNO: supported by upper levels ?? - DISPLAYSIZE: not yet supported, this is given by hardware for the - cards supported 'till now - VIRTUAL: supported if the driver supports it - VIEWPORT: not supported yet - not yet allowed: - VIDEORAM - hgc1280 only: - autodetection is not very reliable, the probe may fail if the card was in a fancy mode before. In this case ' chipset "hgc1280" ' is required. sigmalview only: - currently untested --- 2,10 ---- Pascal Haible 8/93 haible@izfm.uni-stuttgart.de hgc1280 only: - autodetection is not very reliable, the probe may fail if the card was in a fancy mode before. In this case ' chipset "hgc1280" ' is required. + sigmalview only: - currently untested diff -c mit/server/ddx/x386/bdm2/HISTORY:2.2 mit/server/ddx/x386/bdm2/HISTORY:2.3 *** mit/server/ddx/x386/bdm2/HISTORY:2.2 Fri Mar 11 23:38:23 1994 --- mit/server/ddx/x386/bdm2/HISTORY Fri Mar 11 23:38:23 1994 *************** *** 2,7 **** --- 2,20 ---- Pascal Haible 8/93 haible@izfm.uni-stuttgart.de + sa,su 13/14Nov93 + - changed and tested hgc1280 to work as + - primary on primary address + - secondary on primary address and + - secondary on secondary address. + - fixed port constants in visa. + fr 12Nov93 + - finished integrating visa. + Nov93 + - got info about the 'visa' card from Christian Mock. + - Frank Dolle found my stupid bug in the Sigma L-View code. + - got bug report about hgc1280 compiled for primary address: does not + restore text mode correctly. we 29Sep93 - Ran XTEST on the bdm2 server with hgc1280. th 09Sep93 diff -c mit/server/ddx/x386/bdm2/README:2.2 mit/server/ddx/x386/bdm2/README:2.3 *** mit/server/ddx/x386/bdm2/README:2.2 Fri Mar 11 23:38:24 1994 --- mit/server/ddx/x386/bdm2/README Fri Mar 11 23:38:24 1994 *************** *** 22,29 **** Mode: 'graphics mode only' Ports 0x390 - 0x397 Mem 0xC8000 - 0xCFFFF (32kBytes) ! THE LOWLEVEL DRIVER HGC1280 IS FOR THE CARD JUMPERED TO GRAPHICS MODE ! (SECONDARY ADDRESS) ONLY!! These 32kBytes are 2 separate read/write banks. Though lines are 1280/8 = 160 Bytes long, they are aligned to 256 Byte. In other words: there is a 96 Byte gap at the end of each line. --- 22,31 ---- Mode: 'graphics mode only' Ports 0x390 - 0x397 Mem 0xC8000 - 0xCFFFF (32kBytes) ! ! The restriction of the hgc1280 lowlevel driver to secondary address ! has been liftet. ! These 32kBytes are 2 separate read/write banks. Though lines are 1280/8 = 160 Bytes long, they are aligned to 256 Byte. In other words: there is a 96 Byte gap at the end of each line. *************** *** 60,73 **** size 1024x768 800x600x50MHz 1024x768 1280x1024 virt. 1024x1024 800x600 1472x1024 1472x1024 ------------- --------- --------- --------- --------- ! lineStones 73392 27745 24366 7922 ! fillStones 7297 5591 17330 4424 ! blitStones 2969 6496 14019 4698 ! arcStones 1059390 719489 1835344 869540 ! textStones 63250 2062 47437 24062 ! complexStones 10718 9542 26013 9281 ! ------------- ------- ------ ------- ------ ! xStones 9798 4531 24006 7822 4) Can I write another lowlevel driver for bdm2? ------------------------------------------------ --- 62,88 ---- size 1024x768 800x600x50MHz 1024x768 1280x1024 virt. 1024x1024 800x600 1472x1024 1472x1024 ------------- --------- --------- --------- --------- ! lineStones 73392 27745 24366 7922 ! fillStones 7297 5591 17330 4424 ! blitStones 2969 6496 14019 4698 ! arcStones 1059390 719489 1835344 869540 ! textStones 63250 2062 47437 24062 ! complexStones 10718 9542 26013 9281 ! ------------- ------- ------- ------- ------ ! xStones 9798 4531 24006 7822 ! ! card HGC-1280 mono Sigma L-View mono ! size 1280x1024 1664x1200 ! virt. 1472x1024 1664x1200 ! ------------- --------- --------- ! lineStones 7922 10086 ! fillStones 4424 5457 ! blitStones 4698 6017 ! arcStones 869540 1083676 ! textStones 24062 32187 ! complexStones 9281 10339 ! ------------- ------- ------- ! xStones 7822 9825 4) Can I write another lowlevel driver for bdm2? ------------------------------------------------ diff -c /dev/null mit/server/ddx/x386/bdm2/USING:2.0 *** /dev/null Fri Mar 11 23:38:24 1994 --- mit/server/ddx/x386/bdm2/USING Fri Mar 11 23:38:24 1994 *************** *** 0 **** --- 1,24 ---- + bdm2/USING + Pascal Haible 11/93 + haible@izfm.uni-stuttgart.de + + All bdm2 drivers: + allowed options: + STATICGRAY: (anyway) + CHIPSET: supported + SCREENNO: supported by upper levels ?? + DISPLAYSIZE: not yet supported, this is given by hardware for the + cards supported 'till now + VIRTUAL: supported if the driver supports it + VIEWPORT: not supported yet + VIDEORAM: allowed, but doesn't do anything + + hgc1280 only: + option "secondary" If chipset "hgc1280" is given, primary address is + assumed. This overrides this. + sigmalview only: + membase "xxxx" Frame buffer base address (to be set by the driver). + Allowed values: 0xA0000, 0xB0000, ... , 0xE0000. + 0xA0000, 0xB0000 and 0xC0000 conflict with VGA + and are reasonable only on primary displays. + Default is 0xE0000. diff -c mit/server/ddx/x386/bdm2/bdm/bdm.c:2.4 mit/server/ddx/x386/bdm2/bdm/bdm.c:2.7 *** mit/server/ddx/x386/bdm2/bdm/bdm.c:2.4 Fri Mar 11 23:38:26 1994 --- mit/server/ddx/x386/bdm2/bdm/bdm.c Fri Mar 11 23:38:26 1994 *************** *** 14,20 **** * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/bdm/bdm.c,v 2.4 1993/10/02 09:50:22 dawes Exp $ */ #include "X.h" #include "input.h" --- 14,20 ---- * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/bdm/bdm.c,v 2.7 1994/02/10 21:25:11 dawes Exp $ */ #include "X.h" #include "input.h" *************** *** 35,41 **** #include "bdm.h" /* From bdmBank.h */ ! #ifdef __386BSD__ #define BDMBASE 0xFF000000 #else #define BDMBASE 0xF0000000 --- 35,41 ---- #include "bdm.h" /* From bdmBank.h */ ! #ifdef __BSD__ #define BDMBASE 0xFF000000 #else #define BDMBASE 0xF0000000 *************** *** 89,94 **** --- 89,95 ---- 0, /* int maxClock */ 0, /* int videoRam */ 0, /* int BIOSbase */ + 0, /* int MemBase, memory base address of framebuffer */ 350, 285, /* int width, height : Screen picture size in mm */ /* This should be given from the lowlevel driver! */ 0, /* unsigned long speedup */ *************** *** 108,114 **** pointer bdmOrigVideoState = NULL; pointer bdmNewVideoState = NULL; - pointer bdmInitVideoState = NULL; extern void *bdmwriteseg; /* ?? */ --- 109,114 ---- *************** *** 141,148 **** --- 141,151 ---- void (* bdmSetWriteFunc)() = NoopDDA; void (* bdmSetReadWriteFunc)() = NoopDDA; + OFlagSet bdmOptionFlags; + /* Pointer to the Screen while VT is switched out */ static ScreenPtr savepScreen = NULL; + static PixmapPtr ppix = NULL; /* Banking functions etc. are saved and set to NoopDDA * while VT is switched out */ *************** *** 218,224 **** XCONFIG_GIVEN : XCONFIG_PROBED , bdm2InfoRec.name, bdm2InfoRec.chipset); - /* videoram is not yet allowed */ ErrorF("%s %s: videoram: %dk\n", OFLG_ISSET(XCONFIG_VIDEORAM,&bdm2InfoRec.xconfigFlag) ? XCONFIG_GIVEN : XCONFIG_PROBED , --- 221,226 ---- *************** *** 247,258 **** bdmSegmentMask = bdmDrivers[i]->ChipSegmentMask; bdmUse2Banks = bdmDrivers[i]->ChipUse2Banks; bdmScanLineWidth = bdmDrivers[i]->ChipScanLineWidth; ! for (j=0; xf86_OptionTab[j].token >= 0; j++) ! if (OFLG_ISSET(j,&bdm2InfoRec.options)) { ! ErrorF("%s: Option flags are not supported\n", bdm2InfoRec.name); ! break; ! } /* Set up later (?) by x386InitViewport in common/x386Cursor.c */ /* (X0,Y0) = ViewPort */ --- 249,257 ---- bdmSegmentMask = bdmDrivers[i]->ChipSegmentMask; bdmUse2Banks = bdmDrivers[i]->ChipUse2Banks; bdmScanLineWidth = bdmDrivers[i]->ChipScanLineWidth; + bdmOptionFlags = bdmDrivers[i]->ChipOptionFlags; ! xf86VerifyOptions(&bdmOptionFlags, &bdm2InfoRec); /* Set up later (?) by x386InitViewport in common/x386Cursor.c */ /* (X0,Y0) = ViewPort */ *************** *** 323,341 **** int mapSize; if (serverGeneration == 1) { ! #if defined(__386BSD__) && !defined(__bsdi__) /* Hack for mmap() problem on 386bsd */ if (bdmMapSize < 0x18000) mapSize = 0x18000; else ! #endif /* __386BSD__ && !__bsdi__ */ mapSize = bdmMapSize; bdmBase = xf86MapVidMem(index, VGA_REGION /* ?? */, (pointer)bdmMapBase, mapSize); - #if 0 - ErrorF("%s: Using banked dumb framebuffer mono mode\n", - bdm2InfoRec.name); - #endif bdmVirtBase = (pointer)BDMBASE; bdmReadBottom = (void *)((unsigned int)bdmReadBottom + (unsigned int)bdmBase); --- 322,336 ---- int mapSize; if (serverGeneration == 1) { ! #if defined(__BSD__) && !defined(__bsdi__) /* Hack for mmap() problem on 386bsd */ if (bdmMapSize < 0x18000) mapSize = 0x18000; else ! #endif /* __BSD__ && !__bsdi__ */ mapSize = bdmMapSize; bdmBase = xf86MapVidMem(index, VGA_REGION /* ?? */, (pointer)bdmMapBase, mapSize); bdmVirtBase = (pointer)BDMBASE; bdmReadBottom = (void *)((unsigned int)bdmReadBottom + (unsigned int)bdmBase); *************** *** 349,360 **** } /* Warning: bdmInit returns the video state (copy of it) that is to be set */ ! if (!(bdmInitVideoState=(pointer)(bdmInitFunc)(bdm2InfoRec.modes))) FatalError("%s: hardware initialisation failed\n", bdm2InfoRec.name); - bdmNewVideoState = bdmInitVideoState; if (!bdmOrigVideoState) bdmOrigVideoState=(pointer)(bdmSaveFunc)(bdmOrigVideoState); ! (bdmRestoreFunc)(bdmInitVideoState); #ifndef DIRTY_STARTUP bdmSaveScreenFunc(NULL, FALSE); /* blank the screen */ #endif --- 344,354 ---- } /* Warning: bdmInit returns the video state (copy of it) that is to be set */ ! if (!(bdmNewVideoState=(pointer)(bdmInitFunc)(bdm2InfoRec.modes))) FatalError("%s: hardware initialisation failed\n", bdm2InfoRec.name); if (!bdmOrigVideoState) bdmOrigVideoState=(pointer)(bdmSaveFunc)(bdmOrigVideoState); ! (bdmRestoreFunc)(bdmNewVideoState); #ifndef DIRTY_STARTUP bdmSaveScreenFunc(NULL, FALSE); /* blank the screen */ #endif *************** *** 426,438 **** RegionRec pixReg; /* */ DDXPointRec pixPt; /* Point: upper left corner */ PixmapPtr pspix; /* Pointer to the pixmap of the saved screen */ - static PixmapPtr ppix = NULL; ScreenPtr pScreen = savepScreen; /* This is the 'old' Screen: /* real screen on leave, dummy on enter */ /* Set up pointer to the saved pixmap (pspix) only if not resetting and not exiting */ ! if (!x386Resetting && !x386Exiting) { pixBox.x1 = 0; pixBox.x2 = pScreen->width; pixBox.y1 = 0; pixBox.y2 = pScreen->height; pixPt.x = 0; pixPt.y = 0; --- 420,436 ---- RegionRec pixReg; /* */ DDXPointRec pixPt; /* Point: upper left corner */ PixmapPtr pspix; /* Pointer to the pixmap of the saved screen */ ScreenPtr pScreen = savepScreen; /* This is the 'old' Screen: /* real screen on leave, dummy on enter */ /* Set up pointer to the saved pixmap (pspix) only if not resetting and not exiting */ ! /* bdm2 should treat this differently: ! * As this screen might be a secondary screen, it is better to clear ! * it on exit. ! * This makes VT switching on a primary mono card look better (& slower) ! */ ! if (!x386Resetting /* && !x386Exiting */ ) { pixBox.x1 = 0; pixBox.x2 = pScreen->width; pixBox.y1 = 0; pixBox.y2 = pScreen->height; pixPt.x = 0; pixPt.y = 0; *************** *** 487,500 **** * * This pixmap has to be ScanLineWidth pixels wide !! */ - if (!x386Exiting) { ppix = (pScreen->CreatePixmap)(pScreen, /* pScreen->width */ bdmScanLineWidth, pScreen->height, pScreen->rootDepth); if (ppix) { ! bdm_mfbDoBitblt(&pspix->drawable, &ppix->drawable, GXcopy, &pixReg, ! &pixPt, 0xFF); bdm_mfbSolidBlackArea(&pspix->drawable, 1, &pixBox, GXcopy, NULL); pspix->devPrivate.ptr = ppix->devPrivate.ptr; } --- 485,498 ---- * * This pixmap has to be ScanLineWidth pixels wide !! */ { ppix = (pScreen->CreatePixmap)(pScreen, /* pScreen->width */ bdmScanLineWidth, pScreen->height, pScreen->rootDepth); if (ppix) { ! if (!x386Exiting) ! bdm_mfbDoBitblt(&pspix->drawable, &ppix->drawable, GXcopy, &pixReg, ! &pixPt, 0xFF); bdm_mfbSolidBlackArea(&pspix->drawable, 1, &pixBox, GXcopy, NULL); pspix->devPrivate.ptr = ppix->devPrivate.ptr; } *************** *** 507,514 **** */ if (bdmOrigVideoState) (bdmRestoreFunc)(bdmOrigVideoState); - /* Special for bdm2: setting OrigVideoState does not blank the screen */ - (bdmSaveScreenFunc)(NULL,FALSE); (bdmEnterLeaveFunc)(LEAVE); xf86UnMapDisplay(screen_idx, VGA_REGION); --- 505,510 ---- *************** *** 545,551 **** * current vt. Let's catch this case here. */ x386Exiting = TRUE; ! if (x386VTSema) bdmEnterLeaveVT(LEAVE, screen_idx); return(TRUE); } --- 541,556 ---- * current vt. Let's catch this case here. */ x386Exiting = TRUE; ! if (x386VTSema) ! bdmEnterLeaveVT(LEAVE, screen_idx); ! else if (ppix) { ! /* ! * 7-Jan-94 CEG: The server is not running on the current vt. ! * Free the screen snapshot taken when the server vt was left. ! */ ! (savepScreen->DestroyPixmap)(ppix); ! ppix = NULL; ! } return(TRUE); } diff -c mit/server/ddx/x386/bdm2/bdm/bdm.h:2.0 mit/server/ddx/x386/bdm2/bdm/bdm.h:2.1 *** mit/server/ddx/x386/bdm2/bdm/bdm.h:2.0 Fri Mar 11 23:38:27 1994 --- mit/server/ddx/x386/bdm2/bdm/bdm.h Fri Mar 11 23:38:27 1994 *************** *** 14,20 **** * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/bdm/bdm.h,v 2.0 1993/08/30 15:21:57 dawes Exp $ */ /* Included from bdm.c, bdmBank.c */ --- 14,20 ---- * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/bdm/bdm.h,v 2.1 1993/12/01 12:37:09 dawes Exp $ */ /* Included from bdm.c, bdmBank.c */ *************** *** 68,74 **** void *ChipWriteTop; /* Memory to map */ int ChipMapBase; ! int ChipMapSize; /* replaces MEMTOMAP */ int ChipSegmentSize; int ChipSegmentShift; int ChipSegmentMask; --- 68,74 ---- void *ChipWriteTop; /* Memory to map */ int ChipMapBase; ! int ChipMapSize; /* replaces MEMTOMAP */ int ChipSegmentSize; int ChipSegmentShift; int ChipSegmentMask; *************** *** 77,83 **** int ChipHDisplay; int ChipVDisplay; /* In case Scan Line in mfb is longer than HDisplay */ ! int ChipScanLineWidth;/* in pixels */ } bdmVideoChipRec, *bdmVideoChipPtr; /* --- 77,85 ---- int ChipHDisplay; int ChipVDisplay; /* In case Scan Line in mfb is longer than HDisplay */ ! int ChipScanLineWidth; /* in pixels */ ! /* option flags support by this driver */ ! OFlagSet ChipOptionFlags; } bdmVideoChipRec, *bdmVideoChipPtr; /* diff -c mit/server/ddx/x386/bdm2/bdm/bdmBank.h:2.0 mit/server/ddx/x386/bdm2/bdm/bdmBank.h:2.1 *** mit/server/ddx/x386/bdm2/bdm/bdmBank.h:2.0 Fri Mar 11 23:38:27 1994 --- mit/server/ddx/x386/bdm2/bdm/bdmBank.h Fri Mar 11 23:38:28 1994 *************** *** 14,20 **** * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/bdm/bdmBank.h,v 2.0 1993/08/30 15:21:58 dawes Exp $ */ #ifndef BDM_BANK_H #define BDM_BANK_H --- 14,20 ---- * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/bdm/bdmBank.h,v 2.1 1994/02/10 21:25:12 dawes Exp $ */ #ifndef BDM_BANK_H #define BDM_BANK_H *************** *** 46,52 **** extern void (*bdmPopRead)( /* void *p */); ! #ifdef __386BSD__ #define BDMBASE 0xFF000000 #else #define BDMBASE 0xF0000000 --- 46,52 ---- extern void (*bdmPopRead)( /* void *p */); ! #if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) #define BDMBASE 0xFF000000 #else #define BDMBASE 0xF0000000 diff -c mit/server/ddx/x386/bdm2/bdm/bdmBank.s:2.2 mit/server/ddx/x386/bdm2/bdm/bdmBank.s:2.3 *** mit/server/ddx/x386/bdm2/bdm/bdmBank.s:2.2 Fri Mar 11 23:38:28 1994 --- mit/server/ddx/x386/bdm2/bdm/bdmBank.s Fri Mar 11 23:38:28 1994 *************** *** 14,20 **** * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/bdm/bdmBank.s,v 2.2 1993/10/02 16:53:22 dawes Exp $ */ /********** WARNING: **********/ /* If you use bdmBank.s instead of bdmBank.c the lowlevel banking --- 14,20 ---- * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/bdm/bdmBank.s,v 2.3 1994/02/10 21:25:14 dawes Exp $ */ /********** WARNING: **********/ /* If you use bdmBank.s instead of bdmBank.c the lowlevel banking *************** *** 76,86 **** FILE("bdmBank.s") AS_BEGIN ! #ifdef __386BSD__ #define BDMBASE CONST(0xFF000000) ! #else /* __386BSD__ */ #define BDMBASE CONST(0xF0000000) ! #endif /* __386BSD__ */ #ifndef __ASSYNTAX_H__ #define bdmSetReadWrite _bdmSetReadWrite --- 76,86 ---- FILE("bdmBank.s") AS_BEGIN ! #if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) #define BDMBASE CONST(0xFF000000) ! #else #define BDMBASE CONST(0xF0000000) ! #endif #ifndef __ASSYNTAX_H__ #define bdmSetReadWrite _bdmSetReadWrite diff -c mit/server/ddx/x386/bdm2/drivers/hgc1280/HGC1280.info:2.1 mit/server/ddx/x386/bdm2/drivers/hgc1280/HGC1280.info:2.2 *** mit/server/ddx/x386/bdm2/drivers/hgc1280/HGC1280.info:2.1 Fri Mar 11 23:38:32 1994 --- mit/server/ddx/x386/bdm2/drivers/hgc1280/HGC1280.info Fri Mar 11 23:38:32 1994 *************** *** 25,30 **** --- 25,31 ---- address. Mem window 0xC8000 - 0xCFFFF (32kBytes) is 2 separate read/write banks. + (On primary address: first Herc bank 0xB0000-0xB7FFF = 2 banks) Visible lines are 1280 pixels (160 Byte) long. On the right side, further 32 bytes are read/write. By changing one of the regs, the visible area *************** *** 39,45 **** Register level programming: The HGC-1280 (in 'graphics only' mode) is programmed like a Hercules: ! Base: 0x390 base+0 index port base+1 data port base+8 control port --- 40,46 ---- Register level programming: The HGC-1280 (in 'graphics only' mode) is programmed like a Hercules: ! Base: 0x3B0 (primary) , 0x390 (secondary) base+0 index port base+1 data port base+8 control port diff -c mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280HW.h:2.3 mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280HW.h:2.4 *** mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280HW.h:2.3 Fri Mar 11 23:38:33 1994 --- mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280HW.h Fri Mar 11 23:38:33 1994 *************** *** 7,19 **** * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280HW.h,v 2.3 1993/10/02 09:50:42 dawes Exp $ */ - /* ********** WARNING: ********** - * Couldn't include defined constants in hgc1280bank.s, so the - * ports are hardcoded in there!!! - */ - #include "compiler.h" /* void outb(port,val); void outw(port,val); unsigned int inb(port); --- 7,14 ---- * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280HW.h,v 2.4 1993/12/01 12:37:17 dawes Exp $ */ #include "compiler.h" /* void outb(port,val); void outw(port,val); unsigned int inb(port); *************** *** 29,35 **** #define HGC_NUM_REGS (0x40) ! #define HGC_MEM_BASE (0xC8000L) #define HGC_BANK_SIZE (0x4000L) --- 24,31 ---- #define HGC_NUM_REGS (0x40) ! #define HGC_PRIM_MEM_BASE (0xB0000L) ! #define HGC_SEC_MEM_BASE (0xC8000L) #define HGC_BANK_SIZE (0x4000L) *************** *** 36,47 **** #define HGC_MEM_BASE_BANK1 (0L) #define HGC_MEM_BASE_BANK2 (HGC_BANK_SIZE) #define HGC_BANK1_BOTTOM (HGC_MEM_BASE_BANK1) #define HGC_BANK1_TOP (HGC_BANK1_BOTTOM+HGC_BANK_SIZE) ! #define HGC_BANK2_BOTTOM (HGC_MEM_BASE_BANK2) #define HGC_BANK2_TOP (HGC_BANK2_BOTTOM+HGC_BANK_SIZE) ! #define HGC_MAP_BASE (HGC_MEM_BASE) #define HGC_MAP_SIZE (2*HGC_BANK_SIZE) --- 32,45 ---- #define HGC_MEM_BASE_BANK1 (0L) #define HGC_MEM_BASE_BANK2 (HGC_BANK_SIZE) + /* rel. to HGC_XXX_MAP_BASE */ #define HGC_BANK1_BOTTOM (HGC_MEM_BASE_BANK1) #define HGC_BANK1_TOP (HGC_BANK1_BOTTOM+HGC_BANK_SIZE) ! #define HGC_BANK2_BOTTOM (HGC_MEM_BASE_BANK2) #define HGC_BANK2_TOP (HGC_BANK2_BOTTOM+HGC_BANK_SIZE) ! #define HGC_PRIM_MAP_BASE (HGC_PRIM_MEM_BASE) ! #define HGC_SEC_MAP_BASE (HGC_SEC_MEM_BASE) #define HGC_MAP_SIZE (2*HGC_BANK_SIZE) *************** *** 61,86 **** * the mode registers. Setting the banking regs seems to work without * this delay. */ ! #define IO_RECOVER { volatile unsigned char io_recover_dummy; \ ! io_recover_dummy=inb(HGC_PORT_INDEX); \ ! io_recover_dummy=inb(HGC_PORT_INDEX); } ! ! #define HGC_SET_REG(reg,val) { outb(HGC_PORT_INDEX,reg); \ ! IO_RECOVER; \ ! outb(HGC_PORT_DATA,val); } \ ! IO_RECOVER; ! ! #define HGC_GET_REG(reg,pval) { outb(HGC_PORT_INDEX,reg); \ ! IO_RECOVER; \ ! *(pval)=inb(HGC_PORT_DATA); } \ ! IO_RECOVER; #if 0 #define HGC_SHIFT_DISPLAY(offs) { HGC_SET_REG(45, 16 - ((offs)>>4) ) } #endif #define HGC_SET_BANK1(b) HGC_SET_REG(HGC_REG_BANK1,b) #define HGC_SET_BANK2(b) HGC_SET_REG(HGC_REG_BANK2,b) #define HGC_PROBE_REG_RW (56) #define HGC_PROBE_VAL_WRITE (0xFF) --- 59,100 ---- * the mode registers. Setting the banking regs seems to work without * this delay. */ ! #define IO_RECOVER_PRIM { volatile unsigned char io_recover_dummy; \ ! io_recover_dummy=inb(HGC_PRIM_PORT_INDEX); \ ! io_recover_dummy=inb(HGC_PRIM_PORT_INDEX); } ! ! #define IO_RECOVER_SEC { volatile unsigned char io_recover_dummy; \ ! io_recover_dummy=inb(HGC_SEC_PORT_INDEX); \ ! io_recover_dummy=inb(HGC_SEC_PORT_INDEX); } ! ! #define HGC_PRIM_SET_REG(reg,val) { outb(HGC_PRIM_PORT_INDEX,reg); \ ! IO_RECOVER_PRIM; \ ! outb(HGC_PRIM_PORT_DATA,val); } \ ! IO_RECOVER_PRIM; ! ! #define HGC_PRIM_GET_REG(reg,pval) { outb(HGC_PRIM_PORT_INDEX,reg); \ ! IO_RECOVER_PRIM; \ ! *(pval)=inb(HGC_PRIM_PORT_DATA); } \ ! IO_RECOVER_PRIM; ! ! #define HGC_SEC_SET_REG(reg,val) { outb(HGC_SEC_PORT_INDEX,reg); \ ! IO_RECOVER_SEC; \ ! outb(HGC_SEC_PORT_DATA,val); } \ ! IO_RECOVER_SEC; ! ! #define HGC_SEC_GET_REG(reg,pval) { outb(HGC_SEC_PORT_INDEX,reg); \ ! IO_RECOVER_SEC; \ ! *(pval)=inb(HGC_SEC_PORT_DATA); } \ ! IO_RECOVER_SEC; #if 0 #define HGC_SHIFT_DISPLAY(offs) { HGC_SET_REG(45, 16 - ((offs)>>4) ) } #endif + #if 0 #define HGC_SET_BANK1(b) HGC_SET_REG(HGC_REG_BANK1,b) #define HGC_SET_BANK2(b) HGC_SET_REG(HGC_REG_BANK2,b) + #endif #define HGC_PROBE_REG_RW (56) #define HGC_PROBE_VAL_WRITE (0xFF) *************** *** 90,95 **** --- 104,110 ---- #define HGC_PROBE_VAL_FIX1 (16) #define HGC_PROBE_VAL_FIX2 (85) + #define HGC_Graphmode (1407) unsigned char hgcRegsGraf1280x1024[HGC_NUM_REGS] = { /*** 0 1 2 3 4 5 6 7 8 9 ***/ /*0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, *************** *** 98,101 **** --- 113,127 ---- /*3*/ 0, 0, 214, 212, 0, 212, 1, 212, 10, 213, /*4*/ 107, 153, 138, 90, 33, 16, 191, 2, 9, 192, /*5*/ 224, 68, 65, 1, 65, 79, 0, 85, 3, 0, + /*6*/ 0, 85, 3, 0 }; + + #define HGC_Textmode (1408) + unsigned char hgcRegsText[HGC_NUM_REGS] = { + /*** 0 1 2 3 4 5 6 7 8 9 ***/ + /*0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /*1*/ 12, 14, 0, 0, 7, 128, 0, 0, 0, 0, + /*2*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + /*3*/ 0, 0, 135, 132, 135, 132, 5, 132, 200, 134, + /*4*/ 107, 153, 10, 90, 36, 74, 195, 98, 13, 34, + /*5*/ 28, 64, 30, 2, 27, 143, 0, 85, 3, 0, /*6*/ 0, 85, 3, 0 }; diff -c mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280Port.h:2.1 mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280Port.h:2.2 *** mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280Port.h:2.1 Fri Mar 11 23:38:33 1994 --- mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280Port.h Fri Mar 11 23:38:34 1994 *************** *** 7,16 **** * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280Port.h,v 2.1 1993/10/02 09:50:44 dawes Exp $ */ #if 0 ! #define HGC_PORT_BASE 0x390 #define HGC_PORT_INDEX HGC_PORT_BASE #define HGC_PORT_DATA HGC_PORT_BASE+0x01 #define HGC_PORT_CONTROL HGC_PORT_BASE+0x08 --- 7,19 ---- * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280Port.h,v 2.2 1993/12/01 12:37:18 dawes Exp $ */ + /* Primary I/O Base 0x3B0 + * Secondary I/O Base 0x390 + */ #if 0 ! #define HGC_PORT_BASE 0x3B0 #define HGC_PORT_INDEX HGC_PORT_BASE #define HGC_PORT_DATA HGC_PORT_BASE+0x01 #define HGC_PORT_CONTROL HGC_PORT_BASE+0x08 *************** *** 19,46 **** #endif #if defined(C_STYLE_HEX_CONSTANTS) ! #define HGC_PORT_BASE 0x390 ! #define HGC_PORT_INDEX 0x390 ! #define HGC_PORT_DATA 0x391 ! #define HGC_PORT_CONTROL 0x398 ! #define HGC_PORT_CRT_STATUS 0x39A ! #define HGC_PORT_CONFIG 0x39F ! ! #define HGC_REG_BANK1 0x22 ! #define HGC_REG_BANK2 0x24 ! #define HGC_REG_SHIFT_DISPLAY 0x2D ! #define HGC_REG_LEFT_BORDER 0x2A ! #define HGC_REG_RIGHT_BORDER 0x2B ! ! #else ! ! #define HGC_PORT_BASE CONST(0x390) ! #define HGC_PORT_INDEX CONST(0x390) ! #define HGC_PORT_DATA CONST(0x391) ! #define HGC_PORT_CONTROL CONST(0x398) ! #define HGC_PORT_CRT_STATUS CONST(0x39A) ! #define HGC_PORT_CONFIG CONST(0x39F) #define HGC_REG_BANK1 CONST(0x22) #define HGC_REG_BANK2 CONST(0x24) --- 22,45 ---- #endif #if defined(C_STYLE_HEX_CONSTANTS) + #undef CONST + #define CONST(a) (a) + #endif + ! #define HGC_PRIM_PORT_BASE CONST(0x3B0) ! #define HGC_PRIM_PORT_INDEX CONST(0x3B0) ! #define HGC_PRIM_PORT_DATA CONST(0x3B1) ! #define HGC_PRIM_PORT_CONTROL CONST(0x3B8) ! #define HGC_PRIM_PORT_CRT_STATUS CONST(0x3BA) ! #define HGC_PRIM_PORT_CONFIG CONST(0x3BF) ! ! #define HGC_SEC_PORT_BASE CONST(0x390) ! #define HGC_SEC_PORT_INDEX CONST(0x390) ! #define HGC_SEC_PORT_DATA CONST(0x391) ! #define HGC_SEC_PORT_CONTROL CONST(0x398) ! #define HGC_SEC_PORT_CRT_STATUS CONST(0x39A) ! #define HGC_SEC_PORT_CONFIG CONST(0x39F) #define HGC_REG_BANK1 CONST(0x22) #define HGC_REG_BANK2 CONST(0x24) *************** *** 48,51 **** #define HGC_REG_LEFT_BORDER CONST(0x2A) #define HGC_REG_RIGHT_BORDER CONST(0x2B) - #endif --- 47,49 ---- diff -c mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280bank.s:2.1 mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280bank.s:2.2 *** mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280bank.s:2.1 Fri Mar 11 23:38:34 1994 --- mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280bank.s Fri Mar 11 23:38:34 1994 *************** *** 14,20 **** * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280bank.s,v 2.1 1993/10/02 09:50:45 dawes Exp $ */ /* * These are here the very lowlevel VGA bankswitching routines. --- 14,20 ---- * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280bank.s,v 2.2 1993/12/01 12:37:19 dawes Exp $ */ /* * These are here the very lowlevel VGA bankswitching routines. *************** *** 39,70 **** SEG_TEXT ALIGNTEXT4 ! GLOBL GLNAME(HGC1280SetRead) ! GLNAME(HGC1280SetRead): /* set index reg */ PUSH_L (EAX) ! MOV_L (HGC_PORT_INDEX,EDX) MOV_B (HGC_REG_BANK1,AL) OUT_B /* output data */ ! MOV_L (HGC_PORT_DATA,EDX) POP_L (EAX) OUT_B RET ALIGNTEXT4 ! GLOBL GLNAME(HGC1280SetWrite) ! GLOBL GLNAME(HGC1280SetReadWrite) ! GLNAME(HGC1280SetWrite): ! GLNAME(HGC1280SetReadWrite): /* set index reg */ PUSH_L (EAX) ! MOV_L (HGC_PORT_INDEX,EDX) MOV_B (HGC_REG_BANK2,AL) OUT_B /* output data */ ! MOV_L (HGC_PORT_DATA,EDX) POP_L (EAX) OUT_B RET --- 39,104 ---- SEG_TEXT + /* Functions for the card jumpered primary */ + + ALIGNTEXT4 + GLOBL GLNAME(HGC1280pSetRead) + GLNAME(HGC1280pSetRead): + /* set index reg */ + PUSH_L (EAX) + MOV_L (HGC_PRIM_PORT_INDEX,EDX) + MOV_B (HGC_REG_BANK1,AL) + OUT_B + /* output data */ + MOV_L (HGC_PRIM_PORT_DATA,EDX) + POP_L (EAX) + OUT_B + RET + + ALIGNTEXT4 + GLOBL GLNAME(HGC1280pSetWrite) + GLOBL GLNAME(HGC1280pSetReadWrite) + GLNAME(HGC1280pSetWrite): + GLNAME(HGC1280pSetReadWrite): + /* set index reg */ + PUSH_L (EAX) + MOV_L (HGC_PRIM_PORT_INDEX,EDX) + MOV_B (HGC_REG_BANK2,AL) + OUT_B + /* output data */ + MOV_L (HGC_PRIM_PORT_DATA,EDX) + POP_L (EAX) + OUT_B + RET + + /* Functions for the card jumpered secondary */ + ALIGNTEXT4 ! GLOBL GLNAME(HGC1280sSetRead) ! GLNAME(HGC1280sSetRead): /* set index reg */ PUSH_L (EAX) ! MOV_L (HGC_SEC_PORT_INDEX,EDX) MOV_B (HGC_REG_BANK1,AL) OUT_B /* output data */ ! MOV_L (HGC_SEC_PORT_DATA,EDX) POP_L (EAX) OUT_B RET ALIGNTEXT4 ! GLOBL GLNAME(HGC1280sSetWrite) ! GLOBL GLNAME(HGC1280sSetReadWrite) ! GLNAME(HGC1280sSetWrite): ! GLNAME(HGC1280sSetReadWrite): /* set index reg */ PUSH_L (EAX) ! MOV_L (HGC_SEC_PORT_INDEX,EDX) MOV_B (HGC_REG_BANK2,AL) OUT_B /* output data */ ! MOV_L (HGC_SEC_PORT_DATA,EDX) POP_L (EAX) OUT_B RET diff -c mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280driv.c:2.2 mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280driv.c:2.3 *** mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280driv.c:2.2 Fri Mar 11 23:38:35 1994 --- mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280driv.c Fri Mar 11 23:38:35 1994 *************** *** 14,20 **** * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280driv.c,v 2.2 1993/10/02 09:50:46 dawes Exp $ */ #include "X.h" #include "input.h" --- 14,20 ---- * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/hgc1280/hgc1280driv.c,v 2.3 1993/12/01 12:37:21 dawes Exp $ */ #include "X.h" #include "input.h" *************** *** 29,43 **** #include "bdm.h" #include "hgc1280HW.h" ! typedef struct { ! unsigned char reg[HGC_NUM_REGS]; ! } hgc1280Rec, *hgc1280Ptr; /* * Define the HGC I/O Ports */ ! unsigned HGC1280_IOPorts[] = { HGC_PORT_INDEX, HGC_PORT_DATA, ! HGC_PORT_CONTROL, HGC_PORT_CRT_STATUS, HGC_PORT_CONFIG }; int Num_HGC1280_IOPorts = (sizeof(HGC1280_IOPorts)/sizeof(HGC1280_IOPorts[0])); char * HGC1280Ident(); --- 29,48 ---- #include "bdm.h" #include "hgc1280HW.h" ! int HGC_Current_mode = HGC_Textmode; ! ! Bool HGC_Primary = TRUE; + /* #define HGC1280_DEBUG */ + /* * Define the HGC I/O Ports + * We take the ports for both primary and secondary */ ! unsigned HGC1280_IOPorts[] = { HGC_PRIM_PORT_INDEX, HGC_PRIM_PORT_DATA, ! HGC_PRIM_PORT_CONTROL, HGC_PRIM_PORT_CRT_STATUS, HGC_PRIM_PORT_CONFIG, ! HGC_SEC_PORT_INDEX, HGC_SEC_PORT_DATA, ! HGC_SEC_PORT_CONTROL, HGC_SEC_PORT_CRT_STATUS, HGC_SEC_PORT_CONFIG }; int Num_HGC1280_IOPorts = (sizeof(HGC1280_IOPorts)/sizeof(HGC1280_IOPorts[0])); char * HGC1280Ident(); *************** *** 52,60 **** /* Assembler functions in hgc1280bank.s * - to be called by assembler functions only! */ ! extern void HGC1280SetRead(); ! extern void HGC1280SetWrite(); ! extern void HGC1280SetReadWrite(); #if 0 /* From bdm.h -- see there, this here might not be up to date */ --- 57,68 ---- /* Assembler functions in hgc1280bank.s * - to be called by assembler functions only! */ ! extern void HGC1280pSetRead(); ! extern void HGC1280pSetWrite(); ! extern void HGC1280pSetReadWrite(); ! extern void HGC1280sSetRead(); ! extern void HGC1280sSetWrite(); ! extern void HGC1280sSetReadWrite(); #if 0 /* From bdm.h -- see there, this here might not be up to date */ *************** *** 100,105 **** --- 108,114 ---- int ChipVDisplay; /* In case Scan Line in mfb is longer than HDisplay */ int ChipScanLineWidth; + OFlagSet ChipOptionFlags; } bdmVideoChipRec, *bdmVideoChipPtr; #endif /* 0 */ *************** *** 114,127 **** HGC1280Adjust, HGC1280SaveScreen, NoopDDA, /* HGC1280GetMode */ ! HGC1280SetRead, ! HGC1280SetWrite, ! HGC1280SetReadWrite, (void *)HGC_BANK1_BOTTOM, /* ReadBottom */ (void *)HGC_BANK1_TOP, /* ReadTop */ (void *)HGC_BANK2_BOTTOM, /* WriteBottom */ (void *)HGC_BANK2_TOP, /* WriteTop */ ! HGC_MAP_BASE, /* MapBase */ HGC_MAP_SIZE, /* MapSize */ HGC_SEGMENT_SIZE, /* SegmentSize */ HGC_SEGMENT_SHIFT, /* SegmentShift */ --- 123,136 ---- HGC1280Adjust, HGC1280SaveScreen, NoopDDA, /* HGC1280GetMode */ ! HGC1280pSetRead, ! HGC1280pSetWrite, ! HGC1280pSetReadWrite, (void *)HGC_BANK1_BOTTOM, /* ReadBottom */ (void *)HGC_BANK1_TOP, /* ReadTop */ (void *)HGC_BANK2_BOTTOM, /* WriteBottom */ (void *)HGC_BANK2_TOP, /* WriteTop */ ! HGC_PRIM_MAP_BASE, /* MapBase */ HGC_MAP_SIZE, /* MapSize */ HGC_SEGMENT_SIZE, /* SegmentSize */ HGC_SEGMENT_SHIFT, /* SegmentShift */ *************** *** 130,135 **** --- 139,145 ---- HGC_HDISPLAY, /* HDisplay */ HGC_VDISPLAY, /* VDisplay */ HGC_SCAN_LINE_WIDTH, /* ScanLineWidth */ + {0,}, }; /* *************** *** 166,171 **** --- 176,193 ---- /* desired chipset != this one */ return (FALSE); else { + /* chipset "hgc1280" */ + if (OFLG_ISSET(OPTION_SECONDARY, &bdm2InfoRec.options)) { + /* option "secondary" */ + HGC_Primary=FALSE; + ErrorF("%s %s: %s: Using secondary address\n", + XCONFIG_GIVEN, bdm2InfoRec.name, bdm2InfoRec.chipset); + } else { + /* assume primary */ + HGC_Primary=TRUE; + ErrorF("%s %s: %s: Assuming primary address\n", + XCONFIG_PROBED, bdm2InfoRec.name, bdm2InfoRec.chipset); + } HGC1280EnterLeave(ENTER); /* go on with videoram etc. below */ } *************** *** 190,198 **** /* Check for Hercules-like HSYNC on BASE+0xA, Bit 1 */ #define HSYNC_MASK 0x01 #define MIN_COUNT 2000 ! dsp_old = inb(HGC_PORT_CRT_STATUS) & HSYNC_MASK; for (i = 0; i < 5000; i++) { ! dsp = inb(HGC_PORT_CRT_STATUS) & HSYNC_MASK; if (dsp != dsp_old) cnt++; dsp_old = dsp; } --- 212,224 ---- /* Check for Hercules-like HSYNC on BASE+0xA, Bit 1 */ #define HSYNC_MASK 0x01 #define MIN_COUNT 2000 ! /* First check the primary address */ ! #ifdef HGC1280_DEBUG ! ErrorF("Checking primary address: "); ! #endif ! dsp_old = inb(HGC_PRIM_PORT_CRT_STATUS) & HSYNC_MASK; for (i = 0; i < 5000; i++) { ! dsp = inb(HGC_PRIM_PORT_CRT_STATUS) & HSYNC_MASK; if (dsp != dsp_old) cnt++; dsp_old = dsp; } *************** *** 199,228 **** /* This cnt is about 3500 to 4500 with a 'virgin' hardware, * and might be exactly 5000 if the card had been switched * to 'my' graphics mode before */ if (cnt>MIN_COUNT) { bdm2InfoRec.chipset = HGC1280Ident(0); ErrorF("%s %s: %s: cnt=%d, ", XCONFIG_PROBED, bdm2InfoRec.name, bdm2InfoRec.chipset, cnt); /* Test a r/w register */ ! HGC_SET_REG(HGC_PROBE_REG_RW,HGC_PROBE_VAL_WRITE); ! HGC_GET_REG(HGC_PROBE_REG_RW,&val); ErrorF("r/w-val=%d, ",val); found = (val==HGC_PROBE_VAL_READ); /* this register can't be set, depends on other registers */ ! HGC_GET_REG(HGC_PROBE_REG_FIX,&val); ErrorF("fix-val1=%d, ",val); found = found && (val==HGC_PROBE_VAL_FIX1); ! HGC_SET_REG(HGC_PROBE_REG_RW,HGC_PROBE_VAL_RESET); ! HGC_GET_REG(HGC_PROBE_REG_FIX,&val); ! ErrorF("fix-val2=%d ",val); found = found && (val==HGC_PROBE_VAL_FIX2); ! if (found) ! ErrorF("==> found\n"); else { ErrorF("==> not found\n"); bdm2InfoRec.chipset = "\0"; } ! } if ( !(cnt>MIN_COUNT) || !found ) { /* there is no HGC-1280 card */ HGC1280EnterLeave(LEAVE); --- 225,323 ---- /* This cnt is about 3500 to 4500 with a 'virgin' hardware, * and might be exactly 5000 if the card had been switched * to 'my' graphics mode before */ + #ifdef HGC1280_DEBUG + ErrorF("count=%d\n",cnt); + #endif if (cnt>MIN_COUNT) { bdm2InfoRec.chipset = HGC1280Ident(0); + #ifdef HGC1280_DEBUG ErrorF("%s %s: %s: cnt=%d, ", XCONFIG_PROBED, bdm2InfoRec.name, bdm2InfoRec.chipset, cnt); + #endif /* Test a r/w register */ ! HGC_PRIM_SET_REG(HGC_PROBE_REG_RW,HGC_PROBE_VAL_WRITE); ! HGC_PRIM_GET_REG(HGC_PROBE_REG_RW,&val); ! #ifdef HGC1280_DEBUG ErrorF("r/w-val=%d, ",val); + #endif found = (val==HGC_PROBE_VAL_READ); /* this register can't be set, depends on other registers */ ! HGC_PRIM_GET_REG(HGC_PROBE_REG_FIX,&val); ! #ifdef HGC1280_DEBUG ErrorF("fix-val1=%d, ",val); + #endif found = found && (val==HGC_PROBE_VAL_FIX1); ! HGC_PRIM_SET_REG(HGC_PROBE_REG_RW,HGC_PROBE_VAL_RESET); ! HGC_PRIM_GET_REG(HGC_PROBE_REG_FIX,&val); ! #ifdef HGC1280_DEBUG ! ErrorF("fix-val2=%d\n",val); ! #endif found = found && (val==HGC_PROBE_VAL_FIX2); ! if (found) { ! HGC_Primary=TRUE; ! ErrorF("%s %s: %s found on primary address\n", ! XCONFIG_PROBED, bdm2InfoRec.name, ! bdm2InfoRec.chipset); ! } else { + #ifdef HGC1280_DEBUG + ErrorF("==> not found\n"); + #endif + bdm2InfoRec.chipset = "\0"; + } + }; + if ( !(cnt>MIN_COUNT) || !found ) { + #ifdef HGC1280_DEBUG + ErrorF("Checking secondary address: "); + #endif + /* Check the secondary address */ + dsp_old = inb(HGC_SEC_PORT_CRT_STATUS) & HSYNC_MASK; + for (i = 0; i < 5000; i++) { + dsp = inb(HGC_SEC_PORT_CRT_STATUS) & HSYNC_MASK; + if (dsp != dsp_old) cnt++; + dsp_old = dsp; + } + #ifdef HGC1280_DEBUG + ErrorF("count=%d\n",cnt); + #endif + if (cnt>MIN_COUNT) { + bdm2InfoRec.chipset = HGC1280Ident(0); + #ifdef HGC1280_DEBUG + ErrorF("%s %s: %s: cnt=%d, ", XCONFIG_PROBED, + bdm2InfoRec.name, bdm2InfoRec.chipset, cnt); + #endif + /* Test a r/w register */ + HGC_SEC_SET_REG(HGC_PROBE_REG_RW,HGC_PROBE_VAL_WRITE); + HGC_SEC_GET_REG(HGC_PROBE_REG_RW,&val); + #ifdef HGC1280_DEBUG + ErrorF("r/w-val=%d, ",val); + #endif + found = (val==HGC_PROBE_VAL_READ); + /* this register can't be set, depends on other registers */ + HGC_SEC_GET_REG(HGC_PROBE_REG_FIX,&val); + #ifdef HGC1280_DEBUG + ErrorF("fix-val1=%d, ",val); + #endif + found = found && (val==HGC_PROBE_VAL_FIX1); + HGC_SEC_SET_REG(HGC_PROBE_REG_RW,HGC_PROBE_VAL_RESET); + HGC_SEC_GET_REG(HGC_PROBE_REG_FIX,&val); + #ifdef HGC1280_DEBUG + ErrorF("fix-val2=%d\n",val); + #endif + found = found && (val==HGC_PROBE_VAL_FIX2); + if (found) { + HGC_Primary=FALSE; + ErrorF("%s %s: %s found on secondary address\n", + XCONFIG_PROBED, bdm2InfoRec.name, + bdm2InfoRec.chipset); + } else { + #ifdef HGC1280_DEBUG ErrorF("==> not found\n"); + #endif bdm2InfoRec.chipset = "\0"; } ! } ! } /* if ( !(cnt>MIN_COUNT) || !found ) */ if ( !(cnt>MIN_COUNT) || !found ) { /* there is no HGC-1280 card */ HGC1280EnterLeave(LEAVE); *************** *** 229,238 **** --- 324,343 ---- return(FALSE); } } /* else (bdm2InfoRec.chipset) -- bdm2InfoRec.chipset is already set */ + + /* The following is done for both probed and preset chipset */ + if (!bdm2InfoRec.videoRam) { /* videoram not given in Xconfig */ bdm2InfoRec.videoRam=192; } + if (!HGC_Primary) { + /* Fill in consts and functions for secondary I/O / Mem Base */ + HGC1280.ChipMapBase=HGC_SEC_MAP_BASE; + HGC1280.ChipSetRead=HGC1280sSetRead; + HGC1280.ChipSetWrite=HGC1280sSetWrite; + HGC1280.ChipSetReadWrite=HGC1280sSetReadWrite; + } /* We do 'virtual' handling here as it is highly chipset specific */ /* Screen size (pixels) is fixed, virtual size can be larger up to * ChipMaxVirtualX and ChipMaxVirtualY */ *************** *** 281,286 **** --- 386,395 ---- bdm2InfoRec.virtualX); } } + + /* Initialize option flags allowed for this driver */ + OFLG_SET(OPTION_SECONDARY, &HGC1280.ChipOptionFlags); + /* Must return real display size */ /* hardcoded in HGC1280 */ return(TRUE); *************** *** 310,324 **** HGC1280Init(mode) DisplayModePtr mode; { ! /* this is a r/w copy of the initial graph mode */ ! static hgc1280Ptr hgcInitVideoMode = NULL; ! ! if (!hgcInitVideoMode) ! hgcInitVideoMode = (hgc1280Ptr)Xalloc(sizeof(hgc1280Rec)); ! /* memcpy(dest,source,size) */ ! memcpy((void *)hgcInitVideoMode, (void *)hgcRegsGraf1280x1024, ! sizeof(hgc1280Rec)); ! return((void *)hgcInitVideoMode); } /* --- 419,425 ---- HGC1280Init(mode) DisplayModePtr mode; { ! return((void *)HGC_Graphmode); } /* *************** *** 328,345 **** void * HGC1280Save(save) ! hgc1280Ptr save; { ! unsigned char i, val; ! ! if (save==NULL) ! save=(hgc1280Ptr)Xalloc(sizeof(hgc1280Rec)); ! for (i = 0; i < HGC_NUM_REGS; i++) { ! HGC_GET_REG(i,&val); ! save->reg[i] = val; } - return((void *)save); - } /* * HGC1280Restore -- --- 429,438 ---- void * HGC1280Save(save) ! int save; { ! return((void *)HGC_Current_mode); } /* * HGC1280Restore -- *************** *** 348,362 **** void HGC1280Restore(restore) ! hgc1280Ptr restore; { unsigned char i; ! if (restore!=NULL) /* better be shure */ { ! for (i = 0; i < HGC_NUM_REGS; i++) { ! HGC_SET_REG(i,restore->reg[i]); ! } } - else ErrorF("Warning: HGC1280Restore called with arg==NULL\n"); } /* --- 441,475 ---- void HGC1280Restore(restore) ! int restore; { unsigned char i; ! if (HGC_Primary) { ! if (restore==HGC_Textmode) { ! for (i = 0; i < HGC_NUM_REGS; i++) { ! HGC_PRIM_SET_REG(i,hgcRegsText[i]); ! } ! HGC_Current_mode = HGC_Textmode; ! } else if (restore==HGC_Graphmode) { ! for (i = 0; i < HGC_NUM_REGS; i++) { ! HGC_PRIM_SET_REG(i,hgcRegsGraf1280x1024[i]); ! } ! HGC_Current_mode = HGC_Graphmode; ! } else ErrorF("Warning: HGC1280Restore called with invalid arg.\n"); ! } else { ! /* secondary */ ! if (restore==HGC_Textmode) { ! for (i = 0; i < HGC_NUM_REGS; i++) { ! HGC_SEC_SET_REG(i,hgcRegsText[i]); ! } ! HGC_Current_mode = HGC_Textmode; ! } else if (restore==HGC_Graphmode) { ! for (i = 0; i < HGC_NUM_REGS; i++) { ! HGC_SEC_SET_REG(i,hgcRegsGraf1280x1024[i]); ! } ! HGC_Current_mode = HGC_Graphmode; ! } else ErrorF("Warning: HGC1280Restore called with invalid arg.\n"); } } /* *************** *** 376,386 **** * "begin [end] of display within scanline" to middle of the screen */ if (on) { /* Grrr! SaveScreen(on=TRUE) means turn ScreenSaver off */ ! HGC_SET_REG(HGC_REG_LEFT_BORDER,138); ! HGC_SET_REG(HGC_REG_RIGHT_BORDER,90); } else { ! HGC_SET_REG(HGC_REG_LEFT_BORDER,170); ! HGC_SET_REG(HGC_REG_RIGHT_BORDER,50); } } /* if we are not on the active VT, don't do anything - the screen * will be visible as soon as we switch back anyway (?) */ --- 489,509 ---- * "begin [end] of display within scanline" to middle of the screen */ if (on) { /* Grrr! SaveScreen(on=TRUE) means turn ScreenSaver off */ ! if (HGC_Primary) { ! HGC_PRIM_SET_REG(HGC_REG_LEFT_BORDER,138); ! HGC_PRIM_SET_REG(HGC_REG_RIGHT_BORDER,90); ! } else { ! HGC_SEC_SET_REG(HGC_REG_LEFT_BORDER,138); ! HGC_SEC_SET_REG(HGC_REG_RIGHT_BORDER,90); ! } } else { ! if (HGC_Primary) { ! HGC_PRIM_SET_REG(HGC_REG_LEFT_BORDER,170); ! HGC_PRIM_SET_REG(HGC_REG_RIGHT_BORDER,50); ! } else { ! HGC_SEC_SET_REG(HGC_REG_LEFT_BORDER,170); ! HGC_SEC_SET_REG(HGC_REG_RIGHT_BORDER,50); ! } } } /* if we are not on the active VT, don't do anything - the screen * will be visible as soon as we switch back anyway (?) */ *************** *** 412,416 **** /* left side */ val=16-(x>>4); oldx=x; ! HGC_SET_REG(HGC_REG_SHIFT_DISPLAY,val); } --- 535,543 ---- /* left side */ val=16-(x>>4); oldx=x; ! if (HGC_Primary) { ! HGC_PRIM_SET_REG(HGC_REG_SHIFT_DISPLAY,val); ! } else { ! HGC_SEC_SET_REG(HGC_REG_SHIFT_DISPLAY,val); ! } } diff -c mit/server/ddx/x386/bdm2/drivers/sigma/sigmaHW.h:2.1 mit/server/ddx/x386/bdm2/drivers/sigma/sigmaHW.h:2.2 *** mit/server/ddx/x386/bdm2/drivers/sigma/sigmaHW.h:2.1 Fri Mar 11 23:38:37 1994 --- mit/server/ddx/x386/bdm2/drivers/sigma/sigmaHW.h Fri Mar 11 23:38:37 1994 *************** *** 10,29 **** /* Many thanks to Rich Murphey (rich@rice.edu) who sent me the docs */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/sigma/sigmaHW.h,v 2.1 1993/09/10 08:11:45 dawes Exp $ */ #define C_STYLE_HEX_CONSTANTS #include "sigmaPorts.h" /* Memory Base Address */ ! /* Valid choices for bdm2 are 0xC0000L, 0xD0000L and 0xE0000L */ ! /* This is the only place to change it! */ ! #define SIGMA_MEM_BASE (0xD0000L) ! ! #define SIGMA_MEM_BASE_BIT16 ((SIGMA_MEM_BASE & 0x10000L) ? 1 : 0) ! #define SIGMA_MEM_BASE_BIT17 ((SIGMA_MEM_BASE & 0x20000L) ? 1 : 0) ! #define SIGMA_MEM_BASE_BIT18 ((SIGMA_MEM_BASE & 0x40000L) ? 1 : 0) /* Sigma LaserView [PLUS] has its video mem 'high address aligned', * the first line is line 848. Unfortunately, this is not on a bank boundary. * Following trick to cope with this: --- 10,36 ---- /* Many thanks to Rich Murphey (rich@rice.edu) who sent me the docs */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/sigma/sigmaHW.h,v 2.2 1993/12/01 12:37:26 dawes Exp $ */ #define C_STYLE_HEX_CONSTANTS #include "sigmaPorts.h" /* Memory Base Address */ ! /* According to the docs, this can be anywhere (on a 64k boundary) ! * in the second half MB, but show me the PC running *N*X where ! * 0x8000, 0x9000 or 0xF0000 is available! ! * On Systems without VGA, 0xA0000, 0xB0000 and 0xC0000 is available */ ! /* So: valid choices for bdm2 are 0x{ABCDE}0000L */ ! /* 0xE0000 is the default, other values are selected in Xconfig ! * with ' membase "xxxx" ' */ ! #define SIGMA_DEF_MEM_BASE (0xE0000L) + #if 0 + #define SIGMA_DEF_MEM_BASE_BIT16 ((SIGMA_DEF_MEM_BASE & 0x10000L) ? 1 : 0) + #define SIGMA_DEF_MEM_BASE_BIT17 ((SIGMA_DEF_MEM_BASE & 0x20000L) ? 1 : 0) + #define SIGMA_DEF_MEM_BASE_BIT18 ((SIGMA_DEF_MEM_BASE & 0x40000L) ? 1 : 0) + #endif + /* Sigma LaserView [PLUS] has its video mem 'high address aligned', * the first line is line 848. Unfortunately, this is not on a bank boundary. * Following trick to cope with this: *************** *** 35,41 **** #define SIGMA_BANK_SIZE (0x4000L) /* 16k */ ! #define SIGMA_MAP_BASE (SIGMA_MEM_BASE) #define SIGMA_MAP_SIZE (4*SIGMA_BANK_SIZE) --- 42,48 ---- #define SIGMA_BANK_SIZE (0x4000L) /* 16k */ ! #define SIGMA_DEF_MAP_BASE (SIGMA_DEF_MEM_BASE) #define SIGMA_MAP_SIZE (4*SIGMA_BANK_SIZE) *************** *** 47,55 **** */ #define SIGMA_Y_GAP (0x1000L) /* 4k */ #define SIGMA_MEM_BASE_BANK1 (SIGMA_Y_GAP + SIGMA_X_GAP) #define SIGMA_MEM_BASE_BANK2 (2*SIGMA_BANK_SIZE+SIGMA_Y_GAP+SIGMA_X_GAP) - #define SIGMA_BANK1_BOTTOM (SIGMA_MEM_BASE_BANK1) #define SIGMA_BANK1_TOP (SIGMA_BANK1_BOTTOM+SIGMA_BANK_SIZE) #define SIGMA_BANK2_BOTTOM (SIGMA_MEM_BASE_BANK2) --- 54,62 ---- */ #define SIGMA_Y_GAP (0x1000L) /* 4k */ + /* rel. to SIGMA_MAP_BASE */ #define SIGMA_MEM_BASE_BANK1 (SIGMA_Y_GAP + SIGMA_X_GAP) #define SIGMA_MEM_BASE_BANK2 (2*SIGMA_BANK_SIZE+SIGMA_Y_GAP+SIGMA_X_GAP) #define SIGMA_BANK1_BOTTOM (SIGMA_MEM_BASE_BANK1) #define SIGMA_BANK1_TOP (SIGMA_BANK1_BOTTOM+SIGMA_BANK_SIZE) #define SIGMA_BANK2_BOTTOM (SIGMA_MEM_BASE_BANK2) *************** *** 64,78 **** #define SIGMA_SCAN_LINE_WIDTH (2048) ! #if 0 ! ! #define Y_Coord_to_Segment(Y) ((((Y) + 848) >> 6) | 0x80) ! ! #define Y_to_line_offset(Y) (((Y) + 848) % 64) ! #define XY_to_window_offset(X,Y) \ ! ((Y_to_line_offset(Y) << 8) \ ! + (((X) + 384) >> 3)) ! #define XYWindow_to_addr(X,Y,Window) \ ! (XY_to_window_offset(X,Y) + ((Window) << 14)) ! ! #endif --- 71,75 ---- #define SIGMA_SCAN_LINE_WIDTH (2048) ! #define sigma_Textmode (1409) ! #define sigma_Graphmode (1410) diff -c mit/server/ddx/x386/bdm2/drivers/sigma/sigmaPorts.h:2.1 mit/server/ddx/x386/bdm2/drivers/sigma/sigmaPorts.h:2.2 *** mit/server/ddx/x386/bdm2/drivers/sigma/sigmaPorts.h:2.1 Fri Mar 11 23:38:37 1994 --- mit/server/ddx/x386/bdm2/drivers/sigma/sigmaPorts.h Fri Mar 11 23:38:37 1994 *************** *** 10,16 **** /* Many thanks to Rich Murphey (rich@rice.edu) who sent me the docs */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/sigma/sigmaPorts.h,v 2.1 1993/09/10 08:11:46 dawes Exp $ */ /* * Name r/w I/O Bit Reset Description --- 10,16 ---- /* Many thanks to Rich Murphey (rich@rice.edu) who sent me the docs */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/sigma/sigmaPorts.h,v 2.2 1993/12/01 12:37:27 dawes Exp $ */ /* * Name r/w I/O Bit Reset Description *************** *** 39,76 **** * Black Background */ ! #if defined(ACK_ASSEMBLER) || defined(C_STYLE_HEX_CONSTANTS) ! #define SLV_EN1 0x0249 ! #define SLV_W16 0x4249 ! #define SLV_W17 0x8249 ! #define SLV_W18 0xC249 ! #define SLV_BLANK 0x0649 ! #define SLV_ZOOM 0x4649 ! #define SLV_GR0 0x8649 ! #define SLV_GR1 0xC649 ! #define SLV_BANK0 0x0248 ! #define SLV_BANK1 0x4248 ! #define SLV_BANK2 0x8248 ! #define SLV_BANK3 0xC248 ! #define SLV_HIRES 0x0A48 ! #define SLV_MONOEN 0x0A48 ! #define SLV_BOLD 0x8A48 ! #define SLV_WOB 0x8A48 ! #else ! #define SLV_EN1 $0x0249 ! #define SLV_W16 $0x4249 ! #define SLV_W17 $0x8249 ! #define SLV_W18 $0xC249 ! #define SLV_BLANK $0x0649 ! #define SLV_ZOOM $0x4649 ! #define SLV_GR0 $0x8649 ! #define SLV_GR1 $0xC649 ! #define SLV_BANK0 $0x0248 ! #define SLV_BANK1 $0x4248 ! #define SLV_BANK2 $0x8248 ! #define SLV_BANK3 $0xC248 ! #define SLV_HIRES $0x0A48 ! #define SLV_MONOEN $0x0A48 ! #define SLV_BOLD $0x8A48 ! #define SLV_WOB $0x8A48 #endif --- 39,62 ---- * Black Background */ ! #if defined(C_STYLE_HEX_CONSTANTS) ! #undef CONST ! #define CONST(a) (a) #endif + + #define SLV_EN1 CONST(0x0249) + #define SLV_W16 CONST(0x4249) + #define SLV_W17 CONST(0x8249) + #define SLV_W18 CONST(0xC249) + #define SLV_BLANK CONST(0x0649) + #define SLV_ZOOM CONST(0x4649) + #define SLV_GR0 CONST(0x8649) + #define SLV_GR1 CONST(0xC649) + #define SLV_BANK0 CONST(0x0248) + #define SLV_BANK1 CONST(0x4248) + #define SLV_BANK2 CONST(0x8248) + #define SLV_BANK3 CONST(0xC248) + #define SLV_HIRES CONST(0x0A48) + #define SLV_MONOEN CONST(0x0A48) + #define SLV_BOLD CONST(0x8A48) + #define SLV_WOB CONST(0x8A48) diff -c mit/server/ddx/x386/bdm2/drivers/sigma/sigmabank.s:2.1 mit/server/ddx/x386/bdm2/drivers/sigma/sigmabank.s:2.2 *** mit/server/ddx/x386/bdm2/drivers/sigma/sigmabank.s:2.1 Fri Mar 11 23:38:38 1994 --- mit/server/ddx/x386/bdm2/drivers/sigma/sigmabank.s Fri Mar 11 23:38:38 1994 *************** *** 14,20 **** * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/sigma/sigmabank.s,v 2.1 1993/09/10 08:11:47 dawes Exp $ */ /* * These are here the very lowlevel bankswitching routines. --- 14,20 ---- * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/sigma/sigmabank.s,v 2.2 1993/12/01 12:37:28 dawes Exp $ */ /* * These are here the very lowlevel bankswitching routines. *************** *** 57,63 **** /* Add 13 */ ADD_L (CONST(13),EAX) /* Set bit 7 */ ! AND_L (CONST(0x80),EAX) /* Out byte */ MOV_L (SLV_BANK0,EDX) OUT_B --- 57,63 ---- /* Add 13 */ ADD_L (CONST(13),EAX) /* Set bit 7 */ ! OR_L (CONST(0x80),EAX) /* Out byte */ MOV_L (SLV_BANK0,EDX) OUT_B *************** *** 75,81 **** /* Add 13 */ ADD_L (CONST(13),EAX) /* Set bit 7 */ ! AND_L (CONST(0x80),EAX) /* Out byte */ MOV_L (SLV_BANK2,EDX) OUT_B --- 75,81 ---- /* Add 13 */ ADD_L (CONST(13),EAX) /* Set bit 7 */ ! OR_L (CONST(0x80),EAX) /* Out byte */ MOV_L (SLV_BANK2,EDX) OUT_B diff -c mit/server/ddx/x386/bdm2/drivers/sigma/sigmadriv.c:2.2 mit/server/ddx/x386/bdm2/drivers/sigma/sigmadriv.c:2.3 *** mit/server/ddx/x386/bdm2/drivers/sigma/sigmadriv.c:2.2 Fri Mar 11 23:38:38 1994 --- mit/server/ddx/x386/bdm2/drivers/sigma/sigmadriv.c Fri Mar 11 23:38:38 1994 *************** *** 14,20 **** * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/sigma/sigmadriv.c,v 2.2 1993/10/02 09:50:52 dawes Exp $ */ #include "X.h" #include "input.h" --- 14,20 ---- * see bdm2/COPYRIGHT for copyright and disclaimers. */ ! /* $XFree86: mit/server/ddx/x386/bdm2/drivers/sigma/sigmadriv.c,v 2.3 1993/12/01 12:37:29 dawes Exp $ */ #include "X.h" #include "input.h" *************** *** 25,54 **** #include "x386.h" #include "x386Priv.h" #include "xf86_OSlib.h" #include "bdm.h" #include "sigmaHW.h" ! typedef struct { ! unsigned char en1, w16, w17, w18, blank, zoom, gr0, gr1, ! bank0, bank1, bank2, bank3, hires; ! } sigmaRec, *sigmaPtr; ! ! sigmaRec sigmaRegsGraf1664x1152 = { ! /* en1 */ 0x80, ! /* w16 */ ((SIGMA_MEM_BASE_BIT16) ? 0 : 0x80), ! /* w17 */ ((SIGMA_MEM_BASE_BIT17) ? 0 : 0x80), ! /* w18 */ ((SIGMA_MEM_BASE_BIT18) ? 0 : 0x80), ! /* blank */ 0x80, ! /* zoom */ 0x80, ! /* gr0 */ 0x80, ! /* gr1 */ 0x80, ! /* Don't think the bank regs are really needed, but it certainly doesn't hurt */ ! /* bank0 */ 0, ! /* bank1 */ 0, ! /* bank2 */ 0, ! /* bank3 */ 0, ! /* hires */ 0x80 ! }; /* * Define the SIGMA I/O Ports --- 25,36 ---- #include "x386.h" #include "x386Priv.h" #include "xf86_OSlib.h" + #include "xf86_Config.h" #include "bdm.h" #include "sigmaHW.h" ! int sigma_Current_mode = sigma_Textmode; ! int sigmaMemBase = SIGMA_DEF_MEM_BASE; /* * Define the SIGMA I/O Ports *************** *** 59,64 **** --- 41,49 ---- SLV_HIRES /* = MONOEN */, SLV_BOLD /* = WOB */ }; int Num_SIGMA_IOPorts = (sizeof(SIGMA_IOPorts)/sizeof(SIGMA_IOPorts[0])); + volatile int delay_dummy=0; + #define SIGMA_DELAY { delay_dummy++; } + char * SIGMAIdent(); Bool SIGMAProbe(); void SIGMAEnterLeave(); *************** *** 119,124 **** --- 104,110 ---- int ChipVDisplay; /* In case Scan Line in mfb is longer than HDisplay */ int ChipScanLineWidth; + OFlagSet ChipOptionFlags; } bdmVideoChipRec, *bdmVideoChipPtr; #endif /* 0 */ *************** *** 140,146 **** (void *)SIGMA_BANK1_TOP, /* ReadTop */ (void *)SIGMA_BANK2_BOTTOM, /* WriteBottom */ (void *)SIGMA_BANK2_TOP, /* WriteTop */ ! SIGMA_MAP_BASE, /* MapBase */ SIGMA_MAP_SIZE, /* MapSize */ SIGMA_SEGMENT_SIZE, /* SegmentSize */ SIGMA_SEGMENT_SHIFT, /* SegmentShift */ --- 126,132 ---- (void *)SIGMA_BANK1_TOP, /* ReadTop */ (void *)SIGMA_BANK2_BOTTOM, /* WriteBottom */ (void *)SIGMA_BANK2_TOP, /* WriteTop */ ! SIGMA_DEF_MAP_BASE, /* MapBase */ SIGMA_MAP_SIZE, /* MapSize */ SIGMA_SEGMENT_SIZE, /* SegmentSize */ SIGMA_SEGMENT_SHIFT, /* SegmentShift */ *************** *** 149,154 **** --- 135,141 ---- SIGMA_HDISPLAY, /* HDisplay */ SIGMA_VDISPLAY, /* VDisplay */ SIGMA_SCAN_LINE_WIDTH, /* ScanLineWidth */ + {0,}, }; /* *************** *** 207,226 **** /* Test if ZOOM bit (bit 7 on extended port 0x4649) is r/w */ /* save it first */ zoom_save = inb(SLV_ZOOM); outb(SLV_ZOOM,0); ! found=(inb(SLV_ZOOM)==0); outb(SLV_ZOOM,0x80); found=found && ((inb(SLV_ZOOM)&0x80)==0x80); /* write back */ if (found) ! outb(SLV_ZOOM, zoom_save); /* There seems to be no easy way to tell if it is an PLUS or not * (apart perhaps from writing to both planes) */ if (found) { bdm2InfoRec.chipset = SIGMAIdent(0); ! ErrorF("%s: %s detected\n", bdm2InfoRec.name, ! bdm2InfoRec.chipset); } else { /* there is no Sigma L-View card */ SIGMAEnterLeave(LEAVE); --- 194,221 ---- /* Test if ZOOM bit (bit 7 on extended port 0x4649) is r/w */ /* save it first */ zoom_save = inb(SLV_ZOOM); + SIGMA_DELAY; outb(SLV_ZOOM,0); ! SIGMA_DELAY; ! found=((inb(SLV_ZOOM)&0x80)==0); ! SIGMA_DELAY; outb(SLV_ZOOM,0x80); + SIGMA_DELAY; found=found && ((inb(SLV_ZOOM)&0x80)==0x80); + SIGMA_DELAY; /* write back */ if (found) ! outb(SLV_ZOOM, (zoom_save & 0x80)); ! /* write only 0x00 or 0x80 */ /* There seems to be no easy way to tell if it is an PLUS or not * (apart perhaps from writing to both planes) */ if (found) { bdm2InfoRec.chipset = SIGMAIdent(0); ! ErrorF("%s %s: %s detected\n", ! XCONFIG_PROBED, ! bdm2InfoRec.name, ! bdm2InfoRec.chipset); } else { /* there is no Sigma L-View card */ SIGMAEnterLeave(LEAVE); *************** *** 227,236 **** --- 222,271 ---- return(FALSE); } } /* else (bdm2InfoRec.chipset) -- bdm2InfoRec.chipset is already set */ + + /* The following is done for both probed and preset chipset */ + if (!bdm2InfoRec.videoRam) { /* videoram not given in Xconfig */ bdm2InfoRec.videoRam=256; } + if (bdm2InfoRec.MemBase!=0) { + if ( (bdm2InfoRec.MemBase!=0xA0000L) && + (bdm2InfoRec.MemBase!=0xB0000L) && + (bdm2InfoRec.MemBase!=0xC0000L) && + (bdm2InfoRec.MemBase!=0xD0000L) && + (bdm2InfoRec.MemBase!=0xE0000L) ) { + /* Invalid MemBase */ + ErrorF("%s %s: %s: Invalid MemBase 0x%x (must be 0x{ABCDE}0000),\n\t\tusing default\n", + XCONFIG_GIVEN, + bdm2InfoRec.name, + bdm2InfoRec.chipset, + sigmaMemBase); + sigmaMemBase=SIGMA_DEF_MEM_BASE; + ErrorF("%s %s: %s using mem base 0x%x\n", + XCONFIG_PROBED, + bdm2InfoRec.name, + bdm2InfoRec.chipset, + sigmaMemBase); + } else { + /* Valid MemBase */ + sigmaMemBase=bdm2InfoRec.MemBase; + SIGMA.ChipMapBase=sigmaMemBase; + ErrorF("%s %s: %s using mem base 0x%x\n", + XCONFIG_GIVEN, + bdm2InfoRec.name, + bdm2InfoRec.chipset, + sigmaMemBase); + } + } else { + /* Default MemBase */ + sigmaMemBase=SIGMA_DEF_MEM_BASE; + ErrorF("%s %s: %s using mem base 0x%x\n", + XCONFIG_PROBED, + bdm2InfoRec.name, + bdm2InfoRec.chipset, + sigmaMemBase); + } /* We do 'virtual' handling here as it is highly chipset specific */ /* Screen size (pixels) is fixed, virtual size can be larger up to * ChipMaxVirtualX and ChipMaxVirtualY */ *************** *** 242,249 **** */ if (!(bdm2InfoRec.virtualX < 0)) { /* virtual set in Xconfig */ ! ErrorF("%s: %s: Virtual not allowed for Sigma LaserView\n", ! bdm2InfoRec.name, bdm2InfoRec.chipset); } /* Set virtual to real size */ bdm2InfoRec.virtualX = SIGMA_HDISPLAY; --- 277,284 ---- */ if (!(bdm2InfoRec.virtualX < 0)) { /* virtual set in Xconfig */ ! ErrorF("%s %s: %s: Virtual not allowed for this chipset\n", ! XCONFIG_PROBED, bdm2InfoRec.name, bdm2InfoRec.chipset); } /* Set virtual to real size */ bdm2InfoRec.virtualX = SIGMA_HDISPLAY; *************** *** 277,291 **** SIGMAInit(mode) DisplayModePtr mode; { ! /* this is a r/w copy of the initial graph mode */ ! static sigmaPtr sigmaInitVideoMode = NULL; ! ! if (!sigmaInitVideoMode) ! sigmaInitVideoMode = (sigmaPtr)Xalloc(sizeof(sigmaRec)); ! /* memcpy(dest,source,size) */ ! memcpy((void *)sigmaInitVideoMode, (void *)&sigmaRegsGraf1664x1152, ! sizeof(sigmaRec)); ! return((void *)sigmaInitVideoMode); } /* --- 312,318 ---- SIGMAInit(mode) DisplayModePtr mode; { ! return((void *)sigma_Graphmode); } /* *************** *** 295,321 **** void * SIGMASave(save) ! sigmaPtr save; { ! unsigned char i, val; ! ! if (save==NULL) ! save=(sigmaPtr)Xalloc(sizeof(sigmaRec)); ! save->en1=inb(SLV_EN1); ! save->w16=inb(SLV_W16); ! save->w17=inb(SLV_W17); ! save->w18=inb(SLV_W18); ! save->blank=inb(SLV_BLANK); ! save->zoom=inb(SLV_ZOOM); ! save->gr0=inb(SLV_GR0); ! save->gr1=inb(SLV_GR1); ! save->bank0=inb(SLV_BANK0); ! save->bank1=inb(SLV_BANK1); ! save->bank2=inb(SLV_BANK2); ! save->bank3=inb(SLV_BANK3); ! save->hires=inb(SLV_HIRES); ! ! return((void *)save); } /* --- 322,330 ---- void * SIGMASave(save) ! pointer save; { ! return((void *)sigma_Current_mode); } /* *************** *** 325,359 **** void SIGMARestore(restore) ! sigmaPtr restore; { ! unsigned char i; ! if (restore!=NULL) /* better be shure */ { /* Blank the screen to black */ outb(SLV_GR0,0); outb(SLV_GR1,0); outb(SLV_BLANK,0); /* Disable adapter memory */ outb(SLV_EN1,0); ! /* Restore original values */ ! outb(SLV_W16,restore->w16); ! outb(SLV_W17,restore->w17); ! outb(SLV_W18,restore->w18); ! outb(SLV_ZOOM,restore->zoom); ! outb(SLV_BANK0,restore->bank0); ! outb(SLV_BANK1,restore->bank1); ! outb(SLV_BANK2,restore->bank2); ! outb(SLV_BANK3,restore->bank3); ! outb(SLV_HIRES,restore->hires); ! /* Restore screensaver values */ ! outb(SLV_GR0,restore->gr0); ! outb(SLV_GR1,restore->gr1); ! outb(SLV_BLANK,restore->blank); ! /* Restore enable state (may be disabled) */ ! outb(SLV_EN1,restore->en1); ! } ! else ErrorF("Warning: SIGMARestore called with arg==NULL\n"); } /* --- 334,404 ---- void SIGMARestore(restore) ! pointer restore; { ! if ((int)restore==sigma_Textmode) { /* Blank the screen to black */ outb(SLV_GR0,0); + SIGMA_DELAY; outb(SLV_GR1,0); + SIGMA_DELAY; outb(SLV_BLANK,0); + SIGMA_DELAY; /* Disable adapter memory */ outb(SLV_EN1,0); + SIGMA_DELAY; ! /* deselect hires */ ! outb(SLV_HIRES,0x0); ! SIGMA_DELAY; ! /* Unblank the screen */ ! outb(SLV_GR0,0x80); ! SIGMA_DELAY; ! outb(SLV_GR1,0x80); ! SIGMA_DELAY; ! outb(SLV_BLANK,0x80); ! SIGMA_DELAY; ! ! sigma_Current_mode=sigma_Textmode; ! ! } else if ((int)restore==sigma_Graphmode) { ! /* Blank the screen to black */ ! outb(SLV_GR0,0); ! SIGMA_DELAY; ! outb(SLV_GR1,0); ! SIGMA_DELAY; ! outb(SLV_BLANK,0); ! SIGMA_DELAY; ! /* Disable adapter memory */ ! outb(SLV_EN1,0); ! SIGMA_DELAY; ! ! /* Set page frame */ ! outb(SLV_W16,((sigmaMemBase & 0x10000L) ? 0 : 0x80)); ! SIGMA_DELAY; ! outb(SLV_W17,((sigmaMemBase & 0x20000L) ? 0 : 0x80)); ! SIGMA_DELAY; ! outb(SLV_W18,((sigmaMemBase & 0x40000L) ? 0 : 0x80)); ! SIGMA_DELAY; ! outb(SLV_ZOOM,0x80); ! SIGMA_DELAY; ! ! /* */ ! outb(SLV_HIRES,0x80); ! SIGMA_DELAY; ! /* Unblank the screen */ ! outb(SLV_GR0,0x80); ! SIGMA_DELAY; ! outb(SLV_GR1,0x80); ! SIGMA_DELAY; ! outb(SLV_BLANK,0x80); ! SIGMA_DELAY; ! /* Set enable state */ ! outb(SLV_EN1,0x80); ! ! sigma_Current_mode=sigma_Graphmode; ! ! } else ErrorF("Warning: SIGMARestore called with invalid arg.\n"); } /* *************** *** 372,383 **** --- 417,432 ---- if (on) { /* Grrr! SaveScreen(on=TRUE) means turn ScreenSaver off */ /* Unblank to 4 gray levels */ outb(SLV_BLANK,0x80); + SIGMA_DELAY; outb(SLV_GR0,0x80); + SIGMA_DELAY; outb(SLV_GR1,0x80); } else { /* Blank to black */ outb(SLV_BLANK,0); + SIGMA_DELAY; outb(SLV_GR0,0); + SIGMA_DELAY; outb(SLV_GR1,0); } } /* if we are not on the active VT, don't do anything - the screen diff -c /dev/null mit/server/ddx/x386/bdm2/drivers/visa/Imakefile:2.0 *** /dev/null Fri Mar 11 23:38:41 1994 --- mit/server/ddx/x386/bdm2/drivers/visa/Imakefile Fri Mar 11 23:38:42 1994 *************** *** 0 **** --- 1,28 ---- + XCOMM $XFree86: mit/server/ddx/x386/bdm2/drivers/visa/Imakefile,v 2.0 1993/12/01 12:37:36 dawes Exp $ + XCOMM $XConsortium: Imakefile,v 1.1 91/07/16 22:59:40 gildea Exp $ + #include + + SRCS = visadriv.c visabank.s + + OBJS = visadriv.o visabank.o + + #if X386LinkKit + INCLUDES = -I. -I../../../include -I../.. + #else + INCLUDES = -I. -I../../../common -I../../../os-support -I../../bdm \ + -I$(SERVERSRC)/include -I$(INCLUDESRC) + #endif + + NormalLibraryObjectRule() + NormalAsmObjectRule() + + NormalRelocatableTarget(visa, $(OBJS)) + + InstallLinkKitNonExecFile(Imakefile,$(LINKKITDIR)/drivers/bdm2/visa) + InstallLinkKitNonExecFile(visaHW.h,$(LINKKITDIR)/drivers/bdm2/visa) + InstallLinkKitNonExecFile(visaPorts.h,$(LINKKITDIR)/drivers/bdm2/visa) + InstallLinkKitNonExecFile(visabank.s,$(LINKKITDIR)/drivers/bdm2/visa) + InstallLinkKitNonExecFile(visadriv.c,$(LINKKITDIR)/drivers/bdm2/visa) + + DependTarget() + diff -c /dev/null mit/server/ddx/x386/bdm2/drivers/visa/visaHW.h:2.0 *** /dev/null Fri Mar 11 23:38:42 1994 --- mit/server/ddx/x386/bdm2/drivers/visa/visaHW.h Fri Mar 11 23:38:42 1994 *************** *** 0 **** --- 1,44 ---- + /* + * BDM2: Banked dumb monochrome driver + * Pascal Haible 10/93, haible@izfm.uni-stuttgart.de + * + * bdm2/driver/visa/visaHW.c + * Register definitions for visa6845 + * + * see bdm2/COPYRIGHT for copyright and disclaimers. + */ + + /* Thanks to Christian (cm@htu.tuwien.ac.at) who did the first port */ + + /* $XFree86: mit/server/ddx/x386/bdm2/drivers/visa/visaHW.h,v 2.0 1993/12/01 12:37:38 dawes Exp $ */ + + #define C_STYLE_HEX_CONSTANTS + #include "visaPorts.h" + + /* Memory Base Address */ + #define VISA_MEM_BASE (0xB0000L) + + #define VISA_BANK_SIZE (0x10000L) /* 64k */ + + #define VISA_MAP_BASE (VISA_MEM_BASE) + + #define VISA_MAP_SIZE (VISA_BANK_SIZE) + + #define VISA_MEM_BASE_BANK1 (0) + #define VISA_MEM_BASE_BANK2 (0) /* unused */ + + /* rel. to VISA_MAP_BASE */ + #define VISA_BANK1_BOTTOM (VISA_MEM_BASE_BANK1) + #define VISA_BANK1_TOP (VISA_BANK1_BOTTOM+VISA_BANK_SIZE) + /* unused */ + #define VISA_BANK2_BOTTOM (VISA_MEM_BASE_BANK2) + #define VISA_BANK2_TOP (VISA_BANK2_BOTTOM+VISA_BANK_SIZE) + + #define VISA_SEGMENT_SIZE (VISA_BANK_SIZE) + #define VISA_SEGMENT_SHIFT (16) /* 64k */ + #define VISA_SEGMENT_MASK (0xFFFFL) + + #define VISA_HDISPLAY (1280) + #define VISA_VDISPLAY (1024) + + #define VISA_SCAN_LINE_WIDTH (2048) diff -c /dev/null mit/server/ddx/x386/bdm2/drivers/visa/visaPorts.h:2.0 *** /dev/null Fri Mar 11 23:38:42 1994 --- mit/server/ddx/x386/bdm2/drivers/visa/visaPorts.h Fri Mar 11 23:38:42 1994 *************** *** 0 **** --- 1,25 ---- + /* + * BDM2: Banked dumb monochrome driver + * Pascal Haible 10/93, haible@izfm.uni-stuttgart.de + * + * bdm2/driver/sigma/sigmaPorts.h + * I/O Port definitions for Sigma L-View and Sigma LaserView PLUS + * + * see bdm2/COPYRIGHT for copyright and disclaimers. + */ + + /* Thanks to Christian (cm@htu.tuwien.ac.at) who did the first driver */ + + /* $XFree86: mit/server/ddx/x386/bdm2/drivers/visa/visaPorts.h,v 2.0 1993/12/01 12:37:39 dawes Exp $ */ + + #if defined(C_STYLE_HEX_CONSTANTS) + #undef CONST + #define CONST(a) (a) + #endif + + #define VISA_INDEX CONST(0x3B4) + #define VISA_DATA CONST(0x3B5) + #define VISA_MODE CONST(0x3B8) + #define VISA_STATUS CONST(0x3BA) + #define VISA_CONFIG CONST(0x3BF) + #define VISA_BANK CONST(0x3BF) diff -c /dev/null mit/server/ddx/x386/bdm2/drivers/visa/visabank.s:2.0 *** /dev/null Fri Mar 11 23:38:43 1994 --- mit/server/ddx/x386/bdm2/drivers/visa/visabank.s Fri Mar 11 23:38:43 1994 *************** *** 0 **** --- 1,83 ---- + /* + * BDM2: Banked dumb monochrome driver + * Pascal Haible 10/93, haible@izfm.uni-stuttgart.de + * + * bdm2/driver/visa/visabank.s + * + * derived from: + * hga2/* + * Author: Davor Matic, dmatic@athena.mit.edu + * and + * vga256/* + * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. + * + * see bdm2/COPYRIGHT for copyright and disclaimers. + */ + + /* $XFree86: mit/server/ddx/x386/bdm2/drivers/visa/visabank.s,v 2.0 1993/12/01 12:37:40 dawes Exp $ */ + + /* + * These are here the very lowlevel bankswitching routines. + * The segment to switch to is passed via %eax. Only %eax and %edx my be used + * without saving the original contents. + * + * WHY ASSEMBLY LANGUAGE ??? + * + * These routines must be callable by other assembly routines. But I don't + * want to have the overhead of pushing and poping the normal stack-frame. + */ + + /* The visa6845 allows the following braindead banking: + * bank banked to bank banked to + * Bit 6 5 4 B0000-B7FFF B8000-BFFFF + * 0 0 0 0 1 + * 0 0 1 1 2 + * 0 1 0 2 3 + * 0 1 1 3 4 + * 1 0 0 4 5 + * 1 0 1 5 6 + * 1 1 0 6 7 + * 1 1 1 7 0 + * + * We have to use it as a single 64k bank. + * This gives bank(BankNo) as + * out(0x3BF,(BankNo<<5)|3) + */ + + #include "assyntax.h" + + #include "visaPorts.h" + + FILE("visabank.s") + + AS_BEGIN + + SEG_DATA + + SEG_TEXT + + ALIGNTEXT4 + GLOBL GLNAME(VISASetRead) + GLNAME(VISASetRead): + /* Shift left by 5 */ + SHL_L (CONST(5),EAX) + /* Set bit 1 and 0 */ + OR_L (CONST(3),EAX) + /* Out byte */ + MOV_L (VISA_BANK,EDX) + OUT_B + RET + + ALIGNTEXT4 + GLOBL GLNAME(VISASetWrite) + GLOBL GLNAME(VISASetReadWrite) + GLNAME(VISASetWrite): + GLNAME(VISASetReadWrite): + /* Shift left by 5 */ + SHL_L (CONST(5),EAX) + /* Set bit 1 and 0 */ + OR_L (CONST(3),EAX) + /* Out byte */ + MOV_L (VISA_BANK,EDX) + OUT_B + RET diff -c /dev/null mit/server/ddx/x386/bdm2/drivers/visa/visadriv.c:2.0 *** /dev/null Fri Mar 11 23:38:43 1994 --- mit/server/ddx/x386/bdm2/drivers/visa/visadriv.c Fri Mar 11 23:38:43 1994 *************** *** 0 **** --- 1,371 ---- + /* + * BDM2: Banked dumb monochrome driver + * Pascal Haible 10/93, haible@izfm.uni-stuttgart.de + * + * bdm2/driver/visa/visadriv.c + * + * Parts derived from: + * hga2/* + * Author: Davor Matic, dmatic@athena.mit.edu + * and + * vga256/* + * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. + * + * see bdm2/COPYRIGHT for copyright and disclaimers. + */ + + /* Thanks to Christian (cm@htu.tuwien.ac.at) who did the first driver */ + + /* $XFree86: mit/server/ddx/x386/bdm2/drivers/visa/visadriv.c,v 2.0 1993/12/01 12:37:41 dawes Exp $ */ + + #include "X.h" + #include "input.h" + #include "screenint.h" + + #include "compiler.h" + + #include "x386.h" + #include "x386Priv.h" + #include "xf86_OSlib.h" + #include "xf86_Config.h" + #include "bdm.h" + #include "visaHW.h" + + typedef struct { + unsigned char conf; /* write only conf register at port 0x3BF */ + unsigned char mode; /* write only mode register at port 0x3B8 */ + unsigned char tbl[16];/* graph. params */ + } visaRec, *visaPtr; + + visaRec visaRegsGraf1280x1024 = { + 0x03, /* conf */ + 0x0A, /* mode */ + { 0x35, 0x50, 0x2E, 0x07, 0x5B, 0x02, 0x57, 0x57, + 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} + }; + + /* + * Since the table of 6845 registers is write only, we need to keep + * a local copy of the state here. The initial state is assumed to + * be 160x55 text mode. + */ + visaRec visaRegsActual = { + 0x00, + 0x00, + { 0x61, 0xA0, 0x52, 0x0F, 0x19, 0x06, 0x19, 0x19, + 0x02, 0x0D, 0x0B, 0x0C, 0x00, 0x00, 0x00, 0x00 } + }; + + /* + * Define the VISA I/O Ports + */ + unsigned VISA_IOPorts[] = { + VISA_INDEX, VISA_DATA, VISA_MODE, VISA_STATUS, VISA_CONFIG /* = VISA_BANK */ }; + int Num_VISA_IOPorts = (sizeof(VISA_IOPorts)/sizeof(VISA_IOPorts[0])); + + volatile int visa_delay_dummy=0; + #define VISA_DELAY { visa_delay_dummy++; } + + char * VISAIdent(); + Bool VISAProbe(); + void VISAEnterLeave(); + void * VISAInit(); + void * VISASave(); + void VISARestore(); + void VISAAdjust(); + Bool VISASaveScreen(); + void VISAGetMode(); + + /* Assembler functions in visabank.s + * - to be called by assembler functions only! */ + extern void VISASetRead(); + extern void VISASetWrite(); + extern void VISASetReadWrite(); + + #if 0 + /* From bdm.h -- see there, this here might not be up to date */ + /* + * structure for accessing the video chip`s functions + * + * We are doing a total encapsulation of the driver's functions. + * Banking (bdmSetReadWrite(p) etc.) is done in bdmBank.c + * using the chip's function pointed to by + * bmpSetReadWriteFunc(bank) etc. + */ + typedef struct { + char * (* ChipIdent)(); + Bool (* ChipProbe)(); + void (* ChipEnterLeave)(); + void * (* ChipInit)(); + void * (* ChipSave)(); + void (* ChipRestore)(); + void (* ChipAdjust)(); + Bool (* ChipSaveScreen)(); + void (* ChipGetMode)(); + /* These are the chip's banking functions: */ + /* they do the real switching to the desired bank */ + /* they 'become' bdmSetReadFunc() etc. */ + void (* ChipSetRead)(); + void (* ChipSetWrite)(); + void (* ChipSetReadWrite)(); + /* Bottom and top of the banking window (rel. to ChipMapBase) */ + /* Note: Top = highest accessable byte + 1 */ + void *ChipReadBottom; + void *ChipReadTop; + void *ChipWriteBottom; + void *ChipWriteTop; + /* Memory to map */ + int ChipMapBase; + int ChipMapSize; /* replaces MEMTOMAP */ + int ChipSegmentSize; + int ChipSegmentShift; + int ChipSegmentMask; + Bool ChipUse2Banks; + /* Display size is given by the driver */ + int ChipHDisplay; + int ChipVDisplay; + /* In case Scan Line in mfb is longer than HDisplay */ + int ChipScanLineWidth; + OFlagSet ChipOptionFlags; + } bdmVideoChipRec, *bdmVideoChipPtr; + #endif /* 0 */ + + bdmVideoChipRec VISA = { + /* Functions */ + VISAIdent, + VISAProbe, + VISAEnterLeave, + VISAInit, + VISASave, + VISARestore, + VISAAdjust, + VISASaveScreen, + NoopDDA, /* VISAGetMode */ + VISASetRead, + VISASetWrite, + VISASetReadWrite, + (void *)VISA_BANK1_BOTTOM, /* ReadBottom */ + (void *)VISA_BANK1_TOP, /* ReadTop */ + (void *)VISA_BANK2_BOTTOM, /* WriteBottom */ + (void *)VISA_BANK2_TOP, /* WriteTop */ + VISA_MAP_BASE, /* MapBase */ + VISA_MAP_SIZE, /* MapSize */ + VISA_SEGMENT_SIZE, /* SegmentSize */ + VISA_SEGMENT_SHIFT, /* SegmentShift */ + VISA_SEGMENT_MASK, /* SegmentMask */ + FALSE, /* Use2Banks */ + VISA_HDISPLAY, /* HDisplay */ + VISA_VDISPLAY, /* VDisplay */ + VISA_SCAN_LINE_WIDTH, /* ScanLineWidth */ + {0,}, + }; + + /* + * VISAIdent + */ + + char * + VISAIdent(n) + int n; + { + static char *chipsets[] = {"visa6845"}; + if (n >= sizeof(chipsets) / sizeof(char *)) + return(NULL); + else return(chipsets[n]); + } + + /* + * VISAProbe -- + * check whether an VISA based board is installed + */ + + Bool + VISAProbe() + { + /* + * Set up I/O ports to be used by this card + */ + xf86ClearIOPortList(bdm2InfoRec.scrnIndex); + xf86AddIOPorts(bdm2InfoRec.scrnIndex, Num_VISA_IOPorts, VISA_IOPorts); + + if (bdm2InfoRec.chipset) { + /* Chipset preset */ + if (strcmp(bdm2InfoRec.chipset, VISAIdent(0))) + /* desired chipset != this one */ + return (FALSE); + else { + VISAEnterLeave(ENTER); + /* go on with videoram etc. below */ + } + } + else { + /* do the real probing */ + /***** This currently detects any herc board *****/ + #define DSP_VSYNC_MASK 0x80 + #define DSP_ID_MASK 0x70 + unsigned char dsp, dsp_old; + int i, cnt; + + VISAEnterLeave(ENTER); + /* + * Checks if there is a VISA 6845 based bard in the system. + * The following loop tries to see if the Hercules display + * status port register is counting vertical syncs (50Hz). + */ + cnt = 0; + dsp_old = inb(0x3BA) & DSP_VSYNC_MASK; + for (i = 0; i < 0x10000; i++) { + dsp = inb(0x3BA) & DSP_VSYNC_MASK; + if (dsp != dsp_old) cnt++; + dsp_old = dsp; + } + + /* If there are active sync changes, we found a Hercules board. */ + if (cnt) { + bdm2InfoRec.chipset = VISAIdent(0); + ErrorF("%s %s: %s detected\n", + XCONFIG_PROBED, + bdm2InfoRec.name, + bdm2InfoRec.chipset); + } else { + /* there is no VISA 6845 card */ + VISAEnterLeave(LEAVE); + return(FALSE); + } + } /* else (bdm2InfoRec.chipset) -- bdm2InfoRec.chipset is already set */ + if (!bdm2InfoRec.videoRam) { + /* videoram not given in Xconfig */ + bdm2InfoRec.videoRam=256; + } + /* We do 'virtual' handling here as it is highly chipset specific */ + /* Screen size (pixels) is fixed, virtual size can be larger up to + * ChipMaxVirtualX and ChipMaxVirtualY */ + /* Real display size is given by VISA_HDISPLAY and VISA_VDISPLAY, + * desired virtual size is bdm2InfoRec.virtualX and bdm2InfoRec.virtualY. + * Think they can be -1 at this point. + * Maximum virtual size as done by the driver is + * VISA_MAX_VIRTUAL_X and ..._Y + */ + if (!(bdm2InfoRec.virtualX < 0)) { + /* virtual set in Xconfig */ + ErrorF("%s %s: %s: Virtual not allowed for this chipset\n", + XCONFIG_PROBED, bdm2InfoRec.name, bdm2InfoRec.chipset); + } + /* Set virtual to real size */ + bdm2InfoRec.virtualX = VISA_HDISPLAY; + bdm2InfoRec.virtualY = VISA_VDISPLAY; + /* Must return real display size */ + /* hardcoded in VISA */ + return(TRUE); + } + + /* + * VISAEnterLeave -- + * enable/disable io permissions + */ + + void + VISAEnterLeave(enter) + Bool enter; + { + if (enter) + xf86EnableIOPorts(bdm2InfoRec.scrnIndex); + else + xf86DisableIOPorts(bdm2InfoRec.scrnIndex); + } + + /* + * VISAInit -- + * Handle the initialization of the VISAs registers + */ + + void * + VISAInit(mode) + DisplayModePtr mode; + { + /* this is a r/w copy of the initial graph mode */ + static visaPtr visaInitVideoMode = NULL; + + if (!visaInitVideoMode) + visaInitVideoMode = (visaPtr)Xalloc(sizeof(visaRec)); + /* memcpy(dest,source,size) */ + memcpy((void *)visaInitVideoMode, (void *)&visaRegsGraf1280x1024, + sizeof(visaRec)); + return((void *)visaInitVideoMode); + } + + /* + * VISASave -- + * save the current video mode + */ + + void * + VISASave(save) + visaPtr save; + { + unsigned char i; + + if (save==NULL) + save=(visaPtr)Xalloc(sizeof(visaRec)); + save->conf=inb(VISA_CONFIG); + save->mode=inb(VISA_MODE); + /* The table of 6845 registers is write only, we return the local copy */ + for (i=0; i<16; i++) + save->tbl[i] = visaRegsActual.tbl[i]; + return((void *)save); + } + + /* + * VISARestore -- + * restore a video mode + */ + + void + VISARestore(restore) + visaPtr restore; + { + unsigned char i; + if (restore!=NULL) /* better be shure */ { + outb(VISA_CONFIG, (visaRegsActual.conf = restore->conf)); + outb(VISA_MODE, (visaRegsActual.mode = restore->mode)); + for (i=0; i<16; i++) { + outb(VISA_INDEX, i); + outb(VISA_DATA, (visaRegsActual.tbl[i] = restore->tbl[i])); + } + } + else ErrorF("Warning: VISARestore called with arg==NULL\n"); + } + + /* + * VISASaveScreen(); + * Disable the video on the frame buffer (screensaver) + */ + + Bool + VISASaveScreen(pScreen,on) + ScreenPtr pScreen; + Bool on; + { + if (on == SCREEN_SAVER_FORCER) + SetTimeSinceLastInputEvent(); + if (x386VTSema) { + if (on) { /* Grrr! SaveScreen(on=TRUE) means turn ScreenSaver off */ + outb(VISA_MODE, (visaRegsActual.mode |= 0x08)); /* unblank */ + } else { + outb(VISA_MODE, (visaRegsActual.mode &= 0xF7)); /* blank */ + } + } /* if we are not on the active VT, don't do anything - the screen + * will be visible as soon as we switch back anyway (?) */ + return(TRUE); + } + + /* VISAAdjust -- + * adjust the current video frame to display the mousecursor + * (x,y) is the upper left corner to be displayed. + * The VISA 6845 can't pan. + */ + void + VISAAdjust(x,y) + int x, y; + { + } diff -c mit/server/ddx/x386/common/Imakefile:2.16 mit/server/ddx/x386/common/Imakefile:2.17 *** mit/server/ddx/x386/common/Imakefile:2.16 Fri Mar 11 23:38:51 1994 --- mit/server/ddx/x386/common/Imakefile Fri Mar 11 23:38:51 1994 *************** *** 1,4 **** ! XCOMM $XFree86: mit/server/ddx/x386/common/Imakefile,v 2.16 1993/09/23 15:45:15 dawes Exp $ XCOMM $XConsortium: Imakefile,v 1.1 91/07/16 22:57:37 gildea Exp $ #include --- 1,4 ---- ! XCOMM $XFree86: mit/server/ddx/x386/common/Imakefile,v 2.17 1994/02/23 14:17:43 dawes Exp $ XCOMM $XConsortium: Imakefile,v 1.1 91/07/16 22:57:37 gildea Exp $ #include *************** *** 5,15 **** #if i386Mach KBD = x386KbdMach #else ! #if i386Bsd KBD = xf86_KbdBSD ! #else KBD = x386Kbd ! #endif #endif SERVERSRCS = \ --- 5,19 ---- #if i386Mach KBD = x386KbdMach #else ! # if i386Bsd KBD = xf86_KbdBSD ! # else ! # ifdef LinuxArchitecture ! KBD = xf86_KbdLnx ! # else KBD = x386Kbd ! # endif ! # endif #endif SERVERSRCS = \ diff -c mit/server/ddx/x386/common/XF86_Mach32.c:2.1 mit/server/ddx/x386/common/XF86_Mach32.c:2.3 *** mit/server/ddx/x386/common/XF86_Mach32.c:2.1 Fri Mar 11 23:38:51 1994 --- mit/server/ddx/x386/common/XF86_Mach32.c Fri Mar 11 23:38:51 1994 *************** *** 1,5 **** /* ! * $XFree86: mit/server/ddx/x386/common/XF86_Mach32.c,v 2.1 1993/10/07 13:55:56 dawes Exp $ */ #include "X.h" --- 1,5 ---- /* ! * $XFree86: mit/server/ddx/x386/common/XF86_Mach32.c,v 2.3 1994/02/26 05:02:04 dawes Exp $ */ #include "X.h" *************** *** 15,23 **** * is added for using the ramdacs in 2:1 mode. Increasing this limit * could result in damage to your hardware. */ ! #define MAX_MACH32_CLOCK 80000 int mach32MaxClock = MAX_MACH32_CLOCK; ScrnInfoPtr x386Screens[] = { --- 15,25 ---- * is added for using the ramdacs in 2:1 mode. Increasing this limit * could result in damage to your hardware. */ ! #define MAX_MACH32_CLOCK 80000 ! #define MAX_MACH32_TLC34075_CLOCK 135000 int mach32MaxClock = MAX_MACH32_CLOCK; + int mach32MaxTlc34075Clock = MAX_MACH32_TLC34075_CLOCK; ScrnInfoPtr x386Screens[] = { *************** *** 50,55 **** --- 52,58 ---- VIRTUAL, CLOCKPROG, BIOSBASE, + MEMBASE, -1 }; diff -c mit/server/ddx/x386/common/XF86_Mono.c:2.2 mit/server/ddx/x386/common/XF86_Mono.c:2.3 *** mit/server/ddx/x386/common/XF86_Mono.c:2.2 Fri Mar 11 23:38:52 1994 --- mit/server/ddx/x386/common/XF86_Mono.c Fri Mar 11 23:38:52 1994 *************** *** 1,5 **** /* ! * $XFree86: mit/server/ddx/x386/common/XF86_Mono.c,v 2.2 1993/08/30 15:23:13 dawes Exp $ */ #include "X.h" --- 1,5 ---- /* ! * $XFree86: mit/server/ddx/x386/common/XF86_Mono.c,v 2.3 1993/12/01 12:38:18 dawes Exp $ */ #include "X.h" *************** *** 82,87 **** --- 82,89 ---- { STATICGRAY, CHIPSET, + OPTION, + MEMBASE, SCREENNO, DISPLAYSIZE, VIRTUAL, diff -c mit/server/ddx/x386/common/XF86_S3.c:2.2 mit/server/ddx/x386/common/XF86_S3.c:2.6 *** mit/server/ddx/x386/common/XF86_S3.c:2.2 Fri Mar 11 23:38:52 1994 --- mit/server/ddx/x386/common/XF86_S3.c Fri Mar 11 23:38:52 1994 *************** *** 1,5 **** /* ! * $XFree86: mit/server/ddx/x386/common/XF86_S3.c,v 2.2 1993/10/14 16:05:56 dawes Exp $ */ #include "X.h" --- 1,5 ---- /* ! * $XFree86: mit/server/ddx/x386/common/XF86_S3.c,v 2.6 1994/03/06 06:44:39 dawes Exp $ */ #include "X.h" *************** *** 14,20 **** * the ramdacs used on many S3 cards Increasing this limit * could result in damage to your hardware. */ ! /* Clock limit for non-Bt485 cards */ #define MAX_S3_CLOCK 110000 /* --- 14,20 ---- * the ramdacs used on many S3 cards Increasing this limit * could result in damage to your hardware. */ ! /* Clock limit for non-Bt485, non-Ti3020 cards */ #define MAX_S3_CLOCK 110000 /* *************** *** 25,34 **** */ /* Clock limit for cards with a Bt485 */ ! #define MAX_BT485_CLOCK 85000 int s3MaxClock = MAX_S3_CLOCK; int s3MaxBt485Clock = MAX_BT485_CLOCK; ScrnInfoPtr x386Screens[] = { --- 25,43 ---- */ /* Clock limit for cards with a Bt485 */ ! #define MAX_BT485_CLOCK 85000 ! /* Clock limit for Bt485 cards where we support pixel multiplexing */ ! #define MAX_BT485_MUX_CLOCK 135000 ! ! /* Clock limits for cards with a Ti3020 */ ! #define MAX_TI3020_CLOCK 135000 ! #define MAX_TI3020_CLOCK_FAST 200000 int s3MaxClock = MAX_S3_CLOCK; int s3MaxBt485Clock = MAX_BT485_CLOCK; + int s3MaxBt485MuxClock = MAX_BT485_MUX_CLOCK; + int s3MaxTi3020Clock = MAX_TI3020_CLOCK; + int s3MaxTi3020ClockFast = MAX_TI3020_CLOCK_FAST; ScrnInfoPtr x386Screens[] = { *************** *** 61,66 **** --- 70,76 ---- VIRTUAL, CLOCKPROG, BIOSBASE, + MEMBASE, -1 }; diff -c mit/server/ddx/x386/common/XF86_VGA16.c:2.1 mit/server/ddx/x386/common/XF86_VGA16.c:2.2 *** mit/server/ddx/x386/common/XF86_VGA16.c:2.1 Fri Mar 11 23:38:53 1994 --- mit/server/ddx/x386/common/XF86_VGA16.c Fri Mar 11 23:38:53 1994 *************** *** 1,5 **** /* ! * $XFree86: mit/server/ddx/x386/common/XF86_VGA16.c,v 2.1 1993/08/20 16:26:34 dawes Exp $ */ #include "X.h" --- 1,5 ---- /* ! * $XFree86: mit/server/ddx/x386/common/XF86_VGA16.c,v 2.2 1994/02/01 13:52:34 dawes Exp $ */ #include "X.h" *************** *** 32,37 **** --- 32,39 ---- int vga16ValidTokens[] = { PSEUDOCOLOR, + STATICGRAY, + GRAYSCALE, CHIPSET, CLOCKS, DISPLAYSIZE, diff -c mit/server/ddx/x386/common/x386.h:2.7 mit/server/ddx/x386/common/x386.h:2.10 *** mit/server/ddx/x386/common/x386.h:2.7 Fri Mar 11 23:38:53 1994 --- mit/server/ddx/x386/common/x386.h Fri Mar 11 23:38:53 1994 *************** *** 1,4 **** ! /* $XFree86: mit/server/ddx/x386/common/x386.h,v 2.7 1993/09/30 17:49:30 dawes Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * --- 1,4 ---- ! /* $XFree86: mit/server/ddx/x386/common/x386.h,v 2.10 1994/03/06 08:28:10 dawes Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * *************** *** 52,57 **** --- 52,59 ---- #define V_NVSYNC 0x0008 #define V_INTERLACE 0x0010 #define V_DBLSCAN 0x0020 + #define V_CSYNC 0x0040 + #define V_PIXMUX 0x0100 #define MAXCLOCKS 32 *************** *** 91,96 **** --- 93,99 ---- int maxClock; int videoRam; int BIOSbase; /* Base address of video BIOS */ + unsigned long MemBase; /* Frame buffer base address */ int width, height; /* real display dimensions */ unsigned long speedup; /* Use SpeedUp code */ DisplayModePtr modes; diff -c mit/server/ddx/x386/common/x386Config.c:2.25 mit/server/ddx/x386/common/x386Config.c:2.34 *** mit/server/ddx/x386/common/x386Config.c:2.25 Fri Mar 11 23:38:54 1994 --- mit/server/ddx/x386/common/x386Config.c Fri Mar 11 23:38:55 1994 *************** *** 1,5 **** /* ! * $XFree86: mit/server/ddx/x386/common/x386Config.c,v 2.25 1993/10/10 11:46:48 dawes Exp $ * $XConsortium: x386Config.c,v 1.2 91/08/20 15:08:26 gildea Exp $ * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. --- 1,5 ---- /* ! * $XFree86: mit/server/ddx/x386/common/x386Config.c,v 2.34 1994/02/10 21:25:26 dawes Exp $ * $XConsortium: x386Config.c,v 1.2 91/08/20 15:08:26 gildea Exp $ * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. *************** *** 430,435 **** --- 430,436 ---- x386Info.kbdDelay = 500; x386Info.kbdRate = 30; x386Info.vtinit = NULL; + x386Info.vtSysreq = VT_SYSREQ_DEFAULT; x386Info.specialKeyMap = (int *)xalloc((RIGHTCTL - LEFTALT + 1) * sizeof(int)); x386Info.specialKeyMap[LEFTALT - LEFTALT] = K_META; *************** *** 492,497 **** --- 493,508 ---- } } break; + case VTSYSREQ: + #ifdef USE_VT_SYSREQ + x386Info.vtSysreq = TRUE; + if (x386Verbose && !VT_SYSREQ_DEFAULT) + ErrorF("%s VTSysReq enabled\n", XCONFIG_GIVEN); + #else + configError("VTSysReq not supported on this OS"); + #endif + break; + default: pushToken = token; return; *************** *** 512,520 **** x386Info.sampleRate = 0; x386Info.emulate3Buttons = FALSE; x386Info.chordMiddle = FALSE; ! #ifdef CLEARDTR_SUPPORT ! x386Info.clearDTR = FALSE; ! #endif for (;;) { --- 523,529 ---- x386Info.sampleRate = 0; x386Info.emulate3Buttons = FALSE; x386Info.chordMiddle = FALSE; ! x386Info.mouseFlags = 0; for (;;) { *************** *** 562,568 **** case CLEARDTR: #ifdef CLEARDTR_SUPPORT if (x386Info.mseType + MICROSOFT == MOUSESYS) ! x386Info.clearDTR = TRUE; else configError("ClearDTR only supported for MouseSystems mouse"); #else --- 571,577 ---- case CLEARDTR: #ifdef CLEARDTR_SUPPORT if (x386Info.mseType + MICROSOFT == MOUSESYS) ! x386Info.mouseFlags |= MF_CLEAR_DTR; else configError("ClearDTR only supported for MouseSystems mouse"); #else *************** *** 569,574 **** --- 578,593 ---- configError("ClearDTR not supported on this OS"); #endif break; + case CLEARRTS: + #ifdef CLEARDTR_SUPPORT + if (x386Info.mseType + MICROSOFT == MOUSESYS) + x386Info.mouseFlags |= MF_CLEAR_RTS; + else + configError("ClearRTS only supported for MouseSystems mouse"); + #else + configError("ClearRTS not supported on this OS"); + #endif + break; default: pushToken = token; return; *************** *** 852,869 **** FatalError("ClockProg \"%s\" is not a regular file\n", val.str); } screen->clockprog = val.str; ! if (x386Verbose) ! ErrorF("%s: ClockProg: \"%s\"", screen->name, screen->clockprog); if (getToken(NULL) == NUMBER) { textClockValue = (int)(val.realnum * 1000.0 + 0.5); ! ErrorF(", Text Clock: %7.3f\n", textClockValue / 1000.0); } else { pushToken = token; ! ErrorF("\n"); } break; --- 871,890 ---- FatalError("ClockProg \"%s\" is not a regular file\n", val.str); } screen->clockprog = val.str; ! if (!dummy && x386Verbose) ! ErrorF("%s %s: ClockProg: \"%s\"", XCONFIG_GIVEN, screen->name, screen->clockprog); if (getToken(NULL) == NUMBER) { textClockValue = (int)(val.realnum * 1000.0 + 0.5); ! if (!dummy && x386Verbose) ! ErrorF(", Text Clock: %7.3f\n", textClockValue / 1000.0); } else { pushToken = token; ! if (!dummy && x386Verbose) ! ErrorF("\n"); } break; *************** *** 870,879 **** case BIOSBASE: if (getToken(NULL) != NUMBER) configError("BIOS base address expected"); screen->BIOSbase = val.num; ! if (x386Verbose) ! ErrorF("BIOS Base Address: %x\n", val.num); break; case BLACK: case WHITE: { --- 891,909 ---- case BIOSBASE: if (getToken(NULL) != NUMBER) configError("BIOS base address expected"); screen->BIOSbase = val.num; ! if (!dummy && x386Verbose) ! ErrorF("%s %s: BIOS Base Address: %x\n", XCONFIG_GIVEN, screen->name, ! val.num); break; + case MEMBASE: + if (getToken(NULL) != NUMBER) configError("Memory base address expected"); + screen->MemBase = val.num; + if (!dummy && x386Verbose) + ErrorF("%s %s: Memory Base Address: %x\n", XCONFIG_GIVEN, screen->name, + val.num); + break; + case BLACK: case WHITE: { *************** *** 1335,1341 **** break; } if (found_clock && x386Verbose) ! ErrorF("%s: text clock = %7.3f, clock used = %7.3f\n", driver->name, textClockValue / 1000.0, driver->clock[driver->textclock] / 1000.0); if (!found_clock) --- 1365,1372 ---- break; } if (found_clock && x386Verbose) ! ErrorF("$s %s: text clock = %7.3f, clock used = %7.3f\n", ! XCONFIG_GIVEN, driver->name, textClockValue / 1000.0, driver->clock[driver->textclock] / 1000.0); if (!found_clock) *************** *** 1417,1422 **** --- 1448,1454 ---- case NHSYNC: pNew->Flags |= V_NHSYNC; break; case PVSYNC: pNew->Flags |= V_PVSYNC; break; case NVSYNC: pNew->Flags |= V_NVSYNC; break; + case CSYNC: pNew->Flags |= V_CSYNC; break; default: configError("Videomode special flag expected"); break; *************** *** 1500,1508 **** ErrorF("following graphics drivers: "); for (i = 0; i < x386MaxScreens; i++) { ! ErrorF("%s%s", needcomma ? ", " : "", ! tokenToString(SymTab, xf86ScreenNames[i])); ! needcomma = TRUE; } ErrorF("\n"); FatalError("No configured graphics devices"); --- 1532,1543 ---- ErrorF("following graphics drivers: "); for (i = 0; i < x386MaxScreens; i++) { ! if (!x386Screens[i]) ! { ! ErrorF("%s%s", needcomma ? ", " : "", ! tokenToString(SymTab, xf86ScreenNames[i])); ! needcomma = TRUE; ! } } ErrorF("\n"); FatalError("No configured graphics devices"); *************** *** 1538,1544 **** /* * free up mode info... */ ! for (pLast = pModes, pNew = pModes->next; pLast;) { Xfree(pLast->name); Xfree(pLast); --- 1573,1580 ---- /* * free up mode info... */ ! if (pModes) ! for (pLast = pModes, pNew = pModes->next; pLast;) { Xfree(pLast->name); Xfree(pLast); *************** *** 1582,1588 **** driver->clocks = 2; } ! if (p->Clock > driver->maxClock) clock_too_high = TRUE; else { --- 1618,1624 ---- driver->clocks = 2; } ! if ((p->Clock / 1000) > (driver->maxClock / 1000)) clock_too_high = TRUE; else { *************** *** 1619,1625 **** for (i=0; i < driver->clocks; i++) /* scan clocks */ if (abs(p->Clock - driver->clock[i]) <= tol_table[j]) { ! if (driver->clock[i] > driver->maxClock) { clock_too_high = TRUE; break; --- 1655,1661 ---- for (i=0; i < driver->clocks; i++) /* scan clocks */ if (abs(p->Clock - driver->clock[i]) <= tol_table[j]) { ! if ((driver->clock[i] / 1000) > (driver->maxClock / 1000)) { clock_too_high = TRUE; break; diff -c mit/server/ddx/x386/common/x386Cursor.c:1.8 mit/server/ddx/x386/common/x386Cursor.c:2.0 *** mit/server/ddx/x386/common/x386Cursor.c:1.8 Fri Mar 11 23:38:56 1994 --- mit/server/ddx/x386/common/x386Cursor.c Fri Mar 11 23:38:56 1994 *************** *** 58,66 **** x386InitViewport(pScr) ScrnInfoPtr pScr; { - DisplayModePtr pMode, pEnd; - int virtualX, virtualY; - /* * Compute the initial Viewport if necessary */ --- 58,63 ---- *************** *** 145,151 **** ScreenPtr pScreen; int zoom; { - int x, y; ScrnInfoPtr pScr = X386SCRNINFO(pScreen); if (pScr->modes != pScr->modes->next) --- 142,147 ---- diff -c mit/server/ddx/x386/common/x386Events.c:2.13 mit/server/ddx/x386/common/x386Events.c:2.18 *** mit/server/ddx/x386/common/x386Events.c:2.13 Fri Mar 11 23:38:57 1994 --- mit/server/ddx/x386/common/x386Events.c Fri Mar 11 23:38:57 1994 *************** *** 1,5 **** /* ! * $XFree86: mit/server/ddx/x386/common/x386Events.c,v 2.13 1993/10/15 15:39:41 dawes Exp $ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * * Permission to use, copy, modify, distribute, and sell this software and its --- 1,5 ---- /* ! * $XFree86: mit/server/ddx/x386/common/x386Events.c,v 2.18 1994/02/10 21:25:29 dawes Exp $ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * * Permission to use, copy, modify, distribute, and sell this software and its *************** *** 79,89 **** Bool x386VTSema = TRUE; #ifndef _MINIX extern long EnabledDevices[]; #endif ! #if defined(__386BSD__) && !defined(__bsdi__) extern unsigned char x386CodrvMap[]; #endif --- 79,109 ---- Bool x386VTSema = TRUE; + /* + * The first of many hack's to get VT switching to work under + * Solaris 2.1 for x86. The basic problem is that Solaris is supposed + * to be SVR4. It is for the most part, except where the video interface + * is concerned. These hacks work around those problems. + * See the comments for Linux, and SCO. + * + * This is a toggleling variable: + * FALSE = No VT switching keys have been pressed last time around + * TRUE = Possible VT switch Pending + * (DWH - 12/2/93) + * + * This has been generalised to work with Linux and *BSD+syscons (DHD) + */ + + #ifdef USE_VT_SYSREQ + static Bool VTSysreqToggle = FALSE; + #endif /* !USE_VT_SYSREQ */ + static Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for *BSD */ + #ifndef _MINIX extern long EnabledDevices[]; #endif ! #if defined(CODRV_SUPPORT) extern unsigned char x386CodrvMap[]; #endif *************** *** 295,305 **** KeySym *keysym; int keycode; static int lockkeys = 0; ! #if defined(__386BSD__) && !defined(__bsdi__) if (x386Info.consType == CODRV011 || x386Info.consType == CODRV01X) scanCode = x386CodrvMap[scanCode]; #endif /* * First do some special scancode remapping ... */ --- 315,336 ---- KeySym *keysym; int keycode; static int lockkeys = 0; + #if defined(SYSCONS_SUPPORT) + static Bool first_time = TRUE; + #endif ! #if defined(CODRV_SUPPORT) if (x386Info.consType == CODRV011 || x386Info.consType == CODRV01X) scanCode = x386CodrvMap[scanCode]; #endif + + #if defined(SYSCONS_SUPPORT) + if (first_time) + { + first_time = FALSE; + VTSwitchEnabled = (x386Info.consType == SYSCONS); + } + #endif /* * First do some special scancode remapping ... */ *************** *** 309,320 **** case KEY_Prefix0: case KEY_Prefix1: ! #if defined(__386BSD__) && !defined(__bsdi__) if (x386Info.consType == PCCONS || x386Info.consType == SYSCONS) { #endif x386Info.scanPrefix = scanCode; /* special prefixes */ return; ! #if defined(__386BSD__) && !defined(__bsdi__) } break; #endif --- 340,351 ---- case KEY_Prefix0: case KEY_Prefix1: ! #if defined(PCCONS_SUPPORT) || defined(SYSCONS_SUPPORT) if (x386Info.consType == PCCONS || x386Info.consType == SYSCONS) { #endif x386Info.scanPrefix = scanCode; /* special prefixes */ return; ! #if defined(PCCONS_SUPPORT) || defined(SYSCONS_SUPPORT) } break; #endif *************** *** 348,354 **** } else if ( ! #if defined(__386BSD__) && !defined(__bsdi__) (x386Info.consType == PCCONS || x386Info.consType == SYSCONS) && #endif (x386Info.scanPrefix == KEY_Prefix0)) { --- 379,385 ---- } else if ( ! #if defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) (x386Info.consType == PCCONS || x386Info.consType == SYSCONS) && #endif (x386Info.scanPrefix == KEY_Prefix0)) { *************** *** 418,424 **** if (down) x386ZoomViewport(x386Info.currentScreen, 1); return; ! #ifdef linux /* * Under Linux, the raw keycodes are consumed before the kernel * does any processing on them, so we must emulate the vt switching --- 449,455 ---- if (down) x386ZoomViewport(x386Info.currentScreen, 1); return; ! #if defined(linux) || defined(__386BSD__) || defined(__NetBSD__) || defined(__FreeBSD__) /* * Under Linux, the raw keycodes are consumed before the kernel * does any processing on them, so we must emulate the vt switching *************** *** 434,452 **** case KEY_F8: case KEY_F9: case KEY_F10: ! if (down) ! ioctl(x386Info.consoleFd, VT_ACTIVATE, scanCode - KEY_F1 + 1); ! return; ! break; case KEY_F11: case KEY_F12: ! if (down) ! ioctl(x386Info.consoleFd, VT_ACTIVATE, scanCode - KEY_F11 + 11); ! return; ! break; #endif - #if defined(__386BSD__) && !defined(__bsdi__) case KEY_F1: case KEY_F2: case KEY_F3: --- 465,550 ---- case KEY_F8: case KEY_F9: case KEY_F10: ! if (VTSwitchEnabled && !x386Info.vtSysreq) ! { ! if (down) ! ioctl(x386Info.consoleFd, VT_ACTIVATE, scanCode - KEY_F1 + 1); ! return; ! } ! break; case KEY_F11: case KEY_F12: ! if (VTSwitchEnabled && !x386Info.vtSysreq) ! { ! if (down) ! ioctl(x386Info.consoleFd, VT_ACTIVATE, scanCode - KEY_F11 + 11); ! return; ! } ! break; ! #endif ! ! /* just worth mentioning here: any 386bsd keyboard driver ! * (pccons.c or co_kbd.c) catches CTRL-ALT-DEL and CTRL-ALT-ESC ! * before any application (e.g. X386) will see it ! * OBS: syscons does not ! ! */ ! } ! } ! ! /* ! * Start of acutal Solaris VT switching code. ! * This should pretty much emulate standard SVR4 switching keys. ! * ! * DWH 12/2/93 ! */ ! ! #ifdef USE_VT_SYSREQ ! if (VTSwitchEnabled && x386Info.vtSysreq) ! { ! switch (scanCode) ! { ! /* ! * syscons on *BSD doesn't have a VT #0 -- don't think Linux does ! * either ! */ ! #ifdef SOLX86 ! case KEY_H: ! if (VTSysreqToggle && down) ! { ! ioctl(x386Info.consoleFd, VT_ACTIVATE, 0); ! VTSysreqToggle = 0; ! return; ! } ! break; ! ! /* ! * Yah, I know the N, and P keys seem backwards, however that's ! * how they work under Solaris ! * XXXX N means go to next active VT not necessarily vtno+1 (or vtno-1) ! */ ! ! case KEY_N: ! if (VTSysreqToggle && down) ! { ! if (ioctl(x386Info.consoleFd, VT_ACTIVATE, x386Info.vtno - 1 ) < 0) ! ErrorF("Failed to switch consoles (%s)\n", strerror(errno)); ! VTSysreqToggle = FALSE; ! return; ! } ! break; ! ! case KEY_P: ! if (VTSysreqToggle && down) ! { ! if (ioctl(x386Info.consoleFd, VT_ACTIVATE, x386Info.vtno + 1 ) < 0) ! if (ioctl(x386Info.consoleFd, VT_ACTIVATE, 0) < 0) ! ErrorF("Failed to switch consoles (%s)\n", strerror(errno)); ! VTSysreqToggle = FALSE; ! return; ! } ! break; #endif case KEY_F1: case KEY_F2: case KEY_F3: *************** *** 457,486 **** case KEY_F8: case KEY_F9: case KEY_F10: ! if (x386Info.consType == SYSCONS) ! { ! if (down) ! ioctl(x386Info.consoleFd, VT_ACTIVATE, scanCode - KEY_F1 + 1); return; } case KEY_F11: case KEY_F12: ! if (x386Info.consType == SYSCONS) ! { ! if (down) ! ioctl(x386Info.consoleFd, VT_ACTIVATE, scanCode - KEY_F11 + 11); return; } ! #endif ! /* just worth mentioning here: any 386bsd keyboard driver ! * (pccons.c or co_kbd.c) catches CTRL-ALT-DEL and CTRL-ALT-ESC ! * before any application (e.g. X386) will see it ! * OBS: syscons does not ! ! */ ! } } #ifdef SCO /* * With the console in raw mode, SCO will not switch consoles, --- 555,605 ---- case KEY_F8: case KEY_F9: case KEY_F10: ! if (VTSysreqToggle && down) ! { ! if (ioctl(x386Info.consoleFd, VT_ACTIVATE, scanCode-KEY_F1 + 1) < 0) ! ErrorF("Failed to switch consoles (%s)\n", strerror(errno)); ! VTSysreqToggle = FALSE; return; } + break; + case KEY_F11: case KEY_F12: ! if (VTSysreqToggle && down) ! { ! if (ioctl(x386Info.consoleFd, VT_ACTIVATE, scanCode-KEY_F11 + 11) < 0) ! ErrorF("Failed to switch consoles (%s)\n", strerror(errno)); ! VTSysreqToggle = FALSE; return; } ! break; ! /* Ignore these keys -- ie don't let them cancel an alt-sysreq */ ! case KEY_Alt: ! case KEY_AltLang: ! break; ! ! case KEY_SysReqest: ! if (down && (ModifierDown(AltMask) || ModifierDown(AltLangMask))) ! VTSysreqToggle = TRUE; ! break; ! ! default: ! if (VTSysreqToggle) ! { ! /* ! * We only land here when Alt-SysReq is followed by a ! * non-switching key. ! */ ! VTSysreqToggle = FALSE; ! ! } ! } } + #endif /* USE_VT_SYSREQ */ + #ifdef SCO /* * With the console in raw mode, SCO will not switch consoles, *************** *** 604,610 **** * normal, non-keypad keys */ if (scanCode < KEY_KP_7 || scanCode > KEY_KP_Decimal) { ! #if !defined(__386BSD__) && !defined(MACH386) && !defined(_MINIX) && !defined(__OSF__) /* * magic ALT_L key on AT84 keyboards for multilingual support */ --- 723,729 ---- * normal, non-keypad keys */ if (scanCode < KEY_KP_7 || scanCode > KEY_KP_Decimal) { ! #if !defined(__BSD__) && !defined(MACH386) && !defined(_MINIX) && !defined(__OSF__) /* * magic ALT_L key on AT84 keyboards for multilingual support */ *************** *** 615,621 **** UsePrefix = TRUE; Direction = TRUE; } ! #endif /* !MACH386 && !__386BSD__ && !_MINIX && !__OSF__ */ } --- 734,740 ---- UsePrefix = TRUE; Direction = TRUE; } ! #endif /* !MACH386 && !__BSD__ && !_MINIX && !__OSF__ */ } *************** *** 656,662 **** x386PostMseEvent(buttons, dx, dy) int buttons, dx, dy; { - int eventNum = 0; int id, change; int truebuttons; xEvent mevent; --- 775,780 ---- *************** *** 881,894 **** x386VTSwitch() { int j; - int result; if (x386VTSema) { - - #if 0 - SaveScreens(SCREEN_SAVER_FORCER,ScreenSaverActive); - #endif - for (j = 0; j < screenInfo.numScreens; j++) (X386SCRNINFO(screenInfo.screens[j])->EnterLeaveVT)(LEAVE, j); --- 999,1006 ---- diff -c mit/server/ddx/x386/common/x386Kbd.c:2.1 mit/server/ddx/x386/common/x386Kbd.c:2.2 *** mit/server/ddx/x386/common/x386Kbd.c:2.1 Fri Mar 11 23:38:59 1994 --- mit/server/ddx/x386/common/x386Kbd.c Fri Mar 11 23:38:59 1994 *************** *** 1,5 **** /* ! * $XFree86: mit/server/ddx/x386/common/x386Kbd.c,v 2.1 1993/08/01 05:56:09 dawes Exp $ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * * Permission to use, copy, modify, distribute, and sell this software and its --- 1,5 ---- /* ! * $XFree86: mit/server/ddx/x386/common/x386Kbd.c,v 2.2 1994/02/23 14:17:45 dawes Exp $ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * * Permission to use, copy, modify, distribute, and sell this software and its *************** *** 237,249 **** CARD8 *pModMap; { KeySym *k; ! #if !defined(linux) && !defined(AMOEBA) && !defined(_MINIX) && !defined(__OSF__) keymap_t keymap; ! #endif /* !linux && !AMOEBA && !_MINIX && !__OSF__ */ char type; int i, j; ! #if !defined(linux) && !defined(AMOEBA) && !defined(_MINIX) && !defined(__OSF__) /* * use the keymap, which can be gotten from our oringinal vt??. * ( ttymap(1) !!!! ) --- 237,249 ---- CARD8 *pModMap; { KeySym *k; ! #if !defined(AMOEBA) && !defined(_MINIX) && !defined(__OSF__) keymap_t keymap; ! #endif /* !AMOEBA && !_MINIX && !__OSF__ */ char type; int i, j; ! #if !defined(AMOEBA) && !defined(_MINIX) && !defined(__OSF__) /* * use the keymap, which can be gotten from our oringinal vt??. * ( ttymap(1) !!!! ) *************** *** 266,272 **** if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol; } } ! #endif /* !linux && !AMOEBA && !_MINIX && !__OSF__ */ /* * Apply the special key mapping specified in Xconfig --- 266,272 ---- if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol; } } ! #endif /* !AMOEBA && !_MINIX && !__OSF__ */ /* * Apply the special key mapping specified in Xconfig diff -c mit/server/ddx/x386/common/x386Priv.h:2.7 mit/server/ddx/x386/common/x386Priv.h:2.9 *** mit/server/ddx/x386/common/x386Priv.h:2.7 Fri Mar 11 23:38:59 1994 --- mit/server/ddx/x386/common/x386Priv.h Fri Mar 11 23:38:59 1994 *************** *** 1,5 **** /* ! * $XFree86: mit/server/ddx/x386/common/x386Priv.h,v 2.7 1993/09/23 15:45:21 dawes Exp $ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * * Permission to use, copy, modify, distribute, and sell this software and its --- 1,5 ---- /* ! * $XFree86: mit/server/ddx/x386/common/x386Priv.h,v 2.9 1994/02/10 21:25:31 dawes Exp $ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * * Permission to use, copy, modify, distribute, and sell this software and its *************** *** 26,31 **** --- 26,32 ---- #ifndef _X386PRIV_H #define _X386PRIV_H + #include "xf86_OSlib.h" typedef struct { *************** *** 62,67 **** --- 63,69 ---- Bool modeSwitchLock; Bool serverNumLock; Bool composeLock; + Bool vtSysreq; /* pointer part */ DevicePtr pPointer; *************** *** 82,90 **** int emulateState; /* automata state for 2 button mode */ Bool emulate3Buttons; Bool chordMiddle; ! #if defined(SYSV386) || defined(linux) || defined(__386BSD__) ! Bool clearDTR; /* Clear DTR after opening mouse dev */ ! #endif /* xque part */ int xqueFd; --- 84,90 ---- int emulateState; /* automata state for 2 button mode */ Bool emulate3Buttons; Bool chordMiddle; ! int mouseFlags; /* Flags to Clear after opening mouse dev */ /* xque part */ int xqueFd; *************** *** 101,110 **** /* graphics part */ Bool sharedMonitor; ScreenPtr currentScreen; ! #if defined(__386BSD__) || defined(_MINIX) int screenFd; /* fd for memory mapped access to vga card */ #endif ! #ifdef __386BSD__ int consType; /* Which console driver? */ #endif #ifdef _MINIX --- 101,110 ---- /* graphics part */ Bool sharedMonitor; ScreenPtr currentScreen; ! #if defined(__BSD__) || defined(_MINIX) int screenFd; /* fd for memory mapped access to vga card */ #endif ! #ifdef __BSD__ int consType; /* Which console driver? */ #endif #ifdef _MINIX *************** *** 128,139 **** #define XCOMP ((unsigned long) 0x00008000) /* 386BSD console driver types (consType) */ ! #ifdef __386BSD__ #define PCCONS 0 #define CODRV011 1 #define CODRV01X 2 #define SYSCONS 8 #endif extern int x386ScreenIndex; --- 128,143 ---- #define XCOMP ((unsigned long) 0x00008000) /* 386BSD console driver types (consType) */ ! #ifdef __BSD__ #define PCCONS 0 #define CODRV011 1 #define CODRV01X 2 #define SYSCONS 8 #endif + + /* Values of x386Info.mouseFlags */ + #define MF_CLEAR_DTR 1 + #define MF_CLEAR_RTS 2 extern int x386ScreenIndex; diff -c mit/server/ddx/x386/common/xf86_Config.h:2.7 mit/server/ddx/x386/common/xf86_Config.h:2.11 *** mit/server/ddx/x386/common/xf86_Config.h:2.7 Fri Mar 11 23:39:00 1994 --- mit/server/ddx/x386/common/xf86_Config.h Fri Mar 11 23:39:00 1994 *************** *** 23,29 **** * */ ! /* $XFree86: mit/server/ddx/x386/common/xf86_Config.h,v 2.7 1993/10/07 13:56:00 dawes Exp $ */ #ifndef XCONFIG_FLAGS_ONLY --- 23,29 ---- * */ ! /* $XFree86: mit/server/ddx/x386/common/xf86_Config.h,v 2.11 1994/02/10 21:25:33 dawes Exp $ */ #ifndef XCONFIG_FLAGS_ONLY *************** *** 135,140 **** --- 135,141 ---- #define RIGHTALT 6 #define SCROLLLOCK 7 #define RIGHTCTL 8 + #define VTSYSREQ 9 #ifdef INIT_CONFIG static SymTabRec KeyboardTab[] = { *************** *** 148,153 **** --- 149,155 ---- { RIGHTALT, "altgr" }, { SCROLLLOCK, "scrolllock" }, { RIGHTCTL, "rightctl" }, + { VTSYSREQ, "vtsysreq" }, { -1, "" }, }; #endif /* INIT_CONFIG */ *************** *** 184,190 **** #define BAUDRATE 1 #define SAMPLERATE 2 #define CLEARDTR 3 ! #define CHORDMIDDLE 4 #ifdef INIT_CONFIG static SymTabRec MouseTab[] = { --- 186,193 ---- #define BAUDRATE 1 #define SAMPLERATE 2 #define CLEARDTR 3 ! #define CLEARRTS 4 ! #define CHORDMIDDLE 5 #ifdef INIT_CONFIG static SymTabRec MouseTab[] = { *************** *** 192,197 **** --- 195,201 ---- { EMULATE3, "emulate3buttons" }, { SAMPLERATE, "samplerate" }, { CLEARDTR, "cleardtr" }, + { CLEARRTS, "clearrts" }, { CHORDMIDDLE,"chordmiddle" }, { -1, "" }, }; *************** *** 220,225 **** --- 224,230 ---- #define BIOSBASE 22 #define BLACK 23 #define WHITE 24 + #define MEMBASE 25 #ifdef INIT_CONFIG static SymTabRec GraphicsTab[] = { *************** *** 245,250 **** --- 250,256 ---- { BIOSBASE, "biosbase" }, { BLACK, "black" }, { WHITE, "white" }, + { MEMBASE, "membase" }, { -1, "" }, }; #endif /* INIT_CONFIG */ *************** *** 255,260 **** --- 261,267 ---- #define NHSYNC 2 #define PVSYNC 3 #define NVSYNC 4 + #define CSYNC 5 #ifdef INIT_CONFIG static SymTabRec TimingTab[] = { *************** *** 263,268 **** --- 270,276 ---- { NHSYNC, "-hsync"}, { PVSYNC, "+vsync"}, { NVSYNC, "-vsync"}, + { CSYNC, "composite"}, { -1, "" }, }; #endif /* INIT_CONFIG */ diff -c /dev/null mit/server/ddx/x386/common/xf86_KbdLnx.c:2.3 *** /dev/null Fri Mar 11 23:39:00 1994 --- mit/server/ddx/x386/common/xf86_KbdLnx.c Fri Mar 11 23:39:01 1994 *************** *** 0 **** --- 1,583 ---- + /* + * Linux version of keymapping setup. The kernel (since 0.99.14) has support + * for fully remapping the keyboard, but there are some differences between + * the Linux map and the SVR4 map (esp. in the extended keycodes). We also + * remove the restriction on what keycodes can be remapped. + * Orest Zborowski. + */ + /* + * $XFree86: mit/server/ddx/x386/common/xf86_KbdLnx.c,v 2.3 1994/03/11 03:04:58 dawes Exp $ + * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, 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 Thomas Roell not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Thomas Roell makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * $Header: /proj/X11/mit/server/ddx/x386/RCS/x386Kbd.c,v 1.1 1991/06/02 22:36:16 root Exp $ + */ + + #include "X.h" + #include "Xmd.h" + #include "input.h" + #include "scrnintstr.h" + + #include "compiler.h" + + #include "x386Procs.h" + #include "xf86_OSlib.h" + #include "atKeynames.h" + #include "xf86_Config.h" + + #include "x386Keymap.h" + + + /* + * LegalModifier -- + * determine whether a key is a legal modifier key, i.e send a + * press/release sequence. + */ + + /*ARGSUSED*/ + Bool + LegalModifier(key) + int key; + { + return (TRUE); + } + + /* + * x386KbdGetMapping -- + * Get the national keyboard mapping. The keyboard type is set, a new map + * and the modifiermap is computed. + */ + + static void readKernelMapping(KeySymsPtr pKeySyms, CARD8 *pModMap); + + void + x386KbdGetMapping (pKeySyms, pModMap) + KeySymsPtr pKeySyms; + CARD8 *pModMap; + { + KeySym *k; + char type; + int i, j; + + readKernelMapping(pKeySyms, pModMap); + + /* + * Apply the special key mapping specified in Xconfig + */ + for (k = map, i = MIN_KEYCODE; + i < (NUM_KEYCODES + MIN_KEYCODE); + i++, k += 4) { + switch (k[0]) { + case XK_Alt_L: + j = K_INDEX_LEFTALT; + break; + case XK_Alt_R: + j = K_INDEX_RIGHTALT; + break; + case XK_Scroll_Lock: + j = K_INDEX_SCROLLLOCK; + break; + case XK_Control_R: + j = K_INDEX_RIGHTCTL; + break; + default: + j = -1; + } + if (j >= 0) + switch (x386Info.specialKeyMap[j]) { + case K_META: + if (k[0] == XK_Alt_R) + k[1] = XK_Meta_R; + else { + k[0] = XK_Alt_L; + k[1] = XK_Meta_L; + } + break; + case K_COMPOSE: + k[0] = XK_Multi_key; + break; + case K_MODESHIFT: + k[0] = XK_Mode_switch; + k[1] = NoSymbol; + break; + case K_MODELOCK: + k[0] = XK_Mode_switch; + k[1] = XK_Mode_Lock; + break; + case K_SCROLLLOCK: + k[0] = XK_Scroll_Lock; + break; + case K_CONTROL: + k[0] = XK_Control_R; + break; + } + } + + /* + * compute the modifier map + */ + for (i = 0; i < MAP_LENGTH; i++) + pModMap[i] = NoSymbol; /* make sure it is restored */ + + for (k = map, i = MIN_KEYCODE; + i < (NUM_KEYCODES + MIN_KEYCODE); + i++, k += 4) + + switch(*k) { + + case XK_Shift_L: + case XK_Shift_R: + pModMap[i] = ShiftMask; + break; + + case XK_Control_L: + case XK_Control_R: + pModMap[i] = ControlMask; + break; + + case XK_Caps_Lock: + pModMap[i] = LockMask; + break; + + case XK_Alt_L: + case XK_Alt_R: + pModMap[i] = AltMask; + break; + + case XK_Num_Lock: + if (!x386Info.serverNumLock) pModMap[i] = NumLockMask; + break; + + case XK_Scroll_Lock: + pModMap[i] = ScrollLockMask; + break; + + /* kana support */ + case XK_Kana_Lock: + case XK_Kana_Shift: + pModMap[i] = KanaMask; + break; + + /* alternate toggle for multinational support */ + case XK_Mode_switch: + pModMap[i] = AltLangMask; + break; + + } + + x386Info.kbdType = + ioctl(x386Info.consoleFd, KDGKBTYPE, &type) != -1 ? type : KB_101; + + pKeySyms->map = map; + pKeySyms->mapWidth = GLYPHS_PER_KEY; + pKeySyms->minKeyCode = MIN_KEYCODE; + pKeySyms->maxKeyCode = MAX_KEYCODE; + } + + #undef K_COMPOSE + #include + + /* + * As of Linux 0.99.15h, these are not defined in keyboard.h, but + * Andries Brouwer (aeb@cwi.nl), who's done the work in getting key + * mapping in the kernel, promised me they'd be in soon. + */ + #ifndef KG_SHIFTL + + #define KG_SHIFTL 4 + #define KG_SHIFTR 5 + #define KG_CTRLL 6 + #define KG_CTRLR 7 + + #define K_SHIFTL K(KT_SHIFT,KG_SHIFTL) + #define K_SHIFTR K(KT_SHIFT,KG_SHIFTR) + #define K_CTRLL K(KT_SHIFT,KG_CTRLL) + #define K_CTRLR K(KT_SHIFT,KG_CTRLR) + + #endif /* KG_SHIFTL */ + + static KeySym linux_to_x[256] = { + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, XK_Escape, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + XK_space, XK_exclam, XK_quotedbl, XK_numbersign, + XK_dollar, XK_percent, XK_ampersand, XK_apostrophe, + XK_parenleft, XK_parenright, XK_asterisk, XK_plus, + XK_comma, XK_minus, XK_period, XK_slash, + XK_0, XK_1, XK_2, XK_3, + XK_4, XK_5, XK_6, XK_7, + XK_8, XK_9, XK_colon, XK_semicolon, + XK_less, XK_equal, XK_greater, XK_question, + XK_at, XK_A, XK_B, XK_C, + XK_D, XK_E, XK_F, XK_G, + XK_H, XK_I, XK_J, XK_K, + XK_L, XK_M, XK_N, XK_O, + XK_P, XK_Q, XK_R, XK_S, + XK_T, XK_U, XK_V, XK_W, + XK_X, XK_Y, XK_Z, XK_bracketleft, + XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore, + XK_grave, XK_a, XK_b, XK_c, + XK_d, XK_e, XK_f, XK_g, + XK_h, XK_i, XK_j, XK_k, + XK_l, XK_m, XK_n, XK_o, + XK_p, XK_q, XK_r, XK_s, + XK_t, XK_u, XK_v, XK_w, + XK_x, XK_y, XK_z, XK_braceleft, + XK_bar, XK_braceright, XK_asciitilde, XK_Delete, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + XK_nobreakspace,XK_exclamdown, XK_cent, XK_sterling, + XK_currency, XK_yen, XK_brokenbar, XK_section, + XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft, + XK_notsign, XK_hyphen, XK_registered, XK_macron, + XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior, + XK_acute, XK_mu, XK_paragraph, XK_periodcentered, + XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright, + XK_onequarter, XK_onehalf, XK_threequarters,XK_questiondown, + XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde, + XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla, + XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis, + XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis, + XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute, + XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply, + XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex, + XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp, + XK_agrave, XK_aacute, XK_acircumflex, XK_atilde, + XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla, + XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis, + XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis, + XK_eth, XK_ntilde, XK_ograve, XK_oacute, + XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division, + XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex, + XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis + }; + + /* + * Maps the AT keycodes to Linux keycodes + */ + static unsigned char at2lnx[] = + { + 0x01, /* KEY_Escape */ 0x02, /* KEY_1 */ + 0x03, /* KEY_2 */ 0x04, /* KEY_3 */ + 0x05, /* KEY_4 */ 0x06, /* KEY_5 */ + 0x07, /* KEY_6 */ 0x08, /* KEY_7 */ + 0x09, /* KEY_8 */ 0x0a, /* KEY_9 */ + 0x0b, /* KEY_0 */ 0x0c, /* KEY_Minus */ + 0x0d, /* KEY_Equal */ 0x0e, /* KEY_BackSpace */ + 0x0f, /* KEY_Tab */ 0x10, /* KEY_Q */ + 0x11, /* KEY_W */ 0x12, /* KEY_E */ + 0x13, /* KEY_R */ 0x14, /* KEY_T */ + 0x15, /* KEY_Y */ 0x16, /* KEY_U */ + 0x17, /* KEY_I */ 0x18, /* KEY_O */ + 0x19, /* KEY_P */ 0x1a, /* KEY_LBrace */ + 0x1b, /* KEY_RBrace */ 0x1c, /* KEY_Enter */ + 0x1d, /* KEY_LCtrl */ 0x1e, /* KEY_A */ + 0x1f, /* KEY_S */ 0x20, /* KEY_D */ + 0x21, /* KEY_F */ 0x22, /* KEY_G */ + 0x23, /* KEY_H */ 0x24, /* KEY_J */ + 0x25, /* KEY_K */ 0x26, /* KEY_L */ + 0x27, /* KEY_SemiColon */ 0x28, /* KEY_Quote */ + 0x29, /* KEY_Tilde */ 0x2a, /* KEY_ShiftL */ + 0x2b, /* KEY_BSlash */ 0x2c, /* KEY_Z */ + 0x2d, /* KEY_X */ 0x2e, /* KEY_C */ + 0x2f, /* KEY_V */ 0x30, /* KEY_B */ + 0x31, /* KEY_N */ 0x32, /* KEY_M */ + 0x33, /* KEY_Comma */ 0x34, /* KEY_Period */ + 0x35, /* KEY_Slash */ 0x36, /* KEY_ShiftR */ + 0x37, /* KEY_KP_Multiply */ 0x38, /* KEY_Alt */ + 0x39, /* KEY_Space */ 0x3a, /* KEY_CapsLock */ + 0x3b, /* KEY_F1 */ 0x3c, /* KEY_F2 */ + 0x3d, /* KEY_F3 */ 0x3e, /* KEY_F4 */ + 0x3f, /* KEY_F5 */ 0x40, /* KEY_F6 */ + 0x41, /* KEY_F7 */ 0x42, /* KEY_F8 */ + 0x43, /* KEY_F9 */ 0x44, /* KEY_F10 */ + 0x45, /* KEY_NumLock */ 0x46, /* KEY_ScrollLock */ + 0x47, /* KEY_KP_7 */ 0x48, /* KEY_KP_8 */ + 0x49, /* KEY_KP_9 */ 0x4a, /* KEY_KP_Minus */ + 0x4b, /* KEY_KP_4 */ 0x4c, /* KEY_KP_5 */ + 0x4d, /* KEY_KP_6 */ 0x4e, /* KEY_KP_Plus */ + 0x4f, /* KEY_KP_1 */ 0x50, /* KEY_KP_2 */ + 0x51, /* KEY_KP_3 */ 0x52, /* KEY_KP_0 */ + 0x53, /* KEY_KP_Decimal */ 0x54, /* KEY_SysReqest */ + 0x55, /* unused */ 0x56, /* KEY_Less */ + 0x57, /* KEY_F11 */ 0x58, /* KEY_F12 */ + 0x66, /* KEY_Home */ 0x67, /* KEY_Up */ + 0x68, /* KEY_PgUp */ 0x69, /* KEY_Left */ + 0x5d, /* KEY_Begin */ 0x6a, /* KEY_Right */ + 0x6b, /* KEY_End */ 0x6c, /* KEY_Down */ + 0x6d, /* KEY_PgDown */ 0x6e, /* KEY_Insert */ + 0x6f, /* KEY_Delete */ 0x60, /* KEY_KP_Enter */ + 0x61, /* KEY_RCtrl */ 0x77, /* KEY_Pause */ + 0x63, /* KEY_Print */ 0x62, /* KEY_KP_Divide */ + 0x64, /* KEY_AltLang */ 0x65 /* KEY_Break */ + }; + #define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0])) + + static void + readKernelMapping(KeySymsPtr pKeySyms, CARD8 *pModMap) + { + KeySym *k; + char type; + int i, j; + static unsigned char tbl[GLYPHS_PER_KEY] = + { + 0, /* unshifted */ + 1, /* shifted */ + 0, /* modeswitch unshifted */ + 0 /* modeswitch shifted */ + }; + + for (k = map, i = GLYPHS_PER_KEY * NUM_KEYCODES; i--; ) + *k++ = NoSymbol; + + /* + * Read the mapping from the kernel. + * Since we're still using the XFree86 scancode->AT keycode mapping + * routines, we need to convert the AT keycodes to Linux keycodes, + * then translate the Linux keysyms into X keysyms. + * + * First, figure out which tables to use for the modeswitch columns + * above, from the Xconfig fields. + */ + if (x386Info.specialKeyMap[K_INDEX_RIGHTCTL] == K_MODESHIFT || + x386Info.specialKeyMap[K_INDEX_RIGHTCTL] == K_MODELOCK) + tbl[2] = 4; /* control */ + else if (x386Info.specialKeyMap[K_INDEX_RIGHTALT] == K_MODESHIFT || + x386Info.specialKeyMap[K_INDEX_RIGHTALT] == K_MODELOCK) + tbl[2] = 2; /* AltGr */ + else + tbl[2] = 8; /* alt */ + tbl[3] = tbl[2] | 1; + + for (i = 0, k = map+GLYPHS_PER_KEY; i < NUM_AT2LNX; ++i) + { + struct kbentry kbe; + int j; + + kbe.kb_index = at2lnx[i]; + for (j = 0; j < GLYPHS_PER_KEY; ++j, ++k) + { + unsigned short kval; + + kbe.kb_table = tbl[j]; + if (ioctl(x386Info.consoleFd, KDGKBENT, &kbe)) + continue; + + kval = KVAL(kbe.kb_value); + switch (KTYP(kbe.kb_value)) + { + case KT_LATIN: + case KT_LETTER: + *k = linux_to_x[kval]; + break; + + case KT_FN: + if (kval <= 19) + *k = XK_F1 + kval; + else switch (kbe.kb_value) + { + case K_FIND: + *k = XK_Home; /* or XK_Find */ + break; + case K_INSERT: + *k = XK_Insert; + break; + case K_REMOVE: + *k = XK_Delete; + break; + case K_SELECT: + *k = XK_End; /* or XK_Select */ + break; + case K_PGUP: + *k = XK_Prior; + break; + case K_PGDN: + *k = XK_Next; + break; + case K_HELP: + *k = XK_Help; + break; + case K_DO: + *k = XK_Execute; + break; + case K_PAUSE: + *k = XK_Pause; + break; + case K_MACRO: + *k = XK_Menu; + break; + default: + break; + } + break; + + case KT_SPEC: + switch (kbe.kb_value) + { + case K_ENTER: + *k = XK_Return; + break; + case K_BREAK: + *k = XK_Break; + break; + case K_CAPS: + *k = XK_Caps_Lock; + break; + case K_NUM: + *k = XK_Num_Lock; + break; + case K_HOLD: + *k = XK_Scroll_Lock; + break; + case K_COMPOSE: + *k = XK_Multi_key; + break; + default: + break; + } + break; + + case KT_PAD: + switch (kbe.kb_value) + { + case K_PPLUS: + *k = XK_KP_Add; + break; + case K_PMINUS: + *k = XK_KP_Subtract; + break; + case K_PSTAR: + *k = XK_KP_Multiply; + break; + case K_PSLASH: + *k = XK_KP_Divide; + break; + case K_PENTER: + *k = XK_KP_Enter; + break; + case K_PCOMMA: + *k = XK_KP_Separator; + break; + case K_PDOT: + *k = XK_KP_Decimal; + break; + default: + if (kval <= 9) + *k = XK_KP_0 + kval; + break; + } + break; + + /* + * KT_DEAD keys are for accelerated diacritical creation. + * We should generate "XK_Compose XK_xxx" but can only map to one + * keysym. + */ + case KT_DEAD: + break; + + case KT_CUR: + switch (kbe.kb_value) + { + case K_DOWN: + *k = XK_Down; + break; + case K_LEFT: + *k = XK_Left; + break; + case K_RIGHT: + *k = XK_Right; + break; + case K_UP: + *k = XK_Up; + break; + } + break; + + case KT_SHIFT: + switch (kbe.kb_value) + { + case K_ALTGR: + *k = XK_Alt_R; + break; + case K_ALT: + *k = (kbe.kb_index == 0x64 ? + XK_Alt_R : XK_Alt_L); + break; + case K_CTRL: + *k = (kbe.kb_index == 0x61 ? + XK_Control_R : XK_Control_L); + break; + case K_CTRLL: + *k = XK_Control_L; + break; + case K_CTRLR: + *k = XK_Control_R; + break; + case K_SHIFT: + *k = (kbe.kb_index == 0x36 ? + XK_Shift_R : XK_Shift_L); + break; + case K_SHIFTL: + *k = XK_Shift_L; + break; + case K_SHIFTR: + *k = XK_Shift_R; + break; + default: + break; + } + break; + + /* + * KT_ASCII keys accumulate a 3 digit decimal number that gets + * emitted when the shift state changes. We can't emulate that. + */ + case KT_ASCII: + break; + + case KT_LOCK: + if (kbe.kb_value == K_SHIFTLOCK) + *k = XK_Shift_Lock; + break; + + default: + break; + } + } + + if (k[-1] == k[-2]) k[-1] = NoSymbol; + if (k[-2] == k[-3]) k[-2] = NoSymbol; + if (k[-3] == k[-4]) k[-3] = NoSymbol; + if (k[-4] == k[-2] && k[-3] == k[-1]) k[-2] = k[-1] = NoSymbol; + if (k[-1] == k[-4] && k[-2] == k[-3] && k[-2] == NoSymbol) k[-1] =NoSymbol; + } + } diff -c mit/server/ddx/x386/common/xf86_Mouse.c:2.5 mit/server/ddx/x386/common/xf86_Mouse.c:2.7 *** mit/server/ddx/x386/common/xf86_Mouse.c:2.5 Fri Mar 11 23:39:02 1994 --- mit/server/ddx/x386/common/xf86_Mouse.c Fri Mar 11 23:39:02 1994 *************** *** 1,5 **** /* ! * $XFree86: mit/server/ddx/x386/common/xf86_Mouse.c,v 2.5 1993/08/28 07:52:44 dawes Exp $ * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * Copyright 1993 by David Dawes --- 1,5 ---- /* ! * $XFree86: mit/server/ddx/x386/common/xf86_Mouse.c,v 2.7 1994/02/10 21:25:34 dawes Exp $ * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * Copyright 1993 by David Dawes *************** *** 226,235 **** } #ifdef CLEARDTR_SUPPORT ! if (x386Info.mseType == P_MSC && x386Info.clearDTR) { ! int val = 0; ! ioctl(x386Info.mseFd, TIOCMSET, &val); } #endif #endif /* !MOUSE_PROTOCOL_IN_KERNEL || MACH386 */ --- 226,240 ---- } #ifdef CLEARDTR_SUPPORT ! if (x386Info.mseType == P_MSC && (x386Info.mouseFlags & MF_CLEAR_DTR)) { ! int val = TIOCM_DTR; ! ioctl(x386Info.mseFd, TIOCMBIC, &val); ! } ! if (x386Info.mseType == P_MSC && (x386Info.mouseFlags & MF_CLEAR_RTS)) ! { ! int val = TIOCM_RTS; ! ioctl(x386Info.mseFd, TIOCMBIC, &val); } #endif #endif /* !MOUSE_PROTOCOL_IN_KERNEL || MACH386 */ diff -c mit/server/ddx/x386/common/xf86_Option.h:2.15 mit/server/ddx/x386/common/xf86_Option.h:2.27 *** mit/server/ddx/x386/common/xf86_Option.h:2.15 Fri Mar 11 23:39:02 1994 --- mit/server/ddx/x386/common/xf86_Option.h Fri Mar 11 23:39:02 1994 *************** *** 21,27 **** * */ ! /* $XFree86: mit/server/ddx/x386/common/xf86_Option.h,v 2.15 1993/10/16 17:31:31 dawes Exp $ */ #ifndef _XF86_OPTION_H #define _XF86_OPTION_H --- 21,27 ---- * */ ! /* $XFree86: mit/server/ddx/x386/common/xf86_Option.h,v 2.27 1994/03/07 16:32:39 dawes Exp $ */ #ifndef _XF86_OPTION_H #define _XF86_OPTION_H *************** *** 43,76 **** /* * Option flags. Define these in numeric order. */ #define OPTION_LEGEND 0 /* Legend board with 32 clocks */ #define OPTION_SWAP_HIBIT 1 /* WD90Cxx-swap high-order clock sel bit */ ! #define OPTION_INTERN_DISP 2 /* Laptops - enable internal display (WD)*/ ! #define OPTION_EXTERN_DISP 3 /* Laptops - enable external display (WD)*/ ! #define OPTION_NOLINEAR_MODE 4 /* chipset has broken linear access mode */ ! #define OPTION_8CLKS 5 /* Probe for 8 clocks instead of 4 (PVGA1) */ ! #define OPTION_16CLKS 6 /* probe for 16 clocks instead of 8 */ ! #define OPTION_PROBE_CLKS 7 /* Force clock probe for cards where a set of preset clocks is used */ ! #define OPTION_HIBIT_HIGH 8 /* Initial state of high order clock bit */ ! #define OPTION_HIBIT_LOW 9 ! #define OPTION_FAST_DRAM 10 /* reduce DRAM access time (for ET4000) */ ! #define OPTION_SLOW_DRAM 11 /* Allow for slow DRAM (for Cirrus) */ ! #define OPTION_MEM_ACCESS 12 /* prevent direct access to video ram from being automatically disabled */ ! #define OPTION_NO_MEM_ACCESS 13 /* Unable to access video ram directly */ ! #define OPTION_NOACCEL 14 /* Disable accel support in SVGA server */ ! #define OPTION_HW_CURSOR 15 /* Turn on HW cursor */ ! #define OPTION_SW_CURSOR 16 /* Turn off HW cursor (Mach32) */ ! #define OPTION_BT485 17 /* Has BrookTree Bt485 RAMDAC */ ! #define OPTION_NO_BT485 18 /* Override Bt485 RAMDAC probe */ ! #define OPTION_BT485_CURS 19 /* Override Bt485 RAMDAC probe */ ! #define OPTION_SHOWCACHE 20 /* Allow cache to be seen (S3) */ #define CLOCK_OPTION_PROGRAMABLE 0 /* has a programable clock */ #define CLOCK_OPTION_ICD2061A 1 /* use ICD 2061A programable clocks */ #define CLOCK_OPTION_ICD2061ASL 2 /* use slow ICD 2061A programable clocks */ ! /* * Table to