diff options
author | dawes <dawes> | 2000-12-21 19:23:26 +0000 |
---|---|---|
committer | dawes <dawes> | 2000-12-21 19:23:26 +0000 |
commit | 856c96701fa6c514447af12b4b881f762e59767c (patch) | |
tree | 14a18bab24f9003a9c4c50457bbc57528b30b153 /xc/programs/Xserver/hw | |
parent | de862f7f2c68c12cbfdb72a72c4ea6e97c968f90 (diff) |
Import of XFree86 4.0.2X_4_0_2
Diffstat (limited to 'xc/programs/Xserver/hw')
326 files changed, 13712 insertions, 4906 deletions
diff --git a/xc/programs/Xserver/hw/darwin/Imakefile b/xc/programs/Xserver/hw/darwin/Imakefile index 9039d531b..38ccefbdf 100644 --- a/xc/programs/Xserver/hw/darwin/Imakefile +++ b/xc/programs/Xserver/hw/darwin/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.3 2000/12/01 19:47:37 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.4 2000/12/11 20:29:38 dawes Exp $ #include <Server.tmpl> #define IHaveSubdirs @@ -27,6 +27,7 @@ DEFINES = $(CUSTOMVERDEF) NormalLibraryObjectRule() NormalLibraryTarget(darwin,$(OBJS)) +CppManTarget(Xdarwin,) InstallManPage(Xdarwin,$(MANDIR)) DependTarget() diff --git a/xc/programs/Xserver/hw/darwin/Xdarwin.cpp b/xc/programs/Xserver/hw/darwin/Xdarwin.cpp new file mode 100644 index 000000000..2bdec2187 --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/Xdarwin.cpp @@ -0,0 +1,69 @@ +.\" $XFree86: xc/programs/Xserver/hw/darwin/Xdarwin.cpp,v 1.1 2000/12/11 20:29:39 dawes Exp $ +.\" +.TH XDARWIN 1 "Release 4.0.2" "XFree86" +.SH NAME +Xdarwin \- X window system server for Darwin operating system +.SH SYNOPSIS +.B Xdarwin +[ options ] ... +.SH DESCRIPTION +.I Xdarwin +is the window server for Version 11 of the X window system on the Darwin +operating system. It uses IOKit services to accesss the display framebuffer, +mouse and keyboard and to provide a layer of hardware abstraction. +.I Xdarwin +will normally be started by the \fIxdm(1)\fP display manager or by a script +that runs the program \fIxinit(1)\fP. +.SH OPTIONS +.PP +In addition to the normal server options described in the \fIXserver(1)\fP +manual page, \fIXdarwin\fP accepts the following command line switches: +.TP 8 +.B \-fakebuttons +Emulates a 3 button mouse using the Command and Option keys. Clicking the +first mouse button while holding down Command will act like clicking +button 2. Holding down Option will simulate button 3. +.TP 8 +.B \-nofakebuttons +Do not emulate a 3 button mouse. This is the default. +.TP 8 +.B "\-size \fIwidth\fP \fIheight\fP" +Sets the screeen resolution for the X server to use. +.TP 8 +.B "\-depth \fIdepth\fP" +Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits +per pixel are supported. +.TP 8 +.B "\-refresh \fIrate\fP" +Gives the refresh rate to use in Hz. For LCD displays this should be 0. +.TP 8 +.B \-showconfig +Print out the server version and patchlevel. +.TP 8 +.B \-version +Same as \fB\-showconfig\fP. +.SH "SEE ALSO" +.PP +X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1) +.SH BUGS +.I Xdarwin +and this man page still have many limitations. Some of the more obvious +ones are: +.br +- Only one display is supported. +.br +- The display mode can not be changed once the X server has started. +.br +- A screen saver is not supported. +.br +- The X server does not wake from sleep correctly. +.br +- The key repeat rate can not be changed. +.PP +.SH AUTHORS +Original Port to Mac OS X Server - John Carmack +.br +Port to Darwin 1.0 - Dave Zarzycki +.br +Improvements and bug fixes - Torrey T. Lyons + diff --git a/xc/programs/Xserver/hw/darwin/utils/README.txt b/xc/programs/Xserver/hw/darwin/utils/README.txt index 6baff652d..94d61b1f0 100644 --- a/xc/programs/Xserver/hw/darwin/utils/README.txt +++ b/xc/programs/Xserver/hw/darwin/utils/README.txt @@ -1,11 +1,11 @@ dumpkeymap - Diagnostic dump and detailed description of .keymapping files -Version 3 +Version 4 Copyright (C)1999,2000 by Eric Sunshine <sunshine@sunshineco.com> -Eric Sunshine, November 28, 2000 +Eric Sunshine, 1 December 2000 OVERVIEW - +======== This package contains the diagnostic utility dumpkeymap, as well as highly detailed documentation describing the internal layout of the Apple/NeXT .keymapping file. @@ -39,8 +39,9 @@ with the Unix `man' command: % man dumpkeymap -COMPILATION +COMPILATION +=========== MacOS/X, Darwin cc -Wall -o dumpkeymap dumpkeymap.c -framework IOKit @@ -65,8 +66,9 @@ For example, to compile for Linux: gcc -Wall -DDUMPKEYMAP_FILE_ONLY -o dumpkeymap dumpkeymap.c -INSTALLATION +INSTALLATION +============ Install the dumpkeymap executable image in a location mentioned in the PATH environment variable. Typicall locations for executable files are: @@ -93,8 +95,9 @@ Typical locations for manual pages on OpenStep and NextStep are: /LocalLibrary/Documentation/ManPages/man1 /LocalDeveloper/Documentation/ManPages/man1 -CONCLUSION +CONCLUSION +========== This program and its accompanying documentation were written by Eric Sunshine and are copyright (C)1999,2000 by Eric Sunshine <sunshine@sunshineco.com>. @@ -105,4 +108,4 @@ of the NeXT .keymapping file. -$XFree86: xc/programs/Xserver/hw/darwin/utils/README.txt,v 1.1 2000/12/01 19:47:39 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/darwin/utils/README.txt,v 1.2 2000/12/05 21:18:34 dawes Exp $ diff --git a/xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c b/xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c index 22fcf6179..c1b6ea15b 100644 --- a/xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c +++ b/xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c @@ -1,4 +1,4 @@ -// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c,v 1.2 2000/12/04 20:21:18 dawes Exp $ +// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c,v 1.3 2000/12/05 21:18:34 dawes Exp $ //============================================================================= // // Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com> @@ -83,7 +83,16 @@ // // HISTORY // -// 2000/11/28 Eric Sunshine <sunshine@sunshineco.com> +// v4 2000/12/01 Eric Sunshine <sunshine@sunshineco.com> +// Updated manual page to work with `rman', the `man' to `HTML' +// translator. Unfortunately, however, rman is missing important +// roff features such as diversions, indentation, and tab stops, +// and is also hideously buggy, so getting the manual to work with +// rman required quite a few work-arounds. +// The manual page has now been tested with nroff (plain text), troff +// (PostScript, etc.), groff (PostScript), and rman (HTML, etc.) +// +// v3 2000/11/28 Eric Sunshine <sunshine@sunshineco.com> // Considerably expanded the documentation. // Augmented the existing description of .keymapping internals. // Added these new documentation topics: @@ -105,7 +114,7 @@ // Apple/NeXT-specific API. // Added a README file. // -// 2000/11/13 Eric Sunshine <sunshine@sunshineco.com> +// v2 2000/11/13 Eric Sunshine <sunshine@sunshineco.com> // Converted from C++ to plain-C. // Now parses and takes into account the "number-size" flag stored // with each key map. This flag indicates the size, in bytes, of @@ -126,7 +135,7 @@ // Now published under the formal BSD license rather than a // home-grown license. // -// 1999/09/08 Eric Sunshine <sunshine@sunshineco.com> +// v1 1999/09/08 Eric Sunshine <sunshine@sunshineco.com> // Created. //----------------------------------------------------------------------------- #include <ctype.h> @@ -138,7 +147,7 @@ #endif #define PROG_NAME "dumpkeymap" -#define PROG_VERSION "3" +#define PROG_VERSION "4" #define AUTHOR_NAME "Eric Sunshine" #define AUTHOR_EMAIL "sunshine@sunshineco.com" #define AUTHOR_INFO AUTHOR_NAME " <" AUTHOR_EMAIL ">" diff --git a/xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man b/xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man index 3f0d9d6eb..2ad6d54d2 100644 --- a/xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man +++ b/xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man @@ -1,113 +1,163 @@ -.\"============================================================================ -.\" -.\" Manual page for `dumpkeymap'. -.\" -.\" Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com> -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions are met: -.\" -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN -.\" NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -.\" TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -.\" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -.\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\"============================================================================ -.\" -.\" $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man,v 1.1 2000/12/01 19:47:39 dawes Exp $ -.\" -.\"---------------------------------------------------------------------------- -.\" Annotation Macros -- Facilitate creation of annotated, non-filled blocks -.\" of text. An annotated block is initiated with the `AS' macro. Each -.\" annotated, non-filled line within the block must be introduced with -.\" the `AN' macro which takes two arguments. The first argument is the -.\" detail text to be annotated, and the second is the annotation itself. -.\" The block should be terminated with the `AE' macro which actually -.\" emits the fully annotated block. All anotations within the block are -.\" aligned at the same horizontal position. This position is guaranteed -.\" to be just to the right of the widest detail line. Finally, the `AZ' -.\" macro, which takes a single argument, can be used to to insert a -.\" non-annotated line into the block which does not play a part in the -.\" calculation of the horizontal annotation alignment. -.\" Implementation Note -.\" These macros utilize a diversion (named `AD'). Since the prevailing -.\" indentation is stored along with the diverted text, we must muck with -.\" the indentation level in order to prevent the indentation from being -.\" applied to the text a second time when `AD' is finally emitted. -.\"---------------------------------------------------------------------------- +.ig +//============================================================================= +// +// Manual page for `dumpkeymap'. +// +// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +//============================================================================= +// +// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.man,v 1.2 2000/12/05 21:18:34 dawes Exp $ +// +.. +.ig +//----------------------------------------------------------------------------- +// Local identification information. +//----------------------------------------------------------------------------- +.. +.nr VE 4 \" Version number +.TH DUMPKEYMAP 1 "v\n(VE \-\- 1 December 2000" "Version \n(VE" +.de UP +1 December 2000 +.. +.ig +//----------------------------------------------------------------------------- +// Annotation Macros +// ----------------- +// Facilitate creation of annotated, non-filled blocks of text. An +// annotated block is initiated with the `AS' macro. Each annotated, +// non-filled line within the block must be introduced with the `AN' macro +// which takes three arguments. The first argument is the detail text to +// be annotated. The second is a string of spaces used to align the +// annotations by certain (broken) roff interpreters which fail to +// implement the proper set of roff commands (such as diversions, +// indentation, and tab stops). It is assumed that the spaces will be +// used with fixed-point font. The third argument is the annotation +// itself. The block should be terminated with the `AE' macro. For all +// roff interpreters which properly implement diversions, indentation, and +// tab stops, all anotations within the block are automatically aligned at +// the same horizontal position. This position is guaranteed to be just +// to the right of the widest `AN' detail line. For broken roff +// interpreters, such as `rman', the string of spaces from the second +// argument are used to align the annotations. Finally, the `AZ' macro, +// which takes a single argument, can be used to to insert a non-annotated +// line into the block which does not play a part in the calculation of +// the horizontal annotation alignment. +// +// Implementation Notes +// -------------------- +// *1* These macros utilize a diversion (named `AD'). Since the prevailing +// indentation is stored along with the diverted text, we must muck with +// the indentation level in order to prevent the indentation from being +// applied to the text a second time when `AD' is finally emitted. +// +// *2* Unfortunately, `.if' strips leading whitespace from following text, so +// `AN' uses \& to preserve the whitespace. +// +// *3* This manual page has been tested for proper formatting with troff, +// groff, nroff and rman (the `man' to `HTML' converter). Unfortunately, +// rman fails to implement many useful features such as diversions, +// indentation, and tab stops, and is also hideously buggy. Furthermore +// it identifies itself as nroff and fails to provide any further +// identification, so there is no way to create macros which specifically +// work around its limitations. Following is a list of several bugs in +// rman which the implementation of these macros must avoid: +// o Fails with multi-line conditionals within macros. +// o Fails on macro definition within multi-line conditionals. +// o Fails when macro arguments are not delimited by exactly 1 space. +// o String definition `.ds' ignores the value; uses empty "" instead. +// As a consequence of these problems, the following macros are written +// using a series of ugly single-line `.if' conditionals rather than the +// more natural multi-line `.if' and `.ie' conditionals. Also, rman fails +// to understand the common idiom of `.\"' to introduce a comment, which +// is why all comments in this file are wrapped in ignore `.ig' blocks. +//----------------------------------------------------------------------------- +.. .de AS -.nr AW 0 -.nr AI \\n(.i -.in -\\n(AI +.if t .nr AW 0 +.if t .nr AI \\n(.i +.if t .in -\\n(AI .nf .. .de AN -.if \w'\\$1'>\\n(AW .nr AW \w'\\$1' -.da AD -\\$1\\t\\$2 -.da +.if t .if \w'\\$1'>\\n(AW .nr AW \w'\\$1' +.if t .da AD +.if t \\&\\$1\\t\\$3 +.if t .da +.if n \\&\\$1 \\$2\\$3 .. .de AZ -.da AD +.if t .da AD \\$1 -.da -\\ +.if t .da .. .de AE -.in +\\n(AIu -.if \\n(AW .ta \\n(AWu+\w'\\(em'u -.AD -.DT -.rm AD -.rm AW +.if t .in +\\n(AIu +.if t .if \\n(AW .ta \\n(AWu+\w'\\(em'u +.if t .AD +.if t .DT +.if t .rm AD +.if t .rm AW .fi .. -.\"---------------------------------------------------------------------------- -.\" Bulleted list macros -- `BG' begins a bulleted list; `BU' delimits -.\" bulleted entries; `BE' ends a bulleted list. -.\"---------------------------------------------------------------------------- +.ig +//----------------------------------------------------------------------------- +// Bulleted list macros -- `BG' begins a bulleted list; `BU' delimits +// bulleted entries; `BE' ends a bulleted list. +//----------------------------------------------------------------------------- +.. .de BG .PP .RS .. .de BU .HP -.ie t \\(bu\\ \\c -.el *\\ \\c +\\(bu\\ \\c .. .de BE .RE .PP .. -.\"---------------------------------------------------------------------------- -.\" Indented paragraph with stylized hanging tag macro. `TG' takes a single -.\" argument and treats it as the hanging tag of the indented paragraph. -.\" The tag is italicized in troff but not in nroff. -.\"---------------------------------------------------------------------------- +.ig +//----------------------------------------------------------------------------- +// Indented paragraph with stylized hanging tag macro. `TG' takes a single +// argument and treats it as the hanging tag of the indented paragraph. +// The tag is italicized in troff but not in nroff. +//----------------------------------------------------------------------------- +.. .de TG .TP .ie t .I "\\$1" .el \\$1 .. -.\"---------------------------------------------------------------------------- -.\" Manual page for `dumpkeymap'. -.\"---------------------------------------------------------------------------- -.TH DUMPKEYMAP 1 "November 2000" "Version 3" +.ig +//----------------------------------------------------------------------------- +// Manual page for `dumpkeymap'. +//----------------------------------------------------------------------------- +.. .SH NAME dumpkeymap \- Dianostic dump of a .keymapping file .SH SYNOPSIS @@ -200,16 +250,16 @@ variable number of device-specific key mappings. .RS .AS .AZ "struct KeyMappingFile {" -.AN " char magic_number[4];" "// `KYM1'" -.AN " DeviceMapping maps[...];" "// Variable number of maps" +.AN " char magic_number[4];" " " "// `KYM1'" +.AN " DeviceMapping maps[...];" "" "// Variable number of maps" .AZ }; .AE .PP .AS .AZ "struct DeviceMapping {" -.AN " dword interface;" "// Interface type" -.AN " dword handler_id;" "// Interface subtype" -.AN " dword map_size;" "// Byte count of `map' (below)" +.AN " dword interface;" " " "// Interface type" +.AN " dword handler_id;" "" "// Interface subtype" +.AN " dword map_size;" " " "// Byte count of `map' (below)" .AN " KeyMapping map;" .AZ }; .AE @@ -256,14 +306,14 @@ structure. .RS .AS .AZ "struct KeyMapping {" -.AN " word number_size;" "// 0=1 byte, non-zero=2 bytes" -.AN " number num_modifier_groups;" "// Modifier groups" +.AN " word number_size;" " " "// 0=1 byte, non-zero=2 bytes" +.AN " number num_modifier_groups;" "" "// Modifier groups" .AZ " ModifierGroup modifier_groups[...];" -.AN " number num_scan_codes;" "// Scan groups" +.AN " number num_scan_codes;" " " "// Scan groups" .AN " ScanGroup scan_table[...];" -.AN " number num_sequence_lists;" "// Sequence lists" +.AN " number num_sequence_lists;" " " "// Sequence lists" .AN " Sequence sequence_lists[...];" -.AN " number num_special_keys;" "// Special keys" +.AN " number num_special_keys;" " " "// Special keys" .AN " SpecialKey special_key[...];" .AZ }; .AE @@ -285,21 +335,21 @@ etc. .RS .AS .AZ "enum Modifier {" -.AN " ALPHALOCK = 0," -.AN " SHIFT," -.AN " CONTROL," -.AN " ALTERNATE," -.AN " COMMAND," -.AN " KEYPAD," -.AN " HELP" +.AZ " ALPHALOCK = 0," +.AZ " SHIFT," +.AZ " CONTROL," +.AZ " ALTERNATE," +.AZ " COMMAND," +.AZ " KEYPAD," +.AZ " HELP" .AZ }; .AE .PP .AS .AZ "struct ModifierGroup {" -.AN " number modifier;" "// A Modifier constant" +.AN " number modifier;" " " "// A Modifier constant" .AN " number num_scan_codes;" -.AN " number scan_codes[...];" "// Variable number of scan codes" +.AN " number scan_codes[...];" "" "// Variable number of scan codes" .AZ }; .AE .RE @@ -320,11 +370,11 @@ code 0, the second represents scan code 1, etc. .RS .AS .AZ "enum ModifierMask {" -.AN " ALPHALOCK_MASK" "= 1 << 0," -.AN " SHIFT_MASK" "= 1 << 1," -.AN " CONTROL_MASK" "= 1 << 2," -.AN " ALTERNATE_MASK" "= 1 << 3," -.AN " CARRIAGE_RETURN_MASK" "= 1 << 4" +.AN " ALPHALOCK_MASK" " " "= 1 << 0," +.AN " SHIFT_MASK" " " "= 1 << 1," +.AN " CONTROL_MASK" " " "= 1 << 2," +.AN " ALTERNATE_MASK" " " "= 1 << 3," +.AN " CARRIAGE_RETURN_MASK" "" "= 1 << 4" .AZ }; .AZ "#define NOT_BOUND 0xff" .AE @@ -414,28 +464,28 @@ KeyMapping::sequence_lists[]. .RS .AS .AZ "enum CharacterSet {" -.AN " ASCII" "= 0x00," -.AN " SYMBOL" "= 0x01," +.AN " ASCII" " " "= 0x00," +.AN " SYMBOL" " " "= 0x01," .AN " ..." -.AN " FUNCTION_KEY" "= 0xfe," -.AN " KEY_SEQUENCE" "= 0xff" +.AN " FUNCTION_KEY" "" "= 0xfe," +.AN " KEY_SEQUENCE" "" "= 0xff" .AZ }; .AE .PP .AS .AZ "struct Character {" -.AN " number set;" "// CharacterSet of generated character" -.AN " number char_code;" "// Actual character generated" +.AN " number set;" " " "// CharacterSet of generated character" +.AN " number char_code;" "" "// Actual character generated" .AZ }; .AE .PP .AS .AZ "enum FunctionKey {" -.AN " F1 = 0x20, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12," -.AN " INSERT, DELETE, HOME, END, PAGE_UP, PAGE_DOWN, PRINT_SCREEN," -.AN " SCROLL_LOCK, PAUSE, SYS_REQUEST, BREAK, RESET, STOP, MENU," -.AN " USER, SYSTEM, PRINT, CLEAR_LINE, CLEAR_DISPLAY, INSERT_LINE," -.AN " DELETE_LINE, INSERT_CHAR, DELETE_CHAR, PREV, NEXT, SELECT" +.AZ " F1 = 0x20, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12," +.AZ " INSERT, DELETE, HOME, END, PAGE_UP, PAGE_DOWN, PRINT_SCREEN," +.AZ " SCROLL_LOCK, PAUSE, SYS_REQUEST, BREAK, RESET, STOP, MENU," +.AZ " USER, SYSTEM, PRINT, CLEAR_LINE, CLEAR_DISPLAY, INSERT_LINE," +.AZ " DELETE_LINE, INSERT_CHAR, DELETE_CHAR, PREV, NEXT, SELECT" .AZ }; .AE .RE @@ -483,22 +533,22 @@ by the WindowServer. In general, events are not generated for special keys. .RS .AS .AZ "enum SpecialKeyType {" -.AN " VOLUME_UP = 0," -.AN " VOLUME_DOWN," -.AN " BRIGHTNESS_UP," -.AN " BRIGHTNESS_DOWN," -.AN " ALPHA_LOCK," -.AN " HELP," -.AN " POWER," -.AN " SECONDARY_ARROW_UP," -.AN " SECONDARY_ARROW_DOWN" +.AZ " VOLUME_UP = 0," +.AZ " VOLUME_DOWN," +.AZ " BRIGHTNESS_UP," +.AZ " BRIGHTNESS_DOWN," +.AZ " ALPHA_LOCK," +.AZ " HELP," +.AZ " POWER," +.AZ " SECONDARY_ARROW_UP," +.AZ " SECONDARY_ARROW_DOWN" .AZ }; .AE .PP .AS .AZ "struct SpecialKey {" -.AN " number type;" "// A SpecialKeyType constant" -.AN " number scan_code;" "// Actual scan code" +.AN " number type;" " " "// A SpecialKeyType constant" +.AN " number scan_code;" "" "// Actual scan code" .AZ }; .AE .RE @@ -949,3 +999,6 @@ effort to reverse engineer the format of the .SM NeXT .I .keymapping file. +.if n .PP +.if n Version \n(VE \-\- +.if n .UP diff --git a/xc/programs/Xserver/hw/kdrive/kdrive.c b/xc/programs/Xserver/hw/kdrive/kdrive.c index 3c81a9781..e3bcb9665 100644 --- a/xc/programs/Xserver/hw/kdrive/kdrive.c +++ b/xc/programs/Xserver/hw/kdrive/kdrive.c @@ -21,7 +21,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/kdrive/kdrive.c,v 1.10 2000/09/27 20:47:36 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/kdrive.c,v 1.11 2000/12/08 22:59:37 keithp Exp $ */ #include "kdrive.h" #ifdef PSEUDO8 @@ -304,12 +304,30 @@ ddxGiveUp () Bool kdDumbDriver; Bool kdSoftCursor; +char * +KdParseFindNext (char *cur, char *delim, char *save, char *last) +{ + while (*cur && !strchr (delim, *cur)) + { + *save++ = *cur++; + } + *save = 0; + *last = *cur; + if (*cur) + cur++; + return cur; +} + void KdParseScreen (KdScreenInfo *screen, char *arg) { char *bpp; + char delim; + char save[1024]; int fb; + int i; + int pixels, mm; screen->dumb = kdDumbDriver; screen->softCursor = kdSoftCursor; @@ -317,55 +335,74 @@ KdParseScreen (KdScreenInfo *screen, kdSoftCursor = FALSE; screen->width = 0; screen->height = 0; + screen->width_mm = 0; + screen->height_mm = 0; screen->rate = 0; for (fb = 0; fb < KD_MAX_FB; fb++) screen->fb[fb].depth = 0; if (!arg) return; - - screen->width = atoi(arg); - arg = strchr (arg, 'x'); - if (!arg) - return; - arg++; - - screen->height = atoi(arg); - arg = strchr (arg, 'x'); - if (!arg) + if (strlen (arg) > sizeof (save)) return; - arg++; - + + for (i = 0; i < 2; i++) + { + arg = KdParseFindNext (arg, "x/", save, &delim); + if (!save[0]) + return; + + pixels = atoi(save); + mm = 0; + + if (delim == '/') + { + arg = KdParseFindNext (arg, "x", save, &delim); + if (!save[0]) + return; + mm = atoi(save); + } + + if (i == 0) + { + screen->width = pixels; + screen->width_mm = mm; + } + else + { + screen->height = pixels; + screen->height_mm = mm; + } + if (delim != 'x') + return; + } + fb = 0; while (fb < KD_MAX_FB) { - screen->fb[fb].depth = atoi(arg); - - bpp = strchr (arg, '/'); - if (bpp) + arg = KdParseFindNext (arg, "x/,", save, &delim); + if (!save[0]) + break; + screen->fb[fb].depth = atoi(save); + if (delim == '/') { - bpp++; - screen->fb[fb].bitsPerPixel = atoi(bpp); - arg = bpp; + arg = KdParseFindNext (arg, "x,", save, &delim); + if (!save[0]) + break; + screen->fb[fb].bitsPerPixel = atoi (save); } else screen->fb[fb].bitsPerPixel = 0; - bpp = strchr (arg, ','); - if (!bpp) + if (delim != ',') break; - arg = bpp+1; fb++; } - arg = strchr (arg, 'x'); - if (!arg) - return; - arg++; - - screen->rate = atoi(arg); - arg = strchr (arg, 'x'); - if (!arg) - return; - arg++; + if (delim == 'x') + { + arg = KdParseFindNext (arg, "x", save, &delim); + if (save[0]) + screen->rate = atoi(save); + } } int @@ -615,7 +652,7 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) if (!fbSetupScreen (pScreen, screen->fb[0].frameBuffer, screen->width, screen->height, - screen->dpix, screen->dpiy, + 75, 75, screen->fb[0].pixelStride, screen->fb[0].bitsPerPixel)) { @@ -648,7 +685,7 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) screen->fb[0].frameBuffer, screen->fb[1].frameBuffer, screen->width, screen->height, - screen->dpix, screen->dpiy, + 75, 75, screen->fb[0].pixelStride, screen->fb[1].pixelStride, screen->fb[0].bitsPerPixel, @@ -664,8 +701,8 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) { if (!fbFinishScreenInit (pScreen, screen->fb[0].frameBuffer, - screen->width, screen->height, - screen->dpix, screen->dpiy, + screen->width, screen->height, + 75, 75, screen->fb[0].pixelStride, screen->fb[0].bitsPerPixel)) { @@ -674,6 +711,15 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) } /* + * Fix screen sizes; for some reason mi takes dpi instead of mm. + * Rounding errors are annoying + */ + if (screen->width_mm) + pScreen->mmWidth = screen->width_mm; + if (screen->height_mm) + pScreen->mmHeight = screen->height_mm; + + /* * Plug in our own block/wakeup handlers. * miScreenInit installs NoopDDA in both places */ @@ -769,11 +815,6 @@ KdInitScreen (ScreenInfo *pScreenInfo, (*card->cfuncs->scrinit) (screen); - if (!screen->dpix) - screen->dpix = 75; - - if (!screen->dpiy) - screen->dpiy = 75; if (!card->cfuncs->initAccel) screen->dumb = TRUE; if (!card->cfuncs->initCursor) diff --git a/xc/programs/Xserver/hw/kdrive/kdrive.h b/xc/programs/Xserver/hw/kdrive/kdrive.h index cd1e9cfbf..d46bbe179 100644 --- a/xc/programs/Xserver/hw/kdrive/kdrive.h +++ b/xc/programs/Xserver/hw/kdrive/kdrive.h @@ -21,7 +21,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/kdrive/kdrive.h,v 1.11 2000/11/29 08:42:25 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/kdrive.h,v 1.12 2000/12/08 22:59:37 keithp Exp $ */ #include <stdio.h> #include "X.h" @@ -104,7 +104,8 @@ typedef struct _KdScreenInfo { int width; int height; int rate; - int dpix, dpiy; + int width_mm; + int height_mm; Bool dumb; Bool softCursor; int mynum; diff --git a/xc/programs/Xserver/hw/kdrive/kinput.c b/xc/programs/Xserver/hw/kdrive/kinput.c index feb0cc320..30894abd4 100644 --- a/xc/programs/Xserver/hw/kdrive/kinput.c +++ b/xc/programs/Xserver/hw/kdrive/kinput.c @@ -21,7 +21,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.10 2000/10/08 02:08:39 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.11 2000/12/08 21:40:02 keithp Exp $ */ #include "kdrive.h" #include "inputstr.h" @@ -1069,16 +1069,16 @@ KdReleaseAllKeys (void) xEvent xE; int key; + KdBlockSigio (); for (key = 0; key < KD_KEY_COUNT; key++) if (IsKeyDown(key)) { xE.u.keyButtonPointer.time = GetTimeInMillis(); xE.u.u.type = KeyRelease; xE.u.u.detail = key; - KdBlockSigio (); KdHandleKeyboardEvent (&xE); - KdUnblockSigio (); } + KdUnblockSigio (); } void @@ -1155,15 +1155,20 @@ KdEnqueueKeyboardEvent(unsigned char scan_code, { return; } + /* + * X delivers press/release even for autorepeat + */ + xE.u.u.type = KeyRelease; + KdHandleKeyboardEvent (&xE); + xE.u.u.type = KeyPress; } -#if 0 - if (xE.u.u.type == KeyRelease && !IsKeyDown (key_code)) + /* + * Check released keys which are already up + */ + else if (!IsKeyDown (key_code) && xE.u.u.type == KeyRelease) { - xE.u.u.type = KeyPress; - KdHandleKeyboardEvent (&xE); - xE.u.u.type = KeyRelease; + return; } -#endif KdCheckSpecialKeys (&xE); KdHandleKeyboardEvent (&xE); } diff --git a/xc/programs/Xserver/hw/kdrive/kmap.c b/xc/programs/Xserver/hw/kdrive/kmap.c index 4348f13a5..37c56501b 100644 --- a/xc/programs/Xserver/hw/kdrive/kmap.c +++ b/xc/programs/Xserver/hw/kdrive/kmap.c @@ -21,14 +21,20 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/kdrive/kmap.c,v 1.4 2000/11/29 08:42:25 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/kmap.c,v 1.6 2000/12/13 18:06:54 keithp Exp $ */ #include "kdrive.h" #ifdef linux +#ifdef __i386__ +#define HAS_MTRR +#endif +#endif + #include <errno.h> #include <unistd.h> #include <sys/mman.h> +#ifdef HAS_MTRR #include <asm/mtrr.h> #endif @@ -91,14 +97,14 @@ KdUnmapDevice (void *addr, CARD32 size) #endif } -#ifdef linux +#ifdef HAS_MTRR static int mtrr; #endif void KdSetMappedMode (CARD32 addr, CARD32 size, int mode) { -#ifdef linux +#ifdef HAS_MTRR struct mtrr_sentry sentry; unsigned long base, bound; unsigned int type; @@ -131,7 +137,7 @@ KdSetMappedMode (CARD32 addr, CARD32 size, int mode) void KdResetMappedMode (CARD32 addr, CARD32 size, int mode) { -#ifdef linux +#ifdef HAS_MTRR struct mtrr_sentry sentry; unsigned long base, bound; unsigned int type; diff --git a/xc/programs/Xserver/hw/kdrive/linux/keyboard.c b/xc/programs/Xserver/hw/kdrive/linux/keyboard.c index b706bda9f..081a49913 100644 --- a/xc/programs/Xserver/hw/kdrive/linux/keyboard.c +++ b/xc/programs/Xserver/hw/kdrive/linux/keyboard.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/kdrive/linux/keyboard.c,v 1.4 2000/10/10 14:05:48 tsi Exp $ + * $XFree86: xc/programs/Xserver/hw/kdrive/linux/keyboard.c,v 1.5 2000/12/08 23:04:57 keithp Exp $ * * Copyright © 1999 Keith Packard * @@ -64,7 +64,7 @@ static const KeySym linux_to_x[256] = { 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, + XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, diff --git a/xc/programs/Xserver/hw/kdrive/vesa/vesainit.c b/xc/programs/Xserver/hw/kdrive/vesa/vesainit.c index d5cd99cdb..3ea1a9264 100644 --- a/xc/programs/Xserver/hw/kdrive/vesa/vesainit.c +++ b/xc/programs/Xserver/hw/kdrive/vesa/vesainit.c @@ -19,7 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/kdrive/vesa/vesainit.c,v 1.4 2000/10/20 00:19:50 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/vesa/vesainit.c,v 1.5 2000/12/08 21:40:29 keithp Exp $ */ #include "vesa.h" @@ -55,7 +55,7 @@ void InitCard(char *name) { KdCardAttr attr; - KdCardInfoAdd(&vesaFuncs, &attr, 0); + KdCardInfoAdd((KdCardFuncs *) &vesaFuncs, &attr, 0); } void diff --git a/xc/programs/Xserver/hw/vfb/Imakefile b/xc/programs/Xserver/hw/vfb/Imakefile index cc58395c8..0f8695a77 100644 --- a/xc/programs/Xserver/hw/vfb/Imakefile +++ b/xc/programs/Xserver/hw/vfb/Imakefile @@ -1,5 +1,5 @@ XCOMM $TOG: Imakefile /main/13 1998/03/24 13:27:03 kaleb $ -XCOMM $XFree86: xc/programs/Xserver/hw/vfb/Imakefile,v 3.23 2000/11/16 19:44:52 eich Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/vfb/Imakefile,v 3.24 2000/12/11 20:29:43 dawes Exp $ #include <Server.tmpl> #if HasShm @@ -59,5 +59,6 @@ LinkSourceFile(dpmsstubs.c,$(SERVERSRC)/Xext) SpecialCObjectRule(dpmsstubs,$(ICONFIGFILES),$(EXT_DEFINES)) #endif +CppManTarget(Xvfb,) InstallManPage(Xvfb,$(MANDIR)) DependTarget() diff --git a/xc/programs/Xserver/hw/vfb/Xvfb.cpp b/xc/programs/Xserver/hw/vfb/Xvfb.cpp new file mode 100644 index 000000000..a9e27560b --- /dev/null +++ b/xc/programs/Xserver/hw/vfb/Xvfb.cpp @@ -0,0 +1,127 @@ +.\" $TOG: Xvfb.man /main/12 1998/02/10 13:24:06 kaleb $ +.\" Copyright 1993, 1998 The Open Group +.\" +.\" All Rights Reserved. +.\" +.\" The above copyright notice and this permission notice shall be included +.\" in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +.\" OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" Except as contained in this notice, the name of The Open Group shall +.\" not be used in advertising or otherwise to promote the sale, use or +.\" other dealings in this Software without prior written authorization +.\" from The Open Group. +.\" +.\" $XFree86: xc/programs/Xserver/hw/vfb/Xvfb.cpp,v 1.2 2000/12/12 18:06:51 dawes Exp $ +.\" +.TH XVFB 1 "Release 6.4" "X Version 11" +.SH NAME +Xvfb \- virtual framebuffer X server for X Version 11 +.SH SYNOPSIS +.B Xvfb +[ option ] ... +.SH DESCRIPTION +.I Xvfb +is an X server that can run on machines with no display hardware +and no physical input devices. It emulates a dumb framebuffer using +virtual memory. +.PP +The primary use of this server was intended to be server testing. The +mfb or cfb code for any depth can be exercised with this server +without the need for real hardware that supports the desired depths. +The X community has found many other novel uses for \fIXvfb\fP, +including testing clients against unusual depths and screen +configurations, doing batch processing with \fIXvfb\fP as a background +rendering engine, load testing, as an aid to porting the X server to a +new platform, and providing an unobtrusive way to run applications +that don't really need an X server but insist on having one anyway. +.SH BUILDING +To build \fIXvfb\fP, put the following in your host.def and remake. +.PP +#define BuildServer YES /* if you aren't already building other servers */ +.br +#define XVirtualFramebufferServer YES + +.SH OPTIONS +.PP +In addition to the normal server options described in the \fIXserver(1)\fP +manual page, \fIXvfb\fP accepts the following command line switches: +.TP 4 +.B "\-screen \fIscreennum\fP \fIWxHxD\fP" +This option creates screen \fIscreennum\fP and sets its width, height, +and depth to W, H, and D respectively. By default, only screen 0 exists +and has the dimensions 1280x1024x8. +.TP 4 +.B "\-pixdepths \fIlist-of-depths\fP" +This option specifies a list of pixmap depths that the server should +support in addition to the depths implied by the supported screens. +\fIlist-of-depths\fP is a space-separated list of integers that can +have values from 1 to 32. +.TP 4 +.B "\-fbdir \fIframebuffer-directory\fP" +This option specifies the directory in which the memory mapped files +containing the framebuffer memory should be created. +See FILES. +This option only exists on machines that have the mmap and msync system +calls. +.TP 4 +.B "\-shmem" +This option specifies that the framebuffer should be put in shared memory. +The shared memory ID for each screen will be printed by the server. +The shared memory is in xwd format. +This option only exists on machines that support the System V shared memory +interface. +.PP +If neither \fB\-shmem\fP nor \fB\-fbdir\fP is specified, +the framebuffer memory will be allocated with malloc(). +.TP 4 +.B "\-linebias \fIn\fP" +This option specifies how to adjust the pixelization of thin lines. +The value \fIn\fP is a bitmask of octants in which to prefer an axial +step when the Bresenham error term is exactly zero. See the file +Xserver/mi/miline.h for more information. This option is probably only useful +to server developers to experiment with the range of line pixelization +possible with the cfb and mfb code. +.TP 4 +.B "\-blackpixel \fIpixel-value\fP, \-whitepixel \fIpixel-value\fP" +These options specify the black and white pixel values the server should use. +.SH FILES +The following files are created if the \-fbdir option is given. +.TP 4 +\fIframebuffer-directory\fP/Xvfb_screen<n> +Memory mapped file containing screen n's framebuffer memory, one file +per screen. The file is in xwd format. Thus, taking a full-screen +snapshot can be done with a file copy command, and the resulting +snapshot will even contain the cursor image. +.SH EXAMPLES +.TP 8 +Xvfb :1 -screen 0 1600x1200x32 +The server will listen for connections as server number 1, and screen 0 +will be depth 32 1600x1200. +.TP 8 +Xvfb :1 -screen 1 1600x1200x16 +The server will listen for connections as server number 1, will have the +default screen configuration (one screen, 1280x1024x8), and screen 1 +will be depth 16 1600x1200. +.TP 8 +Xvfb -pixdepths 3 27 -fbdir /usr/tmp +The server will listen for connections as server number 0, will have the +default screen configuration (one screen, 1280x1024x8), +will also support pixmap +depths of 3 and 27, +and will use memory mapped files in /usr/tmp for the framebuffer. +.TP 8 +xwud -in /usr/tmp/Xvfb_screen0 +Displays screen 0 of the server started by the preceding example. +.SH "SEE ALSO" +.PP +X(__miscmansuffix__), Xserver(1), xwd(1), xwud(1), XWDFile.h +.SH AUTHORS +David P. Wiggins, The Open Group, Inc. diff --git a/xc/programs/Xserver/hw/xfree86/CHANGELOG b/xc/programs/Xserver/hw/xfree86/CHANGELOG index 35f3f623d..65f791365 100644 --- a/xc/programs/Xserver/hw/xfree86/CHANGELOG +++ b/xc/programs/Xserver/hw/xfree86/CHANGELOG @@ -1,3 +1,234 @@ +XFree86 4.0.2 (18 December 2000) +1211. Fix a problem introduced recently when using the "ps/2" protocol for + mice on FreeBSD (David Dawes). +1210. Disable DRI for tdfx when there's insufficient memory for textures + (Alan Hourihane). +1209. Rename the R6.4 INSTALL and RELNOTES docs at the top level of the source + tree, and add a copy of the XFree86 RELNOTES. +1208. Add Solaris 8/x86 key mappings for some more jp106 keys. +1207. Fix wacom man page to match the driver (based on #4398, Akio Morita). +1206. Install the iso8859-13 encoding file (#4397, Nerijus Baliunas). +1205. Misc doc-related updates. + +XFree86 4.0.1Zc (15 December 2000) +1204. Fix an Xlib memory overrun when the Xutf8TextPropertyToTextList function + is used in a unibyte locale (#4394, Bruno Haible). +1203. Fix the yen/backslash keys for Solaris 8/x86 with Japanese 106 keyboards + (based on #4393, Takaaki Nomura). +1202. Fix type mismatches in the r128 DRI driver on Alpha platforms (#4392, + Gareth Hughes). +1201. Fix build on Japanized version of Solaris 8 for x86 (#4390, + Takaaki Nomura). +1200. Remove some old XtOffset magic for the arm that affects building + with gcc (#4388, Keith Packard). +1199. Release notes updates (David Dawes, Egbert Eich, Mark Vojkovich, + Robin Cutshaw, Keith Packard, Alan Hourihane, #4391, Kevin Brosius). +1198. Revert the tdfx driver to something functionally close to the + last known working version (4.0.1g) (David Dawes). + +XFree86 4.0.1Zb (14 December 2000) +1197. New fonts document (#4386, 4387, Juliusz Chroboczek). +1196. Status doc update for Trident (Alan Hourihane). +1195. Update the R6.4 INSTALL and RELNOTES docs to include references at + the top to the XFree86-specific docs (David Dawes). +1194. Make it possible to install platform-specific man pages with most + ix86 builds (David Dawes). +1193. Add a short man page for the newport driver, update it's sample config + file, and have the driver check user-supplied parameters (#4385, + Guido Guenther). +1192. Missing part of fix for FreeBSD sysmouse support (#4317, from FreeBSD + ports collection). +1191. Trident driver bug fixes (Alan Hourihane). +1190. Make it possible to install hardcopy specs docs that we can't generate + from source (David Dawes). +1189. Set the HasPerl default correctly for LynxOS (#4384, Thomas Mueller). +1188. Lots of Status doc updates (#4383, Branden Robinson). +1187. Update some DebianMaintainer defaults in linux.cf (#4380, + Branden Robinson). +1186. Fix a segfault in the font path verification code in xfs (#4379, + Charles C. Fu). +1185. Rework and document the various MatroxHal imake parameters, and + build in support for the mga_hal module by default for loadable server + builds (David Dawes). +1184. Fix sis driver corrupt display with more than 8MB of video memory (#4378, + Can-Ru Yeou). +1183. Fix xf86cfg build problem on systems that don't come with snprintf + and/or regex (based on #4361, Thomas Mueller). +1182. Fix siliconmotion driver screen restoration when a graphics vesafb mode + is selected during boot up (#4377, Frido Garritsen). +1181. Install and RELNOTES updates for Darwin (#4375, 4376, Torrey T. Lyons). +1180. s3virge patch to get Xft/Xrender working (#4374, Kevin Brosius). +1179. Improve aperture driver related error messages on OpenBSD + (Matthieu Herrb). +1178. Workaround for IA-64 loader bug (Marc La France). +1177. Fix recognition of valid depth/fbbpp combinations in ATI driver + (Marc La France). +1176. Fix 1bpp in ATI driver (Marc La France). +1175. Fix ATI DPMS support on panels by mimicking BIOS behaviour more closely + (Marc La France). + +XFree86 4.0.1Za (12 December 2000) +1174. Set defaults for Mesa's x86 CPU-specific asm options, and make it + possible to build with MMX disabled for systems with older assemblers + (David Dawes). +1173. Fix some R128 DRI bugs: + - Fix depth span functions (was causing rendering errors for windows + not at (0,0)). + - Don't use 32-bit depth buffers since they're not supported by Mesa. + - Use subpixel offsets to fix coordinate rounding errors. + (#4373, Gareth Hughes). +1172. Reinstate the AllTarget for the rule to make html man pages + (David Dawes). +1171. Build all modules on Linux/mips, fixing Xnest build (#4372, + Guido Guenther). +1170. Update Permedia 3 README, Cards file, and glint section in the Status + doc (#4371, Sven Luther). +1169. Fix depth passed to the BIOS in the savage driver (affects depth 15) + (#4369, Ani Joshi). +1168. Update fbdev man page (#4368, Michel Daenzer). +1167. Fix a problem with 32-bit depth buffers when using indirect rendering, + by not advertising them in the mga driver (#4367, Brian Paul). +1166. Update man page version strings, and convert some server/XFree86 man + pages to cpp-processed files to make the references to pages in + system-dependent sections correct (David Dawes). +1165. Update the release notes for the i18n and Unicode support (#4366, + Bruno Haible). +1164. Document most of the environment variables that can influence libX11 + and libXt in the 'X' man page (#4365, Bruno Haible). +1163. Update the ICCCM spec document to relfect the selection targets currently + used in XFree86 (#4364, Bruno Haible). +1162. Update the CTEXT spec document to reflect part of the current + practice in XFree86 (#4363, Bruno Haible). +1161. Augment SpecsDocDirs to reflect additional docs that have XFree86 changes + (#4362, Bruno Haible). +1160. Fix Xv library references in the xvinfo Imakefile (#4361, + Thomas Mueller). +1159. Fix a signed/unsigned error in the calculation of 16-bit displacements + in x86emu (#4359, Tim Roberts). +1158. Fix "noaccel" option in the tdfx driver when building without DRI + (David Dawes). +1157. Add Darwin documentation (Torrey T. Lyons). +1156. Add Darwin bindist files and update Xinstall.sh (Matthieu Herrb). +1155. Update bindist files for NetBSD 1.5 ELF (Matthieu Herrb). +1154. Add DGA support to I128 driver (Robin Cutshaw). + +XFree86 4.0.1Z (8 December 2000) +1153. Flesh out the wacom man page (#4358, Frederic Lepied). +1152. Fix incorrect documentation for xf86UnMapVidMem() in README.OS-lib + (#4357, Guido Guenther). +1151. Update the newport driver to use the map/unmap functions provided by + the os-support layer (#4356, Guido Guenther). +1150. Bugfix to xf86UDelay() (Egbert Eich). +1149. Added a sanity check to pciConvertRange2Host() (Egbert Eich). +1148. Added more log messages to Linux APM code (Egbert Eich). +1147. Added a sanity check to xf86ConfigPciEntity() (Egbert Eich). +1146. Resync with DRI CVS trunk (tdfx driver updates) (Daryll Strauss). +1145. Add -textmode mode option for xf86cfg, to run a ncurses interface, and + add the "expert" interface, to provide more control over the config file. + Updates to vesa driver, removed debug messages and fixed problem with + console restoration in some S3 cards. +1144. Merge tdfx 3D driver code (VA Linux). +1143. Add support PPC support on Rage 128 and disable Int10 for PPC on + Rage 128 (until the bug in PPC Int10 support is fixed) (Kevin Martin). +1142. Install an alternative fonts.alias file that references the UCS-encoded + fonts on systems without Perl (David Dawes). +1141. Add CyberShadow Option back into Trident driver (Alan Hourihane). +1140. Resync with DRI CVS trunk, including: + - SSE support updates + - DRI-specific full screen mode + - Reduce the minimum space required for 3D on the Rage 128 + (VA Linux). +1139. Fix a memory leak in the UTF-8 <--> CompoundText converter (#4354, + Bruno Haible). +1138. Add support for the selection target UTF8_STRING to libXaw (#4353, + Bruno Haible). +1137. Make Xlib's CompoundText converter ISO-2022 compliant (#4352, + Bruno Haible). +1136. Fix 2 wacom driver bugs (core dump on VT switching, and USB support) + (#4350, Frederic Lepied). +1135. Update the ClearlyU fonts to 1.8b. Changes include: + - Cleaned up the Arabic glyphs so they don't look quite so juvenile. + - Squared up the Hebrew glyphs so they match the style of the other + scripts better. + - Added many of the basic Hangul glyphs. + - Brought the Cyrillic block in line with Unicode 3.0 and moved the + extra glyphs into the PUA font in the 0xE4XX range. + (#4349, Mark Leisher). +1134. Update the savage driver to all I/O via MMIO, and add DPMS support + (4347, Ani Joshi). +1133. Change xfs to drop privs after daemonising so that the pid file can + be written (#4346, Frederic Lepied). +1132. Miscellaneous fixups to the trident driver (Alan Hourihane). +1131. Add Xv support to the trident driver. Works for Blade and Image series + chips, but zooming currently doesn't work on Image series. + (Alan Hourihane). +1130. Don't perform a software reset on the Graphics Engine for Trident + Blade3D's and CyberBlade's (Alan Hourihane). +1129. Fix typo in int10 for IA-64's (Marc La France). +1128. Make PCI bridge information in the log more accurate (Marc La France). +1127. Update ATI docs (Marc La France). +1126. Another getValidBIOSBase() fix (Marc La France). +1125. If the loader server dies from a signal during initialisation, print a + list of undefined symbols (Marc La France). +1124. Move Alpha MMIO definitions from xf86_OSproc.h to compiler.h + (Marc La France). +1123. Change update.docs rule for shadow tree friendliness (Marc La France). +1122. Don't reference libc wrapper names directly in the newport driver + (David Dawes). +1121. Fix the fr_CH xkb Macintosh symbols file (#4345, Olaf Hering). +1120. Revert the Estonian_Estonia.1257 change in patch #4297 because + windows-1257 is a closer match to iso8859-13 than iso8859-15. + Also add entries for the et_EE.ISO8859-1 locale (while not perfect for + Estonian, it is commonly used) (#4344, Ville Hallik). +1119. Change name of long Unicode keysyms from 6 to 8 hex digits, which + matches conventional usage better (#4343, Ivan Pascal). +1118. Make XF86VidModeSetViewPort() actually set the viewport to the + X and Y coordinates specified as opposed to always setting it to (0,0) + (#4342, Joe Moss). +1117. Work around some build problems on SVR4.0 (#4341, Satoshi Kimura). +1116. Compose characters for the Macedonian UTF-8 locale (#4338, + Damjan Georgievski). +1115. Fix build problems with the wacom driver on Linux 2.4 when building + a static server (Frederic Lepied, David Dawes). +1114. Changed name of server binary to call by xf86cfg back to "XFree86 + (Egbert Eich). +1113. Modified handling of memory alloctaion in TDFX driver (Egbert Eich). +1112. Attempt to fix the 'UseModes' directive in the Monitor section + (Egbert Eich). +1111. Added debugging output for BIOS base address search (Egbert Eich). +1110. Changed neomagic driver to treat disable stretching for each mode + individually (Egbert Eich). +1109. Removed '-traditional' from cpp rule for makedpend. Required for + new glibc header files (Ruediger Oertel). +1107. Fix to make SuperProbe build again on ia64 (Andreas Schwab). +1107. Attempt to fix int10 (Egbert Eich). +1106. Modified blitter busy test to use the MMIO mapped registers on chips + > CT69000 (Egbert Eich). +1105. Attempt to improve dga support in C&T driver (Egbert Eich). +1104. Moved ppc_flush_icache to compiler.h - hope this fixes build problems + (Egert Eich). +1103. changed cirrus driver to us fb instead of cfb (Egbert Eich). +1102. Modularized HALlib for mga driver (Egbert Eich). +1101. Added DGA support to tseng driver (Rainer Keller). +1100. Added "framebuffer" bus type allowing resource control to take place + outside of the server (Egbert Eich). +1099. Added turkish keyboard layout (Togan Muftuoglu). +1098. Fix Cyber9397/DVD acceleration problem (Alan Hourihane). +1097. Resync with the DRI CVS trunk. +1096. Fix alot of Rage 128 Xv bugs (Mark Vojkovich). +1095. Fix XKB symbols for Swedish Macintosh keyboards (#4337, Olaf Hering). +1094. Disable DRI on PPC (#4337, Olaf Hering). +1093. Suppress xf86ReadBIOS debugging messages for BSD (#4336, Takaaki Nomura). +1092. Silicon Motion driver update, includes bug fixes (#4335, + Frido Garritsen, Silicon Motion, Inc.). +1091. Updates to the dumpkeymap utility and its documentation (#4323, + Eric Sunshine). +1090. Enable 3D support for Rage 128 Mobility chips (Kevin Martin). +1089. Add clip rectangles support to Render extension, Xrender and Xft. + Make Xrender and Xft usable from c++. + Fix a bunch of compiler warnings in Render extension code + (Keith Packard) + XFree86 4.0.1h (4 December 2000) 1088. Fix key mapping for the '\' key on GB keyboards in Solaris 8. 1087. Status doc updates for Neomagic an NVIDIA (#4334, Andrew C. Aitchison, @@ -176,7 +407,8 @@ XFree86 4.0.1h (4 December 2000) - don't let a port option in the config file override the -port command line option - cleanup/fix syslogging - (based on #4253, Debian, and Red Hat's XFree86-4.0-xfsredhat patch). + (based on #4253, Topi Miettinen, Debian, and Red Hat's + XFree86-4.0-xfsredhat patch). 1026. Support for startx to set up the Xauth when starting an X server (based on Red Hat's XFree86-4.0-startx_xauth patch). 1025. Fix an unaligned access on Alpha with the tdfx driver (Jay Estabrook). @@ -11882,4 +12114,4 @@ XFree86 3.0a (28 April 1994) XFree86 3.0 (26 April 1994) -$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.1443 2000/12/05 00:31:58 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.1485 2000/12/18 15:55:33 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/SuperProbe/Probe.h b/xc/programs/Xserver/hw/xfree86/SuperProbe/Probe.h index 0d8e43e73..938c9a753 100644 --- a/xc/programs/Xserver/hw/xfree86/SuperProbe/Probe.h +++ b/xc/programs/Xserver/hw/xfree86/SuperProbe/Probe.h @@ -26,7 +26,7 @@ * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/SuperProbe/Probe.h,v 3.76 2000/11/28 20:59:16 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/SuperProbe/Probe.h,v 3.77 2000/12/06 15:35:05 eich Exp $ */ /* * Includes @@ -47,7 +47,6 @@ #if defined(SYSV) || defined(SVR4) || defined(linux) || defined(__QNX__) || defined(__QNXNTO__) || defined(__GNU__) #if defined(__ia64__) || defined(ia64) #include <sys/io.h> -#include <asm/io.h> #endif # include <string.h> #if !(defined(__QNX__) && !defined(__QNXNTO__)) diff --git a/xc/programs/Xserver/hw/xfree86/XF86Config.cpp b/xc/programs/Xserver/hw/xfree86/XF86Config.cpp index 00de224b0..68415366f 100644 --- a/xc/programs/Xserver/hw/xfree86/XF86Config.cpp +++ b/xc/programs/Xserver/hw/xfree86/XF86Config.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/XF86Config.cpp,v 1.12 2000/11/28 20:59:14 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/XF86Config.cpp,v 1.13 2000/12/11 20:18:01 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH XF86Config __filemansuffix__ "Version 4.0.1" "XFree86" +.TH XF86Config __filemansuffix__ "Version 4.0.2" "XFree86" .SH NAME XF86Config - Configuration File for XFree86 .SH DESCRIPTION diff --git a/xc/programs/Xserver/hw/xfree86/XFree86.cpp b/xc/programs/Xserver/hw/xfree86/XFree86.cpp index 8f9e755dd..6590f3e4d 100644 --- a/xc/programs/Xserver/hw/xfree86/XFree86.cpp +++ b/xc/programs/Xserver/hw/xfree86/XFree86.cpp @@ -1,5 +1,5 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/XFree86.cpp,v 1.2 2000/06/15 20:50:02 dawes Exp $ -.TH XFree86 1 "Version 4.0" "XFree86" +.\" $XFree86: xc/programs/Xserver/hw/xfree86/XFree86.cpp,v 1.4 2000/12/11 20:29:50 dawes Exp $ +.TH XFree86 1 "Version 4.0.2" "XFree86" .SH NAME XFree86 - X11R6 X server .SH SYNOPSIS @@ -304,8 +304,8 @@ Initial access control list for display \fIn\fP .LP Note: <XRoot> refers to the root of the X11 install tree. .SH "SEE ALSO" -X(1), Xserver(1), xdm(1), xinit(1), XF86Config(4/5), xf86config(1), -XF86_SVGA(1), XF86_VGA16(1), XF86_Mono(1), XF86_Accel(1), xvidtune(1) +X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), +XF86Config(__filemansuffix__), xf86config(1), xf86cfg(1), xvidtune(1) .SH AUTHORS .PP For X11R5, \fIXF86 1.2\fP was provided by: diff --git a/xc/programs/Xserver/hw/xfree86/common/Imakefile b/xc/programs/Xserver/hw/xfree86/common/Imakefile index 35ec8419a..0f4d6b37b 100644 --- a/xc/programs/Xserver/hw/xfree86/common/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/common/Imakefile @@ -4,7 +4,7 @@ XCOMM $XConsortium: Imakefile /main/34 1996/10/27 11:05:08 kaleb $ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/common/Imakefile,v 3.124 2000/12/01 00:24:33 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/common/Imakefile,v 3.125 2000/12/06 15:35:06 eich Exp $ @@ -89,6 +89,7 @@ SRCS = \ xf86Bus.c \ xf86isaBus.c \ xf86pciBus.c \ + xf86fbBus.c \ xf86IniExt.c \ xf86Config.c \ xf86Cursor.c \ @@ -124,6 +125,7 @@ OBJS = \ xf86Bus.o \ xf86isaBus.o \ xf86pciBus.o \ + xf86fbBus.o \ xf86Config.o \ xf86Cursor.o \ xf86DGA.o \ diff --git a/xc/programs/Xserver/hw/xfree86/common/compiler.h b/xc/programs/Xserver/hw/xfree86/common/compiler.h index 43bd2c47d..befeaaa77 100644 --- a/xc/programs/Xserver/hw/xfree86/common/compiler.h +++ b/xc/programs/Xserver/hw/xfree86/common/compiler.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.74 2000/11/21 23:10:32 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.76 2000/12/07 15:43:40 tsi Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -1495,9 +1495,23 @@ testinx(unsigned short port, unsigned char ind) #endif /* NO_INLINE */ +#ifdef __alpha__ +/* entry points for Mmio memory access routines */ +extern int (*xf86ReadMmio8)(void *, unsigned long); +extern int (*xf86ReadMmio16)(void *, unsigned long); +extern int (*xf86ReadMmio32)(void *, unsigned long); +extern void (*xf86WriteMmio8)(int, void *, unsigned long); +extern void (*xf86WriteMmio16)(int, void *, unsigned long); +extern void (*xf86WriteMmio32)(int, void *, unsigned long); +extern void (*xf86WriteMmioNB8)(int, void *, unsigned long); +extern void (*xf86WriteMmioNB16)(int, void *, unsigned long); +extern void (*xf86WriteMmioNB32)(int, void *, unsigned long); +extern void xf86JensenMemToBus(char *, long, long, int); +extern void xf86JensenBusToMem(char *, char *, unsigned long, int); +extern void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int); +extern void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); /* Some macros to hide the system dependencies for MMIO accesses */ /* Changed to kill noise generated by gcc's -Wcast-align */ -#ifdef __alpha__ #define MMIO_IN8(base, offset) (*xf86ReadMmio8)(base, offset) #define MMIO_IN16(base, offset) (*xf86ReadMmio16)(base, offset) # if defined (JENSEN_SUPPORT) @@ -1559,6 +1573,17 @@ testinx(unsigned short port, unsigned char ind) # define MMIO_ONB32(base, offset, val) \ xf86WriteMmioNB32Le(base, offset, (CARD32)(val)) # endif +static __inline__ void ppc_flush_icache(char *addr) +{ + __asm__ volatile ( + "dcbf 0,%0;" + "sync;" + "icbi 0,%0;" + "sync;" + "isync;" + : : "r"(addr) : "memory"); +} + #elif defined(__sparc__) /* * Like powerpc, we provide byteswapping and no byteswapping functions diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86.h b/xc/programs/Xserver/hw/xfree86/common/xf86.h index 50920f256..3abc4cf8f 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.144 2000/11/18 19:37:08 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.147 2000/12/07 20:26:19 dawes Exp $ */ /* * Copyright (c) 1997 by The XFree86 Project, Inc. @@ -36,7 +36,12 @@ extern ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */ extern const unsigned char byte_reversed[256]; extern PropertyPtr *xf86RegisteredPropertiesTable; extern ScrnInfoPtr xf86CurrentScreen; - +extern Bool pciSlotClaimed; +extern Bool isaSlotClaimed; +extern Bool fbSlotClaimed; +#ifdef __sparc__ +extern Bool sbusSlotClaimed; +#endif #define XF86SCRNINFO(p) ((ScrnInfoPtr)((p)->devPrivates[xf86ScreenIndex].ptr)) #define XF86FLIP_PIXELS() \ @@ -77,7 +82,9 @@ void xf86PrintResList(int verb, resPtr list); resPtr xf86AddRangesToList(resPtr list, resRange *pRange, int entityIndex); int xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active); int xf86GetIsaInfoForScreen(int scrnIndex); +int xf86GetFbInfoForScreen(int scrnIndex); Bool xf86ParseIsaBusString(const char *busID); +int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active); void xf86EnableAccess(ScrnInfoPtr pScrn); void xf86SetCurrentAccess(Bool Enable, ScrnInfoPtr pScrn); Bool xf86IsPrimaryPci(pciVideoPtr pPci); @@ -178,6 +185,7 @@ int xf86RemoveInputHandler(pointer handler); void xf86DisableInputHandler(pointer handler); void xf86EnableInputHandler(pointer handler); void xf86InterceptSignals(int *signo); +Bool xf86EnableVTSwitch(Bool new); /* xf86Helper.c */ @@ -268,6 +276,10 @@ ScrnInfoPtr xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag, resList res, EntityProc init, EntityProc enter, EntityProc leave, pointer private); +ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, + int entityIndex, EntityProc init, + EntityProc enter, EntityProc leave, + pointer private); /* Obsolete! don't use */ Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,PciChipsets *p_chip, @@ -288,6 +300,9 @@ void xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip, resList res, EntityProc init, EntityProc enter, EntityProc leave, pointer private); +void xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, + EntityProc enter, EntityProc leave, + pointer private); Bool xf86IsScreenPrimary(int scrnIndex); int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, int format, unsigned long len, diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c b/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c index 9f1c08caa..62935e9b1 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.55 2000/11/02 16:46:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.56 2000/12/06 15:35:07 eich Exp $ */ /* * Copyright (c) 1997-1999 by The XFree86 Project, Inc. */ @@ -65,6 +65,7 @@ resRange res8514Shared[] = {_8514_SHARED, _END}; /* Flag: do we need RAC ? */ static Bool needRAC = FALSE; +static Bool doFramebufferMode = FALSE; /* state change notification callback list */ static StateChangeNotificationPtr StateChangeNotificationList; @@ -607,6 +608,19 @@ xf86AccessLeaveState(void) } /* + * xf86AccessRestoreState() - Restore the access registers to the + * state before X was started. This is handy for framebuffers. + */ +void +xf86AccessRestoreState(void) +{ + if (!xf86ResAccessEnter) + return; + PciStateLeave(); + PciBusStateLeave(); +} + +/* * xf86EnableAccess() -- enable access to controlled resources. * To reduce latency when switching access the ScrnInfoRec has * a linked list of the EntityAccPtr of all screen entities. @@ -1807,6 +1821,7 @@ busTypeSpecific(EntityPtr pEnt, xf86State state) * setAccess() -- sets access functions according to resources * required. */ + static void setAccess(EntityPtr pEnt, xf86State state) { @@ -2070,6 +2085,9 @@ xf86EnterServerState(xf86State state) else ErrorF("Entering OPERATING state\n"); #endif + /* When servicing a dump framebuffer we don't need to do anything */ + if (doFramebufferMode) return; + for (i=0; i<xf86NumScreens; i++) { pScrn = xf86Screens[i]; j = pScrn->entityList[pScrn->numEntities - 1]; @@ -2366,6 +2384,24 @@ xf86PostProbe(void) int i,j; resPtr resp, acc, tmp, resp_x, *pprev_next; + if (fbSlotClaimed) { + if (pciSlotClaimed || isaSlotClaimed +#ifdef __sparc__ + || sbusSlotClaimed +#endif + ) { + FatalError("Cannot run in framebuffer mode. Please specify busIDs " + " for all framebuffer devices\n"); + return; + } else { + xf86Msg(X_INFO,"Running in FRAMEBUFFER Mode\n"); + xf86AccessRestoreState(); + notifyStateChange(NOTIFY_ENABLE); + doFramebufferMode = TRUE; + + return; + } + } /* don't compare against ResInit - remove it from clone.*/ acc = tmp = xf86DupResList(Acc); pprev_next = &acc; @@ -2495,6 +2531,8 @@ checkRequiredResources(int entityIndex) void xf86PostPreInit() { + if (doFramebufferMode) return; + if (xf86NumScreens > 1) needRAC = TRUE; @@ -2521,9 +2559,13 @@ xf86PostScreenInit(void) ScreenPtr pScreen; unsigned int flags; int nummem = 0, numio = 0; - #ifdef XFree86LOADER pointer xf86RACInit = NULL; +#endif + + if (doFramebufferMode) return; + +#ifdef XFree86LOADER if (needRAC) { xf86RACInit = LoaderSymbol("xf86RACInit"); if (!xf86RACInit) @@ -2932,7 +2974,8 @@ xf86FindPrimaryDevice() if (primaryBus.type != BUS_NONE) { char *bus; char *loc = xnfcalloc(1,8); - + if (loc == NULL) return; + switch (primaryBus.type) { case BUS_PCI: bus = "PCI"; @@ -2941,7 +2984,7 @@ xf86FindPrimaryDevice() break; case BUS_ISA: bus = "ISA"; - loc[0] = 0; + loc[0] = '\0'; break; case BUS_SBUS: bus = "SBUS"; @@ -2949,7 +2992,7 @@ xf86FindPrimaryDevice() break; default: bus = ""; - loc[0] = 0; + loc[0] = '\0'; } xf86MsgVerb(X_INFO, 2, "Primary Device is: %s %s\n",bus,loc); diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Config.c b/xc/programs/Xserver/hw/xfree86/common/xf86Config.c index 2556136e6..a6a42682e 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Config.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Config.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.235 2000/11/14 18:20:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.236 2000/12/06 15:35:07 eich Exp $ */ /* @@ -1679,19 +1679,23 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor) */ while(modeslnk) { - /* We may want to reuse the monitor section */ - if (!modeslnk->ml_modes) { - modes = xf86findModes (modeslnk->ml_modes_str, - xf86configptr->conf_modes_lst); - modeslnk->ml_modes = modes; + modes = xf86findModes (modeslnk->ml_modes_str, + xf86configptr->conf_modes_lst); + modeslnk->ml_modes = modes; - /* now add the modes found in the modes - section to the list of modes for this - monitor */ + /* now add the modes found in the modes + section to the list of modes for this + monitor unless it has been added before + because we are reusing the same section + for another screen */ + if (xf86itemNotSublist( + (GenericListPtr)conf_monitor->mon_modeline_lst, + (GenericListPtr)modes->mon_modeline_lst)) { conf_monitor->mon_modeline_lst = (XF86ConfModeLinePtr) - xf86addListItem((GenericListPtr)conf_monitor->mon_modeline_lst, - (GenericListPtr)modes->mon_modeline_lst); + xf86addListItem( + (GenericListPtr)conf_monitor->mon_modeline_lst, + (GenericListPtr)modes->mon_modeline_lst); } modeslnk = modeslnk->list.next; } diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c b/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c index 2885b824b..9a64defc3 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.45 2000/12/01 21:03:32 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.49 2000/12/12 18:23:50 tsi Exp $ */ /* * Copyright 2000 by Alan Hourihane, Sychdyn, North Wales. * @@ -331,7 +331,7 @@ static XF86ConfScreenPtr configureScreenSection (int screennum) { int i; - int depths[] = { 1, 4, 8, 15, 16, 24 }; + int depths[] = { 1, 4, 8, 15, 16, 24/*, 32*/ }; parsePrologue (XF86ConfScreenPtr, XF86ConfScreenRec) ptr->scrn_identifier = xf86confmalloc(18); @@ -341,7 +341,7 @@ configureScreenSection (int screennum) ptr->scrn_device_str = xf86confmalloc(16); sprintf(ptr->scrn_device_str, "Card%d", screennum); - for (i=0; i<6; i++) + for (i=0; i<sizeof(depths)/sizeof(depths[0]); i++) { XF86ConfDisplayPtr display; @@ -349,6 +349,8 @@ configureScreenSection (int screennum) memset((XF86ConfDisplayPtr)display,0,sizeof(XF86ConfDisplayRec)); display->disp_depth = depths[i]; display->disp_black.red = display->disp_white.red = -1; + display->disp_black.green = display->disp_white.green = -1; + display->disp_black.blue = display->disp_white.blue = -1; ptr->scrn_display_lst = (XF86ConfDisplayPtr)xf86addListItem( (glp)ptr->scrn_display_lst, (glp)display); } @@ -717,7 +719,6 @@ DoConfigure() strncpy(homebuf,home,PATH_MAX-1); homebuf[PATH_MAX-1] = '\0'; home = homebuf; - ErrorF("CONFIGFILE %s\n",configfile); if (!(filename = (char *)ALLOCATE_LOCAL(strlen(home) + strlen(configfile) + 3))) diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Events.c b/xc/programs/Xserver/hw/xfree86/common/xf86Events.c index a4915aaf0..76b15f4fd 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Events.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Events.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.101 2000/11/18 19:37:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.104 2000/12/07 20:32:54 dawes Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -115,7 +115,10 @@ extern void XTestStealMotionData(); #ifdef USE_VT_SYSREQ static Bool VTSysreqToggle = FALSE; #endif /* !USE_VT_SYSREQ */ -static Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for *BSD */ +static Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for + *BSD and for avoiding VT + switches when using the DRI + automatic full screen mode.*/ extern fd_set EnabledDevices; @@ -1090,9 +1093,9 @@ xf86SigHandler(int signo) #ifdef XF86BIGFONT XF86BigfontCleanup(); #endif -#if defined(DEBUG) && defined(XFree86LOADER) - if (signo == SIGSEGV) - LoaderDumpSymbols(); +#if defined(XFree86LOADER) + if (xf86Initialising) + LoaderCheckUnresolved(LD_RESOLV_IFDONE); #endif FatalError("Caught signal %d. Server aborting\n", signo); } @@ -1320,6 +1323,27 @@ xf86EnableInputHandler(pointer handler) AddEnabledDevice(ih->fd); } +/* + * As used currently by the DRI, the return value is ignored. + */ +Bool +xf86EnableVTSwitch(Bool new) +{ + static Bool def = TRUE; + Bool old; + + old = VTSwitchEnabled; + if (!new) { + /* Disable VT switching */ + def = VTSwitchEnabled; + VTSwitchEnabled = FALSE; + } else { + /* Restore VT switching to default */ + VTSwitchEnabled = def; + } + return old; +} + #ifdef XTESTEXT1 void diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c b/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c index d3675e4fc..86d020df8 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.105 2000/12/02 15:30:28 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.108 2000/12/14 16:33:08 eich Exp $ */ /* * Copyright (c) 1997-1998 by The XFree86 Project, Inc. @@ -1602,7 +1602,8 @@ xf86MatchPciInstances(const char *driverName, int vendorID, } } else { /* Find PCI devices that match the given vendor ID */ - for (ppPci = xf86PciVideoInfo; *ppPci != NULL; ppPci++) { + for (ppPci = xf86PciVideoInfo; (ppPci != NULL) + && (*ppPci != NULL); ppPci++) { if ((*ppPci)->vendor == vendorID) { ++allocatedInstances; instances = xnfrealloc(instances, @@ -2553,7 +2554,8 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); if (!pEnt) return pScrn; - if (!(pEnt->location.type == BUS_PCI)) { + if (!(pEnt->location.type == BUS_PCI) + || !xf86GetPciInfoForEntity(entityIndex)) { xfree(pEnt); return pScrn; } @@ -2586,6 +2588,33 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, return pScrn; } +ScrnInfoPtr +xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, + EntityProc init, EntityProc enter, EntityProc leave, + pointer private) +{ + EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); + if (!pEnt) return pScrn; + + if (!(pEnt->location.type == BUS_NONE)) { + xfree(pEnt); + return pScrn; + } + + if (!pEnt->active) { + xf86ConfigFbEntityInactive(pEnt, init, enter, leave, private); + return pScrn; + } + + if (!pScrn) + pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag); + xf86AddEntityToScreen(pScrn,entityIndex); + + xf86SetEntityFuncs(entityIndex,init,enter,leave,private); + + return pScrn; +} + /* * * OBSOLETE ! xf86ConfigActiveIsaEntity() and xf86ConfigActivePciEntity() @@ -2703,6 +2732,17 @@ xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip, xf86SetEntityFuncs(pEnt->index,init,enter,leave,private); } +void +xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, + EntityProc enter, EntityProc leave, pointer private) +{ + ScrnInfoPtr pScrn; + + if ((pScrn = xf86FindScreenForEntity(pEnt->index))) + xf86RemoveEntityFromScreen(pScrn,pEnt->index); + xf86SetEntityFuncs(pEnt->index,init,enter,leave,private); +} + Bool xf86IsScreenPrimary(int scrnIndex) { diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c b/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c index 59f1fb7b5..4376f6b2f 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.35 2000/11/16 19:44:54 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.36 2000/12/06 15:35:11 eich Exp $ */ /* * Copyright (c) 1997,1998 by The XFree86 Project, Inc. @@ -1399,9 +1399,20 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, lookupNext: status = xf86LookupMode(scrp, p, clockRanges, strategy); - if (status != MODE_OK) xf86DrvMsg(scrp->scrnIndex, X_WARNING, - "mode \"%s\" deleted (%s)\n", p->name, + if (status != MODE_OK) { + if (p->type & M_T_BUILTIN) + xf86DrvMsg(scrp->scrnIndex, X_WARNING, + "Built-in mode \"%s\" deleted (%s)\n", p->name, xf86ModeStatusToString(status)); + else if (p->type & M_T_DEFAULT) + xf86DrvMsg(scrp->scrnIndex, X_WARNING, + "Default mode \"%s\" deleted (%s)\n", p->name, + xf86ModeStatusToString(status)); + else + xf86DrvMsg(scrp->scrnIndex, X_WARNING, + "Mode \"%s\" deleted (%s)\n", p->name, + xf86ModeStatusToString(status)); + } if (status == MODE_ERROR) { ErrorF("xf86ValidateModes: " "unexpected result from xf86LookupMode()\n"); @@ -1485,10 +1496,15 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, xf86DrvMsg(scrp->scrnIndex, X_WARNING, "Built-in mode \"%s\" deleted (%s)\n", p->name, xf86ModeStatusToString(p->status)); - else + else if (p->type & M_T_DEFAULT) + xf86DrvMsg(scrp->scrnIndex, X_WARNING, + "Default mode \"%s\" deleted (%s)\n", p->name, + xf86ModeStatusToString(p->status)); + else xf86DrvMsg(scrp->scrnIndex, X_WARNING, "Mode \"%s\" deleted (%s)\n", p->name, xf86ModeStatusToString(p->status)); + goto lookupNext; } } @@ -1589,14 +1605,20 @@ xf86PruneDriverModes(ScrnInfoPtr scrp) return; n = p->next; if (p->status != MODE_OK) { +#if 0 if (p->type & M_T_BUILTIN) xf86DrvMsg(scrp->scrnIndex, X_WARNING, "Built-in mode \"%s\" deleted (%s)\n", p->name, xf86ModeStatusToString(p->status)); - else if ((p->type & M_T_DEFAULT) == 0) - xf86DrvMsg(scrp->scrnIndex, X_WARNING, - "Mode \"%s\" deleted (%s)\n", p->name, - xf86ModeStatusToString(p->status)); + else if (p->type & M_T_DEFAULT) + xf86DrvMsg(scrp->scrnIndex, X_WARNING, + "Default mode \"%s\" deleted (%s)\n", p->name, + xf86ModeStatusToString(p->status)); + else + xf86DrvMsg(scrp->scrnIndex, X_WARNING, + "Mode \"%s\" deleted (%s)\n", p->name, + xf86ModeStatusToString(p->status)); +#endif xf86DeleteMode(&(scrp->modes), p); } p = n; diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86PM.c b/xc/programs/Xserver/hw/xfree86/common/xf86PM.c index 5ac6dbd7f..feb749fae 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86PM.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86PM.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.3 2000/11/03 18:46:07 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.4 2000/12/08 20:13:34 eich Exp $ */ #include "X.h" @@ -119,7 +119,7 @@ xf86HandlePMEvents(int fd, pointer data) if ((n = xf86PMGetEventFromOs(fd,events,MAX_NO_EVENTS))) { do { for (i = 0; i < n; i++) { - xf86MsgVerb(3,X_INFO,"PM Event received: %s\n", + xf86MsgVerb(X_INFO,3,"PM Event received: %s\n", eventName(events[i])); DoApmEvent(events[i]); switch (xf86PMConfirmEventToOs(fd,events[i])) { diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h b/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h index 6cd7d1278..26c4e6f20 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.82 2000/12/04 18:49:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.83 2000/12/07 21:34:20 mvojkovi Exp $ */ /* * PCI Probe * @@ -479,6 +479,7 @@ #define PCI_CHIP_QUADRO 0x0103 #define PCI_CHIP_GEFORCE2MX 0x0110 #define PCI_CHIP_GEFORCE2MXDDR 0x0111 +#define PCI_CHIP_GEFORCE2GO 0x0112 #define PCI_CHIP_QUADRO2MXR 0x0113 #define PCI_CHIP_GEFORCE2GTS 0x0150 #define PCI_CHIP_GEFORCE2GTS_1 0x0151 diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h b/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h index 03ee01a07..9bd5beb7e 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.68 2000/10/30 23:02:11 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.69 2000/12/07 15:43:40 tsi Exp $ */ /* * Copyright (c) 1997 by The XFree86 Project, Inc. @@ -126,7 +126,7 @@ void xf86ClearEntityListForScreen(int scrnIndex); void xf86AddDevToEntity(int entityIndex, GDevPtr dev); extern void xf86PostPreInit(void); extern void xf86PostScreenInit(void); -extern memType getValidBIOSBase(PCITAG tag, int num); +extern memType getValidBIOSBase(PCITAG tag, int *num); extern int pciTestMultiDeviceCard(int bus, int dev, int func, PCITAG** pTag); /* xf86Config.c */ diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c b/xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c index f97643938..daf8ecaf8 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c @@ -1,7 +1,7 @@ /* * Copyright (c) 1999 by The XFree86 Project, Inc. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.8 1999/12/13 01:39:46 robin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.9 2000/12/06 22:00:46 dawes Exp $ */ /* * This file contains the VidMode functions required by the extension. @@ -294,10 +294,18 @@ VidModeSetViewPort(int scrnIndex, int x, int y) return FALSE; pScrn = xf86Screens[scrnIndex]; - xf86SetViewport(pScrn->pScreen, min(0, x), min(0, y)); + pScrn->frameX0 = min( max(x, 0), + pScrn->virtualX - pScrn->currentMode->HDisplay ); + pScrn->frameX1 = pScrn->frameX0 + pScrn->currentMode->HDisplay - 1; + pScrn->frameY0 = min( max(y, 0), + pScrn->virtualY - pScrn->currentMode->VDisplay ); + pScrn->frameY1 = pScrn->frameY0 + pScrn->currentMode->VDisplay - 1; + if (pScrn->AdjustFrame != NULL) + (pScrn->AdjustFrame)(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); return TRUE; } + Bool VidModeGetViewPort(int scrnIndex, int *x, int *y) { diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c b/xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c new file mode 100644 index 000000000..61bdf59ec --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c @@ -0,0 +1,71 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c,v 1.1 2000/12/06 15:35:11 eich Exp $ */ + +/* + * Copyright (c) 2000 by The XFree86 Project, Inc. + */ + +/* + * This file contains the interfaces to the bus-specific code + */ + +#include <ctype.h> +#include <stdlib.h> +#include <unistd.h> +#include "X.h" +#include "os.h" +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86Resources.h" + +#include "xf86Bus.h" + +#define XF86_OS_PRIVS +#define NEED_OS_RAC_PROTOS +#include "xf86_OSproc.h" + +#include "xf86RAC.h" + +Bool fbSlotClaimed = FALSE; + +int +xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active) +{ + EntityPtr p; + BusAccPtr pbap = xf86BusAccInfo; + int num; + + num = xf86AllocateEntity(); + p = xf86Entities[num]; + p->driver = drvp; + p->chipset = 0; + p->busType = BUS_NONE; + p->active = active; + p->inUse = FALSE; + xf86AddDevToEntity(num, dev); + p->access = xnfcalloc(1,sizeof(EntityAccessRec)); + p->access->fallback = &AccessNULL; + p->access->pAccess = &AccessNULL; + p->busAcc = NULL; + + fbSlotClaimed = TRUE; + return num; +} + +/* + * Get the list of FB "slots" claimed by a screen + */ +int +xf86GetFbInfoForScreen(int scrnIndex) +{ + int num = 0; + int i; + EntityPtr p; + + for (i = 0; i < xf86Screens[scrnIndex]->numEntities; i++) { + p = xf86Entities[xf86Screens[scrnIndex]->entityList[i]]; + if (p->busType == BUS_NONE) { + num++; + } + } + return num; +} diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c b/xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c index 24c37ae00..cfe6ed000 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c,v 3.4 2000/06/20 05:08:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c,v 3.5 2000/12/06 15:35:11 eich Exp $ */ /* * Copyright (c) 1997-1999 by The XFree86 Project, Inc. @@ -25,6 +25,7 @@ #include "xf86RAC.h" +Bool isaSlotClaimed = FALSE; /* * If the slot requested is already in use, return FALSE. @@ -55,6 +56,7 @@ xf86ClaimIsaSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active) p->busAcc = pbap; pbap = pbap->next; } + isaSlotClaimed = TRUE; return num; } diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c b/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c index 45c0b5f26..7ae2c8b40 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.25 2000/11/18 19:37:10 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.28 2000/12/08 20:13:35 eich Exp $ */ /* * Copyright (c) 1997-1999 by The XFree86 Project, Inc. @@ -33,6 +33,7 @@ #include "xf86RAC.h" /* Bus-specific globals */ +Bool pciSlotClaimed = FALSE; pciConfigPtr *xf86PciInfo = NULL; /* Full PCI probe info */ pciVideoPtr *xf86PciVideoInfo = NULL; /* PCI probe for video hw */ pciAccPtr * xf86PciAccInfo = NULL; /* PCI access related */ @@ -1350,7 +1351,7 @@ xf86ReallocatePciResources(int entityIndex, resPtr pRes) */ memType -getValidBIOSBase(PCITAG tag, int num) +getValidBIOSBase(PCITAG tag, int *num) { pciVideoPtr pvp = NULL; PciBusPtr pbp, pbp1; @@ -1418,15 +1419,27 @@ getValidBIOSBase(PCITAG tag, int num) return pvp->biosBase; } } - if (num >= 0 && num <= 5 && - pvp->memBase[num] && (pvp->size[num] >= biosSize)) { + + /* Validate alternate base, and, on failure, look for another one */ + if ((*num < 0) || (*num > 5) || + !pvp->memBase[*num] || (pvp->size[*num] < biosSize)) { + *num = -1; + for (n = 0; n <= 5; n++) { + if (pvp->memBase[n] && (pvp->size[n] >= biosSize)) { + *num = n; + break; + } + } + } + + if (*num >= 0) { /* then try suggested memBase */ /* keep bios size ! */ - P_M_RANGE(range,TAG(pvp),pvp->memBase[num],biosSize,ResExcMemBlock); + P_M_RANGE(range,TAG(pvp),pvp->memBase[*num],biosSize,ResExcMemBlock); if (xf86IsSubsetOf(range,m) && !ChkConflict(&range,avoid,SETUP)) { xf86FreeResList(avoid); xf86FreeResList(m); - return pvp->memBase[num]; + return pvp->memBase[*num]; } } while (m) { @@ -1441,6 +1454,9 @@ getValidBIOSBase(PCITAG tag, int num) xf86FreeResList(avoid); xf86FreeResList(m); + xf86MsgVerb(X_INFO,5,"GetVaildBIOSBase for %x:%x:%x: BIOSbase 0x%lx\n", + pvp->bus,pvp->device,pvp->func, + (memType)M2B(TAG(pvp),range.rBase)); return M2B(TAG(pvp),range.rBase); } @@ -1659,7 +1675,6 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo) PciBus->brfunc = pcrp->funcnum; PciBus->subclass = sub_class; xf86MsgVerb(X_INFO,3,"PCI-to-ISA bridge:\n"); - printBridgeInfo(PciBus); break; case PCI_SUBCLASS_BRIDGE_HOST: *pnPciBus = PciBus = xnfcalloc(1, sizeof(PciBusRec)); @@ -1674,7 +1689,6 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo) PciBus->preferred_pmem = xf86ExtractTypeFromList( xf86PciBusAccWindowsFromOS(),ResMem); xf86MsgVerb(X_INFO,3,"Host-to-PCI bridge:\n"); - printBridgeInfo(PciBus); break; default: break; @@ -1711,7 +1725,6 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo) PciBus->preferred_pmem = xf86ExtractTypeFromList( xf86PciBusAccWindowsFromOS(),ResMem); xf86MsgVerb(X_INFO,3,"Host-to-PCI bridge:\n"); - printBridgeInfo(PciBus); } } } @@ -1734,11 +1747,11 @@ xf86GetPciBridgeInfo(const pciConfigPtr *pciInfo) PciBus->pmem = PciBus1->pmem ? PciBus1->pmem : PciBus1->preferred_pmem; xf86MsgVerb(X_INFO,3,"Subtractive PCI-to-PCI bridge:\n"); - printBridgeInfo(PciBus); break; } } } + printBridgeInfo(PciBus); } return PciBusBase; @@ -1767,7 +1780,6 @@ alignBridgeRanges(PciBusPtr PciBusBase, PciBusPtr primary) xf86FreeResList(PciBus->preferred_mem); PciBus->preferred_mem = tmp; xf86MsgVerb(X_INFO,3,"PCI-to-PCI bridge:\n"); - printBridgeInfo(PciBus); alignBridgeRanges(PciBusBase, PciBus); } } @@ -2360,6 +2372,7 @@ xf86ClaimPciSlot(int bus, int device, int func, DriverPtr drvp, /* in case bios is enabled disable it */ disablePciBios(pciTag(bus,device,func)); + pciSlotClaimed = TRUE; return num; } else @@ -2917,7 +2930,12 @@ pciConvertListToHost(int bus, int dev, int func, resPtr list) void pciConvertRange2Host(int entityIndex, resRange *pRange) { - PCITAG tag = TAG(xf86GetPciInfoForEntity(entityIndex)); + PCITAG tag; + pciVideoPtr pvp; + + pvp = xf86GetPciInfoForEntity(entityIndex); + if (!pvp) return; + tag = TAG(pvp); pciTagConvertRange2Host(tag, pRange); } diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c b/xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c index 5f711f87b..3c7be73ab 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c @@ -20,7 +20,7 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c,v 3.4 2000/12/01 15:28:10 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86sbusBus.c,v 3.5 2000/12/06 15:35:11 eich Exp $ */ #include <ctype.h> #include <stdio.h> @@ -40,6 +40,8 @@ #define FB_DEV_PATH "/dev/fb%d" +Bool sbusSlotClaimed = FALSE; + sbusDevicePtr *xf86SbusInfo = NULL; static int xf86nSbusInfo; @@ -372,6 +374,7 @@ xf86ClaimSbusSlot(sbusDevicePtr psdp, DriverPtr drvp, p->access = xnfcalloc(1,sizeof(EntityAccessRec)); p->access->fallback = &AccessNULL; p->access->pAccess = &AccessNULL; + sbusSlotClaimed = TRUE; return num; } else return -1; diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86str.h b/xc/programs/Xserver/hw/xfree86/common/xf86str.h index bad345055..ecebca966 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86str.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86str.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.73 2000/10/24 22:45:05 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.74 2000/12/13 02:44:59 tsi Exp $ */ /* * Copyright (c) 1997-2000 by The XFree86 Project, Inc. @@ -691,6 +691,26 @@ typedef struct { #define PROBE_TRYHARD 0x02 /* + * Driver entry point types + */ +typedef struct _ScrnInfoRec *ScrnInfoPtr; + +typedef Bool xf86ProbeProc (DriverPtr, int); +typedef Bool xf86PreInitProc (ScrnInfoPtr, int); +typedef Bool xf86ScreenInitProc (int, ScreenPtr, int, char**); +typedef Bool xf86SwitchModeProc (int, DisplayModePtr, int); +typedef void xf86AdjustFrameProc (int, int, int, int); +typedef Bool xf86EnterVTProc (int, int); +typedef void xf86LeaveVTProc (int, int); +typedef void xf86FreeScreenProc (int, int); +typedef int xf86ValidModeProc (int, DisplayModePtr, Bool, int); +typedef void xf86EnableDisableFBAccessProc(int, Bool); +typedef int xf86SetDGAModeProc (int, int, DGADevicePtr); +typedef int xf86ChangeGammaProc (int, Gamma); +typedef void xf86PointerMovedProc (int, int, int); +typedef Bool xf86PMEventProc (int, pmEvent); + +/* * ScrnInfoRec * * There is one of these for each screen, and it holds all the screen-specific @@ -817,7 +837,7 @@ typedef struct _ScrnInfoRec { */ int reservedInt[NUM_RESERVED_INTS]; - int * entityInstanceList; + int * entityInstanceList; pointer reservedPtr[NUM_RESERVED_POINTERS]; /* @@ -825,24 +845,20 @@ typedef struct _ScrnInfoRec { * */ - Bool (*Probe)(DriverPtr drv, int flags); - Bool (*PreInit)(struct _ScrnInfoRec *pScrn, int flags); - Bool (*ScreenInit)(int scrnIndex, ScreenPtr pScreen, - int argc, char **argv); - Bool (*SwitchMode)(int scrnIndex, DisplayModePtr mode, - int flags); - void (*AdjustFrame)(int scrnIndex, int x, int y, int flags); - Bool (*EnterVT)(int scrnIndex, int flags); - void (*LeaveVT)(int scrnIndex, int flags); - void (*FreeScreen)(int scrnIndex, int flags); - int (*ValidMode)(int scrnIndex, DisplayModePtr mode, - Bool verbose, int flags); - void (*EnableDisableFBAccess)(int scrnIndex, Bool enable); - int (*SetDGAMode)(int scrnIndex, int num, - DGADevicePtr devRet); - int (*ChangeGamma)(int scrnIndex, Gamma newGamma); - void (*PointerMoved)(int scrnIndex, int x, int y); - Bool (*PMEvent)(int scrnIndex, pmEvent event); + xf86ProbeProc *Probe; + xf86PreInitProc *PreInit; + xf86ScreenInitProc *ScreenInit; + xf86SwitchModeProc *SwitchMode; + xf86AdjustFrameProc *AdjustFrame; + xf86EnterVTProc *EnterVT; + xf86LeaveVTProc *LeaveVT; + xf86FreeScreenProc *FreeScreen; + xf86ValidModeProc *ValidMode; + xf86EnableDisableFBAccessProc *EnableDisableFBAccess; + xf86SetDGAModeProc *SetDGAMode; + xf86ChangeGammaProc *ChangeGamma; + xf86PointerMovedProc *PointerMoved; + xf86PMEventProc *PMEvent; /* * This can be used when the minor ABI version is incremented. @@ -851,7 +867,7 @@ typedef struct _ScrnInfoRec { */ funcPointer reservedFuncs[NUM_RESERVED_FUNCS]; -} ScrnInfoRec, *ScrnInfoPtr; +} ScrnInfoRec; typedef struct { diff --git a/xc/programs/Xserver/hw/xfree86/doc/Imakefile b/xc/programs/Xserver/hw/xfree86/doc/Imakefile index ed8c19149..c96c5a56d 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/doc/Imakefile @@ -4,7 +4,7 @@ XCOMM $XConsortium: Imakefile /main/33 1996/10/28 05:12:24 kaleb $ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/Imakefile,v 3.70 2000/12/01 19:47:44 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/Imakefile,v 3.72 2000/12/11 16:06:49 dawes Exp $ #include <Server.tmpl> #include <lnxdoc.rules> @@ -28,6 +28,7 @@ REPORTFORM = BugReport #if !BuildLinuxDocText OSREADMES = \ /*ReadmeFile(Bsdi)*/ \ + ReadmeFile(Darwin) \ /*ReadmeFile(DGUX)*/ \ /*ReadmeFile(FreeBSD)*/ \ ReadmeFile(isc) \ diff --git a/xc/programs/Xserver/hw/xfree86/doc/Install b/xc/programs/Xserver/hw/xfree86/doc/Install index ced646815..205f8d56a 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/Install +++ b/xc/programs/Xserver/hw/xfree86/doc/Install @@ -2,7 +2,7 @@ The XFree86 Project, Inc - 30 June 2000 + 15 December 2000 Abstract @@ -13,36 +13,35 @@ This document contains information about installing the XFree86 binaries as provided by The XFree86 Project. -The XFree86 binaries that we provide for UNIX-like OS's (Linux, the BSDs and -Solaris) are packaged in a platform-independent gzipped format (aka "tar- -balls" identified by the .tgz suffix). Along with the binaries we provide a -customized version of the GNU tar utility called "extract" and an installa- -tion script. We recommend that these be used to install the binaries. +The XFree86 binaries that we provide for UNIX-like OS's (Linux, the BSDs, +Solaris, etc) are packaged in a platform-independent gzipped tar format (aka +"tarballs" identified by the .tgz suffix). Along with the binaries we pro- +vide a customized version of the GNU tar utility called "extract" and an +installation script. We recommend that these be used to install the bina- +ries. 2. Downloading the XFree86 4.0.2 binaries -We, The XFree86 Project, provide XFree86 4.0.2 binaries for a range of oper- -ating systems at our ftp site -<URL:ftp://ftp.xfree86.org/pub/XFree86/4.0.2/binaries/>. Often during -releases, our ftp site is heavily loaded. Instead of downloading directly +We provide XFree86 4.0.2 binaries for a range of operating systems at our ftp +site <URL:ftp://ftp.xfree86.org/pub/XFree86/4.0.2/binaries/>. Often during +releases our ftp site is heavily loaded. Instead of downloading directly from us we recommend that instead you use one of our mirror sites. Another advantage of using our mirror sites is that some of them support http access (ours does not). Our binaries are organized by sub-directories which correspond to each of the OS/platforms for which we provide binaries. First go to the sub-directory -that represents your OS Platform. In some cases (e.g., Linux) there may be a +that represents your OS platform. In some cases (e.g., Linux) there may be a number of choices depending on the architecture or libc version your platform uses. In all case we recommend that you first download the Xinstall.sh -script, and run it as in the following example to find out which binary dis- +script, and run it as in the following example to find out which binary dis- tribution you should download. sh Xinstall.sh -check -The output of this utility tells you which is the correct set of binaries -for you to download. If you are careful with this step you will save your- -self a lot time and trouble from NOT downloading an incompatible distribu- -tion. +The output of this utility tells you which is the correct set of binaries for +you to download. If you are careful with this step you will save yourself a +lot time and trouble from NOT downloading an incompatible distribution. NOTE: the Xinstall.sh script must be downloaded in binary mode, otherwise it won't run correctly. If you get lots of "command not found" messages when @@ -53,7 +52,7 @@ should download that correctly. When downloading it under this name, select "save as" on your browser, and save the file under the name "Xinstall.sh". Once you're run the Xinstall.sh script and found which binary distribution is -suitable for your system, download the necessary files. The twelve (12) +suitable for your system, download the necessary files. The twelve (12) mandatory files for all installations are listed below. If you have not downloaded all of the files, the installer script will complain. @@ -81,6 +80,9 @@ NOTES: is present in the binaries sub-directory for your platform, then it is required. + o The Darwin/Mac OS X distribution doesn't have or require the Xmod.tgz + tarball. + o Some distributions may have additional mandatory tarballs. While rare, the installer script will tell you if any are missing. @@ -226,12 +228,17 @@ later that you need it, you can create it easily by running: 3.2 After the installation is complete The next step is to configure the X server. That is covered in detail in an -as-yet unwritten document :-(. In the meantime, there are two ways to create -a basic X server configuration file for XFree86 4.0.2. One is to run the -xf86config utility. Another is to use the new -configure X server option: +as-yet unwritten document :-(. In the meantime, there are three ways to cre- +ate a basic X server configuration file for XFree86 4.0.2. One is to run the +xf86config utility. Another is to run the xf86cfg utility. The third option +is to use the new -configure X server option: XFree86 -configure +Note that if you are running Darwin/Mac OS X, there is no step 3 :-). You +should skip this step, as configuration is not required or possible. The X +server configuration file is not used on Darwin/Mac OS X. + The X server config file (XF86Config) format has changed compared to 3.3.x. Also, its default location is now /etc/X11. Finally, there is now only one X server for driving video hardware, and it is called "XFree86". Once you're @@ -337,14 +344,14 @@ want to omit those sub-directories, or copy selected files over by hand. Once that's done, the main part of the installation can be done: - ./extract -C /usr/X11R6 X[a-df-uw-z]*.tgz + ./extract -C /usr/X11R6 `pwd`/X[a-df-uw-z]*.tgz ./extract -C /usr/X11R6 Xvfb.tgz # If you are installing Xvfb ./extract -C /var Xvar.tgz /sbin/ldconfig /usr/X11R6/lib # For Linux /sbin/ldconfig -m /usr/X11R6/lib # For FreeBSD, NetBSD, OpenBSD /usr/X11R6/bin/mkfontdir /usr/X11R6/lib/X11/fonts/misc - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml,v 1.7 2000/07/03 16:51:11 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml,v 1.10 2000/12/15 19:09:06 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/Install,v 1.7 2000/12/01 19:47:44 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/Install,v 1.10 2000/12/15 19:38:06 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README b/xc/programs/Xserver/hw/xfree86/doc/README index ff349ebd4..d0403f5ed 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README +++ b/xc/programs/Xserver/hw/xfree86/doc/README @@ -2,7 +2,7 @@ The XFree86 Project, Inc - 30 June 2000 + 15 December 2000 Abstract @@ -12,16 +12,17 @@ 1. What is XFree86 4.0.2? -XFree86 4.0.2 is a the upgrade to the first full release in the new XFree86 4 -series. Release 4 is a major re-design of the basic architectural underpin- +XFree86 4.0.2 is the third full release in the new XFree86 4 series. + +XFree86 release 4 is a major re-design of the basic architectural underpin- nings of XFree86's implementation of the original X Consortium's X Server. This re-design allows for a modular interaction between the hardware drivers -and the XFree86 core X server. With 4.0, upgrades to the X server with new +and the XFree86 core X server. With 4.x, upgrades to the X server with new and unsupported hardware can be easily done and installed without undergoing -the previous process of rebuilding a X server. All that is required is +the previous process of rebuilding an X server. All that is required is installing the new driver module and updating the configuration file. -The road to XFree86 Release 4 began as an architectural concept in mid 1997, +The road to XFree86 release 4 began as an architectural concept in mid 1997, with the serious framework being implemented in code the beginning of 1998. There were several snapshots on the road to 4.0 which are now part of the 4.0 base release. The 4.0.2 version is an upgrade to 4.0.1, which include more @@ -29,12 +30,13 @@ hardware ports, code enhancements and bug fixes. Release 4 also included the long-awaited integration of the DRI (Direct Ren- dering Infrastructure). This upgrade into the code base gives XFree86 the -abilities of direct 3-D graphics rendering, used widely in games and other -visualization programs. +abilities of accelerated direct 3-D graphics rendering, used widely in games +and other visualization programs. -Many drivers used in the old 3.3.x series have not be converted over to the -4.0 design and so check first whether your hardware is supported before -upgrading to the 4.0 series in the Driver Status document. +While some driver available in the old 3.3.x release series have not been +converted over to the 4.x series, those required for most modern video hard- +ware are available. Please check the Driver Status document first to see +whether your hardware is supported before upgrading to the 4.x series. Specific release enhancements can be viewed in the Release Notes. @@ -49,9 +51,9 @@ can be found in the License Document. 2.1 Development If you would like to work on the development of XFree86 4, either by helping -with the conversion of our older drivers to the new 4.0 design, or assisting +with the conversion of our older drivers to the new 4.x design, or assisting in the addition of new drivers or platforms to the code base then send a -request to to join the XFree86 development team +request to join the XFree86 development team <URL:http://www.xfree86.org:/developer.html>. This will give you direct access to the latest XFree86 related development topics and discussions. Include in your note, your name, email address, reason for joining (what you @@ -97,13 +99,6 @@ tory this is the list that will show you those updates. This list is updated dynamically every time the repository is updated after the the commit hap- pens. -A followup to the commit list is the soon to be public, patch archives. This -archive will be available on our web-site and will show what patches have -been submitted and will soon be committed. This is helpful for people who -are interested in a specific area and want to know what work is happening -there. When this goes public we will announce it on our web site and our -Announce mailing list, so keep watching. - 3.4 Xpert If instead you are the lone developer who is improving XFree86 on an ad hoc @@ -134,13 +129,19 @@ for the general X11 documentation. The third contains the general X11 docu- mentation in hardcopy format. A source patch relative to version 4.0.1 is also available. Because of its -size, it is split into two parts. The patch files are 4.0.1-4.0.2.diff1.gz -and 4.0.1-4.0.2.diff2.gz. These patches should be applied to a clean 4.0.1 -source tree, working from the directory containing the xc/ directory. The -patches should be applied by running: +size, it is split into four parts. The patch files are 4.0.1-4.0.2.diff1.gz, +4.0.1-4.0.2.diff2.gz, 4.0.1-4.0.2.diff3.gz and 4.0.1-4.0.2.diff4.gz. There +is also a tarball that contains some files that have components that can't be +included in a diff. It is 4.0.2.tgz. These patches should be applied to a +clean 4.0.1 source tree, working from the directory containing the xc/ direc- +tory. The patches should be applied by running: + + gzip -d < 4.0.1-4.0.2.diff1.gz | patch -p0 -E + gzip -d < 4.0.1-4.0.2.diff2.gz | patch -p0 -E + gzip -d < 4.0.1-4.0.2.diff3.gz | patch -p0 -E + gzip -d < 4.0.1-4.0.2.diff4.gz | patch -p0 -E - gunzip < 4.0.1-4.0.2.diff1.gz | patch -p0 -E - gunzip < 4.0.1-4.0.2.diff2.gz | patch -p0 -E + gzip -d < 4.0.2.tgz | tar vxf - The contrib part of the distribution has been folded into the main source tree, so a separate contrib tarball is no longer required. @@ -157,7 +158,7 @@ yourself, send the entire log file with your bug report but not the operating system core dump. Do not edit the log file as our developers use it to reproduce and debug your problem. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.107 2000/07/02 16:35:56 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.110 2000/12/15 16:11:57 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README,v 3.107 2000/12/01 19:47:45 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README,v 3.109 2000/12/15 18:14:32 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.DRI b/xc/programs/Xserver/hw/xfree86/doc/README.DRI index ce89d4218..014dac552 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.DRI +++ b/xc/programs/Xserver/hw/xfree86/doc/README.DRI @@ -76,7 +76,7 @@ giving both byte and word alignment access to the DRI/Mesa drivers. Use this as an example of compiling with this extra speed. In your host.def file that should reside in the xc/config directory, add the line. -#define DefaultCCOptions -ansi GccWarningOptions -pipe -mcpu=ev6 +#define DefaultGcc2AxpOpt -O2 -mcpu=ev6 Additional speed improvements to 3D rendering can be achieved by installing Compaq's Math Libraries (CPML) which can be obtained from the following URL. @@ -556,7 +556,7 @@ The kernel module for the Voodoo3 is named tdfx.o and should be installed in /lib/modules/2.4.x/kernel/driver/char/drm/. It will be automatically loaded by the Xserver if needed. -The DRI 3D driver for the Voodoo3 hould be in /usr/X11R6/lib/mod- +The DRI 3D driver for the Voodoo3 should be in /usr/X11R6/lib/mod- ules/dri/tdfx_dri.so. This will be automatically loaded by libGL.so. 10.1.3 Troubleshooting @@ -595,7 +595,7 @@ ules/dri/tdfx_dri.so. This will be automatically loaded by libGL.so. o Setting GL_LIGHT_MODEL_COLOR_CONTROL to GL_SEPARATE_SPECULAR_COLOR. - o Enabling line stippline or polygon stippling. + o Enabling line stippling or polygon stippling. o Enabling point smoothing or polygon smoothing. @@ -674,7 +674,7 @@ The kernel module for the Voodoo5 is named tdfx.o and should be installed in /lib/modules/2.4.x/kernel/driver/char/drm/. It will be automatically loaded by the Xserver if needed. -The DRI 3D driver for the Voodoo5 hould be in /usr/X11R6/lib/mod- +The DRI 3D driver for the Voodoo5 should be in /usr/X11R6/lib/mod- ules/dri/tdfx_dri.so. This will be automatically loaded by libGL.so. The Voodoo5 supports 3D rendering in 16 and 32 bpp modes. When running in @@ -868,7 +868,7 @@ Software rendering will be used under any of the following conditions: There have been problems in the past with the MGA driver being very sluggish when the DRI is enabled (to the point of being unusable.) This is caused by the graphics card not having an interrupt assigned to it. The current DRI -trunk will attempt to detect this condition and bail outgracefully. +trunk will attempt to detect this condition and bail out gracefully. The solution to the above problem is to assign an interrupt to your graphics card. This is something you must turn on in your system BIOS configuration. @@ -880,7 +880,7 @@ interrupt for your graphics card. MGAHALlib.a is a binary library Matrox has provided for use under Linux to expose functionality for which they can not provide documentation. (For example TV-Out requires MacroVision be enabled on the output.) This binary -library also sets the pixel/memory clocks to the optimial settings for your +library also sets the pixel/memory clocks to the optimal settings for your Matrox card. Currently the MGAHAL library is required for the G450 to work. You can down- @@ -1078,7 +1078,7 @@ forge.net/resources/resources.html o In the future there may be IHV and Linux vendor support resources for the DRI. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.13 2000/12/01 14:28:55 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.15 2000/12/12 18:54:29 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.11 2000/12/01 19:47:46 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.12 2000/12/12 19:04:02 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp b/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp index d2d81ddea..66c216950 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp +++ b/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp @@ -268,7 +268,8 @@ make adjustments for your particular system configuration The default host.def file will look something like this: #define DefaultCCOptions -Wall - #define DefaultGcc2i386Opt -O2 + (i386) #define DefaultGcc2i386Opt -O2 + (Alpha) #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar) #define LibraryCDebugFlags -O2 #define BuildServersOnly YES #define XF86CardDrivers vga tdfx mga r128 i810 @@ -513,7 +514,7 @@ At this point your X server should be up and running with hardware-acceler- ated direct rendering. Please read the DRI User Guide for information about trouble shooting and how to use the DRI-enabled X server for 3D applications. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.8 2000/12/01 14:28:55 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.9 2000/12/12 17:48:10 alanh Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.5 2000/12/01 19:47:46 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.6 2000/12/12 19:04:02 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.Darwin b/xc/programs/Xserver/hw/xfree86/doc/README.Darwin new file mode 100644 index 000000000..c3d118175 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/doc/README.Darwin @@ -0,0 +1,348 @@ + XFree86 on Darwin and Mac OS X + + Torrey T. Lyons + + 11 December 2000 + +1. Introduction + +XFree86, a free implementation of X Windows, has been ported to Darwin and +Mac OS X. This document is a collection of information for anyone experiment- +ing with running X Windows on Apple's next generation operating system. +Please send any comments on this page to <torrey@mrcla.com>. If you are also +working on modifications to the Darwin X server, please let me know. + +2. Hardware Support and Configuration + +The Darwin port of XFree86 uses the IOKit for device driver loading and dis- +covery, rather than the XFree86 module loader. Because of this, the XFree86 +configuration file is not used on Darwin systems. The descriptions found +elsewhere of devices supported by XFree86 for other operating systems also do +not apply. + +XFree86 for Darwin will work with any video card that you have an IOKit +driver for. If you are running Mac OS X, this typically means any card that +has been shipped by Apple. If a card works for you with the Mac OS X GUI, it +will work on the same machine with XFree86. If you have a pure Darwin instal- +lation, your hardware support may be somewhat limited because Apple does not +include all its hardware drivers with Darwin. IOKit drivers are typically +found in /System/Library/Extensions/ or /Library/Extensions/. + +Multi-button and scroll wheel mouse support works well with all USB mice that +I have tested. I have done no testing with serial mice. + +3. Getting Started + +Following are instructions for building and running your own copy of XFree86. +The procedure for getting your X server up and running on Darwin and Mac OS X +are very similar, but it is actually somewhat more difficult on Mac OS X. +Where there are differences I have noted them below. Both Mac OS X Develop- +ers' Preview 4 and Mac OS X Public Beta are covered. Note that to build +XFree86 for yourself on Mac OS X Beta, you will need to have the Developers' +Tools. If you did not receive these as a member of ADC, they are available +for download from the Apple Developer Connection. + +If you want to save some time, you can use the precompiled binaries provided +by the XFree86 server at <URL:ftp://ftp.xfree86.org/pub/XFree86/4.0.2/bina- +ries/Darwin/>. Follow the instructions in the Install document to install +it. + +This will create two new directory trees, /usr/X11R6 and /private/etc/X11. If +you have the developers' tools, you may have to run ranlib on all the +libraries in /usr/X11R6/lib/* before trying to build other X applications. + +If you get the precompiled binaries you can skip ahead to the section on run- +ning X windows (section 4., page 1) + +On the other hand, if you want to build things yourself from scratch, follow +the directions below. + +If you want to recompile the X server on Mac OS X, you will have to make the +header files as described below (section 3.2, page 1). + +3.1 Get the Code + +The first thing you need to do is to get the source code from the XFree86 +project. + + o Setup CVS: Both Darwin and Mac OS X include CVS (Concurrent Versions + System), which is an easy way to download and keep up to date with open + source code released by XFree86 and others. You do have to setup CVS + properly, however, to tell it where to look. Follow the instructions + here on how to do this either via ssh or via the cvs pserver. + + o Now make a directory in some convenient place which will serve as your + top level directory for you open source development efforts. I am going + to call this directory sandbox/ in the following discussions and you + could put this directory, for example, in ~/sandbox/. + + o From the command line type: + + cd sandbox + cvs checkout xc + + Wait for all the files to complete downloading. + +3.2 Make Header Files for Mac OS X + +These next steps are not necessary if you are building XFree86 on Darwin. Mac +OS X Beta or DP4 does not include many of the 'in-progress' header files that +are needed to successfully build XFree86. The general philosophy is that at +any given time, Mac OS X will include only headers files that are 'ready for +prime time' while Darwin will include a snapshot of Apple's current efforts. +So if you have access to a Darwin system, I would suggest using this instead +of Mac OS X to build XFree86. If you don't, read the appropriate page below +for an outline of what you need to do: + + o Mac OS X Public Beta (section 6.1, page 1) + + o Mac OS X Developers' Preview 4 (section 6.2, page 1) + +3.3 Build XFree86 + +Once you have everything ready it is easy to build and install XFree86. From +the command line: + + cd sandbox/xc + make World >& world.log + + (wait for several hours) + + su root + make install >& install.log + make install.man >& man.log + +4. Run X Windows + +You will want to add the X windows executables to your path. Your path is the +list of directories to be searched when you type a command. You will also +want to add the man pages from XFree86 to the list of pages to be searched +when you are looking for documentation. The way to do this depends on the +shell you are using. With tcsh or csh add the following two lines to a file +in your home directory called .cshrc (create this file if you don't have one +yet): + + setenv MANPATH "${MANPATH}:/usr/X11R6/man:/usr/local/man" + setenv PATH "${PATH}:/usr/X11R6/bin" + +Now type ``source ~/.cshrc;rehash'' to get these changes to take effect. On +future logins, this file will be executed automatically. + +You are now ready to go. On Mac OS X, you have to do a few extra steps each +time you want to run X windows. You can't run XFree86 with CoreGraphics run- +ning since they both want to control the screen. So for Mac OS X you first +need to logout. Then for Mac OS X DP4, from the login window type ``console'' +as the user name and push login. For Mac OS X Beta, type ``>console'' as the +user name. This should shutdown CoreGraphics and bring you up with a text +console. Login again. + +Now from the text console you can start X Windows in either Darwin or Mac OS +X by typing ``startx''. After a brief wait at least one terminal window +should pop up for you. So far it probably isn't very impressive as you might +not even have a window manager running to allow you to move windows around. + +When you are ready to quit X windows type ``exit'' in the main terminal win- +dow or quit with the window manager if you have one running. Unfortunately +the X server won't shutdown correctly and you will get an apparently frozen +screen with only a spinning beachball cursor on it. Nothing you type shows up +on the screen, but in fact your keystrokes are being received by the console. +Type ``logout'' to return to normalcy after a brief delay. With Darwin this +should put you back at the text console login prompt. With Mac OS X, Core- +Graphics will restart and you should be given a login window. + +Customize X Windows + +X windows is very customizable and you will certainly want to change some +things. There is a lot you can do to control how your windows look, how the +windows are moved, resized, etc. You will likely want to get a better window +manager than twm, which is included with XFree86. The .xinitrc file in your +home directory controls what programs are run when you start X windows. You +can find a sample .xinitrc file in /private/etc/X11/xinit/xinitrc. + +There are several window managers that have been ported to Darwin. The best +collection of window managers and other X windows applications is at Dar- +winfo's ports page. Another good place to look for Darwin ports in general is +at Stepwise's Softrak site. + +Good luck! + +5. Outstanding Issues with the X server + +There is a still a lot to be done with the X server. As always please let me +know if you are interested in working on any of these issues. + +Things that are broken: + + o The bell is broken. + + o Server shutdown problem: After quitting the X server the colored beach- + ball cursor reappears, but the screen never returns to the console dis- + play. The console is accepting input however, so typing ``logout'' will + return you to the login prompt. + + o Only one display is currently supported. + + o Screen saver not supported. + + o Key repeat rate can not be adjusted. + +Things I am working on: + + o Allowing rootless use on Mac OS X + + o Correct wake from sleep behavior + +6. Appendix + +6.1 Installing IOKit Header files on Mac OS X Beta + +Here is what you need to do to be able to build XFree86 (or other clients of +IOGraphics services) on Mac OS X Public Beta. + + 1. You need to install some more build tools that aren't included in Mac + OS X Beta, but are included in Darwin. These are needed for the next + step. Go to your development directory and type: + + cvs checkout bootstrap_cmds + cd bootstrap_cmds + make + + Now su to root and do a ``make install'' from the bootstrap_cmds direc- + tory. + + 2. The IOKit framework included with Mac OS X Beta is a little on the + wimpy side, even after installing the Developer Tools. You'll need to + rebuild it, but to do so safely we'll take advantage of the cool direc- + tory structure of Mac OS X and put the new version in /Library/Frame- + works/. This will override the version in /System/Library/Frameworks/. + Or at least, that's where you should put it using the new Mac OS X Beta + file structure, but in fact the compiler doesn't know this and still + looks in /Local/Library/Frameworks. (I have already filed a developer's + bug report on this.) To start we make a copy of the original. Login as + root and do the following: + + cd /Library + mkdir -p Frameworks + cp -R /System/Library/Frameworks/IOKit.framework Frameworks/IOKit.framework + cd / + mkdir -p Local + ln -s /Library /Local/Library + + 3. Now you need to get a full version of the IOKit framework from the Dar- + win repository. This comes as part of the kernel. So, in your develop- + ment directory again: + + cvs checkout xnu + cd xnu + source SETUP/setup.csh + make exporthdrs + make install + + The "make install" will start by assembling all the headers you need, + but then will proceed to build a new kernel. You can Control-C out of + the build once it starts compiling things if you want. Otherwise, just + be patient. + + 4. You also need to get the IOKitUser project, which contains the user + interface to the IOKit, and merge it into the IOKit framework. From + your development directory type: + + cvs checkout IOKitUser + + Then you need to change the Makefile so it builds on top of the new + IOKit framework you are building. Change to the IOKitUser project + directory and edit the Makefile. Change the following line: + + NEXTSTEP_BUILD_OUTPUT_DIR = /$(USER)/build/$(NAME) + + to: + + NEXTSTEP_BUILD_OUTPUT_DIR = <your xnudir>/BUILD/dst/System/Library/Frameworks + + Now, run ``make'' while in the IOKitUser directory. It will likely not + finish building since the IOKitUser project relies on some stuff that + Apple hasn't really made public yet, but it should finish populating + the new IOKit framework with headers and start compiling. (Strangely + enough, the headers installed in your new IOKit framework don't contain + the real header files. They are just single line files with an #import + of the file in your IOKitUser project. This works fine as long as you + don't ever delete or move your IOKitUser project. I imagine that using + ``make install'' would fix this up, but you can't do this as long as + the project doesn't build correctly. So for now you can either move the + header files by hand, or make sure you leave your IOKitUser project in + place.) + + 5. Now put the new IOKit headers into our local copy. Change to the xnu + project directory and do the following as root: + + cd BUILD/dst/System/Library/Frameworks/ + cp -R IOKit.framework/Versions/A/Headers/* \ + /Library/Frameworks/IOKit.framework/Versions/A/Headers + + 6. The System framework needs touching up a bit too. You need to copy the + libkern header files from the new System.framework. As root, go to the + xnu project directory and type: (Of course you could make a local copy + of the System framework in /Library/Frameworks/, but the additions to + the System framework are small.) + + cd BUILD/dst/System/Library/Frameworks/System.framework/Versions/B/Headers + cp -R libkern /System/Library/Frameworks/System.framework/Headers/libkern + +6.2 Installing IOKit Header files on Mac OS X DP4 + +Here is an outline of what you need to do to be able to build XFree86 (or +other clients of IOGraphics services) on Mac OS X Developers' Preview 4. + + 1. Checkout, build, and install bootstrap_cmds from the CVS repository. + + 2. Checkout xnu from the CVS repository. Go to sandbox/xnu and do the fol- + lowing: + + source SETUP/setup.csh + make exporthdrs + + 3. su to root and do the following: + + mkdir -p /Local/Library/Frameworks + cp -R /System/Library/Frameworks/IOKit.framework /Local/Library/Frameworks + + This will create a new local version of the IOKit framework that will + override the System version without changing the original. + + 4. You now want to merge the IOKit headers from the xnu project into your + local IOKit framework. I did this fairly tediously by hand, but I would + suggest something like: + + cp -R sandbox/xnu/BUILD/dst/System/Library/Frameworks/IOKit.framework/Versions/A/Headers \ + /Local/Library/Frameworks/IOKit.framework/Versions/A + + The only problem with this is that there are a few stub header files + included that are just a single line with an #import to the appropriate + place in the xnu source on your disk. This is fine as long as you don't + move your xnu project. If you do, you can copy the original file to + replace the stub. There is probably an easier way to automatically + build a clean version of the IOKit framework, but I didn't find it. + (Let me know if you do.) + + 5. There are just a few more files you need in the IOKit framework. Check- + out the IO project from CVS. Get the necessary header files from there + and put them in your new local IOKit framework. You'll get errors when + you try to build XFree86 from which you can tell which files are + needed. I also needed to make the following patch to IOLLEvent.h. Your + mileage may vary. + + 47c47 + < #include <Kernel/libkern/OSTypes.h> + --- + > #include <libkern/OSTypes.h> + + 6. You'll also need a few extra CoreFoundation header files. Checkout + CoreFoundation. You can make a new local version of the CoreFoundation + framework as above, or just add to the existing one. The files you need + are CFMachPort.h and CFMessagePort.h in the RunLoop.subproj and CFStor- + age.h in Collections.subproj. + + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml,v 1.4 2000/12/12 18:54:29 dawes Exp $ + + +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.Darwin,v 1.3 2000/12/12 19:04:02 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.I128 b/xc/programs/Xserver/hw/xfree86/doc/README.I128 index dfcc279e6..b49c54b22 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.I128 +++ b/xc/programs/Xserver/hw/xfree86/doc/README.I128 @@ -95,9 +95,9 @@ Robin Cutshaw, <robin@XFree86.Org> and special help from: - o Galen Brooks, <galen@nine.com> + o Galen Brooks, <galen@interlabs.com> - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/I128.sgml,v 1.5 2000/11/06 22:03:28 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/I128.sgml,v 1.6 2000/12/13 01:55:47 robin Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.I128,v 1.8 2000/12/01 19:47:46 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.I128,v 1.10 2000/12/14 17:12:00 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.NetBSD b/xc/programs/Xserver/hw/xfree86/doc/README.NetBSD index b9c7542f5..eb704992a 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.NetBSD +++ b/xc/programs/Xserver/hw/xfree86/doc/README.NetBSD @@ -2,7 +2,7 @@ Rich Murphey, David Dawes, Marc Wandschneider, Mark Weaver, Matthieu Herrb - Last modified on: 2 December 2000 + Last modified on: 7 December 2000 1. What and Where is XFree86? @@ -23,7 +23,7 @@ ftp://ftp.XFree86.org/pub/XFree86/4.0.2/binaries/NetBSD A list of mirror sites is provided by http://www.xfree86.org/MIRRORS.shtml XFree86 also builds on other NetBSD architectures. See section Building on -other architectures (section 8.3, page 1) for details. +other architectures (section 8.4, page 1) for details. XFree86 also supports NetBSD on PC98 machines. @@ -270,7 +270,20 @@ You should configure the distribution by editing xc/config/cf/host.def before compiling. To compile the sources, invoke ``make World'' in the xc directory. -8.1 Aperture driver +8.1 Perl support + +Starting with XFree86 4.0.2, perl is needed to build the fonts in XFree86. +Since perl is not included with standard NetBSD installation, fonts that need +perl are not built by default. + +If you have installed perl (from the NetBSD packages, for instance), add the +line + + #define HasPerl YES + +in xc/config/cf/host.def before rebuilding XFree86. + +8.2 Aperture driver To build the XFree86 server with the Aperture driver enabled, you should unpack apNetBSD.shar and install it first. @@ -279,11 +292,9 @@ Then edit xc/config/cf/host.def and add the line #define HasNetBSDApertureDriver YES -to it. - -And finally run make World in the xc directory. +to it before rebuilding XFree86. -8.2 Console drivers +8.3 Console drivers XFree86 has a configuration option to select the console drivers to use in host.def: @@ -304,10 +315,10 @@ adding: #define XFree86ConsoleDefines -DWSCONS_SUPPORT -to xc/config/host.def before rebuilding the server. This has not been tor- +to xc/config/host.def before rebuilding the server. This has not been thor- oughly tested, except on the macppc. -8.3 Building on other architectures +8.4 Building on other architectures Note that the NetBSD project has now its own source tree, based on the XFree86 source tree, with some local modifications. You may want to start @@ -347,7 +358,7 @@ Many thanks to all people who contributed to make XFree86 work on *BSD, in particular, David Dawes, Pace Willison, Amancio Hasty, Christoph Robitschko, Nate Williams, Rod Grimes, Jack Velte and Michael Smith. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.57 2000/12/02 15:27:09 herrb Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.59 2000/12/12 18:54:29 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.NetBSD,v 3.73 2000/12/04 21:01:00 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.NetBSD,v 3.75 2000/12/12 19:04:02 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD b/xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD index 84696018a..23617eb9b 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD +++ b/xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD @@ -37,12 +37,14 @@ See the Release Notes for non-OS dependent new features in XFree86 4.0.2. 3.1 New OS dependent features in 4.0.2 - o Support for the OpenBSD ports tree + o Support for the OpenBSD ports tree, o Preliminary support for the powerpc architecture (clients build and - work, the server doesn't work yet) + work, the server doesn't work yet), - o Xdm now writes an utmp entry + o xdm now writes an utmp entry, + + o startx now creates an Xauthority magic cookie for the display. 3.2 New OS dependent features in 4.0.1 @@ -185,6 +187,38 @@ To enable the aperture driver, once included in the kernel, set in /etc/sysctl.conf. +Some drivers need a patch to the aperture driver in the kernel to work cor- +rectly with int10 support. If you get warning from xf86ReadBIOS like this +one: + + (II) checkDevMem: using aperture driver /dev/xf86 + (WW) xf86ReadBIOS: /dev/mem mmap[s=600,a=0,o=0] failed (Invalid argument) + +you should patch your kernel and rebuild it. Until it's integrated in +OpenBSD-current, or a better fix is found, the patch is available at +ftp://ftp.laas.fr/pub/ii/matthieu/OpenBSD/patch-kernel-xf4. + +I've also included it below, if you want to edit the source file by hand. + + Index: sys/arch/i386/i386/mem.c + =================================================================== + RCS file: /cvs/src/sys/arch/i386/i386/mem.c,v + retrieving revision 1.14 + diff -u -r1.14 mem.c + --- sys/arch/i386/i386/mem.c 1999/11/20 11:11:28 1.14 + +++ sys/arch/i386/i386/mem.c 2000/11/13 10:54:22 + @@ -269,8 +269,8 @@ + /* minor device 4 is aperture driver */ + case 4: + if (allowaperture && + - (((off >= VGA_START && off <= BIOS_END) || + - (unsigned)off > (unsigned)ctob(physmem)))) + + (off <= BIOS_END || + + (unsigned)off > (unsigned)ctob(physmem))) + return i386_btop(off); + else + return -1; + Another (less recommended) way to enable linear memory and I/O ports access is to disable the kernel security feature by adding ``option INSECURE'' in your kernel configuration file and build a new kernel. You will also need to @@ -242,7 +276,7 @@ OpenBSD/powerpc and on OpenBSD/i386 -current can be built by adding: #define XFree86ConsoleDefines -DWSCONS_SUPPORT -to xc/config/host.def before rebuilding the server. This has not been tor- +to xc/config/host.def before rebuilding the server. This has not been thor- oughly tested, except on the macppc. 8.2 Building on other architectures @@ -264,7 +298,7 @@ Many thanks to all people who contributed to make XFree86 work on *BSD, in particular, David Dawes, Pace Willison, Amancio Hasty, Christoph Robitschko, Nate Williams, Rod Grimes, Jack Velte and Michael Smith. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml,v 1.12 2000/12/02 15:27:09 herrb Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml,v 1.15 2000/12/12 18:54:29 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD,v 1.16 2000/12/04 21:01:00 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD,v 1.20 2000/12/12 19:04:02 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.ati b/xc/programs/Xserver/hw/xfree86/doc/README.ati index 7cd6232d1..f42f0ce3e 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.ati +++ b/xc/programs/Xserver/hw/xfree86/doc/README.ati @@ -2,7 +2,7 @@ Marc Aurele La France - 2000 August 3 + 2000 December 6 Abstract @@ -81,8 +81,10 @@ The driver also supports 32K, 64K and 16M-colour modes on the 264xT and 3D Rage series of adapters using the accelerator CRTC (but not the VGA CRTC). The newer Rage 128 and Radeon chips are not yet supported by this driver. -Rage 128's are, however, supported by a separate driver, and Rage 128 owners -should read the r128 driver's documentation for details. +Rage 128's and Radeon's are, however, supported by separate drivers, and own- +ers of such adapters should consult the documentation provided with these +drivers. This driver will also invoke the appropriate driver if it finds +Rage 128 and/or Radeon adapter(s) in the system. Adapters based on the above chips have been marketed under a rather large number of names over the years. Among them are: @@ -671,7 +673,7 @@ newer driver API of XFree86 4.0 and later. The introduction of version 6 is a first swipe at porting the driver to non- Intel architectures. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v 3.33 2000/08/09 02:19:23 tsi Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v 3.34 2000/12/07 15:43:41 tsi Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.ati,v 3.52 2000/12/01 19:47:48 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.ati,v 3.53 2000/12/07 15:48:14 tsi Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.fonts b/xc/programs/Xserver/hw/xfree86/doc/README.fonts index c52eb458e..122b98071 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.fonts +++ b/xc/programs/Xserver/hw/xfree86/doc/README.fonts @@ -1,115 +1,277 @@ Fonts in XFree86 - Juliusz Chroboczek, Juliusz.Chroboczek@ens.fr + Juliusz Chroboczek, <jch@xfree86.org> - 5 March 2000 + 14 December 2000 -XFree86 contains a number of improvements related to fonts, including +1. Introduction - o inclusion of new fonts; +This document describes the support for fonts in XFree86. Section Installing +fonts (section 2., page 1) is aimed at the casual user wishing to install +fonts in the X server; the rest of the document describes the font support in +more detail. - o internationalisation of the scalable font backends (Type 1, Speedo, and - TrueType); +We only describe font support within the core X protocol. Issues relating to +fonts within the RENDER extension, the GLX (OpenGL) extension or the PEX +extension are outside the scope of this document. - o support for TrueType fonts; +We assume some familiarity with digital fonts. If anything is not clear to +you, please consult Appendix Background (section 6., page 1) at the end of +this document for background information. - o support for CID-keyed fonts. +2. Installing fonts -This document describes these improvements. It does not attempt to describe -the standard support for fonts in X11; the reader is referred to the X(1), -Xserver(1), and mkfontdir(1) manpages. +Installing fonts in XFree86 is a two step process. First, you need to create +a font directory that contains all the relevant font files as well as some +index files. You then need to inform the X server of the existence of this +new directory by including it in the font path. -1. Background and terminology +2.1 Installing bitmap fonts -1.1 Characters and glyphs +The XFree86 server can use bitmap fonts in both the cross-platform BDF format +and the somewhat more efficient binary PCF format. (XFree86 also supports +the obsolete SNF format.) -A character is an abstract unit of a writing system. Examples of characters -include the Latin capital letter A, the Arabic letter jim, and the dingbat -black scissors. +Bitmap fonts are normally distributed in the BDF format. Before installing +such fonts, it is desirable (but not absolutely necessary) to convert the +font files to the PCF format. This is done by using the command `bdftopcf', +e.g. -A glyph is a shape that may represent one or many characters when displayed -by a window system or printed by a printer. + $ bdftopcf courier12.bdf -While glyphs roughly correspond to characters in most cases, this correspon- -dence is not, in general, one to one. For example, a font may have many vari- -ant forms of the capital letter A; a single fi ligature may correspond to the -letters f and i. +You may then want to compress the resulting PCF font files: -A coded character set is a set of characters together with a mapping from -integer codes -- known as codepoints -- to characters. Examples of coded -character sets include US-ASCII, ISO 8859-1, KOI8-R, and JIS X 0208(1990). + $ gzip courier12.pcf -A coded character set need not use 8-bit integers to index characters. Many -early mainframes used 6-bit character sets, while 16-bit (or more) character -sets are necessary for ideographic writing systems. +After the fonts have been converted, you should copy all the font files that +you wish to make available into a arbitrary directory, say +`/usr/local/share/fonts/bitmap/'. You should then create the index file +`fonts.dir' by running the command `mkfontdir' (please see the mkfontdir(1) +manual page for more information): -1.2 Font files, fonts, and XLFD + $ mkdir /usr/local/share/fonts/bitmap + $ cp *.pcf.gz /usr/local/share/fonts/bitmap + $ cd /usr/local/share/fonts/bitmap + $ mkfontdir -Traditionally, typographers speak about typefaces and founts (we use the tra- -ditional British spelling to distinguish founts from digital fonts). A type- -face is a particular style or design, such as Times Italic, while a fount is -a molten-lead incarnation of a given typeface at a given size. +All that remains is to tell the X server about the existence of the new font +directory; see Section Setting the server font path (section 2.4, page 1). -Digital fonts come in font files. A font file contains all the information -necessary for generating glyphs of a given typeface, and applications using -font files may access glyph information in arbitrary order. +2.2 Installing scalable fonts -Digital fonts may consist of bitmap data, in which case they are said to be -bitmap fonts. They may also consist of a mathematical description of glyph -shapes, in which case they are said to be scalable fonts. Common formats for -scalable font files are Type 1 (sometimes incorrectly called ATM fonts or -PostScript fonts), Speedo and TrueType. +The XFree86 server supports scalable fonts in four formats: Type 1, Speedo, +TrueType and CIDFont. This section only applies to the former three; for +information on CIDFonts, please see Section Installing CIDFonts (section 2.3, +page 1) later in this document. -The glyph data in a digital font needs to be indexed somehow. How this is -done depends on the font file format. In the case of Type 1 fonts, glyphs -are identified by glyph names. In the case of TrueType fonts, glyphs are -indexed by integers corresponding to one of a number of indexing schemes -(usually Unicode --- see below). +Installing scalable fonts is very similar to installing bitmap fonts: you +create a directory with the font files, and run `mkfontdir' to create an +index file called `fonts.dir'. -The X11 system uses the data in font file to generate font instances, which -are collections of glyphs at a given size indexed according to a given encod- -ing. X11 font instances are specified using a notation known as the X Logi- -cal Font Description (XLFD). An XLFD starts with a dash `-', and consists of -fourteen fields separated by dashes, for example +There is, however, a big difference: `mkfontdir' cannot automatically recog- +nise scalable font files. For that reason, you must first index all the font +files in a file called `fonts.scale'. This file has the same format as a +`fonts.dir' file, and typically looks as follows: - -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1 + 4 + cour.pfa -adobe-courier-medium-r-normal-0-0-0-0-p-0-iso8859-1 + cour.pfa -adobe-courier-medium-r-normal-0-0-0-0-p-0-iso8859-2 + couri.pfa -adobe-courier-medium-i-normal-0-0-0-0-p-0-iso8859-1 + couri.pfa -adobe-courier-medium-i-normal-0-0-0-0-p-0-iso8859-2 -Or particular interest are the last two fields `iso8859-1', which specify the -font instance's encoding. +The first line indicates the number of entries in the file. Each line after +the first consists of two fields separated by a space; the first field is the +name of the font file, and the second one is the name under which the font +will appear to the server. This name should obey the X Logical Font Descrip- +tion conventions (see Section The X Logical Font Description (section 6.2, +page 1)). The format of this file is fully described in the mkfontdir(1) +manual page. -1.3 Unicode +Note that multiple lines may point at the same font file. This is most com- +monly done in order to make a single font available under multiple encodings; +please see Section Fonts and internationalisation (section 4., page 1). -Unicode (<URL:http://www.unicode.org>) is a coded character set with the goal -of uniquely identifying all characters for all scripts, current and histori- -cal. While Unicode was explicitly not designed as a glyph encoding scheme, -it is often possible to use it as such. +While it is possible to create the `fonts.scale' file by hand, it is simpler +and more convenient to have it generated automatically. Utilities to perform +this task are available, but are not currently included with XFree86. For +Type 1 fonts, you may use a utility called `type1inst' which is available +from standard Free Software repositories <URL:http://www.ibib- +lio.org/pub/Linux/X11/xutils/> throughout the world. -Unicode is an open character set, in that codepoint assignments may be added -to Unicode at any time (once specified, though, an assignment can never be -changed). For this reason, a Unicode font will be sparse, and only define -glyphs for a subset of the character registry of Unicode. +For TrueType fonts, you may use `ttmkfdir', available from Joerg Pommnitz's +xfsft page <URL:http://www.joerg-pommnitz.de/TrueType/xfsft.html>. -The Unicode standard is defined in parallel with ISO 10646. Assignments in -the two standards are always equivalent, and this document uses the terms -``Unicode'' and ``ISO 10646'' interchangeably. +After the `fonts.scale' is created, you may run `mkfontdir' as above; this +time, however, you need to create an index of encoding files called `encod- +ings.dir' in addition to the `fonts.dir' file. This is done by using +`mkfontdir' with the `-e' flag: -When used in X11, Unicode-encoded fonts should have the last two fields of -their XLFD set to `iso10646-1'. + $ cd /usr/local/share/fonts/Type1 + $ mkfontdir -e /usr/X11R6/lib/font/encodings + +For more information, please see the mkfontdir(1) manual page and Section +Fonts and internationalisation (section 4., page 1) later in this document. + +2.3 Installing CID-keyed fonts + +The CID-keyed font format was designed by Adobe Systems for fonts with large +character sets. A CID-keyed font, or CIDFont for short, contains a collec- +tion of glyphs indexed by character ID (CID). + +Adobe make some sample CIDFonts and a complete set of CMaps available from +O'Reilly's FTP site <URL:ftp://ftp.oreilly.com/pub/examples/nut- +shell/cjkv/adobe/>. + +In order to map such glyphs to meaningful indices, Adobe provide a set of +CMap files. The PostScript name of a font generated from a CIDFont consists +of the name of the CIDFont and the name of the CMap separated by two dashes. +For example, the font generated from the CIDFont `Munhwa-Regular' using the +CMap `UniKS-UCS2-H' is called + + Munhwa-Regular--UniKS-UCS2-H + +The CIDFont support in XFree86 requires a very rigid directory structure. +The main directory must be called `CID' (its location defaults to +`/usr/X11R6/lib/X11/fonts/CID' but it may be located anywhere), and it should +contain a subdirectory for every CID collection. Every subdirectory must +contain subdirectories called CIDFont (containing the actual CIDFont files), +CMap (containing all the needed CMaps), AFM (containing the font metric +files) and CFM (initially empty). For example, in the case of the font +Munhwa-Regular that uses the CID collection Adobe-Korea1-0, the directory +structure should be as follows: + + CID/Adobe-Korea1/CIDFont/Munhwa-Regular + CID/Adobe-Korea1/CMap/UniKS-UCS2-H + CID/Adobe-Korea1/AFM/Munhwa-Regular.afm + CID/Adobe-Korea1/CFM/ + CID/fonts.dir + CID/fonts.scale + +After creating this directory structure and copying the relevant files, you +should create a <`tt/fonts.scale/' file. This file has the same format as in +the case of (non-CID) scalable fonts, except that its first column contains +PostScript font names with the extension `.cid' appended rather than actual +filenames: + + 1 + Adobe-Korea1/Munhwa-Regular--UniKS-UCS2-H.cid \ + -adobe-munhwa-medium-r-normal--0-0-0-0-p-0-iso10646-1 + +(both names on the same line). As above, running `mkfontdir' creates the +`fonts.dir' file: + + $ cd /usr/local/share/fonts/CID + $ mkfontdir + +Finally, you should create the font metrics summary files in the directory +`CFM' by running the command `mkcfm': -2. New fonts + $ mkcfm /usr/local/share/fonts/CID -2.1 Bitmap fonts +If no CFM files are available, the server will still be able to use the CID +fonts but querying them will take a long time. You should run `mkcfm' again +whenever a change is made to any of the CID-keyed fonts, or when the CID- +keyed fonts are copied to a machine with a different architecture. -XFree86 includes two new Unicode-encoded fonts with a large collection of -non-ideographic glyphs. While it is possible to use these fonts as main -fonts, applications may also use them as fallbacks when a given glyph is not -available in the current font. +2.4 Setting the server's font path -2.1.1 The Unicode `fixed' font +The list of directories where the server looks for fonts is known as the font +path. Informing the server of the existence of a new font directory consists +in putting it on the font path. -The font file +The font path is an ordered list; if a client's request matches multiple +fonts, the first one in the font path is the one that gets used. When match- +ing fonts, the server makes two passes over the font path: during the first +pass, it searches for an exact match; during the second, it searches for +fonts suitable for scaling. - /usr/X11/lib/X11/fonts/misc/6x13.pcf.gz +For best results, scalable fonts should appear in the font path before the +bitmap fonts; this way, the server will prefer bitmap fonts to scalable fonts +when an exact match is possible, but will avoid scaling bitmap fonts when a +scalable font can be used. (The `:unscaled' hack, while still supported, +should no longer be necessary in XFree86 4.0 and later.) + +You may check the font path of the running server by typing the command + + $ xset q + +2.4.1 Temporary modification of the font path + +The `xset' utility may be used to modify the font path for the current ses- +sion. The font path is set with the command xset fp; a new element is added +to the front with xset +fp, and added to the end with xset fp+. For example, + + $ xset +fp /usr/local/fonts/Type1 + $ xset fp+ /usr/local/fonts/bitmap + +Conversely, an element may be removed from the front of the font path with +`xset -fp', and removed from the end with `xset fp-'. + +For more information, please consult the xset(1) manual page. + +2.4.2 Permanent modification of the font path + +The default font path (the one used just after server startup) is specified +in the X server's `XF86Config' file. It is computed by appending all the +directories mentioned in the `FontPath' entries of the `Files' section in the +order in which they appear. + + FontPath "/usr/local/fonts/Type1" + ... + FontPath "/usr/local/fonts/bitmap" + +For more information, please consult the `XF86Config'(5) manual page. + +2.5 Troubleshooting + +If you seem to be unable to use some of the fonts you have installed, the +first thing to check is that the `fonts.dir' files are correct and that they +are readable by the server. If this doesn't help, it is quite possible that +you are trying to use a font in a format that is not supported by your +server. + +XFree86 supports the BDF, PCF, SNF, Type 1, Speedo, TrueType and CIDFont font +formats. However, not all XFree86 servers come with all the font backends +configured in. + +On most platforms, the XFree86 servers are modular: the font backends are +included in modules that are loaded at runtime. The modules to be loaded are +specified in the `XF86Config' file using the `Load' directive: + + Load "Type1" + +If you have trouble installing fonts in a specific format, you may want to +check the server's log file in order to see whether the relevant modules are +properly loaded. The list of font modules distributed with XFree86 is as +follows: + + o "bitmap": bitmap fonts (`*.bdf', `*.pcf' and `*.snf'); + + o "Type1": Type 1 fonts (`*.pfa' and `*.pfb') and CIDFonts; + + o "Speedo": Bitstream Speedo fonts (`*.spd'); + + o "freetype": TrueType fonts (`*.ttf' and `*.ttc'); + + o "xtt": alternate TrueType backend (`*.ttf' and `*.ttc'). + +3. Fonts included with XFree86 + +3.1 Standard bitmap fonts + +The Sample Implementation of X11 comes with a large number of bitmap fonts, +including the `fixed' family, and bitmap versions of Courier, Times and Hel- +vetica. In the SI, these fonts are provided in the ISO 8859-1 encoding (ISO +Latin Western-European). + +In XFree86, a number of these fonts are provided in Unicode-encoded font +files instead. At build time, these fonts are split into font files encoded +according to legacy encodings, a process which enables us to provide the +standard fonts in a number of regional encodings with no duplication of work. + +For example, the font file + + /usr/X11R6/lib/X11/fonts/misc/6x13.bdf with XLFD @@ -117,79 +279,171 @@ with XLFD is a Unicode-encoded version of the standard `fixed' font with added support for the Latin, Greek, Cyrillic, Georgian, Armenian, IPA and other scripts -plus numerous technical symbols. It contains over 2800 characters, covering -all characters of ISO 8859 parts 1-5, 7-10, 13-15, as well as all European -IBM and Microsoft code pages, KOI8, WGL4, and the repertoires of many other -character sets. This font is compatible with the standard 8-bit fixed font -and therefore also includes the DEC line-drawing glyphs in the range 0x00 to -0x1F, which are not part of Unicode or ISO 10646-1. +plus numerous technical symbols. It contains over 2800 glyphs, covering all +characters of ISO 8859 parts 1-5, 7-10, 13-15, as well as all European IBM +and Microsoft code pages, KOI8, WGL4, and the repertoires of many other char- +acter sets. + +This font is used at build time for generating the font files + + 6x13-ISO8859-1.bdf + 6x13-ISO8859-2.bdf + 6x13-ISO8859-3.bdf + 6x13-ISO8859-4.bdf + 6x13-ISO8859-5.bdf + 6x13-ISO8859-7.bdf + 6x13-ISO8859-8.bdf + 6x13-ISO8859-9.bdf + 6x13-ISO8859-10.bdf + 6x13-ISO8859-13.bdf + 6x13-ISO8859-15.bdf + 6x13-KOI8-R.bdf + +with respective XLFDs + + -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-1 + -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-2 + -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-3 + -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-4 + -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-5 + -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-7 + -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-8 + -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-9 + -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-10 + -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-13 + -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-15 + -misc-fixed-medium-r-normal--13-120-75-75-c-60-koi8-r + +The standard short name `fixed' is normally an alias for + + -misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-1 + +(The conversion of the standard fonts to Unicode was mainly performed by +Markus Kuhn. Markus is a man of taste, which makes his use of Perl in the +conversion process somewhat surprising.) + +3.2 The ClearlyU Unicode font family + +The ClearlyU family of fonts provides a set of 12 pt, 100 dpi proportional +fonts with many of the glyphs needed for Unicode text. Together, the fonts +contain approximately 7500 glyphs. -An ISO 8859-1 version of this font is still available in file +The main ClearlyU font has the XLFD - /usr/X11/lib/X11/fonts/misc/6x13-ISO8859-1.pcf.gz + -mutt-clearlyu-medium-r-normal--17-120-100-100-p-101-iso10646-1 -with XLFD +and resides in the font file - -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1 + /usr/X11R6/lib/X11/fonts/misc/cu12.pcf.gz -The standard aliases `fixed' and `6x13' still point at the ISO 8859-1 ver- -sions of the font. +Additional ClearlyU fonts include -2.1.2 The ClearlyU Unicode font + -mutt-clearlyu alternate glyphs-medium-r-normal--17-120-100-100-p-91-iso10646-1 + -mutt-clearlyu pua-medium-r-normal--17-120-100-100-p-111-iso10646-1 + -mutt-clearlyu arabic extra-medium-r-normal--17-120-100-100-p-103-fontspecific-0 + -mutt-clearlyu ligature-medium-r-normal--17-120-100-100-p-141-fontspecific-0 -The ClearlyU font set of fonts provides a set of 12pt, 100dpi proportional -fonts with many of the glyphs needed for Unicode text. Together, the fonts -contain over 4000 glyphs. +The Alternate Glyphs font contains additional glyph shapes that are needed +for certain languages. A second alternate glyph font will be provided later +for cases where a character has more than one commonly used alternate shape +(e.g. the Urdu heh). -The main ClearlyU font has XLFD name +The PUA font contains extra glyphs that are useful for certain rendering pur- +poses. - -mutt-ClearlyU-medium-r-normal--17-120-100-100-p-101-iso10646-1 +The Arabic Extra font contains the glyphs necessary for characters that don't +have all of their possible shapes encoded in ISO 10646. The glyphs are +roughly ordered according to the order of the characters in the ISO 10646 +standard. -and resides in the font file +The Ligature font contains ligatures for various scripts that may be useful +for improved presentation of text. - /usr/X11/lib/X11/fonts/misc/cu12.pcf.gz +(The ClearlyU family was designed by Mark Leisher. Mark's usage of the +foundry name mutt predates the mailer of the same name, but he won't say +more.) -Additional ClearlyU fonts include +3.3 Standard scalable fonts + +XFree86 includes all the scalable fonts distributed with X11R6. + +3.3.1 Standard Type 1 fonts + +The IBM Courier set of fonts cover ISO 8859-1 and ISO 8859-2 as well as Adobe +Standard Encoding. These fonts have XLFD + + -adobe-courier-medium-*-*--0-0-0-0-m-0-*-* + +and reside in the font files - -mutt-ClearlyU Alternate Glyphs-medium-r-normal--17-120-100-100-p-91-iso10646-1 + /usr/X11R6/lib/X11/fonts/Type1/cour*.pfa - -mutt-ClearlyU Arabic Extra-medium-r-normal--17-120-100-100-p-103-fontspecific-0 +The Adobe Utopia set of fonts only cover ISO 8859-1 as well as Adobe Standard +Encoding. These fonts have XLFD - -mutt-ClearlyU Ligature-medium-r-normal--17-120-100-100-p-141-fontspecific-0 + -adobe-utopia-*-*-normal--0-0-0-0-p-0-iso8859-1 - -mutt-ClearlyU PUA-medium-r-normal--17-120-100-100-p-111-iso10646-1 +and reside in the font files -2.2 Scalable fonts + /usr/X11R6/lib/X11/fonts/Type1/UT*.pfa -XFree86 includes the ``Lucidux'' family of Type 1 fonts. This family con- -sists of the fonts ``Lucidux Serif'', with XLFD +Finally, XFree86 also comes with Type 1 versions of Bitstream Courier and +Charter. These fonts have XLFD + + -bitstream-courier-*-*-normal--0-0-0-0-m-0-iso8859-1 + -bitstream-charter-*-*-normal--0-0-0-0-p-0-iso8859-1 + +and reside in the font files + + /usr/X11R6/lib/X11/fonts/Type1/c*bt_.pfb + +3.3.2 Standard Speedo fonts + +XFree86 includes Speedo versions of the Bitstream Courier and Charter fonts. +In order to use these fonts, you should ensure that your X server is loading +the `Speedo' font backend; see Section Troubleshooting (section 2.5, page 1). + +These fonts cover all of ISO 8859-1 and almost all of ISO 8859-2. They have +XLFD name + + -bitstream-courier-*-*-normal--0-0-0-0-m-0-*-* + -bitstream-charter-*-*-normal--0-0-0-0-p-0-*-* + +and reside in the font files + + /usr/X11R6/lib/X11/fonts/Speedo/font*.spd + +3.4 The Bigelow & Holmes Lucidux family + +XFree86 includes the Lucidux family of Type 1 fonts. This family consists of +the fonts Lucidux Serif, with XLFD -b&h-lucidux serif-medium-*-normal--*-*-*-*-p-*-*-* -``Lucidux Sans'', with XLFD +Lucidux Sans, with XLFD -b&h-lucidux sans-medium-*-normal--*-*-*-*-p-*-*-* -and ``Lucidux Mono'', with XLFD +and Lucidux Mono, with XLFD -b&h-lucidux mono-medium-*-normal--*-*-*-*-m-*-*-* Each of these fonts currently comes in Roman and oblique variants (bold vari- ants will be included in a future release) and has 337 glyphs covering the -basic ``ASCII'' glyph set, the Latin 1 glyph set, as well as the ``Extended -Latin'' glyph set. In particular, these fonts include all the glyphs needed -for ISO 8859 parts 1, 2, 3, 4, 9 and 15. +basic ASCII Unicode range, the Latin 1 range, as well as the Extended Latin +range. In particular, these fonts include all the glyphs needed for ISO 8859 +parts 1, 2, 3, 4, 9 and 15. The Lucidux fonts are original designs by Charles Bigelow and Kris Holmes. -Lucidux fonts include seriffed, sans-serif, and monospaced styles which share +Lucidux fonts include seriffed, sans serif, and monospaced styles that share the same stem weight, x-height, capital height, ascent and descent. Lucidux fonts harmonise with Lucida (R) fonts of the same vertical proportions and weights. The character width metrics of Lucidux roman fonts match those of core fonts bundled with several window systems. Each PFA file has a copy of the license terms in PS comment lines. The -license terms are also included in the file COPYRIGHT.BH for convenience, and -in the License document. +license terms are also included in the file `COPYRIGHT.BH' for convenience, +as well as in the License document. The design and font outlines were donated by Charles Bigelow and Kris Holmes from Bigelow and Holmes Inc., and the hinting was donated by Berthold Horn @@ -197,161 +451,157 @@ and Blenda Horn from Y&Y, Inc. For more information, please contact <design@bigelowandholmes.com> or <sales@yandy.com>, or consult Y&Y's web site <URL:http://www.yandy.com>. -3. Internationalisation of scalable font backends. +4. Fonts and internationalisation -The scalable font backends (Type 1, Speedo, TrueType) can now automatically -re-encode fonts to the encoding specified in the XLFD in `fonts.dir'. For -example, a `fonts.dir' file can now contain entries for the Type 1 Courier -font such as +The scalable font backends (Type 1, Speedo and TrueType) can now automati- +cally re-encode fonts to the encoding specified in the XLFD in fonts.dir. +For example, a fonts.dir file can contain entries for the Type 1 Courier font +such as cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1 - cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-2 which will lead to the font being recoded to ISO 8859-1 and ISO 8859-2 respectively. -3.1 The `fontenc' layer +4.1 The fontenc layer -Three of the scalable backends (Type 1, Speedo, and the `freetype' TrueType -backend) use a common `fontenc' layer for font re-encoding. This allows -those backends to share their encoding data, and allows simple configuration -of new locales independently of font type. +Three of the scalable backends (Type 1, Speedo, and the FreeType TrueType +backend) use a common fontenc layer for font re-encoding. This allows these +backends to share their encoding data, and allows simple configuration of new +locales independently of font type. -Please note: the X-TrueType (X-TT) backend does not use the `fontenc' layer, -but instead uses its own method for font reencoding. Readers only interested -in X-TT may want to skip to Using Symbol Fonts (section 3.5, page 1), as the -intervening information does not apply to X-TT. X-TT itself is described in -more detail in X-TrueType (section 4.1.2, page 1). +Please note: the X-TrueType (X-TT) backend does not use the fontenc layer, +but instead uses its own method for font reencoding. If you are only inter- +ested in X-TT you may want to skip to Section Using Symbol Fonts (section +4.5, page 1), as the intervening information does not apply to X-TT. X-TT +itself is described in more detail in Section X-TrueType (section 5.2, page +1). -In the `fontenc' layer, an encoding is defined by a name (such as -`iso8859-1'), eventually a number of aliases (alternate names), and an -ordered collection of mappings. A mapping defines the way the encoding can -be mapped into one of the ``target'' encodings known to the `fontenc' layer; -currently, those consist of Unicode, Adobe glyph names, and arbitrary True- -Type `cmap's. +In the fontenc layer, an encoding is defined by a name (such as iso8859-1), +possibly a number of aliases (alternate names), and an ordered collection of +mappings. A mapping defines the way the encoding can be mapped into one of +the target encodings known to fontenc; currently, these consist of Unicode, +Adobe glyph names, and arbitrary TrueType ``cmap''s. -A number of encodings are hardwired into `fontenc', and are therefore always +A number of encodings are hardwired into fontenc, and are therefore always available; the hardcoded encodings cannot easily be redefined. These include: - o `iso10646-1': Unicode; + o iso10646-1: Unicode; - o `iso8859-1': ISO Latin-1 (Western Europe); + o iso8859-1: ISO Latin-1 (Western Europe); - o `iso8859-2': ISO Latin-2 (Eastern Europe); + o iso8859-2: ISO Latin-2 (Eastern Europe); - o `iso8859-3': ISO Latin-3 (Southern Europe); + o iso8859-3: ISO Latin-3 (Southern Europe); - o `iso8859-4': ISO Latin-4 (Northern Europe); + o iso8859-4: ISO Latin-4 (Northern Europe); - o `iso8859-5': ISO Cyrillic; + o iso8859-5: ISO Cyrillic; - o `iso8859-6': ISO Arabic; + o iso8859-6: ISO Arabic; - o `iso8859-7': ISO Greek; + o iso8859-7: ISO Greek; - o `iso8859-8': ISO Hebrew; + o iso8859-8: ISO Hebrew; - o `iso8859-9': ISO Latin-5 (Turkish); + o iso8859-9: ISO Latin-5 (Turkish); - o `iso8859-10': ISO Latin-6 (Nordic); + o iso8859-10: ISO Latin-6 (Nordic); - o `iso8859-15': ISO Latin-9, or Latin-0 (Revised Western-European); + o iso8859-15: ISO Latin-9, or Latin-0 (Revised Western-European); - o `koi8-r': KOI8 Russian; + o koi8-r: KOI8 Russian; - o `koi8-u': KOI8 Ukrainian (see RFC 2319); + o koi8-u: KOI8 Ukrainian (see RFC 2319); - o `koi8-ru': KOI8 Russian/Ukrainian + o koi8-ru: KOI8 Russian/Ukrainian - o `koi8-uni': KOI8 ``Unified'' (Russian, Ukrainian, and Byelorussian); + o koi8-uni: KOI8 ``Unified'' (Russian, Ukrainian, and Byelorussian); - o `koi8-e': KOI8 `European', ISO-IR-111, or ECMA-Cyrillic; + o koi8-e: KOI8 ``European,'' ISO-IR-111, or ECMA-Cyrillic; - o `microsoft-symbol' and `apple-roman': these are only likely to be use- - ful with TrueType symbol fonts. + o microsoft-symbol and apple-roman: these are only likely to be useful + with TrueType symbol fonts. -New encodings can be added by defining encoding files. When a font encoding -is requested that the `fontenc' layer doesn't know about, the backend checks -the directory in which the font file resides (not the directory with -`fonts.dir'!) for a file named `encodings.dir'. If found, this file is -scanned for the unknown encoding, and the requested encoding definition file -is read in. The mkfontdir(1) utility, when invoked with the `-e' option fol- -lowed by the name of a directory containing encoding files, can be used to -automatically build `encodings.dir' files. See the mkfontdir(1) manpage for -more details. +Additional encodings can be added by defining encoding files. When a font +encoding is requested that the fontenc layer doesn't know about, the backend +checks the directory in which the font file resides (not necessarily the +directory with fonts.dir!) for a file named `encodings.dir'. If found, this +file is scanned for the requested encoding, and the relevant encoding defini- +tion file is read in. The `mkfontdir' utility, when invoked with the `-e' +option followed by the name of a directory containing encoding files, can be +used to automatically build `encodings.dir' files. See the mkfontdir(1) man- +ual page for more details. -A number of predefined encoding files have been included with the distribu- -tion. Information on writing new encoding files can be found in Format of -encodings directory files (section 3.3, page 1) and Format of encodings files -(section 3.4, page 1). +A number of encoding files for common encodings are included with XFree86. +Information on writing new encoding files can be found in Section Format of +encodings directory files (section 4.3, page 1) and Format of encoding files +(section 4.4, page 1) later in this document. -3.2 Backend-specific notes about fontenc +4.2 Backend-specific notes about fontenc -3.2.1 Type 1 +4.2.1 Type 1 The Type 1 backend first searches for a mapping with a target of PostScript. -If one is found, it is used. If none is found, the backend searches for a -mapping with target Unicode, which is then composed with a built-in table -mapping codes to glyph names. Note that this table only covers part of the -Unicode code points that have been assigned names by Adobe. +If one is found, it is used. Otherwise, the backend searches for a mapping +with target Unicode, which is then composed with a built-in table mapping +codes to glyph names. Note that this table only covers part of the Unicode +code points that have been assigned names by Adobe. If neither a PostScript or Unicode mapping is found, the backend defaults to ISO 8859-1. -Specifying an encoding value of `adobe-fontspecific' disables the encoding -mechanism. This is useful with symbol and wrongly encoded fonts (see below). +Specifying an encoding value of adobe-fontspecific disables the encoding +mechanism. This is useful with symbol and incorrectly encoded fonts (see +Section Incorrectly encoded fonts (section 4.6, page 1) below). The Type 1 backend currently limits all encodings to 8-bit codes. -3.2.2 Speedo +4.2.2 Speedo The Speedo backend searches for a mapping with a target of Unicode, and uses it if found. If none is found, the backend defaults to ISO 8859-1. The Speedo backend limits all encodings to 8-bit codes. -3.2.3 The `freetype' TrueType backend +4.2.3 The FreeType TrueType backend The TrueType backend scans the mappings in order. Mappings with a target of PostScript are ignored; mappings with a TrueType or Unicode target are checked against all the cmaps in the file. The first applicable mapping is used. -Authors of encoding files to be used with the TrueType backend should ensure -that mappings are mentioned in decreasing order of preference. +If you are writing an encoding file to be used with the TrueType backend, you +should ensure that mappings are mentioned in decreasing order of preference. -3.3 Format of encodings directory files +4.3 Format of encoding directory files In order to use a font in an encoding that the font backend does not know -about, you need to have a `encodings.dir' file in the same directory as the -font file used. `encodings.dir' has the same format as `fonts.dir'. Its -first line specifies the number of encodings, while every successive line has -two columns, the name of the encoding, and the name of the encoding file; -this can be relative to the current directory, or absolute. Every encoding -name should agree with the encoding name defined in the encoding file. For -example, +about, you need to have an `encodings.dir' file in the same directory as the +font file used. The `encodings.dir' file has a similar format to +`fonts.dir'. Its first line specifies the number of encodings, while every +successive line has two columns, the name of the encoding, and the name of +the encoding file; this can be relative to the current directory, or abso- +lute. Every encoding name should agree with the encoding name defined in the +encoding file. For example, 3 + mulearabic-0 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-0.enc + mulearabic-1 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-1.enc + mulearabic-2 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-2.enc - mulearabic-0 encodings/mulearabic-0.enc - - mulearabic-1 encodings/mulearabic-1.enc - - mulearabic-2 encodings/mulearabic-2.enc - -Note that the name of an encoding must be specified in the encoding file's -STARTENCODING or ALIAS line. It is not enough to create an `encodings.dir' -entry. +The name of an encoding must be specified in the encoding file's `STARTENCOD- +ING' or `ALIAS' line. It is not enough to create an `encodings.dir' entry. If your platform supports it (it probably does), encoding files may be com- pressed or gzipped. -`encoding.dir' files are best maintained by the mkfontdir(1) utility. Please -see the mkfontdir(1) manpage for more information. +The `encoding.dir' files are best maintained by the `mkfontdir' utility. +Please see the mkfontdir(1) manual page for more information. -3.4 Format of encoding files +4.4 Format of encoding files The encoding files are ``free form,'' i.e. any string of whitespace is equiv- alent to a single space. Keywords are parsed in a non-case-sensitive manner, @@ -366,47 +616,45 @@ a line, and all characters following the `#' are ignored, up to the end of the line. The encoding file starts with the definition of the name of the encoding, and -eventually its alternate names (aliases): +possibly its alternate names (aliases): STARTENCODING mulearabic-0 - ALIAS arabic-0 - ALIAS something-else -The names of the encoding should be suitable for use in an XLFD font name, -and therefore contain exactly one dash `-'. +The name of the encoding and its aliases should be suitable for use in an +XLFD font name, and therefore contain exactly one dash `-'. The encoding file may then optionally declare the size of the encoding. For -a linear encoding (such as Mule Arabic, or ISO 8859-1), the SIZE line speci- -fies the maximum code plus one: +a linear encoding (such as ISO 8859-1), the SIZE line specifies the maximum +code plus one: SIZE 0x2B For a matrix encoding, it should specify two numbers. The first is the num- ber of the last row plus one, the other, the highest column number plus one. -For example, in the case of `jisx0208.1990-0' (JIS X 0208(1990), double-byte -encoding, high bit clear), it should be +In the case of `jisx0208.1990-0' (JIS X 0208(1990), double-byte encoding, +high bit clear), it should be SIZE 0x75 0x80 -In the case of a matrix encoding, a `FIRSTINDEX' may be included to specify -the minimum glyph index in an encoding. The keyword `FIRSTINDEX' is followed -by two integers, the minimum row number followed by the minimum column num- -ber: +In the case of a matrix encoding, a `FIRSTINDEX' line may be included to +specify the minimum glyph index in an encoding. The keyword `FIRSTINDEX' is +followed by two integers, the minimum row number followed by the minimum col- +umn number: FIRSTINDEX 0x20 0x20 -In the case of a linear encoding, a `FIRSTINDEX' line should usually not be -included. If for some reason however it is desired that it should be -included, it should be followed by a single integer. +In the case of a linear encoding, a `FIRSTINDEX' line is not very useful. If +for some reason however you chose to include on, it should be followed by a +single integer. -Note that in some font backends inclusion of a `FIRSTINDEX' line has the side +Note that in most font backends inclusion of a `FIRSTINDEX' line has the side effect of disabling default glyph generation, and this keyword should there- fore be avoided unless absolutely necessary. Codes outside the region defined by the `SIZE' and `FIRSTINDEX' lines are -supposed to be undefined. Encodings default to linear encoding with a size +understood to be undefined. Encodings default to linear encoding with a size of 256 (0x100). This means that you must declare the size of all 16 bit encodings. @@ -418,11 +666,11 @@ one of: STARTMAPPING unicode - o a given TrueType `cmap': + o a given TrueType ``cmap'': STARTMAPPING cmap 3 1 - o PostScript glyph names + o PostScript glyph names: STARTMAPPING postscript @@ -431,15 +679,13 @@ the target of the mapping. In mappings with a Unicode or TrueType mapping, codes are mapped to codes: 0x21 0x0660 - 0x22 0x0661 - ... As an abbreviation, it is possible to map a contiguous range of codes in a single line. A line consisting of three integers - start end target + <it/start/ <it/end/ <it/target/ is an abbreviation for the range of lines @@ -458,11 +704,8 @@ For example, the line is an abbreviation for 0x2121 0x8140 - 0x2122 0x8141 - ... - 0x215F 0x817E Codes not listed are assumed to map through the identity (i.e. to the same @@ -471,19 +714,15 @@ a range of codes to be undefined by using an `UNDEFINE' line: UNDEFINE 0x00 0x2A -or, for a single code +or, for a single code, UNDEFINE 0x1234 -This works because later values override earlier one. - PostScript mappings are different. Every line in a PostScript mapping maps a code to a glyph name 0x41 A - 0x42 B - ... and codes not explicitly listed are undefined. @@ -497,116 +736,95 @@ line ENDENCODING -Lines of the form - - UNASSIGNED 0x00 0x1F - -or - - UNASSIGNED 0x1234 - -are ignored by the server, but may be used by supporting utilities. - In order to make future extensions to the format possible, lines starting -with an unknown keyword are ignored, as are mapping sections with an unknown -target. +with an unknown keyword are silently ignored, as are mapping sections with an +unknown target. -3.5 Using symbol fonts +4.5 Using symbol fonts -Type 1 symbol fonts should be installed using the `adobe-fontspecific' encod- +Type 1 symbol fonts should be installed using the adobe-fontspecific encod- ing. In an ideal world, all TrueType symbol fonts would be installed using one of -the `microsoft-symbol' and `apple-roman' encodings. A number of symbol fonts, +the microsoft-symbol and apple-roman encodings. A number of symbol fonts, however, are not marked as such; such fonts should be installed using -`microsoft-cp1252', or, for older fonts, `microsoft-win3.1'. +microsoft-cp1252, or, for older fonts, microsoft-win3.1. In order to guarantee consistent results (especially between Type 1 and True- Type versions of the same font), it is possible to define a special encoding -for a given font. This has already been done for the `ZapfDingbats' font; see -the file `encodings/adobe-dingbats.enc'. +for a given font. This has already been done for the ZapfDingbats font; see +the file encodings/adobe-dingbats.enc. -3.6 Using badly encoded font files +4.6 Hints about using badly encoded fonts A number of text fonts are incorrectly encoded. Incorrect encoding is some- times done by design, in order to make a font for an exotic script appear -like an ordinary Western text font. It is often due to the font designer's -laziness or incompetence; in particular, most people seem to find it easier -to invent idiosyncratic glyph names rather than follow the Adobe glyph list. +like an ordinary Western text font. It is often the result of the font +designer's laziness or incompetence; for some reason, most people seem to +find it easier to invent idiosyncratic glyph names rather than follow the +Adobe glyph list. There are two ways of dealing with such fonts: using them with the encoding they were designed for, and creating an ad hoc encoding file. -Of course, most of the time the proper fix would be to hit the font designer -very hard on the head with the PLRM (preferably the first edition, as it was -published in hardcover). - -3.6.1 Using fonts with the designer's encoding +4.6.1 Using fonts with the designer's encoding In the case of Type 1 fonts, the font designer can specify a default encod- ing; this encoding is requested by using the `adobe-fontspecific' encoding in the XLFD name. Sometimes, the font designer omitted to specify a reasonable -default encoding; in this case, you should experiment with `adobe-standard', -`iso8859-1', `microsoft-cp1252', and `microsoft-win3.1', (`microsoft-symbol' -doesn't make sense for Type 1 fonts). +default encoding, in which case you should experiment with `adobe-standard', +`iso8859-1', `microsoft-cp1252', and `microsoft-win3.1'. (The encoding +`microsoft-symbol' doesn't make sense for Type 1 fonts). -TrueType fonts do not have a default encoding, and use of the Microsoft Sym- -bol encoding yields strange results with text fonts on some (non-X11) plat- -forms. However, most TrueType fonts are designed with either Microsoft or -Apple platforms in mind, so one of `microsoft-cp1252', `microsoft-win3.1', or -`apple-roman' should yield reasonable results. +TrueType fonts do not have a default encoding. However, most TrueType fonts +are designed with either Microsoft or Apple platforms in mind, so one of +`microsoft-symbol', `microsoft-cp1252', `microsoft-win3.1', or `apple-roman' +should yield reasonable results. -3.6.2 Specifying an ad hoc encoding file +4.6.2 Specifying an ad hoc encoding file It is always possible to define an encoding file to put the glyphs in a font -in any desired order. Again, see the `encodingsadobe-dingbats.enc/' file to +in any desired order. Again, see the `encodings/adobe-dingbats.enc' file to see how this is done. -3.6.3 Specifying font aliases +4.6.3 Specifying font aliases By following the directions above, you will find yourself with a number of -fonts with unusual names -- specifying encodings such as `adobe-fontspe- -cific', `microsoft-win3.1' etc. In order to use these fonts with standard -applications, it may be useful to remap them to their proper names. +fonts with unusual names --- with encodings such as `adobe-fontspecific', +`microsoft-win3.1' etc. In order to use these fonts with standard applica- +tions, it may be useful to remap them to their proper names. This is done by writing a `fonts.alias' file. The format of this file is sim- ilar to the format of the `fonts.dir' file, except that it maps XLFD names to XLFD names. A `fonts.alias' file might look as follows: 1 - "-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-iso8859-2" \ - "-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific" (both XLFD names on a single line). The syntax of the `fonts.alias' file is -described in the mkfontdir(1) manual page. - -4. New font backends +precisely described in the mkfontdir(1) manual page. -4.1 New TrueType backends +5. Additional notes about TrueType support -This version of XFree86 comes with two TrueType backends, known as `freetype' -(formerly `xfsft') and `X-TrueType' (`X-TT' for short). Those two backends -are incompatible, in that only one can be used at any one time. Users are -invited to chose whichever backend they find more useful and stick to it. +This version of XFree86 comes with two TrueType backends, FreeType (module +`freetype', formerly known as xfsft) and X-TrueType (module `xtt'). These +two backends are not compatible: only one of them can be used at any one +time. -The `freetype' backend resides in the module `freetype'. Before using it, -please check that the `Module' section of your `XF86Config' file contains a -line that reads +In order to use the FreeType backend, please check that the `Module' section +of your `XF86Config' file contains a line that reads - Load "freetype" + Load "freetype" -The `X-TrueType' backend resides in module `xtt'. In order to use it, -replace the line in your `XF86Config' file that loads the `freetype' module -with a line reading +In order to use the X-TrueType backend, replace the line in your XF86Config +file that loads the freetype module with a line that reads - Load "xtt" + Load "xtt" -Both TrueType backends delay glyph rasterisation to the time at which a glyph -is first used. For this reason, they only provide an approximate value for -the `average width' font property. Users are warned not to rely on the aver- -age width of a font having an accurate value. +Both TrueType backends delay glyph rasterisation up to the time at which a +glyph is first used. For this reason, they only provide an approximate value +for the ``average width'' font property. Both backends also support an optimisation for character-cell fonts (fonts with all glyph metrics equal, or terminal fonts). A font with an XLFD speci- @@ -615,16 +833,17 @@ fying a character-cell spacing `c', as in -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0 will not rasterise glyphs at metrics computation time, but instead trust the -font really to be a character-cell font. Users are encouraged to make use of +font really to be a character-cell font. You are encouraged to make use of this optimisation when useful, but be warned that not all monospaced fonts are character-cell fonts. -4.1.1 The `freetype' TrueType backend +5.1 The FreeType TrueType backend -The `freetype' backend (formerly `xfsft') is a backend based on the FreeType -library (see www.freetype.org) with support for the `fontenc' style of inter- -nationalisation (see The fontenc layer (section 3.1, page 1)). This backend -supports TrueType Font files (*.ttf) and TrueType Collections (*.ttc). +The FreeType backend (formerly xfsft) is a backend based on the FreeType +library (see the FreeType web site <URL:http://www.freetype.org/>) and has +support for the ``fontenc'' style of internationalisation (see Section The +fontenc layer (section 4.1, page 1)). This backend supports TrueType Font +files (`*.ttf') and TrueType Collections (`*.ttc'). In order to access the faces in a TrueType Collection file, the face number must be specified in the fonts.dir file before the filename within colons. @@ -634,7 +853,12 @@ For example, refers to face 2 in the `mincho.ttc' TrueType Collection file. -4.1.2 The `X-TrueType' TrueType backend +The FreeType backend uses the fontenc layer in order to support recoding of +fonts; this was described in Section The fontenc layer (section 4.1, page 1) +and especially Section FreeType-specific notes about fontenc (section 4.2.3, +page 1) earlier in this document. + +5.2 The X-TrueType TrueType backend The `X-TrueType' backend is another backend based on the FreeType library. X-TrueType doesn't use the `fontenc' layer for managing font encodings, but @@ -650,142 +874,141 @@ X-TrueType extends the `fonts.dir' syntax with a number of options, known as and should be specified before the filename. The most useful TTCap option is used to specify the face number to use with -TTCs; it carries the name `fn'. This means that face 2 of font file `min- +TTCs; this is the `fn' TTCap option. For example, face 2 of font file `min- cho.ttc' is specified using: :fn=2:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0 More information on the TTCap syntax, and on X-TrueType in general, may be -found on - - <URL:http://hawk.ise.chuo-u.ac.jp/student/person/tshiozak/x-tt/index-eng.html> - -4.2 Support for CID-keyed fonts - -The CID-keyed font format was designed by Adobe Systems for fonts with large -character sets. It is described in the Adobe Technical Notes nr. 5092, -"Overview of the CID-Keyed Font Technology," nr. 5014, "CMap and CIDFont File -Format Specification," and others, available from - - <URL:http://partners.adobe.com/supportservice/devrelations/typeforum/cidfonts.html> - -Sample CID-keyed fonts can be found at: +found on the X-TrueType home page <URL:http://x-tt.dsl.gr.jp/>. - <URL:ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/> +6. Appendix: background and terminology -Support for CID-keyed fonts in XFree86 is controlled by the two switches -`BuildCID' and BuildCIDFonts. Make sure that those switches are turned on -(in the directory xc/config/cf) when XFree86 is built. By default, they -should be set to YES, unless you are building XFree86 for a small memory -footprint, in which case they should be set to NO. +6.1 Characters and glyphs -The CID-keyed font backend does not use the `fontenc' layer, but instead uses -the standard `CMap' method of recoding CID-keyed fonts. +A computer text-processing system inputs keystrokes and outputs glyphs, small +pictures that are assembled on paper or on a computer screen. Keystrokes and +glyphs do not, in general, coincide: for example, if the system does generate +ligatures, then to the two keystrokes <f><i> will typically correspond a sin- +gle glyph. Similarly, if the system shapes Arabic glyphs in a reasonable +manner, then multiple different glyphs may correspond to a single keystroke. -4.2.1 Using CID-keyed fonts +The complex transformation rules from keystrokes to glyphs are usually fac- +tored into two simpler transformations, going through the intermediary of +characters. You may want to think of characters as the basic unit of data +that is stored e.g. in the buffer of your text editor. While the definition +of a character is intrinsically application-specific, a number of standard- +ised collections of characters have been defined. -As shown in the sample install file /usr/X11R6/lib/X11/XF86Config.eg, the -font directory CID should be specified as part of the XFree86 font path: - - FontPath "/usr/X11R6/lib/X11/fonts/CID/" - -in the `XF86Config' file. When the CID font directory is on the font path it -must contain at least the empty files fonts.dir and fonts.scale. Sample -`fonts.dir' and `fonts.scale' files, with 0 entries, are installed by -default. - -A sample CID-keyed font is provided in the file: - - test/xsuite/xtest/CID - -The test directory was given the same name as the CID font directory, because -it shows how a CID-keyed font should be installed. It contains a number of -subdirectories, and any CID font directory should have the same directory -structure. - -When installing CID-keyed fonts, the empty fonts.scale and fonts.dir files in -the directory: - - xc/fonts/scaled/CID - -should be replaced by fonts.scale and fonts.dir files with a number of -entries of the form: +A coded character set is a set of characters together with a mapping from +integer codes --- known as codepoints --- to characters. Examples of coded +character sets include US-ASCII, ISO 8859-1, KOI8-R, and JIS X 0208(1990). - 1 +A coded character set need not use 8 bit integers to index characters. Many +early mainframes used 6 bit character sets, while 16 bit (or more) character +sets are necessary for ideographic writing systems. - Adobe-Korea1/Munhwa-Regular--Adobe-Korea1-0.cid \ +6.2 Font files, fonts, and XLFD - -adobe-munhwa-medium-r-normal--0-0-0-0-p-0-adobe.korea1-0 +Traditionally, typographers speak about typefaces and founts. A typeface is +a particular style or design, such as Times Italic, while a fount is a +molten-lead incarnation of a given typeface at a given size. -(the font file name and the XLFD name should be on the same line). Note that -the first column does not specify an actual filename; instead, it specifies -the PostScript name of the CID-keyed font, followed by the extension `.cid'. -The actual names of the files used will be derived from this PostScript name. +Digital fonts come in font files. A font file contains all the information +necessary for generating glyphs of a given typeface, and applications using +font files may access glyph information in an arbitrary order. -CID-keyed fonts are divided in groups by character collection. For example, -the Korean font: +Digital fonts may consist of bitmap data, in which case they are said to be +bitmap fonts. They may also consist of a mathematical description of glyph +shapes, in which case they are said to be scalable fonts. Common formats for +scalable font files are Type 1 (sometimes incorrectly called ATM fonts or +PostScript fonts), Speedo and TrueType. - Munhwa-Regular--Adobe-Korea1-0 +The glyph data in a digital font needs to be indexed somehow. How this is +done depends on the font file format. In the case of Type 1 fonts, glyphs +are identified by glyph names. In the case of TrueType fonts, glyphs are +indexed by integers corresponding to one of a number of indexing schemes +(usually Unicode --- see below). -is in a subdirectory `Adobe-Korea1'. +The X11 system uses the data in font file to generate font instances, which +are collections of glyphs at a given size indexed according to a given encod- +ing. -The PostScript name of a CID-keyed font consists of two parts, the CIDFont- -Name and the CMapName, separated by two dashes. For instance, in the case of -the font name +X11 font instances are usually specified using a notation known as the X Log- +ical Font Description (XLFD). An XLFD starts with a dash `-', and consists +of fourteen fields separated by dashes, for example - Munhwa-Regular--Adobe-Korea1-0 + -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1 -the CIDFontName is `Munhwa-Regular' while the CMapName is `Adobe-Korea1'. +Or particular interest are the last two fields `iso8859-1', which specify the +font instance's encoding. -Each CID-keyed font consist of a CIDFont file and one or more CMap files. -The CIDFont file contains the description of each character in a font. It is -stored in the subdirectory CIDFont of the Adobe-Korea1 directory. The direc- -tory structure looks as following: +X11 font instances may also be specified by short name. Unlike an XLFD, a +short name has no structure and is simply a conventional name for a font +instance. Two short names are of particular interest, as they are handled +specially by the server, and the server will not start if font instances with +these names cannot be opened. These are `fixed', which specifies the fall- +back font to use when the requested font cannot be opened, and `cursor', +which specifies the set of glyphs to be used by the mouse pointer. - CID/Adobe-Korea1/CIDFont/Munhwa-Regular +Short names are usually implemented as aliases to XLFDs; the `fixed' and +`cursor' aliases are defined in - CID/Adobe-Korea1/CMap/Adobe-Korea1-0 + /usr/X11R6/lib/X11/font/misc/fonts.alias - CID/Adobe-Korea1/AFM/Munhwa-Regular.afm +6.3 Unicode - CID/Adobe-Korea1/CFM - CID/fonts.dir +Unicode (<URL:http://www.unicode.org>) is a coded character set with the goal +of uniquely identifying all characters for all scripts, current and histori- +cal. While Unicode was explicitly not designed as a glyph encoding scheme, +it is often possible to use it as such. - CID/fonts.scale +Unicode is an open character set, meaning that codepoint assignments may be +added to Unicode at any time (once specified, though, an assignment can never +be changed). For this reason, a Unicode font will be sparse, and only define +glyphs for a subset of the character registry of Unicode. -The file `Munhwa-Regular.afm' is an Adobe Font Metric File (AFM). The direc- -tory `CFM' will be used for summaries of that font metric file, which will be -computed later. +The Unicode standard is defined in parallel with the international standard +ISO 10646. Assignments in the two standards are always equivalent, and this +document uses the terms Unicode and ISO 10646 interchangeably. -When the CID-keyed files are installed you can run the utility +When used in X11, Unicode-encoded fonts should have the last two fields of +their XLFD set to `iso10646-1'. - /usr/X11R6/bin/mkcfm +7. References -to create the summaries of font metric file (*.cfm), and to put them in -appropriate subdirectories. By default, the program works on the directory: +XFree86 comes with extensive documentation in the form of manual pages and +typeset documents. Before installing fonts, you really should read the +mkfontdir(1) manual page; other manual pages of interest include X(1), +Xserver(1), xset(1), xlsfonts(1) and showfont(1). In addition, you may want +to read the X Logical Font Description document, by Jim Flowers, which is +provided in the file `xc/doc/xlfd.PS.Z'. - /usr/X11R6/lib/X11/fonts/CID +The comp.fonts FAQ <URL:http://www.netmeg.net/faq/computers/fonts/>, which is +unfortunately no longer being maintained, contains a wealth of information +about digital fonts. -A different directory can be specified on the command line of `mkcfm.' +The xfsft home page <URL:http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/> +has been superseded by this document, and is now obsolete; you may however +still find some of the information it contains useful. Joerg Pommnitz' xfsft +page <URL:http://www.joerg-pommnitz.de/TrueType/xfsft.html> is the canonical +source for the `ttmkfdir' utility. -`mkcfm' should be run as root, as it needs to write its output to a system -directory. If the program determines that it cannot write in the designated -`CFM' subdirectories, it will display a message, and switch to current direc- -tory. +The documentation of X-TrueType is available from the X-TrueType home page +<URL:http://x-tt.dsl.gr.jp/>. -Unless `mkcfm' is run, opening large CID-keyed fonts will take a significant -amount of time. `mkcfm' should be run again whenever a change is made to any -of the CID-keyed fonts, or when the CID-keyed fonts are copied to a machine -with a different architecture. +A number of East-Asian CIDFonts are available from O'Reilly's FTP site +<URL:ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/>. -4.2.2 Limitations +The Unicode consortium site <URL:http://www.unicode.org> may be of interest. +But you are more likely to find what you need on Markus Kuhn's UTF-8 and Uni- +code FAQ <URL:http://www.cl.cam.ac.uk/~mgk25/unicode.html>. -The current version of the CID-keyed fonts backend only supports the CMaps -used for horizontal text (e.g. the CMap `KSC-EUC-H' will be used, but not -`KSC-EUC-V'). This limitation is due to the fact that the core X11 protocol -only provides support for horizontal writing. +The IANA RFC documents, available from a number of sites throughout the +world, often provide interesting information about character set issues; my +favourite is RFC 373. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml,v 1.8 2000/11/14 16:54:49 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml,v 1.11 2000/12/15 20:01:56 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.12 2000/12/01 19:47:49 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.15 2000/12/15 20:22:16 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.newport b/xc/programs/Xserver/hw/xfree86/doc/README.newport index f67024303..647969cdc 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.newport +++ b/xc/programs/Xserver/hw/xfree86/doc/README.newport @@ -38,7 +38,7 @@ The following Section "Device" options are supported by the newport driver: o all the guys who wrote the newport_con linux kernel code - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/newport.sgml,v 1.1 2000/12/01 19:37:57 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/newport.sgml,v 1.2 2000/12/12 18:54:29 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.newport,v 1.1 2000/12/01 19:47:50 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.newport,v 1.2 2000/12/12 19:04:03 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/RELNOTES b/xc/programs/Xserver/hw/xfree86/doc/RELNOTES index 77b6cb4ea..226506c6f 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/RELNOTES +++ b/xc/programs/Xserver/hw/xfree86/doc/RELNOTES @@ -2,7 +2,7 @@ The XFree86 Project, Inc - 3 July 2000 + 17 December 2000 Abstract @@ -11,74 +11,193 @@ 1. Introduction to the 4.x Release Series -XFree86 4.0 was the first official release of the new XFree86 4. XFree86 4 -represents a significant redesign of the XFree86 X server. Not all of the -hardware drivers from 3.3.x have been ported to 4.x yet, but conversely, 4.x -has some hardware support not present in 3.3.x. We've attempted to provide -some information about the second point in our Driver Status document. -Please check there first before downloading 4.0.2. - -The 4.0.1 has a new configuration tool, "xf86cfg". It is work in progress, -but definitely worth trying out. We have also updated the basic text-based -tool "xf86config" to generate config files in the format required by 4.0.2 -(3.3.x config files won't really work with 4.0.2). We're also on a configu- -ration tool that is built-in to the X server. An early version of this is -included in the release, and it works well for some hardware. To try it out, -just run (as root) "XFree86 -configure". Each of these configuration options -will give you a reasonable starting point for a suitable configuration file. -We've put some effort into documenting the 4.0.2 config file format, and you -can find that information in the XF86Config manual page. Check that, the -driver manual pages and the related documentation for further information. - -Oh, another thing you might notice is that our documentation is rather -patchy. Most of what is present should be in reasonable shape, but there are -gaps. We thought it better to leave out docs that were very out of date -rather than providing inaccurate and misleading information. We are looking -for people to also help fill those gaps in <hint hint :->. - -Finally, before you download and install the binary distributions for this +XFree86 4.0 was the first official release of the new XFree86 4 series. The +current release (4.0.2) is the latest in that series. XFree86 4 represents a +significant redesign of the XFree86 X server. Not all of the hardware +drivers from 3.3.x have been ported to 4.x yet, but conversely, 4.x has some +hardware support not present in 3.3.x. Our Driver Status document summarizes +how the hardware driver support compares between 3.3.6 and 4.0.2. Please +check there first before downloading 4.0.2. + +The 4.0.1 release introduced a new graphical configuration tool, "xf86cfg", +and a text mode interface was added to it for the 4.0.2 release. It is work +in progress, but definitely worth trying out. The trusty old text-based tool +"xf86config" can also be used for generating X server config files. In addi- +tion to these tools, we've been working on a configuration tool that is +built-in to the X server. It is included in the release, and it works well +for some hardware. To try it out, just run (as root) "XFree86 -configure". +Each of these configuration options will give you a reasonable starting point +for a suitable configuration file. We've put some effort into documenting +the 4.0.2 config file format, and you can find that information in the +XF86Config manual page. Check that, the driver manual pages and the related +documentation for further information. + +Before you go to download and install the binary distributions for this release, please have a quick read through the Installation Document. It may -save you some time. +save you some time and help you figure out which of the binary releases you +need. The next section describes what is new in the latest version (4.0.2). The other sections below describe some of the new features and changes between -3.3.x and 4.0. There is a lot of new features, and we definitely don't have -enough space to cover it all here. +3.3.x and 4.0. There are lot's of new features, and we definitely don't have +enough space to cover them all here. 2. Summary of new features in 4.0.2. 2.1 X server - o New DRI drivers for Intel i810, Matrox G400 and G200 (AGP only) and the - ATI Rage 128, and updates to the 3Dfx DRI driver, including Voodoo5 sup- - port. + o Darwin/Mac OS X is now supported and the X server runs on PowerPC. The + X server for this platform is called "Xdarwin", and its installation and + configuration is different from the "XFree86" server used on other plat- + forms. Please read the XFree86 on Darwin and Mac OS X document for fur- + ther information. - o The X server now runs on Linux/Sparc including drivers for many video - cards used on SUN hardware. + o Mesa has been updated to the 3.4 stable release. - o DRI support for the Linux/Sparc implementation that allows 3D direct - rendering with Creator3D cards. + o A driver for ATI Radeon adapters has been added. - o Fixed recently publicized security issues. + o ATI driver support for multi-head configurations and non-Intel platforms + has been improved. - o Update Mesa to the latest version. + o The ATI driver has been changed to invoke the appropriate driver for any + Rage 128 and Radeon adapters that it finds in the system. - o Xinerama updates and fixes. + o A driver (i128) for Number Nine chipsets has been added. - o Xv updates and fixes. + o A driver (savage) for S3 Savage chipsets has been added. - o Mouse support in DGA 1.0 compatibility mode should now work correctly - for most games that make use of it. + o A driver (siliconmotion) for some Silicon Motion chipsets has been + added. - o Some bugs with 8+24 overlay support have been fixed. + o The driver (ark) for Ark Logic chips has been ported to 4.x. - o Some XKEYBOARD extension problems have been fixed, including improve- - ments to the MouseKeys support. + o A VESA driver has been added. - o Add generic DGA support to the sis, neomagic and i810 drivers. + o A driver for SGI newport cards has been added (Linux/mips). - o xf86cfg, a new graphical configuration tool for XFree86 4.0, and can be - used to either write the initial configuration or make customizations to + o The trident driver has lots of fixes to the CyberBlade/Blade support, + XVideo support for the Image/Blade series (although scaling doesn't work + yet on the Image series). + + o The s3virge driver has stabilized ViRGE GX2 support, includes ViRGE DX + and ViRGE support for XVideo YUV images, and various fixes. + + o The 3Dlabs (glint) driver now has Permedia3 support. + + o The SiS driver has had many updates, and XVideo support for the 630 is + included. + + o The NVIDIA (nv) driver has been updated to include support for the + GeForce2, and line acceleration has been added. Also, DDC support has + been improved, and support added for Alpha platforms (dense only). + + o The neomagic driver has had various bug fixes and extended acceleration + support. DGA support has also been added. + + o The Chips and Technologies driver (chips) has initial support for the + 69030. + + o The tseng driver has multi-head fixes and DGA support has been added. + + o Most video drivers have been converted to use the integrated "fb" frame- + buffer code instead of the old "cfb" code. + + o DRI support has been updated for the Rage 128, 3Dfx Voodoo3 and Voodoo5, + Intel i810/i815 and Matrox G400. DRI support for SiS and Sun Creator3D + is available. The DRI is now also available on Alpha platforms. + + o An input driver (citron) for Citron Infrared Touch devices has been + added. + + o An input driver (penmount) for PenMount devices has been added. + + o An input driver (digitaledge) for DigitalEdge devices has been added. + + o Big endian problems in Xinerama have been fixed. + + o The new "render" extension has been added (see below (section 4.11, page + 1)). The design has been extended in the following ways: + + o A new FillRectangles request was added. + + o The 'mask' operand was changed to allow per-channel alphas. + + Server implementation: + + o Implemented remaining code for client clip lists. + + o Fixed plenty of bugs related to text rendering. + + o Complete compositing code, except for separate alpha. + + Todo: + + o Polygons + + o Image scaling + + o Separate alpha channels + + o Support for visuals other than TrueColor. + + Drivers with render extension support include: i128, glint, ati (r128 + and radeon), chips, cirrus, mga, neomagic, nv, tdfx, trident, tseng, + vesa, s3virge. + + Acceleration for the render extension: + + o XAA infrastructure for acceleration. + + o Experimental MGA acceleration using XAA + + o kdrive (TinyX) infrastructure + + o Experimental TinyX Trident 9525DVD acceleration + + Xft library: + + o New font naming/access library. + + o Abstraction for core/Render text. + + o Uses FreeType2 rasterizer. + + o Allows anti-aliased/subpixel sampled text. + + o Gracefully falls back to core rendering. + + o Complicated font matching mechanism. + + o Uses server DPI to convert point sizes to pixel sizes, even for + core fonts. + + xterm: + + o Can use Xft, by default uses core fonts. + + o Uses new options '-fa' for family name and '-fs' for font size (in + points). + + x11perf: + + o Add tests for anti-aliased, subpixel sampled and aliased fonts + using the Xft library. + + xditview: + + o When the Xft library is build, uses Xft for all font access. + + Qt, Gtk, twm: + + o Qt changes available here <URL:http://XFree86.org/~keithp/down- + load/qtkernel.tar.bz2>. + + o Gtk changes in process. + + o twm hacks should never see the light of day. + + o xf86cfg, a new graphical configuration tool for XFree86 4.x, and can be + used to either write the initial configuration or make customisations to the current configuration. xf86cfg is a work in progress, and allows configuration of: @@ -111,102 +230,141 @@ enough space to cover it all here. accepting a key if it is pressed only once and not pressed again in a specific amount of time. - New configuration options are being worked on, as well as correct- - ing some of the bugs in the current options. A protocol for plugging in + New configuration options are being worked on, as well as correcting + some of the bugs in the current options. A protocol for plugging in external modules is also planned. 2.2 X libraries and clients. - o Thread safety issues have been resolved in a few places in the - libraries. Upgrading to the latest libraries is essential for multi- - threaded X applications. - - o Some fatal bugs in the big font support have been fixed. Upgrading to - the latest libraries will fix this too. - - o Fixed recently publicized security issues in some of the X libraries. - - o Updates and bug fixes for some clients, including xedit, xman, xcalc, - fstobdf, xdm. + o Significant updates to the internationalisation support in Xlib (see + below (section 2.3, page 1)). - o Fix some xfs problems. + o Some xfs updates, including font path verification, and new options. - o XTerm updates. These include: + o XTerm updates. - o Improve logfile security. + o New "xvinfo" client for querying the XVideo extension. - o Workaround for fixed fonts which are generated from Unicode fonts: - they omit glyphs for some xterm's less-used line-drawing charac- - ters, which caused xterm to set a flag telling it to use only its - internal line-drawing characters. - - o Limit numeric parameters of control sequences to 65535 to simplify - checks for numeric overflow. - - o Change index into UDK list to unsigned to guard against numeric - overflow making the index negative. - - o Add limit checks to ClearInLine(), ScrnInsertChar(), Scrn- - DeleteChar() to correct potential out-of-bounds indexing. - - o Add a resource (limitResize) limiting resizing via the CSI 4 t and - CSI 8 t sequences. - - o Ignore out-of-bounds resize requests, i.e., where sign-extension or - truncation of the parameters would occur. +2.3 Fonts and Internationalisation - o Change Sun function-keys resource name to sunFunctionKeys to work - around redefinition of the token sun by xrdb on Solaris. Simi- - larly, renamed resource sun keyboard to sunKeyboard. Change simi- - lar resource names for HP and SCO to avoid potential conflict with - xrdb symbols on other systems, as well as for consistency. + o Many of the "misc" bdf fonts have been updated and extended, and a wider + range of ISO-8859 subsets have been added. These are now auto-generated + from ISO-10646 encoded master fonts. - o Change line speed from 9600bd to 38400bd to accommodate users who - mistakenly use $TERM set to vt100, to reduce the effect of padding - associated with this terminal type. + o The ClearlyU ISO-10646 encoded fonts have been updated. - o Fix a problem that caused the right scrollbar to be positioned - incorrectly when re-enabling it. + o Functions to read keyboard input in locale independent UTF-8 encoding + have been added to libX11: Xutf8LookupString, Xutf8ResetIC. - o Fix a problem with color support that showed up on some platforms. + o Functions to output strings in locale independent UTF-8 encoding have + been added to libX11: Xutf8DrawString, Xutf8DrawImageString, Xutf8Tex- + tEscapement, Xutf8TextExtents, Xutf8TextPerCharExtents, Xutf8DrawText. - o Modify logic for deleteIsDEL resource so it has internally 3 - states: unspecified, true and false. If unspecified, the keyboard - type determines whether the Delete key transmits <esc>[3~ or \177, - and the popup menu entry reflects the internal state. Otherwise, - the popup menu entry overrides the keyboard type. + o Functions to convert between Compound Text or locale dependent encoding + and UTF-8 have been added to libX11: Xutf8TextListToTextProperty, + Xutf8TextPropertyToTextList. The converter between Compound Text and + UTF-8 in Xlib has been improved; a round-trip conversion now correctly + converts all graphic Unicode characters back and forth. - o Portability fixes for os390, AIX 4.2, Digital Unix 4.0 and IRIX - 6.5. + o libXaw now offers selected text using both selection targets, + UTF8_STRING and COMPOUND_TEXT. -2.3 Fonts and Internationalisation - - o Many of the "misc" bdf fonts have been updated and extended, and a wider - range of ISO-8859 subsets have been added. Oblique/italic versions of - some of them have also been added. + o Locales with UTF-8 encodings are now supported; but the UTF-8 displaying + facilities are not adequate yet. - o The converters in Xlib have been improved and reworked. UTF-8 support - has been added. + o XKB keyboard definitions have been added and updated for some countries. - o Support for ISO-8859-13 has been added to Xlib and to the UTF-8 convert- - ers. +2.4 Platforms + + o Darwin/Mac OS X. + + o Greatly improved IA-64 support. + + o Improved Linux/mips support. + + o Support has been added for more Alpha platforms under Linux. This now + includes all platforms that require sparse memory mapping. + +3. Drivers + +3.1 Video Drivers + +XFree86 4.0.2 includes the following video drivers: + ++--------------+--------------------------+----------------------------------+ +|Driver Name | Description | Further Information | ++--------------+--------------------------+----------------------------------+ +|apm | Alliance Pro Motion | README.apm | +|ark | Ark Logic | | +|ati | ATI | README.ati, README.r128, r128(4) | +|chips | Chips & Technologies | README.chips, chips(4) | +|cirrus | Cirrus Logic | | +|cyrix (*) | Cyrix MediaGX | README.cyrix | +|fbdev | Linux fbdev | fbdev(4) | +|glide | Glide2x (3Dfx) | glide(4) | +|glint | 3Dlabs, TI | glint(4) | +|i128 | Number Nine | README.I128, i128(4) | +|i740 | Intel i740 | README.i740 | +|i810 | Intel i810 | README.i810, i810(4) | +|imstt | Integrated Micro Solns | | +|mga | Matrox | mga(4) | +|neomagic | NeoMagic | neomagic(4) | +|newport (-) | SGI Newport | README.newport, newport(4) | +|nv | NVIDIA | nv(4) | +|rendition | Rendition | README.rendition, rendition(4) | +|s3virge | S3 ViRGE | README.s3virge, s3virge(4) | +|savage | S3 Savage | savage(4) | +|siliconmotion | Silicon Motion | siliconmotion(4) | +|sis | SiS | README.SiS | +|sunbw2 (+) | Sun bw2 | | +|suncg14 (+) | Sun cg14 | | +|suncg3 (+) | Sun cg3 | | +|suncg6 (+) | Sun GX and Turbo GX | | +|sunffb (+) | Sun Creator/3D, Elite 3D | | +|sunleo (+) | Sun Leo (ZX) | | +|suntcx (+) | Sun TCX | | +|tdfx | 3Dfx | | +|tga | DEC TGA | README.DECtga | +|trident | Trident | trident(4) | +|tseng | Tseng Labs | | +|vesa | VESA | vesa(4) | +|vga | Generic VGA | vga(4) | ++--------------+--------------------------+----------------------------------+ - o XKB keyboard definitions have been added and updated for some countries. +Drivers marked with (*) are present in a preliminary form in this release, +but are not complete and/or stable yet. - o Locale support for Celtic languages has been updated, and a Compose file - for ISO-8859-14 added. +Drivers marked with (+) are for Linux/Sparc only. -2.4 Miscellaneous +Drivers marked with (-) are for Linux/mips only. - o Preliminary support for Linux/mips (no X servers yet). +Darwin/Mac OS X uses IOKit drivers and does not use the module loader drivers +listed above. Further information can be found in README.Darwin. - o Update support for BSD/OS. +XFree86 4.0.2 includes the following input drivers: - o Update Linux/IA64 support. +3.2 Input Drivers - o Support for LynxOS 3.1.0. + +------------+--------------------+---------------------+ + |Driver Name | Description | Further Information | + +------------+--------------------+---------------------+ + |acecad | AceCad | | + |citron | Citron | citron(4) | + |digitaledge | DigitalEdge | | + |dynapro | Dynapro | | + |elographics | EloGraphics | | + |keyboard | generic keyboards | keyboard(4) | + |microtouch | MicroTouch | | + |mouse | most mouse devices | mouse(4) | + |mutouch | MicroTouch | | + |penmount | PenMount | | + |spaceorb | SpaceOrb | | + |summa | SummaGraphics | | + |void | dummy device | void(4) | + |wacom | Wacom tablets | wacom(4) | + +------------+--------------------+---------------------+ -3. The new X server +4. Summary of XFree86 4. Unlike XFree86 3.3.x where there are multiple X server binaries, each of which drive different hardware, XFree86 4.0.2 has a single X server binary @@ -215,11 +373,12 @@ in statically, or, more usually, dynamically load the video drivers and other modules that are needed. XFree86 4.0.2 has X server support for most UNIX(R) and UNIX-like operating -systems on Intel/x86 platforms, plus support for Linux on Alpha, PowerPC and -Sparc platforms. Work on support for additional architectures and operating -systems is in progress, and is planned for future releases. +systems on Intel/x86 platforms, plus support for Linux on Alpha, PowerPC, +IA-64, Sparc, and Mips platforms, and for Darwin on PowerPC. Work on support +for additional architectures and operating systems is in progress, and is +planned for future releases. -3.1 Loader and Modules +4.1 Loader and Modules The XFree86 X server has a built-in run-time loader, donated by Metro Link <URL:http://www.metrolink.com>. This loader can load normal object files and @@ -257,7 +416,7 @@ Note about module security hope to have a mechanism for signing/verifying the modules that we provide available in a future release. -3.2 Configuration File +4.2 Configuration File The X server configuration file format has been extended to handle some of the new functionality. The xf86config utility can be used to generate a @@ -417,7 +576,7 @@ The config file search patch has been extended, with the directories /etc/X11 and /usr/X11R6/etc/X11 being added. The full search path details are docu- mented in the XF86Config manual page. -3.3 Command Line Options +4.3 Command Line Options The following new X server command line options have been added: @@ -528,15 +687,15 @@ The following X server command line options have been changed since 3.3.x: This makes it possible for users to choose from multiple config files that the the sysadmin has provided. -3.4 XAA +4.4 XAA The XFree86 Acceleration Architecture (XAA) has been completely rewritten -from scratch. Most drivers implement acceleration by making use of the XAA -module. +from scratch for XFree86 4.x. Most drivers implement acceleration by making +use of the XAA module. -3.5 Multi-head +4.5 Multi-head -Some multi-head configurations are supported in this release, primarily with +Some multi-head configurations are supported in XFree86 4.x, primarily with multiple PCI/AGP cards. However, this is an area that is still being worked on, and we expect that the range of configurations for which it works well will increase in future releases. A configuration that is known to work well @@ -550,7 +709,7 @@ to be resolved. Some combinations can be made to work better by changing which card is the primary card (either by using a different PCI slot, or by changing the system BIOS's preference for the primary card). -3.6 Xinerama +4.6 Xinerama Xinerama is an X server extension that allows multiple physical screens to behave as a single screen. With traditional multi-head in X11, windows can- @@ -562,24 +721,24 @@ with a 16-bit screen in Xinerama mode. Xinerama is not enabled by default, and can be enabled with the +xinerama command line option for the X server. -Xinerama was included with X11R6.4. The version included in this release was +Xinerama was included with X11R6.4. The version included in XFree86 4.x was completely rewritten for improved performance and correctness. Known problems: - o Most (all?) window managers are not Xinerama-aware, and so some opera- - tions like window placement and resizing might not behave in an ideal - way. This is an issue that needs to be dealt with in the individual - window managers, and isn't specifically an XFree86 problem. + o Most window managers are not Xinerama-aware, and so some operations like + window placement and resizing might not behave in an ideal way. This is + an issue that needs to be dealt with in the individual window managers, + and isn't specifically an XFree86 problem. -3.7 DGA version 2 +4.7 DGA version 2 DGA 2.0 is included in 4.0.2, but is not implemented by all drivers. Prelim- inary documentation for the client libraries can be found in the README.DGA document. A good degree of backwards compatibility with version 1.0 is pro- vided. -3.8 DDC +4.8 DDC The VESA(R) Display Data Channel (DDC[tm]) standard allows the monitor to tell the video card (or on some cases the computer directly) about itself; @@ -601,11 +760,12 @@ to the and non-DDC default value 75 with the -dpi 75 command line option for the X server, or by specifying appropriate screen dimensions with the "Dis- playSize" keyword in the "Monitor" section of the config file. -3.9 GLX and the Direct Rendering Infrastructure (DRI) +4.9 GLX and the Direct Rendering Infrastructure (DRI) -Precision Insight <URL:http://www.precisioninsight.com> has been provided -with funding and support from Red Hat <URL:http://www.redhat.com>, SGI -<URL:http://www.sgi.com>, 3Dfx <URL:http://www.3dfx.com>, Intel +Precision Insight <URL:http://www.precisioninsight.com> (now part of the Pro- +fessional Services group at VA Linux Systems <URL:http://www.valinux.com>) +was provided with funding and support from Red Hat <URL:http://www.red- +hat.com>, SGI <URL:http://www.sgi.com>, 3Dfx <URL:http://www.3dfx.com>, Intel <URL:http://www.intel.com>, ATI <URL:http://www.ati.com>, and Matrox <URL:http://www.matrox.com> to integrate the GLX extension for 3D rendering in an X11 window. The 3D core rendering component is the Mesa @@ -616,192 +776,120 @@ integrated these components into the XFree86 X Server and added a Direct Ren- dering Infrastructure (DRI). Direct Rendering provides a highly optimized path for sending 3D data directly to the graphics hardware. This release provides a complete implementation of direct rendering support for the 3Dfx -Banshee and Voodoo3 graphics cards. Additional direct rendering drivers will -be available for 3Dfx, Intel, ATI and Matrox boards during the second quarter -of 2000. Updated information on DRI compatible drivers can be found at the -DRI Project <URL:http://dri.sourceforge.net> on SourceForge -<URL:http://www.sourceforge.net>. - -3.10 X-Video Extension (Xv) - -An XvQueryPortAttributes function has been added as well as support for XvIm- -ages. XvImages are XImages in alternate color spaces such as YUV and can be -passed to the server through shared memory segments. This allows clients to -display YUV data with high quality hardware scaling and filtering. XvImages -are only supported by the Matrox G200/G400 cards at the moment. - -3.11 Other extensions - -The XFree86-Misc extension has not been fully ported to the new server archi- -tecture yet. This should be completed in a future release. - -The XFree86-VidModeExtension extension has been updated, and mostly ported to -the new server architecture. The area of mode validation needs further work, -and the extension should be used with care. This extension has support for -changing the gamma setting at run-time, for modes where this is possible. -The new xgamma utility makes use of this feature. Compatibility with the -3.3.x version of the extension is provided. The missing parts of this exten- -sion and some new features should be completed in a future release. - -3.12 Drivers - -XFree86 4.0.2 includes the following drivers: - - +------------+-------------------------------------+ - |Driver Name | Description | - +------------+-------------------------------------+ - |apm | Alliance Pro Motion | - |ati | ATI | - |chips | Chips & Technologies | - |cirrus | Cirrus Logic | - |cyrix (*) | Cyrix MediaGX | - |fbdev | Linux fbdev | - |glide | Glide2x (3Dfx) | - |glint | 3Dlabs, TI | - |i740 | Intel i740 | - |i810 | Intel i810 | - |mga | Matrox | - |neomagic | NeoMagic | - |nv | NVIDIA | - |r128 | ATI Rage 128 | - |rendition | Rendition | - |s3virge | S3 ViRGE | - |sis | SiS | - |sunbw2 (+) | Sun bw2 | - |suncg14 (+) | Sun cg14 | - |suncg3 (+) | Sun cg3 | - |suncg6 (+) | Sun GX and Turbo GX | - |sunffb (+) | Sun Creator, Creator3D and Elite 3D | - |sunleo (+) | Sun Leo (ZX) | - |suntcx (+) | Sun TCX | - |tdfx | 3Dfx | - |tga | DEC TGA | - |trident | Trident | - |tseng | Tseng Labs | - |vga | Generic VGA | - +------------+-------------------------------------+ - -Drivers marked with (*) are present in a preliminary form in this release, -but are not complete and/or stable yet. - -Drivers marked with (+) are for Linux/Sparc only. - -3.12.1 APM - -This is the driver for Alliance AT3D/AT25 and AT24 chips. There is a rather -complete support for the functions with acceleration at 8,15,16,24 and 32 -bits (limited by the chip at 24bpp). There is preliminary, still buggy, sup- -port for the AP6422 chip, which is still supported in 3.3.x servers. The Xv -driver is almost ok. The Rush extension for glide2x works, with some addi- -tions, including overlay of the result. DGA and DGA2 have been tested ok. -Further information can be found in README.apm. - -3.12.2 Chips & Technologies - -Information about the C&T driver can be found in README.chips. - -3.12.3 s3virge - -The s3virge driver is a port of the 3.3.x SVGA S3 ViRGE driver. As such it -should be as stable and functional as previous XFree86 releases. There are a -couple additional benefits included primarily due to common enhancements: - - o Depth 24 problems resolved with clients using 24/32 bpp pixmaps. +Banshee, Voodoo3 and Voodoo5 graphics cards, as well as the Intel i810/i815 +cards, ATI Rage 128, and Matrox G400. Updated information on DRI compatible +drivers can be found at the DRI Project <URL:http://dri.sourceforge.net> on +SourceForge <URL:http://www.sourceforge.net>. - o Our common acceleration architecture (XAA) has been re-written, as has - the ViRGE acceleration code. You should find this version has better - performance than prior releases. +4.10 XVideo Extension (Xv) - o Multi-head is reported to work. +The XVideo extension is supported in XFree86 4.x. An XvQueryPortAttributes +function has been added as well as support for XvImages. XvImages are XIm- +ages in alternate color spaces such as YUV and can be passed to the server +through shared memory segments. This allows clients to display YUV data with +high quality hardware scaling and filtering. - o The s3virge man page lists options and has configuration notes for this - release of the driver. +4.11 X Rendering Extension (Render) - o Trio 3D and Trio 3D/2X support has been added, matching the 3.3.6 - driver. +The X Rendering extension provides a 2D rendering model that more closely +matches application demands and hardware capabilities. It provides a render- +ing model derived from Plan 9 based on Porter/Duff image composition rather +than binary raster operations. - o Supports screen rotation and shadow framebuffer. +Using simple compositing operators provided by most hardware, Render can draw +anti-aliased text and geometric objects as well as perform translucent image +overlays and other image operations not possible with the core X rendering +system. -Outstanding items not implemented or fully tested: +XFree86 4.0.2 provides a partial implementation of Render sufficient for +drawing anti-aliased text and image composition. Still to be implemented are +geometric primitives and affine transformation of images. - o DGA support is implemented, but preliminary and untested. +Unlike the core protocol, Render provides no font support for applications, +rather it allows applications to upload glyphs for display on the screen. +This allows the client greater control over text rendering and complete +access to the available font information while still providing hardware +acceleration. The Xft library provides font access for Render applications. -Further information can be found in README.s3virge. +4.11.1 The Xft Library -3.12.4 TGA +On the client side, the Xft library provides access to fonts for applications +using the FreeType library, version 2. FreeType currently supports Type1 and +TrueType font files, a future release is expected to support BDF and PCF +files as well, so Render applications will have access to the complete range +of fonts available to core applications. One important thing to note is that +Xft uses the vertical size of the monitor to compute accurate pixel sizes for +provided point sizes; if your monitor doesn't provide accurate information +via DDC, you may want to add that information to XF86Config. -The TGA driver is now accelerated and supports both 8 and 32 plane frame- -buffers. It is known to work under Linux/Alpha. Please see the -README.DECtga file for further information. +To allow a graceful transition for applications moving from core text render- +ing to the Render extension, Xft can use either core fonts or FreeType and +the Render extension for text. By default, Xft is configured to support only +core fonts, see the section on building FreeType support for the changes +needed to add FreeType/Render fonts. -3.12.5 Matrox +The Xft library uses a configuration file, XftConfig, which contains informa- +tion about which directories contain font files and also provides a sophisti- +cated font aliasing mechanism. Documentation for that file is included in +the Xft man page. -The MGA driver supports the same range or hardware as XFree86 3.3.4, but has -a number of enhancements including multi-head support and support for (non- -destructive) overlays (8-bit + 24-bit). +4.11.2 Building FreeType support for Xft -This release contains performance enhancements for the G400 and particularly -for the G400 MAX. It also includes XvImage support for G200/G400 chips and -improved memory autodetection support. +XFree86 4.0.2 includes sources for FreeType version 2.0.1, but they are not +built and installed automatically. As a result, Xft is configured to provide +only core fonts by default. -Further information can be found in the mga man page. +To build FreeType support for Xft, first FreeType must be built and +installed, either from the sources included in XFree86 in extras/freetype2 or +from another FreeType (version 2.0.1 or later) release. Early FreeType ver- +sion 2 releases used a different header file installation and aren't compati- +ble with XFree86. Instructions for building and installing FreeType can be +found in the INSTALL file included with the FreeType release. -3.12.6 ATI +Second, XFree86 needs to know the installed location for FreeType, usually +/usr/local. Edit (or create) config/cf/host.def to include: -Information about the ATI driver can be found in README.ati <URL:ati.html>. -The current version is not accelerated for all supported chips. Some accel- -eration is included for Mach64 chips. + #define Freetype2Dir /usr/local -3.12.7 NVIDIA +Finally, build XFree86 with "make World" from the top. -The "nv" driver supports all Riva TNT accelerators as well as the GeForce 256 -and Quadro accelerators (the GeForce2 and GeForce2 MX are not yet supported). -DGA 2.0 support is included. +4.11.3 Application Support For Anti-Aliased Text -Further information can be found in the nv man page. +Only three applications have been modified in XFree86 4.0.2 to work with the +Render extension and the Xft and FreeType libraries to provide anti-aliased +text. Xterm, xditview and x11perf. Migration of other applications may +occur in future releases. -3.12.8 Glide +By default, xterm uses core fonts through the standard core API. It has two +command line options and associated resources to direct it to use Xft +instead: -This driver is for Voodoo 1 and Voodoo 2 boards. It runs X on top of the 3DFX -Glide API (where this is available, like for Linux). You need to have Glide -2.x installed before you can run this driver. This driver uses no hardware -acceleration (since there is no 2D acceleration in these boards) but is -rather quick anyway since the CPU renders to local RAM which is then copied -block-wise to the board. Unfortunately the Voodoo 1/2 boards are rather lim- -ited in resolution. The Voodoo 1 can do 800x600 and the Voodoo 2 can do -1024x768 at best, but still it has some use as a second head in Xinerama or -multihead mode. + o -fa family / .VT100.faceName: family. Selects the font family to use. -16 and 24 bpp modes are supported (24 bit in 32-bit sparse-packed mode). + o -fs pointsize / .VT100.faceSize: pointsize. Selects the pointsize. -Further information about this driver can be found in the 'glide' driver man -page for XFree86. You will not get this driver running before reading this -man page. +Xditview will use Xft instead of the core API by default. X11perf includes +tests to measure the performance of text rendered in three ways, anti- +aliased, anti-aliased with sub-pixel sampling and regular chunky text, but +through the Render extension, a path which has not been optimized within the +X server yet. -For Voodoo Banshee and Voodoo 3 boards or later: Please use the tdfx driver -which talks directly to the hardware and is much faster. +4.12 Other extensions -3.12.9 GLINT - -The "glint" driver supports most 3Dlabs/Texas Instruments GLINT/Permedia -chips. There is a rather complete support (better than in 3.3.x) for acceler- -ation at 8, 15, 16, and 24 bit depths (limited by some chips at some depths). -8+24 overlay is supported. The Xv extension is supported for some boards. - -Further information about this driver can be found in the 'glint' driver man -page. - -3.12.10 Trident - -The "trident" driver supports all PCI based Trident cards, including one ISA -based - the 8900D. 3.3.x is still needed for older SVGA ISA/VLB based cards, -yet 4.0.2 is much faster for the newer boards. +The XFree86-Misc extension has not been fully ported to the new server archi- +tecture yet. This should be completed in a future release. -4. X libraries and clients +The XFree86-VidModeExtension extension has been updated, and mostly ported to +the new server architecture. The area of mode validation needs further work, +and the extension should be used with care. This extension has support for +changing the gamma setting at run-time, for modes where this is possible. +The new xgamma utility makes use of this feature. Compatibility with the +3.3.x version of the extension is provided. The missing parts of this exten- +sion and some new features should be completed in a future release. -4.1 Xaw +4.13 Xaw -Two versions of the Xaw library are provided in this release. A version with +Two versions of the Xaw library are provided with XFree86 4.x. A version with bug fixes and a few binary compatible improvements and a new version with several new features. @@ -858,188 +946,11 @@ Bug fixes: o Several bugs were fixed in the text code, while some code was rewritten from scratch. -4.2 Xpm +4.14 Xpm Version 3.4k of the Xpm (X pixmap) library is now integrated into XFree86. -4.3 xterm - -New Features: - - o Support Unix98 PTY's. - - o Support Unicode using UTF-8 input and output. There are a few limita- - tions, this work is still in progress: - - o You must use the -u8 command line option to use this feature, as - well as compile with the OPT_WIDE_CHARS definition. (The feature - is compiled when using imake). - - o Input (from keyboard) and output (select/paste) are in UTF-8 form. - There is no support in Xlib for UTF-8; xterm uses a lookup table to - map keysym codes. Select/paste is done either via STRING or using - the new atom UTF8_STRING. - - o Add optional feature (resource and command-line options) to make xterm - use the PTY's sense of erase character on startup, rather than requiring - it to be \177, or set the PTY's erase character to match xterm's config- - uration. Note that while $TERMCAP is modified to reflect the actual - configuration, the terminfo kdch1 string is not. (This feature is also - in XFree86 3.3.4). - - o Revised keyboard handling, making two modes (VT220 and Sun/PC) which are - switched by popup menu. This makes the numeric keypad work as expected. - Codes sent by the backarrow and delete keys also are affected. - - o Add parameters to function key escape sequences to indicate if shift, - control or alt are set. This works for Sun/PC keyboard mode. - - o Separated command-line and menu settings for reverse video from that - done under program control. This is a problem which was introduced by - X11R6. Though correct, most users are confused by allowing the reset - command to undo the effect of the command-line -rv option. - - o Blinking cursor can be specified by resource or popup menu. - - o New control sequences for switching between normal and alternate screens - maintain separate cursor-save locations for the two screens, avoiding - incorrect cursor placement on exit from vi. - - o Support line-drawing characters when the font does not include them by - drawing them. - - o Add support for switching font sizes, by stepping through the font menu - using shifted keypad plus and minus. - - o New resource trimSelection allows xterm to trim trailing blanks from - selected lines. - - o Provide user applications a means of determining the version of xterm - for feature comparison by returning the patch number (e.g., 111) in the - secondary DA response. - - o Modify treatment of XK_Delete keysym so it transmits parameterized - VT220-style "<esc>[3~" if modifiers (shift, control alt) are given. - - o Add ``cacheDoublesize'' resource to limit the caching of font informa- - tion for double-sized characters, to accommodate X terminals with lim- - ited font memory. - - o Add ``metaSendsEscape'' resource, with corresponding control sequence - and menu entry. Like ``eightBitInput'', this causes xterm to send ESC - prefixing the given key, but applies to all keys and is independent of - the 8-bit/7-bit terminal setting. - - o Implement an 88-color model for systems where 256-colors cannot be allo- - cated. - - o Add support for DEC Locator control sequences for xterm. This allows - the xterm mouse to be used with applications that use the DEC Locator - sequences, such as VAX Tpu, or SMG$ based applications. - - o Implement -hold option, allowing users to retain the window after a - shell has exited. - - o Add an application resource, ``messages'' (and a corresponding -/+mesg - option) which controls the initial permission on the terminal. - - o Implement UTF-8 translation for Media Copy (print) operations. - - o Implement vt320 control sequences for Print Composed Main Display and - for Print All Pages. The latter directs xterm to print the current - screen as well as the scrollback buffer. - -Bug fixes/improvements: - - o If colorMode is enabled by default, compile-in default resources to - match the colors listed in XTerm-col.ad. - - o Deprecate DA answerback string, making it settable via a resource value - for applications which may need this. - - o Input characters which are mapped when in vt220 National Replacement - Character mode. - - o Completed support for double size characters. - - o Remove kfnd/kll/kslt strings from terminfo, because curses applications - do not necessarily return khome/kend pairs. - - o Corrected ifdef's for menus, which did not allow tek4014 to be sup- - pressed properly. - - o Improved tests for determining if xterm should use overstriking to simu- - late bold fonts. - - o Add test/demo scripts for double size characters, font switching, screen - resizing and colors. - - o Amend treatment of ALT key so that if ALT is used as a modifier in key - translations, then no parameter will be sent in escape sequences for - Sun/PC function keys. - - o Improved the ptyInitialErase logic to make it work better with a ter- - minfo library. - - o Modify treatment of line-drawing characters in UTF-8 mode so that Uni- - code values are used rather than characters 1-31 for storing the trans- - lated characters. - - o Modify translation of UTF-8 sequences to reject ``overly long'' varia- - tions. - - o Correct a case where colors were not rendered properly. This happened - when an application inserted several lines, then changed colors. If - this was done all in one write, then there would be no intervening - refresh, and the new color was applied to the pending scrolling opera- - tion which was awaiting the next refresh. - - o Corrected misspelled resource name in command-line option for HP func- - tion keys. - - o Change label on ``Sun/PC Keyboard'' popup menu entry to ``VT220 Key- - board'', since the checked state corresponds to VT220 rather than - Sun/PC. - - o Two corrections to simulation of bold font via overstriking: - - o use clipping to avoid leaving trash at end of the text, and - - o add brackets so wide-character logic does not fall-through into the - overstriking logic. - - o Modify checks for repeat-character control sequence to test the charac- - ter class against xterm's state table, rather than the isprint() macro. - - o Modify terminfo entry for ``xterm-xfree86'' to reflect modifiers for - shift and control. - - o Add several entries to termcap file to make it have the same set of - aliases as the terminfo file. - - o Scale the color values used for xterm-256color terminfo entry to - 0..1000, as expected by ncurses. - - o Change xterm-r6 terminfo definitions for F1-F4 to match program. - - o Remove obsolete documentation about modifiers which can be returned in - mouse tracking mode, and modify logic to ignore modifiers other than the - existing ones, e.g., NumLock. - - o Use free bit from obsolete shift-modifier coding of mouse tracking but- - ton events to encode buttons 4 and 5, e.g., for a wheel mouse. Move the - suggested wheel-mouse button translations into charproc.c to simplify - customization. - - o Modify warning if change-ownership of PTY fails; some configurations may - not happen to have old-style PTY's. - - o Add more information, i.e., with strerror for some system calls in the - main program which may fail due to insufficient permissions. - - o Various improvements to configure script, e.g., tests for utmp. - -4.4 xedit +4.15 xedit Xedit have been changed to use most of the new features added to the new ver- sion of the Xaw library, and some xedit only features were added. Emacs users @@ -1078,44 +989,44 @@ xedit. These include: o C-mode: this mode is expected to be stable, and fully usable. -5. Fonts and Internationalisation +4.16 Font support -Details about the font support in this version of XFree86 can be found in the +Details about the font support in XFree86 4.x can be found in the README.fonts document. -5.1 TrueType support +4.17 TrueType support -This version of XFree86 comes with two TrueType backends, known as `xfsft' -(the "freetype" module) and `X-TrueType' (the "xtt" module). Both of these -backends are based on the FreeType library. +XFree86 4.x comes with two TrueType backends, known as `xfsft' (the +"freetype" module) and `X-TrueType' (the "xtt" module). Both of these back- +ends are based on the FreeType library. -5.2 CID font support +4.18 CID font support -Support for CID-keyed fonts is included in this version of XFree86. The CID- -keyed font format was designed by Adobe Systems <URL:http://www.adobe.com> -for fonts with large character sets. The CID-keyed font support in XFree86 -was donated by SGI <URL:http://www.sgi.com>. See the LICENSE document for a -copy of the CID Font Code Public License. +Support for CID-keyed fonts is included in XFree86 4.x. The CID-keyed font +format was designed by Adobe Systems <URL:http://www.adobe.com> for fonts +with large character sets. The CID-keyed font support in XFree86 was donated +by SGI <URL:http://www.sgi.com>. See the LICENSE document for a copy of the +CID Font Code Public License. -5.3 Internationalisation of the scalable font backends +4.19 Internationalisation of the scalable font backends -A new ``fontenc'' layer has been added to allow the scalable font backends to +XFree86 4.x has a ``fontenc'' layer to allow the scalable font backends to use a common method of font re-encoding. This re-encoding makes it possible to uses fonts in encodings other than their their native encoding. This layer is used by the Type1 and Speedo backends and the `xfsft' version of the TrueType backend. The `X-TrueType' version of the TrueType backend uses a different re-encoding method based on loadable encoding modules. -5.4 Large font optimisation +4.20 Large font optimisation The glyph metrics array, which all the X clients using a particular font have access to, is now placed in shared memory, so as to reduce redundant memory consumption. For non-local clients, the glyph metrics array is transmitted in a compressed format. -5.5 Unicode/ISO 10646 support +4.21 Unicode/ISO 10646 support -What is included: +What is included in 4.x: o All ``-misc-fixed-*'' BDF fonts are now available in the ISO10646-1 encoding and cover at least the 614 characters found in ISO @@ -1146,24 +1057,7 @@ What is included: o Both the xfsft (the "freetype" module) and the X-TrueType (the "xtt" module) TrueType font backends support Unicode-encoded fonts. -Known problems: - - o Xlib does not yet fully support UTF-8 as a locale, which means that - xterm UTF-8 keyboard support is at the moment a temporary hack. - - o Most ISO10646-1 fonts encode no characters above U+31FF. This avoids the - inefficient allocation and transmission of a >700 kB large XFontStruct - structure, which would happen if the (not very important) ligatures and - symbols above U+f000 were present. - - o ISO 10646 Level 2 combining characters are not yet supported by xterm - (will be needed for instance for Thai and IPA). - - o Switching between a half-width and full-width font pair (such as 9x18 - and 18x18ja) is not yet supported by xterm (will be needed for CJK - scripts). - -5.6 Lucidux fonts from Bigelow and Holmes +4.22 Lucidux fonts from Bigelow and Holmes XFree86 now includes the ``Lucidux'' family of professionally hinted Type 1 fonts. This family consists of the fonts ``Lucidux Serif'', ``Lucidux Sans'' @@ -1176,12 +1070,10 @@ Blenda Horn from Y&Y, Inc. For more information, please contact <design@bigelowandholmes.com> or <sales@yandy.com>, or consult Y&Y's web site <URL:http://www.yandy.com>. -6. Miscellaneous - -6.1 Directory rearrangements +4.23 Directory rearrangements Some changes to the installed XFree86 directory structure have been imple- -mented for 4.0. One important change is a modified search path for the X +mented for 4.x. One important change is a modified search path for the X server's XF86Config file. The details of this can be found in the XF86Config manual page. The other main change is moving most of the run-time configura- tion files to /etc/X11, with symbolic links in the old /usr/X11R6/lib/X11 @@ -1189,7 +1081,7 @@ location pointing to the new location. Some run-time generated files are now located under the appropriate subdirectories of /var, again with the relevant symbolic links in the old location. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.43 2000/12/04 16:24:57 alanh Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.58 2000/12/17 23:01:10 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/RELNOTES,v 3.87 2000/12/04 19:47:29 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/RELNOTES,v 3.96 2000/12/18 05:55:38 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/Status b/xc/programs/Xserver/hw/xfree86/doc/Status index 905bf3b1f..6c5669771 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/Status +++ b/xc/programs/Xserver/hw/xfree86/doc/Status @@ -19,6 +19,18 @@ includes information about the status of the drivers and the hardware they support, including a comparison of the level of support between versions 3.3.6 and 4.0.2. +In XFree86 3.3.6, several X servers are available; much hardware uses the +XF86_SVGA server, which has a set of driver modules that are built into it at +compile time. In other cases, X servers for specific chips (or families of +chips) are provided (such as XF86_AGX, XF86_Mach64, etc.). + +In XFree86 4.0.2, there is only one X server, called "XFree86", which can +load driver modules at runtime. Thus there is no specific mention of a +server binary when 4.0.2 is discussed; only the XFree86 server is used. +Third-party vendors (often the manufacturers of various video chipsets) may +provide their own drivers for the XFree86 server, but these third-party mod- +ules are beyond the scope of this document. + NOTE: Status information needs to be checked carefully and expanded where possible. E.g., include information about acceleration, multi-head, known problems, hardware known to work on, platform dependencies/limitations, other @@ -27,17 +39,17 @@ architectures known to work on (e.g., Alpha, PPC), etc. 2. 3Dfx 3.3.6: - Support (including acceleration) for Voodoo Banshee and Voodoo 3. - Support is provided by the XF86_SVGA server with the tdfx - driver). + Support (including acceleration) for Voodoo Banshee and Voodoo3 + cards is provided by the XF86_SVGA server with the tdfx driver. 4.0.2: - Support for Voodoo 1 and Voodoo 2 via glide on platforms where - glide is available (Linux and FreeBSD(?)). Support is provided - by the "glide" driver (requires Glide 2x). + Support for Voodoo Graphics and Voodoo 2 chips is available on + platforms where Glide is available (Linux and FreeBSD(?)) and is + provided by the "glide" driver (requires version 2.x of the Glide + library, which is not part of the XFree86 distribution). - Support (including acceleration) for Voodoo Banshee and Voodoo 3. - Support is provided by the "tdfx" driver. + Support (including acceleration) for Voodoo Banshee, Voodoo3, + Voodoo4, and Voodoo5 is provided by the "tdfx" driver. Summary: All hardware supported in 3.3.6 is also supported in 4.0.2. @@ -47,16 +59,17 @@ architectures known to work on (e.g., Alpha, PPC), etc. 3.3.6: Support (including acceleration) for GLINT 500TX (with IBM RGB526 ramdac), GLINT MX plus Delta or Gamma (with IBM RGB526 and RGB640 - ramdacs), Permedia with IBM RGB526 ramdac, Permedia 2, 2a, 2v. - Support is provided by the XF86_3DLabs server. + ramdacs), Permedia with IBM RGB526 RAMDAC, and Permedia 2, 2a, 2v + is provided by the XF86_3DLabs server. 4.0.2: - Support (including acceleration) for Permedia, Permedia 2, 2v - (and 2a??) GLINT 500TX, GLINT MX, GLINT Gamma, and Glint Delta - coproc. Support is provided by the "glint" driver. + Support (including acceleration) for Permedia, Permedia 2, 2v, + (and 2a?), Permedia 3, GLINT 500TX, GLINT MX, GLINT Gamma, and + GLINT Delta coproc is provided by the "glint" driver. Summary: - All hardware supported in 3.3.6 is also supported in 4.0.2. + All hardware supported in 3.3.6 is also supported in 4.0.2. The + Permedia 3 is only supported in 4.0.2. 4. Alliance @@ -81,11 +94,11 @@ architectures known to work on (e.g., Alpha, PPC), etc. the ark driver. 4.0.2: - No native support for these chipsets, because the old driver has - not been ported. + Support (including acceleration) for the ARK1000PV, ARK2000PV, + and ARK2000MT. Support is provided by the "ark" driver. Summary: - No ARK Logic chips are supported in 4.0.2. + All hardware supported in 3.3.6 is also supported in 4.0.2. 6. ATI @@ -104,11 +117,10 @@ architectures known to work on (e.g., Alpha, PPC), etc. by the XF86_SVGA server with the r128 driver. 4.0.2: - Accelerated support is provided for the Rage 128 chips by the - "r128" driver. Accelerated support is provided for the Mach64 - Rage variants by the "ati" driver. Unaccelerated support is pro- - vided for all of the others except the Mach8 and some early - Mach32 chips by the "ati" driver. + Accelerated support is provided for Mach64, Rage, Rage 128 and + Radeon chips. Unaccelerated support is provided for all of the + others except the Mach8 and some early Mach32 chips by the "ati" + driver. Summary: All chips supported in 3.3.6 are supported in 4.0.2 except for @@ -146,7 +158,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. 64300. This support is provided by the "chips" driver. Summary: - All chips supported in 3.3.6 are also supported in 4.0.2. + All hardware supported in 3.3.6 is also supported in 4.0.2. 9. Cirrus Logic @@ -160,13 +172,13 @@ architectures known to work on (e.g., Alpha, PPC), etc. 4.0.2: Support (accelerated) for the Alpine (5430, 5434, 5436, 5446, - 5480), and Laguna (5462, 5464, 5465) chips is provided by the - "cirrus" driver. + 5480, 7548), and Laguna (5462, 5464, 5465) chips is provided by + the "cirrus" driver. Summary: The following chips are supported in 3.3.6 but not in 4.0.2: 6410, 6412, 6420, 6440, 5420, 5422, 5424, 5426, 5428, 5429, 6205, - 6215, 6225, 6235, 7541, 7542, 7543, 7548, 7555 and 7556. + 6215, 6225, 6235, 7541, 7542, 7543, 7555 and 7556. 10. Compaq/Digital @@ -189,7 +201,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Summary: No Compaq AVGA support in 4.0.2. DEC TGA support is equivalent - in both versions. + in both 3.3.6 and 4.0.2. 11. Cyrix @@ -198,11 +210,11 @@ architectures known to work on (e.g., Alpha, PPC), etc. XF86_SVGA server with the cyrix driver. 4.0.2: - A preliminary port of the driver is available, but it isn't ready - for widespread use. + The 3.3.6 driver has been ported to 4.0.2, including accelera- + tion, but feedback is needed. Summary: - No Cyrix chips are well-supported in 4.0.2. + Cyrix MediaGX users are encouraged to test its support in 4.0.2. 12. Epson @@ -260,7 +272,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. 3.3.6: Support (accelerated) for the AGX-016, AGX-015 and AGX-014 is - provided by the XF86_AGX server.. + provided by the XF86_AGX server. 4.0.2: No native support for these chipsets, because the old driver has @@ -269,7 +281,20 @@ architectures known to work on (e.g., Alpha, PPC), etc. Summary: No IIT chips are supported in 4.0.2. -16. Intel +16. Integrated Micro Solutions (IMS) + + 3.3.6: + Support (accelerated) for the IMS Twin Turbo 128 is provided by + the XF86_SVGA server with the imstt driver. + + 4.0.2: + Support (accelerated) for the IMS Twin Turbo 128 is provided by + the "imstt" driver. + + Summary: + All hardware supported in 3.3.6 is also supported in 4.0.2. + +17. Intel 3.3.6: Support (accelerated) for the Intel i740 is provided by the @@ -288,7 +313,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. The i740 and i810 are supported in both versions, but the i810 is only supported on Linux/x86 platforms at present. -17. Matrox +18. Matrox 3.3.6: Support (accelerated) for the MGA2064W (Millennium I), MGA1064SG @@ -301,9 +326,9 @@ architectures known to work on (e.g., Alpha, PPC), etc. and G400 is provided by the "mga" driver. Summary: - All chips supported in 3.3.6 are also supported in 4.0.2. + All hardware supported in 3.3.6 is also supported in 4.0.2. -18. MX (???) +19. MX (???) 3.3.6: Support for the MX68000 and MX68010 chips is provided by the @@ -318,7 +343,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Summary: No MX (???) chips are supported in 4.0.2. -19. NCR +20. NCR 3.3.6: Support for the old NCR 77C22 and 77C22E chips is provided by the @@ -332,7 +357,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Summary: No NCR chips are supported in 4.0.2. -20. NeoMagic +21. NeoMagic 3.3.6: Support (accelerated) for the NeoMagic NM2070, NM2090, NM2093, @@ -345,10 +370,10 @@ architectures known to work on (e.g., Alpha, PPC), etc. provided by the "neomagic" driver. Summary: - All chips supported in 3.3.6 are also supported in 4.0.2. The + All hardware supported in 3.3.6 is also supported in 4.0.2. The NM2230 and later chips are only supported in 4.0.2. -21. NVIDIA +22. NVIDIA 3.3.6: Support (accelerated) for the NV1, Riva 128, 128ZX, TNT, TNT2 @@ -358,27 +383,27 @@ architectures known to work on (e.g., Alpha, PPC), etc. 4.0.2: Support (accelerated) for the Riva 128, 128ZX, TNT, TNT2 (Ultra, Vanta, M64), GeForce (DDR, 256), GeForce2 (GTS, Ultra, MX), - Quadro, and Quadro2 is provided by the nv driver. + Quadro, and Quadro2 is provided by the "nv" driver. Summary: All chipsets supported in 3.3.6 except the NV1 are also supported in 4.0.2. Support for the newer chips (GeForce2 and later) is only available in 4.0.2. -22. Number Nine +23. Number Nine 3.3.6: Support (accelerated) for the Imagine 128, Ticket 2 Ride, Revolu- tion 3D and Revolution IV is provided by the XF86_I128 server. 4.0.2: - No native support for these chipsets, because the old driver has - not been ported. + Support (accelerated) for the Imagine 128, Ticket 2 Ride, Revolu- + tion 3D and Revolution IV is provided by the "i128" driver. Summary: - No Number Nine chips are supported in 4.0.2. + All hardware supported in 3.3.6 is also supported in 4.0.2. -23. Oak Technologies Inc +24. Oak Technologies, Inc. 3.3.6: Support for the OTI067, OTI077, and OTI087 (the latter with some @@ -392,7 +417,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Summary: No Oak chips are supported in 4.0.2. -24. Paradise/Western Digital +25. Paradise/Western Digital 3.3.6: Support for the Paradise PVGA1 and the Western Digital WD90C00, @@ -408,7 +433,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Summary: No Paradise/Western Digital chips are supported in 4.0.2. -25. RealTek +26. RealTek 3.3.6: Support for the RealTek RTG3106 is provided by the XF86_SVGA @@ -423,7 +448,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Summary: No RealTek chips are supported in 4.0.2. -26. Rendition/Micron +27. Rendition/Micron 3.3.6: Support for the Verite 1000, 2100 and 2200 is provided by the @@ -434,9 +459,9 @@ architectures known to work on (e.g., Alpha, PPC), etc. "rendition" driver. Summary: - All chips supported in 3.3.6 are also supported in 4.0.2. + All hardware supported in 3.3.6 is also supported in 4.0.2. -27. S3 +28. S3 3.3.6: Support (accelerated) for the S3 911, 924, 801, 805, 928, 864, @@ -447,21 +472,35 @@ architectures known to work on (e.g., Alpha, PPC), etc. ViRGE/MX+ is provided by the XF86_S3V server. Support (acceler- ated) for those ViRGE chips, as well as the Trio3D and Trio3D/2X is provided by the XF86_SVGA server with the s3v driver. Support - (accelerated) for the Savage3D, Savage3D/MV, Savage4, Savage2000, - is provided by the XF86_SVGA server with the s3_savage driver - (CHECK: is this support Linux-only?). + (accelerated) for the Savage3D, Savage3D/MV, Savage4, and Sav- + age2000, is provided by the XF86_SVGA server with the s3_savage + driver on some OSes (Linux, *BSD). 4.0.2: Support (accelerated) for the ViRGE, ViRGE/VX, ViRGE/DX, ViRGE/GX, ViRGE/GX2, ViRGE/MX, ViRGE/MX+, Trio3D and Trio3D/2X is - provided by the "s3virge" driver. Support for the other S3 - chipsets has not yet been ported. + provided by the "s3virge" driver. Support (accelerated) for the + Savage3D, Savage3D/MV, Savage4, and Savage2000, is provided by + the "savage" driver. Support for the other S3 chipsets has not + yet been ported. + + Summary: + Only the ViRGE, Trio3D and Savage chipsets are supported in + 4.0.2. All of the other chipsets are only supported in 3.3.6. + +29. Silicon Graphics, Inc. (SGI) + + 3.3.6: + No SGI hardware is supported in 3.3.6. + + 4.0.2: + Unaccelerated support for the SGI Indy's Newport cards is pro- + vided by the "newport" driver. Summary: - Only the ViRGE and Trio3D chipsets are supported in 4.0.2. All - of the other chipsets are only supported in 3.3.6. + SGI hardware is supported only in 4.0.2. -28. Silicon Integrated Systems (SiS) +30. Silicon Integrated Systems (SiS) 3.3.6: Support (accelerated) for the SiS 86C201, 86C202, 86C205, 86C215, @@ -478,7 +517,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Support for the 86C201, 86C202, 86C215, 86C225, 5597 and 5598 is currently only available in 3.3.6. -29. Silicon Motion, Inc +31. Silicon Motion, Inc. 3.3.6: Support (accelerated) for the Lynx, LynxE, Lynx3D, LynxEM, @@ -486,14 +525,31 @@ architectures known to work on (e.g., Alpha, PPC), etc. with the smi driver. 4.0.2: - No native support for these chipsets, because the driver has not - been ported. + Support (accelerated) for the Lynx, LynxE, Lynx3D, LynxEM, + LynxEM+ and Lynx3DM chips is provided by the "siliconmotion" + driver. + + Summary: + All hardware supported in 3.3.6 is also supported in 4.0.2. + +32. Sun Microsystems + + 3.3.6: + No Sun hardware is supported in 3.3.6. + + 4.0.2: + Sun BW2 framebuffers are supported by the "sunbw2" driver. Sun + CG3 framebuffers are supported by the "suncg3" driver. Sun CG6 + framebuffers are supported by the "suncg6" driver. Sun CG14 + framebuffers are supported by the "suncg14" driver. Sun FFB + framebuffers are supported by the "sunffb" driver. Sun LEO + framebuffers are supported by the "sunleo" driver. Sun TCX + framebuffers are supported by the "suntcx" driver. Summary: - No SMI chips are supported in 4.0.2, but the fbdev driver is - reported to work on Linux. + Sun hardware is supported only in 4.0.2. -30. Trident Microsystems +33. Trident Microsystems 3.3.6: Support (accelerated where the chip supports it) for the @@ -508,19 +564,22 @@ architectures known to work on (e.g., Alpha, PPC), etc. 4.0.2: Support (accelerated where the chip supports it) for the - TVGA8900D, TGUI9420DGi, TGUI9440AGi, TGUI9660, TGUI9680, ProVidia - 9682, ProVidia 9685, Cyber9320, Cyber9382, Cyber9385, Cyber9388, - Cyber9397, Cyber9520, Cyber9397/DVD, Cyber9525/DVD, 3DImage975, - 3DImage875, Blade3D, CyberBlade/i7, CyberBlade/DSTN/i7 and - CyberBlade/i1 is provided by the "trident" driver. + TVGA8900D, TGUI9440AGi, TGUI9660, TGUI9680, ProVidia 9682, Pro- + Vidia 9685, Cyber9320, Cyber9382, Cyber9385, Cyber9388, + Cyber9397, Cyber9397/DVD, Cyber9520, Cyber9525/DVD, 3DImage975, + 3DImage985, Blade3D, CyberBlade/i7, CyberBlade/DSTN/i7, + CyberBlade/i1, CyberBlade/DSTN/i1, CyberBlade/Ai1, + CyberBlade/DSTN/Ai1 and CyberBlade/e4 is provided by the "tri- + dent" driver. Summary: The following (older) chipsets that are supported in 3.3.6 are not supported in 4.0.2: TVGA8200LX, TVGA8800CS, TVGA8900B, TVGA8900C, TVGA8900CL, TVGA9000, TVGA9000i, TVGA9100B, - TVGA9200CXr, TGUI9400CXi, TGUI9420, TGUI9430DGi. + TVGA9200CXr, TGUI9400CXi, TGUI9420, TGUI9430DGi. The remaining + listed chipsets are supported in 4.0.2. -31. Tseng Labs +34. Tseng Labs 3.3.6: Support for the ET3000 is provided by the XF86_SVGA server with @@ -539,7 +598,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. All cards supported by 3.3.6 are also supported by 4.0.2 except for the old ET3000. -32. Video 7 +35. Video 7 3.3.6: Support for the Video 7 chipset is provided by the XF86_SVGA @@ -554,7 +613,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Summary: No Video 7 chips are supported in 4.0.2. -33. Weitek +36. Weitek 3.3.6: Support (accelerated) for the P9000 is provided by the XF86_P9000 @@ -568,7 +627,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Summary: No Weitek chips are supported in 4.0.2. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml,v 1.21 2000/12/04 19:31:05 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml,v 1.26 2000/12/14 22:15:48 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/Status,v 1.16 2000/12/04 19:47:33 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/Status,v 1.21 2000/12/14 22:34:26 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml index c9ed15581..51ef3d55e 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml @@ -15,7 +15,7 @@ <date>20 November 2000 <ident> - $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.13 2000/12/01 14:28:55 dawes Exp $ + $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.15 2000/12/12 18:54:29 dawes Exp $ </ident> <toc> @@ -101,7 +101,7 @@ In your host.def file that should reside in the xc/config directory, add the line. - #define DefaultCCOptions -ansi GccWarningOptions -pipe -mcpu=ev6 + #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 Additional speed improvements to 3D rendering can be achieved by installing Compaq's Math Libraries (CPML) which can be @@ -653,7 +653,7 @@ should be installed in /lib/modules/2.4.x/kernel/driver/char/drm/. It will be automatically loaded by the Xserver if needed. <p> - The DRI 3D driver for the Voodoo3 hould be in + The DRI 3D driver for the Voodoo3 should be in <tt>/usr/X11R6/lib/modules/dri/tdfx_dri.so</tt>. This will be automatically loaded by libGL.so. <p> @@ -706,7 +706,7 @@ Setting <tt/GL_LIGHT_MODEL_COLOR_CONTROL/ to <tt/GL_SEPARATE_SPECULAR_COLOR/. <item> - Enabling line stippline or polygon stippling. + Enabling line stippling or polygon stippling. <item> Enabling point smoothing or polygon smoothing. <item> @@ -796,7 +796,7 @@ should be installed in /lib/modules/2.4.x/kernel/driver/char/drm/. It will be automatically loaded by the Xserver if needed. <p> - The DRI 3D driver for the Voodoo5 hould be in + The DRI 3D driver for the Voodoo5 should be in <tt>/usr/X11R6/lib/modules/dri/tdfx_dri.so</tt>. This will be automatically loaded by libGL.so. <p> @@ -1015,7 +1015,7 @@ This is caused by the graphics card not having an interrupt assigned to it. The current DRI trunk will attempt to detect this condition and - bail outgracefully. + bail out gracefully. <p> The solution to the above problem is to assign an interrupt to your graphics card. @@ -1030,7 +1030,7 @@ Linux to expose functionality for which they can not provide documentation. (For example TV-Out requires MacroVision be enabled on the output.) - This binary library also sets the pixel/memory clocks to the optimial + This binary library also sets the pixel/memory clocks to the optimal settings for your Matrox card. <p> Currently the MGAHAL library is required for the G450 to work. diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml index ec394effa..d47134637 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml @@ -15,7 +15,7 @@ <date>29 October 2000 <ident> - $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.8 2000/12/01 14:28:55 dawes Exp $ + $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.9 2000/12/12 17:48:10 alanh Exp $ </ident> <toc> @@ -321,7 +321,8 @@ The default <tt>host.def</tt> file will look something like this: <verb> #define DefaultCCOptions -Wall - #define DefaultGcc2i386Opt -O2 +(i386) #define DefaultGcc2i386Opt -O2 +(Alpha) #define DefaultGcc2AxpOpt -O2 -mcpu=ev6 (or similar) #define LibraryCDebugFlags -O2 #define BuildServersOnly YES #define XF86CardDrivers vga tdfx mga r128 i810 diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml new file mode 100644 index 000000000..17003440d --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml @@ -0,0 +1,424 @@ +<!DOCTYPE linuxdoc PUBLIC "-//XFree86//DTD linuxdoc//EN" [ +<!ENTITY % defs SYSTEM "defs.ent"> %defs; +]> + +<article> +<title>XFree86 on Darwin and Mac OS X +<author>Torrey T. Lyons +<date>11 December 2000 + +<ident> +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml,v 1.4 2000/12/12 18:54:29 dawes Exp $ +</ident> + +<toc> + +<sect>Introduction +<p> +<htmlurl url="http://www.xfree86.org/" name="XFree86">, a free +implementation of X Windows, has been ported to <htmlurl +url="http://www.publicsource.apple.com/projects/darwin/" name="Darwin"> +and <htmlurl url="http://www.apple.com/macosx/" name="Mac OS X">. This +document is +a collection of information for anyone +experimenting with running X Windows on Apple's next generation operating +system. Please send any comments on this page to +<email/torrey@mrcla.com/. If you are also +working on modifications to the Darwin X server, please let me know. + +<sect>Hardware Support and Configuration +<p> +The Darwin port of XFree86 uses the IOKit for device driver loading +and discovery, rather than the XFree86 module loader. Because of this, +the XFree86 configuration file is not used on Darwin systems. The +descriptions found elsewhere of devices supported by XFree86 for other +operating systems also do not apply. + +<p> +XFree86 for Darwin will work with any video card that you have an +IOKit driver for. If you are running Mac OS X, this typically means +any card that has been shipped by Apple. If a card works for you with +the Mac OS X GUI, it will work on the same machine with XFree86. If +you have a pure Darwin installation, your hardware support may be +somewhat limited because Apple does not include all its hardware +drivers with Darwin. IOKit drivers are typically found in +/System/Library/Extensions/ or /Library/Extensions/. + +<p> +Multi-button and scroll wheel mouse support works well with all +USB mice that I have tested. I have done no testing with serial +mice. + +<sect>Getting Started +<p> +Following are instructions for building and running your own copy of +XFree86. The procedure for getting your X server up and running on +Darwin and Mac OS X are very similar, but it is actually somewhat more +difficult on Mac OS X. Where there are differences I have noted them +below. Both Mac OS X Developers' Preview 4 and Mac OS X +Public Beta are covered. Note that to build XFree86 for yourself on +Mac OS X Beta, you will need to have the Developers' Tools. If +you did not receive these as a member of ADC, they are available for +download from the <htmlurl url="http://www.apple.com/developer/" +name="Apple Developer Connection">. + +<p> +If you want to save some time, you can use the precompiled binaries +provided by the XFree86 server at <url +url="ftp://ftp.xfree86.org/pub/XFree86/&relvers;/binaries/Darwin/">. +Follow the instructions in the <htmlurl +url="http://www.xfree86.org/&relvers;/Install.html" name="Install"> +document to install it. + +<p> +This will create two new directory trees, <tt>/usr/X11R6</tt> and +<tt>/private/etc/X11</tt>. If you have the developers' tools, you may +have to run ranlib on all the libraries in <tt>/usr/X11R6/lib/*</tt> +before trying to build other X applications. + +<p> +If you get the precompiled binaries you can skip ahead to the section +on <ref id="running" name="running X windows"> + +<p> +On the other hand, if you want to build things yourself from scratch, +follow the directions below. + +<p> +If you want to recompile the X server on Mac OS X, you will have to +make the header files as described <ref id="makeHeaders" +name="below">. + +<sect1> Get the Code + +<p> +The first thing you need to do is to get the source code from the +XFree86 project. + +<itemize> +<item> Setup CVS: Both Darwin and Mac OS X include CVS (Concurrent +Versions System), which is an easy way to download and keep up to date +with open source code released by XFree86 and others. You do have to +setup CVS properly, however, to tell it where to look. Follow the +instructions <htmlurl url="http://www.xfree86.org/cvs/" name="here"> on +how to do this either via ssh or via the cvs pserver. + +<item> Now make a directory in some convenient place which will serve +as your top level directory for you open source development efforts. I +am going to call this directory <tt>sandbox/</tt> in the following discussions +and you could put this directory, for example, in <tt>~/sandbox/</tt>. + +<item>From the command line type: +<tscreen><verb> +cd sandbox +cvs checkout xc +</verb></tscreen> +Wait for all the files to complete downloading. + +</itemize> + +<sect1>Make Header Files for Mac OS X<label id="makeHeaders"> +<p> + +These next steps are not necessary if you are building XFree86 on +Darwin. Mac OS X Beta or DP4 does not include many of the +"in-progress" header files that are needed to successfully +build XFree86. The general philosophy is that at any given time, Mac +OS X will include only headers files that are "ready for prime +time" while Darwin will include a snapshot of Apple's current +efforts. So if you have access to a Darwin system, I would suggest +using this instead of Mac OS X to build XFree86. If you don't, read +the appropriate page below for an outline of what you need to do: + +<itemize> +<item><ref id="headersXBeta" name="Mac OS X Public Beta"> +<item><ref id="headersXDP4" name="Mac OS X Developers' Preview 4"> +</itemize> + +<sect1> Build XFree86 +<p> +Once you have everything ready it is easy to build and install +XFree86. From the command line: + +<tscreen><verb> +cd sandbox/xc +make World >& world.log + +(wait for several hours) + +su root +make install >& install.log +make install.man >& man.log +</verb></tscreen> + +<sect>Run X Windows<label id="running"> +<p> +You will want to add the X windows executables to your path. Your path +is the list of directories to be searched when you type a command. You +will also want to add the man pages from XFree86 to the list of pages +to be searched when you are looking for documentation. The way to do +this depends on the shell you are using. With tcsh or csh add the +following two lines to a file in your home directory called <tt/.cshrc/ +(create this file if you don't have one yet): +<tscreen><verb> +setenv MANPATH "${MANPATH}:/usr/X11R6/man:/usr/local/man" +setenv PATH "${PATH}:/usr/X11R6/bin" +</verb></tscreen> +Now type ``<tt>source ~/.cshrc;rehash</tt>'' to +get these changes to take effect. On future logins, this file will be +executed automatically. + +<p> +You are now ready to go. On Mac OS X, you have to do a few extra steps +each time you want to run X windows. You can't run XFree86 with +CoreGraphics running since they both want to control the screen. So +for Mac OS X you first need to logout. Then for Mac OS X DP4, from the +login window type ``console'' as the user name and push +login. For Mac OS X Beta, type ``>console'' as the user +name. This should shutdown CoreGraphics and bring you up with a text +console. Login again. + +<p> +Now from the text console you can start X Windows in either Darwin or +Mac OS X by typing ``startx''. After a brief wait at least one terminal +window should pop up for you. So far it probably isn't very impressive +as you might not even have a window manager running to allow you to +move windows around. + +<p> +When you are ready to quit X windows type ``exit'' in the main +terminal window or quit with the window manager if you have one +running. Unfortunately the X server won't shutdown correctly and you +will get an apparently frozen screen with only a spinning beachball +cursor on it. Nothing you type shows up on the screen, but in fact +your keystrokes are being received by the console. Type +``logout'' to return to normalcy after a brief delay. With +Darwin this should put you back at the text console login prompt. With +Mac OS X, CoreGraphics will restart and you should be given a login +window. + +<p> +<bf/Customize X Windows/ +<p> + +X windows is very customizable and you will certainly want to change +some things. There is a lot you can do to control how your windows +look, how the windows are moved, resized, etc. You will likely want to +get a better window manager than twm, which is included with +XFree86. The <tt>.xinitrc</tt> file in your home directory controls what +programs are run when you start X windows. You can find a sample +<tt>.xinitrc</tt> file in <tt>/private/etc/X11/xinit/xinitrc</tt>. + +<p> +There are several +window managers that have been ported to Darwin. The best collection +of window managers and other X windows applications is at <htmlurl +url="http://www.darwinfo.org/ports.shtml#X Windows" name="Darwinfo's ports +page">. Another good place to look for Darwin ports in general is at +<htmlurl +url="http://softrak.stepwise.com/Apps/WebObjects/Softrak" name="Stepwise's +Softrak site">. + +<p> +Good luck! + +<sect>Outstanding Issues with the X server + +<p> +There is a still a lot to be done with the X server. As always please +let me know if you are interested in working on any of these issues. + +<bf/Things that are broken:/ +<itemize> +<item>The bell is broken. + +<item>Server shutdown problem: After quitting the X server the colored +beachball cursor reappears, but the screen never returns to the +console display. The console is accepting input however, so typing +``logout'' will return you to the login prompt. + +<item>Only one display is currently supported. + +<item>Screen saver not supported. + +<item>Key repeat rate can not be adjusted. +</itemize> + +<bf/Things I am working on:/ +<itemize> +<item> Allowing rootless use on Mac OS X +<item> Correct wake from sleep behavior +</itemize> + +<sect>Appendix + +<sect1>Installing IOKit Header files on Mac OS X Beta<label + id="headersXBeta"> +<p> +Here is what you need to do to be able to build XFree86 (or other +clients of IOGraphics services) on Mac OS X Public Beta. +<enum> + +<item>You need to install some more build tools that aren't included +in Mac OS X Beta, but are included in Darwin. These are needed for the +next step. Go to your development directory and type: +<tscreen><verb> +cvs checkout bootstrap_cmds +cd bootstrap_cmds +make +</verb></tscreen> +Now su to root and do a ``make install'' from the bootstrap_cmds +directory. + +<item> +The IOKit framework included with Mac OS X Beta is a little on the +wimpy side, even after installing the Developer Tools. You'll need to +rebuild it, but to do so safely we'll take advantage of the cool +directory structure of Mac OS X and put the new version in +/Library/Frameworks/. This will override the version in +/System/Library/Frameworks/. Or at least, that's where you should put +it using the new Mac OS X Beta file structure, but in fact the +compiler doesn't know this and still looks in +/Local/Library/Frameworks. (I have already filed a developer's bug +report on this.) To start we make a copy of the original. Login as +root and do the following: +<tscreen><verb> +cd /Library +mkdir -p Frameworks +cp -R /System/Library/Frameworks/IOKit.framework Frameworks/IOKit.framework +cd / +mkdir -p Local +ln -s /Library /Local/Library +</verb></tscreen> + +<item>Now you need to get a full version of the IOKit framework from +the Darwin repository. This comes as part of the kernel. So, in your +development directory again: + +<tscreen><verb> +cvs checkout xnu +cd xnu +source SETUP/setup.csh +make exporthdrs +make install +</verb></tscreen> + +The "make install" will start by assembling all the headers you need, +but then will proceed to build a new kernel. You can Control-C out of +the build once it starts compiling things if you want. Otherwise, just +be patient. + +<item> +You also need to get the IOKitUser project, which contains the user +interface to the IOKit, and merge it into the IOKit framework. From +your development directory type: +<tscreen><verb> +cvs checkout IOKitUser +</verb></tscreen> +Then you need to change the Makefile so it builds on top of the new +IOKit framework you are building. Change to the IOKitUser project +directory and edit the Makefile. Change the following line: +<tscreen><verb> +NEXTSTEP_BUILD_OUTPUT_DIR = /$(USER)/build/$(NAME) +</verb></tscreen> +to: +<tscreen><verb> +NEXTSTEP_BUILD_OUTPUT_DIR = <your xnudir>/BUILD/dst/System/Library/Frameworks +</verb></tscreen> + +Now, run ``make'' while in the IOKitUser directory. It will likely not +finish building since the IOKitUser project relies on some stuff that +Apple hasn't really made public yet, but it should finish populating +the new IOKit framework with headers and start compiling. (Strangely +enough, the headers installed in your new IOKit framework don't contain +the real header files. They are just single line files with an #import +of the file in your IOKitUser project. This works fine as long as you +don't ever delete or move your IOKitUser project. I imagine that using +``make install'' would fix this up, but you can't do this as long as the +project doesn't build correctly. So for now you can either move the +header files by hand, or make sure you leave your IOKitUser project in +place.) + +<item> +Now put the new IOKit headers into our local copy. Change to the xnu +project directory and do the following as root: +<tscreen><verb> +cd BUILD/dst/System/Library/Frameworks/ +cp -R IOKit.framework/Versions/A/Headers/* \ + /Library/Frameworks/IOKit.framework/Versions/A/Headers +</verb></tscreen> + +<item> +The System framework needs touching up a bit too. You need to copy the +libkern header files from the new System.framework. As root, go to the +xnu project directory and type: (Of course you could make a local copy +of the System framework in /Library/Frameworks/, but the additions to +the System framework are small.) +<tscreen><verb> +cd BUILD/dst/System/Library/Frameworks/System.framework/Versions/B/Headers +cp -R libkern /System/Library/Frameworks/System.framework/Headers/libkern +</verb></tscreen> +</enum> + +<sect1>Installing IOKit Header files on Mac OS X DP4<label +id="headersXDP4"> +<p> +Here is an outline of what you need to do to be able to build XFree86 +(or other clients of IOGraphics services) on Mac OS X Developers' +Preview 4. + +<enum> + +<item>Checkout, build, and install bootstrap_cmds from the CVS +repository. +<item>Checkout xnu from the CVS repository. Go to sandbox/xnu and do +the following: +<tscreen><verb> +source SETUP/setup.csh +make exporthdrs +</verb></tscreen> +<item>su to root and do the following: +<tscreen><verb> +mkdir -p /Local/Library/Frameworks +cp -R /System/Library/Frameworks/IOKit.framework /Local/Library/Frameworks +</verb></tscreen> +This will create a new local version of the IOKit framework that will +override the System version without changing the original. + +<item>You now want to merge the IOKit headers from the xnu project +into your local IOKit framework. I did this fairly tediously by hand, +but I would suggest something like: +<tscreen><verb> +cp -R sandbox/xnu/BUILD/dst/System/Library/Frameworks/IOKit.framework/Versions/A/Headers \ +/Local/Library/Frameworks/IOKit.framework/Versions/A +</verb></tscreen> +The only problem with this is that there are a few stub header files +included that are just a single line with an #import to the +appropriate place in the xnu source on your disk. This is fine as long +as you don't move your xnu project. If you do, you can copy the +original file to replace the stub. There is probably an easier way to +automatically build a clean version of the IOKit framework, but I +didn't find it. (Let me know if you do.) + +<item>There are just a few more files you need in the IOKit +framework. Checkout the IO project from CVS. Get the necessary header +files from there and put them in your new local IOKit +framework. You'll get errors when you try to build XFree86 from which +you can tell which files are needed. I also needed to make the +following patch to IOLLEvent.h. Your mileage may vary. +<tscreen><verb> +47c47 +< #include <Kernel/libkern/OSTypes.h> +--- +> #include <libkern/OSTypes.h> +</verb></tscreen> + +<item>You'll also need a few extra CoreFoundation header +files. Checkout CoreFoundation. You can make a new local version of +the CoreFoundation framework as above, or just add to the existing +one. The files you need are CFMachPort.h and CFMessagePort.h in the +RunLoop.subproj and CFStorage.h in Collections.subproj. +</enum> + +</article> + diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/I128.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/I128.sgml index 2383f0dd3..b8bd8cfa1 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/I128.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/I128.sgml @@ -7,7 +7,7 @@ <author>The XFree86 Project Inc. <date>3 November 2000 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/I128.sgml,v 1.5 2000/11/06 22:03:28 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/I128.sgml,v 1.6 2000/12/13 01:55:47 robin Exp $ </ident> <toc> @@ -93,7 +93,7 @@ Robin Cutshaw, <email>robin@XFree86.Org</email> and special help from: <itemize> -<item>Galen Brooks, <email>galen@nine.com</email> +<item>Galen Brooks, <email>galen@interlabs.com</email> </itemize> </article> diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile b/xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile index f78dcaed8..6fcb90a9b 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile @@ -3,7 +3,7 @@ XCOMM $XConsortium: Imakefile /main/16 1996/10/28 05:13:04 kaleb $ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile,v 3.66 2000/12/01 19:47:55 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile,v 3.69 2000/12/18 02:43:50 dawes Exp $ #include <Server.tmpl> #include <lnxdoc.rules> @@ -13,7 +13,8 @@ MANSGMLDEPENDS = mdefs.ent INDEXLIST = README.sgml RELNOTES.sgml Status.sgml LICENSE.sgml Install.sgml \ DESIGN.sgml \ mouse.sgml fonts.sgml DRI.sgml DRIcomp.sgml \ - isc.sgml LynxOS.sgml NetBSD.sgml OpenBSD.sgml OS2note.sgml \ + Darwin.sgml isc.sgml LynxOS.sgml NetBSD.sgml OpenBSD.sgml \ + OS2note.sgml \ apm.sgml ati.sgml chips.sgml cyrix.sgml DECtga.sgml \ I128.sgml i740.sgml i810.sgml newport.sgml \ r128.sgml rendition.sgml s3virge.sgml SiS.sgml @@ -21,6 +22,7 @@ MANSGMLDEPENDS = mdefs.ent #ifdef DEADDOCS LinuxDocReadmeTarget(Bsdi) #endif +LinuxDocReadmeTarget(Darwin) #ifdef OUTOFDATE LinuxDocReadmeTarget(DGUX) LinuxDocReadmeTarget(FreeBSD) @@ -145,3 +147,6 @@ clean:: FORMATTEDDIR = .. +/* Update RELNOTES at top level */ +UpdateFormattedDoc(RELNOTES,$(TOP)) + diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml index 3714fe5fb..dc2df49d0 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml @@ -6,10 +6,10 @@ <title>Installation Details for XFree86™ &relvers; <author>The XFree86 Project, Inc -<date>30 June 2000 +<date>15 December 2000 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml,v 1.7 2000/07/03 16:51:11 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml,v 1.10 2000/12/15 19:09:06 dawes Exp $ </ident> <abstract> @@ -26,8 +26,8 @@ This document contains information about installing the XFree86 binaries as provided by The XFree86 Project. <p> -The XFree86 binaries that we provide for UNIX-like OS's (Linux, the BSDs -and Solaris) are packaged in a platform-independent gzipped format (aka +The XFree86 binaries that we provide for UNIX-like OS's (Linux, the BSDs, +Solaris, etc) are packaged in a platform-independent gzipped tar format (aka "tarballs" identified by the <tt>.tgz</tt> suffix). Along with the binaries we provide a customized version of the GNU tar utility called "extract" and an installation script. We recommend that these be @@ -36,7 +36,7 @@ used to install the binaries. <sect>Downloading the XFree86 &relvers; binaries <p> -We, The XFree86 Project, provide XFree86 &relvers; binaries for a range +We provide XFree86 &relvers; binaries for a range of operating systems at our <![ %snapshot; [ <url name="ftp site" @@ -46,7 +46,7 @@ url="ftp://ftp.xfree86.org/pub/XFree86/snapshots/&relvers/binaries/">. <url name="ftp site" url="ftp://ftp.xfree86.org/pub/XFree86/&relvers/binaries/">. ]]> -Often during releases, our ftp site is heavily loaded. Instead of +Often during releases our ftp site is heavily loaded. Instead of downloading directly from us we recommend that instead you use one of our mirror sites. Another advantage of using our mirror sites is that some of them support http access (ours does not). @@ -54,20 +54,20 @@ some of them support http access (ours does not). <p> Our binaries are organized by sub-directories which correspond to each of the OS/platforms for which we provide binaries. First go to the -sub-directory that represents your OS Platform. In some cases (e.g., +sub-directory that represents your OS platform. In some cases (e.g., Linux) there may be a number of choices depending on the architecture or libc version your platform uses. In all case we recommend that you first download the <tt>Xinstall.sh</tt> script, and run it as in the -following example to find out which binary distribution you should +following example to find out which binary distribution you should download. <tscreen><verb> sh Xinstall.sh -check </verb></tscreen> -The output of this utility tells you which is the correct set of binaries -for you to download. If you are careful with this step you will save -yourself a lot time and trouble from NOT downloading an incompatible +The output of this utility tells you which is the correct set of binaries +for you to download. If you are careful with this step you will save +yourself a lot time and trouble from NOT downloading an incompatible distribution. <bf>NOTE</bf>: the Xinstall.sh script must be downloaded in binary mode, @@ -81,7 +81,7 @@ and save the file under the name "<tt>Xinstall.sh</tt>". Once you're run the <tt>Xinstall.sh</tt> script and found which binary distribution is suitable for your system, download the necessary files. -The twelve (12) mandatory files for all installations are listed below. +The twelve (12) mandatory files for all installations are listed below. If you have not downloaded all of the files, the installer script will complain. @@ -111,6 +111,9 @@ NOTES: tarball. If it is present in the <tt>binaries</tt> sub-directory for your platform, then it is required. + <item>The Darwin/Mac OS X distribution doesn't have or require the + <tt>Xmod.tgz</tt> tarball. + <item>Some distributions may have additional mandatory tarballs. While rare, the installer script will tell you if any are missing. @@ -273,15 +276,20 @@ ln -s /usr/X11R6/bin/rstartd /usr/bin/rstartd <sect1>After the installation is complete <p> The next step is to configure the X server. That is covered in detail -in an as-yet unwritten document :-(. In the meantime, there are two +in an as-yet unwritten document :-(. In the meantime, there are three ways to create a basic X server configuration file for XFree86 &relvers;. -One is to run the <tt>xf86config</tt> utility. Another is to use the -new <tt>-configure</tt> X server option: +One is to run the <tt>xf86config</tt> utility. Another is to run the +<tt>xf86cfg</tt> utility. The third option is to use the new +<tt>-configure</tt> X server option: <tscreen><verb> XFree86 -configure </verb></tscreen> +Note that if you are running Darwin/Mac OS X, there is no step 3 :-). +You should skip this step, as configuration is not required or possible. +The X server configuration file is not used on Darwin/Mac OS X. + The X server config file (<tt>XF86Config</tt>) format has changed compared to 3.3.x. Also, its default location is now <tt>/etc/X11</tt>. Finally, there is now only one X server for driving video hardware, @@ -411,7 +419,7 @@ hand. Once that's done, the main part of the installation can be done: <tscreen><verb> -./extract -C /usr/X11R6 X[a-df-uw-z]*.tgz +./extract -C /usr/X11R6 `pwd`/X[a-df-uw-z]*.tgz ./extract -C /usr/X11R6 Xvfb.tgz # If you are installing Xvfb ./extract -C /var Xvar.tgz /sbin/ldconfig /usr/X11R6/lib # For Linux diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml index 17b6e9297..dc4dd743b 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml @@ -9,10 +9,10 @@ David Dawes, Marc Wandschneider, Mark Weaver, Matthieu Herrb -<Date>Last modified on: 2 December 2000 +<Date>Last modified on: 7 December 2000 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.57 2000/12/02 15:27:09 herrb Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.59 2000/12/12 18:54:29 dawes Exp $ </ident> <toc> @@ -353,6 +353,19 @@ You should configure the distribution by editing <tt>xc/config/cf/host.def</tt> before compiling. To compile the sources, invoke ``<tt/make World/'' in the xc directory. +<sect1>Perl support +<p> +Starting with XFree86 4.0.2, perl is needed to build the fonts in +XFree86. Since perl is not included with standard NetBSD installation, +fonts that need perl are not built by default. +<p> +If you have installed perl (from the NetBSD packages, for instance), +add the line +<tscreen><verb> +#define HasPerl YES +</verb></tscreen> +in <tt>xc/config/cf/host.def</tt> before rebuilding XFree86. + <sect1>Aperture driver <p> To build the XFree86 server with the Aperture driver enabled, you @@ -362,9 +375,7 @@ Then edit <tt>xc/config/cf/host.def</tt> and add the line <tscreen><verb> #define HasNetBSDApertureDriver YES </verb></tscreen> -to it. - -And finally run <tt/make World/ in the <tt/xc/ directory. +to it before rebuilding XFree86. <sect1>Console drivers<label id="console-drivers"> @@ -391,7 +402,7 @@ by adding: #define XFree86ConsoleDefines -DWSCONS_SUPPORT </verb></tscreen> to <tt>xc/config/host.def</tt> before rebuilding the server. -This has not been toroughly tested, except on the macppc. +This has not been thoroughly tested, except on the macppc. <sect1>Building on other architectures<label id="sparc"> diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml index 2ce82b556..09a13a4cc 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml @@ -9,7 +9,7 @@ Matthieu Herrb <Date>Last modified on: 2 December 2000 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml,v 1.12 2000/12/02 15:27:09 herrb Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml,v 1.15 2000/12/12 18:54:29 dawes Exp $ </ident> <toc> @@ -60,10 +60,11 @@ non-OS dependent new features in XFree86 &relvers;. <sect1>New OS dependent features in 4.0.2 <p> <itemize> -<item>Support for the OpenBSD ports tree +<item>Support for the OpenBSD ports tree, <item>Preliminary support for the powerpc architecture (clients build -and work, the server doesn't work yet) -<item>Xdm now writes an utmp entry +and work, the server doesn't work yet), +<item>xdm now writes an utmp entry, +<item>startx now creates an Xauthority magic cookie for the display. </itemize> <sect1>New OS dependent features in 4.0.1 @@ -232,7 +233,44 @@ To enable the aperture driver, once included in the kernel, set machdep.allowaperture=1 </verb></tscreen> in <tt>/etc/sysctl.conf</tt>. - + +Some drivers need a patch to the aperture driver in the kernel to work +correctly with int10 support. If you get warning from xf86ReadBIOS +like this one: +<tscreen><verb> +(II) checkDevMem: using aperture driver /dev/xf86 +(WW) xf86ReadBIOS: /dev/mem mmap[s=600,a=0,o=0] failed (Invalid argument) +</verb></tscreen> +you should patch your kernel and rebuild it. Until it's integrated in +OpenBSD-current, or a better fix is found, the patch is available at +<htmlurl +name="ftp://ftp.laas.fr/pub/ii/matthieu/OpenBSD/patch-kernel-xf4" +url="ftp://ftp.laas.fr/pub/ii/matthieu/OpenBSD/patch-kernel-xf4">. + +I've also included it below, if you want to edit the source file by +hand. + +<tscreen><verb> +Index: sys/arch/i386/i386/mem.c +=================================================================== +RCS file: /cvs/src/sys/arch/i386/i386/mem.c,v +retrieving revision 1.14 +diff -u -r1.14 mem.c +--- sys/arch/i386/i386/mem.c 1999/11/20 11:11:28 1.14 ++++ sys/arch/i386/i386/mem.c 2000/11/13 10:54:22 +@@ -269,8 +269,8 @@ + /* minor device 4 is aperture driver */ + case 4: + if (allowaperture && +- (((off >= VGA_START && off <= BIOS_END) || +- (unsigned)off > (unsigned)ctob(physmem)))) ++ (off <= BIOS_END || ++ (unsigned)off > (unsigned)ctob(physmem))) + return i386_btop(off); + else + return -1; +</verb></tscreen> + <p> Another (less recommended) way to enable linear memory and I/O ports access is to disable the kernel security feature by adding ``option @@ -311,7 +349,7 @@ by adding: #define XFree86ConsoleDefines -DWSCONS_SUPPORT </verb></tscreen> to <tt>xc/config/host.def</tt> before rebuilding the server. -This has not been toroughly tested, except on the macppc. +This has not been thoroughly tested, except on the macppc. diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml index 74f03321a..50ecbe950 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml @@ -1,8 +1,10 @@ <!DOCTYPE linuxdoc PUBLIC "-//XFree86//DTD linuxdoc//EN" [ <!ENTITY % defs SYSTEM "defs.ent"> %defs; <!ENTITY % onediff 'IGNORE'> <!-- patch is a single diff file --> -<!ENTITY % twodiffs 'INCLUDE'> <!-- patch is split into two diff files --> +<!ENTITY % twodiffs 'IGNORE'> <!-- patch is split into two diff files --> <!ENTITY % threediffs 'IGNORE'> <!-- patch is split into three diff files --> +<!ENTITY % fourdiffs 'INCLUDE'> <!-- patch is split into four diff files --> +<!ENTITY % difftar 'INCLUDE'> <!-- patch also contains a tarball --> ]> @@ -10,10 +12,10 @@ <title>README for XFree86&tm; &relvers; <author>The XFree86 Project, Inc -<date>30 June 2000 +<date>15 December 2000 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.107 2000/07/02 16:35:56 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.110 2000/12/15 16:11:57 dawes Exp $ </ident> <abstract> @@ -29,42 +31,20 @@ operating systems on Intel and other platforms. <sect>What is XFree86 &relvers;? <p> -<![ %snapshot [ -XFree86 &relvers; is a ``work in progress'' snapshot of the XFree86 4.0 -development code. It is <![ %latersnap; [one of]]> -<![ %firstsnap; [the first in]]> -a series of snapshot releases leading up the the 4.0 release. The -plan is to release a new snapshot every four to six weeks. The target -audience for this release is developers and others who are comfortable -on the bleeding edge. This release is not targeted at beginners. -Also, most end users will find life easier using our latest 3.3.x release. -While we welcome bug reports and feedback about this release, we don't -have the resources to provide user-level support for it. If you're not -comfortable dealing with those sorts of things yourself, then the snapshot -releases are probably not for you. - -This code is very much work in progress. Many of the interfaces may -change without notice between now and the 4.0 release. The -<htmlurl name="driver design" url="DESIGN.html"> has changed significantly -compared with the 3.3.x versions, and only a small number of drivers have -been converted so far. That means that this release does not support a -wide range of video hardware. Some of the drivers and new features are -well developed and reasonably stable, while others are not. -]]> +XFree86 &relvers; is the third full release in the <![ %earlyrel; [new]]> +XFree86 4 series. -<![ %release [ -XFree86 &relvers; is <![ %firstrel; [the first]]> -<![ %laterrel; [a]]> the upgrade to the first full release in the <![ %earlyrel; [new]]> XFree86 4 -series. Release 4 is a major re-design of the basic architectural +<p> +XFree86 release 4 is a major re-design of the basic architectural underpinnings of XFree86's implementation of the original X Consortium's X Server. This re-design allows for a modular interaction between the -hardware drivers and the XFree86 core X server. With 4.0, upgrades to +hardware drivers and the XFree86 core X server. With 4.x, upgrades to the X server with new and unsupported hardware can be easily done and -installed without undergoing the previous process of rebuilding a X +installed without undergoing the previous process of rebuilding an X server. All that is required is installing the new driver module and updating the configuration file. -The road to XFree86 Release 4 began as an architectural concept in mid +The road to XFree86 release 4 began as an architectural concept in mid 1997, with the serious framework being implemented in code the beginning of 1998. There were several snapshots on the road to 4.0 which are now part of the 4.0 base release. The &relvers; version is an upgrade to @@ -72,16 +52,15 @@ part of the 4.0 base release. The &relvers; version is an upgrade to bug fixes. Release 4 also included the long-awaited integration of the DRI (Direct -Rendering Infrastructure). This upgrade into the code base gives XFree86 -the abilities of direct 3-D graphics rendering, used widely in games -and other visualization programs. - -Many drivers used in the old 3.3.x series have not be converted over to -the 4.0 design and so check first whether your hardware is supported -before upgrading to the 4.0 series in the <htmlurl name="Driver Status -document" url="Status.html">. +Rendering Infrastructure). This upgrade into the code base gives +XFree86 the abilities of accelerated direct 3-D graphics rendering, used +widely in games and other visualization programs. -]]> +While some driver available in the old 3.3.x release series have not +been converted over to the 4.x series, those required for most modern +video hardware are available. Please check the <htmlurl name="Driver +Status document" url="Status.html"> first to see whether your hardware +is supported before upgrading to the 4.x series. Specific release enhancements can be viewed in the <htmlurl name="Release Notes" url="RELNOTES.html">. @@ -110,9 +89,9 @@ and not XFree86. <p> If you would like to work on the development of XFree86 4, either by -helping with the conversion of our older drivers to the new 4.0 design, +helping with the conversion of our older drivers to the new 4.x design, or assisting in the addition of new drivers or platforms to the code base -then send a request to to <url name="join the XFree86 development team" +then send a request to <url name="join the XFree86 development team" url="http://www.xfree86.org:/developer.html">. This will give you direct access to the latest XFree86 related development topics and discussions. Include in your note, your name, email address, reason for joining (what @@ -167,6 +146,7 @@ repository this is the list that will show you those updates. This list is updated dynamically every time the repository is updated after the the commit happens. +<!-- <p> A followup to the commit list is the soon to be public, patch archives. This archive will be available on our web-site and will show what patches @@ -174,6 +154,7 @@ have been submitted and will soon be committed. This is helpful for people who are interested in a specific area and want to know what work is happening there. When this goes public we will announce it on our web site and our Announce mailing list, so keep watching. +--> <sect1> Xpert @@ -224,53 +205,112 @@ contains the general X11 documentation in hardcopy format. <![ %onediff; [ A source patch relative to version &prevrelvers; is also available. -The patch file is <tt>&prevrelvers;-&relvers;.diff.gz</tt>. This patch +The patch file is <tt>&prevrelvers;-&relvers;.diff.gz</tt>. +<![ %difftar; [ +There is also a tarball that contains some files that have components that +can't be included in a diff. It is <tt>&relvers;.tgz</tt>. +]]> +The patch should be applied to a clean &prevrelvers; source tree, working from the directory containing the <tt>xc/</tt> directory. The patch should be applied by running: <tscreen><verb> -gunzip < &prevrelvers;-&relvers;.diff.gz | patch -p0 -E +gzip -d < &prevrelvers;-&relvers;.diff.gz | patch -p0 -E +</verb></tscreen> +<![ %difftar; [ +<tscreen><verb> +gzip -d < &relvers;.tgz | tar vxf - </verb></tscreen> ]]> +]]> <![ %twodiffs; [ A source patch relative to version &prevrelvers; is also available. Because of its size, it is split into two parts. The patch files are <tt>&prevrelvers;-&relvers;.diff1.gz</tt> and -<tt>&prevrelvers;-&relvers;.diff2.gz</tt>. These patches should +<tt>&prevrelvers;-&relvers;.diff2.gz</tt>. +<![ %difftar; [ +There is also a tarball that contains some files that have components that +can't be included in a diff. It is <tt>&relvers;.tgz</tt>. +]]> +These patches should be applied to a clean &prevrelvers; source tree, working from the directory containing the <tt>xc/</tt> directory. The patches should be applied by running: <tscreen><verb> -gunzip < &prevrelvers;-&relvers;.diff1.gz | patch -p0 -E -gunzip < &prevrelvers;-&relvers;.diff2.gz | patch -p0 -E +gzip -d < &prevrelvers;-&relvers;.diff1.gz | patch -p0 -E +gzip -d < &prevrelvers;-&relvers;.diff2.gz | patch -p0 -E +</verb></tscreen> +<![ %difftar; [ +<tscreen><verb> +gzip -d < &relvers;.tgz | tar vxf - </verb></tscreen> ]]> +]]> <![ %threediffs; [ A source patch relative to version &prevrelvers; is also available. Because of its size, it is split into three parts. The patch files are <tt>&prevrelvers;-&relvers;.diff1.gz</tt>, <tt>&prevrelvers;-&relvers;.diff2.gz</tt> and -<tt>&prevrelvers;-&relvers;.diff3.gz</tt>. These patches should +<tt>&prevrelvers;-&relvers;.diff3.gz</tt>. +<![ %difftar; [ +There is also a tarball that contains some files that have components that +can't be included in a diff. It is <tt>&relvers;.tgz</tt>. +]]> +These patches should be applied to a clean &prevrelvers; source tree, working from the directory containing the <tt>xc/</tt> directory. The patches should be applied by running: <tscreen><verb> -gunzip < &prevrelvers;-&relvers;.diff1.gz | patch -p0 -E -gunzip < &prevrelvers;-&relvers;.diff2.gz | patch -p0 -E -gunzip < &prevrelvers;-&relvers;.diff3.gz | patch -p0 -E +gzip -d < &prevrelvers;-&relvers;.diff1.gz | patch -p0 -E +gzip -d < &prevrelvers;-&relvers;.diff2.gz | patch -p0 -E +gzip -d < &prevrelvers;-&relvers;.diff3.gz | patch -p0 -E +</verb></tscreen> +<![ %difftar; [ +<tscreen><verb> +gzip -d < &relvers;.tgz | tar vxf - </verb></tscreen> ]]> +]]> + +<![ %fourdiffs; [ +A source patch relative to version &prevrelvers; is also available. +Because of its size, it is split into four parts. +The patch files are <tt>&prevrelvers;-&relvers;.diff1.gz</tt>, +<tt>&prevrelvers;-&relvers;.diff2.gz</tt>, +<tt>&prevrelvers;-&relvers;.diff3.gz</tt> and +<tt>&prevrelvers;-&relvers;.diff4.gz</tt>. +<![ %difftar; [ +There is also a tarball that contains some files that have components that +can't be included in a diff. It is <tt>&relvers;.tgz</tt>. +]]> +These patches should +be applied to a clean &prevrelvers; source tree, working from the directory +containing the <tt>xc/</tt> directory. The patches should be applied by +running: + +<tscreen><verb> +gzip -d < &prevrelvers;-&relvers;.diff1.gz | patch -p0 -E +gzip -d < &prevrelvers;-&relvers;.diff2.gz | patch -p0 -E +gzip -d < &prevrelvers;-&relvers;.diff3.gz | patch -p0 -E +gzip -d < &prevrelvers;-&relvers;.diff4.gz | patch -p0 -E +</verb></tscreen> +<![ %difftar; [ +<tscreen><verb> +gzip -d < &relvers;.tgz | tar vxf - +</verb></tscreen> +]]> +]]> The contrib part of the distribution has been folded into the main source tree, so a separate contrib tarball is no longer required. To format the XFree86 documentation use the latest version of our doctools -package available as <tt>doctools-1.2.tgz</tt>. +package available as <tt>doctools-&doctoolsvers;.tgz</tt>. <sect>Reporting Bugs <p> diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml index 9e20f003f..79450284a 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml @@ -6,10 +6,10 @@ <title>Release Notes for XFree86™ &relvers; <author>The XFree86 Project, Inc -<date>3 July 2000 +<date>17 December 2000 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.43 2000/12/04 16:24:57 alanh Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.58 2000/12/17 23:01:10 dawes Exp $ </ident> <abstract> @@ -23,44 +23,47 @@ in XFree86 &relvers; and their status. <sect>Introduction to the 4.x Release Series <p> -XFree86 4.0 was the first official release of the new XFree86 4. XFree86 +XFree86 4.0 was the first official release of the new XFree86 4 series. +The current release (&relvers;) is the latest in that series. XFree86 4 represents a significant redesign of the XFree86 X server. Not all of the hardware drivers from 3.3.x have been ported to 4.x yet, but conversely, 4.x has some hardware support not present in 3.3.x. -We've attempted to provide some information -about the second point in our <htmlurl name="Driver Status document" -url="Status.html">. Please check there first before downloading &relvers;. - -The 4.0.1 has a new configuration tool, "<tt>xf86cfg</tt>". It is work -in progress, but definitely worth trying out. We have also updated the -basic text-based tool "<tt>xf86config</tt>" to generate config files in -the format required by &relvers; (3.3.x config files won't really work -with &relvers;). We're also on a configuration tool that is built-in -to the X server. An early version of this is included in the release, -and it works well for some hardware. To try it out, just run (as root) -"<tt>XFree86 -configure</tt>". Each of these configuration options will -give you a reasonable starting point for a suitable configuration file. -We've put some effort into documenting the &relvers; config file format, -and you can find that information in the XF86Config manual page. Check -that, the driver manual pages and the related documentation for further -information. - +Our <htmlurl name="Driver Status document" url="Status.html"> summarizes +how the hardware driver support compares between &legacyvers; and &relvers;. +Please check there first before downloading &relvers;. + +The 4.0.1 release introduced a new graphical configuration tool, +"<tt>xf86cfg</tt>", and a text mode interface was added to it for the +4.0.2 release. It is work in progress, but definitely worth trying out. +The trusty old text-based tool "<tt>xf86config</tt>" can also be used +for generating X server config files. In addition to these tools, we've +been working on a configuration tool that is built-in to the X +server. It is included in the release, and it works well for some +hardware. To try it out, just run (as root) "<tt>XFree86 -configure</tt>". +Each of these configuration options will give you a reasonable starting +point for a suitable configuration file. We've put some effort into +documenting the &relvers; config file format, and you can find that +information in the XF86Config manual page. Check that, the driver manual +pages and the related documentation for further information. + +<!-- Oh, another thing you might notice is that our documentation is rather patchy. Most of what is present should be in reasonable shape, but there are gaps. We thought it better to leave out docs that were very out of date rather than providing inaccurate and misleading information. We are looking for people to also help fill those gaps in <hint hint :->. +--> -Finally, before you download and install the binary distributions for +Before you go to download and install the binary distributions for this release, please have a quick read through the <htmlurl name="Installation Document" url="Install.html">. It may save you some -time. +time and help you figure out which of the binary releases you need. The next section describes what is new in the latest version (&relvers;). The other sections below describe some of the new features and changes -between 3.3.x and 4.0. There is a lot of new features, and we definitely -don't have enough space to cover it all here. +between 3.3.x and 4.0. There are lot's of new features, and we definitely +don't have enough space to cover them all here. </sect> @@ -69,38 +72,192 @@ don't have enough space to cover it all here. <sect1>X server <p> <itemize> - <item>New DRI drivers for Intel i810, Matrox G400 and G200 (AGP only) and - the ATI Rage 128, and updates to the 3Dfx DRI driver, including - Voodoo5 support. + <item>Darwin/Mac OS X is now supported and the X server runs on PowerPC. + The X server for this platform is called "Xdarwin", and its + installation and configuration is different from the "XFree86" + server used on other platforms. Please read the <htmlurl + url="Darwin.html" name="XFree86 on Darwin and Mac OS X"> document + for further information. + + <item>Mesa has been updated to the 3.4 stable release. + + <item>A driver for ATI Radeon adapters has been added. + + <item>ATI driver support for multi-head configurations and non-Intel + platforms has been improved. + + <item>The ATI driver has been changed to invoke the appropriate driver for + any Rage 128 and Radeon adapters that it finds in the system. + + <item>A driver (i128) for Number Nine chipsets has been added. + + <item>A driver (savage) for S3 Savage chipsets has been added. + + <item>A driver (siliconmotion) for some Silicon Motion chipsets has been + added. + + <item>The driver (ark) for Ark Logic chips has been ported to 4.x. + + <item>A VESA driver has been added. + + <item>A driver for SGI newport cards has been added (Linux/mips). + + <item>The trident driver has lots of fixes to the CyberBlade/Blade + support, XVideo support for the Image/Blade series (although + scaling doesn't work yet on the Image series). + + <item>The s3virge driver has stabilized ViRGE GX2 support, includes + ViRGE DX and ViRGE support for XVideo YUV images, and various fixes. + + <item>The 3Dlabs (glint) driver now has Permedia3 support. + + <item>The SiS driver has had many updates, and XVideo support for the 630 + is included. + + <item>The NVIDIA (nv) driver has been updated to include support for the + GeForce2, and line acceleration has been added. Also, DDC support + has been improved, and support added for Alpha platforms (dense only). + + <item>The neomagic driver has had various bug fixes and extended acceleration + support. DGA support has also been added. - <item>The X server now runs on Linux/Sparc including drivers for many - video cards used on SUN hardware. + <item>The Chips and Technologies driver (chips) has initial support for + the 69030. - <item>DRI support for the Linux/Sparc implementation that allows 3D direct - rendering with Creator3D cards. + <item>The tseng driver has multi-head fixes and DGA support has been added. - <item>Fixed recently publicized security issues. + <item>Most video drivers have been converted to use the integrated "fb" + framebuffer code instead of the old "cfb" code. + + <item>DRI support has been updated for the Rage 128, 3Dfx Voodoo3 and + Voodoo5, Intel i810/i815 and Matrox G400. DRI support for SiS + and Sun Creator3D is available. The DRI is now also available on + Alpha platforms. + + <item>An input driver (citron) for Citron Infrared Touch devices has been + added. + + <item>An input driver (penmount) for PenMount devices has been added. + + <item>An input driver (digitaledge) for DigitalEdge devices has been added. + + <item>Big endian problems in Xinerama have been fixed. - <item>Update Mesa to the latest version. + <item>The new "render" extension has been added (see <ref id="render" + name="below">). The design has been + extended in the following ways:<p> - <item>Xinerama updates and fixes. + <itemize> + <item>A new FillRectangles request was added. + + <item>The 'mask' operand was changed to allow per-channel alphas. + + </itemize> - <item>Xv updates and fixes. + <p>Server implementation: - <item>Mouse support in DGA 1.0 compatibility mode should now work correctly - for most games that make use of it. + <itemize> + <item>Implemented remaining code for client clip lists. + + <item>Fixed plenty of bugs related to text rendering. + + <item>Complete compositing code, except for separate alpha. + + </itemize> + + <p>Todo: + + <itemize> + <item>Polygons - <item>Some bugs with 8+24 overlay support have been fixed. + <item>Image scaling - <item>Some XKEYBOARD extension problems have been fixed, including - improvements to the MouseKeys support. + <item>Separate alpha channels - <item>Add generic DGA support to the sis, neomagic and i810 drivers. + <item>Support for visuals other than TrueColor. + + </itemize> + + <p>Drivers with render extension support include: i128, glint, ati (r128 + and radeon), chips, cirrus, mga, neomagic, nv, tdfx, trident, tseng, + vesa, s3virge. + + <p>Acceleration for the render extension: + + <itemize> + <item>XAA infrastructure for acceleration. + + <item>Experimental MGA acceleration using XAA + + <item>kdrive (TinyX) infrastructure + + <item>Experimental TinyX Trident 9525DVD acceleration + + </itemize> + + <p>Xft library: + + <itemize> + <item>New font naming/access library. + + <item>Abstraction for core/Render text. + + <item>Uses FreeType2 rasterizer. + + <item>Allows anti-aliased/subpixel sampled text. + + <item>Gracefully falls back to core rendering. + + <item>Complicated font matching mechanism. + + <item>Uses server DPI to convert point sizes to pixel sizes, even + for core fonts. + + </itemize> + + <p>xterm: + + <itemize> + <item>Can use Xft, by default uses core fonts. + + <item>Uses new options '<tt>-fa</tt>' for family name and + '<tt>-fs</tt>' for font size (in points). + + </itemize> + + <p>x11perf: + + <itemize> + <item>Add tests for anti-aliased, subpixel sampled and aliased + fonts using the Xft library. + + </itemize> - <item><tt>xf86cfg</tt>, a new graphical configuration tool for XFree86 4.0, + <p>xditview: + + <itemize> + <item>When the Xft library is build, uses Xft for all font access. + + </itemize> + + <p>Qt, Gtk, twm: + + <itemize> + <item>Qt changes available <url + url="http://XFree86.org/~keithp/download/qtkernel.tar.bz2" + name="here">. + + <item>Gtk changes in process. + + <item>twm hacks should never see the light of day. + + </itemize> + + + <item><tt>xf86cfg</tt>, a new graphical configuration tool for XFree86 4.x, and can be used to either write the initial configuration or make - customizations to the current configuration. <tt>xf86cfg</tt> is - a work in progress, and allows configuration of: + customisations to the current configuration. <tt>xf86cfg</tt> is + a work in progress, and allows configuration of:<p> <itemize> <item>Specific setup of monitors, cards, keyboards and mice, as @@ -112,7 +269,7 @@ don't have enough space to cover it all here. monitors, and allows adding a modeline specific to a monitor directly to the configuration file. <item>AccessX configuration interface, that provides an interface - to easy setup of most AccessX options, including: + to easy setup of most AccessX options, including:<p> <itemize> <item>Timeout to reset controls. @@ -129,7 +286,7 @@ don't have enough space to cover it all here. </itemize> </itemize> - New configuration options are being worked on, as well as correcting + <p>New configuration options are being worked on, as well as correcting some of the bugs in the current options. A protocol for plugging in external modules is also planned. @@ -139,119 +296,197 @@ don't have enough space to cover it all here. <sect1>X libraries and clients. <p> <itemize> - <item>Thread safety issues have been resolved in a few places in the - libraries. Upgrading to the latest libraries is essential for - multi-threaded X applications. + <item>Significant updates to the internationalisation support in Xlib + (see <ref id="i18n" name="below">). - <item>Some fatal bugs in the big font support have been fixed. Upgrading - to the latest libraries will fix this too. + <item>Some xfs updates, including font path verification, and new options. - <item>Fixed recently publicized security issues in some of the X libraries. + <item>XTerm updates. - <item>Updates and bug fixes for some clients, including xedit, xman, - xcalc, fstobdf, xdm. - - <item>Fix some xfs problems. - - <item>XTerm updates. These include: - <itemize> - <item>Improve logfile security. - - <item>Workaround for fixed fonts which are generated from - Unicode fonts: they omit glyphs for some xterm's - less-used line-drawing characters, which caused xterm - to set a flag telling it to use only its internal - line-drawing characters. - - <item>Limit numeric parameters of control sequences to 65535 - to simplify checks for numeric overflow. - - <item>Change index into UDK list to unsigned to guard against - numeric overflow making the index negative. - - <item>Add limit checks to ClearInLine(), ScrnInsertChar(), - ScrnDeleteChar() to correct potential out-of-bounds - indexing. - - <item>Add a resource (limitResize) limiting resizing via the - <tt>CSI 4 t</tt> and <tt>CSI 8 t</tt> sequences. - - <item>Ignore out-of-bounds resize requests, i.e., where - sign-extension or truncation of the parameters would - occur. - - <item>Change Sun function-keys resource name to sunFunctionKeys - to work around redefinition of the token sun by xrdb on - Solaris. Similarly, renamed resource sun keyboard to - sunKeyboard. Change similar resource names for HP and - SCO to avoid potential conflict with xrdb symbols on - other systems, as well as for consistency. - - <item>Change line speed from 9600bd to 38400bd to accommodate - users who mistakenly use $TERM set to vt100, to reduce - the effect of padding associated with this terminal - type. - - <item>Fix a problem that caused the right scrollbar to be - positioned incorrectly when re-enabling it. - - <item>Fix a problem with color support that showed up on some - platforms. - - <item>Modify logic for deleteIsDEL resource so it has internally - 3 states: unspecified, true and false. If unspecified, - the keyboard type determines whether the Delete key - transmits <tt><esc>[3~</tt> or <tt>\177</tt>, and - the popup menu entry reflects the internal state. - Otherwise, the popup menu entry overrides the keyboard - type. - - <item>Portability fixes for os390, AIX 4.2, Digital Unix 4.0 - and IRIX 6.5. - - </itemize> + <item>New "xvinfo" client for querying the XVideo extension. </itemize> -<sect1>Fonts and Internationalisation +<sect1>Fonts and Internationalisation <label id="i18n"> <p> <itemize> <item>Many of the "misc" bdf fonts have been updated and extended, and - a wider range of ISO-8859 subsets have been added. Oblique/italic - versions of some of them have also been added. + a wider range of ISO-8859 subsets have been added. These are now + auto-generated from ISO-10646 encoded master fonts. + + <item>The ClearlyU ISO-10646 encoded fonts have been updated. + + <item>Functions to read keyboard input in locale independent UTF-8 encoding + have been added to libX11: Xutf8LookupString, Xutf8ResetIC. - <item>The converters in Xlib have been improved and reworked. UTF-8 - support has been added. + <item>Functions to output strings in locale independent UTF-8 encoding + have been added to libX11: Xutf8DrawString, Xutf8DrawImageString, + Xutf8TextEscapement, Xutf8TextExtents, Xutf8TextPerCharExtents, + Xutf8DrawText. - <item>Support for ISO-8859-13 has been added to Xlib and to the UTF-8 - converters. + <item>Functions to convert between Compound Text or locale dependent encoding + and UTF-8 have been added to libX11: Xutf8TextListToTextProperty, + Xutf8TextPropertyToTextList. The converter between Compound Text + and UTF-8 in Xlib has been improved; a round-trip conversion + now correctly converts all graphic Unicode characters back and + forth. + + <item>libXaw now offers selected text using both selection targets, + UTF8_STRING and COMPOUND_TEXT. + + <item>Locales with UTF-8 encodings are now supported; but the UTF-8 + displaying facilities are not adequate yet. <item>XKB keyboard definitions have been added and updated for some countries. - <item>Locale support for Celtic languages has been updated, and a Compose - file for ISO-8859-14 added. - </itemize> </sect1> -<sect1>Miscellaneous +<sect1>Platforms <p> <itemize> - <item>Preliminary support for Linux/mips (no X servers yet). + <item>Darwin/Mac OS X. - <item>Update support for BSD/OS. + <item>Greatly improved IA-64 support. - <item>Update Linux/IA64 support. + <item>Improved Linux/mips support. - <item>Support for LynxOS 3.1.0. + <item>Support has been added for more Alpha platforms under Linux. This + now includes all platforms that require sparse memory mapping. </itemize> </sect1> </sect> -<sect>The new X server +<sect>Drivers +<p> + +<sect1>Video Drivers +<p> + +XFree86 &relvers; includes the following video drivers: + +<table border=1 align="center"> +<tabular ca="|l|l|l|"> + <tabrow>Driver Name<colsep>Description<colsep>Further Information</tabrow> + <hline> + <tabrow><tt>apm</tt><colsep>Alliance Pro Motion<colsep><htmlurl + name="README.apm" url="apm.html"></tabrow> + <tabrow><tt>ark</tt><colsep>Ark Logic<colsep> </tabrow> + <tabrow><tt>ati</tt><colsep>ATI<colsep><htmlurl + name="README.ati" url="ati.html">, <htmlurl + name="README.r128" url="r128.html">, <htmlurl + name="r128(4)" url="r128.4.html"></tabrow> + <tabrow><tt>chips</tt><colsep>Chips & Technologies<colsep><htmlurl + name="README.chips" url="chips.html">, <htmlurl + name="chips(4)" url="chips.4.html"></tabrow> + <tabrow><tt>cirrus</tt><colsep>Cirrus Logic<colsep> </tabrow> + <tabrow><tt>cyrix</tt> (*)<colsep>Cyrix MediaGX<colsep><htmlurl + name="README.cyrix" url="cyrix.html"></tabrow> + <tabrow><tt>fbdev</tt><colsep>Linux fbdev<colsep><htmlurl + name="fbdev(4)" url="fbdev.4.html"></tabrow> + <tabrow><tt>glide</tt><colsep>Glide2x (3Dfx)<colsep><htmlurl + name="glide(4)" url="glide.4.html"></tabrow> + <tabrow><tt>glint</tt><colsep>3Dlabs, TI<colsep><htmlurl + name="glint(4)" url="glint.4.html"></tabrow> + <tabrow><tt>i128</tt><colsep>Number Nine<colsep><htmlurl + name="README.I128" url="I128.html">, <htmlurl + name="i128(4)" url="i128.4.html"></tabrow> + <tabrow><tt>i740</tt><colsep>Intel i740<colsep><htmlurl + name="README.i740" url="i740.html"></tabrow> + <tabrow><tt>i810</tt><colsep>Intel i810<colsep><htmlurl + name="README.i810" url="i810.html">, <htmlurl + name="i810(4)" url="i810.4.html"></tabrow> + <tabrow><tt>imstt</tt><colsep>Integrated Micro Solns<colsep> </tabrow> + <tabrow><tt>mga</tt><colsep>Matrox<colsep><htmlurl + name="mga(4)" url="mga.4.html"></tabrow> + <tabrow><tt>neomagic</tt><colsep>NeoMagic<colsep><htmlurl + name="neomagic(4)" url="neomagic.4.html"></tabrow> + <tabrow><tt>newport</tt> (-)<colsep>SGI Newport<colsep><htmlurl + name="README.newport" url="newport.html">, <htmlurl + name="newport(4)" url="newport.4.html"></tabrow> + <tabrow><tt>nv</tt><colsep>NVIDIA<colsep><htmlurl + name="nv(4)" url="nv.4.html"></tabrow> + <tabrow><tt>rendition</tt><colsep>Rendition<colsep><htmlurl + name="README.rendition" url="rendition.html">, <htmlurl + name="rendition(4)" url="rendition.4.html"></tabrow> + <tabrow><tt>s3virge</tt><colsep>S3 ViRGE<colsep><htmlurl + name="README.s3virge" url="s3virge.html">, <htmlurl + name="s3virge(4)" url="s3virge.4.html"></tabrow> + <tabrow><tt>savage</tt><colsep>S3 Savage<colsep><htmlurl + name="savage(4)" url="savage.4.html"></tabrow> + <tabrow><tt>siliconmotion</tt><colsep>Silicon Motion<colsep><htmlurl + name="siliconmotion(4)" url="siliconmotion.4.html"></tabrow> + <tabrow><tt>sis</tt><colsep>SiS<colsep><htmlurl + name="README.SiS" url="SiS.html"></tabrow> + <tabrow><tt>sunbw2</tt> (+)<colsep>Sun bw2<colsep> </tabrow> + <tabrow><tt>suncg14</tt> (+)<colsep>Sun cg14<colsep> </tabrow> + <tabrow><tt>suncg3</tt> (+)<colsep>Sun cg3<colsep> </tabrow> + <tabrow><tt>suncg6</tt> (+)<colsep>Sun GX and Turbo GX<colsep> </tabrow> + <tabrow><tt>sunffb</tt> (+)<colsep>Sun Creator/3D, Elite 3D<colsep> </tabrow> + <tabrow><tt>sunleo</tt> (+)<colsep>Sun Leo (ZX)<colsep> </tabrow> + <tabrow><tt>suntcx</tt> (+)<colsep>Sun TCX<colsep> </tabrow> + <tabrow><tt>tdfx</tt><colsep>3Dfx<colsep> </tabrow> + <tabrow><tt>tga</tt><colsep>DEC TGA<colsep><htmlurl + name="README.DECtga" url="DECtga.html"></tabrow> + <tabrow><tt>trident</tt><colsep>Trident<colsep><htmlurl + name="trident(4)" url="trident.4.html"></tabrow> + <tabrow><tt>tseng</tt><colsep>Tseng Labs<colsep> </tabrow> + <tabrow><tt>vesa</tt><colsep>VESA<colsep><htmlurl + name="vesa(4)" url="vesa.4.html"></tabrow> + <tabrow><tt>vga</tt><colsep>Generic VGA<colsep><htmlurl + name="vga(4)" url="vga.4.html"></tabrow> +</tabular> +</table> + +Drivers marked with (*) are present in a preliminary form in this release, +but are not complete and/or stable yet. +<p> + +Drivers marked with (+) are for Linux/Sparc only. +<p> + +Drivers marked with (-) are for Linux/mips only. +<p> + +Darwin/Mac OS X uses IOKit drivers and does not use the module loader drivers +listed above. Further information can be found in +<htmlurl name="README.Darwin" url="Darwin.html">. + +XFree86 &relvers; includes the following input drivers: + +<sect1>Input Drivers +<p> + +<table border=1 align="center"> +<tabular ca="|l|l|l|"> + <tabrow>Driver Name<colsep>Description<colsep>Further Information</tabrow> + <hline> + <tabrow><tt>acecad</tt><colsep>AceCad<colsep> </tabrow> + <tabrow><tt>citron</tt><colsep>Citron<colsep><htmlurl + name="citron(4)" url="citron.4.html"></tabrow> + <tabrow><tt>digitaledge</tt><colsep>DigitalEdge<colsep> </tabrow> + <tabrow><tt>dynapro</tt><colsep>Dynapro<colsep> </tabrow> + <tabrow><tt>elographics</tt><colsep>EloGraphics<colsep> </tabrow> + <tabrow><tt>keyboard</tt><colsep>generic keyboards<colsep><htmlurl + name="keyboard(4)" url="keyboard.4.html"></tabrow> + <tabrow><tt>microtouch</tt><colsep>MicroTouch<colsep> </tabrow> + <tabrow><tt>mouse</tt><colsep>most mouse devices<colsep><htmlurl + name="mouse(4)" url="mouse.4.html"></tabrow> + <tabrow><tt>mutouch</tt><colsep>MicroTouch<colsep> </tabrow> + <tabrow><tt>penmount</tt><colsep>PenMount<colsep> </tabrow> + <tabrow><tt>spaceorb</tt><colsep>SpaceOrb<colsep> </tabrow> + <tabrow><tt>summa</tt><colsep>SummaGraphics<colsep> </tabrow> + <tabrow><tt>void</tt><colsep>dummy device<colsep><htmlurl + name="void(4)" url="void.4.html"></tabrow> + <tabrow><tt>wacom</tt><colsep>Wacom tablets<colsep><htmlurl + name="wacom(4)" url="wacom.4.html"></tabrow> +</tabular> +</table> + +<sect>Summary of XFree86 4. <p> Unlike XFree86 3.3.x where there are multiple X server binaries, each of which drive different hardware, XFree86 &relvers; has a single X @@ -261,9 +496,9 @@ load the video drivers and other modules that are needed. XFree86 &relvers; has X server support for most UNIX(R) and UNIX-like operating systems on Intel/x86 platforms, plus support for Linux on -Alpha, PowerPC and Sparc platforms. Work on support for additional -architectures and operating systems is in progress, and is planned for -future releases. +Alpha, PowerPC, IA-64, Sparc, and Mips platforms, and for Darwin on PowerPC. +Work on support for additional architectures and operating systems is +in progress, and is planned for future releases. <sect1>Loader and Modules <p> @@ -436,15 +671,6 @@ Section "InputDevice" EndSection </verb></quote> -<!-- what is this doing in the middle of information about the config file?? -j - Note: Additional sample rates have been added for some mice. - Matching the mouse sampling rate with the vertical refresh - rate can yield very noticeable improvements in smoothness of - pointer event driven operations such as window moves and - scrolling. ---> - <item>The Monitor section is mostly unchanged. The main difference is that a set of VESA modes is defined internally in the server, and so for most monitors, it isn't necessary to specify any modes @@ -656,12 +882,12 @@ The following X server command line options have been changed since 3.3.x: <p> The XFree86 Acceleration Architecture (XAA) has been completely rewritten -from scratch. Most drivers implement acceleration by making use of the -XAA module. +from scratch for XFree86 4.x. Most drivers implement acceleration by +making use of the XAA module. <sect1>Multi-head <p> -Some multi-head configurations are supported in this release, primarily +Some multi-head configurations are supported in XFree86 4.x, primarily with multiple PCI/AGP cards. However, this is an area that is still being worked on, and we expect that the range of configurations for which it works well will increase in future releases. A configuration that @@ -688,12 +914,12 @@ an 8-bit screen together with a 16-bit screen in Xinerama mode. Xinerama is not enabled by default, and can be enabled with the <tt>+xinerama</tt> command line option for the X server. -Xinerama was included with X11R6.4. The version included in this release +Xinerama was included with X11R6.4. The version included in XFree86 4.x was completely rewritten for improved performance and correctness. Known problems: <itemize> - <item>Most (all?) window managers are not Xinerama-aware, and so some + <item>Most window managers are not Xinerama-aware, and so some operations like window placement and resizing might not behave in an ideal way. This is an issue that needs to be dealt with in the individual window managers, and isn't specifically an @@ -739,7 +965,9 @@ of the config file. <p> <url name="Precision Insight" url="http://www.precisioninsight.com"> -has been provided with funding and support from <url name="Red Hat" +(now part of the Professional Services group at <url name="VA Linux Systems" +url="http://www.valinux.com">) +was provided with funding and support from <url name="Red Hat" url="http://www.redhat.com">, <url name="SGI" url="http://www.sgi.com">, <url name="3Dfx" url="http://www.3dfx.com">, <url name="Intel" url="http://www.intel.com">, <url name="ATI" url="http://www.ati.com">, @@ -753,223 +981,157 @@ these components into the XFree86 X Server and added a Direct Rendering Infrastructure (DRI). Direct Rendering provides a highly optimized path for sending 3D data directly to the graphics hardware. This release provides a complete implementation of direct rendering support -for the 3Dfx Banshee and Voodoo3 graphics cards. Additional direct -rendering drivers will be available for 3Dfx, Intel, ATI and Matrox -boards during the second quarter of 2000. Updated information on DRI +for the 3Dfx Banshee, Voodoo3 and Voodoo5 graphics cards, as well as +the Intel i810/i815 cards, ATI Rage 128, and Matrox G400. +Updated information on DRI compatible drivers can be found at the <url name="DRI Project" url="http://dri.sourceforge.net"> on <url name="SourceForge" url="http://www.sourceforge.net">. -<sect1>X-Video Extension (Xv) +<sect1>XVideo Extension (Xv) <p> +The XVideo extension is supported in XFree86 4.x. An XvQueryPortAttributes function has been added as well as support for XvImages. XvImages are XImages in alternate color spaces such as YUV and can be passed to the server through shared memory segments. This allows clients to display YUV data with high quality -hardware scaling and filtering. XvImages are only supported -by the Matrox G200/G400 cards at the moment. +hardware scaling and filtering. -<sect1>Other extensions +<sect1>X Rendering Extension (Render) <label id="render"> <p> -The XFree86-Misc extension has not been fully ported to the new server -architecture yet. This should be completed in a future release. - -The XFree86-VidModeExtension extension has been updated, and mostly -ported to the new server architecture. The area of mode validation -needs further work, and the extension should be used with care. This -extension has support for changing the gamma setting at run-time, for -modes where this is possible. The new <tt>xgamma</tt> utility makes -use of this feature. Compatibility with the 3.3.x version of the -extension is provided. The missing parts of this extension and some -new features should be completed in a future release. +The X Rendering extension provides a 2D rendering model that more +closely matches application demands and hardware capabilities. It provides +a rendering model derived from Plan 9 based on Porter/Duff image +composition rather than binary raster operations. - -<sect1>Drivers <p> +Using simple compositing operators provided by most hardware, Render +can draw anti-aliased text and geometric objects as well as perform +translucent image overlays and other image operations not possible with +the core X rendering system. -XFree86 &relvers; includes the following drivers: - -<table border=1 align="center"> -<tabular ca="|l|l|"> - <tabrow>Driver Name<colsep>Description</tabrow> - <hline> - <tabrow><tt>apm</tt><colsep>Alliance Pro Motion</tabrow> - <tabrow><tt>ati</tt><colsep>ATI</tabrow> - <tabrow><tt>chips</tt><colsep>Chips & Technologies</tabrow> - <tabrow><tt>cirrus</tt><colsep>Cirrus Logic</tabrow> - <tabrow><tt>cyrix</tt> (*)<colsep>Cyrix MediaGX</tabrow> - <tabrow><tt>fbdev</tt><colsep>Linux fbdev</tabrow> - <tabrow><tt>glide</tt><colsep>Glide2x (3Dfx)</tabrow> - <tabrow><tt>glint</tt><colsep>3Dlabs, TI</tabrow> - <tabrow><tt>i740</tt><colsep>Intel i740</tabrow> - <tabrow><tt>i810</tt><colsep>Intel i810</tabrow> - <tabrow><tt>mga</tt><colsep>Matrox</tabrow> - <tabrow><tt>neomagic</tt><colsep>NeoMagic</tabrow> - <tabrow><tt>nv</tt><colsep>NVIDIA</tabrow> - <tabrow><tt>r128</tt><colsep>ATI Rage 128</tabrow> - <tabrow><tt>rendition</tt><colsep>Rendition</tabrow> - <tabrow><tt>s3virge</tt><colsep>S3 ViRGE</tabrow> - <tabrow><tt>sis</tt><colsep>SiS</tabrow> - <tabrow><tt>sunbw2</tt> (+)<colsep>Sun bw2</tabrow> - <tabrow><tt>suncg14</tt> (+)<colsep>Sun cg14</tabrow> - <tabrow><tt>suncg3</tt> (+)<colsep>Sun cg3</tabrow> - <tabrow><tt>suncg6</tt> (+)<colsep>Sun GX and Turbo GX</tabrow> - <tabrow><tt>sunffb</tt> (+)<colsep>Sun Creator, Creator3D and Elite 3D</tabrow> - <tabrow><tt>sunleo</tt> (+)<colsep>Sun Leo (ZX)</tabrow> - <tabrow><tt>suntcx</tt> (+)<colsep>Sun TCX</tabrow> - <tabrow><tt>tdfx</tt><colsep>3Dfx</tabrow> - <tabrow><tt>tga</tt><colsep>DEC TGA</tabrow> - <tabrow><tt>trident</tt><colsep>Trident</tabrow> - <tabrow><tt>tseng</tt><colsep>Tseng Labs</tabrow> - <tabrow><tt>vga</tt><colsep>Generic VGA</tabrow> -</tabular> -</table> - -Drivers marked with (*) are present in a preliminary form in this release, -but are not complete and/or stable yet. <p> +XFree86 &relvers; provides a partial implementation of Render sufficient +for drawing anti-aliased text and image composition. Still to be +implemented are geometric primitives and affine transformation of images. -Drivers marked with (+) are for Linux/Sparc only. - -<sect2>APM <label id="apm"> <p> - -This is the driver for Alliance AT3D/AT25 and AT24 chips. There is a rather -complete support for the functions with acceleration at 8,15,16,24 and 32 bits -(limited by the chip at 24bpp). There is preliminary, still buggy, support -for the AP6422 chip, which is still supported in 3.3.x servers. The Xv driver -is almost ok. The Rush extension for glide2x works, with some additions, -including overlay of the result. DGA and DGA2 have been tested ok. -Further information can be found in <htmlurl name="README.apm" url="apm.html">. - -<sect2>Chips & Technologies +Unlike the core protocol, Render provides no font support for applications, +rather it allows applications to upload glyphs for display on the screen. +This allows the client greater control over text rendering and complete +access to the available font information while still providing hardware +acceleration. The Xft library provides font access for +Render applications. + +<sect2>The Xft Library <p> -Information about the C&T driver can be found in <htmlurl -name="README.chips" url="chips.html">. +On the client side, the Xft library provides access to fonts for +applications using the FreeType library, version 2. FreeType currently +supports Type1 and TrueType font files, a future release is expected to +support BDF and PCF files as well, so Render applications will have access +to the complete range of fonts available to core applications. One +important thing to note is that Xft uses the vertical size of the monitor +to compute accurate pixel sizes for provided point sizes; if your monitor +doesn't provide accurate information via DDC, you may want to add that +information to <tt>XF86Config</tt>. -<sect2>s3virge <p> +To allow a graceful transition for applications moving from core text +rendering to the Render extension, Xft can use either core fonts or +FreeType and the Render extension for text. By default, Xft is configured +to support only core fonts, see the section on building FreeType support +for the changes needed to add FreeType/Render fonts. -The s3virge driver is a port of the 3.3.x SVGA S3 ViRGE driver. As -such it should be as stable and functional as previous XFree86 -releases. There are a couple additional benefits included primarily due -to common enhancements: - -<itemize> - <item>Depth 24 problems resolved with clients using 24/32 bpp pixmaps. - <item>Our common acceleration architecture (XAA) has been re-written, - as has the ViRGE acceleration code. You should find this version - has better performance than prior releases. - - <item>Multi-head is reported to work. - <item>The <tt>s3virge</tt> man page lists options and has configuration - notes for this release of the driver. - <item>Trio 3D and Trio 3D/2X support has been added, matching the 3.3.6 - driver. - <item>Supports screen rotation and shadow framebuffer. - -</itemize> - -Outstanding items not implemented or fully tested: - -<itemize> - <item>DGA support is implemented, but preliminary and untested. -</itemize> - -Further information can be found in <htmlurl name="README.s3virge" -url="s3virge.html">. - -<sect2>TGA <p> +The Xft library uses a configuration file, <tt>XftConfig</tt>, which +contains information about which directories contain font files and also +provides a sophisticated font aliasing mechanism. Documentation for that +file is included in the Xft man page. -The TGA driver is now accelerated and supports both 8 and 32 plane -framebuffers. It is known to work under Linux/Alpha. Please see the -<htmlurl name="README.DECtga" url="DECtga.html"> file for further -information. - -<sect2>Matrox +</sect2> +<sect2>Building FreeType support for Xft <p> -The MGA driver supports the same range or hardware as XFree86 3.3.4, -but has a number of enhancements including multi-head support and -support for (non-destructive) overlays (8-bit + 24-bit). - -This release contains performance enhancements for the G400 and particularly -for the G400 MAX. It also includes XvImage support for G200/G400 chips and -improved memory autodetection support. +XFree86 &relvers; includes sources for FreeType version 2.0.1, but they are +not built and installed automatically. As a result, Xft is configured to +provide only core fonts by default. -Further information can be found in the <tt>mga</tt> <htmlurl name="man page" -url="mga.4.html">. - -<sect2>ATI <p> +To build FreeType support for Xft, first FreeType must be built and +installed, either from the sources included in XFree86 in +<tt>extras/freetype2</tt> or from another FreeType (version 2.0.1 or later) +release. Early FreeType version 2 releases used a different header file +installation and aren't compatible with XFree86. Instructions for building and +installing FreeType can be found in the <tt>INSTALL</tt> file included with +the FreeType release. -Information about the ATI driver can be found in <url name="README.ati" -url="ati.html">. The current version is not accelerated for all supported -chips. Some acceleration is included for Mach64 chips. +<p> +Second, XFree86 needs to know the installed location for FreeType, usually +<tt>/usr/local</tt>. Edit (or create) <tt>config/cf/host.def</tt> to +include: +<quote><p> + #define Freetype2Dir /usr/local +</quote> -<sect2>NVIDIA <p> +Finally, build XFree86 with "make World" from the top. +</sect2> -The "nv" driver supports all Riva TNT accelerators as well as the GeForce -256 and Quadro accelerators (the GeForce2 and GeForce2 MX are not yet -supported). DGA 2.0 support is included. +<sect2>Application Support For Anti-Aliased Text +<p> -Further information can be found in the nv <htmlurl name="man page" -url="nv.4.html">. +Only three applications have been modified in XFree86 &relvers; to work +with the Render extension and the Xft and FreeType libraries to provide +anti-aliased text. Xterm, xditview and x11perf. Migration of other +applications may occur in future releases. -<sect2>Glide <p> -This driver is for Voodoo 1 and Voodoo 2 boards. It runs X on top of -the 3DFX Glide API (where this is available, like for Linux). You need -to have Glide 2.x installed before you can run this driver. This -driver uses no hardware acceleration (since there is no 2D -acceleration in these boards) but is rather quick anyway since the CPU -renders to local RAM which is then copied block-wise to the -board. Unfortunately the Voodoo 1/2 boards are rather limited in -resolution. The Voodoo 1 can do 800x600 and the Voodoo 2 can do -1024x768 at best, but still it has some use as a second head in -Xinerama or multihead mode. - -16 and 24 bpp modes are supported (24 bit in 32-bit sparse-packed -mode). - -Further information about this driver can be found in the 'glide' driver -man page for XFree86. You will not get this driver running before -reading this man page. - -For Voodoo Banshee and Voodoo 3 boards or later: Please use the tdfx -driver which talks directly to the hardware and is much faster. - -<sect2>GLINT <label id="glint"> +By default, xterm uses core fonts through the standard core API. It has +two command line options and associated resources to direct it to use +Xft instead: +<itemize> + <item><tt>-fa</tt> family / <tt>.VT100.faceName:</tt> family. Selects the + font family to use. + <item><tt>-fs</tt> pointsize / <tt>.VT100.faceSize:</tt> pointsize. + Selects the pointsize. +</itemize> + <p> +Xditview will use Xft instead of the core API by default. X11perf +includes tests to measure the performance of text rendered in three ways, +anti-aliased, anti-aliased with sub-pixel sampling and regular chunky +text, but through the Render extension, a path which has not been +optimized within the X server yet. +</sect2> -The "glint" driver supports most 3Dlabs/Texas Instruments GLINT/Permedia -chips. There is a rather complete support (better than in 3.3.x) for -acceleration at 8, 15, 16, and 24 bit depths (limited by some chips at -some depths). 8+24 overlay is supported. The Xv extension is supported -for some boards. +<sect1>Other extensions +<p> -Further information about this driver can be found in the 'glint' driver -man page. +The XFree86-Misc extension has not been fully ported to the new server +architecture yet. This should be completed in a future release. -<sect2>Trident <label id="trident"> -<p> +The XFree86-VidModeExtension extension has been updated, and mostly +ported to the new server architecture. The area of mode validation +needs further work, and the extension should be used with care. This +extension has support for changing the gamma setting at run-time, for +modes where this is possible. The new <tt>xgamma</tt> utility makes +use of this feature. Compatibility with the 3.3.x version of the +extension is provided. The missing parts of this extension and some +new features should be completed in a future release. -The "trident" driver supports all PCI based Trident cards, including one ISA -based - the 8900D. 3.3.x is still needed for older SVGA ISA/VLB based cards, -yet 4.0.2 is much faster for the newer boards. +<!-- <sect>X libraries and clients <p> +--> <sect1>Xaw <p> -Two versions of the Xaw library are provided in this release. A version with +Two versions of the Xaw library are provided with XFree86 4.x. A version with bug fixes and a few binary compatible improvements and a new version with several new features. @@ -1024,14 +1186,6 @@ New features: </itemize> -<!-- is this still true? - <item>This release shows the current state of the work to add to the Xaw - text widget WYSIWYG capabilities. The state is very initial, and - can be seen as a candidate to a candidate to a very early alpha - snapshot. There is no public interface for programming yet, because - the current one is very likely to change before ready to use. ---> - </itemize> Bug fixes: @@ -1057,207 +1211,6 @@ Bug fixes: Version 3.4k of the Xpm (X pixmap) library is now integrated into XFree86. -<sect1>xterm -<p> - -New Features: - -<itemize> - <item>Support Unix98 PTY's. - - <item>Support Unicode using UTF-8 input and output. There are a few - limitations, this work is still in progress: - - <itemize> - <item>You must use the <tt>-u8</tt> command line option to - use this feature, as well as compile with the - <tt>OPT_WIDE_CHARS</tt> definition. (The feature is - compiled when using imake). - - <item>Input (from keyboard) and output (select/paste) are in - UTF-8 form. There is no support in Xlib for UTF-8; - xterm uses a lookup table to map keysym codes. - Select/paste is done either via <tt>STRING</tt> or using - the new atom <tt>UTF8_STRING</tt>. - - </itemize> - - <item>Add optional feature (resource and command-line options) to make - xterm use the PTY's sense of erase character on startup, rather - than requiring it to be <tt>\177</tt>, or set the PTY's erase - character to match xterm's configuration. Note that while - <tt>$TERMCAP</tt> is modified to reflect the actual configuration, - the terminfo <tt>kdch1</tt> string is not. (This feature is - also in XFree86 3.3.4). - - <item>Revised keyboard handling, making two modes (VT220 and Sun/PC) which - are switched by popup menu. This makes the numeric keypad work as - expected. Codes sent by the backarrow and delete keys also are - affected. - - <item>Add parameters to function key escape sequences to indicate if - shift, control or alt are set. This works for Sun/PC keyboard - mode. - - <item>Separated command-line and menu settings for reverse video from that - done under program control. This is a problem which was introduced - by X11R6. Though correct, most users are confused by allowing - the reset command to undo the effect of the command-line - <tt>-rv</tt> option. - - <item>Blinking cursor can be specified by resource or popup menu. - - <item>New control sequences for switching between normal and alternate - screens maintain separate cursor-save locations for the two screens, - avoiding incorrect cursor placement on exit from vi. - - <item>Support line-drawing characters when the font does not include them - by drawing them. - - <item>Add support for switching font sizes, by stepping through the font - menu using shifted keypad plus and minus. - - <item>New resource <tt>trimSelection</tt> allows xterm to trim trailing - blanks from selected lines. - - <item>Provide user applications a means of determining the version of xterm - for feature comparison by returning the patch number (e.g., 111) in - the secondary DA response. - - <item>Modify treatment of <tt>XK_Delete</tt> keysym so it transmits - parameterized VT220-style "<tt><esc>[3~</tt>" if modifiers - (shift, control alt) are given. - - <item>Add ``cacheDoublesize'' resource to limit the caching of font - information for double-sized characters, to accommodate X terminals - with limited font memory. - - <item>Add ``metaSendsEscape'' resource, with corresponding control sequence - and menu entry. Like ``eightBitInput'', this causes xterm to send ESC - prefixing the given key, but applies to all keys and is independent - of the 8-bit/7-bit terminal setting. - - <item>Implement an 88-color model for systems where 256-colors cannot be - allocated. - - <item>Add support for DEC Locator control sequences for xterm. This allows - the xterm mouse to be used with applications that use the DEC Locator - sequences, such as VAX Tpu, or SMG$ based applications. - - <item>Implement <tt>-hold</tt> option, allowing users to retain the window - after a shell has exited. - - <item>Add an application resource, ``messages'' (and a corresponding - <tt>-</tt>/<tt>+mesg</tt> option) which controls the initial - permission on the terminal. - - <item>Implement UTF-8 translation for Media Copy (print) operations. - - <item>Implement vt320 control sequences for Print Composed Main Display and - for Print All Pages. The latter directs xterm to print the current - screen as well as the scrollback buffer. - -</itemize> - -Bug fixes/improvements: - -<itemize> - <item>If <tt>colorMode</tt> is enabled by default, compile-in default - resources to match the colors listed in <tt>XTerm-col.ad</tt>. - - <item>Deprecate DA answerback string, making it settable via a resource - value for applications which may need this. - - <item>Input characters which are mapped when in vt220 National Replacement - Character mode. - - <item>Completed support for double size characters. - - <item>Remove <tt>kfnd</tt>/<tt>kll</tt>/<tt>kslt</tt> strings from - terminfo, because curses applications do not necessarily return - <tt>khome</tt>/<tt>kend</tt> pairs. - - <item>Corrected ifdef's for menus, which did not allow tek4014 to be - suppressed properly. - - <item>Improved tests for determining if xterm should use overstriking to - simulate bold fonts. - - <item>Add test/demo scripts for double size characters, font switching, - screen resizing and colors. - - <item>Amend treatment of ALT key so that if ALT is used as a modifier in - key translations, then no parameter will be sent in escape sequences - for Sun/PC function keys. - - <item>Improved the ptyInitialErase logic to make it work better with - a terminfo library. - - <item>Modify treatment of line-drawing characters in UTF-8 mode so that - Unicode values are used rather than characters 1-31 for storing the - translated characters. - - <item>Modify translation of UTF-8 sequences to reject ``overly long'' - variations. - - <item>Correct a case where colors were not rendered properly. This - happened when an application inserted several lines, then changed - colors. If this was done all in one write, then there would be no - intervening refresh, and the new color was applied to the pending - scrolling operation which was awaiting the next refresh. - - <item>Corrected misspelled resource name in command-line option for HP - function keys. - - <item>Change label on ``Sun/PC Keyboard'' popup menu entry to ``VT220 - Keyboard'', since the checked state corresponds to VT220 rather than - Sun/PC. - - <item>Two corrections to simulation of bold font via overstriking: - - <itemize> - - <item>use clipping to avoid leaving trash at end of the text, and - - <item>add brackets so wide-character logic does not fall-through - into the overstriking logic. - - </itemize> - - <item>Modify checks for repeat-character control sequence to test the - character class against xterm's state table, rather than the - <tt>isprint()</tt> macro. - - <item>Modify terminfo entry for ``xterm-xfree86'' to reflect modifiers for - shift and control. - - <item>Add several entries to termcap file to make it have the same set - of aliases as the terminfo file. - - <item>Scale the color values used for xterm-256color terminfo entry to - 0..1000, as expected by ncurses. - - <item>Change xterm-r6 terminfo definitions for F1-F4 to match program. - - <item>Remove obsolete documentation about modifiers which can be returned - in mouse tracking mode, and modify logic to ignore modifiers other - than the existing ones, e.g., NumLock. - - <item>Use free bit from obsolete shift-modifier coding of mouse tracking - button events to encode buttons 4 and 5, e.g., for a wheel mouse. - Move the suggested wheel-mouse button translations into charproc.c to - simplify customization. - - <item>Modify warning if change-ownership of PTY fails; some - configurations may not happen to have old-style PTY's. - - <item>Add more information, i.e., with strerror for some system calls in - the main program which may fail due to insufficient permissions. - - <item>Various improvements to configure script, e.g., tests for utmp. - -</itemize> - <sect1>xedit <p> @@ -1305,12 +1258,6 @@ version of xedit. These include: <item><bf>C-mode:</bf> this mode is expected to be stable, and fully usable. -<!-- This was removed, right? - - <item><bf>Html-mode:</bf> a lot of work needs to be done yet. It is - included in this snapshot only to show what the new text widget - capabilities can do. ---> </itemize> </itemize> @@ -1318,16 +1265,21 @@ version of xedit. These include: <p> +<!-- <sect>Fonts and Internationalisation <p> +--> + +<sect1>Font support +<p> -Details about the font support in this version of XFree86 can be found +Details about the font support in XFree86 4.x can be found in the <htmlurl name="README.fonts" url="fonts.html"> document. <sect1>TrueType support <p> -This version of XFree86 comes with two TrueType backends, known as +XFree86 4.x comes with two TrueType backends, known as `xfsft' (the <tt>"freetype"</tt> module) and `X-TrueType' (the <tt>"xtt"</tt> module). Both of these backends are based on the FreeType library. @@ -1335,7 +1287,7 @@ library. <sect1>CID font support <p> -Support for CID-keyed fonts is included in this version of XFree86. +Support for CID-keyed fonts is included in XFree86 4.x. The CID-keyed font format was designed by <url name="Adobe Systems" url="http://www.adobe.com"> for fonts with large character sets. The CID-keyed font support in XFree86 was donated by <url name="SGI" @@ -1346,7 +1298,7 @@ License. <sect1>Internationalisation of the scalable font backends <p> -A new ``fontenc'' layer has been added to allow the scalable font backends +XFree86 4.x has a ``fontenc'' layer to allow the scalable font backends to use a common method of font re-encoding. This re-encoding makes it possible to uses fonts in encodings other than their their native encoding. This layer is used by the Type1 and Speedo backends and the @@ -1364,7 +1316,7 @@ transmitted in a compressed format. <sect1>Unicode/ISO 10646 support <p> -What is included: +What is included in 4.x: <itemize> <item>All ``-misc-fixed-*'' BDF fonts are now available in the @@ -1403,27 +1355,6 @@ What is included: </itemize> -Known problems: - -<itemize> - <item>Xlib does not yet fully support UTF-8 as a locale, which means that - xterm UTF-8 keyboard support is at the moment a temporary hack. - - <item>Most ISO10646-1 fonts encode no characters above U+31FF. This - avoids the inefficient allocation and transmission of a - >700 kB large XFontStruct structure, which would happen if the - (not very important) ligatures and symbols above U+f000 were - present. - - <item>ISO 10646 Level 2 combining characters are not yet supported by - xterm (will be needed for instance for Thai and IPA). - - <item>Switching between a half-width and full-width font pair (such - as 9x18 and 18x18ja) is not yet supported by xterm (will be - needed for CJK scripts). - -</itemize> - <sect1>Lucidux fonts from Bigelow and Holmes <p> @@ -1440,14 +1371,16 @@ For more information, please contact <email>sales@yandy.com</email>, or consult <url name="Y&Y's web site" url="http://www.yandy.com">. +<!-- <sect>Miscellaneous <p> +--> <sect1>Directory rearrangements <p> Some changes to the installed XFree86 directory structure have been -implemented for 4.0. +implemented for 4.x. One important change is a modified search path for the X server's <tt>XF86Config</tt> file. The details of this can be found diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml index dc5529742..c817f134a 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml @@ -9,7 +9,7 @@ <date>4 December 2000 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml,v 1.21 2000/12/04 19:31:05 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml,v 1.26 2000/12/14 22:15:48 dawes Exp $ </ident> <abstract> @@ -31,27 +31,38 @@ XFree86 &relvers;. It includes information about the status of the drivers and the hardware they support, including a comparison of the level of support between versions &legacyvers; and &relvers;. -NOTE: Status information needs to be checked carefully and expanded -where possible. E.g., include information about acceleration, multi-head, -known problems, hardware known to work on, platform -dependencies/limitations, other architectures known to work on -(e.g., Alpha, PPC), etc. +In XFree86 &legacyvers;, several X servers are available; much hardware +uses the XF86_SVGA server, which has a set of driver modules that are built +into it at compile time. In other cases, X servers for specific chips (or +families of chips) are provided (such as XF86_AGX, XF86_Mach64, etc.). + +In XFree86 &relvers;, there is only one X server, called "XFree86", which +can load driver modules at runtime. Thus there is no specific mention of a +server binary when &relvers; is discussed; only the XFree86 server is +used. Third-party vendors (often the manufacturers of various video +chipsets) may provide their own drivers for the XFree86 server, but these +third-party modules are beyond the scope of this document. + +NOTE: Status information needs to be checked carefully and expanded where +possible. E.g., include information about acceleration, multi-head, known +problems, hardware known to work on, platform dependencies/limitations, +other architectures known to work on (e.g., Alpha, PPC), etc. <sect>3Dfx <p> <descrip> <tag>&legacyvers;:</tag> - Support (including acceleration) for Voodoo Banshee and Voodoo - 3. Support is provided by the XF86_SVGA server with the tdfx - driver). + Support (including acceleration) for Voodoo Banshee and Voodoo3 + cards is provided by the XF86_SVGA server with the tdfx driver. <tag>&relvers;:</tag> - Support for Voodoo 1 and Voodoo 2 via glide on platforms where - glide is available (Linux and FreeBSD(?)). Support is provided by - the "glide" driver (requires Glide 2x). + Support for Voodoo Graphics and Voodoo 2 chips is available on + platforms where Glide is available (Linux and FreeBSD(?)) and is + provided by the "glide" driver (requires version 2.x of the Glide + library, which is not part of the XFree86 distribution). - Support (including acceleration) for Voodoo Banshee and Voodoo 3. - Support is provided by the "tdfx" driver. + Support (including acceleration) for Voodoo Banshee, Voodoo3, + Voodoo4, and Voodoo5 is provided by the "tdfx" driver. <tag>Summary:</tag> All hardware supported in &legacyvers; is also supported in &relvers;. @@ -64,17 +75,18 @@ dependencies/limitations, other architectures known to work on <tag>&legacyvers;:</tag> Support (including acceleration) for GLINT 500TX (with IBM RGB526 ramdac), GLINT MX plus Delta or Gamma (with IBM RGB526 and RGB640 - ramdacs), Permedia with IBM RGB526 ramdac, Permedia 2, 2a, 2v. - Support is provided by the XF86_3DLabs server. + ramdacs), Permedia with IBM RGB526 RAMDAC, and Permedia 2, 2a, 2v + is provided by the XF86_3DLabs server. <tag>&relvers;:</tag> - Support (including acceleration) for Permedia, Permedia 2, 2v - (and 2a??) GLINT 500TX, GLINT MX, GLINT Gamma, and Glint Delta - coproc. Support is provided by the "glint" driver. + Support (including acceleration) for Permedia, Permedia 2, 2v, (and + 2a?), Permedia 3, GLINT 500TX, GLINT MX, GLINT Gamma, and GLINT + Delta coproc is provided by the "glint" driver. <tag>Summary:</tag> All hardware supported in &legacyvers; is also supported in &relvers;. + The Permedia 3 is only supported in &relvers;. </descrip> @@ -106,11 +118,11 @@ dependencies/limitations, other architectures known to work on Support is provided by the XF86_SVGA server with the ark driver. <tag>&relvers;:</tag> - No native support for these chipsets, because the old driver - has not been ported. + Support (including acceleration) for the ARK1000PV, ARK2000PV, + and ARK2000MT. Support is provided by the "ark" driver. <tag>Summary:</tag> - No ARK Logic chips are supported in &relvers;. + All hardware supported in &legacyvers; is also supported in &relvers;. </descrip> @@ -132,11 +144,10 @@ dependencies/limitations, other architectures known to work on server with the r128 driver. <tag>&relvers;:</tag> - Accelerated support is provided for the Rage 128 chips by the - "r128" driver. Accelerated support is provided for the Mach64 - Rage variants by the "ati" driver. Unaccelerated support is - provided for all of the others except the Mach8 and some early - Mach32 chips by the "ati" driver. + Accelerated support is provided for Mach64, Rage, Rage 128 and + Radeon chips. Unaccelerated support is provided for all of the + others except the Mach8 and some early Mach32 chips by the "ati" + driver. <tag>Summary:</tag> All chips supported in &legacyvers; are supported in &relvers; @@ -180,8 +191,7 @@ dependencies/limitations, other architectures known to work on and 64300. This support is provided by the "chips" driver. <tag>Summary:</tag> - All chips supported in &legacyvers; are also supported in - &relvers;. + All hardware supported in &legacyvers; is also supported in &relvers;. </descrip> @@ -197,15 +207,14 @@ dependencies/limitations, other architectures known to work on XF86_SVGA server with the cirrus driver. <tag>&relvers;:</tag> - Support (accelerated) for the Alpine (5430, 5434, 5436, 5446, - 5480), and Laguna (5462, 5464, 5465) chips is provided by the + Support (accelerated) for the Alpine (5430, 5434, 5436, 5446, 5480, + 7548), and Laguna (5462, 5464, 5465) chips is provided by the "cirrus" driver. <tag>Summary:</tag> The following chips are supported in &legacyvers; but not in &relvers;: 6410, 6412, 6420, 6440, 5420, 5422, 5424, 5426, 5428, - 5429, 6205, 6215, 6225, 6235, 7541, 7542, 7543, 7548, 7555 and - 7556. + 5429, 6205, 6215, 6225, 6235, 7541, 7542, 7543, 7555 and 7556. </descrip> @@ -231,7 +240,7 @@ dependencies/limitations, other architectures known to work on <tag>Summary:</tag> No Compaq AVGA support in &relvers;. DEC TGA support is equivalent - in both versions. + in both &legacyvers; and &relvers;. </descrip> @@ -243,11 +252,12 @@ dependencies/limitations, other architectures known to work on XF86_SVGA server with the cyrix driver. <tag>&relvers;:</tag> - A preliminary port of the driver is available, but it isn't - ready for widespread use. + The &legacyvers; driver has been ported to &relvers;, including + acceleration, but feedback is needed. <tag>Summary:</tag> - No Cyrix chips are well-supported in &relvers;. + Cyrix MediaGX users are encouraged to test its support in + &relvers;. </descrip> @@ -316,7 +326,7 @@ dependencies/limitations, other architectures known to work on <descrip> <tag>&legacyvers;:</tag> Support (accelerated) for the AGX-016, AGX-015 and AGX-014 is - provided by the XF86_AGX server.. + provided by the XF86_AGX server. <tag>&relvers;:</tag> No native support for these chipsets, because the old driver @@ -327,6 +337,22 @@ dependencies/limitations, other architectures known to work on </descrip> +<sect>Integrated Micro Solutions (IMS) +<p> +<descrip> +<tag>&legacyvers;:</tag> + Support (accelerated) for the IMS Twin Turbo 128 is provided by the + XF86_SVGA server with the imstt driver. + +<tag>&relvers;:</tag> + Support (accelerated) for the IMS Twin Turbo 128 is provided by the + "imstt" driver. + +<tag>Summary:</tag> + All hardware supported in &legacyvers; is also supported in &relvers;. + +</descrip> + <sect>Intel <p> <descrip> @@ -363,8 +389,7 @@ dependencies/limitations, other architectures known to work on and G400 is provided by the "mga" driver. <tag>Summary:</tag> - All chips supported in &legacyvers; are also supported in - &relvers;. + All hardware supported in &legacyvers; is also supported in &relvers;. </descrip> @@ -418,9 +443,8 @@ dependencies/limitations, other architectures known to work on provided by the "neomagic" driver. <tag>Summary:</tag> - All chips supported in &legacyvers; are also supported in - &relvers;. The NM2230 and later chips are only supported in - &relvers;. + All hardware supported in &legacyvers; is also supported in &relvers;. + The NM2230 and later chips are only supported in &relvers;. </descrip> @@ -435,8 +459,7 @@ dependencies/limitations, other architectures known to work on <tag>&relvers;:</tag> Support (accelerated) for the Riva 128, 128ZX, TNT, TNT2 (Ultra, Vanta, M64), GeForce (DDR, 256), GeForce2 (GTS, Ultra, MX), Quadro, - and Quadro2 is provided by - the nv driver. + and Quadro2 is provided by the "nv" driver. <tag>Summary:</tag> All chipsets supported in &legacyvers; except the NV1 are also @@ -454,15 +477,15 @@ dependencies/limitations, other architectures known to work on server. <tag>&relvers;:</tag> - No native support for these chipsets, because the old driver - has not been ported. + Support (accelerated) for the Imagine 128, Ticket 2 Ride, + Revolution 3D and Revolution IV is provided by the "i128" driver. <tag>Summary:</tag> - No Number Nine chips are supported in &relvers;. + All hardware supported in &legacyvers; is also supported in &relvers;. </descrip> -<sect>Oak Technologies Inc +<sect>Oak Technologies, Inc. <p> <descrip> <tag>&legacyvers;:</tag> @@ -528,8 +551,7 @@ dependencies/limitations, other architectures known to work on "rendition" driver. <tag>Summary:</tag> - All chips supported in &legacyvers; are also supported in - &relvers;. + All hardware supported in &legacyvers; is also supported in &relvers;. </descrip> @@ -537,31 +559,46 @@ dependencies/limitations, other architectures known to work on <p> <descrip> <tag>&legacyvers;:</tag> - Support (accelerated) for the S3 911, 924, 801, 805, 928, 864, - 868, 964, 968, Trio32, Trio64, Trio64V+, Trio64UV+, Aurora64V+, + Support (accelerated) for the S3 911, 924, 801, 805, 928, 864, 868, + 964, 968, Trio32, Trio64, Trio64V+, Trio64UV+, Aurora64V+, Trio64V2, PLATO/PX is provided by the XF86_S3 server and the XF86_SVGA server with the s3_svga driver. Support (accelerated) for the ViRGE, ViRGE/VX, ViRGE/DX, ViRGE/GX, ViRGE/GX2, ViRGE/MX, ViRGE/MX+ is provided by the XF86_S3V server. Support (accelerated) for those ViRGE chips, as well as the Trio3D and - Trio3D/2X is provided by the XF86_SVGA server with the s3v - driver. Support (accelerated) for the Savage3D, Savage3D/MV, - Savage4, Savage2000, is provided by the XF86_SVGA server with - the s3_savage - driver (CHECK: is this support Linux-only?). + Trio3D/2X is provided by the XF86_SVGA server with the s3v driver. + Support (accelerated) for the Savage3D, Savage3D/MV, Savage4, and + Savage2000, is provided by the XF86_SVGA server with the s3_savage + driver on some OSes (Linux, *BSD). <tag>&relvers;:</tag> Support (accelerated) for the ViRGE, ViRGE/VX, ViRGE/DX, ViRGE/GX, - ViRGE/GX2, ViRGE/MX, ViRGE/MX+, Trio3D and Trio3D/2X is provided - by the "s3virge" driver. Support for the other S3 chipsets has - not yet been ported. + ViRGE/GX2, ViRGE/MX, ViRGE/MX+, Trio3D and Trio3D/2X is provided by + the "s3virge" driver. Support (accelerated) for the Savage3D, + Savage3D/MV, Savage4, and Savage2000, is provided by the "savage" + driver. Support for the other S3 chipsets has not yet been ported. <tag>Summary:</tag> - Only the ViRGE and Trio3D chipsets are supported in &relvers;. + Only the ViRGE, Trio3D and Savage chipsets are supported in &relvers;. All of the other chipsets are only supported in &legacyvers;. </descrip> +<sect>Silicon Graphics, Inc. (SGI) +<p> +<descrip> +<tag>&legacyvers;:</tag> + No SGI hardware is supported in &legacyvers;. + +<tag>&relvers;:</tag> + Unaccelerated support for the SGI Indy's Newport cards is provided + by the "newport" driver. + +<tag>Summary:</tag> + SGI hardware is supported only in &relvers;. + +</descrip> + <sect>Silicon Integrated Systems (SiS) <p> <descrip> @@ -582,7 +619,7 @@ dependencies/limitations, other architectures known to work on </descrip> -<sect>Silicon Motion, Inc +<sect>Silicon Motion, Inc. <p> <descrip> <tag>&legacyvers;:</tag> @@ -591,12 +628,31 @@ dependencies/limitations, other architectures known to work on smi driver. <tag>&relvers;:</tag> - No native support for these chipsets, because the driver - has not been ported. + Support (accelerated) for the Lynx, LynxE, Lynx3D, LynxEM, LynxEM+ + and Lynx3DM chips is provided by the "siliconmotion" driver. + +<tag>Summary:</tag> + All hardware supported in &legacyvers; is also supported in &relvers;. + +</descrip> + +<sect>Sun Microsystems +<p> +<descrip> +<tag>&legacyvers;:</tag> + No Sun hardware is supported in &legacyvers;. + +<tag>&relvers;:</tag> + Sun BW2 framebuffers are supported by the "sunbw2" driver. + Sun CG3 framebuffers are supported by the "suncg3" driver. + Sun CG6 framebuffers are supported by the "suncg6" driver. + Sun CG14 framebuffers are supported by the "suncg14" driver. + Sun FFB framebuffers are supported by the "sunffb" driver. + Sun LEO framebuffers are supported by the "sunleo" driver. + Sun TCX framebuffers are supported by the "suntcx" driver. <tag>Summary:</tag> - No SMI chips are supported in &relvers;, but the fbdev driver is - reported to work on Linux. + Sun hardware is supported only in &relvers;. </descrip> @@ -616,17 +672,19 @@ dependencies/limitations, other architectures known to work on <tag>&relvers;:</tag> Support (accelerated where the chip supports it) for the TVGA8900D, - TGUI9420DGi, TGUI9440AGi, TGUI9660, TGUI9680, ProVidia 9682, - ProVidia 9685, Cyber9320, Cyber9382, Cyber9385, Cyber9388, - Cyber9397, Cyber9520, Cyber9397/DVD, Cyber9525/DVD, 3DImage975, - 3DImage875, Blade3D, CyberBlade/i7, CyberBlade/DSTN/i7 and - CyberBlade/i1 is provided by the "trident" driver. + TGUI9440AGi, TGUI9660, TGUI9680, ProVidia 9682, ProVidia 9685, + Cyber9320, Cyber9382, Cyber9385, Cyber9388, Cyber9397, Cyber9397/DVD, + Cyber9520, Cyber9525/DVD, 3DImage975, 3DImage985, Blade3D, + CyberBlade/i7, CyberBlade/DSTN/i7, CyberBlade/i1, CyberBlade/DSTN/i1, + CyberBlade/Ai1, CyberBlade/DSTN/Ai1 and CyberBlade/e4 is provided + by the "trident" driver. <tag>Summary:</tag> The following (older) chipsets that are supported in &legacyvers; are not supported in &relvers;: TVGA8200LX, TVGA8800CS, TVGA8900B, TVGA8900C, TVGA8900CL, TVGA9000, TVGA9000i, TVGA9100B, TVGA9200CXr, - TGUI9400CXi, TGUI9420, TGUI9430DGi. + TGUI9400CXi, TGUI9420, TGUI9430DGi. The remaining listed chipsets + are supported in &relvers;. </descrip> diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml index 9212b1d0c..70def9111 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml @@ -8,14 +8,14 @@ <title>ATI Adapters README file <author>Marc Aurele La France -<date>2000 August 3 +<date>2000 December 6 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v 3.33 2000/08/09 02:19:23 tsi Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v 3.34 2000/12/07 15:43:41 tsi Exp $ </ident> <abstract> @@ -88,8 +88,11 @@ VGAWonder series: 18800, 18800-1, 28800-2, 28800-4, 28800-5, 28800-6 The driver also supports 32K, 64K and 16M-colour modes on the 264xT and 3D Rage series of adapters using the accelerator CRTC (but not the VGA CRTC).<p> The newer Rage 128 and Radeon chips are not yet supported by this driver. -Rage 128's are, however, supported by a separate driver, and Rage 128 owners -should read the r128 driver's documentation for details.<p> +Rage 128's and Radeon's are, however, supported by separate drivers, and +owners of such adapters should consult the documentation provided with these +drivers. +This driver will also invoke the appropriate driver if it finds Rage 128 and/or +Radeon adapter(s) in the system.<p> Adapters based on the above chips have been marketed under a rather large number of names over the years. Among them are: diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent b/xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent index 878e483ec..18ae2a778 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent @@ -1,4 +1,4 @@ -<!-- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent,v 1.14 2000/11/28 20:59:17 dawes Exp $ --> +<!-- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent,v 1.15 2000/12/08 19:10:25 dawes Exp $ --> <!-- shared entity definitions for the XFree86 documentation --> @@ -14,6 +14,9 @@ <!ENTITY spvers CDATA "2.23"> <!ENTITY legacyspvers CDATA "2.21"> +<!-- doctools version strings --> +<!ENTITY doctoolsvers CDATA "1.2"> + <!-- These should be set according to which snapshot/release this is --> <!ENTITY % firstsnap 'IGNORE'> <!ENTITY % latersnap 'INCLUDE'> diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml index f4cfe4f77..7187e923b 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml @@ -1,306 +1,595 @@ -<!doctype LINUXDOC PUBLIC "-//XFree86//DTD linuxdoc//EN"[ +<!doctype LINUXDOC PUBLIC "-//XFree86//DTD linuxdoc//EN" [ <!ENTITY % defs SYSTEM "defs.ent"> %defs; ]> <article> <title>Fonts in XFree86 -<author>Juliusz Chroboczek, <tt/Juliusz.Chroboczek@ens.fr/ -<date>5 March 2000</date> +<author>Juliusz Chroboczek, <email/jch@xfree86.org/ +<date>14 December 2000</date> <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml,v 1.8 2000/11/14 16:54:49 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml,v 1.11 2000/12/15 20:01:56 dawes Exp $ </ident> <toc> -<p>XFree86 contains a number of improvements related to fonts, including -<itemize> -<item> inclusion of new fonts; -<item> internationalisation of the scalable font backends (Type 1, Speedo, - and TrueType); -<item> support for TrueType fonts; -<item> support for CID-keyed fonts. -</itemize> -This document describes these improvements. It does not attempt to -describe the standard support for fonts in X11; the reader is referred -to the <tt/X/(1), <tt/Xserver/(1), and <tt/mkfontdir/(1) manpages. - -<sect>Background and terminology - -<sect1>Characters and glyphs - -<p>A <it/character/ is an abstract unit of a writing system. Examples -of characters include the Latin capital letter <it/A/, the Arabic -letter <it/jim/, and the <it/dingbat black scissors/. - -A <it/glyph/ is a shape that may represent one or many characters when -displayed by a window system or printed by a printer. - -While glyphs roughly correspond to characters in most cases, this -correspondence is not, in general, one to one. For example, a font may -have many variant forms of the capital letter <it/A/; a single <it/fi/ -ligature may correspond to the letters <it/f/ and <it/i/. - -A <it/coded character set/ is a set of characters together with a -mapping from integer codes -- known as <it/codepoints/ -- to -characters. Examples of coded character sets include US-ASCII, -ISO 8859-1, KOI8-R, and JIS X 0208(1990). - -A coded character set need not use 8-bit integers to index -characters. Many early mainframes used 6-bit character sets, while -16-bit (or more) character sets are necessary for ideographic writing -systems. +<sect>Introduction -<sect1>Font files, fonts, and XLFD +<!-- I hate SGML. What's wrong with texinfo? --> -<p>Traditionally, typographers speak about <it/typefaces/ and -<it/founts/ (we use the traditional British spelling to distinguish -founts from digital fonts). A typeface is a particular style or -design, such as Times Italic, while a fount is a molten-lead -incarnation of a given typeface at a given size. +<p>This document describes the support for fonts in XFree86. Section +<ref id="sec:installing" name="Installing fonts"> is aimed at the +casual user wishing to install fonts in the X server; the rest of the +document describes the font support in more detail. -Digital fonts come in <it/font files/. A font file contains all the -information necessary for generating glyphs of a given typeface, and -applications using font files may access glyph information in -arbitrary order. - -Digital fonts may consist of bitmap data, in which case they are said -to be <it/bitmap fonts/. They may also consist of a mathematical -description of glyph shapes, in which case they are said to be -<it/scalable fonts/. Common formats for scalable font files are -<it/Type 1/ (sometimes incorrectly called <it/ATM fonts/ or -<it/PostScript fonts/), <it/Speedo/ and <it/TrueType/. +We only describe font support within the core X protocol. Issues +relating to fonts within the RENDER extension, the GLX (OpenGL) +extension or the PEX extension are outside the scope of this document. -The glyph data in a digital font needs to be indexed somehow. How -this is done depends on the font file format. In the case of -Type 1 fonts, glyphs are identified by <it/glyph names/. In the -case of TrueType fonts, glyphs are indexed by integers corresponding -to one of a number of indexing schemes (usually Unicode --- see below). - -The X11 system uses the data in font file to generate <it/font -instances/, which are collections of glyphs at a given size indexed -according to a given encoding. X11 font instances are specified using -a notation known as the <it/X Logical Font Description/ (XLFD). An -XLFD starts with a dash `<tt/-/', and consists of fourteen fields -separated by dashes, for example -<tscreen> --adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1 -</tscreen> -Or particular interest are the last two fields `<tt/iso8859-1/', which -specify the font instance's encoding. - -<sect1>Unicode - -<p>Unicode (<url url="http://www.unicode.org">) is a coded character -set with the goal of uniquely identifying all characters for all -scripts, current and historical. While Unicode was explicitly not -designed as a glyph encoding scheme, it is often possible to use it as -such. - -Unicode is an <it/open/ character set, in that codepoint assignments -may be added to Unicode at any time (once specified, though, an -assignment can never be changed). For this reason, a Unicode font -will be <it/sparse/, and only define glyphs for a subset of the -character registry of Unicode. - -The Unicode standard is defined in parallel with ISO 10646. -Assignments in the two standards are always equivalent, and this -document uses the terms ``Unicode'' and ``ISO 10646'' interchangeably. - -When used in X11, Unicode-encoded fonts should have the last two -fields of their XLFD set to `<tt/iso10646-1/'. +We assume some familiarity with digital fonts. If anything is not +clear to you, please consult Appendix <ref id="sec:background" +name="Background"> at the end of this document for background +information. +<sect>Installing fonts <label id="sec:installing"> + +<p>Installing fonts in XFree86 is a two step process. First, you need +to create a <it/font directory/ that contains all the relevant font +files as well as some index files. You then need to inform the X +server of the existence of this new directory by including it in the +<it/font path/. + +<sect1>Installing bitmap fonts + +<p>The XFree86 server can use bitmap fonts in both the cross-platform +BDF format and the somewhat more efficient binary PCF format. +(XFree86 also supports the obsolete SNF format.) + +Bitmap fonts are normally distributed in the BDF format. Before +installing such fonts, it is desirable (but not absolutely necessary) +to convert the font files to the PCF format. This is done by using the +command `<tt/bdftopcf/', <it/e.g./ +<tscreen><verb> +$ bdftopcf courier12.bdf +</verb></tscreen> +You may then want to compress the resulting PCF font files: +<tscreen><verb> +$ gzip courier12.pcf +</verb></tscreen> + +After the fonts have been converted, you should copy all the font +files that you wish to make available into a arbitrary directory, say +`<tt>/usr/local/share/fonts/bitmap/</tt>'. You should then create the +index file `<tt/fonts.dir/' by running the command `<tt/mkfontdir/' +(please see the <tt/mkfontdir/(1) manual page for more information): +<tscreen><verb> +$ mkdir /usr/local/share/fonts/bitmap +$ cp *.pcf.gz /usr/local/share/fonts/bitmap +$ cd /usr/local/share/fonts/bitmap +$ mkfontdir +</verb></tscreen> + +All that remains is to tell the X server about the existence of the +new font directory; see Section <ref id="sec:set-font-path" +name="Setting the server font path">. + +<sect1>Installing scalable fonts + +<p>The XFree86 server supports scalable fonts in four formats: +Type 1, Speedo, TrueType and CIDFont. This section only applies +to the former three; for information on CIDFonts, please see Section +<ref id="sec:cid-fonts" name="Installing CIDFonts"> later in this +document. + +Installing scalable fonts is very similar to installing bitmap fonts: +you create a directory with the font files, and run `<tt/mkfontdir/' +to create an index file called `<tt/fonts.dir/'. + +There is, however, a big difference: `<tt/mkfontdir/' cannot +automatically recognise scalable font files. For that reason, you +must first index all the font files in a file called +`<tt/fonts.scale/'. This file has the same format as a +`<tt/fonts.dir/' file, and typically looks as follows: +<tscreen><verb> +4 +cour.pfa -adobe-courier-medium-r-normal-0-0-0-0-p-0-iso8859-1 +cour.pfa -adobe-courier-medium-r-normal-0-0-0-0-p-0-iso8859-2 +couri.pfa -adobe-courier-medium-i-normal-0-0-0-0-p-0-iso8859-1 +couri.pfa -adobe-courier-medium-i-normal-0-0-0-0-p-0-iso8859-2 +</verb></tscreen> +The first line indicates the number of entries in the file. +Each line after the first consists of two fields separated by a space; +the first field is the name of the font file, and the second one is +the name under which the font will appear to the server. This name +should obey the X Logical Font Description conventions (see Section +<ref id="sec:xlfd" name="The X Logical Font Description">). The +format of this file is fully described in the <tt/mkfontdir/(1) manual +page. + +Note that multiple lines may point at the same font file. This is +most commonly done in order to make a single font available under +multiple encodings; please see Section +<ref id="sec:internationalisation" name="Fonts and internationalisation">. + +While it is possible to create the `<tt/fonts.scale/' file by hand, it +is simpler and more convenient to have it generated automatically. +Utilities to perform this task are available, but are not currently +included with XFree86. For Type 1 fonts, you may use a utility +called `<tt/type1inst/' which is available from +<url url="http://www.ibiblio.org/pub/Linux/X11/xutils/" name="standard +Free Software repositories"> throughout the world. + +For TrueType fonts, you may use `<tt/ttmkfdir/', available from +<url name="Joerg Pommnitz's xfsft page" + url="http://www.joerg-pommnitz.de/TrueType/xfsft.html">. + +After the `<tt/fonts.scale/' is created, you may run `<tt/mkfontdir/' as +above; this time, however, you need to create an index of encoding +files called `<tt>encodings.dir</tt>' in addition to the +`<tt>fonts.dir</tt>' file. This is done by using `<tt/mkfontdir/' with +the `<tt/-e/' flag: +<tscreen><verb> +$ cd /usr/local/share/fonts/Type1 +$ mkfontdir -e /usr/X11R6/lib/font/encodings +</verb></tscreen> +For more information, please see the <tt/mkfontdir/(1) manual page and +Section <ref id="sec:internationalisation" name="Fonts and +internationalisation"> later in this document. + +<sect1>Installing CID-keyed fonts <label id="sec:cid-fonts"> + +<p>The CID-keyed font format was designed by Adobe Systems for fonts +with large character sets. A CID-keyed font, or CIDFont for short, +contains a collection of glyphs indexed by <it/character ID/ (CID). + +Adobe make some sample CIDFonts and a complete set of CMaps +available from +<url name="O'Reilly's FTP site" + url="ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/">. + +In order to map such glyphs to meaningful indices, Adobe provide a set +of <it/CMap/ files. The PostScript name of a font generated from a +CIDFont consists of the name of the CIDFont and the name of the CMap +separated by two dashes. For example, the font generated from the +CIDFont `<tt/Munhwa-Regular/' using the CMap `<tt/UniKS-UCS2-H/' is +called +<tscreen><verb> +Munhwa-Regular--UniKS-UCS2-H +</verb></tscreen> + +The CIDFont support in XFree86 requires a very rigid directory +structure. The main directory must be called `<tt/CID/' (its location +defaults to `<tt>/usr/X11R6/lib/X11/fonts/CID</tt>' but it may be +located anywhere), and it should contain a subdirectory for every CID +collection. Every subdirectory <it/must/ contain subdirectories +called <tt/CIDFont/ (containing the actual CIDFont files), <tt/CMap/ +(containing all the needed CMaps), <tt/AFM/ (containing the font +metric files) and <tt/CFM/ (initially empty). For example, in the +case of the font <tt/Munhwa-Regular/ that uses the CID collection +<tt/Adobe-Korea1-0/, the directory structure should be as follows: +<tscreen><verb> +CID/Adobe-Korea1/CIDFont/Munhwa-Regular +CID/Adobe-Korea1/CMap/UniKS-UCS2-H +CID/Adobe-Korea1/AFM/Munhwa-Regular.afm +CID/Adobe-Korea1/CFM/ +CID/fonts.dir +CID/fonts.scale +</verb></tscreen> + +After creating this directory structure and copying the relevant +files, you should create a <`tt/fonts.scale/' file. This file has the +same format as in the case of (non-CID) scalable fonts, except that +its first column contains PostScript font names with the extension +`<tt/.cid/' appended rather than actual filenames: +<tscreen><verb> +1 +Adobe-Korea1/Munhwa-Regular--UniKS-UCS2-H.cid \ + -adobe-munhwa-medium-r-normal--0-0-0-0-p-0-iso10646-1 +</verb></tscreen> +(both names on the same line). As above, running `<tt/mkfontdir/' +creates the `<tt/fonts.dir/' file: +<tscreen><verb> +$ cd /usr/local/share/fonts/CID +$ mkfontdir +</verb></tscreen> + +Finally, you should create the font metrics summary files in the +directory `<tt/CFM/' by running the command `<tt/mkcfm/': +<tscreen><verb> +$ mkcfm /usr/local/share/fonts/CID +</verb></tscreen> +If no CFM files are available, the server will still be able to use +the CID fonts but querying them will take a long time. You should run +`<tt/mkcfm/' again whenever a change is made to any of the CID-keyed +fonts, or when the CID-keyed fonts are copied to a machine with a +different architecture. + +<sect1>Setting the server's font path <label id="sec:set-font-path"> + +<p>The list of directories where the server looks for fonts is known +as the <it/font path/. Informing the server of the existence of a new +font directory consists in putting it on the font path. + +The font path is an ordered list; if a client's request matches +multiple fonts, the first one in the font path is the one that gets +used. When matching fonts, the server makes two passes over the font +path: during the first pass, it searches for an exact match; during +the second, it searches for fonts suitable for scaling. + +For best results, scalable fonts should appear in the font path before +the bitmap fonts; this way, the server will prefer bitmap fonts to +scalable fonts when an exact match is possible, but will avoid scaling +bitmap fonts when a scalable font can be used. (The `<tt/:unscaled/' +hack, while still supported, should no longer be necessary in XFree86 +4.0 and later.) + +You may check the font path of the running server by typing the command +<tscreen><verb> +$ xset q +</verb></tscreen> + +<sect2>Temporary modification of the font path + +<p>The `<tt/xset/' utility may be used to modify the font path for the +current session. The font path is set with the command <tt/xset fp/; +a new element is added to the front with <tt/xset +fp/, and added to +the end with <tt/xset fp+/. For example, +<tscreen><verb> +$ xset +fp /usr/local/fonts/Type1 +$ xset fp+ /usr/local/fonts/bitmap +</verb></tscreen> + +Conversely, an element may be removed from the front of the font path +with `<tt/xset -fp/', and removed from the end with `<tt/xset fp-/'. + +For more information, please consult the <tt/xset/(1) manual page. + +<sect2>Permanent modification of the font path + +<p>The default font path (the one used just after server startup) is +specified in the X server's `<tt/XF86Config/' file. It is computed by +appending all the directories mentioned in the `<tt/FontPath/' entries +of the `<tt/Files/' section in the order in which they appear. +<tscreen><verb> +FontPath "/usr/local/fonts/Type1" +... +FontPath "/usr/local/fonts/bitmap" +</verb></tscreen> + +For more information, please consult the `<tt/XF86Config/'(5) manual +page. + +<sect1>Troubleshooting <label id="sec:troubleshooting"> + +<p>If you seem to be unable to use some of the fonts you have +installed, the first thing to check is that the `<tt/fonts.dir/' files +are correct and that they are readable by the server. If this doesn't +help, it is quite possible that you are trying to use a font in a +format that is not supported by your server. + +XFree86 supports the BDF, PCF, SNF, Type 1, Speedo, TrueType and +CIDFont font formats. However, not all XFree86 servers come with all +the font backends configured in. + +On most platforms, the XFree86 servers are <it/modular/: the font +backends are included in modules that are loaded at runtime. The +modules to be loaded are specified in the `<tt/XF86Config/' file using +the `<tt/Load/' directive: +<tscreen><verb> +Load "Type1" +</verb></tscreen> +If you have trouble installing fonts in a specific format, you may +want to check the server's log file in order to see whether the +relevant modules are properly loaded. The list of font modules +distributed with XFree86 is as follows: +<itemize> +<item> <tt/"bitmap"/: bitmap fonts (`<tt/*.bdf/', `<tt/*.pcf/' +and `<tt/*.snf/'); +<item> <tt/"Type1"/: Type 1 fonts (`<tt/*.pfa/' and +`<tt/*.pfb/') and CIDFonts; +<item> <tt/"Speedo"/: Bitstream Speedo fonts (`<tt/*.spd/'); +<item> <tt/"freetype"/: TrueType fonts (`<tt/*.ttf/' and `<tt/*.ttc/'); +<item> <tt/"xtt"/: alternate TrueType backend (`<tt/*.ttf/' and +`<tt/*.ttc/'). +</itemize> -<sect>New fonts +<sect>Fonts included with XFree86 -<sect1>Bitmap fonts +<sect1>Standard bitmap fonts -<p>XFree86 includes two new Unicode-encoded fonts with a large -collection of non-ideographic glyphs. While it is possible to use -these fonts as main fonts, applications may also use them as fallbacks -when a given glyph is not available in the current font. +<p>The Sample Implementation of X11 comes with a large number of +bitmap fonts, including the `<tt/fixed/' family, and bitmap versions +of Courier, Times and Helvetica. In the SI, these fonts are provided +in the ISO 8859-1 encoding (ISO Latin Western-European). -<sect2>The Unicode `fixed' font +In XFree86, a number of these fonts are provided in Unicode-encoded +font files instead. At build time, these fonts are split into font +files encoded according to legacy encodings, a process which enables +us to provide the standard fonts in a number of regional encodings +with no duplication of work. -<p>The font file -<tscreen> -/usr/X11/lib/X11/fonts/misc/6x13.pcf.gz -</tscreen> +For example, the font file +<tscreen><verb> +/usr/X11R6/lib/X11/fonts/misc/6x13.bdf +</verb></tscreen> with XLFD -<tscreen> +<tscreen><verb> -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1 -</tscreen> +</verb></tscreen> is a Unicode-encoded version of the standard `<tt/fixed/' font with added support for the Latin, Greek, Cyrillic, Georgian, Armenian, IPA and other scripts plus numerous technical symbols. It contains over -2800 characters, covering all characters of ISO 8859 parts 1-5, +2800 glyphs, covering all characters of ISO 8859 parts 1-5, 7-10, 13-15, as well as all European IBM and Microsoft code pages, -KOI8, WGL4, and the repertoires of many other character sets. This -font is compatible with the standard 8-bit <tt/fixed/ font and -therefore also includes the DEC line-drawing glyphs in the range 0x00 -to 0x1F, which are not part of Unicode or ISO 10646-1. - -An ISO 8859-1 version of this font is still available in file -<tscreen> -/usr/X11/lib/X11/fonts/misc/6x13-ISO8859-1.pcf.gz -</tscreen> -with XLFD -<tscreen> --misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1 -</tscreen> -The standard aliases `<tt/fixed/' and `<tt/6x13/' still point at the -ISO 8859-1 versions of the font. - -<sect2>The ClearlyU Unicode font - -<p>The ClearlyU font set of fonts provides a set of 12pt, 100dpi -proportional fonts with many of the glyphs needed for Unicode text. -Together, the fonts contain over 4000 glyphs. - -The main ClearlyU font has XLFD name -<tscreen> --mutt-ClearlyU-medium-r-normal--17-120-100-100-p-101-iso10646-1 -</tscreen> +KOI8, WGL4, and the repertoires of many other character sets. + +This font is used at build time for generating the font files +<tscreen><verb> +6x13-ISO8859-1.bdf +6x13-ISO8859-2.bdf +6x13-ISO8859-3.bdf +6x13-ISO8859-4.bdf +6x13-ISO8859-5.bdf +6x13-ISO8859-7.bdf +6x13-ISO8859-8.bdf +6x13-ISO8859-9.bdf +6x13-ISO8859-10.bdf +6x13-ISO8859-13.bdf +6x13-ISO8859-15.bdf +6x13-KOI8-R.bdf +</verb></tscreen> +with respective XLFDs +<tscreen><verb> +-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-1 +-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-2 +-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-3 +-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-4 +-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-5 +-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-7 +-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-8 +-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-9 +-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-10 +-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-13 +-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-15 +-misc-fixed-medium-r-normal--13-120-75-75-c-60-koi8-r +</verb></tscreen> +The standard short name `<tt/fixed/' is normally an alias for +<tscreen><verb> +-misc-fixed-medium-r-normal--13-120-75-75-c-60-iso8859-1 +</verb></tscreen> + +(The conversion of the standard fonts to Unicode was mainly performed +by Markus Kuhn. Markus is a man of taste, which makes his use of Perl +in the conversion process somewhat surprising.) + +<sect1>The ClearlyU Unicode font family + +<p>The ClearlyU family of fonts provides a set of 12 pt, +100 dpi proportional fonts with many of the glyphs needed for +Unicode text. Together, the fonts contain approximately 7500 glyphs. + +The main ClearlyU font has the XLFD +<tscreen><verb> +-mutt-clearlyu-medium-r-normal--17-120-100-100-p-101-iso10646-1 +</verb></tscreen> and resides in the font file -<tscreen> -/usr/X11/lib/X11/fonts/misc/cu12.pcf.gz -</tscreen> +<tscreen><verb> +/usr/X11R6/lib/X11/fonts/misc/cu12.pcf.gz +</verb></tscreen> Additional ClearlyU fonts include -<tscreen> --mutt-ClearlyU Alternate Glyphs-medium-r-normal--17-120-100-100-p-91-iso10646-1 -<p>-mutt-ClearlyU Arabic Extra-medium-r-normal--17-120-100-100-p-103-fontspecific-0 -<p>-mutt-ClearlyU Ligature-medium-r-normal--17-120-100-100-p-141-fontspecific-0 -<p>-mutt-ClearlyU PUA-medium-r-normal--17-120-100-100-p-111-iso10646-1 -</tscreen> - -<sect1>Scalable fonts - -<p>XFree86 includes the ``Lucidux'' family of Type 1 fonts. This -family consists of the fonts ``Lucidux Serif'', with XLFD -<tscreen> +<tscreen><verb> +-mutt-clearlyu alternate glyphs-medium-r-normal--17-120-100-100-p-91-iso10646-1 +-mutt-clearlyu pua-medium-r-normal--17-120-100-100-p-111-iso10646-1 +-mutt-clearlyu arabic extra-medium-r-normal--17-120-100-100-p-103-fontspecific-0 +-mutt-clearlyu ligature-medium-r-normal--17-120-100-100-p-141-fontspecific-0 +</verb></tscreen> + +The <it/Alternate Glyphs/ font contains additional glyph shapes that +are needed for certain languages. A second alternate glyph font will +be provided later for cases where a character has more than one +commonly used alternate shape (<it/e.g./ the Urdu heh). + +The <it/PUA/ font contains extra glyphs that are useful for certain +rendering purposes. + +The <it/Arabic Extra/ font contains the glyphs necessary for +characters that don't have all of their possible shapes encoded in +ISO 10646. The glyphs are roughly ordered according to the order +of the characters in the ISO 10646 standard. + +The <it/Ligature/ font contains ligatures for various scripts that +may be useful for improved presentation of text. + +(The ClearlyU family was designed by Mark Leisher. Mark's usage of +the foundry name <it/mutt/ predates the mailer of the same name, but +he won't say more.) + +<sect1>Standard scalable fonts + +<p>XFree86 includes all the scalable fonts distributed with X11R6. + +<sect2>Standard Type 1 fonts + +<p>The IBM Courier set of fonts cover ISO 8859-1 and +ISO 8859-2 as well as Adobe Standard Encoding. These fonts have +XLFD +<tscreen><verb> +-adobe-courier-medium-*-*--0-0-0-0-m-0-*-* +</verb></tscreen> +and reside in the font files +<tscreen><verb> +/usr/X11R6/lib/X11/fonts/Type1/cour*.pfa +</verb></tscreen> + +The Adobe Utopia set of fonts only cover ISO 8859-1 as well as +Adobe Standard Encoding. These fonts have XLFD +<tscreen><verb> +-adobe-utopia-*-*-normal--0-0-0-0-p-0-iso8859-1 +</verb></tscreen> +and reside in the font files +<tscreen><verb> +/usr/X11R6/lib/X11/fonts/Type1/UT*.pfa +</verb></tscreen> + +Finally, XFree86 also comes with Type 1 versions of Bitstream +Courier and Charter. These fonts have XLFD +<tscreen><verb> +-bitstream-courier-*-*-normal--0-0-0-0-m-0-iso8859-1 +-bitstream-charter-*-*-normal--0-0-0-0-p-0-iso8859-1 +</verb></tscreen> +and reside in the font files +<tscreen><verb> +/usr/X11R6/lib/X11/fonts/Type1/c*bt_.pfb +</verb></tscreen> + +<sect2>Standard Speedo fonts + +<p>XFree86 includes Speedo versions of the Bitstream Courier and +Charter fonts. In order to use these fonts, you should ensure that +your X server is loading the `<tt/Speedo/' font backend; see Section +<ref id="sec:troubleshooting" name="Troubleshooting">. + +These fonts cover all of ISO 8859-1 and almost all of +ISO 8859-2. They have XLFD name +<tscreen><verb> +-bitstream-courier-*-*-normal--0-0-0-0-m-0-*-* +-bitstream-charter-*-*-normal--0-0-0-0-p-0-*-* +</verb></tscreen> +and reside in the font files +<tscreen><verb> +/usr/X11R6/lib/X11/fonts/Speedo/font*.spd +</verb></tscreen> + +<sect1>The Bigelow & Holmes Lucidux family + +<p>XFree86 includes the <it/Lucidux/ family of Type 1 fonts. This +family consists of the fonts <it/Lucidux Serif/, with XLFD +<tscreen><verb> -b&h-lucidux serif-medium-*-normal--*-*-*-*-p-*-*-* -</tscreen> -``Lucidux Sans'', with XLFD -<tscreen> +</verb></tscreen> +<it/Lucidux Sans/, with XLFD +<tscreen><verb> -b&h-lucidux sans-medium-*-normal--*-*-*-*-p-*-*-* -</tscreen> -and ``Lucidux Mono'', with XLFD -<tscreen> +</verb></tscreen> +and <it/Lucidux Mono/, with XLFD +<tscreen><verb> -b&h-lucidux mono-medium-*-normal--*-*-*-*-m-*-*-* -</tscreen> +</verb></tscreen> Each of these fonts currently comes in Roman and oblique variants (bold variants will be included in a future release) and has 337 -glyphs covering the basic ``ASCII'' glyph set, the Latin 1 glyph -set, as well as the ``Extended Latin'' glyph set. In particular, +glyphs covering the basic ASCII Unicode range, the Latin 1 +range, as well as the <it/Extended Latin/ range. In particular, these fonts include all the glyphs needed for ISO 8859 parts 1, 2, 3, 4, 9 and 15. The Lucidux fonts are original designs by Charles Bigelow and Kris -Holmes. Lucidux fonts include seriffed, sans-serif, and monospaced -styles which share the same stem weight, x-height, capital height, +Holmes. Lucidux fonts include seriffed, sans serif, and monospaced +styles that share the same stem weight, x-height, capital height, ascent and descent. Lucidux fonts harmonise with Lucida (R) fonts of the same vertical proportions and weights. The character width metrics of Lucidux roman fonts match those of core fonts bundled with several window systems. Each PFA file has a copy of the license terms in PS comment lines. -The license terms are also included in the file <tt/COPYRIGHT.BH/ for -convenience, and in the <htmlurl name="License document" url="LICENSE.html">. +The license terms are also included in the file `<tt/COPYRIGHT.BH/' +for convenience, as well as in the <htmlurl name="License document" +url="LICENSE.html">. The design and font outlines were donated by Charles Bigelow and Kris Holmes from Bigelow and Holmes Inc., and the hinting was donated by Berthold Horn and Blenda Horn from Y&Y, Inc. For more information, -please contact <email/design@bigelowandholmes.com/ or -<email/sales@yandy.com/, or consult <url name="Y&Y's web site" -url="http://www.yandy.com">. - +please contact <email>design@bigelowandholmes.com</email> or +<email>sales@yandy.com</email>, or consult +<url name="Y&Y's web site" url="http://www.yandy.com">. -<sect>Internationalisation of scalable font backends. +<sect>Fonts and internationalisation <label id="sec:internationalisation"> -<p>The scalable font backends (Type 1, Speedo, TrueType) can now -automatically re-encode fonts to the encoding specified in the XLFD in -`<tt/fonts.dir/'. For example, a `<tt/fonts.dir/' file can now +<p>The scalable font backends (Type 1, Speedo and TrueType) can +now automatically re-encode fonts to the encoding specified in the +XLFD in <tt/fonts.dir/. For example, a <tt/fonts.dir/ file can contain entries for the Type 1 Courier font such as -<tscreen> -cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1 -<p>cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-2 -</tscreen> -which will lead to the font being recoded to ISO 8859-1 and +<tscreen><verb> +cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1 +cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-2 +</verb></tscreen> +which will lead to the font being recoded to ISO 8859-1 and ISO 8859-2 respectively. -<sect1>The `fontenc' layer<label id="sec-fontenc"> +<sect1>The <it/fontenc/ layer <label id="sec:fontenc"> <p>Three of the scalable backends (Type 1, Speedo, and the -`freetype' TrueType backend) use a common `fontenc' layer for font -re-encoding. This allows those backends to share their encoding data, -and allows simple configuration of new locales independently of font -type. +<it/FreeType/ TrueType backend) use a common <it/fontenc/ layer for +font re-encoding. This allows these backends to share their encoding +data, and allows simple configuration of new locales independently of +font type. <it/Please note:/ the X-TrueType (X-TT) backend does not use the -`fontenc' layer, but instead uses its own method for font reencoding. -Readers only interested in X-TT may want to skip to <ref -id="sec-symbol-fonts" name="Using Symbol Fonts">, as the intervening -information does not apply to X-TT. X-TT itself is described in more -detail in <ref id="sec-X-TT" name="X-TrueType">. - -In the `fontenc' layer, an encoding is defined by a name (such as -`<tt/iso8859-1/'), eventually a number of aliases (alternate names), -and an ordered collection of mappings. A mapping defines the way the -encoding can be mapped into one of the ``target'' encodings known to -the `fontenc' layer; currently, those consist of Unicode, Adobe glyph -names, and arbitrary TrueType `cmap's. - -A number of encodings are hardwired into `fontenc', and are therefore -always available; the hardcoded encodings cannot easily be redefined. -These include: +<it/fontenc/ layer, but instead uses its own method for font +reencoding. If you are only interested in X-TT you may want to skip +to Section <ref id="sec:symbol-fonts" name="Using Symbol Fonts">, as +the intervening information does not apply to X-TT. X-TT itself is +described in more detail in Section <ref id="sec:X-TT" +name="X-TrueType">. + +In the <it/fontenc/ layer, an encoding is defined by a name (such as +<tt/iso8859-1/), possibly a number of aliases (alternate names), and +an ordered collection of mappings. A mapping defines the way the +encoding can be mapped into one of the <it/target encodings/ known to +<it/fontenc/; currently, these consist of Unicode, Adobe glyph names, +and arbitrary TrueType ``cmap''s. + +A number of encodings are hardwired into <it/fontenc/, and are +therefore always available; the hardcoded encodings cannot easily be +redefined. These include: <itemize> -<item> `<tt/iso10646-1/': Unicode; -<item> `<tt/iso8859-1/': ISO Latin-1 (Western Europe); -<item> `<tt/iso8859-2/': ISO Latin-2 (Eastern Europe); -<item> `<tt/iso8859-3/': ISO Latin-3 (Southern Europe); -<item> `<tt/iso8859-4/': ISO Latin-4 (Northern Europe); -<item> `<tt/iso8859-5/': ISO Cyrillic; -<item> `<tt/iso8859-6/': ISO Arabic; -<item> `<tt/iso8859-7/': ISO Greek; -<item> `<tt/iso8859-8/': ISO Hebrew; -<item> `<tt/iso8859-9/': ISO Latin-5 (Turkish); -<item> `<tt/iso8859-10/': ISO Latin-6 (Nordic); -<item> `<tt/iso8859-15/': ISO Latin-9, or Latin-0 (Revised +<item> <tt/iso10646-1/: Unicode; +<item> <tt/iso8859-1/: ISO Latin-1 (Western Europe); +<item> <tt/iso8859-2/: ISO Latin-2 (Eastern Europe); +<item> <tt/iso8859-3/: ISO Latin-3 (Southern Europe); +<item> <tt/iso8859-4/: ISO Latin-4 (Northern Europe); +<item> <tt/iso8859-5/: ISO Cyrillic; +<item> <tt/iso8859-6/: ISO Arabic; +<item> <tt/iso8859-7/: ISO Greek; +<item> <tt/iso8859-8/: ISO Hebrew; +<item> <tt/iso8859-9/: ISO Latin-5 (Turkish); +<item> <tt/iso8859-10/: ISO Latin-6 (Nordic); +<item> <tt/iso8859-15/: ISO Latin-9, or Latin-0 (Revised Western-European); -<item> `<tt/koi8-r/': KOI8 Russian; -<item> `<tt/koi8-u/': KOI8 Ukrainian (see RFC 2319); -<item> `<tt/koi8-ru/': KOI8 Russian/Ukrainian -<item> `<tt/koi8-uni/': KOI8 ``Unified'' (Russian, Ukrainian, and +<item> <tt/koi8-r/: KOI8 Russian; +<item> <tt/koi8-u/: KOI8 Ukrainian (see RFC 2319); +<item> <tt/koi8-ru/: KOI8 Russian/Ukrainian +<item> <tt/koi8-uni/: KOI8 ``Unified'' (Russian, Ukrainian, and Byelorussian); -<item> `<tt/koi8-e/': KOI8 `European', ISO-IR-111, or ECMA-Cyrillic; -<item> `<tt/microsoft-symbol/' and `<tt/apple-roman/': these are only +<item> <tt/koi8-e/: KOI8 ``European,'' ISO-IR-111, or ECMA-Cyrillic; +<item> <tt/microsoft-symbol/ and <tt/apple-roman/: these are only likely to be useful with TrueType symbol fonts. </itemize> -New encodings can be added by defining <it/encoding files/. When a -font encoding is requested that the `fontenc' layer doesn't know -about, the backend checks the directory in which the font file resides -(not the directory with `<tt/fonts.dir/'!) for a file named -`<tt/encodings.dir/'. If found, this file is scanned for the unknown -encoding, and the requested encoding definition file is read in. The -mkfontdir(1) utility, when invoked with the `<tt/-e/' option followed -by the name of a directory containing encoding files, can be used to -automatically build `<tt/encodings.dir/' files. See the <tt/mkfontdir/(1) -manpage for more details. - -A number of predefined encoding files have been included with the -distribution. Information on writing new encoding files can be found -in <ref id="sec-format-encoding-directory-files" name="Format of -encodings directory files"> and <ref id="sec-format-encoding-files" -name="Format of encodings files">. +Additional encodings can be added by defining <it/encoding files/. +When a font encoding is requested that the <it/fontenc/ layer doesn't +know about, the backend checks the directory in which the font file +resides (not necessarily the directory with <tt/fonts.dir/!) for a +file named `<tt/encodings.dir/'. If found, this file is scanned for +the requested encoding, and the relevant encoding definition file is +read in. The `<tt/mkfontdir/' utility, when invoked with the +`<tt/-e/' option followed by the name of a directory containing +encoding files, can be used to automatically build +`<tt/encodings.dir/' files. See the <tt/mkfontdir/(1) manual page for +more details. + +A number of encoding files for common encodings are included with +XFree86. Information on writing new encoding files can be found in +Section <ref id="sec:format-encoding-directory-files" name="Format of +encodings directory files"> and <ref id="sec:format-encoding-files" +name="Format of encoding files"> later in this document. <sect1>Backend-specific notes about fontenc <sect2>Type 1 <p>The Type 1 backend first searches for a mapping with a target -of PostScript. If one is found, it is used. If none is found, the +of PostScript. If one is found, it is used. Otherwise, the backend searches for a mapping with target Unicode, which is then composed with a built-in table mapping codes to glyph names. Note that this table only covers part of the Unicode code points that have @@ -309,9 +598,11 @@ been assigned names by Adobe. If neither a PostScript or Unicode mapping is found, the backend defaults to ISO 8859-1. -Specifying an encoding value of `<tt/adobe-fontspecific/' disables -the encoding mechanism. This is useful with symbol and wrongly -encoded fonts (see below). +Specifying an encoding value of <tt/adobe-fontspecific/ disables +the encoding mechanism. This is useful with symbol and incorrectly +encoded fonts (see Section +<ref id="sec:incorrect-encoding" name="Incorrectly encoded fonts"> +below). The Type 1 backend currently limits all encodings to 8-bit codes. @@ -323,50 +614,48 @@ ISO 8859-1. The Speedo backend limits all encodings to 8-bit codes. -<sect2>The `freetype' TrueType backend +<sect2>The <it/FreeType/ TrueType backend <label id="sec:fontenc-freetype" -<p>The TrueType backend scans the mappings in order. Mappings with -a target of PostScript are ignored; mappings with a TrueType or -Unicode target are checked against all the cmaps in the file. The -first applicable mapping is used. +<p>The TrueType backend scans the mappings in order. Mappings with a +target of PostScript are ignored; mappings with a TrueType or Unicode +target are checked against all the cmaps in the file. The first +applicable mapping is used. -Authors of encoding files to be used with the TrueType backend should -ensure that mappings are mentioned in decreasing order of preference. +If you are writing an encoding file to be used with the TrueType +backend, you should ensure that mappings are mentioned in decreasing +order of preference. - -<sect1>Format of encodings directory files<label - id="sec-format-encoding-directory-files"> +<sect1>Format of encoding directory files <label id="sec:format-encoding-directory-files"> <p>In order to use a font in an encoding that the font backend does -not know about, you need to have a `<tt/encodings.dir/' file in the -same directory as the font file used. `<tt/encodings.dir/' has the -same format as `<tt/fonts.dir/'. Its first line specifies the number -of encodings, while every successive line has two columns, the name of -the encoding, and the name of the encoding file; this can be relative -to the current directory, or absolute. Every encoding name should -agree with the encoding name defined in the encoding file. For -example, - -<tscreen> +not know about, you need to have an `<tt/encodings.dir/' file in the +same directory as the font file used. The `<tt/encodings.dir/' file +has a similar format to `<tt/fonts.dir/'. Its first line specifies +the number of encodings, while every successive line has two columns, +the name of the encoding, and the name of the encoding file; this can +be relative to the current directory, or absolute. Every encoding +name should agree with the encoding name defined in the encoding file. +For example, + +<tscreen><verb> 3 -<p>mulearabic-0 encodings/mulearabic-0.enc -<p>mulearabic-1 encodings/mulearabic-1.enc -<p>mulearabic-2 encodings/mulearabic-2.enc -</tscreen> +mulearabic-0 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-0.enc +mulearabic-1 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-1.enc +mulearabic-2 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-2.enc +</verb></tscreen> -Note that the name of an encoding <it/must/ be specified in the -encoding file's STARTENCODING or ALIAS line. It is not enough to -create an `<tt/encodings.dir/' entry. +The name of an encoding <it/must/ be specified in the encoding file's +`<tt/STARTENCODING/' or `<tt/ALIAS/' line. It is not enough to create +an `<tt/encodings.dir/' entry. If your platform supports it (it probably does), encoding files may be compressed or gzipped. -`<tt/encoding.dir/' files are best maintained by the <tt/mkfontdir/(1) -utility. Please see the <tt/mkfontdir/(1) manpage for more -information. - +The `<tt/encoding.dir/' files are best maintained by the +`<tt/mkfontdir/' utility. Please see the <tt/mkfontdir/(1) manual +page for more information. -<sect1>Format of encoding files<label id="sec-format-encoding-files"> +<sect1>Format of encoding files <label id="sec:format-encoding-files"> <p>The encoding files are ``free form,'' <it/i.e./ any string of whitespace is equivalent to a single space. Keywords are parsed in a @@ -382,46 +671,46 @@ appear at any point in a line, and all characters following the `<tt/#/' are ignored, up to the end of the line. The encoding file starts with the definition of the name of the -encoding, and eventually its alternate names (aliases): -<tscreen> +encoding, and possibly its alternate names (aliases): +<tscreen><verb> STARTENCODING mulearabic-0 -<p>ALIAS arabic-0 -<p>ALIAS something-else -</tscreen> -The names of the encoding should be suitable for use in an XLFD font -name, and therefore contain exactly one dash `<tt/-/'. +ALIAS arabic-0 +ALIAS something-else +</verb></tscreen> +The name of the encoding and its aliases should be suitable for use in +an XLFD font name, and therefore contain exactly one dash `<tt/-/'. The encoding file may then optionally declare the size of the -encoding. For a linear encoding (such as Mule Arabic, or -ISO 8859-1), the SIZE line specifies the maximum code plus one: -<tscreen> +encoding. For a linear encoding (such as ISO 8859-1), the SIZE +line specifies the maximum code plus one: +<tscreen><verb> SIZE 0x2B -</tscreen> +</verb></tscreen> For a matrix encoding, it should specify two numbers. The first is the number of the last row plus one, the other, the highest column -number plus one. For example, in the case of `<tt/jisx0208.1990-0/' +number plus one. In the case of `<tt/jisx0208.1990-0/' (JIS X 0208(1990), double-byte encoding, high bit clear), it should be -<tscreen> +<tscreen><verb> SIZE 0x75 0x80 -</tscreen> -In the case of a matrix encoding, a `<tt/FIRSTINDEX/' may be included -to specify the minimum glyph index in an encoding. The keyword -`<tt/FIRSTINDEX/' is followed by two integers, the minimum row number -followed by the minimum column number: -<tscreen> +</verb></tscreen> +In the case of a matrix encoding, a `<tt/FIRSTINDEX/' line may be +included to specify the minimum glyph index in an encoding. The +keyword `<tt/FIRSTINDEX/' is followed by two integers, the minimum row +number followed by the minimum column number: +<tscreen><verb> FIRSTINDEX 0x20 0x20 -</tscreen> -In the case of a linear encoding, a `<tt/FIRSTINDEX/' line should -usually not be included. If for some reason however it is desired -that it should be included, it should be followed by a single integer. +</verb></tscreen> +In the case of a linear encoding, a `<tt/FIRSTINDEX/' line is not very +useful. If for some reason however you chose to include on, it should +be followed by a single integer. -Note that in some font backends inclusion of a `<tt/FIRSTINDEX/' line +Note that in most font backends inclusion of a `<tt/FIRSTINDEX/' line has the side effect of disabling default glyph generation, and this keyword should therefore be avoided unless absolutely necessary. Codes outside the region defined by the `<tt/SIZE/' and -`<tt/FIRSTINDEX/' lines are supposed to be undefined. Encodings +`<tt/FIRSTINDEX/' lines are understood to be undefined. Encodings default to linear encoding with a size of 256 (0x100). This means that you must declare the size of all 16 bit encodings. @@ -430,159 +719,144 @@ starts with a `<tt/STARTMAPPING/' line stating the target of the mapping. The target may be one of: <itemize> <item>Unicode (ISO 10646): -<tscreen> +<tscreen><verb> STARTMAPPING unicode -</tscreen> -<item>a given TrueType `<tt/cmap/': -<tscreen> +</verb></tscreen> +<item>a given TrueType ``cmap'': +<tscreen><verb> STARTMAPPING cmap 3 1 -</tscreen> -<item>PostScript glyph names -<tscreen> +</verb></tscreen> +<item>PostScript glyph names: +<tscreen><verb> STARTMAPPING postscript -</tscreen> +</verb></tscreen> </itemize> Every line in a mapping section maps one from the encoding being defined to the target of the mapping. In mappings with a Unicode or TrueType mapping, codes are mapped to codes: -<tscreen> +<tscreen><verb> 0x21 0x0660 -<p>0x22 0x0661 -<p>... -</tscreen> +0x22 0x0661 +... +</verb></tscreen> As an abbreviation, it is possible to map a contiguous range of codes in a single line. A line consisting of three integers -<tscreen> +<tscreen><verb> <it/start/ <it/end/ <it/target/ -</tscreen> +</verb></tscreen> is an abbreviation for the range of lines <tscreen> <it/start/ <it/target/ -<p><it/start/+1 <it/target/+1 -<p>... -<p><it/end/ <it/target/+<it/end/-<it/start/ +</tscreen><tscreen> +<it/start/+1 <it/target/+1 +</tscreen><tscreen> +... +</tscreen><tscreen> +<it/end/ <it/target/+<it/end/-<it/start/ </tscreen> For example, the line -<tscreen> +<tscreen><verb> 0x2121 0x215F 0x8140 -</tscreen> +</verb></tscreen> is an abbreviation for -<tscreen> +<tscreen><verb> 0x2121 0x8140 -<p>0x2122 0x8141 -<p>... -<p>0x215F 0x817E -</tscreen> +0x2122 0x8141 +... +0x215F 0x817E +</verb></tscreen> Codes not listed are assumed to map through the identity (<it/i.e./ to the same numerical value). In order to override this default mapping, you may specify a range of codes to be undefined by using an `<tt/UNDEFINE/' line: -<tscreen> +<tscreen><verb> UNDEFINE 0x00 0x2A -</tscreen> -or, for a single code -<tscreen> +</verb></tscreen> +or, for a single code, +<tscreen><verb> UNDEFINE 0x1234 -</tscreen> -This works because later values override earlier one. +</verb></tscreen> PostScript mappings are different. Every line in a PostScript mapping maps a code to a glyph name -<tscreen> +<tscreen><verb> 0x41 A -<p>0x42 B -<p>... -</tscreen> +0x42 B +... +</verb></tscreen> and codes not explicitly listed are undefined. A mapping section ends with an <tt/ENDMAPPING/ line -<tscreen> +<tscreen><verb> ENDMAPPING -</tscreen> +</verb></tscreen> After all the mappings have been defined, the file ends with an <tt/ENDENCODING/ line -<tscreen> +<tscreen><verb> ENDENCODING -</tscreen> -Lines of the form -<tscreen> -UNASSIGNED 0x00 0x1F -</tscreen> -or -<tscreen> -UNASSIGNED 0x1234 -</tscreen> -are ignored by the server, but may be used by supporting utilities. +</verb></tscreen> In order to make future extensions to the format possible, lines -starting with an unknown keyword are ignored, as are mapping sections -with an unknown target. - +starting with an unknown keyword are silently ignored, as are mapping +sections with an unknown target. -<sect1>Using symbol fonts<label id="sec-symbol-fonts"> +<sect1>Using symbol fonts <label id="sec:symbol-fonts"> <p>Type 1 symbol fonts should be installed using the -`<tt/adobe-fontspecific/' encoding. +<tt/adobe-fontspecific/ encoding. In an ideal world, all TrueType symbol fonts would be installed using -one of the `<tt/microsoft-symbol/' and `<tt/apple-roman/' encodings. A +one of the <tt/microsoft-symbol/ and <tt/apple-roman/ encodings. A number of symbol fonts, however, are not marked as such; such fonts -should be installed using `<tt/microsoft-cp1252/', or, for older -fonts, `<tt/microsoft-win3.1/'. +should be installed using <tt/microsoft-cp1252/, or, for older fonts, +<tt/microsoft-win3.1/. In order to guarantee consistent results (especially between Type 1 and TrueType versions of the same font), it is possible to define a special encoding for a given font. This has already been done -for the `<tt/ZapfDingbats/' font; see the file -`<tt>encodings/adobe-dingbats.enc</tt>'. - +for the <tt/ZapfDingbats/ font; see the file +<tt>encodings/adobe-dingbats.enc</tt>. -<sect1>Using badly encoded font files<label id="sec-badly-encoded"> +<sect1>Hints about using badly encoded fonts <label id="sec:incorrect-encoding"> -<p>A number of text fonts are incorrectly encoded. Incorrect encoding is -sometimes done by design, in order to make a font for an exotic script -appear like an ordinary Western text font. It is often due to the font -designer's laziness or incompetence; in particular, most people seem -to find it easier to invent idiosyncratic glyph names rather than -follow the Adobe glyph list. +<p>A number of text fonts are incorrectly encoded. Incorrect encoding +is sometimes done by design, in order to make a font for an exotic +script appear like an ordinary Western text font. It is often the +result of the font designer's laziness or incompetence; for some +reason, most people seem to find it easier to invent idiosyncratic +glyph names rather than follow the Adobe glyph list. There are two ways of dealing with such fonts: using them with the encoding they were designed for, and creating an <it/ad hoc/ encoding file. -Of course, most of the time the proper fix would be to hit the font -designer very hard on the head with the PLRM (preferably the first -edition, as it was published in hardcover). - <sect2>Using fonts with the designer's encoding <p>In the case of Type 1 fonts, the font designer can specify a default encoding; this encoding is requested by using the `<tt/adobe-fontspecific/' encoding in the XLFD name. Sometimes, the -font designer omitted to specify a reasonable default encoding; in -this case, you should experiment with `<tt/adobe-standard/', +font designer omitted to specify a reasonable default encoding, in +which case you should experiment with `<tt/adobe-standard/', `<tt/iso8859-1/', `<tt/microsoft-cp1252/', and -`<tt/microsoft-win3.1/', (`<tt/microsoft-symbol/' doesn't make sense -for Type 1 fonts). +`<tt/microsoft-win3.1/'. (The encoding `<tt/microsoft-symbol/' doesn't +make sense for Type 1 fonts). -TrueType fonts do not have a default encoding, and use of the -Microsoft Symbol encoding yields strange results with text fonts on -some (non-X11) platforms. However, most TrueType fonts are designed -with either Microsoft or Apple platforms in mind, so one of -`<tt/microsoft-cp1252/', `<tt/microsoft-win3.1/', or -`<tt/apple-roman/' should yield reasonable results. +TrueType fonts do not have a default encoding. However, most TrueType +fonts are designed with either Microsoft or Apple platforms in mind, +so one of `<tt/microsoft-symbol/', `<tt/microsoft-cp1252/', +`<tt/microsoft-win3.1/', or `<tt/apple-roman/' should yield reasonable +results. -<sect2>Specifying an ad hoc encoding file +<sect2>Specifying an <it/ad hoc/ encoding file <p>It is always possible to define an encoding file to put the glyphs in a font in any desired order. Again, see the -`<tt/encodings/adobe-dingbats.enc/' file to see how this is done. - +`<tt>encodings/adobe-dingbats.enc</tt>' file to see how this is done. <sect2>Specifying font aliases <p>By following the directions above, you will find yourself with a -number of fonts with unusual names -- specifying encodings such as +number of fonts with unusual names --- with encodings such as `<tt/adobe-fontspecific/', `<tt/microsoft-win3.1/' <it/etc/. In order to use these fonts with standard applications, it may be useful to remap them to their proper names. @@ -590,74 +864,75 @@ remap them to their proper names. This is done by writing a `<tt/fonts.alias/' file. The format of this file is similar to the format of the `<tt/fonts.dir/' file, except that it maps XLFD names to XLFD names. A `<tt/fonts.alias/' file might look as follows: -<tscreen> +<tscreen><verb> 1 -<p>"-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-iso8859-2" \ -<p> "-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific" -</tscreen> +"-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-iso8859-2" \ + "-ogonki-alamakota-medium-r-normal--0-0-0-0-p-0-adobe-fontspecific" +</verb></tscreen> (both XLFD names on a single line). The syntax of the -`<tt/fonts.alias/' file is described in the mkfontdir(1) manual page. - - -<sect>New font backends - -<sect1>New TrueType backends - -<p>This version of XFree86 comes with two TrueType backends, known as -`freetype' (formerly `xfsft') and `X-TrueType' (`X-TT' for short). -Those two backends are incompatible, in that only one can be used at -any one time. Users are invited to chose whichever backend they find -more useful and stick to it. - -The `freetype' backend resides in the module `<tt/freetype/'. Before -using it, please check that the `<tt/Module/' section of your -`<tt/XF86Config/' file contains a line that reads -<tscreen> - Load "freetype" -</tscreen> - -The `X-TrueType' backend resides in module `<tt/xtt/'. In order to -use it, replace the line in your `<tt/XF86Config/' file that loads the -`<tt/freetype/' module with a line reading -<tscreen> - Load "xtt" -</tscreen> - -Both TrueType backends delay glyph rasterisation to the time at which -a glyph is first used. For this reason, they only provide an -approximate value for the `average width' font property. Users are -warned not to rely on the average width of a font having an accurate -value. +`<tt/fonts.alias/' file is precisely described in the +<tt/mkfontdir/(1) manual page. + +<sect>Additional notes about TrueType support + +<p>This version of XFree86 comes with two TrueType backends, +<it/FreeType/ (module `<tt/freetype/', formerly known as <it/xfsft/) and +<it/X-TrueType/ (module `<tt/xtt/'). These two backends are <it/not/ +compatible: only one of them can be used at any one time. + +In order to use the <it/FreeType/ backend, please check that the +`<tt/Module/' section of your `<tt/XF86Config/' file contains a line +that reads +<tscreen><verb> +Load "freetype" +</verb></tscreen> + +In order to use the <it/X-TrueType/ backend, replace the line in your +<tt/XF86Config/ file that loads the <tt/freetype/ module with a +line that reads +<tscreen><verb> + Load "xtt" +</verb></tscreen> + +Both TrueType backends delay glyph rasterisation up to the time at +which a glyph is first used. For this reason, they only provide an +approximate value for the ``average width'' font property. Both backends also support an optimisation for character-cell fonts (fonts with all glyph metrics equal, or terminal fonts). A font with an XLFD specifying a character-cell spacing `<tt/c/', as in -<tscreen> +<tscreen><verb> -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0 -</tscreen> +</verb></tscreen> will not rasterise glyphs at metrics computation time, but instead -trust the font really to be a character-cell font. Users are +trust the font really to be a character-cell font. You are encouraged to make use of this optimisation when useful, but be warned that not all monospaced fonts are character-cell fonts. +<sect1>The <it/FreeType/ TrueType backend -<sect2>The `freetype' TrueType backend - -<p>The `freetype' backend (formerly `xfsft') is a backend based on the -FreeType library (see www.freetype.org) with support for the `fontenc' -style of internationalisation (see <ref id="sec-fontenc" name="The -fontenc layer">). This backend supports TrueType Font files -(<tt/*.ttf/) and TrueType Collections (<tt/*.ttc/). +<p>The <it/FreeType/ backend (formerly <it/xfsft/) is a backend based on +the FreeType library (see <url url="http://www.freetype.org/" +name="the FreeType web site">) and has support for the ``fontenc'' +style of internationalisation (see Section <ref id="sec:fontenc" +name="The fontenc layer">). This backend supports TrueType Font files +(`<tt/*.ttf/') and TrueType Collections (`<tt/*.ttc/'). In order to access the faces in a TrueType Collection file, the face number must be specified in the fonts.dir file before the filename within colons. For example, -<tscreen> +<tscreen><verb> :2:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0 -</tscreen> +</verb></tscreen> refers to face 2 in the `<tt/mincho.ttc/' TrueType Collection file. -<sect2>The `X-TrueType' TrueType backend<label id="sec-X-TT"> +The <it/FreeType/ backend uses the <it/fontenc/ layer in order to +support recoding of fonts; this was described in Section <ref +id="sec:fontenc" name="The fontenc layer"> and especially Section <ref +id="sec:fontenc-freetype" name="FreeType-specific notes about +fontenc"> earlier in this document. + +<sect1>The <it/X-TrueType/ TrueType backend <label id="sec:X-TT"> <p>The `X-TrueType' backend is another backend based on the FreeType library. X-TrueType doesn't use the `fontenc' layer for managing font @@ -667,151 +942,167 @@ need is likely to be present in X-TrueType. X-TrueType extends the `<tt/fonts.dir/' syntax with a number of options, known as `TTCap'. A `TTCap' entry follows the general syntax -<tscreen> +<tscreen><verb> :option=value: -</tscreen> +</verb></tscreen> and should be specified before the filename. The most useful TTCap option is used to specify the face number to use -with TTCs; it carries the name `<tt/fn/'. This means that face 2 of font -file `<tt/mincho.ttc/' is specified using: -<tscreen> +with TTCs; this is the `<tt/fn/' TTCap option. For example, face 2 of +font file `<tt/mincho.ttc/' is specified using: +<tscreen><verb> :fn=2:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0 -</tscreen> +</verb></tscreen> More information on the TTCap syntax, and on X-TrueType in general, -may be found on -<tscreen> -<url url="http://hawk.ise.chuo-u.ac.jp/student/person/tshiozak/x-tt/index-eng.html"> -</tscreen> +may be found on <url url="http://x-tt.dsl.gr.jp/" name="the X-TrueType +home page">. -<sect1>Support for CID-keyed fonts +<sect>Appendix: background and terminology <label id="sec:background"> +<sect1>Characters and glyphs -<p>The CID-keyed font format was designed by Adobe Systems for fonts with -large character sets. It is described in the Adobe Technical Notes -nr. 5092, "Overview of the CID-Keyed Font Technology," -nr. 5014, "CMap and CIDFont File Format Specification," and -others, available from -<tscreen> -<url url="http://partners.adobe.com/supportservice/devrelations/typeforum/cidfonts.html"> -</tscreen> +<p>A computer text-processing system inputs keystrokes and outputs +<it/glyphs/, small pictures that are assembled on paper or on a +computer screen. Keystrokes and glyphs do not, in general, coincide: +for example, if the system does generate ligatures, then to the two +keystrokes <<tt/f/><<tt/i/> will typically correspond a +single glyph. Similarly, if the system shapes Arabic glyphs in a +reasonable manner, then multiple different glyphs may correspond to +a single keystroke. + +The complex transformation rules from keystrokes to glyphs are usually +factored into two simpler transformations, going through the +intermediary of <it/characters/. You may want to think of characters +as the basic unit of data that is stored <it/e.g./ in the buffer of +your text editor. While the definition of a character is intrinsically +application-specific, a number of standardised collections of +characters have been defined. -Sample CID-keyed fonts can be found at: -<tscreen> -<url url="ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/"> -</tscreen> -Support for CID-keyed fonts in XFree86 is controlled by the two -switches `<tt/BuildCID/' and <tt/BuildCIDFonts/. Make sure that those -switches are turned on (in the directory <tt>xc/config/cf</tt>) when -XFree86 is built. By default, they should be set to <tt/YES/, unless -you are building XFree86 for a small memory footprint, in which case -they should be set to <tt/NO/. +A <it/coded character set/ is a set of characters together with a +mapping from integer codes --- known as <it/codepoints/ --- to +characters. Examples of coded character sets include US-ASCII, +ISO 8859-1, KOI8-R, and JIS X 0208(1990). -The CID-keyed font backend does not use the `fontenc' layer, but -instead uses the standard `CMap' method of recoding CID-keyed fonts. +A coded character set need not use 8 bit integers to index +characters. Many early mainframes used 6 bit character sets, while +16 bit (or more) character sets are necessary for ideographic writing +systems. -<sect2>Using CID-keyed fonts +<sect1>Font files, fonts, and XLFD <label id="sec:xlfd"> -<p>As shown in the sample install file -<tt>/usr/X11R6/lib/X11/XF86Config.eg</tt>, the font directory CID -should be specified as part of the XFree86 font path: -<tscreen> -FontPath "/usr/X11R6/lib/X11/fonts/CID/" -</tscreen> -in the `<tt/XF86Config/' file. When the CID font directory is on the -font path it must contain at least the empty files fonts.dir and -fonts.scale. Sample `<tt/fonts.dir/' and `<tt/fonts.scale/' files, -with 0 entries, are installed by default. - -A sample CID-keyed font is provided in the file: -<tscreen> -test/xsuite/xtest/CID -</tscreen> -The test directory was given the same name as the CID font directory, -because it shows how a CID-keyed font should be installed. It -contains a number of subdirectories, and any CID font directory should -have the same directory structure. +<p>Traditionally, typographers speak about <it/typefaces/ and +<it/founts/. A typeface is a particular style or design, such as +Times Italic, while a fount is a molten-lead incarnation of a given +typeface at a given size. -When installing CID-keyed fonts, the empty fonts.scale and fonts.dir -files in the directory: -<tscreen> -xc/fonts/scaled/CID -</tscreen> -should be replaced by <tt/fonts.scale/ and <tt/fonts.dir/ files with a -number of entries of the form: -<tscreen> -1 -<p>Adobe-Korea1/Munhwa-Regular--Adobe-Korea1-0.cid \ -<p> -adobe-munhwa-medium-r-normal--0-0-0-0-p-0-adobe.korea1-0 -</tscreen> -(the font file name and the XLFD name should be on the same line). -Note that the first column does not specify an actual filename; -instead, it specifies the PostScript name of the CID-keyed font, -followed by the extension `<tt/.cid/'. The actual names of the files -used will be derived from this PostScript name. - -CID-keyed fonts are divided in groups by character collection. For -example, the Korean font: -<tscreen> -Munhwa-Regular--Adobe-Korea1-0 -</tscreen> -is in a subdirectory `<tt/Adobe-Korea1/'. +Digital fonts come in <it/font files/. A font file contains all the +information necessary for generating glyphs of a given typeface, and +applications using font files may access glyph information in an +arbitrary order. -The PostScript name of a CID-keyed font consists of two parts, the -<it/CIDFontName/ and the <it/CMapName/, separated by two dashes. -For instance, in the case of the font name -<tscreen> -Munhwa-Regular--Adobe-Korea1-0 -</tscreen> -the <it/CIDFontName/ is `<tt/Munhwa-Regular/' while the <it/CMapName/ -is `<tt/Adobe-Korea1/'. +Digital fonts may consist of bitmap data, in which case they are said +to be <it/bitmap fonts/. They may also consist of a mathematical +description of glyph shapes, in which case they are said to be +<it/scalable fonts/. Common formats for scalable font files are +<it/Type 1/ (sometimes incorrectly called <it/ATM fonts/ or +<it/PostScript fonts/), <it/Speedo/ and <it/TrueType/. -Each CID-keyed font consist of a CIDFont file and one or more CMap files. -The CIDFont file contains the description of each character in a font. It is -stored in the subdirectory CIDFont of the Adobe-Korea1 directory. The -directory structure looks as following: -<tscreen> -CID/Adobe-Korea1/CIDFont/Munhwa-Regular -<p>CID/Adobe-Korea1/CMap/Adobe-Korea1-0 -<p>CID/Adobe-Korea1/AFM/Munhwa-Regular.afm -<p>CID/Adobe-Korea1/CFM -<p>CID/fonts.dir -<p>CID/fonts.scale -</tscreen> -The file `<tt/Munhwa-Regular.afm/' is an Adobe Font Metric File (AFM). -The directory `<tt/CFM/' will be used for summaries of that font -metric file, which will be computed later. +The glyph data in a digital font needs to be indexed somehow. How +this is done depends on the font file format. In the case of +Type 1 fonts, glyphs are identified by <it/glyph names/. In the +case of TrueType fonts, glyphs are indexed by integers corresponding +to one of a number of indexing schemes (usually Unicode --- see below). -When the CID-keyed files are installed you can run the utility -<tscreen> -/usr/X11R6/bin/mkcfm -</tscreen> -to create the summaries of font metric file (<tt/*.cfm/), and to put them -in appropriate subdirectories. By default, the program works on the -directory: -<tscreen> -/usr/X11R6/lib/X11/fonts/CID -</tscreen> -A different directory can be specified on the command line of -`<tt/mkcfm/.' +The X11 system uses the data in font file to generate <it/font +instances/, which are collections of glyphs at a given size indexed +according to a given encoding. -`<tt/mkcfm/' should be run as root, as it needs to write its output to -a system directory. If the program determines that it cannot write in -the designated `<tt/CFM/' subdirectories, it will display a message, -and switch to current directory. +X11 font instances are usually specified using a notation known as the +<it/X Logical Font Description/ (XLFD). An XLFD starts with a dash +`<tt/-/', and consists of fourteen fields separated by dashes, for +example +<tscreen><verb> +-adobe-courier-medium-r-normal--0-0-0-0-m-0-iso8859-1 +</verb></tscreen> +Or particular interest are the last two fields `<tt/iso8859-1/', which +specify the font instance's encoding. -Unless `<tt/mkcfm/' is run, opening large CID-keyed fonts will take a -significant amount of time. `<tt/mkcfm/' should be run again whenever a -change is made to any of the CID-keyed fonts, or when the CID-keyed -fonts are copied to a machine with a different architecture. +X11 font instances may also be specified by short name. Unlike an +XLFD, a short name has no structure and is simply a conventional name +for a font instance. Two short names are of particular interest, as +they are handled specially by the server, and the server will not +start if font instances with these names cannot be opened. These are +`<tt/fixed/', which specifies the fallback font to use when the +requested font cannot be opened, and `<tt/cursor/', which specifies +the set of glyphs to be used by the mouse pointer. + +Short names are usually implemented as aliases to XLFDs; the +`<tt/fixed/' and `<tt/cursor/' aliases are defined in +<tscreen><verb> +/usr/X11R6/lib/X11/font/misc/fonts.alias +</verb></tscreen> -<sect2>Limitations +<sect1>Unicode -<p>The current version of the CID-keyed fonts backend only supports -the CMaps used for horizontal text (<it/e.g./ the CMap -`<tt/KSC-EUC-H/' will be used, but not `<tt/KSC-EUC-V/'). This -limitation is due to the fact that the core X11 protocol only provides -support for horizontal writing. +<p>Unicode (<url url="http://www.unicode.org">) is a coded character +set with the goal of uniquely identifying all characters for all +scripts, current and historical. While Unicode was explicitly not +designed as a glyph encoding scheme, it is often possible to use it as +such. +Unicode is an <it/open/ character set, meaning that codepoint +assignments may be added to Unicode at any time (once specified, +though, an assignment can never be changed). For this reason, a +Unicode font will be <it/sparse/, and only define glyphs for a subset +of the character registry of Unicode. -</article> +The Unicode standard is defined in parallel with the international +standard ISO 10646. Assignments in the two standards are always +equivalent, and this document uses the terms <it/Unicode/ and +<it/ISO 10646/ interchangeably. + +When used in X11, Unicode-encoded fonts should have the last two +fields of their XLFD set to `<tt/iso10646-1/'. + +<sect>References + +<p>XFree86 comes with extensive documentation in the form of manual +pages and typeset documents. Before installing fonts, you really +should read the <tt/mkfontdir/(1) manual page; other manual pages of +interest include <tt/X/(1), <tt/Xserver/(1), <tt/xset/(1), +<tt/xlsfonts/(1) and <tt/showfont/(1). In addition, you may want to +read the X Logical Font Description document, by Jim Flowers, which is +provided in the file `<tt>xc/doc/xlfd.PS.Z</tt>'. + +The <url name="comp.fonts FAQ" +url="http://www.netmeg.net/faq/computers/fonts/">, which is +unfortunately no longer being maintained, contains a wealth of +information about digital fonts. + +The +<url name="xfsft home page" + url="http://www.dcs.ed.ac.uk/home/jec/programs/xfsft/"> +has been superseded by this document, and is now obsolete; you may +however still find some of the information it contains useful. <url +name="Joerg Pommnitz' xfsft page" +url="http://www.joerg-pommnitz.de/TrueType/xfsft.html"> is the +canonical source for the `<tt/ttmkfdir/' utility. + +The documentation of <it/X-TrueType/ is available from +<url url="http://x-tt.dsl.gr.jp/" name="the X-TrueType home page">. + +A number of East-Asian CIDFonts are available from +<url name="O'Reilly's FTP site" + url="ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/">. + +The <url url="http://www.unicode.org" name="Unicode consortium site"> +may be of interest. But you are more likely to find what you need on +Markus Kuhn's <url url="http://www.cl.cam.ac.uk/~mgk25/unicode.html" +name="UTF-8 and Unicode FAQ">. + +The IANA RFC documents, available from a number of sites throughout +the world, often provide interesting information about character set +issues; my favourite is RFC 373. +</article> +<!-- Who was it who wrote the Linuxdoc DTD, and was he drunk at the + time ? --> diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/index.pre b/xc/programs/Xserver/hw/xfree86/doc/sgml/index.pre index fc3fb96e4..18e6cf5a5 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/index.pre +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/index.pre @@ -8,10 +8,10 @@ <!-- Title information --> <title>Documentation for XFree86™ version &relvers; <author>The XFree86 Project, Inc -<date>December 2000 +<date>18 December 2000 <!-- -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/index.pre,v 1.9 2000/11/28 20:59:17 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/index.pre,v 1.11 2000/12/17 23:01:10 dawes Exp $ --> <p> diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/newport.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/newport.sgml index 18ebd7b4e..a0999f79a 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/newport.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/newport.sgml @@ -7,7 +7,7 @@ <author>Guido Guenther <date>1 August 2000 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/newport.sgml,v 1.1 2000/12/01 19:37:57 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/newport.sgml,v 1.2 2000/12/12 18:54:29 dawes Exp $ </ident> <toc> @@ -36,17 +36,17 @@ The following Section "Device" options are supported by the newport driver: <sect>Authors <p> <itemize> - <item>Guido Guenther <guido.guenther@gmx.net> + <item>Guido Guenther <email>guido.guenther@gmx.net</email> </itemize> <sect>Acknowledgements <p> <itemize> - <item>Gleb O. Raiko <raiko@niisi.msk.ru> for getting the beast to build - <item>Ralf Baechle <ralf@oss.sgi.com> for his patience... - <item>Ulf Carlsson <ulfc@calypso.engr.sgi.com> for comments and the dynamic loader code - <item>Nina A. Podolskaya <nap@niisi.msk.ru> for dynamic loader code + <item>Gleb O. Raiko <email>raiko@niisi.msk.ru</email> for getting the beast to build + <item>Ralf Baechle <email>ralf@oss.sgi.com</email> for his patience... + <item>Ulf Carlsson <email>ulfc@calypso.engr.sgi.com</email> for comments and the dynamic loader code + <item>Nina A. Podolskaya <email>nap@niisi.msk.ru</email> for dynamic loader code <item>all the guys who wrote the newport_con linux kernel code </itemize> diff --git a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.cpp b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.cpp index d105ba52f..a38fed3b9 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm.cpp,v 1.4 2000/06/14 02:13:07 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm.cpp,v 1.5 2000/12/11 20:18:05 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH APM __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH APM __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME apm \- Alliance ProMotion video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.cpp b/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.cpp index 22d90daab..7d7de05f0 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.cpp,v 1.5 2000/06/19 15:00:55 tsi Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.cpp,v 1.6 2000/12/11 20:18:06 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH ATI __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH ATI __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME ati \- ATI video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c index 68a32983e..8b2ff084a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c,v 1.9 2000/08/04 21:07:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atidac.c,v 1.10 2000/12/13 00:45:19 tsi Exp $ */ /* * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca * @@ -183,14 +183,30 @@ ATIDACPreInit if (pATI->depth == 1) { - rgb blackColour = pScreenInfo->display->whiteColour, + rgb blackColour = pScreenInfo->display->blackColour, whiteColour = pScreenInfo->display->whiteColour; - /* Check for defaults */ - if (!blackColour.red && !blackColour.green && !blackColour.blue && - !whiteColour.red && !whiteColour.green && !whiteColour.blue) - whiteColour.red = whiteColour.green = whiteColour.blue = - maxColour; + if (blackColour.red > maxColour) + blackColour.red = maxColour; + if (blackColour.green > maxColour) + blackColour.green = maxColour; + if (blackColour.blue > maxColour) + blackColour.blue = maxColour; + if (whiteColour.red > maxColour) + whiteColour.red = maxColour; + if (whiteColour.green > maxColour) + whiteColour.green = maxColour; + if (whiteColour.blue > maxColour) + whiteColour.blue = maxColour; + + if ((blackColour.red == whiteColour.red) && + (blackColour.green == whiteColour.green) && + (blackColour.blue == whiteColour.blue)) + { + blackColour.red = whiteColour.red ^ maxColour; + blackColour.green = whiteColour.green ^ maxColour; + blackColour.blue = whiteColour.blue ^ maxColour; + } pATIHW->lut[(MONO_BLACK * 3) + 0] = blackColour.red; pATIHW->lut[(MONO_BLACK * 3) + 1] = blackColour.green; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c index e9241d664..df04d62ce 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c,v 1.26 2000/11/02 16:55:28 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c,v 1.27 2000/12/13 00:25:12 tsi Exp $ */ /* * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca * @@ -806,53 +806,91 @@ ATIMach64SetDPMSMode if ((pATI->LCDPanelID >= 0) && !pATI->OptionCRT) { - CARD32 lcd_index = 0, power_management; + CARD32 lcd_index = 0; - if (pATI->Chip == ATI_CHIP_264LT) - power_management = inr(POWER_MANAGEMENT); - else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) || - (pATI->Chip == ATI_CHIP_264XL) || - (pATI->Chip == ATI_CHIP_MOBILITY)) */ + /* + * ATI's BIOS simply turns the panel on and off, so do the same by + * default, but keep the previous behaviour around for reference. + */ + if (pATI->OptionDevel) { - lcd_index = inr(LCD_INDEX); - power_management = ATIGetMach64LCDReg(LCD_POWER_MANAGEMENT); - } + CARD32 power_management; - power_management &= ~(STANDBY_NOW | SUSPEND_NOW); + if (pATI->Chip == ATI_CHIP_264LT) + power_management = inr(POWER_MANAGEMENT); + else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) || + (pATI->Chip == ATI_CHIP_264XL) || + (pATI->Chip == ATI_CHIP_MOBILITY)) */ + { + lcd_index = inr(LCD_INDEX); + power_management = ATIGetMach64LCDReg(LCD_POWER_MANAGEMENT); + } - switch (DPMSMode) - { - case DPMSModeOn: - break; + power_management &= ~(STANDBY_NOW | SUSPEND_NOW); - case DPMSModeStandby: - power_management |= STANDBY_NOW; - break; + switch (DPMSMode) + { + case DPMSModeOn: + break; - case DPMSModeSuspend: - power_management |= SUSPEND_NOW; - break; + case DPMSModeStandby: + power_management |= STANDBY_NOW; + break; - case DPMSModeOff: - power_management |= STANDBY_NOW | SUSPEND_NOW; /* ? */ - break; + case DPMSModeSuspend: + power_management |= SUSPEND_NOW; + break; - default: /* Muffle compiler */ - return; - } + case DPMSModeOff: + power_management |= STANDBY_NOW | SUSPEND_NOW; /* ? */ + break; - /* Panel power management seems to involve the engine */ - if (pATI->OptionAccel) - ATIMach64WaitForIdle(pATI); + default: /* Muffle compiler */ + return; + } - if (pATI->Chip == ATI_CHIP_264LT) - outr(POWER_MANAGEMENT, power_management); - else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) || - (pATI->Chip == ATI_CHIP_264XL) || - (pATI->Chip == ATI_CHIP_MOBILITY)) */ + /* Panel power management seems to involve the engine */ + if (pATI->OptionAccel) + ATIMach64WaitForIdle(pATI); + + if (pATI->Chip == ATI_CHIP_264LT) + outr(POWER_MANAGEMENT, power_management); + else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) || + (pATI->Chip == ATI_CHIP_264XL) || + (pATI->Chip == ATI_CHIP_MOBILITY)) */ + { + ATIPutMach64LCDReg(LCD_POWER_MANAGEMENT, power_management); + outr(LCD_INDEX, lcd_index); + } + } + else { - ATIPutMach64LCDReg(LCD_POWER_MANAGEMENT, power_management); - outr(LCD_INDEX, lcd_index); + CARD32 lcd_gen_ctrl; + + if (pATI->Chip == ATI_CHIP_264LT) + lcd_gen_ctrl = inr(LCD_GEN_CTRL); + else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) || + (pATI->Chip == ATI_CHIP_264XL) || + (pATI->Chip == ATI_CHIP_MOBILITY)) */ + { + lcd_index = inr(LCD_INDEX); + lcd_gen_ctrl = ATIGetMach64LCDReg(LCD_GEN_CNTL); + } + + if (DPMSMode == DPMSModeOn) + lcd_gen_ctrl |= LCD_ON; + else + lcd_gen_ctrl &= ~LCD_ON; + + if (pATI->Chip == ATI_CHIP_264LT) + outr(LCD_GEN_CTRL, lcd_gen_ctrl); + else /* if ((pATI->Chip == ATI_CHIP_264LTPRO) || + (pATI->Chip == ATI_CHIP_264XL) || + (pATI->Chip == ATI_CHIP_MOBILITY)) */ + { + ATIPutMach64LCDReg(LCD_GEN_CNTL, lcd_gen_ctrl); + outr(LCD_INDEX, lcd_index); + } } } } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c index 4002ee139..4ecdd8246 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c,v 1.38 2000/12/02 15:30:32 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c,v 1.39 2000/12/13 00:45:20 tsi Exp $ */ /* * Copyright 1999 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca * @@ -510,23 +510,41 @@ ATIPreInit if (!xf86SetDepthBpp(pScreenInfo, 8, 8, 8, i)) return FALSE; - switch (pScreenInfo->depth) + for (j = 0; ; j++) { - + static const CARD8 AllowedDepthBpp[][2] = + { #ifndef AVOID_CPIO - - case 1: case 4: - + { 1, 1}, + { 4, 4}, + { 4, 8}, #endif /* AVOID_CPIO */ + { 8, 8}, + {15, 16}, + {16, 16}, + {24, 24}, + {24, 32} + }; + + if (j < NumberOf(AllowedDepthBpp)) + { + if (pScreenInfo->depth > AllowedDepthBpp[j][0]) + continue; - case 8: case 15: case 16: case 24: - break; + if (pScreenInfo->depth == AllowedDepthBpp[j][0]) + { + if (pScreenInfo->bitsPerPixel > AllowedDepthBpp[j][1]) + continue; - default: - xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, - "Driver does not support depth %d.\n", - pScreenInfo->depth); - return FALSE; + if (pScreenInfo->bitsPerPixel == AllowedDepthBpp[j][1]) + break; + } + } + + xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, + "Driver does not support depth %d at fbbpp %d.\n", + pScreenInfo->depth, pScreenInfo->bitsPerPixel); + return FALSE; } xf86PrintDepthBpp(pScreenInfo); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c index 773e67dba..1d36d7657 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.35 2000/11/03 03:42:27 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.36 2000/12/13 02:44:59 tsi Exp $ */ /* * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca * @@ -2240,6 +2240,25 @@ NoVGAWonder:; } xf86LoaderReqSymLists(ATISymbols, NULL); + + /* Workaround for possible loader bug */ +# define ATIPreInit \ + (xf86PreInitProc*) LoaderSymbol("ATIPreInit") +# define ATIScreenInit \ + (xf86ScreenInitProc*) LoaderSymbol("ATIScreenInit") +# define ATISwitchMode \ + (xf86SwitchModeProc*) LoaderSymbol("ATISwitchMode") +# define ATIAdjustFrame \ + (xf86AdjustFrameProc*)LoaderSymbol("ATIAdjustFrame") +# define ATIEnterVT \ + (xf86EnterVTProc*) LoaderSymbol("ATIEnterVT") +# define ATILeaveVT \ + (xf86LeaveVTProc*) LoaderSymbol("ATILeaveVT") +# define ATIFreeScreen \ + (xf86FreeScreenProc*) LoaderSymbol("ATIFreeScreen") +# define ATIValidMode \ + (xf86ValidModeProc*) LoaderSymbol("ATIValidMode") + #endif /* Attach device to screen */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h index 110c59516..e957caf6b 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h,v 1.27 2000/12/02 15:53:52 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h,v 1.28 2000/12/13 00:45:21 tsi Exp $ */ /* * Copyright 1997 through 2000 by Marc Aurele La France (TSI @ UQV), tsi@ualberta.ca * @@ -27,11 +27,11 @@ #define ATI_NAME "ATI" #define ATI_DRIVER_NAME "ati" -#define ATI_VERSION_NAME "6.2.2" +#define ATI_VERSION_NAME "6.2.3" #define ATI_VERSION_MAJOR 6 #define ATI_VERSION_MINOR 2 -#define ATI_VERSION_PATCH 2 +#define ATI_VERSION_PATCH 3 #define ATI_VERSION_CURRENT \ ((ATI_VERSION_MAJOR << 20) | (ATI_VERSION_MINOR << 10) | ATI_VERSION_PATCH) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.cpp b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.cpp index 2f5408b34..da732b0bd 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.cpp,v 1.1 2000/11/02 16:55:29 tsi Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.cpp,v 1.3 2000/12/11 20:18:07 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH R128 __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH R128 __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME r128 \- ATI Rage 128 video driver .SH SYNOPSIS @@ -62,6 +62,11 @@ Enables or disables the use of 6 bits per color component when in 8 bpp mode (emulates VGA mode). By default, all 8 bits per color component are used. The default is .B off. +.TP +.BI "Option \*qVideoKey\*q \*q" integer \*q +This overrides the default pixel value for the YUV video overlay key. +The default value is +.B undefined. .SH "SEE ALSO" XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__) .SH AUTHORS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h index aaae5390c..75d3e855c 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h,v 1.6 2000/12/04 19:21:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h,v 1.8 2000/12/08 19:15:33 martin Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -40,8 +40,6 @@ #include "xf86str.h" -#include "xf86_OSproc.h" - /* PCI support */ #include "xf86Pci.h" @@ -110,6 +108,7 @@ typedef struct { CARD32 cap0_trig_cntl; CARD32 cap1_trig_cntl; CARD32 bus_cntl; + CARD32 config_cntl; /* Other registers to save for VT switches */ CARD32 dp_datatype; @@ -381,20 +380,20 @@ extern Bool R128DRIFinishScreenInit(ScreenPtr pScreen); #define R128CCE_START(pScrn, info) \ do { \ - int ret = drmR128StartCCE(info->drmFD); \ - if (ret) { \ + int _ret = drmR128StartCCE(info->drmFD); \ + if (_ret) { \ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, \ - "%s: CCE start %d\n", __FUNCTION__, ret); \ + "%s: CCE start %d\n", __FUNCTION__, _ret); \ } \ info->CCEInUse = TRUE; \ } while (0) #define R128CCE_STOP(pScrn, info) \ do { \ - int ret = drmR128StopCCE(info->drmFD); \ - if (ret) { \ + int _ret = drmR128StopCCE(info->drmFD); \ + if (_ret) { \ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, \ - "%s: CCE stop %d\n", __FUNCTION__, ret); \ + "%s: CCE stop %d\n", __FUNCTION__, _ret); \ } \ info->CCEInUse = FALSE; \ } while (0) @@ -402,10 +401,10 @@ do { \ #define R128CCE_RESET(pScrn, info) \ do { \ if (R128CCE_USE_RING_BUFFER(info->CCEMode)) { \ - int ret = drmR128ResetCCE(info->drmFD); \ - if (ret) { \ + int _ret = drmR128ResetCCE(info->drmFD); \ + if (_ret) { \ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, \ - "%s: CCE reset %d\n", __FUNCTION__, ret); \ + "%s: CCE reset %d\n", __FUNCTION__, _ret); \ } \ } \ info->CCEInUse = FALSE; \ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c index 55b2a24db..d90a3dab8 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v 1.6 2000/12/04 19:21:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v 1.7 2000/12/12 17:17:12 dawes Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -153,6 +153,7 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen) } } break; + case 32: numConfigs = 1; if (R128_USE_ACCUM) numConfigs *= 2; @@ -211,7 +212,7 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen) pConfigs[i].depthSize = 24; pConfigs[i].stencilSize = 8; } else { - pConfigs[i].depthSize = 32; + pConfigs[i].depthSize = 24; pConfigs[i].stencilSize = 0; } pConfigs[i].auxBuffers = 0; @@ -361,6 +362,7 @@ static void R128DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 indx) pbox = pboxSave; nbox = nboxSave; + /* FIXME: this needs to consider depth tiling. */ (*info->accel->SetupForSolidFill)(pScrn, depth, GXcopy, (CARD32)(-1)); for (; nbox; nbox--, pbox++) (*info->accel->SubsequentSolidFillRect)(pScrn, diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c index ada2af0b0..764bac4b8 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c,v 1.8 2000/12/04 19:21:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c,v 1.13 2000/12/08 19:15:33 martin Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -322,6 +322,7 @@ static const char *driSymbols[] = { static const char *vbeSymbols[] = { "VBEInit", "vbeDoEDID", + "vbeFree", NULL }; #endif @@ -536,11 +537,13 @@ static Bool R128GetBIOSParameters(ScrnInfoPtr pScrn) } if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) { info->BIOSAddr = 0x00000000; + xfree(info->VBIOS); + info->VBIOS = NULL; xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Video BIOS not found!\n"); } - if (info->HasPanelRegs) { + if (info->VBIOS && info->HasPanelRegs) { info->FPBIOSstart = 0; /* FIXME: There should be direct access to the start of the FP info @@ -619,9 +622,40 @@ static Bool R128GetPLLParameters(ScrnInfoPtr pScrn) { R128InfoPtr info = R128PTR(pScrn); R128PLLPtr pll = &info->pll; - CARD16 bios_header; - CARD16 pll_info_block; +#if defined(__powerpc__) + /* there is no bios under Linux PowerPC but Open Firmware + does set up the PLL registers properly and we can use + those to calculate xclk and find the reference divider */ + + unsigned x_mpll_ref_fb_div; + unsigned xclk_cntl; + unsigned Nx, M; + unsigned PostDivSet[] = {0, 1, 2, 4, 8, 3, 6, 12}; + + /* Assume REF clock is 2950 (in units of 10khz) */ + /* and that all pllclk must be between 125 Mhz and 250Mhz */ + pll->reference_freq = 2950; + pll->min_pll_freq = 12500; + pll->max_pll_freq = 25000; + + /* need to memory map the io to use INPLL since it + has not been done yet at this point in the startup */ + R128MapMMIO(pScrn); + x_mpll_ref_fb_div = INPLL(pScrn, R128_X_MPLL_REF_FB_DIV); + xclk_cntl = INPLL(pScrn, R128_XCLK_CNTL) & 0x7; + pll->reference_div = + INPLL(pScrn,R128_PPLL_REF_DIV) & R128_PPLL_REF_DIV_MASK; + /* unmap it again */ + R128UnmapMMIO(pScrn); + + Nx = (x_mpll_ref_fb_div & 0x00FF00) >> 8; + M = (x_mpll_ref_fb_div & 0x0000FF); + + pll->xclk = R128Div((2 * Nx * pll->reference_freq), + (M * PostDivSet[xclk_cntl])); + +#else /* !defined(__powerpc__) */ if (!info->VBIOS) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, @@ -636,8 +670,8 @@ static Bool R128GetPLLParameters(ScrnInfoPtr pScrn) pll->max_pll_freq = 25000; pll->xclk = 10300; } else { - bios_header = R128_BIOS16(0x48); - pll_info_block = R128_BIOS16(bios_header + 0x30); + CARD16 bios_header = R128_BIOS16(0x48); + CARD16 pll_info_block = R128_BIOS16(bios_header + 0x30); R128TRACE(("Header at 0x%04x; PLL Information at 0x%04x\n", bios_header, pll_info_block)); @@ -647,6 +681,7 @@ static Bool R128GetPLLParameters(ScrnInfoPtr pScrn) pll->max_pll_freq = R128_BIOS32(pll_info_block + 0x16); pll->xclk = R128_BIOS16(pll_info_block + 0x08); } +#endif /* __powerpc__ */ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PLL parameters: rf=%d rd=%d min=%d max=%d; xclk=%d\n", @@ -978,14 +1013,24 @@ static Bool R128PreInitDDC(ScrnInfoPtr pScrn) if (!xf86LoadSubModule(pScrn, "ddc")) return FALSE; xf86LoaderReqSymLists(ddcSymbols, NULL); + +#if defined(__powerpc__) + /* Int10 is broken on PPC */ + return TRUE; +#else if (xf86LoadSubModule(pScrn, "vbe")) { +#ifdef XFree86LOADER + xf86LoaderReqSymLists(vbeSymbols,NULL); +#endif pVbe = VBEInit(NULL,info->pEnt->index); if (!pVbe) return FALSE; xf86SetDDCproperties(pScrn,xf86PrintEDID(vbeDoEDID(pVbe,NULL))); + vbeFree(pVbe); return TRUE; } else return FALSE; +#endif } /* This is called by R128PreInit to initialize gamma correction. */ @@ -1327,7 +1372,7 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n", info->videoKey); } else { - info->videoKey = 0x1E; + info->videoKey = 0x1E; } if (xf86ReturnOptValBool(R128Options, OPTION_SHOW_CACHE, FALSE)) { @@ -1451,14 +1496,14 @@ static void R128LoadPalette(ScrnInfoPtr pScrn, int numColors, static void R128BlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[i]; + ScreenPtr pScreen = screenInfo.screens[i]; ScrnInfoPtr pScrn = xf86Screens[i]; R128InfoPtr info = R128PTR(pScrn); - + pScreen->BlockHandler = info->BlockHandler; (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); pScreen->BlockHandler = R128BlockHandler; - + if(info->VideoTimerCallback) { (*info->VideoTimerCallback)(pScrn, currentTime.milliseconds); } @@ -1525,19 +1570,12 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86DrvMsg(scrnIndex, X_WARNING, "Acceleration disabled, not initializing the DRI\n"); info->directRenderingEnabled = FALSE; -#if 1 - } else if (info->HasPanelRegs) { - /* FIXME: Disable 3D support for FPs until it is tested */ - xf86DrvMsg(scrnIndex, X_WARNING, - "DRI disabled on Mobility 128 by default\n"); - info->directRenderingEnabled = FALSE; -#endif - } else if (maxy <= pScrn->virtualY * 4) { + } else if (maxy <= pScrn->virtualY * 3) { xf86DrvMsg(scrnIndex, X_WARNING, "Static buffer allocation failed -- " "need at least %d kB video memory\n", (pScrn->displayWidth * pScrn->virtualY * - info->CurrentLayout.pixel_bytes * 4 + 1023) / 1024); + info->CurrentLayout.pixel_bytes * 3 + 1023) / 1024); info->directRenderingEnabled = FALSE; } else { info->directRenderingEnabled = R128DRIScreenInit(pScreen); @@ -1658,19 +1696,22 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) * performance than playing nicely, and you'll get around a full * framebuffer's worth of pixmap cache anyway. */ - if ( info->textureSize < info->FbMapSize / 2 ) { + if ( info->textureSize < (int)info->FbMapSize / 2 ) { info->textureSize = info->FbMapSize - 4 * bufferSize; } - - l = R128MinBits((info->textureSize-1) / R128_NR_TEX_REGIONS); - if (l < R128_LOG_TEX_GRANULARITY) l = R128_LOG_TEX_GRANULARITY; - - /* Round the texture size up to the nearest whole number of - * texture regions. Again, be greedy about this, don't round - * down. - */ - info->log2TexGran = l; - info->textureSize = ((info->textureSize >> l) + 1) << l; + if ( info->textureSize > 0 ) { + l = R128MinBits((info->textureSize-1) / R128_NR_TEX_REGIONS); + if (l < R128_LOG_TEX_GRANULARITY) l = R128_LOG_TEX_GRANULARITY; + + /* Round the texture size up to the nearest whole number of + * texture regions. Again, be greedy about this, don't + * round down. + */ + info->log2TexGran = l; + info->textureSize = ((info->textureSize >> l) + 1) << l; + } else { + info->textureSize = 0; + } total = info->FbMapSize - info->textureSize; scanlines = total / width_bytes; @@ -1683,6 +1724,14 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) info->textureOffset = scanlines * width_bytes; info->textureSize = info->FbMapSize - info->textureOffset; + /* Set a minimum usable local texture heap size. This will fit + * two 256x256x32bpp textures. + */ + if ( info->textureSize < 512 * 1024 ) { + info->textureOffset = 0; + info->textureSize = 0; + } + MemBox.x1 = 0; MemBox.y1 = 0; MemBox.x2 = pScrn->displayWidth; @@ -1935,6 +1984,7 @@ static void R128RestoreCommonRegisters(ScrnInfoPtr pScrn, R128SavePtr restore) OUTREG(R128_CAP0_TRIG_CNTL, restore->cap0_trig_cntl); OUTREG(R128_CAP1_TRIG_CNTL, restore->cap1_trig_cntl); OUTREG(R128_BUS_CNTL, restore->bus_cntl); + OUTREG(R128_CONFIG_CNTL, restore->config_cntl); } /* Write CRTC registers. */ @@ -2114,6 +2164,7 @@ static void R128SaveCommonRegisters(ScrnInfoPtr pScrn, R128SavePtr save) save->cap0_trig_cntl = INREG(R128_CAP0_TRIG_CNTL); save->cap1_trig_cntl = INREG(R128_CAP1_TRIG_CNTL); save->bus_cntl = INREG(R128_BUS_CNTL); + save->config_cntl = INREG(R128_CONFIG_CNTL); } /* Read CRTC registers. */ @@ -2381,6 +2432,17 @@ static Bool R128InitCrtcRegisters(ScrnInfoPtr pScrn, R128SavePtr save, R128TRACE(("Pitch = %d bytes (virtualX = %d, displayWidth = %d)\n", save->crtc_pitch, pScrn->virtualX, info->CurrentLayout.displayWidth)); + +#if X_BYTE_ORDER == X_BIG_ENDIAN + /* Change the endianness of the aperture */ + switch (info->CurrentLayout.pixel_code) { + case 15: + case 16: save->config_cntl |= APER_0_BIG_ENDIAN_16BPP_SWAP; break; + case 32: save->config_cntl |= APER_0_BIG_ENDIAN_32BPP_SWAP; break; + default: break; + } +#endif + return TRUE; } @@ -2886,7 +2948,7 @@ static Bool R128CloseScreen(int scrnIndex, ScreenPtr pScreen) if (info->DGAModes) xfree(info->DGAModes); info->DGAModes = NULL; - + if (info->adaptor) { xfree(info->adaptor->pPortPrivates[0].ptr); xf86XVFreeVideoAdaptorRec(info->adaptor); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c index ab11ae374..23a618bd1 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c,v 1.5 2000/12/02 15:30:33 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c,v 1.6 2000/12/13 02:45:00 tsi Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -170,6 +170,25 @@ R128Probe(DriverPtr drv, int flags) } xf86LoaderReqSymLists(R128Symbols, NULL); + + /* Workaround for possible loader bug */ +# define R128PreInit \ + (xf86PreInitProc*) LoaderSymbol("R128PreInit") +# define R128ScreenInit \ + (xf86ScreenInitProc*) LoaderSymbol("R128ScreenInit") +# define R128SwitchMode \ + (xf86SwitchModeProc*) LoaderSymbol("R128SwitchMode") +# define R128AdjustFrame \ + (xf86AdjustFrameProc*)LoaderSymbol("R128AdjustFrame") +# define R128EnterVT \ + (xf86EnterVTProc*) LoaderSymbol("R128EnterVT") +# define R128LeaveVT \ + (xf86LeaveVTProc*) LoaderSymbol("R128LeaveVT") +# define R128FreeScreen \ + (xf86FreeScreenProc*) LoaderSymbol("R128FreeScreen") +# define R128ValidMode \ + (xf86ValidModeProc*) LoaderSymbol("R128ValidMode") + #endif pScrn->driverVersion = R128_VERSION_CURRENT; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h index 436c3d93b..16ab358b2 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h,v 1.4 2000/12/04 19:21:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h,v 1.6 2000/12/12 17:17:13 dawes Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -288,6 +288,8 @@ #define R128_CONFIG_APER_SIZE 0x0108 #define R128_CONFIG_BONDS 0x00e8 #define R128_CONFIG_CNTL 0x00e0 +# define APER_0_BIG_ENDIAN_16BPP_SWAP (1 << 0) +# define APER_0_BIG_ENDIAN_32BPP_SWAP (2 << 0) #define R128_CONFIG_MEMSIZE 0x00f8 #define R128_CONFIG_MEMSIZE_EMBEDDED 0x0114 #define R128_CONFIG_REG_1_BASE 0x010c @@ -1092,8 +1094,8 @@ # define R128_SET_UP_CONTINUE (1 << 31) #define R128_WINDOW_XY_OFFSET 0x1bcc -# define R128_WINDOW_Y_SHIFT 2 -# define R128_WINDOW_X_SHIFT 18 +# define R128_WINDOW_Y_SHIFT 4 +# define R128_WINDOW_X_SHIFT 20 #define R128_Z_OFFSET_C 0x1c90 #define R128_Z_PITCH_C 0x1c94 diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h index 1dbc5088a..350262d61 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h,v 1.4 2000/12/04 19:21:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_sarea.h,v 1.5 2000/12/15 22:48:43 dawes Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -107,47 +107,47 @@ typedef struct { /* Context state - can be written in one large chunk */ - unsigned long dst_pitch_offset_c; - unsigned long dp_gui_master_cntl_c; - unsigned long sc_top_left_c; - unsigned long sc_bottom_right_c; - unsigned long z_offset_c; - unsigned long z_pitch_c; - unsigned long z_sten_cntl_c; - unsigned long tex_cntl_c; - unsigned long misc_3d_state_cntl_reg; - unsigned long texture_clr_cmp_clr_c; - unsigned long texture_clr_cmp_msk_c; - unsigned long fog_color_c; + unsigned int dst_pitch_offset_c; + unsigned int dp_gui_master_cntl_c; + unsigned int sc_top_left_c; + unsigned int sc_bottom_right_c; + unsigned int z_offset_c; + unsigned int z_pitch_c; + unsigned int z_sten_cntl_c; + unsigned int tex_cntl_c; + unsigned int misc_3d_state_cntl_reg; + unsigned int texture_clr_cmp_clr_c; + unsigned int texture_clr_cmp_msk_c; + unsigned int fog_color_c; /* Texture state */ - unsigned long tex_size_pitch_c; - unsigned long constant_color_c; + unsigned int tex_size_pitch_c; + unsigned int constant_color_c; /* Setup state */ - unsigned long pm4_vc_fpu_setup; - unsigned long setup_cntl; + unsigned int pm4_vc_fpu_setup; + unsigned int setup_cntl; /* Mask state */ - unsigned long dp_write_mask; - unsigned long sten_ref_mask_c; - unsigned long plane_3d_mask_c; + unsigned int dp_write_mask; + unsigned int sten_ref_mask_c; + unsigned int plane_3d_mask_c; /* Window state */ - unsigned long window_xy_offset; + unsigned int window_xy_offset; /* Core state */ - unsigned long scale_3d_cntl; + unsigned int scale_3d_cntl; } r128_context_regs_t; /* Setup registers for each texture unit */ typedef struct { - unsigned long tex_cntl; - unsigned long tex_combine_cntl; - unsigned long tex_size_pitch; - unsigned long tex_offset[R128_TEX_MAXLEVELS]; - unsigned long tex_border_color; + unsigned int tex_cntl; + unsigned int tex_combine_cntl; + unsigned int tex_size_pitch; + unsigned int tex_offset[R128_TEX_MAXLEVELS]; + unsigned int tex_border_color; } r128_texture_regs_t; typedef struct { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c index 76a3cc758..16a446bc7 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c,v 1.11 2000/12/03 23:41:57 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_video.c,v 1.14 2000/12/07 20:42:52 mvojkovi Exp $ */ #include "r128.h" #include "r128_reg.h" @@ -18,7 +18,6 @@ #define TIMER_MASK (OFF_TIMER | FREE_TIMER) - #ifndef XvExtension void R128InitVideo(ScreenPtr pScreen) {} #else @@ -272,8 +271,8 @@ RegionsEqual(RegionPtr A, RegionPtr B) Takes the dst box in standard X BoxRec form (top and left edges inclusive, bottom and right exclusive). The new dst - box is returned. The source boundaries are given (x1, y1 - inclusive, x2, y2 exclusive) and returned are the new source + box is returned. The source boundaries are given (xa, ya + inclusive, xb, yb exclusive) and returned are the new source boundaries in 16.16 fixed point. */ @@ -282,10 +281,10 @@ RegionsEqual(RegionPtr A, RegionPtr B) static Bool R128ClipVideo( BoxPtr dst, - INT32 *x1, - INT32 *x2, - INT32 *y1, - INT32 *y2, + INT32 *xa, + INT32 *xb, + INT32 *ya, + INT32 *yb, RegionPtr reg, INT32 width, INT32 height @@ -294,58 +293,58 @@ R128ClipVideo( BoxPtr extents = REGION_EXTENTS(DummyScreen, reg); int diff; - hscale = ((*x2 - *x1) << 16) / (dst->x2 - dst->x1); - vscale = ((*y2 - *y1) << 16) / (dst->y2 - dst->y1); + hscale = ((*xb - *xa) << 16) / (dst->x2 - dst->x1); + vscale = ((*yb - *ya) << 16) / (dst->y2 - dst->y1); - *x1 <<= 16; *x2 <<= 16; - *y1 <<= 16; *y2 <<= 16; + *xa <<= 16; *xb <<= 16; + *ya <<= 16; *yb <<= 16; diff = extents->x1 - dst->x1; if(diff > 0) { dst->x1 = extents->x1; - *x1 += diff * hscale; + *xa += diff * hscale; } diff = dst->x2 - extents->x2; if(diff > 0) { dst->x2 = extents->x2; - *x2 -= diff * hscale; + *xb -= diff * hscale; } diff = extents->y1 - dst->y1; if(diff > 0) { dst->y1 = extents->y1; - *y1 += diff * vscale; + *ya += diff * vscale; } diff = dst->y2 - extents->y2; if(diff > 0) { dst->y2 = extents->y2; - *y2 -= diff * vscale; + *yb -= diff * vscale; } - if(*x1 < 0) { - diff = (- *x1 + hscale - 1)/ hscale; + if(*xa < 0) { + diff = (- *xa + hscale - 1)/ hscale; dst->x1 += diff; - *x1 += diff * hscale; + *xa += diff * hscale; } - delta = *x2 - (width << 16); + delta = *xb - (width << 16); if(delta > 0) { diff = (delta + hscale - 1)/ hscale; dst->x2 -= diff; - *x2 -= diff * hscale; + *xb -= diff * hscale; } - if(*x1 >= *x2) return FALSE; + if(*xa >= *xb) return FALSE; - if(*y1 < 0) { - diff = (- *y1 + vscale - 1)/ vscale; + if(*ya < 0) { + diff = (- *ya + vscale - 1)/ vscale; dst->y1 += diff; - *y1 += diff * vscale; + *ya += diff * vscale; } - delta = *y2 - (height << 16); + delta = *yb - (height << 16); if(delta > 0) { diff = (delta + vscale - 1)/ vscale; dst->y2 -= diff; - *y2 -= diff * vscale; + *yb -= diff * vscale; } - if(*y1 >= *y2) return FALSE; + if(*ya >= *yb) return FALSE; if((dst->x1 != extents->x1) || (dst->x2 != extents->x2) || (dst->y1 != extents->y1) || (dst->y2 != extents->y2)) @@ -495,18 +494,31 @@ R128CopyMungedData( int h, int w ){ - CARD32 *dst = (CARD32*)dst1; + CARD32 *dst; + CARD8 *s1, *s2, *s3; int i, j; - dstPitch >>= 2; w >>= 1; for(j = 0; j < h; j++) { - for(i = 0; i < w; i++) { - dst[i] = src1[i << 1] | (src1[(i << 1) + 1] << 16) | - (src3[i] << 8) | (src2[i] << 24); + dst = (CARD32*)dst1; + s1 = src1; s2 = src2; s3 = src3; + i = w; + while(i > 4) { + dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24); + dst[1] = s1[2] | (s1[3] << 16) | (s3[1] << 8) | (s2[1] << 24); + dst[2] = s1[4] | (s1[5] << 16) | (s3[2] << 8) | (s2[2] << 24); + dst[3] = s1[6] | (s1[7] << 16) | (s3[3] << 8) | (s2[3] << 24); + dst += 4; s2 += 4; s3 += 4; s1 += 8; + i -= 4; } - dst += dstPitch; + while(i--) { + dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24); + dst++; s2++; s3++; + s1 += 2; + } + + dst1 += dstPitch; src1 += srcPitch; if(j & 1) { src2 += srcPitch2; @@ -537,20 +549,20 @@ R128AllocateMemory( pScreen = screenInfo.screens[pScrn->scrnIndex]; - new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8, + new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16, NULL, NULL, NULL); if(!new_linear) { int max_size; - xf86QueryLargestOffscreenLinear(pScreen, &max_size, 8, + xf86QueryLargestOffscreenLinear(pScreen, &max_size, 16, PRIORITY_EXTREME); if(max_size < size) return NULL; xf86PurgeUnlockedOffscreenAreas(pScreen); - new_linear = xf86AllocateOffscreenLinear(pScreen, size, 8, + new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16, NULL, NULL, NULL); } @@ -644,31 +656,45 @@ R128PutImage( ){ R128InfoPtr info = R128PTR(pScrn); R128PortPrivPtr pPriv = (R128PortPrivPtr)data; - INT32 x1, x2, y1, y2; + INT32 xa, xb, ya, yb; unsigned char *dst_start; - int pitch, new_size, offset, offset2 = 0, offset3 = 0; - int srcPitch, srcPitch2 = 0, dstPitch; + int pitch, new_size, offset, s2offset, s3offset; + int srcPitch, srcPitch2, dstPitch; int top, left, npixels, nlines, bpp; BoxRec dstBox; CARD32 tmp; + /* + * s2offset, s3offset - byte offsets into U and V plane of the + * source where copying starts. Y plane is + * done by editing "buf". + * + * offset - byte offset to the first line of the destination. + * + * dst_start - byte address to the first displayed pel. + * + */ + + /* make the compiler happy */ + s2offset = s3offset = srcPitch2 = 0; + if(src_w > (drw_w << 4)) drw_w = src_w >> 4; if(src_h > (drw_h << 4)) drw_h = src_h >> 4; /* Clip */ - x1 = src_x; - x2 = src_x + src_w; - y1 = src_y; - y2 = src_y + src_h; + xa = src_x; + xb = src_x + src_w; + ya = src_y; + yb = src_y + src_h; dstBox.x1 = drw_x; dstBox.x2 = drw_x + drw_w; dstBox.y1 = drw_y; dstBox.y2 = drw_y + drw_h; - if(!R128ClipVideo(&dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height)) + if(!R128ClipVideo(&dstBox, &xa, &xb, &ya, &yb, clipBoxes, width, height)) return Success; dstBox.x1 -= pScrn->frameX0; @@ -679,20 +705,21 @@ R128PutImage( bpp = pScrn->bitsPerPixel >> 3; pitch = bpp * pScrn->displayWidth; - dstPitch = ((width << 1) + 15) & ~15; - new_size = ((dstPitch * height) + bpp - 1) / bpp; - switch(id) { case FOURCC_YV12: case FOURCC_I420: + dstPitch = ((width << 1) + 15) & ~15; + new_size = ((dstPitch * height) + bpp - 1) / bpp; srcPitch = (width + 3) & ~3; - offset2 = srcPitch * height; + s2offset = srcPitch * height; srcPitch2 = ((width >> 1) + 3) & ~3; - offset3 = (srcPitch2 * (height >> 1)) + offset2; + s3offset = (srcPitch2 * (height >> 1)) + s2offset; break; case FOURCC_UYVY: case FOURCC_YUY2: default: + dstPitch = ((width << 1) + 15) & ~15; + new_size = ((dstPitch * height) + bpp - 1) / bpp; srcPitch = (width << 1); break; } @@ -706,38 +733,40 @@ R128PutImage( pPriv->currentBuffer ^= 1; /* copy data */ - top = y1 >> 16; - left = (x1 >> 16) & ~1; - npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left; - left <<= 1; + top = ya >> 16; + left = (xa >> 16) & ~1; + npixels = ((((xb + 0xffff) >> 16) + 1) & ~1) - left; - offset = pPriv->linear->offset * bpp; + offset = (pPriv->linear->offset * bpp) + (top * dstPitch); if(pPriv->doubleBuffer) offset += pPriv->currentBuffer * new_size * bpp; - dst_start = info->FB + offset + left + (top * dstPitch); + dst_start = info->FB + offset; switch(id) { case FOURCC_YV12: case FOURCC_I420: top &= ~1; - tmp = ((top >> 1) * srcPitch2) + (left >> 2); - offset2 += tmp; - offset3 += tmp; + dst_start += left << 1; + tmp = ((top >> 1) * srcPitch2) + (left >> 1); + s2offset += tmp; + s3offset += tmp; if(id == FOURCC_I420) { - tmp = offset2; - offset2 = offset3; - offset3 = tmp; + tmp = s2offset; + s2offset = s3offset; + s3offset = tmp; } - nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top; - R128CopyMungedData(buf + (top * srcPitch) + (left >> 1), - buf + offset2, buf + offset3, dst_start, - srcPitch, srcPitch2, dstPitch, nlines, npixels); + nlines = ((((yb + 0xffff) >> 16) + 1) & ~1) - top; + R128CopyMungedData(buf + (top * srcPitch) + left, buf + s2offset, + buf + s3offset, dst_start, srcPitch, srcPitch2, + dstPitch, nlines, npixels); break; case FOURCC_UYVY: case FOURCC_YUY2: default: + left <<= 1; buf += (top * srcPitch) + left; - nlines = ((y2 + 0xffff) >> 16) - top; + nlines = ((yb + 0xffff) >> 16) - top; + dst_start += left; R128CopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels); break; } @@ -752,9 +781,8 @@ R128PutImage( REGION_RECTS(clipBoxes)); } - offset += top * dstPitch; R128DisplayVideo(pScrn, id, offset, width, height, dstPitch, - x1, x2, y1, &dstBox, src_w, src_h, drw_w, drw_h); + xa, xb, ya, &dstBox, src_w, src_h, drw_w, drw_h); pPriv->videoStatus = CLIENT_VIDEO_ON; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h index 10451e9b0..5d710570a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v 1.5 2000/12/01 08:56:03 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v 1.8 2000/12/08 14:41:16 alanh Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -40,8 +40,6 @@ #include "xf86str.h" -#include "xf86_OSproc.h" - /* PCI support */ #include "xf86Pci.h" @@ -228,6 +226,8 @@ typedef struct { RADEONSaveRec ModeReg; /* Current mode */ Bool (*CloseScreen)(int, ScreenPtr); + void (*BlockHandler)(int, pointer, pointer, pointer); + Bool PaletteSavedOnVT; /* Palette saved on last VT switch */ XAAInfoRecPtr accel; @@ -345,6 +345,9 @@ typedef struct { int log2TexGran; #endif XF86VideoAdaptorPtr adaptor; + void (*VideoTimerCallback)(ScrnInfoPtr, Time); + int videoKey; + Bool showCache; } RADEONInfoRec, *RADEONInfoPtr; #define RADEONWaitForFifo(pScrn, entries) \ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c index c9297bbf9..448587094 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v 1.7 2000/11/18 19:37:12 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v 1.8 2000/12/08 14:40:01 alanh Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -87,6 +87,7 @@ /* colormap initialization */ #include "micmap.h" +#include "dixstruct.h" /* X and server generic header files */ #include "xf86.h" @@ -1441,6 +1442,22 @@ static void RADEONLoadPalette(ScrnInfoPtr pScrn, int numColors, } } +static void +RADEONBlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) +{ + ScreenPtr pScreen = screenInfo.screens[i]; + ScrnInfoPtr pScrn = xf86Screens[i]; + RADEONInfoPtr info = RADEONPTR(pScrn); + + pScreen->BlockHandler = info->BlockHandler; + (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + pScreen->BlockHandler = RADEONBlockHandler; + + if(info->VideoTimerCallback) { + (*info->VideoTimerCallback)(pScrn, currentTime.milliseconds); + } +} + /* Called at the start of each server generation. */ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { @@ -1835,6 +1852,9 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } #endif + info->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = RADEONBlockHandler; + return TRUE; } @@ -2912,6 +2932,7 @@ static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen) pScrn->vtSema = FALSE; + pScreen->BlockHandler = info->BlockHandler; pScreen->CloseScreen = info->CloseScreen; return (*pScreen->CloseScreen)(scrnIndex, pScreen); } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c index 4f1b91deb..e37dbe066 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c,v 1.4 2000/12/02 15:30:34 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c,v 1.5 2000/12/13 02:45:00 tsi Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -157,6 +157,25 @@ RADEONProbe(DriverPtr drv, int flags) } xf86LoaderReqSymLists(RADEONSymbols, NULL); + + /* Workaround for possible loader bug */ +# define RADEONPreInit \ + (xf86PreInitProc*) LoaderSymbol("RADEONPreInit") +# define RADEONScreenInit \ + (xf86ScreenInitProc*) LoaderSymbol("RADEONScreenInit") +# define RADEONSwitchMode \ + (xf86SwitchModeProc*) LoaderSymbol("RADEONSwitchMode") +# define RADEONAdjustFrame \ + (xf86AdjustFrameProc*)LoaderSymbol("RADEONAdjustFrame") +# define RADEONEnterVT \ + (xf86EnterVTProc*) LoaderSymbol("RADEONEnterVT") +# define RADEONLeaveVT \ + (xf86LeaveVTProc*) LoaderSymbol("RADEONLeaveVT") +# define RADEONFreeScreen \ + (xf86FreeScreenProc*) LoaderSymbol("RADEONFreeScreen") +# define RADEONValidMode \ + (xf86ValidModeProc*) LoaderSymbol("RADEONValidMode") + #endif pScrn->driverVersion = RADEON_VERSION_CURRENT; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c index f0d6337d5..873726ede 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c @@ -1,56 +1,10 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c,v 1.5 2000/11/21 23:10:35 tsi Exp $ */ -/* - * Copyright 2000 Stuart R. Anderson and Metro Link, Inc. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation on - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * ATI, PRECISION INSIGHT AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * Authors: - * Stuart R. Anderson <anderson@metrolink.com> - * - * Credits: - * - * This code is derived primarily from the GATOS Project run by Stea Greene. - * The initial version of this code was done by Vladimir Dergacheb. - * - * This code was simplified from the GATOS code primarily because I didn't - * have the right hardware handy to test anything beyond simple overlays, - * and because I wanted to complete it in a short time frame that I had - * available. - * - * My apologies to Vladimir as there is more good work in his code that - * should be brought forward. - * - * RADEON ALERT ! - * Alan Hourihane <ahourihane@valinux.com> - * This is an extremely quick port to the Radeon, it hasn't been tested - * thoroughly, although it appears to work. - */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_video.c,v 1.8 2000/12/13 12:58:19 tsi Exp $ */ #include "radeon.h" #include "radeon_reg.h" #include "xf86.h" +#include "dixstruct.h" #include "Xv.h" #include "fourcc.h" @@ -67,59 +21,54 @@ #ifndef XvExtension void RADEONInitVideo(ScreenPtr pScreen) {} #else -static XF86VideoAdaptorPtr RADEONSetupImageVideo(ScreenPtr); -static int RADEONSetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer); -static int RADEONGetPortAttribute(ScrnInfoPtr, Atom ,INT32 *, pointer); +static XF86VideoAdaptorPtr RADEONSetupImageVideo(ScreenPtr); +static int RADEONSetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer); +static int RADEONGetPortAttribute(ScrnInfoPtr, Atom ,INT32 *, pointer); static void RADEONStopVideo(ScrnInfoPtr, pointer, Bool); -static void RADEONQueryBestSize(ScrnInfoPtr, Bool, - short, short, short, short, unsigned int *, unsigned int *, pointer); -static int RADEONPutImage( ScrnInfoPtr, - short, short, short, short, short, short, short, short, - int, unsigned char*, short, short, Bool, RegionPtr, pointer); -static int RADEONQueryImageAttributes(ScrnInfoPtr, - int, unsigned short *, unsigned short *, int *, int *); +static void RADEONQueryBestSize(ScrnInfoPtr, Bool, short, short, short, short, + unsigned int *, unsigned int *, pointer); +static int RADEONPutImage(ScrnInfoPtr, short, short, short, short, short, + short, short, short, int, unsigned char*, short, + short, Bool, RegionPtr, pointer); +static int RADEONQueryImageAttributes(ScrnInfoPtr, int, unsigned short *, + unsigned short *, int *, int *); + + +static void RADEONResetVideo(ScrnInfoPtr); + +static void RADEONVideoTimerCallback(ScrnInfoPtr pScrn, Time time); + #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) -#define IMAGE_MAX_WIDTH 2048 -#define IMAGE_MAX_HEIGHT 2048 -#define Y_BUF_SIZE (IMAGE_MAX_WIDTH * IMAGE_MAX_HEIGHT) +static Atom xvBrightness, xvColorKey, xvSaturation, xvDoubleBuffer; -static Atom xvColorKey; typedef struct { - int videoStatus; - unsigned char brightness; - unsigned char contrast; - - RegionRec clip; - CARD32 colorKey; - CARD8 overlay_pixel_size; - CARD8 current_buffer; - int overlay_pad; - CARD32 overlay_id; - CARD32 overlay_width; - - CARD32 scale_cntl; - CARD32 video_format; - FBLinearPtr linear; - } RADEONPortPrivRec, *RADEONPortPrivPtr; + int brightness; + int saturation; + Bool doubleBuffer; + unsigned char currentBuffer; + FBLinearPtr linear; + RegionRec clip; + CARD32 colorKey; + CARD32 videoStatus; + Time offTime; + Time freeTime; +} RADEONPortPrivRec, *RADEONPortPrivPtr; + void RADEONInitVideo(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + RADEONInfoPtr info = RADEONPTR(pScrn); XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; XF86VideoAdaptorPtr newAdaptor = NULL; int num_adaptors; - RADEONTRACE(("RADEONInitVideo called\n")); - - /* Determine if the card supports this */ - if (pScrn->bitsPerPixel != 8) - { + if(info->accel && info->accel->FillSolidRects) newAdaptor = RADEONSetupImageVideo(pScreen); - } num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); @@ -148,39 +97,43 @@ void RADEONInitVideo(ScreenPtr pScreen) } /* client libraries expect an encoding */ -static XF86VideoEncodingRec DummyEncoding[1] = +static XF86VideoEncodingRec DummyEncoding = { - { 0, "XV_IMAGE", - IMAGE_MAX_WIDTH, IMAGE_MAX_HEIGHT, + 2048, 2048, {1, 1} - } }; -#define NUM_FORMATS 3 +#define NUM_FORMATS 12 static XF86VideoFormatRec Formats[NUM_FORMATS] = { - {15, TrueColor}, - {16, TrueColor}, - {32, TrueColor} + {8, TrueColor}, {8, DirectColor}, {8, PseudoColor}, + {8, GrayScale}, {8, StaticGray}, {8, StaticColor}, + {15, TrueColor}, {16, TrueColor}, {24, TrueColor}, + {15, DirectColor}, {16, DirectColor}, {24, DirectColor} }; -#define NUM_ATTRIBUTES 1 + +#define NUM_ATTRIBUTES 4 static XF86AttributeRec Attributes[NUM_ATTRIBUTES] = { - {XvSettable | XvGettable, 0, (1<<24)-1, "XV_COLORKEY"}, + {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"}, + {XvSettable | XvGettable, -64, 63, "XV_BRIGHTNESS"}, + {XvSettable | XvGettable, 0, 31, "XV_SATURATION"}, + {XvSettable | XvGettable, 0, 1, "XV_DOUBLE_BUFFER"} }; -#define NUM_IMAGES 3 +#define NUM_IMAGES 4 static XF86ImageRec Images[NUM_IMAGES] = { XVIMAGE_YUY2, + XVIMAGE_UYVY, XVIMAGE_YV12, - XVIMAGE_UYVY + XVIMAGE_I420 }; static void @@ -190,52 +143,53 @@ RADEONResetVideo(ScrnInfoPtr pScrn) unsigned char *RADEONMMIO = info->MMIO; RADEONPortPrivPtr pPriv = info->adaptor->pPortPrivates[0].ptr; - RADEONTRACE(("RADEONResetVideo called\n")); - /* Initialize some of the HW here */ - OUTREG(RADEON_OV0_EXCLUSIVE_HORZ,0); /* disable exclusive mode */ - OUTREG(RADEON_OV0_VIDEO_KEY_MSK,0xffff); + OUTREG(RADEON_OV0_SCALE_CNTL, 0x80000000); + OUTREG(RADEON_OV0_EXCLUSIVE_HORZ, 0); + OUTREG(RADEON_OV0_AUTO_FLIP_CNTL, 0); /* maybe */ + OUTREG(RADEON_OV0_FILTER_CNTL, 0x0000000f); + OUTREG(RADEON_OV0_COLOUR_CNTL, (pPriv->brightness & 0x7f) | + (pPriv->saturation << 8) | + (pPriv->saturation << 16)); + OUTREG(RADEON_OV0_GRAPHICS_KEY_MSK, (1 << pScrn->depth) - 1); + OUTREG(RADEON_OV0_GRAPHICS_KEY_CLR, pPriv->colorKey); OUTREG(RADEON_OV0_KEY_CNTL, RADEON_GRAPHIC_KEY_FN_NE); - OUTREG(RADEON_OV0_GRAPHICS_KEY_CLR,pPriv->colorKey); - /* Only using one buffer for now - OUTREG(RADEON_OV0_AUTO_FLIP_CNTL,pAPriv->Port[0].auto_flip_cntl); - */ - switch(pScrn->depth){ - case 8: - OUTREG(RADEON_OV0_GRAPHICS_KEY_MSK,0xff); - break; - case 15: - OUTREG(RADEON_OV0_GRAPHICS_KEY_MSK,0x7fff); - break; - case 16: - OUTREG(RADEON_OV0_GRAPHICS_KEY_MSK,0xffff); - break; - case 24: - OUTREG(RADEON_OV0_GRAPHICS_KEY_MSK,0xffffff); - break; - case 32: - OUTREG(RADEON_OV0_GRAPHICS_KEY_MSK,0xffffffff); - break; + OUTREG(RADEON_OV0_TEST, 0); +} + + +static XF86VideoAdaptorPtr +RADEONAllocAdaptor(ScrnInfoPtr pScrn) +{ + XF86VideoAdaptorPtr adapt; + RADEONInfoPtr info = RADEONPTR(pScrn); + RADEONPortPrivPtr pPriv; + + if(!(adapt = xf86XVAllocateVideoAdaptorRec(pScrn))) + return NULL; + + if(!(pPriv = xcalloc(1, sizeof(RADEONPortPrivRec) + sizeof(DevUnion)))) + { + xfree(adapt); + return NULL; } - OUTREG(RADEON_OV0_REG_LOAD_CNTL,0x0); - OUTREG(RADEON_OV0_DEINTERLACE_PATTERN,0xAAAAA); - OUTREG(RADEON_OV0_P1_V_ACCUM_INIT,(2<<20)|1); - OUTREG(RADEON_OV0_P23_V_ACCUM_INIT,(2<<20)|1); - OUTREG(RADEON_OV0_P1_H_ACCUM_INIT,(3<<28)); - OUTREG(RADEON_OV0_P23_H_ACCUM_INIT,(2<<28)); - OUTREG(RADEON_OV0_STEP_BY,1|(1<<8)); - OUTREG(RADEON_OV0_FILTER_CNTL,0xf); /* use hardcoded coeff's */ - OUTREG(RADEON_OV0_FILTER_CNTL,0x0); /* use programmable coeff's */ - OUTREG(RADEON_OV0_FOUR_TAP_COEF_0 , 0x00002000); - OUTREG(RADEON_OV0_FOUR_TAP_COEF_1 , 0x0D06200D); - OUTREG(RADEON_OV0_FOUR_TAP_COEF_2 , 0x0D0A1C0D); - OUTREG(RADEON_OV0_FOUR_TAP_COEF_3 , 0x0C0E1A0C); - OUTREG(RADEON_OV0_FOUR_TAP_COEF_4 , 0x0C14140C); - OUTREG(RADEON_OV0_COLOUR_CNTL,(1<<12)|(1<<20)); - OUTREG(RADEON_OV0_TEST,0); - OUTREG(RADEON_OV0_SCALE_CNTL,pPriv->scale_cntl|pPriv->video_format); - OUTREG(RADEON_CAP0_TRIG_CNTL,0); + adapt->pPortPrivates = (DevUnion*)(&pPriv[1]); + adapt->pPortPrivates[0].ptr = (pointer)pPriv; + + xvBrightness = MAKE_ATOM("XV_BRIGHTNESS"); + xvSaturation = MAKE_ATOM("XV_SATURATION"); + xvColorKey = MAKE_ATOM("XV_COLORKEY"); + xvDoubleBuffer = MAKE_ATOM("XV_DOUBLE_BUFFER"); + + pPriv->colorKey = info->videoKey; + pPriv->doubleBuffer = TRUE; + pPriv->videoStatus = 0; + pPriv->brightness = 0; + pPriv->saturation = 16; + pPriv->currentBuffer = 0; + + return adapt; } static XF86VideoAdaptorPtr @@ -243,32 +197,23 @@ RADEONSetupImageVideo(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; RADEONInfoPtr info = RADEONPTR(pScrn); - XF86VideoAdaptorPtr adapt; RADEONPortPrivPtr pPriv; + XF86VideoAdaptorPtr adapt; - RADEONTRACE(("RADEONSetupImageVideo called\n")); - - if(!(adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) + - sizeof(RADEONPortPrivRec) + - sizeof(DevUnion)))) + if(!(adapt = RADEONAllocAdaptor(pScrn))) return NULL; adapt->type = XvWindowMask | XvInputMask | XvImageMask; adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; - adapt->name = "RADEON Video Overlay"; + adapt->name = "ATI Rage128 Video Overlay"; adapt->nEncodings = 1; - adapt->pEncodings = DummyEncoding; + adapt->pEncodings = &DummyEncoding; adapt->nFormats = NUM_FORMATS; adapt->pFormats = Formats; adapt->nPorts = 1; - adapt->pPortPrivates = (DevUnion*)(&adapt[1]); - - pPriv = (RADEONPortPrivPtr)(&adapt->pPortPrivates[1]); - - adapt->pPortPrivates[0].ptr = (pointer)(pPriv); + adapt->nAttributes = NUM_ATTRIBUTES; adapt->pAttributes = Attributes; adapt->nImages = NUM_IMAGES; - adapt->nAttributes = NUM_ATTRIBUTES; adapt->pImages = Images; adapt->PutVideo = NULL; adapt->PutStill = NULL; @@ -281,24 +226,17 @@ RADEONSetupImageVideo(ScreenPtr pScreen) adapt->PutImage = RADEONPutImage; adapt->QueryImageAttributes = RADEONQueryImageAttributes; - /* gotta uninit this someplace */ - REGION_INIT(pScreen, &pPriv->clip, NullBox, 0); - info->adaptor = adapt; - pPriv->colorKey = 0x01; /* a touch of blue */ - pPriv->video_format = RADEON_SCALER_SOURCE_VYUY422; - pPriv->scale_cntl = RADEON_SCALER_PRG_LOAD_START|RADEON_SCALER_DOUBLE_BUFFER; - pPriv->scale_cntl|= RADEON_SCALER_SMART_SWITCH|RADEON_SCALER_PIX_EXPAND; - pPriv->scale_cntl|= RADEON_SCALER_SMART_SWITCH; - - xvColorKey = MAKE_ATOM("XV_COLORKEY"); + pPriv = (RADEONPortPrivPtr)(adapt->pPortPrivates[0].ptr); + REGION_INIT(pScreen, &(pPriv->clip), NullBox, 0); RADEONResetVideo(pScrn); return adapt; } +/* I really should stick this in miregion */ static Bool RegionsEqual(RegionPtr A, RegionPtr B) { @@ -328,28 +266,119 @@ RegionsEqual(RegionPtr A, RegionPtr B) return TRUE; } + +/* RADEONClipVideo - + + Takes the dst box in standard X BoxRec form (top and left + edges inclusive, bottom and right exclusive). The new dst + box is returned. The source boundaries are given (xa, ya + inclusive, xb, yb exclusive) and returned are the new source + boundaries in 16.16 fixed point. +*/ + +#define DummyScreen screenInfo.screens[0] + +static Bool +RADEONClipVideo( + BoxPtr dst, + INT32 *xa, + INT32 *xb, + INT32 *ya, + INT32 *yb, + RegionPtr reg, + INT32 width, + INT32 height +){ + INT32 vscale, hscale, delta; + BoxPtr extents = REGION_EXTENTS(DummyScreen, reg); + int diff; + + hscale = ((*xb - *xa) << 16) / (dst->x2 - dst->x1); + vscale = ((*yb - *ya) << 16) / (dst->y2 - dst->y1); + + *xa <<= 16; *xb <<= 16; + *ya <<= 16; *yb <<= 16; + + diff = extents->x1 - dst->x1; + if(diff > 0) { + dst->x1 = extents->x1; + *xa += diff * hscale; + } + diff = dst->x2 - extents->x2; + if(diff > 0) { + dst->x2 = extents->x2; + *xb -= diff * hscale; + } + diff = extents->y1 - dst->y1; + if(diff > 0) { + dst->y1 = extents->y1; + *ya += diff * vscale; + } + diff = dst->y2 - extents->y2; + if(diff > 0) { + dst->y2 = extents->y2; + *yb -= diff * vscale; + } + + if(*xa < 0) { + diff = (- *xa + hscale - 1)/ hscale; + dst->x1 += diff; + *xa += diff * hscale; + } + delta = *xb - (width << 16); + if(delta > 0) { + diff = (delta + hscale - 1)/ hscale; + dst->x2 -= diff; + *xb -= diff * hscale; + } + if(*xa >= *xb) return FALSE; + + if(*ya < 0) { + diff = (- *ya + vscale - 1)/ vscale; + dst->y1 += diff; + *ya += diff * vscale; + } + delta = *yb - (height << 16); + if(delta > 0) { + diff = (delta + vscale - 1)/ vscale; + dst->y2 -= diff; + *yb -= diff * vscale; + } + if(*ya >= *yb) return FALSE; + + if((dst->x1 != extents->x1) || (dst->x2 != extents->x2) || + (dst->y1 != extents->y1) || (dst->y2 != extents->y2)) + { + RegionRec clipReg; + REGION_INIT(DummyScreen, &clipReg, dst, 1); + REGION_INTERSECT(DummyScreen, reg, reg, &clipReg); + REGION_UNINIT(DummyScreen, &clipReg); + } + return TRUE; +} + static void -RADEONStopVideo(ScrnInfoPtr pScrn, pointer data, Bool Exit) +RADEONStopVideo(ScrnInfoPtr pScrn, pointer data, Bool cleanup) { - RADEONInfoPtr info = RADEONPTR(pScrn); - unsigned char *RADEONMMIO = info->MMIO; - RADEONPortPrivPtr pPriv = (RADEONPortPrivPtr) data; - - RADEONTRACE(("RADEONStopVideo called\n")); + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char *RADEONMMIO = info->MMIO; + RADEONPortPrivPtr pPriv = (RADEONPortPrivPtr)data; - REGION_EMPTY(pScrn->pScreen, &pPriv->clip); + REGION_EMPTY(pScrn->pScreen, &pPriv->clip); - if (Exit) { - if(pPriv->videoStatus & CLIENT_VIDEO_ON) { - OUTREG(RADEON_OV0_SCALE_CNTL,pPriv->scale_cntl|pPriv->video_format); - } - if(pPriv->linear) { - xf86FreeOffscreenLinear(pPriv->linear); - pPriv->linear = NULL; - } + if(cleanup) { + if(pPriv->videoStatus & CLIENT_VIDEO_ON) { + OUTREG(RADEON_OV0_SCALE_CNTL, 0); + } + if(pPriv->linear) { + xf86FreeOffscreenLinear(pPriv->linear); + pPriv->linear = NULL; + } pPriv->videoStatus = 0; } else { if(pPriv->videoStatus & CLIENT_VIDEO_ON) { + pPriv->videoStatus |= OFF_TIMER; + pPriv->offTime = currentTime.milliseconds + OFF_DELAY; } } } @@ -360,22 +389,40 @@ RADEONSetPortAttribute( Atom attribute, INT32 value, pointer data -) -{ - RADEONInfoPtr info = RADEONPTR(pScrn); - unsigned char *RADEONMMIO = info->MMIO; - RADEONPortPrivPtr pPriv = (RADEONPortPrivPtr) data; - - RADEONTRACE(("RADEONSetPortAttribute called\n")); - - if (attribute == xvColorKey) { +){ + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char *RADEONMMIO = info->MMIO; + RADEONPortPrivPtr pPriv = (RADEONPortPrivPtr)data; + + if(attribute == xvBrightness) { + if((value < -64) || (value > 63)) + return BadValue; + pPriv->brightness = value; + OUTREG(RADEON_OV0_COLOUR_CNTL, (pPriv->brightness & 0x7f) | + (pPriv->saturation << 8) | + (pPriv->saturation << 16)); + } else + if(attribute == xvSaturation) { + if((value < 0) || (value > 31)) + return BadValue; + pPriv->saturation = value; + OUTREG(RADEON_OV0_COLOUR_CNTL, (pPriv->brightness & 0x7f) | + (pPriv->saturation << 8) | + (pPriv->saturation << 16)); + } else + if(attribute == xvDoubleBuffer) { + if((value < 0) || (value > 1)) + return BadValue; + pPriv->doubleBuffer = value; + } else + if(attribute == xvColorKey) { pPriv->colorKey = value; - OUTREG(RADEON_OV0_GRAPHICS_KEY_CLR,pPriv->colorKey); - RADEONTRACE(("Setting ColorKey to %d\n", pPriv->colorKey)); - return Success; - } + OUTREG(RADEON_OV0_GRAPHICS_KEY_CLR, pPriv->colorKey); - return Success; + REGION_EMPTY(pScrn->pScreen, &pPriv->clip); + } else return BadMatch; + + return Success; } static int @@ -384,21 +431,26 @@ RADEONGetPortAttribute( Atom attribute, INT32 *value, pointer data -) -{ - RADEONPortPrivPtr pPriv = (RADEONPortPrivPtr) data; - - RADEONTRACE(("RADEONGetPortAttribute called\n")); - - if (attribute == xvColorKey) { - RADEONTRACE(("Getting ColorKey %d\n", pPriv->colorKey)); +){ + RADEONPortPrivPtr pPriv = (RADEONPortPrivPtr)data; + + if(attribute == xvBrightness) { + *value = pPriv->brightness; + } else + if(attribute == xvSaturation) { + *value = pPriv->saturation; + } else + if(attribute == xvDoubleBuffer) { + *value = pPriv->doubleBuffer ? 1 : 0; + } else + if(attribute == xvColorKey) { *value = pPriv->colorKey; - return Success; - } + } else return BadMatch; - return Success; + return Success; } + static void RADEONQueryBestSize( ScrnInfoPtr pScrn, @@ -407,80 +459,11 @@ RADEONQueryBestSize( short drw_w, short drw_h, unsigned int *p_w, unsigned int *p_h, pointer data -) -{ - RADEONTRACE(("RADEONQueryBestSize called\n")); +){ *p_w = drw_w; *p_h = drw_h; } -static void -RADEONDisplayVideo( - ScrnInfoPtr pScrn, - short width, short height, - int xa, int ya, int xb, int yb, - short src_w, short src_h, - short drw_w, short drw_h, - int fboffset -) -{ - RADEONInfoPtr info = RADEONPTR(pScrn); - unsigned char *RADEONMMIO = info->MMIO; - RADEONPortPrivPtr pPriv = info->adaptor->pPortPrivates[0].ptr; - int step_by, vert_inc, horz_inc; - - RADEONTRACE(("RADEONDisplayVideo called\n")); - - /* calculate step_by factor */ - step_by=src_w/(drw_w*2); - switch(step_by){ - case 0: - OUTREG(RADEON_OV0_STEP_BY,0x101); - step_by=1; - break; - case 1: - OUTREG(RADEON_OV0_STEP_BY,0x202); - step_by=2; - break; - case 2: - case 3: - OUTREG(RADEON_OV0_STEP_BY,0x303); - step_by=4; - break; - default: - OUTREG(RADEON_OV0_STEP_BY,0x404); - step_by=8; - break; - } - - vert_inc=(src_h<<12)/(drw_h); - horz_inc=(src_w<<12)/(drw_w*step_by); - - OUTREG(RADEON_OV0_Y_X_START,((xa))|(ya<<16)|(1<<31)); - OUTREG(RADEON_OV0_Y_X_END,((xb))|((yb)<<16)); - OUTREG(RADEON_OV0_H_INC,(horz_inc)|((horz_inc<<15))); - OUTREG(RADEON_OV0_V_INC,(vert_inc<<8)); - OUTREG(RADEON_OV0_P1_BLANK_LINES_AT_TOP,0xfff|((src_h-1)<<16)); - OUTREG(RADEON_OV0_P23_BLANK_LINES_AT_TOP,0xfff|((src_h-1)<<16)); - OUTREG(RADEON_OV0_VID_BUF_PITCH0_VALUE,width<<1); - OUTREG(RADEON_OV0_VID_BUF_PITCH1_VALUE,width<<1); - OUTREG(RADEON_OV0_P1_X_START_END,(src_w-1)|((xa&0xf)<<16)); - OUTREG(RADEON_OV0_P2_X_START_END,(src_w-1)|((xa&0xf)<<16)); - OUTREG(RADEON_OV0_P3_X_START_END,(src_w-1)|((xa&0xf)<<16)); - - OUTREG(RADEON_OV0_VID_BUF0_BASE_ADRS,(fboffset)&(~0xf)); - OUTREG(RADEON_OV0_VID_BUF1_BASE_ADRS,(fboffset)&(~0xf)); - OUTREG(RADEON_OV0_VID_BUF2_BASE_ADRS,(fboffset)&(~0xf)); - -#if 0 - /* Enable this when double buffering is implemented */ - OUTREG(RADEON_OV0_VID_BUF3_BASE_ADRS,(fboffset2)&(~0xf)); - OUTREG(RADEON_OV0_VID_BUF4_BASE_ADRS,(fboffset2)&(~0xf)); - OUTREG(RADEON_OV0_VID_BUF5_BASE_ADRS,(fboffset2)&(~0xf)); -#endif - - OUTREG(RADEON_OV0_SCALE_CNTL,pPriv->scale_cntl|RADEON_SCALER_ENABLE|pPriv->video_format); -} static void RADEONCopyData( @@ -490,8 +473,7 @@ RADEONCopyData( int dstPitch, int h, int w - ) -{ +){ w <<= 1; while(h--) { memcpy(dst, src, w); @@ -511,20 +493,32 @@ RADEONCopyMungedData( int dstPitch, int h, int w - ) -{ - CARD32 *dst = (CARD32*)dst1; +){ + CARD32 *dst; + CARD8 *s1, *s2, *s3; int i, j; - dstPitch >>= 2; w >>= 1; for(j = 0; j < h; j++) { - for(i = 0; i < w; i++) { - dst[i] = src1[i << 1] | (src1[(i << 1) + 1] << 16) | - (src3[i] << 8) | (src2[i] << 24); + dst = (CARD32*)dst1; + s1 = src1; s2 = src2; s3 = src3; + i = w; + while(i > 4) { + dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24); + dst[1] = s1[2] | (s1[3] << 16) | (s3[1] << 8) | (s2[1] << 24); + dst[2] = s1[4] | (s1[5] << 16) | (s3[2] << 8) | (s2[2] << 24); + dst[3] = s1[6] | (s1[7] << 16) | (s3[3] << 8) | (s2[3] << 24); + dst += 4; s2 += 4; s3 += 4; s1 += 8; + i -= 4; } - dst += dstPitch; + while(i--) { + dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24); + dst++; s2++; s3++; + s1 += 2; + } + + dst1 += dstPitch; src1 += srcPitch; if(j & 1) { src2 += srcPitch2; @@ -533,18 +527,16 @@ RADEONCopyMungedData( } } + static FBLinearPtr RADEONAllocateMemory( - ScrnInfoPtr pScrn, - FBLinearPtr linear, - int size -) -{ + ScrnInfoPtr pScrn, + FBLinearPtr linear, + int size +){ ScreenPtr pScreen; FBLinearPtr new_linear; - RADEONTRACE(("RADEONAllocateMemory(%x,%d) called\n",linear,size)); - if(linear) { if(linear->size >= size) return linear; @@ -557,27 +549,99 @@ RADEONAllocateMemory( pScreen = screenInfo.screens[pScrn->scrnIndex]; - new_linear = xf86AllocateOffscreenLinear(pScreen, size, 4, - NULL, NULL, NULL); + new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16, + NULL, NULL, NULL); if(!new_linear) { int max_size; - xf86QueryLargestOffscreenLinear(pScreen, &max_size, 4, - PRIORITY_EXTREME); + xf86QueryLargestOffscreenLinear(pScreen, &max_size, 16, + PRIORITY_EXTREME); - if(max_size < size) return NULL; + if(max_size < size) + return NULL; xf86PurgeUnlockedOffscreenAreas(pScreen); - new_linear = xf86AllocateOffscreenLinear(pScreen, size, 4, - NULL, NULL, NULL); + new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16, + NULL, NULL, NULL); } - RADEONTRACE(("returning %x(%x)\n",new_linear,new_linear->offset)); - return new_linear; } +static void +RADEONDisplayVideo( + ScrnInfoPtr pScrn, + int id, + int offset, + short width, short height, + int pitch, + int left, int right, int top, + BoxPtr dstBox, + short src_w, short src_h, + short drw_w, short drw_h +){ + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char *RADEONMMIO = info->MMIO; + int v_inc, h_inc, step_by, tmp; + int p1_h_accum_init, p23_h_accum_init; + int p1_v_accum_init; + + v_inc = (src_h << 20) / drw_h; + h_inc = (src_w << 12) / drw_w; + step_by = 1; + + while(h_inc >= (2 << 12)) { + step_by++; + h_inc >>= 1; + } + + /* keep everything in 16.16 */ + + offset += ((left >> 16) & ~7) << 1; + + tmp = (left & 0x0003ffff) + 0x00028000 + (h_inc << 3); + p1_h_accum_init = ((tmp << 4) & 0x000f8000) | + ((tmp << 12) & 0xf0000000); + + tmp = ((left >> 1) & 0x0001ffff) + 0x00028000 + (h_inc << 2); + p23_h_accum_init = ((tmp << 4) & 0x000f8000) | + ((tmp << 12) & 0x70000000); + + tmp = (top & 0x0000ffff) + 0x00018000; + p1_v_accum_init = ((tmp << 4) & 0x03ff8000) | 0x00000001; + + left = (left >> 16) & 7; + + + OUTREG(RADEON_OV0_REG_LOAD_CNTL, 1); + while(!(INREG(RADEON_OV0_REG_LOAD_CNTL) & (1 << 3))); + + OUTREG(RADEON_OV0_H_INC, h_inc | ((h_inc >> 1) << 16)); + OUTREG(RADEON_OV0_STEP_BY, step_by | (step_by << 8)); + OUTREG(RADEON_OV0_Y_X_START, (dstBox->x1 + 8) | (dstBox->y1 << 16)); + OUTREG(RADEON_OV0_Y_X_END, (dstBox->x2 + 8) | (dstBox->y2 << 16)); + OUTREG(RADEON_OV0_V_INC, v_inc); + OUTREG(RADEON_OV0_P1_BLANK_LINES_AT_TOP, 0x00000fff | ((src_h - 1) << 16)); + OUTREG(RADEON_OV0_VID_BUF_PITCH0_VALUE, pitch); + OUTREG(RADEON_OV0_P1_X_START_END, (src_w + left - 1) | (left << 16)); + left >>= 1; src_w >>= 1; + OUTREG(RADEON_OV0_P2_X_START_END, (src_w + left - 1) | (left << 16)); + OUTREG(RADEON_OV0_P3_X_START_END, (src_w + left - 1) | (left << 16)); + OUTREG(RADEON_OV0_VID_BUF0_BASE_ADRS, offset & 0xfffffff0); + OUTREG(RADEON_OV0_P1_V_ACCUM_INIT, p1_v_accum_init); + OUTREG(RADEON_OV0_P1_H_ACCUM_INIT, p1_h_accum_init); + OUTREG(RADEON_OV0_P23_H_ACCUM_INIT, p23_h_accum_init); + + if(id == FOURCC_UYVY) + OUTREG(RADEON_OV0_SCALE_CNTL, 0x41008C03); + else + OUTREG(RADEON_OV0_SCALE_CNTL, 0x41008B03); + + OUTREG(RADEON_OV0_REG_LOAD_CNTL, 0); +} + + static int RADEONPutImage( ScrnInfoPtr pScrn, @@ -589,174 +653,163 @@ RADEONPutImage( short width, short height, Bool Sync, RegionPtr clipBoxes, pointer data -) -{ - RADEONInfoPtr info = RADEONPTR(pScrn); - unsigned char *RADEONMMIO = info->MMIO; - RADEONPortPrivPtr pPriv = (RADEONPortPrivPtr)data; - INT32 xa, xb, ya, yb; - INT32 d_x,d_y,d_width,d_height; - int srcPitch = 0, srcPitch2 = 0; - int dstPitch = 0; - int offset,offset2 = 0,offset3 = 0,fboffset; - int top, left, npixels, nlines, size; - CARD32 video_format; +){ + RADEONInfoPtr info = RADEONPTR(pScrn); + RADEONPortPrivPtr pPriv = (RADEONPortPrivPtr)data; + INT32 xa, xb, ya, yb; + unsigned char *dst_start; + int pitch, new_size, offset, s2offset, s3offset; + int srcPitch, srcPitch2, dstPitch; + int top, left, npixels, nlines, bpp; + BoxRec dstBox; + CARD32 tmp; + + /* + * s2offset, s3offset - byte offsets into U and V plane of the + * source where copying starts. Y plane is + * done by editing "buf". + * + * offset - byte offset to the first line of the destination. + * + * dst_start - byte address to the first displayed pel. + * + */ - RADEONTRACE(("RADEONPutImage called\n")); + /* make the compiler happy */ + s2offset = s3offset = srcPitch2 = 0; - switch(id) { - case FOURCC_YV12: - case FOURCC_UYVY: - video_format=RADEON_SCALER_SOURCE_VYUY422; - break; - case FOURCC_YUY2: - video_format=RADEON_SCALER_SOURCE_YVYU422; - break; - default: - return BadValue; - } + if(src_w > (drw_w << 4)) + drw_w = src_w >> 4; + if(src_h > (drw_h << 4)) + drw_h = src_h >> 4; /* Clip */ - d_x=drw_x; - d_y=drw_y; - d_width=drw_w; - d_height=drw_h; - if(drw_x<0){ - drw_w+=drw_x; - drw_x=0; - } - if(drw_y<0){ - drw_h+=drw_y; - drw_y=0; - } - if(drw_x+drw_w>pScrn->pScreen->width){ - drw_w=pScrn->pScreen->width-drw_x; - } - if(drw_y+drw_h>pScrn->pScreen->height){ - drw_h=pScrn->pScreen->height-drw_y; - } - if((drw_w<=0)||(drw_h<=0)){ - /* this should not happen, - since we are outside of visible screen, - but just in case */ - return Success; - } + xa = src_x; + xb = src_x + src_w; + ya = src_y; + yb = src_y + src_h; - xa = src_x; - xb = src_x + src_w; - ya = src_y; - yb = src_y + src_h; + dstBox.x1 = drw_x; + dstBox.x2 = drw_x + drw_w; + dstBox.y1 = drw_y; + dstBox.y2 = drw_y + drw_h; - dstPitch = width*info->CurrentLayout.pixel_bytes; - srcPitch=width; + if(!RADEONClipVideo(&dstBox, &xa, &xb, &ya, &yb, clipBoxes, width, height)) + return Success; - switch(id) { - case FOURCC_YV12: - size = width * height * 2; /* 16bpp */ - break; - case FOURCC_UYVY: - case FOURCC_YUY2: - default: - size = width * height * 1.5; - break; - } + dstBox.x1 -= pScrn->frameX0; + dstBox.x2 -= pScrn->frameX0; + dstBox.y1 -= pScrn->frameY0; + dstBox.y2 -= pScrn->frameY0; + + bpp = pScrn->bitsPerPixel >> 3; + pitch = bpp * pScrn->displayWidth; - if(!(pPriv->linear = RADEONAllocateMemory(pScrn, pPriv->linear,size))) + switch(id) { + case FOURCC_YV12: + case FOURCC_I420: + dstPitch = ((width << 1) + 15) & ~15; + new_size = ((dstPitch * height) + bpp - 1) / bpp; + srcPitch = (width + 3) & ~3; + s2offset = srcPitch * height; + srcPitch2 = ((width >> 1) + 3) & ~3; + s3offset = (srcPitch2 * (height >> 1)) + s2offset; + break; + case FOURCC_UYVY: + case FOURCC_YUY2: + default: + dstPitch = ((width << 1) + 15) & ~15; + new_size = ((dstPitch * height) + bpp - 1) / bpp; + srcPitch = (width << 1); + break; + } + + if(!(pPriv->linear = RADEONAllocateMemory(pScrn, pPriv->linear, + pPriv->doubleBuffer ? (new_size << 1) : new_size))) + { return BadAlloc; + } + + pPriv->currentBuffer ^= 1; /* copy data */ - top = ya >> 16; - left = (xa >> 16) & ~1; - npixels = ((((xb + 0xffff) >> 16) + 1) & ~1) - left; + top = ya >> 16; + left = (xa >> 16) & ~1; + npixels = ((((xb + 0xffff) >> 16) + 1) & ~1) - left; - switch(id) { + offset = (pPriv->linear->offset * bpp) + (top * dstPitch); + if(pPriv->doubleBuffer) + offset += pPriv->currentBuffer * new_size * bpp; + dst_start = info->FB + offset; + + switch(id) { case FOURCC_YV12: - srcPitch = (width + 3) & ~3; - offset2 = srcPitch * height; - srcPitch2 = ((width >> 1) + 3) & ~3; - offset3 = (srcPitch2 * (height >> 1)) + offset2; + case FOURCC_I420: + top &= ~1; + dst_start += left << 1; + tmp = ((top >> 1) * srcPitch2) + (left >> 1); + s2offset += tmp; + s3offset += tmp; + if(id == FOURCC_I420) { + tmp = s2offset; + s2offset = s3offset; + s3offset = tmp; + } nlines = ((((yb + 0xffff) >> 16) + 1) & ~1) - top; + RADEONCopyMungedData(buf + (top * srcPitch) + left, buf + s2offset, + buf + s3offset, dst_start, srcPitch, srcPitch2, + dstPitch, nlines, npixels); break; case FOURCC_UYVY: case FOURCC_YUY2: default: + left <<= 1; buf += (top * srcPitch) + left; nlines = ((yb + 0xffff) >> 16) - top; - srcPitch = (width << 1); + dst_start += left; + RADEONCopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels); break; } - nlines=src_h; - npixels=src_w; - if(npixels>width) npixels=width; - if(nlines>height) nlines=height; - - /* adjust source rectangle */ - src_x+=((drw_x-d_x)*src_w)/d_width; - src_y+=((drw_y-d_y)*src_h)/d_height; - src_w=(src_w * drw_w)/d_width; - src_h=(src_h * drw_h)/d_height; - - offset=(src_x+src_y*width)*info->CurrentLayout.pixel_bytes; - fboffset=pPriv->linear->offset*info->CurrentLayout.pixel_bytes; - - if(!(INREG(RADEON_CRTC_STATUS)&2)){ - xf86DrvMsg(pScrn->scrnIndex,X_INFO,"too fast"); - return Success; - } - - RADEONDisplayVideo(pScrn, width, height, - drw_x, drw_y, drw_x+drw_w, drw_y+drw_h, - src_w, src_h, drw_w, drw_h, fboffset); /* update cliplist */ if(!RegionsEqual(&pPriv->clip, clipBoxes)) { REGION_COPY(pScreen, &pPriv->clip, clipBoxes); /* draw these */ - (*info->accel->FillSolidRects)(pScrn, pPriv->colorKey, - GXcopy, (CARD32)(~0), + (*info->accel->FillSolidRects)(pScrn, pPriv->colorKey, GXcopy, ~0, REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes)); } - - switch(id) { - case FOURCC_YV12: - RADEONCopyMungedData(buf + (top * srcPitch) + (left >> 1), - buf + offset2, buf + offset3, info->FB+fboffset, - srcPitch, srcPitch2, dstPitch, nlines, npixels); - break; - case FOURCC_UYVY: - case FOURCC_YUY2: - default: - RADEONCopyData(buf,info->FB+fboffset,srcPitch,dstPitch, - nlines,npixels); - break; - } + RADEONDisplayVideo(pScrn, id, offset, width, height, dstPitch, + xa, xb, ya, &dstBox, src_w, src_h, drw_w, drw_h); pPriv->videoStatus = CLIENT_VIDEO_ON; + + info->VideoTimerCallback = RADEONVideoTimerCallback; + return Success; } + static int RADEONQueryImageAttributes( - ScrnInfoPtr pScrn, - int id, - unsigned short *w, unsigned short *h, - int *pitches, int *offsets -) -{ + ScrnInfoPtr pScrn, + int id, + unsigned short *w, unsigned short *h, + int *pitches, int *offsets +){ int size, tmp; - RADEONTRACE(("RADEONQueryImageAtrributes called\n")); - if(*w > IMAGE_MAX_WIDTH) *w = IMAGE_MAX_WIDTH; - if(*h > IMAGE_MAX_HEIGHT) *h = IMAGE_MAX_HEIGHT; + if(*w > 2048) *w = 2048; + if(*h > 2048) *h = 2048; *w = (*w + 1) & ~1; if(offsets) offsets[0] = 0; switch(id) { case FOURCC_YV12: + case FOURCC_I420: *h = (*h + 1) & ~1; size = (*w + 3) & ~3; if(pitches) pitches[0] = size; @@ -780,4 +833,34 @@ RADEONQueryImageAttributes( return size; } -#endif + +static void +RADEONVideoTimerCallback(ScrnInfoPtr pScrn, Time time) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + RADEONPortPrivPtr pPriv = info->adaptor->pPortPrivates[0].ptr; + + if(pPriv->videoStatus & TIMER_MASK) { + if(pPriv->videoStatus & OFF_TIMER) { + if(pPriv->offTime < time) { + unsigned char *RADEONMMIO = info->MMIO; + OUTREG(RADEON_OV0_SCALE_CNTL, 0); + pPriv->videoStatus = FREE_TIMER; + pPriv->freeTime = time + FREE_DELAY; + } + } else { /* FREE_TIMER */ + if(pPriv->freeTime < time) { + if(pPriv->linear) { + xf86FreeOffscreenLinear(pPriv->linear); + pPriv->linear = NULL; + } + pPriv->videoStatus = 0; + info->VideoTimerCallback = NULL; + } + } + } else /* shouldn't get here */ + info->VideoTimerCallback = NULL; +} + + +#endif /* !XvExtension */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.cpp b/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.cpp index 142a546e8..281ea82f6 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/chips.cpp,v 1.7 2000/06/14 02:13:08 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/chips.cpp,v 1.9 2000/12/12 18:54:30 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH CHIPS __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH CHIPS __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME chips \- Chips and Technologies video driver .SH SYNOPSIS @@ -112,7 +112,7 @@ Disables linear addressing in cases where it is enabled by default. Default: off .TP .BI "Option \*qLinear\*q \*q" boolean \*q -Enables linear addressing in cases where it isdisabled by default. +Enables linear addressing in cases where it is disabled by default. Default: off .TP .BI "Option \*qHWCursor\*q \*q" boolean \*q @@ -160,7 +160,7 @@ flat panel at a specified depth Force the use of memory mapped IO where it can be used. Default: off .TP .BI "Option \*qSuspendHack\*q \*q" boolean \*q -Force driver to leave centering and stretching resgisters alone. This +Force driver to leave centering and stretching registers alone. This can fix some laptop suspend/resume problems. Default: off .TP .BI "Option \*qOverlay\*q" diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BltHiQV.h b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BltHiQV.h index 860a3d074..b02026443 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BltHiQV.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BltHiQV.h @@ -4,7 +4,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BltHiQV.h,v 1.9 2000/09/19 12:46:14 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_BltHiQV.h,v 1.10 2000/12/06 15:35:12 eich Exp $ */ /* Definitions for the Chips and Technology BitBLT engine communication. */ /* These are done using Memory Mapped IO, of the registers */ @@ -71,14 +71,20 @@ {int timeout; \ timeout = 0; \ for (;;) { \ - if (!(cPtr->readXR(cPtr,0x20) & 0x1)) break; \ + if (cPtr->Chipset >= CHIPS_CT69000) { \ + if (!(MMIO_IN32(cPtr->MMIOBase,BR(0x4))&(1<<31)))\ + break; \ + } else { \ + if (!(cPtr->readXR(cPtr,0x20) & 0x1)) break; \ + } \ timeout++; \ if (timeout == 100000) { \ unsigned char tmp; \ ErrorF("timeout\n"); \ tmp = cPtr->readXR(cPtr, 0x20); \ cPtr->writeXR(cPtr, 0x20, ((tmp & 0xFD) | 0x2)); \ - cPtr->writeXR(cPtr, 0x20, (tmp & 0xFD)); \ + xf86UDelay(10000); \ + cPtr->writeXR(cPtr, 0x20, (tmp & 0xFD)); \ break; \ } \ } \ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_dga.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_dga.c index 942b78251..563035e4e 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_dga.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_dga.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_dga.c,v 1.1 1999/08/14 10:49:38 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_dga.c,v 1.2 2000/12/06 15:35:12 eich Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -83,6 +83,8 @@ CHIPSDGAInit(ScreenPtr pScreen) int Bpp = pScrn->bitsPerPixel >> 3; int num = 0; Bool oneMore; + int imlines = (pScrn->videoRam * 1024) / + (pScrn->displayWidth * (pScrn->bitsPerPixel >> 3)); pMode = firstMode = pScrn->modes; @@ -133,7 +135,7 @@ SECOND_PASS: if(oneMore) { /* first one is narrow width */ currentMode->bytesPerScanline = ((pMode->HDisplay * Bpp) + 3) & ~3L; currentMode->imageWidth = pMode->HDisplay; - currentMode->imageHeight = pMode->VDisplay; + currentMode->imageHeight = imlines; currentMode->pixmapWidth = currentMode->imageWidth; currentMode->pixmapHeight = currentMode->imageHeight; currentMode->maxViewportX = currentMode->imageWidth - @@ -147,7 +149,7 @@ SECOND_PASS: currentMode->bytesPerScanline = ((pScrn->displayWidth * Bpp) + 3) & ~3L; currentMode->imageWidth = pScrn->displayWidth; - currentMode->imageHeight = pMode->VDisplay; + currentMode->imageHeight = imlines; currentMode->pixmapWidth = currentMode->imageWidth; currentMode->pixmapHeight = currentMode->imageHeight; currentMode->maxViewportX = currentMode->imageWidth - @@ -187,17 +189,18 @@ CHIPS_SetMode( CHIPSPtr cPtr = CHIPSPTR(pScrn); - if(!pMode) { /* restore the original mode */ + if (!pMode) { /* restore the original mode */ /* put the ScreenParameters back */ - - pScrn->displayWidth = OldDisplayWidth[index]; - - CHIPSSwitchMode(index, pScrn->currentMode, 0); - cPtr->DGAactive = FALSE; + if (cPtr->DGAactive) { + pScrn->displayWidth = OldDisplayWidth[index]; + pScrn->EnterVT(pScrn->scrnIndex,0); + + cPtr->DGAactive = FALSE; + } } else { if(!cPtr->DGAactive) { /* save the old parameters */ OldDisplayWidth[index] = pScrn->displayWidth; - + pScrn->LeaveVT(pScrn->scrnIndex,0); cPtr->DGAactive = TRUE; } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c index 775910b94..b0992ef50 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c,v 1.102 2000/12/02 15:30:34 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c,v 1.103 2000/12/06 15:35:12 eich Exp $ */ /* * Copyright 1993 by Jon Block <block@frc.com> @@ -542,6 +542,7 @@ typedef enum { OPTION_LCD_STRETCH, OPTION_LCD_CENTER, OPTION_MMIO, + OPTION_FULL_MMIO, OPTION_SUSPEND_HACK, OPTION_RGB_BITS, OPTION_SYNC_ON_GREEN, @@ -613,6 +614,7 @@ static OptionInfoRec ChipsHiQVOptions[] = { { OPTION_LCD_STRETCH, "NoStretch", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_LCD_CENTER, "LcdCenter", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_MMIO, "MMIO", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_FULL_MMIO, "FullMMIO", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SUSPEND_HACK, "SuspendHack", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_PANEL_SIZE, "FixPanelSize", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_RGB_BITS, "RGBbits", OPTV_INTEGER, {0}, FALSE }, @@ -1426,9 +1428,6 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) "Enabling linear addressing\n"); xf86DrvMsg(pScrn->scrnIndex, from, "base address is set at 0x%X.\n", cPtr->FbAddress); - cPtr->UseMMIO = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Using MMIO\n"); cPtr->IOAddress = cPtr->FbAddress + 0x400000L; } else xf86DrvMsg(pScrn->scrnIndex, from, @@ -1539,35 +1538,41 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) else cPtr->Flags &= ~ChipsHWCursor; - /* Are we using MMIO mapping of VGA registers */ - if (xf86ReturnOptValBool(cPtr->Options, OPTION_MMIO, FALSE)) { - if ((cPtr->Flags & ChipsLinearSupport) && cPtr->UseMMIO && - (cPtr->Flags & ChipsFullMMIOSupport) && - cPtr->pEnt->location.type == BUS_PCI) { - - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Enabling MMIO\n"); - cPtr->UseFullMMIO = TRUE; - - /* - * We need to map the framebuffer to read/write regs. - * but can't do that without the FbMapSize. So need to - * fake value for PreInit. This isn't a problem as framebuffer - * isn't actually used in PreInit - */ - cPtr->FbMapSize = 1024 * 1024; - - /* Map the linear framebuffer */ - if (!chipsMapMem(pScrn)) - return FALSE; - - /* Setup the MMIO register functions */ - if (cPtr->MMIOBaseVGA) { - CHIPSSetMmioExtFuncs(cPtr); - CHIPSHWSetMmioFuncs(pScrn, cPtr->MMIOBaseVGA, 0x0); + if (xf86ReturnOptValBool(cPtr->Options, OPTION_MMIO, TRUE)) { + cPtr->UseMMIO = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Using MMIO\n"); + + /* Are we using MMIO mapping of VGA registers */ + if (xf86ReturnOptValBool(cPtr->Options, OPTION_FULL_MMIO, FALSE)) { + if ((cPtr->Flags & ChipsLinearSupport) + && (cPtr->Flags & ChipsFullMMIOSupport) + && (cPtr->pEnt->location.type == BUS_PCI)) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Enabling Full MMIO\n"); + cPtr->UseFullMMIO = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Using Full MMIO\n"); + + /* Map the linear framebuffer */ + if (!chipsMapMem(pScrn)) + return FALSE; + + /* Setup the MMIO register functions */ + if (cPtr->MMIOBaseVGA) { + CHIPSSetMmioExtFuncs(cPtr); + CHIPSHWSetMmioFuncs(pScrn, cPtr->MMIOBaseVGA, 0x0); + } + } else { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "FULL_MMIO option ignored\n"); } - } else { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MMIO option ignored\n"); } + } else { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,"Disabling MMIO: " + "no acceleration, no hw_cursor\n"); + cPtr->UseMMIO = FALSE; + cPtr->Accel.UseHWCursor = FALSE; + cPtr->Flags &= ~ChipsAccelSupport; } /* memory size */ @@ -3330,10 +3335,12 @@ CHIPSEnterVT(int scrnIndex, int flags) if ((!(cPtr->Flags & ChipsOverlay8plus16)) && (cPtr->Flags & ChipsVideoSupport)) CHIPSResetVideo(pScrn); + xf86UDelay(50000); chipsHWCursorOn(cPtr); /* cursor settle delay */ - usleep(50000); + xf86UDelay(50000); CHIPSAdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + xf86UDelay(50000); return TRUE; } @@ -3515,7 +3522,6 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; } - ErrorF("bla\n"); miSetPixmapDepths (); /* @@ -3594,7 +3600,7 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86SetBlackWhitePixels(pScreen); - if ((cPtr->Flags & ChipsAccelSupport) && (pScrn->depth >= 8)) + if ( (pScrn->depth >= 8)) CHIPSDGAInit(pScreen); cPtr->HWCursorShown = FALSE; @@ -6315,18 +6321,19 @@ chipsMapMem(ScrnInfoPtr pScrn) if (cPtr->MMIOBase == NULL) return FALSE; } - - if (cPtr->Bus == ChipsPCI) - cPtr->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - cPtr->PciTag, (unsigned long)cPtr->FbAddress, - cPtr->FbMapSize); - else - cPtr->FbBase = xf86MapVidMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, - (unsigned long)cPtr->FbAddress, cPtr->FbMapSize); + if (cPtr->FbMapSize) { + if (cPtr->Bus == ChipsPCI) + cPtr->FbBase = xf86MapPciMem(pScrn->scrnIndex,VIDMEM_FRAMEBUFFER, + cPtr->PciTag, (unsigned long)cPtr->FbAddress, + cPtr->FbMapSize); + else + cPtr->FbBase = xf86MapVidMem(pScrn->scrnIndex,VIDMEM_FRAMEBUFFER, + (unsigned long)cPtr->FbAddress, + cPtr->FbMapSize); - if (cPtr->FbBase == NULL) - return FALSE; - + if (cPtr->FbBase == NULL) + return FALSE; + } if (cPtr->Flags & ChipsFullMMIOSupport) cPtr->MMIOBaseVGA = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO,cPtr->PciTag, diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/Imakefile index c2ace11eb..256c7fd77 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/Imakefile,v 1.29 2000/10/11 16:18:53 mvojkovi Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/Imakefile,v 1.30 2000/12/06 15:35:14 eich Exp $ XCOMM XCOMM This is an Imakefile for the Cirrus Logic driver. XCOMM @@ -22,7 +22,7 @@ INCLUDES = -I. -I../../include INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(XF86SRC)/xf4bpp -I$(XF86SRC)/xf1bpp \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa \ + -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ -I$(XF86SRC)/ramdac -I$(XF86SRC)/i2c \ -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ddc \ @@ -30,7 +30,7 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(FONTINCSRC) -I$(SERVERSRC)/include \ -I$(XINCLUDESRC) -I$(EXTINCSRC) \ -I$(XF86OSSRC)/int10 -I$(XF86SRC)/shadowfb \ - -I$(SERVERSRC)/render + -I$(SERVERSRC)/render -I$(XF86OSSRC)/vbe #endif #if MakeHasPosixVariableSubstitutions diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h index 280f417a8..ca26b8fe9 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h @@ -1,10 +1,14 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h,v 1.3 2000/09/22 11:12:32 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h,v 1.4 2000/12/06 15:35:15 eich Exp $ */ /* (c) Itai Nahshon */ #ifndef ALP_H #define ALP_H +extern ScrnInfoPtr AlpProbe(int entity); +extern OptionInfoPtr AlpAvailableOptions(int chipid); + +# ifdef _ALP_PRIVATE_ /* Saved registers that are not part of the core VGA */ /* CRTC >= 0x19; Sequencer >= 0x05; Graphics >= 0x09; Attribute >= 0x15 */ @@ -69,5 +73,6 @@ typedef struct alpRec { CARD32 sr0f, sr17; } AlpRec, *AlpPtr; +# endif /* _ALP_PRIVATE_ */ #endif /* ALP_H */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c index fe055b55e..1eec31b39 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c @@ -11,7 +11,7 @@ * Guy DESBIEF */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c,v 1.15 2000/10/09 23:37:11 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c,v 1.17 2000/12/07 15:43:44 tsi Exp $ */ /* All drivers should typically include these */ #include "xf86.h" @@ -53,19 +53,9 @@ /* Framebuffer memory manager */ #include "xf86fbman.h" -/* - * If using cfb, cfb.h is required. Select the others for the bpp values - * the driver supports. - */ #include "xf4bpp.h" #include "xf1bpp.h" -#define PSZ 8 /* needed for cfb.h */ -#include "cfb.h" -#undef PSZ -#include "cfb16.h" -#include "cfb24.h" -#include "cfb32.h" -#include "cfb24_32.h" +#include "fb.h" /* These need to be checked */ #if 0 @@ -79,6 +69,7 @@ #include "xf86int10.h" #include "cir.h" +#define _ALP_PRIVATE_ #include "alp.h" #ifdef XvExtension @@ -95,8 +86,6 @@ static void AlpProbeI2C(int scrnIndex); * Forward definitions for the functions that make up the driver. */ -ScrnInfoPtr AlpProbe(int entity); - /* Mandatory functions */ Bool AlpPreInit(ScrnInfoPtr pScrn, int flags); @@ -187,21 +176,11 @@ static const char *vgahwSymbols[] = { NULL }; -static const char *cfbSymbols[] = { - "xf1bppScreenInit", - "xf4bppScreenInit", - "cfbScreenInit", - "cfb16ScreenInit", - "cfb24ScreenInit", - "cfb32ScreenInit", - "cfb8_32ScreenInit", - "cfb24_32ScreenInit", - NULL -}; - -static const char *xf8_32bppSymbols[] = { - "xf86Overlay8Plus32Init", - NULL +static const char *fbSymbols[] = { + "xf1bppScreenInit", + "xf4bppScreenInit", + "fbScreenInit", + NULL }; static const char *xaaSymbols[] = { @@ -284,8 +263,8 @@ alpSetup(pointer module, pointer opts, int *errmaj, int *errmin) static Bool setupDone = FALSE; if (!setupDone) { setupDone = TRUE; - LoaderRefSymLists(vgahwSymbols, cfbSymbols, xaaSymbols, - xf8_32bppSymbols, ramdacSymbols,int10Symbols, + LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, + ramdacSymbols,int10Symbols, ddcSymbols, i2cSymbols, shadowSymbols, NULL); } return (pointer)1; @@ -534,11 +513,13 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) MessageType from; int i; ClockRangePtr clockRanges; - char *mod = NULL; char *s; - if (flags & PROBE_DETECT) return FALSE; - + if (flags & PROBE_DETECT) { + cirProbeDDC( pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index ); + return TRUE; + } + #ifdef ALP_DEBUG ErrorF("AlpPreInit\n"); #endif @@ -651,23 +632,16 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) if (!xf86SetDefaultVisual(pScrn, -1)) { return FALSE; - } else { - /* We don't currently support DirectColor at > 8bpp */ - if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual" - " (%s) is not supported at depth %d\n", - xf86GetVisualName(pScrn->defaultVisual), pScrn->depth); - return FALSE; - } - } - + } /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); /* Process the options */ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, CirOptions); - pScrn->rgbBits = 6; + if (pScrn->depth == 8) + pScrn->rgbBits = 6; + from = X_DEFAULT; pCir->HWCursor = FALSE; if (xf86GetOptValBool(CirOptions, OPTION_HW_CURSOR, &pCir->HWCursor)) @@ -1082,21 +1056,33 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) /* Load bpp-specific modules */ switch (pScrn->bitsPerPixel) { - case 1: mod = "xf1bpp"; break; - case 4: mod = "xf4bpp"; break; - case 8: mod = "cfb"; break; - case 16: mod = "cfb16"; break; + case 1: + if (xf86LoadSubModule(pScrn, "xf1bpp") == NULL) { + AlpFreeRec(pScrn); + return FALSE; + } + xf86LoaderReqSymbols("xf1bppScreenInit",NULL); + break; + case 4: + if (xf86LoadSubModule(pScrn, "xf4bpp") == NULL) { + AlpFreeRec(pScrn); + return FALSE; + } + xf86LoaderReqSymbols("xf4bppScreenInit",NULL); + break; + case 8: + case 16: case 24: - if (pix24bpp == 24) - mod = "cfb24"; - else - mod = "xf24_32bpp"; - break; - case 32: mod = "cfb32"; break; - } - if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { - AlpFreeRec(pScrn); + case 32: + if (xf86LoadSubModule(pScrn, "fb") == NULL) { + AlpFreeRec(pScrn); return FALSE; + } + xf86LoaderReqSymbols("fbScreenInit",NULL); +#ifdef RENDER + xf86LoaderReqSymbols("fbPictureInit", NULL); +#endif + break; } /* Load XAA if needed */ @@ -1525,8 +1511,6 @@ AlpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) * function. If not, the visuals will need to be setup before calling * a fb ScreenInit() function and fixed up after. * - * For most PC hardware at depths >= 8, the defaults that cfb uses - * are not appropriate. In this driver, we fixup the visuals after. */ /* @@ -1536,27 +1520,13 @@ AlpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Setup the visuals we support. */ - /* - * For bpp > 8, the default visuals are not acceptable because we only - * support TrueColor and not DirectColor. To deal with this, call - * miSetVisualTypes with the appropriate visual mask. - */ -#ifdef ALP_DEBUG - ErrorF("AlpScreenInit before miSetVisualTypes\n"); -#endif - if (pScrn->bitsPerPixel > 8) { - if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, - pScrn->defaultVisual)) + if (!miSetVisualTypes(pScrn->depth, + miGetDefaultVisualMask(pScrn->depth), + pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; - } else { - if (!miSetVisualTypes(pScrn->depth, - miGetDefaultVisualMask(pScrn->depth), - pScrn->rgbBits, pScrn->defaultVisual)) - return FALSE; - } -#ifdef ALP_DEBUG - ErrorF("AlpScreenInit after miSetVisualTypes\n"); -#endif + + miSetPixmapDepths (); + displayWidth = pScrn->displayWidth; if (pCir->rotate) { height = pScrn->virtualX; @@ -1595,34 +1565,13 @@ AlpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) displayWidth); break; case 8: - ret = cfbScreenInit(pScreen, FbBase, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - break; case 16: - ret = cfb16ScreenInit(pScreen, FbBase, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - break; case 24: - if (pix24bpp == 24) - ret = cfb24ScreenInit(pScreen, FbBase, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - else - ret = cfb24_32ScreenInit(pScreen, FbBase, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - break; case 32: - ret = cfb32ScreenInit(pScreen, FbBase, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); + ret = fbScreenInit(pScreen, FbBase, + width,height, + pScrn->xDpi, pScrn->yDpi, + displayWidth,pScrn->bitsPerPixel); break; default: xf86DrvMsg(scrnIndex, X_ERROR, @@ -1633,6 +1582,9 @@ AlpScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } if (!ret) return FALSE; +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif #ifdef ALP_DEBUG ErrorF("AlpScreenInit after depth dependent init\n"); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c index 36c4f7e74..626fe3023 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c,v 1.3 2000/02/10 22:33:38 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c,v 1.4 2000/12/06 15:35:15 eich Exp $ */ /* (c) Itai Nahshon */ @@ -13,6 +13,7 @@ #include "vgaHW.h" #include "cir.h" +#define _ALP_PRIVATE_ #include "alp.h" #define CURSORWIDTH pAlp->CursorWidth diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_i2c.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_i2c.c index c92b7e1ec..78d540664 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_i2c.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_i2c.c @@ -1,6 +1,6 @@ /* (c) Itai Nahshon */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_i2c.c,v 1.2 2000/02/08 13:13:14 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_i2c.c,v 1.3 2000/12/06 15:35:15 eich Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -13,6 +13,7 @@ #include "vgaHW.h" #include "cir.h" +#define _ALP_PRIVATE_ #include "alp.h" /* diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c index b28025d6d..77b8920f4 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c @@ -1,6 +1,6 @@ /* (c) Itai Nahshon */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c,v 1.4 2000/10/23 12:10:14 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaa.c,v 1.5 2000/12/06 15:35:15 eich Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -13,6 +13,7 @@ #include "vgaHW.h" #include "cir.h" +#define _ALP_PRIVATE_ #include "alp.h" #define WAIT outb(0x3CE,0x31); while(inb(0x3CF) & pCir->chip.alp->waitMsk){}; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c index 8c0eb09dc..105c9d444 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c @@ -1,6 +1,6 @@ /* (c) Itai Nahshon */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c,v 1.3 2000/09/22 11:12:32 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_xaam.c,v 1.4 2000/12/06 15:35:15 eich Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -13,8 +13,10 @@ #include "vgaHW.h" #include "cir.h" +#define _ALP_PRIVATE_ #include "alp.h" +#ifdef DEBUG #define minb(p) \ ErrorF("minb(%X)\n", p),\ MMIO_IN8(pCir->IOBase, (p)) @@ -27,7 +29,12 @@ #define moutl(p,v) \ ErrorF("moutl(%X)\n", p),\ MMIO_OUT32(pCir->IOBase, (p),(v)) - +#else +#define minb(p) MMIO_IN8(pCir->IOBase, (p)) +#define moutb(p,v) MMIO_OUT8(pCir->IOBase, (p),(v)) +#define minl(p) MMIO_IN32(pCir->IOBase, (p)) +#define moutl(p,v) MMIO_OUT32(pCir->IOBase, (p),(v)) +#endif #define WAIT while(minb(0x40) & pCir->chip.alp->waitMsk){}; #define WAIT_1 while(minb(0x40) & 0x1){}; @@ -158,7 +165,6 @@ Bool AlpXAAInitMMIO(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - vgaHWPtr hwp = VGAHWPTR(pScrn); CirPtr pCir = CIRPTR(pScrn); XAAInfoRecPtr XAAPtr; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h index e2fd33cb2..d2e9b2f68 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h,v 1.16 2000/09/22 11:12:32 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h,v 1.17 2000/12/06 15:35:15 eich Exp $ */ /* (c) Itai Nahshon */ @@ -76,6 +76,7 @@ extern PciChipsets CIRPciChipsets[]; extern Bool CirMapMem(CirPtr pCir, int scrnIndex); extern Bool CirUnmapMem(CirPtr pCir, int scrnIndex); +extern void cirProbeDDC(ScrnInfoPtr pScrn, int index); /* in cir_shadow.c */ void cirPointerMoved(int index, int x, int y); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c index 5d7ce6965..ad77bc48a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c @@ -11,7 +11,7 @@ * Guy DESBIEF */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c,v 1.61 2000/12/02 15:30:36 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c,v 1.62 2000/12/06 15:35:15 eich Exp $ */ /* All drivers should typically include these */ #include "xf86.h" @@ -29,6 +29,10 @@ #include "xf86Pci.h" #include "cir.h" +#include "alp.h" +#include "lg.h" + +#include "vbe.h" /* * Forward definitions for the functions that make up the driver. @@ -40,11 +44,6 @@ static OptionInfoPtr CIRAvailableOptions(int chipid, int busid); static void CIRIdentify(int flags); static Bool CIRProbe(DriverPtr drv, int flags); -extern OptionInfoPtr AlpAvailableOptions(int chipid); -extern OptionInfoPtr LgAvailableOptions(int chipid); -extern ScrnInfoPtr AlpProbe(int entity); -extern ScrnInfoPtr LgProbe(int entity); - static Bool lg_loaded = FALSE; static Bool alp_loaded = FALSE; @@ -393,3 +392,14 @@ CirUnmapMem(CirPtr pCir, int scrnIndex) pCir->FbBase = NULL; return TRUE; } + +void +cirProbeDDC(ScrnInfoPtr pScrn, int index) +{ + vbeInfoPtr pVbe; + + if (xf86LoadSubModule(pScrn, "vbe")) { + pVbe = VBEInit(NULL,index); + ConfiguredMonitor = vbeDoEDID(pVbe, NULL); + } +} diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cirrus.cpp b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cirrus.cpp index d6cf0dea1..a115c5106 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cirrus.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cirrus.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cirrus.cpp,v 1.4 2000/06/14 02:13:08 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cirrus.cpp,v 1.5 2000/12/11 20:18:09 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH CIRRUS __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH CIRRUS __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME cirrus \- Cirrus Logic video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h index 087151f98..c76cca590 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h @@ -10,13 +10,16 @@ * Inspired by cir.h */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h,v 1.10 2000/02/08 13:13:15 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h,v 1.11 2000/12/06 15:35:16 eich Exp $ */ #ifndef LG_H #define LG_H +#define LG_DEBUG +extern ScrnInfoPtr LgProbe(int entity); +extern OptionInfoPtr LgAvailableOptions(int chipid); -#define LG_DEBUG +# ifdef _LG_PRIVATE_ /* Saved registers that are not part of the core VGA */ /* CRTC >= 0x19; Sequencer >= 0x05; Graphics >= 0x09; Attribute >= 0x15 */ @@ -98,6 +101,7 @@ typedef struct lgRec { int blitYDir; } LgRec, *LgPtr; +# endif /* _LG_PRIVATE_ */ #endif /* LG_H */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c index d787777af..e846dfac4 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c @@ -13,7 +13,7 @@ * David Dawes, Andrew E. Mileski, Leonard N. Zubkoff, * Guy DESBIEF, Itai Nahshon. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c,v 1.32 2000/10/09 23:37:12 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c,v 1.33 2000/12/06 15:35:16 eich Exp $ */ #define EXPERIMENTAL @@ -52,23 +52,14 @@ #include "xf86int10.h" -/* - * If using cfb, cfb.h is required. Select the others for the bpp values - * the driver supports. - */ -#define PSZ 8 /* needed for cfb.h */ -#include "cfb.h" -#undef PSZ -#include "cfb16.h" -#include "cfb24.h" -#include "cfb24_32.h" -#include "cfb32.h" +#include "fb.h" #include "xf86DDC.h" #undef LG_DEBUG #include "cir.h" +#define _LG_PRIVATE_ #include "lg.h" #ifdef XvExtension @@ -80,8 +71,6 @@ * Forward definitions for the functions that make up the driver. */ -ScrnInfoPtr LgProbe(int entity); - /* Mandatory functions */ Bool LgPreInit(ScrnInfoPtr pScrn, int flags); Bool LgScreenInit(int Index, ScreenPtr pScreen, int argc, char **argv); @@ -196,13 +185,8 @@ static const char *vgahwSymbols[] = { NULL }; -static const char *cfbSymbols[] = { - "cfbScreenInit", - "cfb16ScreenInit", - "cfb24ScreenInit", - "cfb32ScreenInit", - "cfb8_32ScreenInit", - "cfb24_32ScreenInit", +static const char *fbSymbols[] = { + "fbScreenInit", NULL }; @@ -287,7 +271,7 @@ lgSetup(pointer module, pointer opts, int *errmaj, int *errmin) if (!setupDone) { setupDone = TRUE; - LoaderRefSymLists(vgahwSymbols, cfbSymbols, xaaSymbols, + LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, ramdacSymbols, ddcSymbols, i2cSymbols, int10Symbols, NULL); } @@ -426,11 +410,13 @@ LgPreInit(ScrnInfoPtr pScrn, int flags) MessageType from; int i; ClockRangePtr clockRanges; - char *mod = NULL; int fbPCIReg, ioPCIReg; char *s; - if (flags & PROBE_DETECT) return FALSE; + if (flags & PROBE_DETECT) { + cirProbeDDC( pScrn, xf86GetEntityInfo(pScrn->entityList[0])->index ); + return TRUE; + } #ifdef LG_DEBUG ErrorF("LgPreInit\n"); @@ -538,13 +524,6 @@ LgPreInit(ScrnInfoPtr pScrn, int flags) if (!xf86SetDefaultVisual(pScrn, -1)) return FALSE; - /* We don't currently support DirectColor at > 8bpp */ - if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual" - " (%s) is not supported at depth %d\n", - xf86GetVisualName(pScrn->defaultVisual), pScrn->depth); - return FALSE; - } /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); @@ -876,19 +855,19 @@ LgPreInit(ScrnInfoPtr pScrn, int flags) /* Load bpp-specific modules */ switch (pScrn->bitsPerPixel) { - case 8: mod = "cfb"; break; - case 16: mod = "cfb16"; break; + case 8: + case 16: case 24: - if (pix24bpp == 24) - mod = "cfb24"; - else - mod = "xf24_32bpp"; - break; - case 32: mod = "cfb32"; break; - } - if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { - LgFreeRec(pScrn); - return FALSE; + case 32: + if (xf86LoadSubModule(pScrn, "fb") == NULL) { + LgFreeRec(pScrn); + return FALSE; + } + xf86LoaderReqSymbols("fbScreenInit",NULL); +#ifdef RENDER + xf86LoaderReqSymbols("fbPictureInit", NULL); +#endif + break; } /* Load XAA if needed */ @@ -1385,8 +1364,6 @@ LgScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) * function. If not, the visuals will need to be setup before calling * a fb ScreenInit() function and fixed up after. * - * For most PC hardware at depths >= 8, the defaults that cfb uses - * are not appropriate. In this driver, we fixup the visuals after. */ /* @@ -1396,24 +1373,13 @@ LgScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Setup the visuals we support. */ - /* - * For bpp > 8, the default visuals are not acceptable because we only - * support TrueColor and not DirectColor. To deal with this, call - * miSetVisualTypes with the appropriate visual mask. - */ -#ifdef LG_DEBUG - ErrorF("LgScreenInit before miSetVisualTypes\n"); -#endif - if (pScrn->bitsPerPixel > 8) { - if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, - pScrn->defaultVisual)) - return FALSE; - } else { - if (!miSetVisualTypes(pScrn->depth, - miGetDefaultVisualMask(pScrn->depth), - pScrn->rgbBits, pScrn->defaultVisual)) - return FALSE; - } + if (!miSetVisualTypes(pScrn->depth, + miGetDefaultVisualMask(pScrn->depth), + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + + miSetPixmapDepths (); + #ifdef LG_DEBUG ErrorF("LgScreenInit after miSetVisualTypes\n"); #endif @@ -1442,34 +1408,13 @@ LgScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) */ switch (pScrn->bitsPerPixel) { case 8: - ret = cfbScreenInit(pScreen, FbBase, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - break; case 16: - ret = cfb16ScreenInit(pScreen, FbBase, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - break; case 24: - if (pix24bpp == 24) - ret = cfb24ScreenInit(pScreen, FbBase, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - else - ret = cfb24_32ScreenInit(pScreen, FbBase, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - break; case 32: - ret = cfb32ScreenInit(pScreen, FbBase, - width,height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); + ret = fbScreenInit(pScreen, FbBase, + width,height, + pScrn->xDpi, pScrn->yDpi, + displayWidth,pScrn->bitsPerPixel); break; default: xf86DrvMsg(scrnIndex, X_ERROR, diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c index d9fdb70be..4644ce593 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c @@ -10,7 +10,7 @@ * Much of this code is inspired by the HW cursor code from XFree86 * 3.3.3. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c,v 1.3 2000/02/08 13:13:15 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c,v 1.4 2000/12/06 15:35:17 eich Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -23,6 +23,7 @@ #include "vgaHW.h" #include "cir.h" +#define _LG_PRIVATE_ #include "lg.h" #include "lg_xaa.h" /* For BitBLT engine macros */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_i2c.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_i2c.c index 4624040f3..6cb3e3d89 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_i2c.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_i2c.c @@ -1,6 +1,6 @@ /* (c) Itai Nahshon */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_i2c.c,v 1.3 2000/02/08 13:13:15 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_i2c.c,v 1.4 2000/12/06 15:35:17 eich Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -13,6 +13,7 @@ #include "vgaHW.h" #include "cir.h" +#define _LG_PRIVATE_ #include "lg.h" static void diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_xaa.c b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_xaa.c index 193e7e942..fe0633b39 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_xaa.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_xaa.c @@ -10,7 +10,7 @@ * Much of this code is inspired by the XAA acceleration from XFree86 * 3.3.3, laguna_acl.c */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_xaa.c,v 1.3 2000/02/08 17:19:08 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_xaa.c,v 1.4 2000/12/06 15:35:17 eich Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -23,6 +23,7 @@ #include "vgaHW.h" #include "cir.h" +#define _LG_PRIVATE_ #include "lg.h" #include "lg_xaa.h" diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.cpp b/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.cpp index e9c6ecb70..78bc29bfe 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.cpp,v 1.4 2000/06/14 02:13:08 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.cpp,v 1.5 2000/12/11 20:18:10 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH CYRIX __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH CYRIX __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME cyrix \- Cyrix video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c b/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c index 17292ffc4..6c92b5c36 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c,v 1.26 2000/12/02 15:30:38 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c,v 1.27 2000/12/06 15:35:18 eich Exp $ */ /* * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> @@ -267,15 +267,23 @@ FBDevProbe(DriverPtr drv, int flags) xf86LoaderReqSymLists(fbdevHWSymbols, NULL); for (i = 0; i < numDevSections; i++) { + Bool isIsa = FALSE; + Bool isPci = FALSE; + dev = xf86FindOptionValue(devSections[i]->options,"fbdev"); if (devSections[i]->busID) { - xf86ParsePciBusString(devSections[i]->busID,&bus,&device,&func); - if (!xf86CheckPciSlot(bus,device,func)) - continue; + if (xf86ParsePciBusString(devSections[i]->busID,&bus,&device, + &func)) { + if (!xf86CheckPciSlot(bus,device,func)) + continue; + isPci = TRUE; + } else if (xf86ParseIsaBusString(devSections[i]->busID)) + isIsa = TRUE; + } if (fbdevHWProbe(NULL,dev,NULL)) { pScrn = NULL; - if (devSections[i]->busID) { + if (isPci) { /* XXX what about when there's no busID set? */ int entity; @@ -291,8 +299,7 @@ FBDevProbe(DriverPtr drv, int flags) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "claimed PCI slot %d:%d:%d\n",bus,device,func); - } else { - /* XXX This is a quick hack */ + } else if (isIsa) { int entity; entity = xf86ClaimIsaSlot(drv, 0, @@ -300,6 +307,14 @@ FBDevProbe(DriverPtr drv, int flags) pScrn = xf86ConfigIsaEntity(pScrn,0,entity, NULL,RES_SHARED_VGA, NULL,NULL,NULL,NULL); + } else { + int entity; + + entity = xf86ClaimFbSlot(drv, 0, + devSections[i], TRUE); + pScrn = xf86ConfigFbEntity(pScrn,0,entity, + NULL,NULL,NULL,NULL); + } if (pScrn) { foundScreen = TRUE; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.cpp b/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.cpp index 9609d89fe..fbfd11ff5 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.cpp,v 1.8 2000/06/14 02:13:09 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.cpp,v 1.10 2000/12/11 22:40:25 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH FBDEV __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH FBDEV __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME fbdev \- video driver for framebuffer device .SH SYNOPSIS @@ -45,6 +45,9 @@ The following driver .B Options are supported: .TP +.BI "Option \*qfbdev\*q \*q" string \*q +The framebuffer device to use. Default: /dev/fb0. +.TP .BI "Option \*qShadowFB\*q \*q" boolean \*q Enable or disable use of the shadow framebuffer layer. See shadowfb(__drivermansuffix__) for further information. Default: on. @@ -52,4 +55,4 @@ shadowfb(__drivermansuffix__) for further information. Default: on. XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__), fbdevhw(__drivermansuffix__) .SH AUTHORS -Authors include: Gerd Knorr +Authors include: Gerd Knorr, Michel Dänzer, Geert Uytterhoeven diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glide/glide.cpp b/xc/programs/Xserver/hw/xfree86/drivers/glide/glide.cpp index e5665beec..59e79076a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glide/glide.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/glide/glide.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/glide.cpp,v 1.10 2000/06/14 02:13:09 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/glide.cpp,v 1.11 2000/12/11 20:18:12 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH GLIDE __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH GLIDE __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME glide \- Glide video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3 b/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3 index 5ae579bf2..caa5961ee 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3 +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3 @@ -1,14 +1,17 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3,v 1.5 2000/11/28 16:10:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3,v 1.6 2000/12/12 17:02:43 dawes Exp $ */ STATUS as of Mon, 16 Oct 2000 21:24:51 +0200 Working : * Unaccelerated : Depth 8, 15, 16 and 24 are ok. I tested them upto 1280x1024 only as my monitor don't support higher modes. + * Untested on big endian systems, i had some reports of endianess problems + with a Permedia4 though, so i suppose things are broken for Permedia3 + also. If you encounter problems, please contact me or try with + acceleration disabled. * HW cursor. * ShadowFb works. * Full 2D Accels. - - It should be endian clean, need testing on a big endian box though. - Sync. - Pixmap cache. - Offscreen pixmaps. @@ -30,6 +33,7 @@ Not Working : - Solid & Dashed Lines are not possible on glint hardware. - 8x8 Color Pattern Fill is almost never used. - Clipping needs cleaning up. + - Seems broken on big endian systems, cannot test it though. * 2D Accel hooks for the Rendering extension ? - Render extension initialization. - CPUToScreenTexture. diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp index 9aeedfe1f..00ba3b542 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp,v 1.9 2000/10/17 09:07:04 alanh Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.cpp,v 1.10 2000/12/11 20:18:13 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH GLINT __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH GLINT __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME glint \- GLINT/Permedia video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c index 146c87113..344381c19 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c @@ -28,7 +28,7 @@ * this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen, * Siemens Nixdorf Informationssysteme and Appian Graphics. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c,v 1.100 2000/12/02 15:30:39 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c,v 1.103 2000/12/08 13:42:35 alanh Exp $ */ #include "fb.h" #include "cfb8_32.h" @@ -251,6 +251,9 @@ static const char *xaaSymbols[] = { static const char *fbSymbols[] = { "cfb8_32ScreenInit", +#ifdef RENDER + "fbPictureInit", +#endif "fbScreenInit", "fbBres", NULL @@ -614,7 +617,7 @@ GLINTProbe(DriverPtr drv, int flags) checkusedPci = xf86GetPciVideoInfo(); - if (checkusedPci == NULL) { + if (checkusedPci == NULL && devSections /* for xf86DoProbe */) { /* * Changed the behaviour to try probing using the FBDev support * when no PCI cards have been found. This is for systems without @@ -681,7 +684,7 @@ GLINTProbe(DriverPtr drv, int flags) xfree(devSections); - } else { + } else if (checkusedPci) { numUsed = xf86MatchPciInstances(GLINT_NAME, 0, GLINTChipsets, GLINTPciChipsets, devSections, @@ -2450,6 +2453,8 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; + if (!miSetPixmapDepths()) + return FALSE; } #ifdef XF86DRI @@ -2489,6 +2494,10 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, displayWidth, pScrn->bitsPerPixel); +#ifdef RENDER + if (ret) + fbPictureInit(pScreen, 0, 0); +#endif break; case 32: if(pScrn->overlayFlags & OVERLAY_8_32_PLANAR) @@ -2496,11 +2505,16 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, displayWidth); - else + else { ret = fbScreenInit(pScreen, FBStart, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, displayWidth, pScrn->bitsPerPixel); +#ifdef RENDER + if (ret) + fbPictureInit(pScreen, 0, 0); +#endif + } break; default: xf86DrvMsg(scrnIndex, X_ERROR, @@ -2752,7 +2766,6 @@ GLINTAdjustFrame(int scrnIndex, int x, int y, int flags) base = ((y * pScrn->displayWidth + x) >> 1) >> pGlint->BppShift; if (pScrn->bitsPerPixel == 24) base *= 3; - if (pScrn->bitsPerPixel == 32) base *= 4; switch (pGlint->Chipset) { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile index d441441e9..ff5cdf85f 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile,v 1.2 2000/10/05 11:33:15 alanh Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/Imakefile,v 1.3 2000/12/11 01:53:00 robin Exp $ XCOMM XCOMM This is the Imakefile for the I128 driver. XCOMM @@ -6,8 +6,8 @@ XCOMM #define IHaveModules #include <Server.tmpl> -SRCS = i128_driver.c i128init.c i128IBMDAC.c i128accel.c -OBJS = i128_driver.o i128init.o i128IBMDAC.o i128accel.o +SRCS = i128_driver.c i128init.c i128IBMDAC.c i128accel.c i128dga.c +OBJS = i128_driver.o i128init.o i128IBMDAC.o i128accel.o i128dga.o #if defined(XF86DriverSDK) INCLUDES = -I. -I../../include @@ -51,6 +51,7 @@ InstallDriverSDKNonExecFile(i128init.c,$(DRIVERSDKDIR)/drivers/i128) InstallDriverSDKNonExecFile(i128IBMDAC.c,$(DRIVERSDKDIR)/drivers/i128) InstallDriverSDKNonExecFile(Ti302X.h,$(DRIVERSDKDIR)/drivers/i128) InstallDriverSDKNonExecFile(IBMRGB.h,$(DRIVERSDKDIR)/drivers/i128) +InstallDriverSDKNonExecFile(i128dga.c,$(DRIVERSDKDIR)/drivers/i128) InstallDriverSDKObjectModule(i128,$(DRIVERSDKMODULEDIR),drivers) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.cpp b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.cpp index b71467143..48926990f 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128.cpp,v 1.1 2000/10/04 23:34:58 robin Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128.cpp,v 1.2 2000/12/11 20:18:14 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH I128 __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH I128 __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME i128 \- Number 9 I128 video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h index 589b02094..3e0b14b83 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h,v 1.2 2000/10/23 14:11:39 robin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h,v 1.4 2000/12/11 01:53:00 robin Exp $ */ /* * Number Nine I128 functions * @@ -48,7 +48,6 @@ typedef struct { int CursorLines; int AdjustCursorXPos; int CursGeneration; - unsigned char *vgamem; /* layout specific */ int bitsPerPixel; @@ -92,6 +91,10 @@ typedef struct { XAAInfoRecPtr AccelInfoRec; xf86CursorInfoPtr CursorInfoRec; I2CBusPtr I2C; + Bool DGAactive; + int DGAViewportStatus; + int numDGAModes; + DGAModePtr DGAModes; Bool (*ProgramDAC)(ScrnInfoPtr, DisplayModePtr); unsigned int (*ddc1Read)(ScrnInfoPtr); Bool (*i2cInit)(ScrnInfoPtr); @@ -107,6 +110,7 @@ Bool I128SwitchMode(int scrnIndex, DisplayModePtr mode, int flags); Bool I128HWCursorInit(ScreenPtr pScreen); Bool I128AccelInit(ScreenPtr pScreen); +void I128EngineDone(ScrnInfoPtr pScrn); Bool I128Init(ScrnInfoPtr pScrn, DisplayModePtr mode); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c index 0a583347e..af1800868 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c @@ -22,7 +22,7 @@ * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c,v 1.15 2000/12/02 15:30:40 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c,v 1.17 2000/12/11 01:53:01 robin Exp $ */ /* All drivers should typically include these */ @@ -188,6 +188,9 @@ static const char *vgahwSymbols[] = { static const char *fbSymbols[] = { "fbScreenInit", +#ifdef RENDER + "fbPictureInit", +#endif NULL }; @@ -1156,6 +1159,9 @@ I128PreInit(ScrnInfoPtr pScrn, int flags) return FALSE; } xf86LoaderReqSymbols("fbScreenInit", NULL); +#ifdef RENDER + xf86LoaderReqSymbols("fbPictureInit", NULL); +#endif /* Load XAA if needed */ if (!pI128->NoAccel) { @@ -1508,6 +1514,9 @@ I128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; + if (!miSetPixmapDepths()) + return FALSE; + /* * Call the framebuffer layer's ScreenInit function, and fill in other @@ -1527,6 +1536,10 @@ I128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (!ret) return FALSE; +#ifdef RENDER + fbPictureInit(pScreen, 0, 0); +#endif + if (pScrn->bitsPerPixel > 8) { /* Fixup RGB ordering */ visual = pScreen->visuals + pScreen->numVisuals; @@ -1545,6 +1558,9 @@ I128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86SetBlackWhitePixels(pScreen); if (!pI128->NoAccel) + I128DGAInit(pScreen); + + if (!pI128->NoAccel) I128AccelInit(pScreen); miInitializeBackingStore(pScreen); @@ -1700,6 +1716,8 @@ I128CloseScreen(int scrnIndex, ScreenPtr pScreen) XAADestroyInfoRec(pI128->AccelInfoRec); if (pI128->CursorInfoRec) xf86DestroyCursorInfoRec(pI128->CursorInfoRec); + if (pI128->DGAModes) + xfree(pI128->DGAModes); pScrn->vtSema = FALSE; pScreen->CloseScreen = pI128->CloseScreen; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128accel.c b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128accel.c index 46b4abafd..6b32011e0 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128accel.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128accel.c,v 1.6 2000/11/01 23:33:06 robin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128accel.c,v 1.7 2000/12/06 01:07:34 robin Exp $ */ /* * Copyright 1997-2000 by Robin Cutshaw <robin@XFree86.Org> @@ -436,6 +436,18 @@ I128AccelInit(ScreenPtr pScreen) infoPtr->SubsequentScreenToScreenCopy = I128SubsequentScreenToScreenCopy; +#if 0 + /* screen to screen color expansion */ + if (pI128->Chipset == PCI_CHIP_I128_T2R) + infoPtr->ScreenToScreenColorExpandFillFlags |= + ONLY_LEFT_TO_RIGHT_BITBLT; + + infoPtr->SetupForScreenToScreenColorExpandFill = + I128SetupForScreenToScreenColorExpandFill; + infoPtr->SubsequentScreenToScreenColorExpandFill = + I128SubsequentScreenToScreenColorExpandFill; +#endif + /* solid fills */ infoPtr->SetupForSolidFill = I128SetupForSolidFill; infoPtr->SubsequentSolidFillRect = I128SubsequentSolidFillRect; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128dga.c b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128dga.c new file mode 100644 index 000000000..f5e3c5435 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128dga.c @@ -0,0 +1,272 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128dga.c,v 1.1 2000/12/11 01:53:01 robin Exp $ */ + +#include "xf86.h" +#include "xf86_OSproc.h" +#include "xf86_ansic.h" +#include "xf86Pci.h" +#include "xf86PciInfo.h" +#include "xaa.h" +#include "xaalocal.h" +#include "i128.h" +#include "dgaproc.h" + + +static Bool I128_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, + int *, int *, int *); +static Bool I128_SetMode(ScrnInfoPtr, DGAModePtr); +static int I128_GetViewport(ScrnInfoPtr); +static void I128_SetViewport(ScrnInfoPtr, int, int, int); +static void I128_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); +static void I128_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); +static void I128_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, + unsigned long); + +static +DGAFunctionRec I128_DGAFuncs = { + I128_OpenFramebuffer, + NULL, + I128_SetMode, + I128_SetViewport, + I128_GetViewport, + I128EngineDone, + I128_FillRect, + I128_BlitRect, +#if 0 + I128_BlitTransRect +#else + NULL +#endif +}; + + +Bool +I128DGAInit(ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + I128Ptr pI128 = I128PTR(pScrn); + DGAModePtr modes = NULL, newmodes = NULL, currentMode; + DisplayModePtr pMode, firstMode; + int Bpp = pScrn->bitsPerPixel >> 3; + int num = 0; + Bool oneMore; + + pMode = firstMode = pScrn->modes; + + while(pMode) { + + if(0 /*pScrn->displayWidth != pMode->HDisplay*/) { + newmodes = xrealloc(modes, (num + 2) * sizeof(DGAModeRec)); + oneMore = TRUE; + } else { + newmodes = xrealloc(modes, (num + 1) * sizeof(DGAModeRec)); + oneMore = FALSE; + } + + if(!newmodes) { + xfree(modes); + return FALSE; + } + modes = newmodes; + +SECOND_PASS: + + currentMode = modes + num; + num++; + + currentMode->mode = pMode; + currentMode->flags = DGA_CONCURRENT_ACCESS | DGA_PIXMAP_AVAILABLE; + currentMode->flags |= DGA_FILL_RECT | DGA_BLIT_RECT; + if(pMode->Flags & V_DBLSCAN) + currentMode->flags |= DGA_DOUBLESCAN; + if(pMode->Flags & V_INTERLACE) + currentMode->flags |= DGA_INTERLACED; + currentMode->byteOrder = pScrn->imageByteOrder; + currentMode->depth = pScrn->depth; + currentMode->bitsPerPixel = pScrn->bitsPerPixel; + currentMode->red_mask = pScrn->mask.red; + currentMode->green_mask = pScrn->mask.green; + currentMode->blue_mask = pScrn->mask.blue; + currentMode->visualClass = (Bpp == 1) ? PseudoColor : TrueColor; + currentMode->viewportWidth = pMode->HDisplay; + currentMode->viewportHeight = pMode->VDisplay; + currentMode->xViewportStep = 1; + currentMode->yViewportStep = 1; + currentMode->viewportFlags = DGA_FLIP_RETRACE; + currentMode->offset = 0; + currentMode->address = pI128->MemoryPtr; + + if(oneMore) { /* first one is narrow width */ + currentMode->bytesPerScanline = ((pMode->HDisplay * Bpp) + 3) & ~3L; + currentMode->imageWidth = pMode->HDisplay; + currentMode->imageHeight = pMode->VDisplay; + currentMode->pixmapWidth = currentMode->imageWidth; + currentMode->pixmapHeight = currentMode->imageHeight; + currentMode->maxViewportX = currentMode->imageWidth - + currentMode->viewportWidth; + /* this might need to get clamped to some maximum */ + currentMode->maxViewportY = currentMode->imageHeight - + currentMode->viewportHeight; + oneMore = FALSE; + goto SECOND_PASS; + } else { + currentMode->bytesPerScanline = + ((pScrn->displayWidth * Bpp) + 3) & ~3L; + currentMode->imageWidth = pScrn->displayWidth; + currentMode->imageHeight = pMode->VDisplay; + currentMode->pixmapWidth = currentMode->imageWidth; + currentMode->pixmapHeight = currentMode->imageHeight; + currentMode->maxViewportX = currentMode->imageWidth - + currentMode->viewportWidth; + /* this might need to get clamped to some maximum */ + currentMode->maxViewportY = currentMode->imageHeight - + currentMode->viewportHeight; + } + + pMode = pMode->next; + if(pMode == firstMode) + break; + } + + pI128->numDGAModes = num; + pI128->DGAModes = modes; + + return DGAInit(pScreen, &I128_DGAFuncs, modes, num); +} + + +static Bool +I128_SetMode( + ScrnInfoPtr pScrn, + DGAModePtr pMode +){ + static int OldDisplayWidth[MAXSCREENS]; + int index = pScrn->pScreen->myNum; + + I128Ptr pI128 = I128PTR(pScrn); + + if(!pMode) { /* restore the original mode */ + /* put the ScreenParameters back */ + + pScrn->displayWidth = OldDisplayWidth[index]; + + I128SwitchMode(index, pScrn->currentMode, 0); + pI128->DGAactive = FALSE; + } else { + if(!pI128->DGAactive) { /* save the old parameters */ + OldDisplayWidth[index] = pScrn->displayWidth; + + pI128->DGAactive = TRUE; + } + + pScrn->displayWidth = pMode->bytesPerScanline / + (pMode->bitsPerPixel >> 3); + + I128SwitchMode(index, pMode->mode, 0); + } + + return TRUE; +} + + + +static int +I128_GetViewport( + ScrnInfoPtr pScrn +){ + I128Ptr pI128 = I128PTR(pScrn); + + return pI128->DGAViewportStatus; +} + +static void +I128_SetViewport( + ScrnInfoPtr pScrn, + int x, int y, + int flags +){ + I128Ptr pI128 = I128PTR(pScrn); + + I128AdjustFrame(pScrn->pScreen->myNum, x, y, flags); + pI128->DGAViewportStatus = 0; /* I128AdjustFrame loops until finished */ +} + +static void +I128_FillRect ( + ScrnInfoPtr pScrn, + int x, int y, int w, int h, + unsigned long color +){ + I128Ptr pI128 = I128PTR(pScrn); + + if(pI128->AccelInfoRec) { + (*pI128->AccelInfoRec->SetupForSolidFill)(pScrn, color, GXcopy, ~0); + (*pI128->AccelInfoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h); + SET_SYNC_FLAG(pI128->AccelInfoRec); + } +} + +static void +I128_BlitRect( + ScrnInfoPtr pScrn, + int srcx, int srcy, + int w, int h, + int dstx, int dsty +){ + I128Ptr pI128 = I128PTR(pScrn); + + if(pI128->AccelInfoRec) { + int xdir = ((srcx < dstx) && (srcy == dsty)) ? -1 : 1; + int ydir = (srcy < dsty) ? -1 : 1; + + (*pI128->AccelInfoRec->SetupForScreenToScreenCopy)( + pScrn, xdir, ydir, GXcopy, ~0, -1); + (*pI128->AccelInfoRec->SubsequentScreenToScreenCopy)( + pScrn, srcx, srcy, dstx, dsty, w, h); + SET_SYNC_FLAG(pI128->AccelInfoRec); + } +} + + +static void +I128_BlitTransRect( + ScrnInfoPtr pScrn, + int srcx, int srcy, + int w, int h, + int dstx, int dsty, + unsigned long color +){ + I128Ptr pI128 = I128PTR(pScrn); + + if(pI128->AccelInfoRec) { + int xdir = ((srcx < dstx) && (srcy == dsty)) ? -1 : 1; + int ydir = (srcy < dsty) ? -1 : 1; + + (*pI128->AccelInfoRec->SetupForScreenToScreenCopy)( + pScrn, xdir, ydir, GXcopy, ~0, color); + (*pI128->AccelInfoRec->SubsequentScreenToScreenCopy)( + pScrn, srcx, srcy, dstx, dsty, w, h); + SET_SYNC_FLAG(pI128->AccelInfoRec); + } +} + + +static Bool +I128_OpenFramebuffer( + ScrnInfoPtr pScrn, + char **name, + unsigned char **mem, + int *size, + int *offset, + int *flags +){ + I128Ptr pI128 = I128PTR(pScrn); + CARD32 FbAddress = pI128->PciInfo->memBase[0] & 0xFFC00000; + + *name = NULL; /* no special device */ + *mem = (unsigned char*)FbAddress; + *size = pI128->MemorySize*1024; + *offset = 0; + *flags = DGA_NEED_ROOT; + + return TRUE; +} diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.cpp b/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.cpp index 9cced26d4..b3d4c9438 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/i740.cpp,v 1.4 2000/06/14 02:13:10 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/i740.cpp,v 1.5 2000/12/11 20:18:15 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH I740 __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH I740 __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME i740 \- Intel i740 video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp index 29fb289a1..17ab9429c 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp,v 1.5 2000/09/17 19:44:29 mvojkovi Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.cpp,v 1.6 2000/12/11 20:18:17 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH I810 __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH I810 __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME i810 \- Intel i810 video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c index 2a65bc328..35daecb8c 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c @@ -23,7 +23,7 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c,v 1.12 2000/09/17 01:36:27 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c,v 1.14 2000/12/06 01:40:49 mvojkovi Exp $ */ /* * i810_video.c: i810 Xv driver. Based on the mga Xv driver by Mark Vojkovich. @@ -262,8 +262,8 @@ typedef struct { unsigned char currentBuf; - unsigned char brightness; - unsigned char contrast; + int brightness; + int contrast; RegionRec clip; CARD32 colorKey; @@ -372,7 +372,7 @@ I810SetupImageVideo(ScreenPtr pScreen) pPriv->colorKey = pI810->colorKey & ((1 << pScrn->depth) - 1); pPriv->videoStatus = 0; pPriv->brightness = 0; - pPriv->contrast = 128; + pPriv->contrast = 64; pPriv->linear = NULL; pPriv->currentBuf = 0; @@ -542,16 +542,14 @@ I810SetPortAttribute( if((value < -128) || (value > 127)) return BadValue; pPriv->brightness = value; - overlay->OV0CLRC0 &= 0xFFFFFF00; - overlay->OV0CLRC0 |= value; + overlay->OV0CLRC0 = (pPriv->contrast << 8) | (pPriv->brightness & 0xff); OVERLAY_UPDATE(pI810->OverlayPhysical); } else if(attribute == xvContrast) { if((value < 0) || (value > 255)) return BadValue; pPriv->contrast = value; - overlay->OV0CLRC0 &= 0xFFFE00FF; - overlay->OV0CLRC0 |= value << 9; + overlay->OV0CLRC0 = (pPriv->contrast << 8) | (pPriv->brightness & 0xff); OVERLAY_UPDATE(pI810->OverlayPhysical); } else if(attribute == xvColorKey) { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.cpp b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.cpp index a5354d3b7..1a7b51245 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.cpp,v 1.2 2000/06/14 02:13:11 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.cpp,v 1.3 2000/12/11 20:18:18 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH IMSTT __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH IMSTT __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME imstt \- Integrated Micro Solutions Twin Turbo 128 driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h b/xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h index 7fe7f6888..f44de3eb6 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h @@ -13,7 +13,7 @@ @end ***************************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h,v 1.3 2000/10/24 22:45:08 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h,v 1.5 2000/12/06 20:39:52 dawes Exp $ */ #ifndef _BINDING #define _BINDING diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile index 2af10824a..197ca8dce 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile,v 1.37 2000/10/09 23:12:45 alanh Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/Imakefile,v 1.39 2000/12/14 16:38:49 dawes Exp $ XCOMM XCOMM This is an Imakefile for the MGA driver. XCOMM @@ -19,25 +19,51 @@ DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri \ DRIDEFINES = $(GLX_DEFINES) #endif +#if DoLoadableServer && (HaveMatroxHal || BuildMatroxHal) +#define BuildHalModule YES +#else +#define BuildHalModule NO +#endif + +#if !DoLoadableServer && UseMatroxHal && (HaveMatroxHal || BuildMatroxHal) +#define BuildHalStatic YES +#else +#define BuildHalStatic NO +#endif + +#if BuildHalModule +MGAHALMODSRC = mga_halmod.c +MGAHALMODOBJ = mga_halmod.o +#endif + #if UseMatroxHal -MGAHALSRCS = clientlx.c MGAHALDEFINES = -DUSEMGAHAL -#if !BuildMatroxHal -MGAHALOBJS = clientlx.o HALlib/mgaHALlib.a +#if BuildMatroxHal +MGAHALINCLUDES = -Ihallib +#else MGAHALINCLUDES = -IHALlib +#endif +#endif + +#if BuildHalModule || BuildHalStatic +MGAHALSRCS = $(MGAHALMODSRC) clientlx.c +#if !BuildMatroxHal +MGAHALOBJS = $(MGAHALMODOBJ) clientlx.o HALlib/mgaHALlib.a #else -MGAHALOBJS = clientlx.o hallib/libmga_hal.a -MGAHALINCLUDES = -Ihallib +MGAHALOBJS = $(MGAHALMODOBJ) clientlx.o hallib/libmga_hal.a hallib/libmga_hal.a: $(SUBDIRS) #endif #endif -SRCS = mga_driver.c mga_hwcurs.c /* mga_cmap.c */ mga_dac3026.c mga_dacG.c \ +MGASRCS = mga_driver.c mga_hwcurs.c /* mga_cmap.c */ mga_dac3026.c mga_dacG.c \ mga_storm8.c mga_storm16.c mga_storm24.c mga_storm32.c mga_arc.c \ - mga_dga.c mga_shadow.c mga_video.c $(MGAHALSRCS) $(DRISRCS) -OBJS = mga_driver.o mga_hwcurs.o /* mga_cmap.o */ mga_dac3026.o mga_dacG.o \ + mga_dga.c mga_shadow.c mga_video.c $(DRISRCS) +MGAOBJS = mga_driver.o mga_hwcurs.o /* mga_cmap.o */ mga_dac3026.o mga_dacG.o \ mga_storm8.o mga_storm16.o mga_storm24.o mga_storm32.o mga_arc.o \ - mga_dga.o mga_shadow.o mga_video.o $(MGAHALOBJS) $(DRIOBJS) + mga_dga.o mga_shadow.o mga_video.o $(DRIOBJS) + +SRCS = $(MGASRCS) $(MGAHALSRCS) +OBJS = $(MGAOBJS) $(MGAHALOBJS) #if defined(XF86DriverSDK) INCLUDES = -I. -I../../include @@ -63,7 +89,14 @@ SubdirLibraryRule($(OBJS)) ModuleObjectRule() +#if BuildHalStatic ObjectModuleTarget(mga,$(OBJS)) +#else +ObjectModuleTarget(mga,$(MGAOBJS)) +#endif +#if BuildHalModule +ObjectModuleTarget(mga_hal,$(MGAHALOBJS)) +#endif ObjectFromSpecialSource(mga_storm8, mga_storm, -DPSZ=8) ObjectFromSpecialSource(mga_storm16, mga_storm, -DPSZ=16) @@ -71,6 +104,9 @@ ObjectFromSpecialSource(mga_storm24, mga_storm, -DPSZ=24) ObjectFromSpecialSource(mga_storm32, mga_storm, -DPSZ=32) InstallObjectModule(mga,$(MODULEDIR),drivers) +#if BuildHalModule +InstallObjectModule(mga_hal,$(MODULEDIR),drivers) +#endif #if !defined(XF86DriverSDK) CppManTarget(mga,) @@ -94,8 +130,12 @@ InstallDriverSDKNonExecFile(mga_reg.h,$(DRIVERSDKDIR)/drivers/mga) InstallDriverSDKNonExecFile(mga_shadow.c,$(DRIVERSDKDIR)/drivers/mga) InstallDriverSDKNonExecFile(mga_storm.c,$(DRIVERSDKDIR)/drivers/mga) InstallDriverSDKNonExecFile(mga_video.c,$(DRIVERSDKDIR)/drivers/mga) +InstallDriverSDKNonExecFile(mga_halmod.c,$(DRIVERSDKDIR)/drivers/mga) InstallDriverSDKObjectModule(mga,$(DRIVERSDKMODULEDIR),drivers) +#if BuildMatroxHal +InstallDriverSDKObjectModule(mga_hal,$(DRIVERSDKMODULEDIR),drivers) +#endif #if BuildMatroxHal MakeSubdirs($(SUBDIRS)) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.cpp b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.cpp index f96da4b9a..6ff899de3 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.cpp,v 1.18 2000/09/15 21:46:12 mvojkovi Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.cpp,v 1.20 2000/12/12 18:54:30 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH MGA __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH MGA __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME mga \- Matrox video driver .SH SYNOPSIS @@ -82,7 +82,7 @@ Enable or disable the HW cursor. Default: on. Specify whether G100, G200 or G400 cards have SDRAM. The driver attempts to auto-detect this based on the card's PCI subsystem ID. This option may be used to override that auto-detection. The mga driver is not able to -auto-detect the prescence of SDRAM on secondary heads in multihead configurations +auto-detect the presence of of SDRAM on secondary heads in multihead configurations so this option will often need to be specified in multihead configurations. Default: auto-detected. .TP diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h index b1b05e1e5..c6b4dce79 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v 1.69 2000/12/03 01:51:05 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v 1.70 2000/12/06 15:35:19 eich Exp $ */ /* * MGA Millennium (MGA2064W) functions * @@ -301,6 +301,10 @@ typedef struct { Time RenderTime; MGAPaletteInfo palinfo[256]; /* G400 hardware bug workaround */ FBLinearPtr LinearScratch; + Bool softbooted; +#ifdef USEMGAHAL + Bool HALLoaded; +#endif } MGARec, *MGAPtr; #ifdef XF86DRI diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c index 5efb33ab6..3f74af156 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c @@ -2,7 +2,7 @@ * MGA-1064, MGA-G100, MGA-G200, MGA-G400 RAMDAC driver */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v 1.41 2000/11/02 02:51:19 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v 1.42 2000/12/06 15:35:20 eich Exp $ */ /* * This is a first cut at a non-accelerated version to work with the @@ -334,8 +334,10 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode) } pReg->Option2 = 0x0000007; break; -#ifndef USEMGAHAL case PCI_CHIP_MGAG400: +#ifdef USEMGAHAL + MGA_HAL(break;); +#endif if(pMga->Dac.maxPixelClock == 360000) { /* G400 MAX */ if(pMga->OverclockMem) { /* 150/200 */ @@ -376,6 +378,9 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode) case PCI_CHIP_MGAG200: case PCI_CHIP_MGAG200_PCI: default: +#ifdef USEMGAHAL + MGA_HAL(break;); +#endif if(pMga->OverclockMem) { /* 143 Mhz */ pReg->DacRegs[ MGA1064_SYS_PLL_M ] = 0x06; @@ -393,7 +398,6 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode) else pReg->Option = 0x4049cd21; break; -#endif } MGA_NOT_HAL( diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c index 5b1d6ddc6..0dc68f7b8 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.13 2000/12/01 14:28:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.14 2000/12/11 22:34:55 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -254,9 +254,8 @@ MGAInitVisualConfigs(ScreenPtr pScreen) pMGAConfigPtrs[i] = &pMGAConfigs[i]; i = 0; - depth = 1; for (accum = 0; accum <= 1; accum++) { - for (stencil = 0; stencil <= 1; stencil++) { + for (depth = 0; depth <= 1; depth++) { /* and stencil */ for (db=1; db>=0; db--) { pConfigs[i].vid = -1; pConfigs[i].class = -1; @@ -286,17 +285,14 @@ MGAInitVisualConfigs(ScreenPtr pScreen) pConfigs[i].doubleBuffer = FALSE; pConfigs[i].stereo = FALSE; pConfigs[i].bufferSize = 32; - if (depth) - if (stencil) + if (depth) { pConfigs[i].depthSize = 24; - else - pConfigs[i].depthSize = 32; - else - pConfigs[i].depthSize = 0; - if (stencil) - pConfigs[i].stencilSize = 8; - else - pConfigs[i].stencilSize = 0; + pConfigs[i].stencilSize = 8; + } + else { + pConfigs[i].depthSize = 0; + pConfigs[i].stencilSize = 0; + } pConfigs[i].auxBuffers = 0; pConfigs[i].level = 0; if (accum) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c index 5cfefa728..415472e17 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c @@ -43,7 +43,7 @@ * Fixed 32bpp hires 8MB horizontal line glitch at middle right */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.183 2000/12/02 15:30:43 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.185 2000/12/07 20:26:21 dawes Exp $ */ /* * This is a first cut at a non-accelerated version to work with the @@ -220,7 +220,8 @@ typedef enum { OPTION_TV, OPTION_TVSTANDARD, OPTION_CABLETYPE, - OPTION_USEIRQZERO + OPTION_USEIRQZERO, + OPTION_NOHAL } MGAOpts; static OptionInfoRec MGAOptions[] = { @@ -250,6 +251,7 @@ static OptionInfoRec MGAOptions[] = { { OPTION_TVSTANDARD, "TVStandard", OPTV_ANYSTR, {0}, FALSE }, { OPTION_CABLETYPE, "CableType", OPTV_ANYSTR, {0}, FALSE }, { OPTION_USEIRQZERO, "UseIrqZero", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_NOHAL, "NoHal", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; @@ -352,6 +354,9 @@ static const char *driSymbols[] = { "DRIGetSAREAPrivate", "DRIGetContext", "DRIQueryVersion", + "DRIAdjustFrame", + "DRIOpenFullScreen", + "DRICloseFullScreen", "GlxSetVisualConfigs", NULL }; @@ -419,7 +424,21 @@ static const char *fbdevHWSymbols[] = { NULL }; - +#ifdef USEMGAHAL +static const char *halSymbols[] = { + "MGACloseLibrary", + "MGASaveVgaState", + "MGARestoreVgaState", + "MGASetVgaMode", + "MGASetMode", + "MGAValidateMode", + "MGAValidateVideoParameters", + "MGAGetBOARDHANDLESize", + "MGAGetHardwareInfo", + "MGAOpenLibrary", + NULL +}; +#endif #ifdef XFree86LOADER static MODULESETUPPROTO(mgaSetup); @@ -468,7 +487,9 @@ mgaSetup(pointer module, pointer opts, int *errmaj, int *errmin) #ifdef XF86DRI drmSymbols, driSymbols, #endif - +#ifdef USEMGAHAL + halSymbols, +#endif NULL); /* @@ -1356,13 +1377,15 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) /* Process the options */ xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, MGAOptions); - if(xf86ReturnOptValBool(MGAOptions, OPTION_INT10, FALSE) && + pMga->softbooted = FALSE; + if (xf86ReturnOptValBool(MGAOptions, OPTION_INT10, FALSE) && xf86LoadSubModule(pScrn, "int10")) { xf86Int10InfoPtr pInt; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n"); pInt = xf86InitInt10(pMga->pEnt->index); + if (pInt) pMga->softbooted = TRUE; xf86FreeInt10(pInt); } @@ -1398,6 +1421,16 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) pMga->ChipRev = pMga->PciInfo->chipRev; } +#ifdef USEMGAHAL + if (HAL_CHIPSETS && !xf86ReturnOptValBool(MGAOptions, OPTION_NOHAL, FALSE) + && xf86LoadSubModule(pScrn, "mga_hal")) { + xf86LoaderReqSymLists(halSymbols, NULL); + xf86DrvMsg(pScrn->scrnIndex, X_INFO,"Matrox HAL module used\n"); + pMga->HALLoaded = TRUE; + } else + pMga->HALLoaded = FALSE; +#endif + /* * This shouldn't happen because such problems should be caught in * MGAProbe(), but check it just in case. @@ -1481,13 +1514,15 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) from = X_CONFIG; } #ifdef USEMGAHAL - xf86GetOptValBool(MGAOptions, OPTION_TV, &tv); - if (tv == TRUE) { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Support\n"); - } - xf86GetOptValBool(MGAOptions, OPTION_DIGITAL, &digital); - if (digital == TRUE) { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Digital Screen Support\n"); + if (pMga->HALLoaded) { + xf86GetOptValBool(MGAOptions, OPTION_TV, &tv); + if (tv == TRUE) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "TV Support\n"); + } + xf86GetOptValBool(MGAOptions, OPTION_DIGITAL, &digital); + if (digital == TRUE) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Digital Screen Support\n"); + } } #endif /* For compatibility, accept this too (as an override) */ @@ -1600,23 +1635,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) } } - if(pMga->HasSDRAM) { /* don't bother checking */ } - else if ((pMga->PciInfo->subsysCard == PCI_CARD_MILL_G200_SD) || - (pMga->PciInfo->subsysCard == PCI_CARD_MARV_G200_SD) || - (pMga->PciInfo->subsysCard == PCI_CARD_MYST_G200_SD) || - (pMga->PciInfo->subsysCard == PCI_CARD_PROD_G100_SD)) { - pMga->HasSDRAM = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Has SDRAM\n"); - } - else if (pMga->Primary && (pMga->Chipset != PCI_CHIP_MGA2064) && - (pMga->Chipset != PCI_CHIP_MGA2164) && - (pMga->Chipset != PCI_CHIP_MGA2164_AGP)) { - if(!(pciReadLong(pMga->PciTag, PCI_OPTION_REG) & (1 << 14))) { - pMga->HasSDRAM = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Has SDRAM\n"); - } - } - switch (pMga->Chipset) { case PCI_CHIP_MGA2064: case PCI_CHIP_MGA2164: @@ -2095,6 +2113,29 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) ); /* MGA_HAL */ #endif + if(pMga->HasSDRAM) { /* don't bother checking */ } + else if ((pMga->PciInfo->subsysCard == PCI_CARD_MILL_G200_SD) || + (pMga->PciInfo->subsysCard == PCI_CARD_MARV_G200_SD) || + (pMga->PciInfo->subsysCard == PCI_CARD_MYST_G200_SD) || + (pMga->PciInfo->subsysCard == PCI_CARD_PROD_G100_SD)) { + pMga->HasSDRAM = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Has SDRAM\n"); + } + /* + * Can we trust HALlib to set the memory configuration + * registers correctly? + */ + else if ((pMga->softbooted || pMga->Primary /*|| pMga->HALLoaded*/ ) && + (pMga->Chipset != PCI_CHIP_MGA2064) && + (pMga->Chipset != PCI_CHIP_MGA2164) && + (pMga->Chipset != PCI_CHIP_MGA2164_AGP)) { + CARD32 option_reg = pciReadLong(pMga->PciTag, PCI_OPTION_REG); + if(!(option_reg & (1 << 14))) { + pMga->HasSDRAM = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Has SDRAM\n"); + } + } + /* * Set the CRTC parameters for all of the modes based on the type * of mode, and the chipset's interlace requirements. @@ -2104,8 +2145,8 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) * are not pre-initialised at all. */ #ifdef USEMGAHAL - MGA_HAL(xf86SetCrtcForModes(pScrn, 0)); - MGA_NOT_HAL(xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V)); + MGA_HAL(xf86SetCrtcForModes(pScrn, 0)); + MGA_NOT_HAL(xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V)); #else xf86SetCrtcForModes(pScrn, INTERLACE_HALVE_V); #endif @@ -2457,7 +2498,8 @@ MGASave(ScrnInfoPtr pScrn) if(pMga->SecondCrtc == TRUE) return; #ifdef USEMGAHAL - MGA_HAL(if (pMga->pBoard != NULL) MGASaveVgaState(pMga->pBoard)); + if (pMga->HALLoaded) + MGA_HAL(if (pMga->pBoard != NULL) MGASaveVgaState(pMga->pBoard)); #endif /* Only save text mode fonts/text for the primary card */ @@ -2547,10 +2589,12 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) Bool tv = FALSE; ULONG status; - /* Verify if user wants digital screen output */ - xf86GetOptValBool(MGAOptions, OPTION_DIGITAL, &digital); - /* Verify if user wants TV output */ - xf86GetOptValBool(MGAOptions, OPTION_TV, &tv); + if (pMga->HALLoaded) { + /* Verify if user wants digital screen output */ + xf86GetOptValBool(MGAOptions, OPTION_DIGITAL, &digital); + /* Verify if user wants TV output */ + xf86GetOptValBool(MGAOptions, OPTION_TV, &tv); + } #endif vgaHWUnlock(hwp); @@ -2569,7 +2613,7 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) mgaReg = &pMga->ModeReg; #ifdef USEMGAHAL - MGA_HAL( + MGA_HAL( FillModeInfoStruct(pScrn,mode); if(pMga->SecondCrtc == TRUE) { @@ -2680,12 +2724,12 @@ MGARestore(ScrnInfoPtr pScrn) vgaHWProtect(pScrn, TRUE); if (pMga->Primary) { #ifdef USEMGAHAL - MGA_HAL( - if(pMga->pBoard != NULL) { - MGASetVgaMode(pMga->pBoard); - MGARestoreVgaState(pMga->pBoard); - } - ); /* MGA_HAL */ + MGA_HAL( + if(pMga->pBoard != NULL) { + MGASetVgaMode(pMga->pBoard); + MGARestoreVgaState(pMga->pBoard); + } + ); /* MGA_HAL */ #endif (*pMga->Restore)(pScrn, vgaReg, mgaReg, TRUE); } else { @@ -2744,7 +2788,6 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pMga = MGAPTR(pScrn); MGAdac = &pMga->Dac; - /* Map the MGA memory and MMIO areas */ if (pMga->FBDev) { if (!MGAMapMemFBDev(pScrn)) @@ -2787,7 +2830,7 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pMga->pBoard = pMgaEnt->pBoard; pMga->pMgaHwInfo = pMgaEnt->pMgaHwInfo; } - ); /* MGA_HAL */ + ); #endif } else { #ifdef USEMGAHAL @@ -2802,6 +2845,17 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) ); /* MGA_HAL */ #endif } +#ifdef USEMGAHAL + MGA_HAL( + /* There is a problem in the HALlib: set soft reset bit */ + if ( !pMga->Primary && !pMga->FBDev && + (pMga->PciInfo->subsysCard == PCI_CARD_MILL_G200_SG) ) { + OUTREG(MGAREG_Reset, 1); + usleep(200); + OUTREG(MGAREG_Reset, 0); + } + ) +#endif /* Initialise the MMIO vgahw functions */ vgaHWSetMmioFuncs(hwp, pMga->IOBase, PORT_OFFSET); @@ -2829,7 +2883,6 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) return FALSE; } - /* Darken the screen for aesthetic reasons and set the viewport */ if (pMga->SecondCrtc == TRUE) { MGASaveScreenCrtc2(pScreen, SCREEN_SAVER_ON); @@ -3029,6 +3082,16 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86DPMSInit(pScreen, MGADisplayPowerManagementSet, 0); #endif + pScrn->memPhysBase = pMga->FbAddress; + pScrn->fbOffset = pMga->YDstOrg * (pScrn->bitsPerPixel / 8); + + if(pMga->SecondCrtc == TRUE) { + pScreen->SaveScreen = MGASaveScreenCrtc2; + } else { + pScreen->SaveScreen = MGASaveScreen; + } + MGAInitVideo(pScreen); + #ifdef XF86DRI /* Initialize the Warp engine */ if (pMga->directRenderingEnabled) { @@ -3050,16 +3113,6 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pMga->have_quiescense = 1; #endif - pScrn->memPhysBase = pMga->FbAddress; - pScrn->fbOffset = pMga->YDstOrg * (pScrn->bitsPerPixel / 8); - - if(pMga->SecondCrtc == TRUE) { - pScreen->SaveScreen = MGASaveScreenCrtc2; - } else { - pScreen->SaveScreen = MGASaveScreen; - } - MGAInitVideo(pScreen); - /* Wrap the current CloseScreen function */ pMga->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = MGACloseScreen; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_halmod.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_halmod.c new file mode 100644 index 000000000..4308f8556 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_halmod.c @@ -0,0 +1,38 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_halmod.c,v 1.1 2000/12/06 15:35:21 eich Exp $ */ +#include "xf86Module.h" + +#ifdef XFree86LOADER + +#define HAL_MAJOR_VERSION 1 +#define HAL_MINOR_VERSION 0 +#define HAL_PATCHLEVEL 0 + +static MODULESETUPPROTO(halSetup); + +static XF86ModuleVersionInfo halVersRec = +{ + "mga_hal", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + HAL_MAJOR_VERSION, HAL_MINOR_VERSION, HAL_PATCHLEVEL, + ABI_CLASS_VIDEODRV, /* This is a video driver */ + ABI_VIDEODRV_VERSION, + MOD_CLASS_NONE, + {0,0,0,0} +}; + +/* + * This is the module init data. + * Its name has to be the driver name followed by ModuleData. + */ +XF86ModuleData mga_halModuleData = { &halVersRec, halSetup, NULL }; + +static pointer +halSetup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + return (pointer)1; +} + +#endif /* XFree86LOADER */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h index 4aa48527b..78931b94c 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h,v 1.17 2000/11/02 02:51:20 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h,v 1.18 2000/12/06 15:35:21 eich Exp $ */ #ifndef _MGA_MACROS_H_ #define _MGA_MACROS_H_ @@ -97,11 +97,11 @@ while(INREG(MGAREG_DWGSYNC) != MGA_SYNC_XTAG) ; \ (pMga->Chipset == PCI_CHIP_MGAG400)) #define MGA_HAL(x) { \ MGAPtr pMga = MGAPTR(pScrn); \ - if (HAL_CHIPSETS) { x; } \ + if (pMga->HALLoaded && HAL_CHIPSETS) { x; } \ } #define MGA_NOT_HAL(x) { \ MGAPtr pMga = MGAPTR(pScrn); \ - if (!HAL_CHIPSETS) { x; } \ + if (!pMga->HALLoaded || !HAL_CHIPSETS) { x; } \ } #else #define MGA_NOT_HAL(x) { x; } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c index 2ffcc8788..4ecd5cf85 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c,v 1.80 2000/11/03 18:46:11 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c,v 1.81 2000/12/14 16:33:09 eich Exp $ */ /* All drivers should typically include these */ @@ -601,8 +601,8 @@ MGANAME(AccelInit)(ScreenPtr pScreen) pMga->AccelFlags = TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND; -#if 0 - if(pMga->FbMapSize > 8*1024*1024) +#if 1 + if((pMga->FbMapSize > 8*1024*1024) && (pScrn->depth == 8)) pMga->AccelFlags |= LARGE_ADDRESSES; #endif break; @@ -801,7 +801,6 @@ MGANAME(AccelInit)(ScreenPtr pScreen) maxlines = (min(pMga->FbUsableSize, 16*1024*1024)) / (pScrn->displayWidth * PSZ / 8); - #ifdef XF86DRI if (pMga->directRenderingEnabled) { if(maxlines > (pMga->numXAALines + pScrn->virtualY)) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c index 3899ef258..940e22148 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c,v 1.20 2000/11/08 00:51:10 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c,v 1.21 2000/12/05 20:03:45 mvojkovi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -439,7 +439,7 @@ MGAClipVideo( } static void -MGAStopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit) +MGAStopVideo(ScrnInfoPtr pScrn, pointer data, Bool shutdown) { MGAPtr pMga = MGAPTR(pScrn); MGAPortPrivPtr pPriv = pMga->portPrivate; @@ -448,7 +448,7 @@ MGAStopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit) REGION_EMPTY(pScrn->pScreen, &pPriv->clip); - if(exit) { + if(shutdown) { if(pPriv->videoStatus & CLIENT_VIDEO_ON) OUTREG(MGAREG_BESCTL, 0); if(pPriv->linear) { @@ -592,23 +592,37 @@ MGACopyMungedData( int h, int w ){ - CARD32 *dst = (CARD32*)dst1; + CARD32 *dst; + CARD8 *s1, *s2, *s3; int i, j; - dstPitch >>= 2; w >>= 1; for(j = 0; j < h; j++) { - for(i = 0; i < w; i++) { - dst[i] = src1[i << 1] | (src1[(i << 1) + 1] << 16) | - (src3[i] << 8) | (src2[i] << 24); - } - dst += dstPitch; - src1 += srcPitch; - if(j & 1) { - src2 += srcPitch2; - src3 += srcPitch2; - } + dst = (CARD32*)dst1; + s1 = src1; s2 = src2; s3 = src3; + i = w; + while(i > 4) { + dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24); + dst[1] = s1[2] | (s1[3] << 16) | (s3[1] << 8) | (s2[1] << 24); + dst[2] = s1[4] | (s1[5] << 16) | (s3[2] << 8) | (s2[2] << 24); + dst[3] = s1[6] | (s1[7] << 16) | (s3[3] << 8) | (s2[3] << 24); + dst += 4; s2 += 4; s3 += 4; s1 += 8; + i -= 4; + } + + while(i--) { + dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24); + dst++; s2++; s3++; + s1 += 2; + } + + dst1 += dstPitch; + src1 += srcPitch; + if(j & 1) { + src2 += srcPitch2; + src3 += srcPitch2; + } } } @@ -729,7 +743,7 @@ MGADisplayVideoTexture( short drw_w, short drw_h ){ MGAPtr pMga = MGAPTR(pScrn); - int log2w, log2h, i, incx, incy, padw, padh; + int log2w = 0, log2h = 0, i, incx, incy, padw, padh; pitch >>= 1; @@ -813,15 +827,15 @@ MGAPutImage( short drw_w, short drw_h, int id, unsigned char* buf, short width, short height, - Bool sync, + Bool Sync, RegionPtr clipBoxes, pointer data ){ MGAPtr pMga = MGAPTR(pScrn); MGAPortPrivPtr pPriv = pMga->portPrivate; INT32 x1, x2, y1, y2; unsigned char *dst_start; - int pitch, new_size, offset, offset2, offset3; - int srcPitch, srcPitch2, dstPitch; + int pitch, new_size, offset, offset2 = 0, offset3 = 0; + int srcPitch, srcPitch2 = 0, dstPitch; int top, left, npixels, nlines, bpp; BoxRec dstBox; CARD32 tmp; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c index 1897874cb..2c01f5574 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c @@ -22,7 +22,7 @@ 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: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c,v 1.44 2000/12/04 18:49:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c,v 1.46 2000/12/06 18:08:54 eich Exp $ */ /* * The original Precision Insight driver for @@ -2267,6 +2267,7 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) vgaHWPtr hwp = VGAHWPTR(pScrn); NeoRegPtr NeoNew = &nPtr->NeoModeReg; vgaRegPtr NeoStd = &hwp->ModeReg; + Bool noLcdStretch = nPtr->noLcdStretch; neoUnlock(pScrn); @@ -2399,21 +2400,19 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) NeoNew->PanelDispCntlReg3 = 0x00; nAcl->NoCursorMode = FALSE; - if ((!nPtr->noLcdStretch) && + if ((!noLcdStretch) && (NeoNew->PanelDispCntlReg1 & 0x02)) { if (mode->HDisplay == nPtr->NeoPanelWidth) { /* * Don't disable the flag. It will be needed if another mode * is selected. */ -#if 0 /* * No stretching required when the requested display width * equals the panel width. */ xf86DrvMsg(pScrn->scrnIndex,X_INFO,"Stretching disabled\n"); - nPtr->noLcdStretch = TRUE; -#endif + noLcdStretch = TRUE; } else { switch (mode->HDisplay) { @@ -2429,7 +2428,7 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) /* No stretching in these modes. */ xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Stretching disabled not supported in this mode\n"); - nPtr->noLcdStretch = TRUE; + noLcdStretch = TRUE; break; } } @@ -2464,7 +2463,7 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) NeoNew->PanelDispCntlReg3 |= 0x10; /* Calculate the horizontal and vertical offsets. */ - if (nPtr->noLcdStretch) { + if (noLcdStretch) { hoffset = ((nPtr->NeoPanelWidth - mode->HDisplay) >> 4) - 1; voffset = ((nPtr->NeoPanelHeight - mode->VDisplay) >> 1) - 2; } else { @@ -2537,7 +2536,7 @@ neoModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) #define MAX_N 127 #define MAX_D 31 #define MAX_F 1 -#define DEBUG + static void neoCalcVCLK(ScrnInfoPtr pScrn, long freq) { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neomagic.cpp b/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neomagic.cpp index 0b8914545..a3b1d5acc 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neomagic.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/neomagic/neomagic.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neomagic.cpp,v 1.5 2000/09/25 23:57:11 mvojkovi Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neomagic.cpp,v 1.7 2000/12/14 08:11:15 herrb Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH NEOMAGIC __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH NEOMAGIC __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME neomagic \- Neomagic video driver .SH SYNOPSIS @@ -73,7 +73,15 @@ Default: no rotation. .BI "Option \*qShadowFB\*q \*q" boolean \*q Enable or disable use of the shadow framebuffer layer. See shadowfb(__drivermansuffix__) for further information. Default: off. -.TP +.PP +.B Note +.br +On some laptops using the 2160 chipset (MagicGraph 128XD) the +following options are needed to avoid a lock-up of the graphic engine: +.nf + Option "XaaNoScanlineImageWriteRect" + Option "XaaNoScanlineCPUToScreenColorExpandFill" +.fi .SH "SEE ALSO" XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile index ae0d85b77..f29a52de1 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile,v 1.1 2000/12/01 19:47:56 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile,v 1.2 2000/12/14 20:59:12 dawes Exp $ #define IHaveModules #include <Server.tmpl> @@ -33,6 +33,11 @@ ObjectModuleTarget(newport,$(OBJS)) InstallObjectModule(newport,$(MODULEDIR),drivers) InstallNamedNonExec($(XF86CONFIG),$(XF86CONFIG),$(LIBDIR)) +#if !defined(XF86DriverSDK) +CppManTarget(newport,) +InstallModuleManPage(newport) +#endif + DependTarget() InstallDriverSDKNonExecFile(Imakefile,$(DRIVERSDKDIR)/drivers/newport) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/newport/XF86Config.indy b/xc/programs/Xserver/hw/xfree86/drivers/newport/XF86Config.indy index 9ebda996e..080fd3de1 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/newport/XF86Config.indy +++ b/xc/programs/Xserver/hw/xfree86/drivers/newport/XF86Config.indy @@ -27,7 +27,7 @@ # dealings in this Software without prior written authorization from the # XFree86 Project. # -# $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/XF86Config.indy,v 1.1 2000/12/01 19:47:57 dawes Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/XF86Config.indy,v 1.2 2000/12/14 20:59:12 dawes Exp $ # ********************************************************************** # This is a configuration file for the Indy's Newport Graphics and the @@ -279,22 +279,10 @@ EndSection # ********************************************************************** Section "Device" - Identifier "Newport Graphics 1" + Identifier "Newport Graphics" Driver "newport" -# Option "shadowfb" "yes" -# Option "Silkenmouse" "no" -# VideoRam 1280 # Option "bitplanes" "24" - BusID "0" -EndSection - -Section "Device" - Identifier "Newport Graphics 2" - Driver "newport" - - Option "shadowfb" "yes" - BusID "1" EndSection # ********************************************************************** @@ -308,7 +296,7 @@ EndSection Section "Screen" Identifier "Screen 1" - Device "Newport Graphics 1" + Device "Newport Graphics" Monitor "SGI GDM17e11" DefaultDepth 8 @@ -318,19 +306,6 @@ Section "Screen" EndSubSection EndSection -Section "Screen" - Identifier "Screen 2" - Device "Newport Graphics 2" - Monitor "SGI GDM17e11" - DefaultDepth 24 - - SubSection "Display" - Depth 24 - Modes "1280x1024" - EndSubSection -EndSection - - # ********************************************************************** # ServerLayout sections. # ********************************************************************** @@ -342,10 +317,3 @@ Section "ServerLayout" InputDevice "Keyboard1" "CoreKeyboard" EndSection -Section "ServerLayout" - Identifier "multihead layout" - Screen "Screen 1" "" "" "" "Screen 2" - Screen "Screen 2" "" "" "Screen 1" "" - InputDevice "Mouse1" "CorePointer" - InputDevice "Keyboard1" "CoreKeyboard" -EndSection diff --git a/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.cpp b/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.cpp new file mode 100644 index 000000000..3eb1954bd --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.cpp @@ -0,0 +1,40 @@ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport.cpp,v 1.1 2000/12/14 20:59:12 dawes Exp $ +.\" shorthand for double quote that works everywhere. +.ds q \N'34' +.TH NEWPORT __drivermansuffix__ "Version 4.0.2" "XFree86" +.SH NAME +newport \- Newport video driver +.SH SYNOPSIS +.nf +.B "Section \*qDevice\*q" +.BI " Identifier \*q" devname \*q +.B " Driver \*qnewport\*q" +\ \ ... +.B EndSection +.fi +.SH DESCRIPTION +.B newport +is an XFree86 driver for the SGI Indy's newport video cards. +.SH SUPPORTED HARDWARE +The +.B newport +driver supports the Newport(sometimes called XL) cards found in SGI Indys. It +does not support the XZ boards. The driver is currently limited to 8bit only. +.SH CONFIGURATION DETAILS +Please refer to XF86Config(__filemansuffix__) for general configuration +details. This section only covers configuration details specific to this +driver. +.PP +The driver auto-detects all device information necessary to initialize +the card. However, if you have problems with auto-detection, you can +specify: +.br +.TP +.BI "Option \*qbitplanes\*q \*q" integer \*q +number of bitplanes of the board (8 or 24) +Default: auto-detected. +.SH "SEE ALSO" +XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__) +.SH AUTHORS +Authors: +Guido Guenther \fIguido.guenther@gmx.net\fP diff --git a/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h b/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h index afab66e82..f6c787cc1 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h @@ -1,15 +1,11 @@ /* * Id: newport.h,v 1.4 2000/11/29 20:58:10 agx Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h,v 1.1 2000/12/01 19:47:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h,v 1.2 2000/12/06 22:00:46 dawes Exp $ */ #ifndef __NEWPORT_H__ #define __NEWPORT_H__ -#ifndef XFree86LOADER -# define NEED_XF86_TYPES /* to make XF86FILE, etc available */ -#endif - /* * All drivers should include these: */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c index 28c97ab71..745240bfd 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c @@ -30,7 +30,7 @@ * Project. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c,v 1.2 2000/12/02 15:30:46 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c,v 1.6 2000/12/14 20:59:12 dawes Exp $ */ /* function prototypes, common data structures & generic includes */ #include "newport.h" @@ -56,6 +56,14 @@ #include "xf86xv.h" #include "Xv.h" +/* Temporary workaround. A module really shouldn't need this */ +#ifndef XFree86LOADER +# include "xf86_OSlib.h" +# ifndef MAP_FAILED +# define MAP_FAILED ((pointer)(-1)) +# endif +#endif + #define VERSION 4000 #define NEWPORT_NAME "Newport" #define NEWPORT_DRIVER_NAME "newport" @@ -79,8 +87,8 @@ static Bool NewportModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); static void NewportRestore(ScrnInfoPtr pScrn, Bool Closing); static Bool NewportGetRec(ScrnInfoPtr pScrn); static Bool NewportFreeRec(ScrnInfoPtr pScrn); -static NewportRegsPtr NewportMapRegs(unsigned cardNum); -static Bool NewportUnmapRegs(unsigned cardNum); +static Bool NewportMapRegs(ScrnInfoPtr pScrn); +static void NewportUnmapRegs(ScrnInfoPtr pScrn); static Bool NewportProbeCardInfo(ScrnInfoPtr pScrn); /* ------------------------------------------------------------------ */ @@ -358,10 +366,10 @@ NewportPreInit(ScrnInfoPtr pScrn, int flags) pScrn->videoRam = 1280 * (pScrn->bitsPerPixel >> 3); /* get revisions of REX3, etc. */ - if( !(pNewport->pNewportRegs = NewportMapRegs(busID))) + if( ! NewportMapRegs(pScrn)) return FALSE; NewportProbeCardInfo(pScrn); - NewportUnmapRegs(busID); + NewportUnmapRegs(pScrn); from=X_PROBED; xf86DrvMsg(pScrn->scrnIndex, from, @@ -370,7 +378,7 @@ NewportPreInit(ScrnInfoPtr pScrn, int flags) pNewport->cmap_rev, pNewport->xmap9_rev); if ( (xf86GetOptValInteger(NewportOptions, OPTION_BITPLANES, &pNewport->bitplanes))) - from = X_CONFIG; + from = X_CONFIG; xf86DrvMsg(pScrn->scrnIndex, from, "Newport has %d bitplanes\n", pNewport->bitplanes); if ( pScrn->depth > pNewport->bitplanes ) { @@ -379,6 +387,12 @@ NewportPreInit(ScrnInfoPtr pScrn, int flags) pScrn->depth, pNewport->bitplanes); return FALSE; } + if ( ( pNewport->bitplanes != 8 ) && ( pNewport->bitplanes != 24 ) ) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, \ + "Number of bitplanes on newport must be either 8 or 24 not %d\n", \ + pNewport->bitplanes); + return FALSE; + } /* Set up clock ranges that are alway ok */ /* XXX: Should use the correct data from the specs(which specs?) here */ @@ -459,7 +473,7 @@ NewportScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) pNewport = NEWPORTPTR(pScrn); /* map the Newportregs until the server dies */ - if( !(pNewport->pNewportRegs = NewportMapRegs(pNewport->busID))) + if( ! NewportMapRegs(pScrn)) return FALSE; /* Reset visual list. */ @@ -585,8 +599,7 @@ NewportCloseScreen(int scrnIndex, ScreenPtr pScreen) xfree(pNewport->ShadowPtr); /* unmap the Newport's registers from memory */ - if(!NewportUnmapRegs(pNewport->busID)) - return FALSE; + NewportUnmapRegs(pScrn); pScrn->vtSema = FALSE; pScreen->CloseScreen = pNewport->CloseScreen; @@ -684,14 +697,14 @@ NewportHWProbe(unsigned probedIDs[]) FILE* cpuinfo; char line[80]; unsigned hasNewport = 0; - cpuinfo = xf86fopen("/proc/cpuinfo","r"); - while(xf86fgets(line,80,cpuinfo) != NULL) { - if(xf86strstr(line, "SGI Indy") != NULL) { + cpuinfo = fopen("/proc/cpuinfo","r"); + while(fgets(line,80,cpuinfo) != NULL) { + if(strstr(line, "SGI Indy") != NULL) { hasNewport = 1; break; } } - xf86fclose(cpuinfo); + fclose(cpuinfo); probedIDs[0] = 0; return hasNewport; @@ -723,40 +736,27 @@ static Bool NewportProbeCardInfo(ScrnInfoPtr pScrn) /* map NewportRegs */ -static NewportRegsPtr -NewportMapRegs(unsigned cardNum) +static Bool +NewportMapRegs(ScrnInfoPtr pScrn) { - int fd; - pointer base; - - if ((fd = xf86open("/dev/mem", XF86_O_RDWR)) < 0) { - FatalError("NewportMapRegs: failed to open /dev/mem (%s)\n", \ - xf86strerror(xf86errno)); - return (NewportRegsPtr)NULL; - } + NewportPtr pNewport = NEWPORTPTR(pScrn); - base = xf86mmap((pointer)0, sizeof(NewportRegs), \ - XF86_PROT_READ | XF86_PROT_WRITE, XF86_MAP_SHARED, fd, \ - NEWPORT_BASE_ADDR0 + cardNum * NEWPORT_BASE_OFFSET); - xf86close(fd); - if (base == XF86_MAP_FAILED) { - FatalError("NewportMapRegs: Could not mmap NewportRegs (0x%08x,0x%x) (%s)\n", \ - NEWPORT_BASE_ADDR0 + cardNum * NEWPORT_BASE_OFFSET, \ - sizeof(NewportRegs), xf86strerror(xf86errno)); - return (NewportRegsPtr)NULL; - } - return (NewportRegsPtr)base; + pNewport->pNewportRegs = xf86MapVidMem(pScrn->scrnIndex, + VIDMEM_MMIO, + NEWPORT_BASE_ADDR0 + pNewport->busID * NEWPORT_BASE_OFFSET, + sizeof(NewportRegs)); + if ( ! pNewport->pNewportRegs ) + return FALSE; + return TRUE; } /* unmap NewportRegs */ -static Bool -NewportUnmapRegs(unsigned cardNum) +static void +NewportUnmapRegs(ScrnInfoPtr pScrn) { - if(xf86munmap( (pointer)(NEWPORT_BASE_ADDR0 + cardNum * NEWPORT_BASE_OFFSET), \ - sizeof(NewportRegs)) == -1) { - FatalError("NewportUnmapRegs: Could not munmap NewportRegs\n"); - return FALSE; - } - return TRUE; -} + NewportPtr pNewport = NEWPORTPTR(pScrn); + xf86UnMapVidMem( pScrn->scrnIndex, pNewport->pNewportRegs, + sizeof(NewportRegs)); + pNewport->pNewportRegs = NULL; +} diff --git a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv.cpp b/xc/programs/Xserver/hw/xfree86/drivers/nv/nv.cpp index 7d1872031..0790ec020 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/nv/nv.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv.cpp,v 1.10 2000/06/14 02:13:12 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv.cpp,v 1.11 2000/12/11 20:18:21 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH NV __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH NV __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME nv \- NVIDIA video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c index 079028165..4ceb56988 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c @@ -24,7 +24,7 @@ /* Hacked together from mga driver and 3.3.4 NVIDIA driver by Jarno Paananen <jpaana@s2.org> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c,v 1.51 2000/12/02 15:30:46 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c,v 1.53 2000/12/14 16:33:09 eich Exp $ */ #include "nv_include.h" @@ -110,6 +110,7 @@ static SymTabRec NVChipsets[] = { { NV_CHIP_GEFORCE2MX, "GeForce2 MX"}, { NV_CHIP_GEFORCE2MXDDR, "GeForce2 MX DDR"}, { NV_CHIP_QUADRO2MXR, "Quadro 2 MXR"}, + { NV_CHIP_GEFORCE2GO, "GeForce 2 Go"}, {-1, NULL } }; @@ -131,6 +132,7 @@ static PciChipsets NVPciChipsets[] = { { NV_CHIP_GEFORCE2MX, NV_CHIP_GEFORCE2MX, RES_SHARED_VGA }, { NV_CHIP_GEFORCE2MXDDR, NV_CHIP_GEFORCE2MXDDR, RES_SHARED_VGA }, { NV_CHIP_QUADRO2MXR, NV_CHIP_QUADRO2MXR, RES_SHARED_VGA }, + { NV_CHIP_GEFORCE2GO, NV_CHIP_GEFORCE2GO, RES_SHARED_VGA }, { -1, -1, RES_UNDEFINED } }; @@ -762,21 +764,22 @@ NVdoDDC(ScrnInfoPtr pScrn) /* if ((MonInfo = nvDoDDCVBE(pScrn))) return MonInfo; */ - /* Save the current state */ - NVSave(pScrn); - /* Enable access to extended registers */ vgaHWUnlock(hwp); pNv->riva.LockUnlock(&pNv->riva, 0); + /* Save the current state */ + NVSave(pScrn); - if ((MonInfo = nvDoDDC2(pScrn))) return MonInfo; + if ((MonInfo = nvDoDDC2(pScrn))) goto done; #if 0 /* disable for now - causes problems on AXP */ - if ((MonInfo = nvDoDDC1(pScrn))) return MonInfo; + if ((MonInfo = nvDoDDC1(pScrn))) goto done; #endif + + done: /* Restore previous state */ NVRestore(pScrn); - - xf86SetDDCproperties(pScrn, MonInfo); + pNv->riva.LockUnlock(&pNv->riva, 1); + vgaHWLock(hwp); return MonInfo; } @@ -1163,6 +1166,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) case NV_CHIP_GEFORCE2MX: case NV_CHIP_GEFORCE2MXDDR: case NV_CHIP_QUADRO2MXR: + case NV_CHIP_GEFORCE2GO: NV10Setup(pScrn); break; } @@ -1504,7 +1508,7 @@ NVModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) if (!(*pNv->ModeInit)(pScrn, mode)) return FALSE; } - + /* Program the registers */ vgaHWProtect(pScrn, TRUE); vgaReg = &hwp->ModeReg; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h b/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h index f27ba8963..95158d4c7 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h,v 1.17 2000/10/09 20:26:24 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h,v 1.18 2000/12/07 21:42:17 mvojkovi Exp $ */ #ifndef __NV_STRUCT_H__ #define __NV_STRUCT_H__ @@ -136,6 +136,7 @@ void NVPointerMoved(int index, int x, int y); #define NV_CHIP_GEFORCE2MX ((PCI_VENDOR_NVIDIA << 16) | PCI_CHIP_GEFORCE2MX) #define NV_CHIP_GEFORCE2MXDDR ((PCI_VENDOR_NVIDIA << 16) | PCI_CHIP_GEFORCE2MXDDR) #define NV_CHIP_QUADRO2MXR ((PCI_VENDOR_NVIDIA << 16) | PCI_CHIP_QUADRO2MXR) +#define NV_CHIP_GEFORCE2GO ((PCI_VENDOR_NVIDIA << 16) | PCI_CHIP_GEFORCE2GO) #define NV_CHIP_GEFORCE2GTS ((PCI_VENDOR_NVIDIA << 16) | PCI_CHIP_GEFORCE2GTS) #define NV_CHIP_GEFORCE2GTS_1 ((PCI_VENDOR_NVIDIA << 16) | PCI_CHIP_GEFORCE2GTS_1) #define NV_CHIP_GEFORCE2ULTRA ((PCI_VENDOR_NVIDIA << 16) | PCI_CHIP_GEFORCE2ULTRA) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c index 7f755f6a8..0171707e4 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c,v 1.37 2000/12/02 15:30:47 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c,v 1.38 2000/12/14 16:33:10 eich Exp $ */ /* * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. * @@ -121,7 +121,7 @@ OptionInfoRec renditionOptions[]={ DriverRec RENDITION={ RENDITION_VERSION_CURRENT, - "rendition driver", + "rendition", renditionIdentify, renditionProbe, renditionAvailableOptions, @@ -644,7 +644,9 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags) pRendition->board.mem_base); /* First of all get a "clean" starting state */ +#if 1 verite_resetboard(pScreenInfo); +#endif /* determine video ram -- to do so, we assume a full size memory of 16M, * then map it and use verite_getmemorysize() to determine the real amount of diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.cpp b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.cpp index 6e9572ba4..e60216399 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.cpp,v 1.5 2000/06/14 02:13:13 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.cpp,v 1.7 2000/12/12 18:54:31 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH RENDITION __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH RENDITION __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME rendition \- Rendition video driver .SH SYNOPSIS @@ -105,7 +105,7 @@ Default: no rotation. For the moment the driver defaults to not request write-combine for any chipset as there has been indications of problems with it. Use .B "Option \*qMTRR\*q" -to let the driver request write-combining of memory access on the videoboard. +to let the driver request write-combining of memory access on the video board. .SH "SEE ALSO" XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__) .SH AUTHORS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c index 004f483c3..141110cc2 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c,v 1.69 2000/12/02 15:30:47 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c,v 1.70 2000/12/14 00:55:25 dawes Exp $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. @@ -2433,11 +2433,17 @@ S3VScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; + + if (!miSetPixmapDepths ()) + return FALSE; } else { if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; + + if (!miSetPixmapDepths ()) + return FALSE; } ret = S3VInternalScreenInit(scrnIndex, pScreen); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.cpp b/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.cpp index 5ce786002..3263812d7 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.cpp,v 1.10 2000/11/28 20:59:18 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3virge.cpp,v 1.12 2000/12/12 18:54:31 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH s3virge __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH s3virge __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME s3virge \- S3 ViRGE video driver .SH SYNOPSIS @@ -60,7 +60,7 @@ driver supports PCI and AGP video cards based on the following S3 chips: Please refer to XF86Config(__filemansuffix__) for general configuration details. This section only covers configuration details specific to this driver. All options names are case and white space insensitive when -parsed by the server, for exmaple, "virge vx" and "VIRGEvx" are equivalent. +parsed by the server, for example, "virge vx" and "VIRGEvx" are equivalent. .PP The driver auto-detects the chipset type, but the following .B ChipSet diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.cpp b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.cpp index 9c4631d37..d35f7f8ad 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage.cpp,v 1.1 2000/12/02 01:16:11 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage.cpp,v 1.2 2000/12/11 20:18:25 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH SAVAGE __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH SAVAGE __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME savage \- S3 Savage video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c index cb5e07763..2dfaf1432 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c,v 1.2 2000/12/02 15:30:49 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c,v 1.4 2000/12/07 20:26:22 dawes Exp $ */ /* * @@ -320,7 +320,7 @@ SavageSetGBD( ScrnInfoPtr pScrn ) /* Set stride to use GBD. */ VGAOUT8(vgaCRIndex, 0x50); - VGAOUT8(vgaCRReg, inb(vgaCRReg) | 0xC1); + VGAOUT8(vgaCRReg, VGAIN8(vgaCRReg) | 0xC1); /* Enable 2D engine. */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c index 25e9ee027..4227e11c7 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c,v 1.3 2000/12/04 18:49:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c,v 1.6 2000/12/12 16:50:48 dawes Exp $ */ /* * vim: sw=4 ts=8 ai ic: * @@ -15,6 +15,12 @@ #include "xf86RAC.h" #include "shadowfb.h" +#ifdef DPMSExtension +#include "globals.h" +#define DPMS_SERVER +#include "extensions/dpms.h" +#endif /* DPMSExtension */ + #include "savage_driver.h" #include "savage_bci.h" @@ -43,7 +49,8 @@ static int SavageInternalScreenInit(int scrnIndex, ScreenPtr pScreen); static ModeStatus SavageValidMode(int index, DisplayModePtr mode, Bool verbose, int flags); -static Bool SavageMapMem(ScrnInfoPtr pScrn); +static Bool SavageMapMMIO(ScrnInfoPtr pScrn); +static Bool SavageMapFB(ScrnInfoPtr pScrn); static void SavageUnmapMem(ScrnInfoPtr pScrn); static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); static Bool SavageCloseScreen(int scrnIndex, ScreenPtr pScreen); @@ -57,6 +64,9 @@ static void SavageCalcClock(long freq, int min_m, int min_n1, int max_n1, unsigned int *ndiv, unsigned int *r); void SavageGEReset(ScrnInfoPtr pScrn, int from_timeout, int line, char *file); void SavagePrintRegs(ScrnInfoPtr pScrn); +#ifdef DPMSExtension +static void SavageDPMS(ScrnInfoPtr pScrn, int mode, int flags); +#endif static int pix24bpp = 0; @@ -794,17 +804,18 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) } psav->EntityIndex = pEnt->index; - if (xf86LoadSubModule(pScrn, "int10")) { - xf86LoaderReqSymLists(int10Symbols, NULL); - psav->pInt10 = xf86InitInt10(pEnt->index); - } + if (psav->UseBIOS) { + if (xf86LoadSubModule(pScrn, "int10")) { + xf86LoaderReqSymLists(int10Symbols, NULL); + psav->pInt10 = xf86InitInt10(pEnt->index); + } - if (xf86LoadSubModule(pScrn, "vbe")) { - xf86LoaderReqSymLists(vbeSymbols, NULL); - psav->pVbe = VBEInit(psav->pInt10, pEnt->index); + if (xf86LoadSubModule(pScrn, "vbe")) { + xf86LoaderReqSymLists(vbeSymbols, NULL); + psav->pVbe = VBEInit(psav->pInt10, pEnt->index); + } } - psav->PciInfo = xf86GetPciInfoForEntity(pEnt->index); xf86RegisterResources(pEnt->index, NULL, ResNone); xf86SetOperatingState(RES_SHARED_VGA, pEnt->index, ResUnusedOpr); @@ -848,6 +859,10 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) psav->PciInfo->func); hwp = VGAHWPTR(pScrn); + + if (!SavageMapMMIO(pScrn)) + return FALSE; + vgaHWGetIOBase(hwp); vgaIOBase = hwp->IOBase; vgaCRIndex = vgaIOBase + 4; @@ -1052,10 +1067,6 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected current MCLK value of %1.3f MHz\n", mclk / 1000.0); -#if 0 - SavageUnmapMem(pScrn); -#endif - psav->minClock = 20000; pScrn->maxHValue = 2048; @@ -1100,7 +1111,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) SavageFreeBIOSModeTable( psav, &psav->ModeTable ); } - psav->ModeTable = SavageGetBIOSModeTable( psav, pScrn->bitsPerPixel ); + psav->ModeTable = SavageGetBIOSModeTable( psav, pScrn->depth ); if( !psav->ModeTable || !psav->ModeTable->NumModes ) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -1195,9 +1206,6 @@ static Bool SavageEnterVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; -#if 0 - SavageMapMem(pScrn); -#endif SavageSave(pScrn); return SavageModeInit(pScrn, pScrn->currentMode); } @@ -1212,10 +1220,6 @@ static void SavageLeaveVT(int scrnIndex, int flags) SavageRegPtr SavageSavePtr = &psav->SavedReg; SavageWriteMode(pScrn, vgaSavePtr, SavageSavePtr); - -#if 0 - SavageUnmapMem(pScrn); -#endif } @@ -1443,13 +1447,15 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, /* Disable old MMIO. */ VGAOUT8(vgaCRIndex, 0x53); - VGAOUT8(vgaCRReg, VGAIN8(vgaCRReg) & ~0x10); + tmp = VGAIN8(vgaCRReg); + VGAOUT8(vgaCRReg, tmp & ~0x10); /* We may need TV/panel fixups here. See s3bios.c line 2904. */ /* Set FIFO fetch delay. */ VGAOUT8(vgaCRIndex, 0x85); - VGAOUT8(vgaCRReg, (VGAIN8(vgaCRReg) & 0xf8) | 0x03); + tmp = VGAIN8(vgaCRReg); + VGAOUT8(vgaCRReg, (tmp & 0xf8) | 0x03); /* Patch CR79. These values are magical. */ @@ -1518,7 +1524,8 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, /* Handle the pitch. */ VGAOUT8(vgaCRIndex, 0x50); - VGAOUT8(vgaCRReg, VGAIN8(vgaCRReg) | 0xC1); + tmp = VGAIN8(vgaCRReg); + VGAOUT8(vgaCRReg, tmp | 0xC1); width = (pScrn->displayWidth * (pScrn->bitsPerPixel / 8)) >> 3; VGAOUT16(vgaCRIndex, ((width & 0xff) << 8) | 0x13 ); @@ -1529,7 +1536,8 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, if( psav->Chipset == S3_SAVAGE2000 ) { VGAOUT8(vgaCRIndex, 0x73); - VGAOUT8(vgaCRReg, VGAIN8(vgaCRReg) & 0xdf ); + tmp = VGAIN8(vgaCRReg); + VGAOUT8(vgaCRReg, tmp & 0xdf ); } else if( psav->Chipset != S3_SAVAGE_MX ) { @@ -1538,7 +1546,8 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, { /* Not SGRAM; disable block write. */ VGAOUT8(vgaCRIndex, 0x88); - VGAOUT8(vgaCRReg, VGAIN8(vgaCRReg) | 0x10); + tmp = VGAIN8(vgaCRReg); + VGAOUT8(vgaCRReg, tmp | 0x10); } } @@ -1767,7 +1776,8 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, if( graphicsMode && (!psav->NoAccel) ) { VGAOUT8(vgaCRIndex, 0x50); - VGAOUT8(vgaCRReg, VGAIN8(vgaCRReg) | 0xC1); + tmp = VGAIN8(vgaCRReg); + VGAOUT8(vgaCRReg, tmp | 0xC1); SavageInitialize2DEngine(pScrn); } @@ -1785,7 +1795,7 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, } -static Bool SavageMapMem(ScrnInfoPtr pScrn) +static Bool SavageMapMMIO(ScrnInfoPtr pScrn) { SavagePtr psav; vgaHWPtr hwp; @@ -1822,6 +1832,19 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn) psav->BciMem = psav->MapBase + 0x10000; + SavageEnableMMIO(pScrn); + hwp = VGAHWPTR(pScrn); + vgaHWGetIOBase(hwp); + + return TRUE; +} + + + +static Bool SavageMapFB(ScrnInfoPtr pScrn) +{ + SavagePtr psav = SAVPTR(pScrn); + xf86DrvMsg( pScrn->scrnIndex, X_PROBED, "mapping framebuffer @ 0x%x with size 0x%x\n", psav->FrameBufferBase, psav->videoRambytes); @@ -1840,19 +1863,6 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn) pScrn->memPhysBase = psav->PciInfo->memBase[0]; pScrn->fbOffset = 0; /* psav->FBCursorOffset = psav->videoRambytes - 1024; */ - SavageEnableMMIO(pScrn); - hwp = VGAHWPTR(pScrn); -/* vgaHWSetMmioFuncs(hwp, psav->MapBase, SAVAGE_NEWMMIO_REGSIZE); */ - vgaHWGetIOBase(hwp); - -#if 0 - if (xf86IsPrimaryPci(psav->PciInfo)) { - hwp->MapSize = 0x10000; - if (!vgaHWMapMem(pScrn)) - return FALSE; - psav->PrimaryVidMapped = TRUE; - } -#endif return TRUE; } @@ -1895,7 +1905,7 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen, pScrn = xf86Screens[pScreen->myNum]; psav = SAVPTR(pScrn); - if (!SavageMapMem(pScrn)) + if (!SavageMapFB(pScrn)) return FALSE; SavageSave(pScrn); @@ -1992,6 +2002,11 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen, pScreen->SaveScreen = SavageSaveScreen; pScreen->CloseScreen = SavageCloseScreen; +#ifdef DPMSExtension + if (xf86DPMSInit(pScreen, SavageDPMS, 0) == FALSE) + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DPMS initialization failed\n"); +#endif + if (serverGeneration == 1) xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); @@ -2454,15 +2469,15 @@ Bool SavageSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) void SavageEnableMMIO(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); - /*SavagePtr psav = SAVPTR(pScrn); */ + SavagePtr psav = SAVPTR(pScrn); int vgaCRIndex, vgaCRReg; unsigned char val; - vgaHWSetStdFuncs(hwp); + vgaHWSetMmioFuncs(hwp, psav->MapBase, 0x8000); val = VGAIN8(0x3c3); VGAOUT8(0x3c3, val | 0x01); val = VGAIN8(VGA_MISC_OUT_R); - outb(VGA_MISC_OUT_W, val | 0x01); + VGAOUT8(VGA_MISC_OUT_W, val | 0x01); vgaHWGetIOBase(hwp); vgaCRIndex = hwp->IOBase + 4; vgaCRReg = hwp->IOBase + 5; @@ -2478,7 +2493,7 @@ void SavageEnableMMIO(ScrnInfoPtr pScrn) void SavageDisableMMIO(ScrnInfoPtr pScrn) { vgaHWPtr hwp = VGAHWPTR(pScrn); - /*SavagePtr psav = SAVPTR(pScrn);*/ + SavagePtr psav = SAVPTR(pScrn); int vgaCRIndex, vgaCRReg; unsigned char val; @@ -2497,6 +2512,7 @@ void SavageDisableMMIO(ScrnInfoPtr pScrn) void SavageLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, LOCO *colors, VisualPtr pVisual) { + SavagePtr psav = SAVPTR(pScrn); int i, index; for (i=0; i<numColors; i++) { @@ -2657,6 +2673,7 @@ void SavageGEReset(ScrnInfoPtr pScrn, int from_timeout, int line, char *file) void SavagePrintRegs(ScrnInfoPtr pScrn) { + SavagePtr psav = SAVPTR(pScrn); unsigned char i; int vgaCRIndex = 0x3d4; int vgaCRReg = 0x3d5; @@ -2666,8 +2683,8 @@ SavagePrintRegs(ScrnInfoPtr pScrn) for( i = 0; i < 0x70; i++ ) { if( !(i % 16) ) ErrorF( "\nSR%xx ", i >> 4 ); - outb( 0x3c4, i ); - ErrorF( " %02x", inb(0x3c5) ); + VGAOUT8( 0x3c4, i ); + ErrorF( " %02x", VGAIN8(0x3c5) ); } ErrorF( "\n\nCR x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF" ); @@ -2675,9 +2692,50 @@ SavagePrintRegs(ScrnInfoPtr pScrn) for( i = 0; i < 0xB7; i++ ) { if( !(i % 16) ) ErrorF( "\nCR%xx ", i >> 4 ); - outb( vgaCRIndex, i ); - ErrorF( " %02x", inb(vgaCRReg) ); + VGAOUT8( vgaCRIndex, i ); + ErrorF( " %02x", VGAIN8(vgaCRReg) ); } ErrorF("\n\n"); } + + +#ifdef DPMSExtension +static void SavageDPMS(ScrnInfoPtr pScrn, int mode, int flags) +{ + SavagePtr psav = SAVPTR(pScrn); + unsigned char sr8 = 0x00, srd = 0x00; + + VGAOUT8(0x3c4, 0x08); + sr8 = VGAIN8(0x3c5); + sr8 |= 0x06; + VGAOUT8(0x3c5, sr8); + + VGAOUT8(0x3c4, 0x0d); + srd = VGAIN8(0x3c5); + + srd &= 0x03; + + switch (mode) { + case DPMSModeOn: + break; + case DPMSModeStandby: + srd |= 0x10; + break; + case DPMSModeSuspend: + srd |= 0x40; + break; + case DPMSModeOff: + srd |= 0x50; + break; + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid DPMS mode %d\n", mode); + break; + } + + VGAOUT8(0x3c4, 0x0d); + VGAOUT8(0x3c5, srd); + + return; +} +#endif /* DPMSExtension */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h index 42e742415..d05cdb19e 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h,v 1.2 2000/12/02 15:30:49 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h,v 1.3 2000/12/07 20:26:22 dawes Exp $ */ #ifndef SAVAGE_VGAHWMMIO_H #define SAVAGE_VGAHWMMIO_H @@ -23,13 +23,13 @@ #include "savage_regs.h" -#define VGAIN8(addr) inb(addr) -#define VGAIN16(addr) inw(addr) -#define VGAIN(addr) inl(addr) +#define VGAIN8(addr) MMIO_IN8(psav->MapBase+0x8000, addr) +#define VGAIN16(addr) MMIO_IN16(psav->MapBase+0x8000, addr) +#define VGAIN(addr) MMIO_IN32(psav->MapBase+0x8000, addr) -#define VGAOUT8(addr,val) outb(addr,val) -#define VGAOUT16(addr,val) outw(addr,val) -#define VGAOUT(addr,val) outl(addr,val) +#define VGAOUT8(addr,val) MMIO_OUT8(psav->MapBase+0x8000, addr, val) +#define VGAOUT16(addr,val) MMIO_OUT16(psav->MapBase+0x8000, addr, val) +#define VGAOUT(addr,val) MMIO_OUT32(psav->MapBase+0x8000, addr, val) #define INREG(addr) MMIO_IN32(psav->MapBase, addr) #define OUTREG(addr,val) MMIO_OUT32(psav->MapBase, addr, val) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h index b1a21ea93..679795c8d 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h,v 1.3 2000/12/04 18:50:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h,v 1.4 2000/12/07 20:26:22 dawes Exp $ */ #ifndef _SAVAGE_REGS_H #define _SAVAGE_REGS_H @@ -97,11 +97,11 @@ enum S3CHIPTAGS { #define VerticalRetraceWait() \ { \ - outb(vgaCRIndex, 0x17); \ - if (inb(vgaCRReg) & 0x80) { \ - while ((inb(vgaIOBase + 0x0a) & 0x08) == 0x00) ; \ - while ((inb(vgaIOBase + 0x0a) & 0x08) == 0x08) ; \ - while ((inb(vgaIOBase + 0x0a) & 0x08) == 0x00) ; \ + VGAOUT8(vgaCRIndex, 0x17); \ + if (VGAIN8(vgaCRReg) & 0x80) { \ + while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x00) ; \ + while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x08) ; \ + while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x00) ; \ } \ } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README index 3e8b8b264..c7ed98328 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README +++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README @@ -20,6 +20,7 @@ Display: - "ShadowFB" Use shadow framebuffer. Default: off. - "Rotate" "cw" | "ccw" Rotate the screen CW - clockwise or CCW - counter clockwise. Uses ShadowFB. Default: no rotation. +- "UseBIOS" Use BIOS to set modes. Default: on. Overlays: @@ -71,4 +72,4 @@ Debug: Header: //Mercury/Projects/archives/XFree86/4.0/README.-arc 1.2 14 Sep 2000 12:28:36 Frido $ -$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README,v 1.1 2000/11/28 20:59:18 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/README,v 1.2 2000/12/05 21:18:37 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt index 28fca6afc..a9448ee81 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt +++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt @@ -1,5 +1,32 @@ -------------------------------------------------------------------------------- Silicon Motion Driver for XFree86 4.0.1 + Alpha Release 1.2.0, 12/13/2000 +-------------------------------------------------------------------------------- + +Fixed bugs: + +- When restoring from VESAFB graphics mode, the screen did not update with the + UseBIOS switch on. + +-------------------------------------------------------------------------------- + Silicon Motion Driver for XFree86 4.0.1 + Alpha Release 1.1.9, 11/30/2000 +-------------------------------------------------------------------------------- + +Fixed bugs: + +#581 - Need Linux driver to support zooming via ctrl+alt++ & ctrl+alt+-. +#670 - Screen broken occurs when switch back to the Xwindow during in Rotation + mode. +#671 - Very slow to pop up the Exit menu from X windows during in Rotation mode. +#672 - It doesn't redraw properly in X windows during in Rotation mode. +#689 - Screen broken when toggle between terminal and desktop during playing in + MPEG. +#705 - Linux CRT only 800x600 or 1024x768 there is no display. +#864 - Lockup when video is playing and switching to full-screen command shell. + +-------------------------------------------------------------------------------- + Silicon Motion Driver for XFree86 4.0.1 Alpha Release 1.1.8, 11/27/2000 -------------------------------------------------------------------------------- @@ -121,6 +148,6 @@ This driver has been tested on the LynxEM+ 712 chip under 16-bit mode. Any other mode might still show lock-ups and/or garbage. Please report any problems to frido@siliconmotion.com. -Header: //Mercury/Projects/archives/XFree86/4.0/Release.txt-arc 1.23 27 Nov 2000 14:22:48 Frido $ +Header: //Mercury/Projects/archives/XFree86/4.0/Release.txt-arc 1.30 30 Nov 2000 17:00:58 Frido $ -$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt,v 1.1 2000/11/28 20:59:18 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/Release.txt,v 1.3 2000/12/14 01:05:43 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.cpp b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.cpp index 116da41dc..43ab525f7 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.cpp @@ -1,14 +1,16 @@ -.\" Header: //Mercury/Projects/archives/XFree86/4.0/siliconmotion.cpp-arc 1.3 21 Nov 2000 18:35:46 Frido $ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.cpp,v 1.1 2000/11/28 20:59:19 dawes Exp $ -.TH siliconmotion __drivermansuffix__ "Version 4.0" "XFree86" +.\" Header: //Mercury/Projects/archives/XFree86/4.0/siliconmotion.cpp-arc 1.4 29 Nov 2000 14:12:56 Frido $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/siliconmotion.cpp,v 1.4 2000/12/12 18:54:31 dawes Exp $ +.\" shorthand for double quote that works everywhere. +.ds q \N'34' +.TH siliconmotion __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME siliconmotion \- Silicon Motion video driver .SH SYNOPSIS -.B "Section ""Device""" +.B "Section \*qDevice\*q" .br -.BI " Identifier """ devname """" +.BI " Identifier \*q" devname \*q .br -.B " Driver ""siliconmotion""" +.B " Driver \*qsiliconmotion\*q" .br \ \ ... .br @@ -50,12 +52,12 @@ SM720 Please refer to XF86Config(__filemansuffix__) for general configuration details. This section only covers configuration details specific to this driver. All options names are case and white space insensitive when -parsed by the server, for exmaple, "lynxe" and "LynxE" are equivalent. +parsed by the server, for example, "lynxe" and "LynxE" are equivalent. .PP The driver auto-detects the chipset type, but the following .B ChipSet names may optionally be specified in the config file -.B """Device""" +.B \*qDevice\*q section, and will override the auto-detection: .PP .RS 4 @@ -67,10 +69,10 @@ The following Cursor .B Options are supported: .TP -.BI "Option ""HWCursor"" [""" boolean """] +.BI "Option \*qHWCursor\*q \*q" boolean \*q Enable or disable the HW cursor. Default: on. .TP -.BI "Option ""SWCursor"" [""" boolean """] +.BI "Option \*qSWCursor\*q \*q" boolean \*q Inverse of "HWCursor". Default: off. .PP @@ -78,29 +80,31 @@ The following display .B Options are supported: .TP -.BI "Option ""ShadowFB"" [""" boolean """] +.BI "Option \*qShadowFB\*q \*q" boolean \*q Use shadow framebuffer. Default: off. .TP -.BI "Option ""Rotate"" """ cw " | " ccw """ +.BI "Option \*qRotate\*q \*qCW\*q" +.TP +.BI "Option \*qRotate\*q \*qCCW\*q" Rotate the screen CW - clockwise or CCW - counter clockwise. Uses ShadowFB. Default: no rotation. .TP -.BI "Option ""VideoKey"" [""" integer """] -Set the video colorkey. Default: a little off full blue. +.BI "Option \*qVideoKey\*q \*q" integer \*q +Set the video color key. Default: a little off full blue. .TP -.BI "Option ""ByteSwap"" [""" boolean """] +.BI "Option \*qByteSwap\*q \*q" boolean \*q Turn on byte swapping for capturing using SMI demo board. Default: off. .TP -.BI "Option ""UseBIOS"" [""" boolean """] +.BI "Option \*qUseBIOS\*q \*q" boolean \*q Use the BIOS to set the modes. This is used for custom panel timings. -Default: off. +Default: on. .PP The following video memory .B Options are supported: .TP -.BI "Option ""set_mclk"" """ integer """ +.BI "Option \*qset_mclk\*q \*q" integer \*q sets the memory clock, where .I integer is in kHz, and @@ -114,7 +118,7 @@ The following acceleration and graphics engine .B Options are supported: .TP -.B "Option ""NoAccel"" +.B "Option \*qNoAccel\*q" Disable acceleration. Very useful for determining if the driver has problems with drawing and acceleration routines. This is the first option to try if your server runs but you see graphic corruption on the screen. @@ -122,7 +126,11 @@ Using it decreases performance, as it uses software emulation for drawing operations the video driver can accelerate with hardware. Default: acceleration is enabled. .TP -.BR "Option ""fifo_aggressive " | " fifo_moderate " | " fifo_conservative""" +.B "Option \*qfifo_aggressive\*q" +.TP +.B "Option \*qfifo_moderate\*q" +.TP +.B "Option \*qfifo_conservative\*q" alter the settings for the threshold at which the pixel FIFO takes over the internal memory bus to refill itself. The smaller this threshold, the better @@ -143,11 +151,11 @@ The following PCI bus .B Options are supported: .TP -.BI "Option ""pci_burst"" [""" boolean """] +.BI "Option \*qpci_burst\*q \*q" boolean \*q will enable PCI burst mode. This should work on all but a few broken PCI chipsets, and will increase performance. Default: off. .TP -.BI "Option ""pci_retry"" [""" boolean """] +.BI "Option \*qpci_retry\*q \*q" boolean \*q will allow the driver to rely on PCI Retry to program the ViRGE registers. .B "pci_burst" @@ -162,12 +170,12 @@ The following additional .B Options are supported: .TP -.BI "Option ""ShowCache"" [""" boolean """] +.BI "Option \*qShowCache\*q \*q" boolean \*q Enable or disable viewing offscreen cache memory. A development debug option. Default: off. .SH SEE ALSO -XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(1) +XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__) .SH SUPPORT For assistance with this driver, or XFree86 in general, check the XFree86 web diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h index ff54368a0..dbe80934e 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h @@ -1,4 +1,4 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi.h-arc 1.48 10 Nov 2000 15:56:38 Frido $ */ +/* Header: //Mercury/Projects/archives/XFree86/4.0/smi.h-arc 1.51 29 Nov 2000 17:45:16 Frido $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. @@ -26,7 +26,7 @@ Silicon Motion shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the XFree86 Project and Silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h,v 1.1 2000/11/28 20:59:19 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h,v 1.2 2000/12/05 21:18:37 dawes Exp $ */ #ifndef _SMI_H #define _SMI_H @@ -192,6 +192,14 @@ typedef struct int ShadowWidthBytes; /* Width of shadow buffer in bytes */ int ShadowWidth; /* Width of shadow buffer in pixels */ int ShadowHeight; /* Height of shadow buffer in pixels */ + CARD32 saveBufferSize; /* #670 - FB save buffer size */ + void * pSaveBuffer; /* #670 - FB save buffer */ + CARD32 savedFBOffset; /* #670 - Saved FBOffset value */ + CARD32 savedFBReserved; /* #670 - Saved FBReserved value */ + + /* Polylines - #671 */ + ValidateGCProcPtr ValidatePolylines;/* Org. ValidatePolylines function */ + Bool polyLines; /* Our polylines patch is active */ void (*PointerMoved)(int index, int x, int y); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c index 421c020c4..516b22d29 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c @@ -1,4 +1,4 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_accel.c-arc 1.12 27 Nov 2000 15:46:54 Frido $ */ +/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_accel.c-arc 1.15 29 Nov 2000 12:12:04 Frido $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. @@ -26,7 +26,7 @@ Silicon Motion shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the XFree86 Project and silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c,v 1.1 2000/11/28 20:59:19 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_accel.c,v 1.2 2000/12/05 21:18:37 dawes Exp $ */ #include "smi.h" @@ -63,6 +63,9 @@ static void SMI_SubsequentImageWriteRect(ScrnInfoPtr, int, int, int, int, int); #endif static void SMI_SetClippingRectangle(ScrnInfoPtr, int, int, int, int); static void SMI_DisableClipping(ScrnInfoPtr); +/* #671 */ +static void SMI_ValidatePolylines(GCPtr, unsigned long, DrawablePtr); +static void SMI_Polylines(DrawablePtr, GCPtr, int, int, DDXPointPtr); Bool SMI_AccelInit(ScreenPtr pScreen) @@ -164,7 +167,8 @@ SMI_AccelInit(ScreenPtr pScreen) | HARDWARE_CLIP_MONO_8x8_FILL | HARDWARE_CLIP_COLOR_8x8_FILL | HARDWARE_CLIP_SOLID_FILL - | HARDWARE_CLIP_SOLID_LINE; + | HARDWARE_CLIP_SOLID_LINE + | HARDWARE_CLIP_DASHED_LINE; infoPtr->SetClippingRectangle = SMI_SetClippingRectangle; infoPtr->DisableClipping = SMI_DisableClipping; @@ -219,6 +223,11 @@ SMI_AccelInit(ScreenPtr pScreen) xf86InitFBManager(pScreen, &AvailFBArea); ret = XAAInit(pScreen, infoPtr); + if (ret && pSmi->shadowFB) /* #671 */ + { + pSmi->ValidatePolylines = infoPtr->ValidatePolylines; + infoPtr->ValidatePolylines = SMI_ValidatePolylines; + } LEAVE_PROC("SMI_AccelInit"); return(ret); @@ -930,3 +939,163 @@ SMI_DisableClipping(ScrnInfoPtr pScrn) LEAVE_PROC("SMI_DisableClipping"); } + +/******************************************************************************/ +/* Polylines #671 */ +/******************************************************************************/ + +/* + +In order to speed up the "logout" screen in rotated modes, we need to intercept +the Polylines function. Normally, the polylines are drawn and the shadowFB is +then sending a request of the bounding rectangle of those poylines. This should +be okay, if it weren't for the fact that the Gnome logout screen is drawing +polylines in rectangles and this asks for a rotation of the entire rectangle. +This is very slow. + +To circumvent this slowness, we intercept the ValidatePolylines function and +override the default "Fallback" Polylines with our own Polylines function. Our +Polylines function first draws the polylines through the original Fallback +function and then rotates the lines, line by line. We then set a flag and +return control to the shadowFB which will try to rotate the bounding rectangle. +However, the flag has been set and the RefreshArea function does nothing but +clear the flag so the next Refresh that comes in shoiuld be handled correctly. + +All this code improves the speed quite a bit. + +*/ + +#define IS_VISIBLE(pWin) \ +( \ + pScrn->vtSema \ + && (((WindowPtr) pWin)->visibility != VisibilityFullyObscured) \ +) + +#define TRIM_BOX(box, pGC) \ +{ \ + BoxPtr extents = &pGC->pCompositeClip->extents; \ + if (box.x1 < extents->x1) box.x1 = extents->x1; \ + if (box.y1 < extents->y1) box.y1 = extents->y1; \ + if (box.x2 > extents->x2) box.x2 = extents->x2; \ + if (box.y2 > extents->y2) box.y2 = extents->y2; \ +} + +#define TRANSLATE_BOX(box, pDraw) \ +{ \ + box.x1 += pDraw->x; \ + box.y1 += pDraw->y; \ + box.x2 += pDraw->x; \ + box.y2 += pDraw->y; \ +} + +#define BOX_NOT_EMPTY(box) \ + ((box.x2 > box.x1) && (box.y2 > box.y1)) + +static void +SMI_ValidatePolylines(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) +{ + XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); + SMIPtr pSmi = SMIPTR(infoRec->pScrn); + + ENTER_PROC("SMI_ValidatePolylines"); + + pSmi->ValidatePolylines(pGC, changes, pDraw); + if (pGC->ops->Polylines == XAAFallbackOps.Polylines) + { + /* Override the Polylines function with our own Polylines function. */ + pGC->ops->Polylines = SMI_Polylines; + } + + LEAVE_PROC("SMI_ValidatePolylines"); +} + +static void +SMI_Polylines(DrawablePtr pDraw, GCPtr pGC, int mode, int npt, + DDXPointPtr pptInit) +{ + XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); + ScrnInfoPtr pScrn = infoRec->pScrn; + SMIPtr pSmi = SMIPTR(pScrn); + + ENTER_PROC("SMI_Polylines"); + + /* Call the original Polylines function. */ + pGC->ops->Polylines = XAAFallbackOps.Polylines; + (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit); + pGC->ops->Polylines = SMI_Polylines; + + if (IS_VISIBLE(pDraw) && npt) + { + /* Allocate a temporary buffer for all segments of the polyline. */ + BoxPtr pBox = xnfcalloc(sizeof(BoxRec), npt); + int extra = pGC->lineWidth >> 1, box; + + if (npt > 1) + { + /* Adjust the extra space required per polyline segment. */ + if (pGC->joinStyle == JoinMiter) + { + extra = 6 * pGC->lineWidth; + } + else if (pGC->capStyle == CapProjecting) + { + extra = pGC->lineWidth; + } + } + + for (box = 0; --npt;) + { + /* Setup the bounding box for one polyline segment. */ + pBox[box].x1 = pptInit->x; + pBox[box].y1 = pptInit->y; + pptInit++; + pBox[box].x2 = pptInit->x; + pBox[box].y2 = pptInit->y; + if (mode == CoordModePrevious) + { + pBox[box].x2 += pBox[box].x1; + pBox[box].y2 += pBox[box].y1; + } + + /* Sort coordinates. */ + if (pBox[box].x1 > pBox[box].x2) + { + int tmp = pBox[box].x1; + pBox[box].x1 = pBox[box].x2; + pBox[box].x2 = tmp; + } + if (pBox[box].y1 > pBox[box].y2) + { + int tmp = pBox[box].y1; + pBox[box].y1 = pBox[box].y2; + pBox[box].y2 = tmp; + } + + /* Add extra space required for each polyline segment. */ + pBox[box].x1 -= extra; + pBox[box].y1 -= extra; + pBox[box].x2 += extra + 1; + pBox[box].y2 += extra + 1; + + /* See if we need to draw this polyline segment. */ + TRANSLATE_BOX(pBox[box], pDraw); + TRIM_BOX(pBox[box], pGC); + if (BOX_NOT_EMPTY(pBox[box])) + { + box++; + } + } + + if (box) + { + /* Refresh all polyline segments now. */ + SMI_RefreshArea(pScrn, box, pBox); + } + + /* Free the temporary buffer. */ + xfree(pBox); + } + + pSmi->polyLines = TRUE; + LEAVE_PROC("SMI_Polylines"); +} diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c index 1bbb6f7e7..719399f9f 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c @@ -1,4 +1,4 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_driver.c-arc 1.31 27 Nov 2000 14:20:52 Frido $ */ +/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_driver.c-arc 1.40 06 Dec 2000 15:35:00 Frido $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. @@ -26,7 +26,7 @@ Silicon Motion shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The XFree86 Project or Silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c,v 1.4 2000/12/02 15:30:50 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c,v 1.6 2000/12/14 01:05:43 dawes Exp $ */ #include "xf86Resources.h" #include "xf86RAC.h" @@ -84,12 +84,12 @@ static void SMI_FreeScreen(int ScrnIndex, int flags); static void SMI_ProbeDDC(ScrnInfoPtr pScrn, int index); -#define SILICONMOTION_NAME "Silicon Motion" +#define SILICONMOTION_NAME "Silicon Motion" #define SILICONMOTION_DRIVER_NAME "siliconmotion" -#define SILICONMOTION_VERSION_NAME "1.1.8" +#define SILICONMOTION_VERSION_NAME "1.2.0" #define SILICONMOTION_VERSION_MAJOR 1 -#define SILICONMOTION_VERSION_MINOR 1 -#define SILICONMOTION_PATCHLEVEL 8 +#define SILICONMOTION_VERSION_MINOR 2 +#define SILICONMOTION_PATCHLEVEL 0 #define SILICONMOTION_DRIVER_VERSION ( (SILICONMOTION_VERSION_MAJOR << 24) \ | (SILICONMOTION_VERSION_MINOR << 16) \ | (SILICONMOTION_PATCHLEVEL) \ @@ -795,6 +795,11 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: UseBIOS %s.\n", pSmi->useBIOS ? "enabled" : "disabled"); } + else + { + /* Default to UseBIOS enabled. */ + pSmi->useBIOS = TRUE; + } /* Find the PCI slot for this screen */ pEnt = xf86GetEntityInfo(pScrn->entityList[0]); @@ -1206,6 +1211,7 @@ static Bool SMI_EnterVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SMIPtr pSmi = SMIPTR(pScrn); Bool ret; ENTER_PROC("SMI_EnterVT"); @@ -1214,8 +1220,34 @@ SMI_EnterVT(int scrnIndex, int flags) SMI_MapMem(pScrn); SMI_Save(pScrn); + /* #670 */ + if (pSmi->shadowFB) + { + pSmi->FBOffset = pSmi->savedFBOffset; + pSmi->FBReserved = pSmi->savedFBReserved; + } + ret = SMI_ModeInit(pScrn, pScrn->currentMode); + /* #670 */ + if (ret && pSmi->shadowFB) + { + BoxRec box; + + if (pSmi->pSaveBuffer) + { + memcpy(pSmi->FBBase, pSmi->pSaveBuffer, pSmi->saveBufferSize); + xfree(pSmi->pSaveBuffer); + pSmi->pSaveBuffer = NULL; + } + + box.x1 = 0; + box.y1 = 0; + box.x2 = pScrn->virtualY; + box.y2 = pScrn->virtualX; + SMI_RefreshArea(pScrn, 1, &box); + } + LEAVE_PROC("SMI_EnterVT"); return(ret); } @@ -1237,6 +1269,20 @@ SMI_LeaveVT(int scrnIndex, int flags) ENTER_PROC("SMI_LeaveVT"); + /* #670 */ + if (pSmi->shadowFB) + { + pSmi->pSaveBuffer = xnfalloc(pSmi->saveBufferSize); + if (pSmi->pSaveBuffer) + { + memcpy(pSmi->pSaveBuffer, pSmi->FBBase, pSmi->saveBufferSize); + } + + pSmi->savedFBOffset = pSmi->FBOffset; + pSmi->savedFBReserved = pSmi->FBReserved; + } + + memset(pSmi->FBBase, 0, 256 * 1024); /* #689 */ SMI_WriteMode(pScrn, vgaSavePtr, SMISavePtr); SMI_UnmapMem(pScrn); @@ -1366,7 +1412,7 @@ SMI_Save(ScrnInfoPtr pScrn) pSmi->pInt->num = 0x10; pSmi->pInt->ax = 0x0F00; xf86ExecX86int10(pSmi->pInt); - save->mode = pSmi->pInt->ax & 0x00FF; + save->mode = pSmi->pInt->ax & 0x007F; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Current mode 0x%02X.\n", save->mode); } @@ -1409,7 +1455,7 @@ SMI_WriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, SMIRegPtr restore) if (pSmi->useBIOS && (pSmi->pInt != NULL) && (restore->mode != 0)) { pSmi->pInt->num = 0x10; - pSmi->pInt->ax = restore->mode; + pSmi->pInt->ax = restore->mode | 0x80; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting mode 0x%02X\n", restore->mode); xf86ExecX86int10(pSmi->pInt); @@ -1417,13 +1463,11 @@ SMI_WriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, SMIRegPtr restore) /* Enable linear mode. */ outb(VGA_SEQ_INDEX, 0x18); tmp = inb(VGA_SEQ_DATA); - pSmi->SR18Value = tmp; outb(VGA_SEQ_DATA, tmp | 0x01); - /* Enable/disable PDR registers. */ - tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21) & ~0x03; - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, tmp | - (restore->SR21 & 0x03)); + /* Enable DPR/VPR registers. */ + tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21); + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, tmp & ~0x03); } else { @@ -1431,9 +1475,8 @@ SMI_WriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, SMIRegPtr restore) tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18) & ~0x1F; VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18, tmp | (restore->SR18 & 0x1F)); - tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21) & ~0x03; - VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, tmp | - (restore->SR21 & 0x03)); + tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21); + VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, tmp & ~0x03); tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31) & ~0xC0; VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x31, tmp | (restore->SR31 & 0xC0)); @@ -1827,7 +1870,10 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Save the chip/graphics state */ SMI_Save(pScrn); - /* Initialise the first mode */ + /* Zero the frame buffer, #258 */ + memset(pSmi->FBBase, 0, pSmi->videoRAMBytes); + + /* Initialize the first mode */ if (!SMI_ModeInit(pScrn, pScrn->currentMode)) { LEAVE_PROC("SMI_ScreenInit"); @@ -2038,7 +2084,8 @@ SMI_InternalScreenInit(int scrnIndex, ScreenPtr pScreen) | (pSmi->ShadowWidthBytes / bytesPerPixel); } - pSmi->FBReserved -= pSmi->ShadowWidthBytes * pSmi->ShadowHeight; + pSmi->saveBufferSize = pSmi->ShadowWidthBytes * pSmi->ShadowHeight; + pSmi->FBReserved -= pSmi->saveBufferSize; pSmi->FBReserved &= ~0x15; WRITE_VPR(pSmi, 0x0C, (pSmi->FBOffset = pSmi->FBReserved) >> 3); @@ -2471,10 +2518,6 @@ SMI_ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) /* Zero the font memory */ memset(new->smiFont, 0, sizeof(new->smiFont)); - /* Zero the frame buffer, #258 */ - memset(pSmi->FBBase + pSmi->FBOffset, 0, - pSmi->width * pSmi->height * pSmi->Bpp); - /* Write the mode registers to hardware */ SMI_WriteMode(pScrn, vganew, new); @@ -2541,6 +2584,11 @@ SMI_CloseScreen(int scrnIndex, ScreenPtr pScreen) { xf86DestroyI2CBusRec(pSmi->I2C, TRUE, TRUE); } + /* #670 */ + if (pSmi->pSaveBuffer) + { + xfree(pSmi->pSaveBuffer); + } pScrn->vtSema = FALSE; pScreen->CloseScreen = pSmi->CloseScreen; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c index e249fb1a8..5ef9ba586 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c @@ -1,4 +1,4 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_shadow.c-arc 1.8 27 Nov 2000 15:46:16 Frido $ */ +/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_shadow.c-arc 1.10 30 Nov 2000 11:40:38 Frido $ */ /* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. @@ -26,7 +26,7 @@ Silicon Motion shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the XFree86 Project and Silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c,v 1.1 2000/11/28 20:59:20 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_shadow.c,v 1.2 2000/12/05 21:18:37 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -49,7 +49,7 @@ authorization from the XFree86 Project and Silicon Motion. |* |* DESCRIPTION: Refresh a portion of the shadow buffer to the visual screen |* buffer. This is mainly used for rotation purposes. -|* +|* y |* RETURNS: Nothing. |* \******************************************************************************/ @@ -58,6 +58,15 @@ void SMI_RefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) SMIPtr pSmi = SMIPTR(pScrn); int width, height, srcX, srcY, destX, destY; + ENTER_PROC("SMI_RefreshArea"); + + /* #671 */ + if (pSmi->polyLines) + { + pSmi->polyLines = FALSE; + return; + } + if (pSmi->rotate) { /* IF we need to do rotation, setup the hardware here. */ @@ -67,6 +76,14 @@ void SMI_RefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) WRITE_DPR(pSmi, 0x44, pSmi->FBOffset >> 3); } + /* #672 */ + if (pSmi->ClipTurnedOn) + { + WaitQueue(1); + WRITE_DPR(pSmi, 0x2C, pSmi->ScissorsLeft); + pSmi->ClipTurnedOn = FALSE; + } + while (num--) { /* Get coordinates of the box to refresh. */ @@ -75,6 +92,8 @@ void SMI_RefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) width = pbox->x2 - srcX; height = pbox->y2 - srcY; + DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d\n", srcX, srcY, width, height)); + if ((width > 0) && (height > 0)) { switch (pSmi->rotate) @@ -158,6 +177,8 @@ void SMI_RefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) WRITE_DPR(pSmi, 0x3C, (pSmi->Stride << 16) | pSmi->Stride); WRITE_DPR(pSmi, 0x44, 0); } + + LEAVE_PROC("SMI_RefreshArea"); } /******************************************************************************\ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c index 5506b1015..d7b288ea2 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c @@ -1,4 +1,4 @@ -/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_video.c.-arc 1.12 08 Nov 2000 18:38:34 Frido $ */ +/* Header: //Mercury/Projects/archives/XFree86/4.0/smi_video.c.-arc 1.14 30 Nov 2000 16:51:40 Frido $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. @@ -26,7 +26,7 @@ Silicon Motion shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the XFree86 Project and silicon Motion. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c,v 1.1 2000/11/28 20:59:20 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_video.c,v 1.2 2000/12/05 21:18:37 dawes Exp $ */ #include "smi.h" #include "smi_video.h" @@ -701,7 +701,7 @@ SMI_StopVideo( #if SMI_USE_CAPTURE WRITE_CPR(pSmi, 0x00, READ_CPR(pSmi, 0x00) & ~0x00000001); WRITE_VPR(pSmi, 0x54, READ_VPR(pSmi, 0x54) & ~0x00F00000); - OUT_SEQ(pSmi, 0x21, IN_SEQ(pSmi, 0x21) | 0x04); +/* #864 OUT_SEQ(pSmi, 0x21, IN_SEQ(pSmi, 0x21) | 0x04); */ #endif } if (ptrPort->area != NULL) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.cpp b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.cpp index 3f58c7c9d..08f3b7404 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.cpp,v 1.4 2000/06/14 02:13:13 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.cpp,v 1.5 2000/12/11 20:18:26 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH SIS __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH SIS __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME sis \- SiS video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.c index 3ff55a73b..ce0f2b0cb 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.c,v 1.4 2000/12/02 01:16:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis300_accel.c,v 1.5 2000/12/14 02:51:40 dawes Exp $ */ /* * @@ -176,7 +176,7 @@ SiS300AccelInit(ScreenPtr pScreen) */ /* Screen To Screen Color Expand */ -/* infoPtr->SetupForScreenToScreenColorExpandFill = +/* infoPtr->SetupForScreenToScreenColorExpandFill = SiSSetupForScreenToScreenColorExpand; infoPtr->SubsequentScreenToScreenColorExpandFill = SiSSubsequentScreenToScreenColorExpand; @@ -317,6 +317,7 @@ static void SiSSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, /* XAAInfoRecPtr pXAA = XAAPTR(pScrn);*/ PDEBUG(ErrorF("Setup ScreenCopy(%d, %d, 0x%x, 0x%x, 0x%x)\n", xdir, ydir, rop, planemask, trans_color)); + /* ErrorF("XAAInfoPtr->UsingPixmapCache = %s\n" "XAAInfoPtr->CanDoMono8x8 = %s\n" @@ -357,11 +358,8 @@ static void SiSSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, pXAA->NeedToSync ? "True" : "False"); */ - SiSSetupSRCBase(0) SiSSetupDSTColorDepth(SISPTR(pScrn)->DstColor); SiSSetupSRCPitch(pSiS->scrnOffset) - SiSSetupDSTBase(0) -/* SiSSetupDSTRect(pSiS->scrnOffset, pScrn->virtualY)*/ SiSSetupDSTRect(pSiS->scrnOffset, -1) SiSSetupROP(sisALUConv[rop]) if (xdir > 0) SiSSetupCMDFlag(X_INC) @@ -374,10 +372,22 @@ static void SiSSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int width, int height) { SISPtr pSiS = SISPTR(pScrn); + long srcbase, dstbase; PDEBUG(ErrorF("Subsequent ScreenCopy(%d,%d, %d,%d, %d,%d)\n", src_x, src_y, dst_x, dst_y, width, height)); + srcbase=dstbase=0; + if (src_y >= 2048) + { srcbase=pSiS->scrnOffset*src_y; + src_y=0; + } + if (dst_y >= pScrn->virtualY) + { dstbase=pSiS->scrnOffset*dst_y; + dst_y=0; + } + SiSSetupSRCBase(srcbase); + SiSSetupDSTBase(dstbase); if (!(pSiS->CommandReg & X_INC)) { src_x += width-1; dst_x += width-1; @@ -402,7 +412,6 @@ SiSSetupForSolidFill(ScrnInfoPtr pScrn, color, rop, planemask)); SiSSetupPATFG(color) - SiSSetupDSTBase(0) /* SiSSetupDSTRect(pSiS->scrnOffset, pScrn->virtualY)*/ SiSSetupDSTRect(pSiS->scrnOffset, -1) SiSSetupDSTColorDepth(SISPTR(pScrn)->DstColor); @@ -415,9 +424,16 @@ SiSSubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h) { SISPtr pSiS = SISPTR(pScrn); + long dstbase; PDEBUG(ErrorF("Subsequent SolidFillRect(%d, %d, %d, %d)\n", x, y, w, h)); + dstbase=0; + if (y>=2048) + { dstbase=pSiS->scrnOffset*y; + y=0; + } + SiSSetupDSTBase(dstbase) SiSSetupDSTXY(x,y) SiSSetupRect(w,h) SiSDoCMD @@ -434,7 +450,6 @@ SiSSetupForSolidLine(ScrnInfoPtr pScrn, SiSSetupLineCount(1) SiSSetupPATFG(color) - SiSSetupDSTBase(0) /* SiSSetupDSTRect(pSiS->scrnOffset, pScrn->virtualY)*/ SiSSetupDSTRect(pSiS->scrnOffset, -1) SiSSetupDSTColorDepth(SISPTR(pScrn)->DstColor); @@ -447,9 +462,19 @@ SiSSubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, int x1, int y1, int x2, int y2, int flags) { SISPtr pSiS = SISPTR(pScrn); + long dstbase,miny,maxy; PDEBUG(ErrorF("Subsequent SolidLine(%d, %d, %d, %d, 0x%x)\n", x1, y1, x2, y2, flags)); + dstbase=0; + miny=(y1>y2)?y2:y1; + maxy=(y1>y2)?y1:y2; + if (maxy>=2048) + { dstbase=pSiS->scrnOffset*miny; + y1-=miny; + y2-=miny; + } + SiSSetupDSTBase(dstbase) SiSSetupX0Y0(x1,y1) SiSSetupX1Y1(x2,y2) @@ -463,10 +488,18 @@ SiSSubsequentSolidHorzVertLine(ScrnInfoPtr pScrn, int x, int y, int len, int dir) { SISPtr pSiS = SISPTR(pScrn); + long dstbase; PDEBUG(ErrorF("Subsequent SolidHorzVertLine(%d, %d, %d, %d)\n", x, y, len, dir)); + dstbase=0; + if ((y>=2048) || ((y+len)>=2048)) + { dstbase=pSiS->scrnOffset*y; + y=0; + } + SiSSetupDSTBase(dstbase) + SiSSetupX0Y0(x,y) if (dir==DEGREES_0) { SiSSetupX1Y1(x+len,y);} @@ -486,7 +519,6 @@ SiSSetupForDashedLine(ScrnInfoPtr pScrn, fg, bg, rop, planemask, length, *(pattern+4), *pattern)); SiSSetupLineCount(1) - SiSSetupDSTBase(0) /* SiSSetupDSTRect(pSiS->scrnOffset, pScrn->virtualY)*/ SiSSetupDSTRect(pSiS->scrnOffset, -1) SiSSetupDSTColorDepth(SISPTR(pScrn)->DstColor); @@ -503,10 +535,21 @@ SiSSubsequentDashedTwoPointLine(ScrnInfoPtr pScrn, int flags, int phase) { SISPtr pSiS = SISPTR(pScrn); + long dstbase,miny,maxy; PDEBUG(ErrorF("Subsequent DashedLine(%d,%d, %d,%d, 0x%x,0x%x)\n", x1, y1, x2, y2, flags, phase)); + dstbase=0; + miny=(y1>y2)?y2:y1; + maxy=(y1>y2)?y1:y2; + if (maxy>=2048) + { dstbase=pSiS->scrnOffset*miny; + y1-=miny; + y2-=miny; + } + SiSSetupDSTBase(dstbase) + SiSSetupX0Y0(x1,y1) SiSSetupX1Y1(x2,y2) if (flags & OMIT_LAST) @@ -525,7 +568,6 @@ SiSSetupForMonoPatternFill(ScrnInfoPtr pScrn, PDEBUG(ErrorF("Setup MonoPatFill(0x%x,0x%x, 0x%x,0x%x, 0x%x, 0x%x)\n", patx, paty, fg, bg, rop, planemask)); - SiSSetupDSTBase(0) SiSSetupDSTRect(pSiS->scrnOffset, -1) SiSSetupDSTColorDepth(SISPTR(pScrn)->DstColor); SiSSetupMONOPAT(patx,paty) @@ -541,9 +583,17 @@ SiSSubsequentMonoPatternFill(ScrnInfoPtr pScrn, int x, int y, int w, int h) { SISPtr pSiS = SISPTR(pScrn); + long dstbase; PDEBUG(ErrorF("Subsequent MonoPatFill(0x%x,0x%x, %d,%d, %d,%d)\n", patx, paty, x, y, w, h)); + dstbase=0; + if (y>=2048) + { dstbase=pSiS->scrnOffset*y; + y=0; + } + + SiSSetupDSTBase(dstbase) SiSSetupDSTXY(x,y) SiSSetupRect(w,h) SiSDoCMD @@ -560,7 +610,6 @@ SiSSetupForColorPatternFill(ScrnInfoPtr pScrn, PDEBUG(ErrorF("Setup ColorPatFill(0x%x,0x%x, 0x%x,0x%x, 0x%x)\n", patx, paty, rop, planemask, trans_color)); - SiSSetupDSTBase(0) /* SiSSetupDSTRect(pSiS->scrnOffset, pScrn->virtualY)*/ SiSSetupDSTRect(pSiS->scrnOffset, -1) SiSSetupDSTColorDepth(SISPTR(pScrn)->DstColor); @@ -574,9 +623,18 @@ SiSSubsequentColorPatternFill(ScrnInfoPtr pScrn, int x, int y, int w, int h) { SISPtr pSiS = SISPTR(pScrn); + long dstbase; PDEBUG(ErrorF("Subsequent ColorPatFill(0x%x,0x%x, %d,%d, %d,%d)\n", patx, paty, x, y, w, h)); + + dstbase=0; + if (y>=2048) + { dstbase=pSiS->scrnOffset*y; + y=0; + } + SiSSetupDSTBase(dstbase) + SiSSetupDSTXY(x,y) SiSSetupRect(w,h) SiSDoCMD @@ -593,7 +651,6 @@ SiSSetupForCPUToScreenColorExpand(ScrnInfoPtr pScrn, PDEBUG(ErrorF("Setup CPUToScreen ColorExpand(0x%x,0x%x, 0x%x,0x%x)\n", fg, bg, rop, planemask)); - SiSSetupDSTBase(0) /* SiSSetupDSTRect(pSiS->scrnOffset, pScrn->virtualY)*/ SiSSetupDSTRect(pSiS->scrnOffset, -1) SiSSetupDSTColorDepth(SISPTR(pScrn)->DstColor); @@ -612,10 +669,18 @@ SiSSubsequentCPUToScreenColorExpand(ScrnInfoPtr pScrn, int x, int y, int w, int h, int skipleft) { SISPtr pSiS = SISPTR(pScrn); + long dstbase; PDEBUG(ErrorF("Subsequent CPUToScreen ColorExpand(%d,%d, %d,%d, %d)\n", x, y, w, h, skipleft)); + dstbase=0; + if (y>=2048) + { dstbase=pSiS->scrnOffset*y; + y=0; + } + SiSSetupDSTBase(dstbase) + /* SiSSetupSRCPitch(((w+31)&0xFFE0)/8)*/ SiSSetupSRCPitch((w+7)/8) SiSSetupDSTXY(x,y) @@ -624,6 +689,7 @@ SiSSubsequentCPUToScreenColorExpand(ScrnInfoPtr pScrn, pSiS->DoColorExpand = TRUE; } +#if 0 static void SiSSetupForScreenToScreenColorExpand(ScrnInfoPtr pScrn, int fg, int bg, @@ -660,7 +726,7 @@ SiSSubsequentScreenToScreenColorExpand(ScrnInfoPtr pScrn, SiSDoCMD } - +#endif static void SiSSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg, int bg, int rop, unsigned int planemask) @@ -670,7 +736,6 @@ SiSSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg, int bg, while ((MMIO_IN16(pSiS->IOBase, 0x8242) & 0x1F00)!=0) {} pSiS->ColorExpandRingHead = 0; pSiS->ColorExpandRingTail = pSiS->ColorExpandBufferNumber - 1; - SiSSetupDSTBase(0); SiSSetupSRCXY(0,0); SiSSetupROP(sisALUConv[rop]); SiSSetupSRCFG(fg); @@ -690,7 +755,16 @@ int xcurrent, ycurrent; static void SiSSubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int x, int y, int w, int h, int skipleft) { SISPtr pSiS=SISPTR(pScrn); - int _x0,_y0,_x1,_y1; + int _x0,_y0,_x1,_y1; + long dstbase; + + dstbase=0; + if (y>=2048) + { dstbase=pSiS->scrnOffset*y; + y=0; + } + SiSSetupDSTBase(dstbase) + if (skipleft > 0) { _x0=x+skipleft; _y0=y; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/sunbw2.cpp b/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/sunbw2.cpp index 5cba0b860..8be9c868a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/sunbw2.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/sunbw2.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/sunbw2.cpp,v 1.1 2000/06/30 17:15:14 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/sunbw2.cpp,v 1.2 2000/12/11 20:18:27 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH SUNBW2 __drivermansuffix__ "Version 4.0" "XFree86" +.TH SUNBW2 __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME sunbw2 \- BW2 video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/suncg14.cpp b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/suncg14.cpp index e15f8ecd7..1d111923a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/suncg14.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/suncg14.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/suncg14.cpp,v 1.1 2000/06/30 17:15:14 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/suncg14.cpp,v 1.2 2000/12/11 20:18:29 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH SUNCG14 __drivermansuffix__ "Version 4.0" "XFree86" +.TH SUNCG14 __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME suncg14 \- CG14 video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg3/suncg3.cpp b/xc/programs/Xserver/hw/xfree86/drivers/suncg3/suncg3.cpp index 65fb08cf0..eb183fbe2 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suncg3/suncg3.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg3/suncg3.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/suncg3.cpp,v 1.1 2000/06/30 17:15:15 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/suncg3.cpp,v 1.2 2000/12/11 20:18:31 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH SUNCG3 __drivermansuffix__ "Version 4.0" "XFree86" +.TH SUNCG3 __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME suncg3 \- CG3 video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/suncg6.cpp b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/suncg6.cpp index b48106f47..8ff863c39 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/suncg6.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/suncg6.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/suncg6.cpp,v 1.2 2000/06/14 02:13:14 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/suncg6.cpp,v 1.3 2000/12/11 20:18:32 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH SUNCG6 __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH SUNCG6 __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME suncg6 \- GX/Turbo GX video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/sunffb.cpp b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/sunffb.cpp index 1db2ea525..1ee144b56 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/sunffb.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/sunffb.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/sunffb.cpp,v 1.2 2000/06/14 02:13:14 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/sunffb.cpp,v 1.3 2000/12/11 20:18:33 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH FFB __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH FFB __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME ffb \- SUNFFB video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/sunleo.cpp b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/sunleo.cpp index 78aba7702..ee22b004d 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/sunleo.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/sunleo.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/sunleo.cpp,v 1.3 2000/06/14 02:13:14 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/sunleo.cpp,v 1.4 2000/12/11 20:18:34 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH SUNLEO __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH SUNLEO __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME sunleo \- Leo video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/suntcx.cpp b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/suntcx.cpp index 392c74ba8..311f8aaf0 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/suntcx.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/suntcx.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/suntcx.cpp,v 1.1 2000/06/30 17:15:16 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/suntcx.cpp,v 1.2 2000/12/11 20:18:35 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH SUNTCX __drivermansuffix__ "Version 4.0" "XFree86" +.TH SUNTCX __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME suntcx \- TCX video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile index 75347890d..dc98911b9 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile,v 1.18 2000/12/01 14:28:58 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile,v 1.19 2000/12/15 15:19:35 dawes Exp $ XCOMM XCOMM This is the Imakefile for the TDFX driver. XCOMM @@ -37,7 +37,7 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ $(DRIINCLUDES) #endif -DEFINES = -DPROP_3DFX $(DRIDEFINES) +DEFINES = $(DRIDEFINES) #if MakeHasPosixVariableSubstitutions SubdirLibraryRule($(OBJS)) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.cpp b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.cpp index 847c24b9d..483a12622 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.cpp,v 1.5 2000/12/01 14:28:59 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.cpp,v 1.6 2000/12/11 20:18:36 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH TDFX __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH TDFX __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME tdfx \- 3Dfx video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h index 3f78a9230..9d133f2c5 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h @@ -5,7 +5,7 @@ Copyright: 1998,1999 */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h,v 1.13 2000/12/01 16:07:15 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h,v 1.17 2000/12/15 15:19:35 dawes Exp $ */ #ifndef _TDFX_H_ #define _TDFX_H_ @@ -42,13 +42,8 @@ typedef struct _TDFXRec *TDFXPtr; #endif #include "tdfx_priv.h" - -extern Bool TDFXInitFifo(ScreenPtr pScreen); -extern void TDFXShutdownFifo(ScreenPtr pScreen); extern void TDFXSwapContextFifo(ScreenPtr pScreen); extern void TDFXLostContext(ScreenPtr pScreen); -extern Bool TDFXSetupSLI(ScrnInfoPtr pScrn, Bool sliEnable, int aaSamples); -extern Bool TDFXDisableSLI(TDFXPtr pTDFX); #ifdef XF86DRI extern void FillPrivateDRI(TDFXPtr pTDFX, TDFXDRIPtr pTDFXDRI); @@ -209,6 +204,7 @@ typedef struct _TDFXRec { * shadow everything and make it happen automatically for every write. */ INT32 sst2DSrcFmtShadow; INT32 sst2DDstFmtShadow; + int pixmapCacheLines; } TDFXRec; typedef struct { @@ -270,6 +266,7 @@ extern void TDFXSubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, extern void TDFXSelectBuffer(TDFXPtr pTDFX, int which); + #endif diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_accel.c index 66af1fda2..ce4b0369e 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_accel.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_accel.c,v 1.16 2000/12/01 14:28:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_accel.c,v 1.17 2000/12/15 15:19:35 dawes Exp $ */ /* All drivers should typically include these */ #include "xf86.h" @@ -73,8 +73,6 @@ static void TDFXSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int skipleft); static void TDFXSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno); -void TDFXSelectBuffer(TDFXPtr pTDFX, int which); - void TDFXNeedSync(ScrnInfoPtr pScrn) { TDFXPtr pTDFX = TDFXPTR(pScrn); @@ -107,6 +105,7 @@ TDFXCheckSync(ScrnInfoPtr pScrn) { pTDFX->syncDone=FALSE; #ifdef XF86DRI if (pTDFX->directRenderingEnabled) { + TDFXLostContext(screenInfo.screens[pScrn->scrnIndex]); DRIUnlock(screenInfo.screens[pScrn->scrnIndex]); } #endif @@ -125,10 +124,8 @@ TDFXSelectBuffer(TDFXPtr pTDFX, int which) { else fmt=pTDFX->stride|((pTDFX->cpp+1)<<16); TDFXWriteLong(pTDFX, SST_2D_DSTBASEADDR, pTDFX->fbOffset); TDFXWriteLong(pTDFX, SST_2D_DSTFORMAT, fmt); - pTDFX->sst2DDstFmtShadow = fmt; TDFXWriteLong(pTDFX, SST_2D_SRCBASEADDR, pTDFX->fbOffset); TDFXWriteLong(pTDFX, SST_2D_SRCFORMAT, fmt); - pTDFX->sst2DSrcFmtShadow = fmt; break; case TDFX_BACK: if (pTDFX->cpp==2) @@ -137,10 +134,8 @@ TDFXSelectBuffer(TDFXPtr pTDFX, int which) { fmt=((pTDFX->stride+127)/128)|(5<<16); /* Tiled 32bpp */ TDFXWriteLong(pTDFX, SST_2D_DSTBASEADDR, pTDFX->backOffset|BIT(31)); TDFXWriteLong(pTDFX, SST_2D_DSTFORMAT, fmt); - pTDFX->sst2DDstFmtShadow = fmt; TDFXWriteLong(pTDFX, SST_2D_SRCBASEADDR, pTDFX->backOffset|BIT(31)); TDFXWriteLong(pTDFX, SST_2D_SRCFORMAT, fmt); - pTDFX->sst2DSrcFmtShadow = fmt; break; case TDFX_DEPTH: if (pTDFX->cpp==2) @@ -149,10 +144,8 @@ TDFXSelectBuffer(TDFXPtr pTDFX, int which) { fmt=((pTDFX->stride+127)/128)|(5<<16); /* Tiled 32bpp */ TDFXWriteLong(pTDFX, SST_2D_DSTBASEADDR, pTDFX->depthOffset|BIT(31)); TDFXWriteLong(pTDFX, SST_2D_DSTFORMAT, fmt); - pTDFX->sst2DDstFmtShadow = fmt; TDFXWriteLong(pTDFX, SST_2D_SRCBASEADDR, pTDFX->depthOffset|BIT(31)); TDFXWriteLong(pTDFX, SST_2D_SRCFORMAT, fmt); - pTDFX->sst2DSrcFmtShadow = fmt; break; default: ; @@ -240,7 +233,7 @@ TDFXAccelInit(ScreenPtr pScreen) infoPtr->SubsequentScreenToScreenCopy = TDFXSubsequentScreenToScreenCopy; infoPtr->ScreenToScreenCopyFlags = commonFlags; - /* When we're using the fifo we have to use indirect expansion */ + /* When we're using the fifo interface we have to use indirect */ pTDFX->scanlineColorExpandBuffers[0] = xalloc((pScrn->virtualX+62)/32*4); pTDFX->scanlineColorExpandBuffers[1] = xalloc((pScrn->virtualX+62)/32*4); infoPtr->NumScanlineColorExpandBuffers=2; @@ -281,9 +274,6 @@ TDFXAccelInit(ScreenPtr pScreen) pTDFX->ModeReg.dstbaseaddr=pTDFX->fbOffset; TDFXWriteLongMMIO(pTDFX, SST_2D_DSTBASEADDR, pTDFX->ModeReg.dstbaseaddr); - pTDFX->sst2DSrcFmtShadow = TDFXReadLongMMIO(pTDFX, SST_2D_SRCFORMAT); - pTDFX->sst2DDstFmtShadow = TDFXReadLongMMIO(pTDFX, SST_2D_DSTFORMAT); - /* Fill in acceleration functions */ return XAAInit(pScreen, infoPtr); } @@ -428,9 +418,7 @@ TDFXSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, TDFXMakeRoom(pTDFX, 2); DECLARE(SSTCP_SRCFORMAT|SSTCP_DSTFORMAT); TDFXWriteLong(pTDFX, SST_2D_DSTFORMAT, fmt); - pTDFX->sst2DDstFmtShadow = fmt; TDFXWriteLong(pTDFX, SST_2D_SRCFORMAT, fmt); - pTDFX->sst2DSrcFmtShadow = fmt; } void @@ -488,7 +476,6 @@ TDFXSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, DECLARE(SSTCP_DSTFORMAT|SSTCP_COLORFORE| SSTCP_COLORBACK); TDFXWriteLong(pTDFX, SST_2D_DSTFORMAT, fmt); - pTDFX->sst2DDstFmtShadow = fmt; TDFXWriteLong(pTDFX, SST_2D_COLORBACK, color); TDFXWriteLong(pTDFX, SST_2D_COLORFORE, color); } @@ -538,7 +525,6 @@ TDFXSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, |SSTCP_PATTERN1ALIAS|SSTCP_COLORFORE| SSTCP_COLORBACK); TDFXWriteLong(pTDFX, SST_2D_DSTFORMAT, fmt); - pTDFX->sst2DDstFmtShadow = fmt; TDFXWriteLong(pTDFX, SST_2D_PATTERN0, patx); TDFXWriteLong(pTDFX, SST_2D_PATTERN1, paty); TDFXWriteLong(pTDFX, SST_2D_COLORBACK, bg); @@ -654,7 +640,6 @@ TDFXNonTEGlyphRenderer(ScrnInfoPtr pScrn, int x, int y, int n, (pbox->x2&0x1FFF)); TDFXWriteLong(pTDFX, SST_2D_SRCFORMAT, SST_2D_PIXFMT_1BPP | SST_2D_SOURCE_PACKING_DWORD); - pTDFX->sst2DSrcFmtShadow = SST_2D_PIXFMT_1BPP | SST_2D_SOURCE_PACKING_DWORD; TDFXWriteLong(pTDFX, SST_2D_SRCXY, 0); TDFXWriteLong(pTDFX, SST_2D_COLORFORE, fg); TDFXWriteLong(pTDFX, SST_2D_COMMAND, pTDFX->Cmd); @@ -788,11 +773,9 @@ TDFXSubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrn, int x, int y, SSTCP_DSTSIZE|SSTCP_DSTXY|SSTCP_COMMAND | SSTCP_CLIP1MIN|SSTCP_CLIP1MAX); TDFXWriteLong(pTDFX,SST_2D_DSTFORMAT, fmt); - pTDFX->sst2DDstFmtShadow = fmt; TDFXWriteLong(pTDFX,SST_2D_CLIP1MIN, (x&0x1FFF) | ((y&0x1FFF)<<16)); TDFXWriteLong(pTDFX,SST_2D_CLIP1MAX, ((x+w)&0x1FFF) | (((y+h)&0x1FFF)<<16)); TDFXWriteLong(pTDFX,SST_2D_SRCFORMAT, pTDFX->stride); - pTDFX->sst2DSrcFmtShadow = pTDFX->stride; TDFXWriteLong(pTDFX,SST_2D_SRCXY, (srcx&0x1FFF) | ((srcy&0x1FFF)<<16)); TDFXWriteLong(pTDFX,SST_2D_DSTSIZE, ((w+offset)&0x1FFF) | ((h&0x1FFF)<<16)); TDFXWriteLong(pTDFX,SST_2D_DSTXY, ((x-offset)&0x1FFF) | ((y&0x1FFF)<<16)); @@ -851,11 +834,9 @@ TDFXSubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int x, int y, SSTCP_DSTFORMAT|SSTCP_DSTSIZE|SSTCP_SRCXY| SSTCP_DSTXY|SSTCP_COMMAND); TDFXWriteLong(pTDFX, SST_2D_DSTFORMAT, fmt); - pTDFX->sst2DDstFmtShadow = fmt; TDFXWriteLong(pTDFX, SST_2D_CLIP1MIN, ((y&0x1FFF)<<16)|(x&0x1FFF)); TDFXWriteLong(pTDFX, SST_2D_CLIP1MAX, (((y+h)&0x1FFF)<<16)|((x+w)&0x1FFF)); TDFXWriteLong(pTDFX, SST_2D_SRCFORMAT, (((w+31)/32)*4) & 0x3FFF); - pTDFX->sst2DSrcFmtShadow = (((w+31)/32)*4) & 0x3FFF; TDFXWriteLong(pTDFX, SST_2D_SRCXY, skipleft&0x1F); TDFXWriteLong(pTDFX, SST_2D_DSTSIZE, ((w-skipleft)&0x1FFF)|((h&0x1FFF)<<16)); TDFXWriteLong(pTDFX, SST_2D_DSTXY, ((x+skipleft)&0x1FFF) | ((y&0x1FFF)<<16)); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c index c64e0d049..8c5831420 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c,v 1.13 2000/12/01 14:28:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c,v 1.14 2000/12/07 20:26:23 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -373,6 +373,8 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen) pDRIInfo->SwapContext = TDFXDRISwapContext; pDRIInfo->InitBuffers = TDFXDRIInitBuffers; pDRIInfo->MoveBuffers = TDFXDRIMoveBuffers; + pDRIInfo->OpenFullScreen = TDFXDRIOpenFullScreen; + pDRIInfo->CloseFullScreen = TDFXDRICloseFullScreen; pDRIInfo->bufferRequests = DRI_ALL_WINDOWS; if (!DRIScreenInit(pScreen, pDRIInfo, &pTDFX->drmSubFD)) { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c index 6081cd54e..4592402ff 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c @@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c,v 1.47 2000/12/02 15:30:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c,v 1.59 2000/12/18 15:50:04 dawes Exp $ */ /* * Authors: @@ -172,6 +172,7 @@ static PciChipsets TDFXPciChipsets[] = { { -1, -1, RES_UNDEFINED } }; +/* !!! Do we want an option for PIO address space? !!! */ /* !!! Do we want an option for alternate clocking? !!! */ typedef enum { @@ -206,6 +207,20 @@ static const char *vgahwSymbols[] = { 0 }; +static const char *ramdacSymbols[] = { + "xf86InitCursor", + "xf86CreateCursorInfoRec", + "xf86DestroyCursorInfoRec", + NULL +}; + +static const char *ddcSymbols[] = { + "xf86PrintEDID", + "xf86DoEDID_DDC1", + NULL +}; + +#ifdef XFree86LOADER static const char *fbSymbols[] = { "fbScreenInit", #ifdef RENDER @@ -231,19 +246,6 @@ static const char *xaaSymbols[] = { NULL }; -static const char *ramdacSymbols[] = { - "xf86InitCursor", - "xf86CreateCursorInfoRec", - "xf86DestroyCursorInfoRec", - NULL -}; - -static const char *ddcSymbols[] = { - "xf86PrintEDID", - "xf86DoEDID_DDC1", - NULL -}; - static const char *vbeSymbols[] = { "VBEInit", "vbeDoEDID", @@ -289,8 +291,6 @@ static const char *driSymbols[] = { #endif -#ifdef XFree86LOADER - static MODULESETUPPROTO(tdfxSetup); static XF86ModuleVersionInfo tdfxVersRec = @@ -400,7 +400,7 @@ TDFXProbeDDC(ScrnInfoPtr pScrn, int index) #endif { pVbe = VBEInit(NULL,index); - vbeDoEDID(pVbe, NULL); + ConfiguredMonitor = vbeDoEDID(pVbe, NULL); } } @@ -498,10 +498,7 @@ TDFXCountRam(ScrnInfoPtr pScrn) { /* set memory interface delay values and enable refresh */ /* these apply to all RAM vendors */ dramInit1 = 0x0; - if (pTDFX->ChipType==PCI_CHIP_BANSHEE) - dramInit1 |= 7<<SST_SGRAM_OFLOP_DEL_ADJ_SHIFT; - else - dramInit1 |= 2<<SST_SGRAM_OFLOP_DEL_ADJ_SHIFT; + dramInit1 |= 2<<SST_SGRAM_OFLOP_DEL_ADJ_SHIFT; dramInit1 |= SST_SGRAM_CLK_NODELAY; dramInit1 |= SST_DRAM_REFRESH_EN; dramInit1 |= (0x18 << SST_DRAM_REFRESH_VALUE_SHIFT) & SST_DRAM_REFRESH_VALUE; @@ -603,31 +600,28 @@ static void TDFXInitChips(ScrnInfoPtr pScrn) { TDFXPtr pTDFX; - int i, v, cfgbits, initbits; + int i, cfgbits, initbits; int mem0base, mem1base, mem0size, mem0bits, mem1size, mem1bits; pTDFX=TDFXPTR(pScrn); cfgbits=pciReadLong(pTDFX->PciTag[0], CFG_PCI_DECODE); mem0base=pciReadLong(pTDFX->PciTag[0], CFG_MEM0BASE); mem1base=pciReadLong(pTDFX->PciTag[0], CFG_MEM1BASE); - initbits=pciReadLong(pTDFX->PciTag[0], CFG_INIT_ENABLE); mem0size=32*1024*1024; /* Registers are always 32MB */ mem1size=pScrn->videoRam*1024*2; /* Linear mapping is 2x memory */ mem0bits=TDFXSizeToCfg(mem0size); mem1bits=TDFXSizeToCfg(mem1size)<<4; cfgbits=(cfgbits&~(0xFF))|mem0bits|mem1bits; for (i=0; i<pTDFX->numChips; i++) { + initbits=pciReadLong(pTDFX->PciTag[i], CFG_INIT_ENABLE); initbits|=BIT(10); pciWriteLong(pTDFX->PciTag[i], CFG_INIT_ENABLE, initbits); - v=pciReadWord(pTDFX->PciTag[i], CFG_PCI_COMMAND); - if (!i) - pciWriteWord(pTDFX->PciTag[i], CFG_PCI_COMMAND, v|0x3); - else - pciWriteWord(pTDFX->PciTag[i], CFG_PCI_COMMAND, v|0x2); pTDFX->MMIOAddr[i]=mem0base+i*mem0size; + pciWriteLong(pTDFX->PciTag[i], CFG_MEM0BASE, 0xFFFFFFFF); pciWriteLong(pTDFX->PciTag[i], CFG_MEM0BASE, pTDFX->MMIOAddr[i]); pTDFX->MMIOAddr[i]&=0xFFFFFF00; pTDFX->LinearAddr[i]=mem1base+i*mem1size; + pciWriteLong(pTDFX->PciTag[i], CFG_MEM1BASE, 0xFFFFFFFF); pciWriteLong(pTDFX->PciTag[i], CFG_MEM1BASE, pTDFX->LinearAddr[i]); pTDFX->LinearAddr[i]&=0xFFFFFF00; pciWriteLong(pTDFX->PciTag[i], CFG_PCI_DECODE, cfgbits); @@ -740,17 +734,9 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) return FALSE; } - if (!xf86SetDefaultVisual(pScrn, -1)) { + if (!xf86SetDefaultVisual (pScrn, -1)) { return FALSE; - } else { - /* We don't currently support DirectColor at > 8bpp */ - if (pScrn->depth > 8 && pScrn->defaultVisual != TrueColor) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual" - " (%s) is not supported at depth %d\n", - xf86GetVisualName(pScrn->defaultVisual), pScrn->depth); - return FALSE; - } - } + } /* We use a programamble clock */ pScrn->progClock = TRUE; @@ -943,7 +929,8 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) xf86LoaderReqSymbols("fbPictureInit", NULL); #endif - if (!xf86ReturnOptValBool(TDFXOptions, OPTION_NOACCEL, FALSE)) { + pTDFX->NoAccel=xf86ReturnOptValBool(TDFXOptions, OPTION_NOACCEL, FALSE); + if (!pTDFX->NoAccel) { if (!xf86LoadSubModule(pScrn, "xaa")) { TDFXFreeRec(pScrn); return FALSE; @@ -1097,7 +1084,6 @@ DoSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, TDFXRegPtr tdfxReg, Bool saveFonts) { TDFXPtr pTDFX; vgaHWPtr hwp; - int i, dummy, count; TDFXTRACE("TDFXDoSave start\n"); pTDFX = TDFXPTR(pScrn); @@ -1128,15 +1114,6 @@ DoSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, TDFXRegPtr tdfxReg, Bool saveFonts) tdfxReg->clip1max=TDFXReadLongMMIO(pTDFX, SST_2D_CLIP1MAX); tdfxReg->srcbaseaddr=TDFXReadLongMMIO(pTDFX, SST_2D_SRCBASEADDR); tdfxReg->dstbaseaddr=TDFXReadLongMMIO(pTDFX, SST_2D_DSTBASEADDR); - for (i=0; i<512; i++) { - count=0; - do { - TDFXWriteLongMMIO(pTDFX, DACADDR, i); - dummy=TDFXReadLongMMIO(pTDFX, DACADDR); - } while (count++<100 && dummy!=i); - tdfxReg->dactable[i]=TDFXReadLongMMIO(pTDFX, DACDATA); - dummy=tdfxReg->dactable[i]; - } } static void @@ -1156,7 +1133,6 @@ DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, TDFXRegPtr tdfxReg, Bool restoreFonts) { TDFXPtr pTDFX; vgaHWPtr hwp; - int i, dummy, count; TDFXTRACE("TDFXDoRestore start\n"); pTDFX = TDFXPTR(pScrn); @@ -1187,19 +1163,8 @@ DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, TDFXRegPtr tdfxReg, pTDFX->writeLong(pTDFX, VIDPROCCFG, tdfxReg->vidcfg); TDFXWriteLongMMIO(pTDFX, SST_2D_SRCBASEADDR, tdfxReg->srcbaseaddr); TDFXWriteLongMMIO(pTDFX, SST_2D_DSTBASEADDR, tdfxReg->dstbaseaddr); + vgaHWProtect(pScrn, FALSE); - for (i=0; i<512; i++) { - count=0; - do { - TDFXWriteLongMMIO(pTDFX, DACADDR, i); - dummy=TDFXReadLongMMIO(pTDFX, DACADDR); - } while (count++<100 && dummy!=i); - count=0; - do { - TDFXWriteLongMMIO(pTDFX, DACDATA, tdfxReg->dactable[i]); - dummy=TDFXReadLongMMIO(pTDFX, DACDATA); - } while (count++<100 && dummy!=tdfxReg->dactable[i]); - } pTDFX->sync(pScrn); } @@ -1516,8 +1481,8 @@ TDFXLoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, for (j=index<<2; j<max; j++) { repeat=100; do { - TDFXWriteLongMMIO(pTDFX, DACADDR, j); - } while (--repeat && TDFXReadLongMMIO(pTDFX, DACADDR)!=j); + pTDFX->writeLong(pTDFX, DACADDR, j); + } while (--repeat && pTDFX->readLong(pTDFX, DACADDR)!=j); if (!repeat) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Failed to set dac index, " "bypassing CLUT\n"); @@ -1526,8 +1491,8 @@ TDFXLoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, } repeat=100; do { - TDFXWriteLongMMIO(pTDFX, DACDATA, v); - } while (--repeat && TDFXReadLongMMIO(pTDFX, DACDATA)!=v); + pTDFX->writeLong(pTDFX, DACDATA, v); + } while (--repeat && pTDFX->readLong(pTDFX, DACDATA)!=v); if (!repeat) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Failed to set dac value, " "bypassing CLUT\n"); @@ -1551,8 +1516,8 @@ TDFXLoadPalette24(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, v=(colors[index].red<<16)|(colors[index].green<<8)|colors[index].blue; repeat=100; do { - TDFXWriteLongMMIO(pTDFX, DACADDR, index); - } while (--repeat && TDFXReadLongMMIO(pTDFX, DACADDR)!=index); + pTDFX->writeLong(pTDFX, DACADDR, index); + } while (--repeat && pTDFX->readLong(pTDFX, DACADDR)!=index); if (!repeat) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Failed to set dac index, " "bypassing CLUT\n"); @@ -1561,8 +1526,8 @@ TDFXLoadPalette24(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, } repeat=100; do { - TDFXWriteLongMMIO(pTDFX, DACDATA, v); - } while (--repeat && TDFXReadLongMMIO(pTDFX, DACDATA)!=v); + pTDFX->writeLong(pTDFX, DACDATA, v); + } while (--repeat && pTDFX->readLong(pTDFX, DACDATA)!=v); if (!repeat) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Failed to set dac value, " "bypassing CLUT\n"); @@ -1684,19 +1649,29 @@ static void allocateMemory(ScrnInfoPtr pScrn) { /* it to be on a page boundary too, just */ /* for giggles. */ pTDFX->fbOffset - = (pTDFX->backOffset - (pScrn->virtualY+128)*pTDFX->stride) &~ 0xFFF; + = (pTDFX->backOffset - + (pScrn->virtualY+PIXMAP_CACHE_LINES)*pTDFX->stride) &~ 0xFFF; /* Give the cmd fifo at least */ /* CMDFIFO_PAGES pages, but no more than */ /* 255. */ fifoSize = ((255 <= CMDFIFO_PAGES) ? 255 : CMDFIFO_PAGES) << 12; /* We give 4096 bytes to the cursor, fifoSize to the */ /* FIFO, and everything to textures. */ - texSize = (pTDFX->fbOffset - fifoSize - 4096 - 16*1024); - pTDFX->texOffset = pTDFX->fbOffset - texSize + 16*1024; + texSize = (pTDFX->fbOffset - fifoSize - 4096); + pTDFX->texOffset = pTDFX->fbOffset - texSize; pTDFX->texSize = texSize; - pTDFX->fifoOffset = 4096+16*1024; + pTDFX->fifoOffset = 4096; pTDFX->fifoSize = fifoSize; - pTDFX->cursorOffset = 0+16*1024; + pTDFX->cursorOffset = 0; + if (texSize < 0) { + pTDFX->backOffset = -1; + pTDFX->depthOffset = -1; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No Texture Memory available." + " Disabling direct rendering.\n"); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Textures Memory %0.02f MB\n", + (float)texSize/1024.0/1024.0); + } #if 0 xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Cursor Offset: [0x%08X,0x%08X)\n", @@ -1713,7 +1688,8 @@ static void allocateMemory(ScrnInfoPtr pScrn) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Front Buffer Offset: [0x%08X, 0x%08X)\n", pTDFX->fbOffset, - pTDFX->fbOffset + (pScrn->virtualY+128)*pTDFX->stride); + pTDFX->fbOffset + + (pScrn->virtualY+PIXMAP_CACHE_LINES)*pTDFX->stride); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "BackOffset: [0x%08X, 0x%08X)\n", pTDFX->backOffset, @@ -1723,8 +1699,6 @@ static void allocateMemory(ScrnInfoPtr pScrn) { pTDFX->depthOffset, pTDFX->depthOffset+screenSizeInTiles); #endif /* 0/1 */ - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Textures Memory %0.02f MB\n", - (float)texSize/1024.0/1024.0); } static Bool @@ -1751,7 +1725,6 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { allocateMemory(pScrn); -#if 0 if (pTDFX->numChips>1) { if (xf86ReturnOptValBool(TDFXOptions, OPTION_NO_SLI, FALSE)) { TDFXSetupSLI(pScrn, FALSE, 0); @@ -1759,20 +1732,15 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { TDFXSetupSLI(pScrn, TRUE, 0); } } -#endif TDFXSetLFBConfig(pTDFX); /* We initialize in the state that our FIFO is up to date */ pTDFX->syncDone=TRUE; -#ifdef PROP_3DFX if (!TDFXInitFifo(pScreen)) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize private\n"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize fifo\n"); return FALSE; } -#else - pTDFX->sync=TDFXSync; -#endif maxy=pScrn->virtualY+PIXMAP_CACHE_LINES; MemBox.y1 = pScrn->virtualY; @@ -1785,8 +1753,6 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { TDFXSave(pScrn); if (!TDFXModeInit(pScrn, pScrn->currentMode)) return FALSE; - TDFXSetLFBConfig(pTDFX); - miClearVisualTypes(); if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), @@ -1795,15 +1761,20 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { miSetPixmapDepths (); - pTDFX->NoAccel=xf86ReturnOptValBool(TDFXOptions, OPTION_NOACCEL, FALSE); #ifdef XF86DRI /* * Setup DRI after visuals have been established, but before fbScreenInit * is called. fbScreenInit will eventually call into the drivers * InitGLXVisuals call back. */ - if (!pTDFX->NoAccel) - pTDFX->directRenderingEnabled = TDFXDRIScreenInit(pScreen); + if (!pTDFX->NoAccel) { + if ( !((pTDFX->backOffset == -1) && (pTDFX->depthOffset == -1))) { + pTDFX->directRenderingEnabled = TDFXDRIScreenInit(pScreen); + } + /* Force the initialization of the context */ + if (pTDFX->directRenderingEnabled) + TDFXLostContext(pScreen); + } #endif switch (pScrn->bitsPerPixel) { @@ -1907,19 +1878,9 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { } #endif -#if 0 - /* Disable for now, not up with latest XFree release */ #ifdef XvExtension - { - XF86VideoAdaptorPtr *ptr; - int n; - - n = xf86XVListGenericAdaptors(pScrn,&ptr); - if (n) { - xf86XVScreenInit(pScreen, ptr, n); - } - } -#endif + /* Initialize Xv support */ + TDFXInitVideo (pScreen); #endif pScreen->SaveScreen = TDFXSaveScreen; @@ -1966,12 +1927,12 @@ TDFXEnterVT(int scrnIndex, int flags) { TDFXTRACE("TDFXEnterVT start\n"); pScrn = xf86Screens[scrnIndex]; - InstallFifo(pScrn); #ifdef XF86DRI pTDFX = TDFXPTR(pScrn); if (pTDFX->directRenderingEnabled) { pScreen = screenInfo.screens[scrnIndex]; DRIUnlock(pScreen); + TDFXLostContext(pScreen); } #endif if (!TDFXModeInit(pScrn, pScrn->currentMode)) return FALSE; @@ -1994,7 +1955,6 @@ TDFXLeaveVT(int scrnIndex, int flags) { TDFXRestore(pScrn); vgaHWLock(hwp); pScreen = screenInfo.screens[scrnIndex]; - TDFXShutdownFifo(pScreen); #ifdef XF86DRI pTDFX = TDFXPTR(pScrn); if (pTDFX->directRenderingEnabled) { @@ -2090,7 +2050,7 @@ TDFXBlankScreen(ScrnInfoPtr pScrn, Bool unblank) scrn |= 0x20; /* blank screen */ } - vgaHWSeqReset(hwp, TRUE); + vgaHWSeqReset(hwp, TRUE); hwp->writeSeq(hwp, 0x01, scrn); /* change mode */ vgaHWSeqReset(hwp, FALSE); } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c index b5b16978a..58e49d1cf 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c,v 1.11 2000/12/01 14:29:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c,v 1.13 2000/12/15 15:19:35 dawes Exp $ */ #include "xf86.h" @@ -119,7 +119,7 @@ static void TDFXSyncFifo(ScrnInfoPtr pScrn) TDFXPtr pTDFX; int i, cnt; int stat; - long start_sec, end_sec, dummy, readptr; + long start_sec, end_sec, dummy; TDFXTRACEACCEL("TDFXSyncFifo start\n"); pTDFX=TDFXPTR(pScrn); @@ -128,7 +128,6 @@ static void TDFXSyncFifo(ScrnInfoPtr pScrn) cnt=0; start_sec=0; do { - readptr=TDFXReadLongMMIO(pTDFX, SST_FIFO_RDPTRL0); stat=TDFXReadLongMMIO(pTDFX, 0); if (stat&SST_BUSY) i=0; else i++; cnt++; @@ -138,9 +137,7 @@ static void TDFXSyncFifo(ScrnInfoPtr pScrn) } else { getsecs(&end_sec, &dummy); if (end_sec-start_sec>3) { - dummy=TDFXReadLongMMIO(pTDFX, SST_FIFO_RDPTRL0); - if (dummy=readptr) - TDFXResetFifo(pScrn); + TDFXResetFifo(pScrn); start_sec=0; } } @@ -240,6 +237,24 @@ void TDFXSwapContextFifo(ScreenPtr pScreen) pTDFX->fifoSlots = pTDFX->fifoEnd-pTDFX->fifoPtr-8; } +void TDFXLostContext(ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn; + TDFXPtr pTDFX; + TDFXSAREAPriv *sPriv; + + pScrn = xf86Screens[pScreen->myNum]; + pTDFX=TDFXPTR(pScrn); + sPriv=(TDFXSAREAPriv*)DRIGetSAREAPrivate(pScreen); + if (!sPriv) return; + if (sPriv->fifoPtr!=(((unsigned char*)pTDFX->fifoPtr)-pTDFX->FbBase) || + sPriv->fifoRead!=(((unsigned char*)pTDFX->fifoRead)-pTDFX->FbBase)) { + sPriv->fifoPtr=(((unsigned char*)pTDFX->fifoPtr)-pTDFX->FbBase); + sPriv->fifoRead=(((unsigned char*)pTDFX->fifoRead)-pTDFX->FbBase); + sPriv->fifoOwner=DRIGetContext(pScreen); + /* ErrorF("Out FifoPtr=%d FifoRead=%d\n", sPriv->fifoPtr, sPriv->fifoRead); */ + } +} #endif static void diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h index a98f86366..d7fd4dfa3 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h,v 1.6 2000/12/01 14:29:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h,v 1.7 2000/12/15 15:19:35 dawes Exp $ */ #ifndef _TDFX_FIFO_H_ @@ -11,7 +11,7 @@ typedef int int32; typedef short int16; typedef char int8; -#define CMDFIFO_PAGES 255 +#define CMDFIFO_PAGES 64 #define PROPSAREADATA \ volatile int fifoPtr; \ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_sli.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_sli.c index 25b87acc0..4f784ca27 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_sli.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_sli.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_sli.c,v 1.5 2000/12/01 14:29:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_sli.c,v 1.6 2000/12/15 15:19:35 dawes Exp $ */ #include "xf86.h" #include "xf86_ansic.h" @@ -12,7 +12,7 @@ /* #define RD_ABORT_ERROR */ #define H3VDD -Bool TDFXDisableSLI(TDFXPtr pTDFX) +static Bool TDFXDisableSLI(TDFXPtr pTDFX) { int i; int v; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c index a7e3c71cf..8480de20a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c,v 1.2 2000/12/02 15:30:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c,v 1.5 2000/12/08 21:53:37 mvojkovi Exp $ */ /* Adapted from ../mga/mga_video.c */ @@ -30,6 +30,10 @@ #define SST_2D_FORMAT_UYVY 0x9 #define YUVBASEADDR 0x80100 +/* This should move to tdfx.h + * Only one port for now due to need for better memory allocation. */ +#define TDFX_MAX_PORTS 1 + #define YUVSTRIDE 0x80104 #ifndef XvExtension @@ -122,14 +126,14 @@ void TDFXCloseVideo (ScreenPtr pScreen) } /* client libraries expect an encoding */ -static XF86VideoEncodingRec DummyEncoding[2] = +static XF86VideoEncodingRec DummyEncoding[1] = { { /* blit limit */ 0, "XV_IMAGE", - 1024, PIXMAP_CACHE_LINES, /* Height is a limitation of pixmap space. */ + 1024, 0, /* Height is a limitation of pixmap space, and filled in later. */ {1, 1} - }, + } }; #define NUM_FORMATS_OVERLAY 3 @@ -158,11 +162,29 @@ static XF86ImageRec Images[NUM_IMAGES] = static XF86VideoAdaptorPtr TDFXAllocAdaptor(ScrnInfoPtr pScrn) { + DevUnion *devUnions; + int i; XF86VideoAdaptorPtr adapt; if(!(adapt = xf86XVAllocateVideoAdaptorRec(pScrn))) - return NULL; - + return NULL; + /* Allocate a TDFX private structure */ + /* There is no need for a TDFX private structure at this time. But a + * DevUnion has to be provided to the core Xv code. */ + if (!(devUnions = xcalloc (1, sizeof (DevUnion) * TDFX_MAX_PORTS))) + { + xfree (adapt); + return NULL; + } + adapt->pPortPrivates = &devUnions[0]; + + /* Fill in some of the DevUnion */ + for (i = 0; i < TDFX_MAX_PORTS; i++) + { + adapt->pPortPrivates[i].val = i; + adapt->pPortPrivates[i].ptr = NULL; /* No private data */ + } + return adapt; } @@ -173,6 +195,9 @@ TDFXSetupImageVideo(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; XF86VideoAdaptorPtr adapt; + TDFXPtr pTDFX = TDFXPTR(pScrn); + + DummyEncoding[0].height = pTDFX->pixmapCacheLines; adapt = TDFXAllocAdaptor(pScrn); @@ -184,10 +209,10 @@ TDFXSetupImageVideo(ScreenPtr pScreen) adapt->pEncodings = &DummyEncoding[0]; adapt->nFormats = NUM_FORMATS_OVERLAY; adapt->pFormats = Formats; - adapt->nPorts = 1; + adapt->nPorts = TDFX_MAX_PORTS; adapt->nAttributes = 0; adapt->pAttributes = NULL; - adapt->nImages = 3; + adapt->nImages = NUM_IMAGES; adapt->pImages = Images; /* XXX For now all I'm implementing is PutImage so that programs like OMS @@ -311,13 +336,14 @@ YUVPlanarToPacked (ScrnInfoPtr pScrn, void *dst; char *psrc = buf, *pdst = 0; + int count = 0; /* Register saves */ INT32 yuvBaseAddr, yuvStride; - /* Save these registers I can restore them when we are done. */ + /* Save these registers so I can restore them when we are done. */ yuvBaseAddr = TDFXReadLongMMIO(pTDFX, YUVBASEADDR); yuvStride = TDFXReadLongMMIO(pTDFX, YUVSTRIDE); @@ -329,49 +355,79 @@ YUVPlanarToPacked (ScrnInfoPtr pScrn, pTDFX->stride * (fbarea->box.y1 + pScrn->virtualY) + fbarea->box.x1); /* Set yuvStride register to reflect stride of U and V planes */ + /* There is a subtle issue involved with copying the Y plane. Y is + * sampled at twice the rate of the U and V data, in both + * directions. But when packing their needs to be two Y values for + * each U,V pair. So if src_x is odd we will end up missing on + * of the Y values. To correct for this we will always adjust the src + * x value. This adjust is done both in computing the address of the + * pixels to copy and when determining the amount of pixels to copy. + * Note that care needs to be taken to insure that the offscreen + * temporary buffer is allocated with enough space to hold the possible + * extra column of data. + */ TDFXWriteLongMMIO (pTDFX, YUVSTRIDE, pTDFX->stride); - psrc = (char*)buf; /* psrc points to the base of the Y plane, move out to src_x, src_y */ - psrc += src_x + src_y * width; - + psrc += (src_x & ~0x1) + src_y * width; pdst = (char *)pTDFX->MMIOBase[0] + YUV_Y_BASE; - for (y = 0; y < height; y++) + for (y = 0; y < src_h; y++) { - memcpy (pdst, psrc, src_w); + memcpy (pdst, psrc, src_w + (src_x & 0x1)); psrc += width; + /* YUV planar region is always 1024 bytes wide */ pdst += 1024; } - /* The difference between FOURCC_YV12 and FOURCC_I420 is the - * order that the U and V planes appear in the buffer. But I at - * this point I just send them in the order they appear. - * Depending on the format the order in the packing ends up - * different and we handle it in the the way we pick the source - * format later on. */ + /* The difference between FOURCC_YV12 and FOURCC_I420 is the order + * that the U and V planes appear in the buffer. But at this point + * I just send the second buffer as V and the third buffer as U. + * Depending on the format, the packing will be different and we + * handle it in the the way we pick the source format for the blit + * later on. */ pdst = (char *)pTDFX->MMIOBase[0] + YUV_V_BASE; psrc = (char*)buf + width * height; - /* psrc now points to the base of the V plane, move out to src_x, src_y */ + /* psrc now points to the base of the V plane, move out to src_x/2, + * src_y/2 */ psrc += (src_x >> 1) + (src_y >> 1) * (width >> 1); - for (y = 0; y < height >> 1; y++) + for (y = 0; y < src_h >> 1; y++) { + /* YUV planar region is always 1024 bytes wide */ memcpy (pdst, psrc, src_w >> 1); psrc += width >> 1; pdst += 1024; } pdst = (char *)pTDFX->MMIOBase[0] + YUV_U_BASE; psrc = (char*)buf + width * height + (width >> 1) * (height >> 1); - /* psrc now points to the base of the U plane, move out to src_x, src_y */ + /* psrc now points to the base of the U plane, move out to src_x/2, + * src_y/2 */ psrc += (src_x >> 1) + (src_y >> 1) * (width >> 1); - for (y = 0; y < height >> 1; y++) + for (y = 0; y < src_h >> 1; y++) { + /* YUV planar region is always 1024 bytes wide */ memcpy (pdst, psrc, src_w >> 1); psrc += width >> 1; pdst += 1024; } - + + /* Before restoring trashed registers we have to wait for the conversion + * to finish. We aren't using the FIFO for this but the hardware can + * take a little extra time even after we finish all the writes. If we + * restore the registers before it finishes it can store some of the YUV + * data to the wrong place. One particular wrong place is often on top + * of the hardware cursor data. So we wait for the status register + * to go idle. */ + /* XXX Right now wait for the whole chip to go idle. This is more than + * is required. Find out which subsystem is handles the YUV packing and + * wait only on that status bit. */ + count = 0; + do + { + count++; + } while ((TDFXReadLongMMIO(pTDFX, 0) & SST_BUSY) && count < 1000); + /* Restore trashed registers */ TDFXWriteLongMMIO(pTDFX, YUVBASEADDR, yuvBaseAddr); TDFXWriteLongMMIO(pTDFX, YUVSTRIDE, yuvStride); @@ -397,7 +453,7 @@ TDFXPutImage( FBAreaPtr fbarea; - /* Make sure we are synced up (this really mean, lock and find the + /* Make sure we are synced up (this really means, lock and find the * fifo pointer. */ TDFXFirstSync (pScrn); @@ -480,6 +536,8 @@ TDFXPutImage( * make sure the next command sent will work. */ TDFXSendNOP(pScrn); break; + /* XXX What am I supposed to do about the sync flag? */ + } return Success; @@ -605,13 +663,32 @@ TDFXDeallocateOffscreenBuffer (ScrnInfoPtr pScrn, int id) static FBAreaPtr TDFXAllocateOffscreenBuffer (ScrnInfoPtr pScrn, int id, int width, int height) { + int myWidth; TDFXPtr pTDFX = TDFXPTR(pScrn); if (!pTDFX) return NULL; - + + /* We tweak the width slightly */ + myWidth = width; + /* We tweak the width slightly */ + myWidth = width; + + /* width is measured in pixels. The pixels in the YUV image are alway + * 8 bit YUV data. But, the xf86 offscreen manager allocates in terms of + * desktop pixels, so we adjust. */ + myWidth = myWidth / pTDFX->cpp; + if (width % pTDFX->cpp) + myWidth++; + + /* If we are putting up a subimage then we need an extra column of data + * if the source width is odd, instead of checkin the width just always + * allocate an extra column. */ + /* XXX is this really necessary? */ + myWidth++; + if (pTDFX->offscreenYUVBuf != NULL && - width == pTDFX->offscreenYUVBufWidth && + myWidth == pTDFX->offscreenYUVBufWidth && height == pTDFX->offscreenYUVBufHeight) { /* we already have a buffer, don't do anything. */ @@ -622,8 +699,7 @@ TDFXAllocateOffscreenBuffer (ScrnInfoPtr pScrn, int id, int width, int height) if (pTDFX->offscreenYUVBuf != NULL) { if (!xf86ResizeOffscreenArea (pTDFX->offscreenYUVBuf, - /* I always want an 8 bit buffer. */ - width / pTDFX->cpp + 1, + myWidth, height)) { return (NULL); @@ -634,15 +710,14 @@ TDFXAllocateOffscreenBuffer (ScrnInfoPtr pScrn, int id, int width, int height) /* Allocate a brand new buffer */ pTDFX->offscreenYUVBuf = xf86AllocateOffscreenArea (pScrn->pScreen, - /* I always want an 8 bit buffer. */ - width / pTDFX->cpp + 1, + myWidth, height, 0, NULL, NULL, NULL); } /* Return the buffer */ - pTDFX->offscreenYUVBufWidth = width; + pTDFX->offscreenYUVBufWidth = myWidth; pTDFX->offscreenYUVBufHeight = height; return (pTDFX->offscreenYUVBuf); } @@ -661,11 +736,12 @@ TDFXQueryImageAttributes( /* The Maximum size for 3dfx YUV planar space * but our temporary buffer has to fit in the pixmap region which - * is the same width as the desktop and PIXMAP_CACHE_LINES pixels high. + * is the same width as the desktop and pTDFX->pixmapCacheLines + * pixels high. */ if(*w > 1024) *w = 1024; if (*w > pTDFX->stride) *w = pTDFX->stride; - if(*h > PIXMAP_CACHE_LINES) *h = PIXMAP_CACHE_LINES; + if(*h > pTDFX->pixmapCacheLines) *h = pTDFX->pixmapCacheLines; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h index cd822f4bf..c77566b78 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h,v 1.8 2000/12/01 14:29:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfxdefs.h,v 1.9 2000/12/15 15:19:35 dawes Exp $ */ /* Voodoo Banshee driver version 1.0.1 @@ -201,7 +201,6 @@ #define SST_3D_CHIPMASK SST_3D_OFFSET+0x214 /* NAPALM REGISTERS */ -#define CFG_PCI_COMMAND 4 #define CFG_MEM0BASE 16 #define CFG_MEM1BASE 20 #define CFG_INIT_ENABLE 64 diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/trident/Imakefile index 94e72cd9d..7833b3a6a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/Imakefile,v 1.26 2000/11/03 18:46:13 eich Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/Imakefile,v 1.27 2000/12/07 16:48:04 alanh Exp $ XCOMM XCOMM This is an Imakefile for the TRIDENT driver. XCOMM @@ -9,11 +9,11 @@ XCOMM SRCS = trident_driver.c trident_dac.c tridenthelper.c \ trident_accel.c trident_i2c.c trident_bank.c \ image_accel.c blade_accel.c tvga_dac.c trident_dga.c \ - trident_shadow.c + trident_shadow.c trident_video.c OBJS = trident_driver.o trident_dac.o tridenthelper.o \ trident_accel.o trident_i2c.o trident_bank.o \ image_accel.o blade_accel.o tvga_dac.o trident_dga.o \ - trident_shadow.o + trident_shadow.o trident_video.o #if defined(XF86DriverSDK) INCLUDES = -I. -I../../include @@ -61,6 +61,7 @@ InstallDriverSDKNonExecFile(trident_shadow.c,$(DRIVERSDKDIR)/drivers/trident) InstallDriverSDKNonExecFile(trident_regs.h,$(DRIVERSDKDIR)/drivers/trident) InstallDriverSDKNonExecFile(tridenthelper.c,$(DRIVERSDKDIR)/drivers/trident) InstallDriverSDKNonExecFile(tridentramdac.c,$(DRIVERSDKDIR)/drivers/trident) +InstallDriverSDKNonExecFile(trident_video.c,$(DRIVERSDKDIR)/drivers/trident) InstallDriverSDKNonExecFile(tvga_dac.c,$(DRIVERSDKDIR)/drivers/trident) InstallDriverSDKObjectModule(trident,$(DRIVERSDKMODULEDIR),drivers) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c index a20eacbda..f0720e477 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c @@ -23,7 +23,7 @@ * * Trident Blade3D accelerated options. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c,v 1.13 2000/12/04 08:46:17 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/blade_accel.c,v 1.14 2000/12/06 14:33:59 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -103,10 +103,6 @@ BladeInitializeAccelerator(ScrnInfoPtr pScrn) TRIDENTPtr pTrident = TRIDENTPTR(pScrn); CARD32 stride; - BLADE_OUT(0x2124, 1<<7); - BLADE_OUT(0x2124, 0); - BladeSync(pScrn); - stride = (pScrn->displayWidth >> 3) << 20; BLADE_OUT(0x21C8, stride); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c index 75b83482a..c63039ad7 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c @@ -23,7 +23,7 @@ * * Trident 3DImage' accelerated options. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c,v 1.16 2000/11/03 18:46:13 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c,v 1.21 2000/12/12 09:07:45 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -107,27 +107,19 @@ ImageInitializeAccelerator(ScrnInfoPtr pScrn) pTrident->EngineOperation = 2; break; } - IMAGE_OUT(0x2120, 0x10000000); - IMAGE_OUT(0x2130, 2047 << 16 | 2047); - IMAGE_OUT(0x2120, 0x20000000); + IMAGE_OUT(0x2120, 0xF0000000); IMAGE_OUT(0x2120, 0x40000000 | pTrident->EngineOperation); - IMAGE_OUT(0x2120, 0x50000000); - IMAGE_OUT(0x2120, 0x60000000 |pScrn->displayWidth<<16 |pScrn->displayWidth); - IMAGE_OUT(0x2120, 0x70000000); IMAGE_OUT(0x2120, 0x80000000); - IMAGE_OUT(0x2120, 0xA0000000); - IMAGE_OUT(0x2120, 0xB0000000); - IMAGE_OUT(0x2120, 0xD0000000); - IMAGE_OUT(0x2120, 0xE0000000); - IMAGE_OUT(0x2130, 0x00000000); - IMAGE_OUT(0x2120, 0xF0000000); IMAGE_OUT(0x2144, 0x00000000); IMAGE_OUT(0x2148, 0x00000000); IMAGE_OUT(0x2150, 0x00000000); IMAGE_OUT(0x2154, 0x00000000); + IMAGE_OUT(0x2120, 0x60000000 |pScrn->displayWidth<<16 |pScrn->displayWidth); IMAGE_OUT(0x216C, 0x00000000); IMAGE_OUT(0x2170, 0x00000000); IMAGE_OUT(0x217C, 0x00000000); + IMAGE_OUT(0x2120, 0x10000000); + IMAGE_OUT(0x2130, 2047 << 16 | 2047); pTrident->Clipping = FALSE; pTrident->DstEnable = FALSE; } @@ -202,9 +194,13 @@ ImageAccelInit(ScreenPtr pScreen) infoPtr->ClippingFlags |= HARDWARE_CLIP_COLOR_8x8_FILL; #endif + if (pTrident->Chipset != CYBER9397DVD) { + /* It seems as though the 9397DVD doesn't like the transfer window */ + /* But then, I've also tried at the two port addresses too, with */ + /* no luck. Disable for this chipset for now. I'd guess there's some */ + /* extra setup needed for this chipset. */ infoPtr->ScanlineCPUToScreenColorExpandFillFlags = NO_PLANEMASK | LEFT_EDGE_CLIPPING | - LEFT_EDGE_CLIPPING_NEGATIVE_X | BIT_ORDER_IN_BYTE_MSBFIRST; pTrident->XAAScanlineColorExpandBuffers[0] = @@ -222,7 +218,6 @@ ImageAccelInit(ScreenPtr pScreen) ImageSubsequentColorExpandScanline; infoPtr->ScanlineImageWriteFlags = NO_PLANEMASK | - LEFT_EDGE_CLIPPING_NEGATIVE_X | LEFT_EDGE_CLIPPING; infoPtr->SetupForScanlineImageWrite = ImageSetupForScanlineImageWrite; @@ -237,6 +232,7 @@ ImageAccelInit(ScreenPtr pScreen) xnfalloc(pScrn->virtualX * pScrn->bitsPerPixel / 8); infoPtr->ImageWriteBase = pTrident->IOBase + 0x10000; + } AvailFBArea.x1 = 0; AvailFBArea.y1 = 0; @@ -418,6 +414,9 @@ ImageSubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, int y, int w, int h) { TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + if ((w<=0) || (h<=0)) + return; + IMAGE_OUT(0x2108, ((y&0xfff)<<16) | (x&0xfff)); IMAGE_OUT(0x210C, (((y+h-1)&0xfff)<<16) | ((x+w-1)&0xfff)); IMAGE_OUT(0x2124, 0x80000000| 3<<22| 1<<10| 1<<9| (pTrident->Clipping?1:0)); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.cpp b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.cpp index ad4f3567d..a25063e3a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.cpp,v 1.4 2000/06/14 02:13:15 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.cpp,v 1.8 2000/12/11 20:18:37 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH TRIDENT __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH TRIDENT __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME trident \- Trident video driver .SH SYNOPSIS @@ -13,18 +13,69 @@ trident \- Trident video driver .B EndSection .fi .SH DESCRIPTION -.B trident -is an XFree86 driver for Trident video chips. -THIS MAN PAGE NEEDS TO BE FILLED IN. +.B trident +is an XFree86 driver for Trident video cards. The driver is fully +accelerated, and provides support for the following framebuffer depths: +1, 4, 8, 15, 16, and 24. Multi-head configurations +are supported. The XvImage extension is supported on all Blade and Image +series cards. Currently the ZOOM feature doesn't work properly on the Image +series. .SH SUPPORTED HARDWARE The .B trident -driver supports... +driver supports PCI,AGP and ISA video cards based on the following +Trident chips: +.TP 12 +.B Blade +Blade3D, CyberBlade series i1, i7 (DSTN), i1, i1 (DSTN), Ai1, Ai1 (DSTN), +CyberBlade/e4 +.TP 12 +.B Image +3DImage975, 3DImage985, Cyber9520, Cyber9525, Cyber9397, Cyber9397DVD +.TP 12 +.B ProVidia +9682, 9685, Cyber9382, Cyber9385, Cyber9388 +.TP 12 +.B TGUI +9440AGi, 9660, 9680 +.TP 12 +.B 8900 +8900D (ISA) .SH CONFIGURATION DETAILS Please refer to XF86Config(__filemansuffix__) for general configuration details. This section only covers configuration details specific to this driver. +.PP +The following driver +.B Options +are supported: +.TP +.BI "Option \*qSWCursor\*q \*q" boolean \*q +Enable or disable the SW cursor. Default: off. +.TP +.BI "Option \*qNoAccel\*q \*q" boolean \*q +Disable or enable acceleration. Default: acceleration is enabled. +.TP +.BI "Option \*qPciRetry\*q \*q" boolean \*q +Enable or disable PCI retries. Default: off. +.TP +.BI "Option \*qCyberShadow\*q \*q" boolean \*q +For Cyber chipsets only, turn off shadow registers. If you only see +a partial display - this may be the option for you. Default: on. +.TP +.BI "Option \*qShadowFB\*q \*q" boolean \*q +Enable or disable use of the shadow framebuffer layer. See +shadowfb(__drivermansuffix__) for further information. Default: off. +.TP +.BI "Option \*qVideoKey\*q \*q" integer \*q +This sets the default pixel value for the YUV video overlay key. +NOTE: Default is 0 for depth 15 and 24. This needs fixing. +Default: undefined. +.TP +.BI "Option \*qNoPciBurst\*q \*q" boolean \*q +Turn off PCI burst mode, PCI Bursting is on by default. +Default: off. .SH "SEE ALSO" XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__) -.SH AUTHORS -Authors include: ... +.SH AUTHOR +Author: Alan Hourihane diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h index 91744dd1e..775cfbc9d 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h @@ -1,5 +1,5 @@ /* - * Copyright 1998 by Alan Hourihane <alanh@fairlite.demon.co.uk> + * Copyright 1992-2000 by Alan Hourihane <alanh@fairlite.demon.co.uk> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -21,7 +21,7 @@ * * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h,v 1.31 2000/11/30 11:53:25 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h,v 1.33 2000/12/08 09:05:16 alanh Exp $ */ #ifndef _TRIDENT_H_ #define _TRIDENT_H_ @@ -34,6 +34,7 @@ #include "xf86i2c.h" #include "xf86int10.h" #include "shadowfb.h" +#include "xf86xv.h" typedef struct { unsigned char tridentRegs3x4[0x100]; @@ -69,7 +70,6 @@ typedef struct { Bool HWCursor; Bool UsePCIRetry; Bool UsePCIBurst; - Bool UseGERetry; Bool NewClockCode; Bool Clipping; Bool DstEnable; @@ -77,10 +77,6 @@ typedef struct { Bool HasSGRAM; Bool MUX; Bool IsCyber; -#if 0 - /* obsolete */ - Bool CyberShadowSet; -#endif Bool CyberShadow; Bool NoMMIO; Bool MMIOonly; @@ -128,12 +124,20 @@ typedef struct { xf86Int10InfoPtr Int10; XAAInfoRecPtr AccelInfoRec; CloseScreenProcPtr CloseScreen; + ScreenBlockHandlerProcPtr BlockHandler; int panelWidth; int panelHeight; unsigned int (*ddc1Read)(ScrnInfoPtr); CARD8* XAAScanlineColorExpandBuffers[2]; CARD8* XAAImageScanlineBuffer[1]; void (*InitializeAccelerator)(ScrnInfoPtr); +#ifdef XvExtension + void (*VideoTimerCallback)(ScrnInfoPtr, Time); + XF86VideoAdaptorPtr adaptor; + int videoKey; + int hsync; + int vsync; +#endif } TRIDENTRec, *TRIDENTPtr; typedef struct { @@ -240,7 +244,6 @@ typedef enum { CYBER9397DVD, CYBER9520, CYBER9525DVD, - CYBERBLADEE4, IMAGE975, IMAGE985, BLADE3D, @@ -249,7 +252,8 @@ typedef enum { CYBERBLADEI1, CYBERBLADEI1D, CYBERBLADEAI1, - CYBERBLADEAI1D + CYBERBLADEAI1D, + CYBERBLADEE4 } TRIDENTType; #define UseMMIO (pTrident->NoMMIO == FALSE) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_accel.c index 905c44497..35e6b3a42 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_accel.c @@ -1,5 +1,5 @@ /* - * Copyright 1997,1998 by Alan Hourihane, Wigan, England. + * Copyright 1992-2000 by Alan Hourihane, Wigan, England. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -23,7 +23,7 @@ * * Trident accelerated options. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_accel.c,v 1.18 2000/11/16 20:11:30 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_accel.c,v 1.19 2000/12/07 16:48:04 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -320,8 +320,7 @@ TridentSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, TGUI_DEST_XY(x2,y2); TGUI_DIM_XY(w,h); TGUI_COMMAND(GE_BLT); - if (!pTrident->UseGERetry) - TridentClearSync(pScrn); + TridentClearSync(pScrn); } static void @@ -360,8 +359,7 @@ TridentSubsequentSolidBresenhamLine( ScrnInfoPtr pScrn, TGUI_DEST_XY(x,y); TGUI_DIM_XY(dmin+e,len); TGUI_COMMAND(GE_BRESLINE); - if (!pTrident->UseGERetry) - TridentSync(pScrn); + TridentSync(pScrn); } static void @@ -381,8 +379,7 @@ TridentSubsequentSolidHorVertLine( TGUI_DEST_XY(x,y); } TGUI_COMMAND(GE_BLT); - if (!pTrident->UseGERetry) - TridentSync(pScrn); + TridentSync(pScrn); } void @@ -452,8 +449,7 @@ TridentSubsequentDashedBresenhamLine(ScrnInfoPtr pScrn, TGUI_DEST_XY(x,y); TGUI_DIM_XY(e+dmin,len); TGUI_COMMAND(GE_BRESLINE); - if (!pTrident->UseGERetry) - TridentSync(pScrn); + TridentSync(pScrn); } static void @@ -485,8 +481,7 @@ TridentSubsequentFillRectSolid(ScrnInfoPtr pScrn, int x, int y, int w, int h) TGUI_DIM_XY(w,h); TGUI_DEST_XY(x,y); TGUI_COMMAND(GE_BLT); - if (!pTrident->UseGERetry) - TridentSync(pScrn); + TridentSync(pScrn); } static void MoveDWORDS( @@ -570,8 +565,7 @@ TridentSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, TGUI_DEST_XY(x,y); TGUI_DIM_XY(w,h); TGUI_COMMAND(GE_BLT); - if (!pTrident->UseGERetry) - TridentSync(pScrn); + TridentSync(pScrn); } static void @@ -615,8 +609,7 @@ TridentSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrn, TGUI_DEST_XY(x,y); TGUI_DIM_XY(w,h); TGUI_COMMAND(GE_BLT); - if (!pTrident->UseGERetry) - TridentClearSync(pScrn); + TridentClearSync(pScrn); } static void @@ -677,8 +670,7 @@ TridentSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno) pTrident->dwords); pTrident->h--; - if (!pTrident->UseGERetry) - TridentSync(pScrn); + TridentSync(pScrn); if (pTrident->h) { TGUI_DEST_XY(pTrident->x,pTrident->y++); TGUI_DIM_XY(pTrident->w,1); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_bank.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_bank.c index af1cea9c0..056d64a32 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_bank.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_bank.c @@ -1,5 +1,5 @@ /* - * Copyright 1998 by Alan Hourihane, Wigan, England. + * Copyright 1992-2000 by Alan Hourihane, Wigan, England. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -21,7 +21,7 @@ * * Author: Alan Hourihane, alanh@fairlite.demon.co.uk */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_bank.c,v 1.3 1999/10/13 20:02:30 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_bank.c,v 1.4 2000/12/07 16:48:04 alanh Exp $ */ /* All drivers should typically include these */ #include "xf86.h" diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c index 8166ab42b..4aceb4090 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c @@ -1,5 +1,5 @@ /* - * Copyright 1992-1999 by Alan Hourihane, Wigan, England. + * Copyright 1992-2000 by Alan Hourihane, Wigan, England. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -21,7 +21,7 @@ * * Author: Alan Hourihane, alanh@fairlite.demon.co.uk */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c,v 1.33 2000/11/30 10:19:48 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c,v 1.37 2000/12/14 19:29:44 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -170,6 +170,8 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode) OUTB(0x3CE, MiscExtFunc); pReg->tridentRegs3CE[MiscExtFunc] = INB(0x3CF) & 0xF0; pReg->tridentRegs3x4[GraphEngReg] = 0x00; + pReg->tridentRegs3x4[PreEndControl] = 0; + pReg->tridentRegs3x4[PreEndFetch] = 0; pReg->tridentRegs3x4[CRTHiOrd] = (((mode->CrtcVBlankEnd-1) & 0x400)>>4) | (((mode->CrtcVTotal - 2) & 0x400) >> 3) | @@ -307,7 +309,13 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode) pReg->tridentRegs3CE[CyberControl] &= 0x7E; xf86DrvMsgVerb(pScrn->scrnIndex,X_INFO,1,"Shadow off\n"); } + + if (pTrident->CyberShadow) { + pReg->tridentRegs3CE[CyberControl] &= 0x7E; + xf86DrvMsgVerb(pScrn->scrnIndex,X_INFO,1,"Forcing Shadow off\n"); + } } + /* Enable Chipset specific options */ switch (pTrident->Chipset) { case CYBERBLADEI7: @@ -319,8 +327,7 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode) case CYBERBLADEE4: case BLADE3D: OUTB(vgaIOBase + 4, RAMDACTiming); - pReg->tridentRegs3x4[RAMDACTiming] |= 0x0F; - pReg->tridentRegs3x4[GraphEngReg] |= 0x10; + pReg->tridentRegs3x4[RAMDACTiming] = INB(vgaIOBase + 5) | 0x0F; /* Fall Through */ case CYBER9520: case CYBER9525DVD: @@ -331,21 +338,19 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode) case IMAGE985: if (pScrn->bitsPerPixel >= 8) pReg->tridentRegs3CE[MiscExtFunc] |= 0x10; + if (!pReg->tridentRegs3x4[PreEndControl]) + pReg->tridentRegs3x4[PreEndControl] = 0x01; + if (!pReg->tridentRegs3x4[PreEndFetch]) + pReg->tridentRegs3x4[PreEndFetch] = 0xFF; /* Fall Through */ case PROVIDIA9685: - if (pTrident->UsePCIRetry) { - pTrident->UseGERetry = TRUE; - pReg->tridentRegs3x4[Enhancement0] = 0x50; - } else { - pTrident->UseGERetry = FALSE; - pReg->tridentRegs3x4[Enhancement0] = 0x00; - } + pReg->tridentRegs3x4[Enhancement0] = 0x40; /* Fall Through */ case PROVIDIA9682: if (pTrident->UsePCIRetry) pReg->tridentRegs3x4[PCIRetry] = 0xDF; else - pReg->tridentRegs3x4[PCIRetry] = 0x00; + pReg->tridentRegs3x4[PCIRetry] = 0x1F; /* Fall Through */ case TGUI9660: case TGUI9680: @@ -539,6 +544,8 @@ TridentRestore(ScrnInfoPtr pScrn, TRIDENTRegPtr tridentReg) OUTW_3CE(MiscIntContReg); OUTW_3CE(MiscExtFunc); OUTW_3x4(Offset); + OUTW_3x4(PreEndControl); + OUTW_3x4(PreEndFetch); if (pTrident->Chipset >= PROVIDIA9685) OUTW_3x4(Enhancement0); if (pTrident->Chipset >= BLADE3D) OUTW_3x4(RAMDACTiming); if (pTrident->Chipset == CYBERBLADEE4) OUTW_3x4(New32); @@ -562,8 +569,6 @@ TridentRestore(ScrnInfoPtr pScrn, TRIDENTRegPtr tridentReg) OUTW_3x4(0x11); OUTW_3x4(0x16); SHADOW_RESTORE(tmp); - OUTW_3x4(PreEndControl); - OUTW_3x4(PreEndFetch); } if (Is3Dchip) { @@ -639,6 +644,8 @@ TridentSave(ScrnInfoPtr pScrn, TRIDENTRegPtr tridentReg) INB_3x4(GraphEngReg); INB_3x4(PCIReg); INB_3x4(PCIRetry); + INB_3x4(PreEndControl); + INB_3x4(PreEndFetch); if (pTrident->Chipset >= PROVIDIA9685) INB_3x4(Enhancement0); if (pTrident->Chipset >= BLADE3D) INB_3x4(RAMDACTiming); if (pTrident->Chipset == CYBERBLADEE4) INB_3x4(New32); @@ -661,8 +668,6 @@ TridentSave(ScrnInfoPtr pScrn, TRIDENTRegPtr tridentReg) INB_3x4(0x11); INB_3x4(0x16); SHADOW_RESTORE(tmp); - INB_3x4(PreEndControl); - INB_3x4(PreEndFetch); } /* save cursor registers */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c index 145076dee..5ee14fa65 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c @@ -1,5 +1,5 @@ /* - * Copyright 1992-1998 by Alan Hourihane, Wigan, England. + * Copyright 1992-2000 by Alan Hourihane, Wigan, England. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -28,7 +28,7 @@ * Massimiliano Ghilardi, max@Linuz.sns.it, some fixes to the * clockchip programming code. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c,v 1.113 2000/12/02 15:30:58 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c,v 1.119 2000/12/08 09:05:16 alanh Exp $ */ #include "xf1bpp.h" #include "xf4bpp.h" @@ -47,7 +47,7 @@ #include "vgaHW.h" #include "xf86RAC.h" #include "vbe.h" - +#include "dixstruct.h" #include "compiler.h" #include "mipointer.h" @@ -94,6 +94,7 @@ static Bool TRIDENTUnmapMem(ScrnInfoPtr pScrn); static void TRIDENTSave(ScrnInfoPtr pScrn); static void TRIDENTRestore(ScrnInfoPtr pScrn); static Bool TRIDENTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); +static void TRIDENTBlockHandler(int, pointer, pointer, pointer); static void TRIDENTEnableMMIO(ScrnInfoPtr pScrn); static void TRIDENTDisableMMIO(ScrnInfoPtr pScrn); @@ -125,9 +126,6 @@ static int pix24bpp = 0; DriverRec TRIDENT = { VERSION, TRIDENT_DRIVER_NAME, -#if 0 - "accelerated driver for Trident chipsets", -#endif TRIDENTIdentify, TRIDENTProbe, TRIDENTAvailableOptions, @@ -199,7 +197,6 @@ static PciChipsets TRIDENTPciChipsets[] = { typedef enum { OPTION_SW_CURSOR, - OPTION_HW_CURSOR, OPTION_PCI_RETRY, OPTION_RGB_BITS, OPTION_NOACCEL, @@ -208,65 +205,28 @@ typedef enum { OPTION_SHADOW_FB, OPTION_ROTATE, OPTION_MMIO_ONLY, -#if 0 - /* obsolete */ - OPTION_CYBER_SHADOW, -#endif + OPTION_VIDEO_KEY, OPTION_NOMMIO, - OPTION_NOPCIBURST + OPTION_NOPCIBURST, + OPTION_CYBER_SHADOW } TRIDENTOpts; static OptionInfoRec TRIDENTOptions[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SETMCLK, "SetMClk", OPTV_FREQ, {0}, FALSE }, { OPTION_MUX_THRESHOLD, "MUXThreshold", OPTV_INTEGER, {0}, FALSE }, { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE }, -#if 0 - /* obsolete */ - { OPTION_CYBER_SHADOW, "CyberShadow", OPTV_BOOLEAN, {0}, FALSE }, -#endif + { OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE }, { OPTION_NOMMIO, "NoMMIO", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOPCIBURST, "NoPciBurst", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_MMIO_ONLY, "MMIOonly", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_CYBER_SHADOW, "CyberShadow", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; -#if 0 -static int AvailablePitches[] = { - { 0 }, /* 8200LX */ - { 0 }, /* 8800CS */ - { 0 }, /* 8900B */ - { 0 }, /* 8900C */ - { 0 }, /* 8900CL */ - { 0 }, /* 8900D */ - { 0 }, /* 9000 */ - { 0 }, /* 9000i */ - { 0 }, /* 9100B */ - { 0 }, /* 9200CXr */ - { 0 }, /* 9400CXi */ - { 0 }, /* 9420 */ - { 0 }, /* 9420DGi */ - { 0 }, /* 9430DGi */ - { 512, 1024, 2048, 4096 }, /* 9440AGi */ - { 512, 640, 800, 1024, 1280, 2048, 4096 }, /* 9320 */ - { 512, 640, 832, 1024, 1280, 2048, 4096 }, /* 9660 */ - { 512, 640, 800, 1024, 1280, 2048, 4096 }, /* 9680 */ - { 512, 640, 800, 832, 1024, 1280, 1600, 2048, 4096 }, /* 9682 */ - { 512, 640, 800, 832, 1024, 1280, 1600, 2048, 4096 }, /* 9685 */ - { 512, 640, 800, 832, 1024, 1280, 1600, 2048, 4096 }, /* 9685 */ - { 512, 640, 800, 832, 1024, 1280, 1600, 2048, 4096 }, /* 9685 */ - { 0 }, - { 0 }, - { 0 }, - { 0 }, - { 0 }, -}; -#endif - /* Clock Limits */ static int ClockLimit[] = { 80000, @@ -626,6 +586,27 @@ TRIDENTDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, int } #endif +static void +TRIDENTBlockHandler ( + int i, + pointer blockData, + pointer pTimeout, + pointer pReadmask +){ + ScreenPtr pScreen = screenInfo.screens[i]; + ScrnInfoPtr pScrn = xf86Screens[i]; + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + + pScreen->BlockHandler = pTrident->BlockHandler; + (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + pScreen->BlockHandler = TRIDENTBlockHandler; + + if(pTrident->VideoTimerCallback) { + UpdateCurrentTime(); + (*pTrident->VideoTimerCallback)(pScrn, currentTime.milliseconds); + } +} + static OptionInfoPtr TRIDENTAvailableOptions(int chipid, int busid) @@ -1062,9 +1043,29 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) case 1: case 4: case 8: + if (pScrn->bitsPerPixel != pScrn->depth) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Given depth (%d)/ fbbpp (%d) is not supported by this driver\n", + pScrn->depth, pScrn->bitsPerPixel); + return FALSE; + } + break; case 15: case 16: + if (pScrn->bitsPerPixel != 16) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Given depth (%d)/ fbbpp (%d) is not supported by this driver\n", + pScrn->depth, pScrn->bitsPerPixel); + return FALSE; + } + break; case 24: + if ((pScrn->bitsPerPixel != 24) && (pScrn->bitsPerPixel != 32)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Given depth (%d)/ fbbpp (%d) is not supported by this driver\n", + pScrn->depth, pScrn->bitsPerPixel); + return FALSE; + } /* OK */ break; default: @@ -1168,8 +1169,6 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) } from = X_DEFAULT; pTrident->HWCursor = TRUE; - if (xf86GetOptValBool(TRIDENTOptions, OPTION_HW_CURSOR, &pTrident->HWCursor)) - from = X_CONFIG; if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pTrident->HWCursor = FALSE; @@ -1189,14 +1188,16 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) pTrident->UsePCIBurst = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI Burst disbled\n"); } -#if 0 - /* obsolete */ - if ((pTrident->CyberShadowSet = xf86GetOptValBool(TRIDENTOptions, - OPTION_CYBER_SHADOW, - &pTrident->CyberShadow))) - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Cyber Shadow Registers %s\n", - pTrident->CyberShadow?"enabled":"disabled"); -#endif + if(xf86GetOptValInteger(TRIDENTOptions, OPTION_VIDEO_KEY, + &(pTrident->videoKey))) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n", + pTrident->videoKey); + } else { + pTrident->videoKey = (1 << pScrn->offset.red) | + (1 << pScrn->offset.green) | + (((pScrn->mask.blue >> pScrn->offset.blue) - 1) + << pScrn->offset.blue); + } if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_NOMMIO, FALSE)) { pTrident->NoMMIO = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MMIO Disabled\n"); @@ -1210,8 +1211,12 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MMIO Disabled\n"); } } + if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_CYBER_SHADOW, FALSE)) { + pTrident->CyberShadow = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Cyber Shadow enabled\n"); + } - pTrident->MUXThreshold = 80000; /* 100MHz */ + pTrident->MUXThreshold = 160000; /* 160MHz */ if (xf86GetOptValInteger(TRIDENTOptions, OPTION_MUX_THRESHOLD, &pTrident->MUXThreshold)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MUX Threshold set to %d\n", @@ -1267,23 +1272,6 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) /* FIXME ACCELERATION */ if (!UseMMIO) pTrident->NoAccel = TRUE; -#if 0 - /* - * This shouldn't happen because such problems should be caught in - * TRIDENTProbe(), but check it just in case. - */ - if (pScrn->chipset == NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "ChipID 0x%04X is not recognised\n", pTrident->Chipset); - return FALSE; - } - if (pTrident->Chipset < 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Chipset \"%s\" is not recognised\n", pScrn->chipset); - return FALSE; - } -#endif - if (pTrident->Linear) { if (pTrident->pEnt->device->MemBase != 0) { /* @@ -1370,7 +1358,6 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) pScrn->progClock = TRUE; pTrident->EngineOperation = 0x00; - pTrident->UseGERetry = FALSE; pTrident->IsCyber = FALSE; pTrident->HasSGRAM = FALSE; pTrident->NewClockCode = FALSE; @@ -1998,7 +1985,8 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) xf86LoaderReqSymbols(Sym, NULL); #ifdef RENDER - xf86LoaderReqSymbols("fbPictureInit", NULL); + if (pScrn->depth > 8) + xf86LoaderReqSymbols("fbPictureInit", NULL); #endif if (!xf86LoadSubModule(pScrn, "i2c")) { @@ -2229,6 +2217,10 @@ TRIDENTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) break; } + /* Calculate skew offsets for video overlay */ + pTrident->hsync = (mode->CrtcHTotal - mode->CrtcHSyncStart) - 23; + pTrident->vsync = (mode->CrtcVTotal - mode->CrtcVSyncStart) - 4; + vgaHWUnlock(hwp); /* Initialise the ModeReg values */ @@ -2436,6 +2428,11 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) ret = fbScreenInit(pScreen, FBStart, width, height, pScrn->xDpi, pScrn->yDpi, displayWidth, pScrn->bitsPerPixel); +#ifdef RENDER + if (ret) + fbPictureInit (pScreen, 0, 0); +#endif + break; default: xf86DrvMsg(scrnIndex, X_ERROR, @@ -2447,10 +2444,6 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (!ret) return FALSE; -#ifdef RENDER - fbPictureInit (pScreen, 0, 0); -#endif - if (pScrn->bitsPerPixel > 8) { /* Fixup RGB ordering */ visual = pScreen->visuals + pScreen->numVisuals; @@ -2472,6 +2465,9 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86SetBlackWhitePixels(pScreen); + pTrident->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = TRIDENTBlockHandler; + if (!pTrident->ShadowFB) TRIDENTDGAInit(pScreen); @@ -2530,8 +2526,8 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pTrident->HWCursor = FALSE; if (pTrident->HWCursor) { - TridentHWCursorInit(pScreen); xf86SetSilkenMouse(pScreen); + TridentHWCursorInit(pScreen); } /* Initialise default colourmap */ @@ -2583,17 +2579,13 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->fbOffset = 0; #ifdef XvExtension - { - XF86VideoAdaptorPtr *ptr; - int n; - - n = xf86XVListGenericAdaptors(pScrn,&ptr); - if (n) { - xf86XVScreenInit(pScreen, ptr, n); - } - } + if (pTrident->Chipset >= CYBER9397) + TRIDENTInitVideo(pScreen); #endif + if(pTrident->BlockHandler) + pScreen->BlockHandler = pTrident->BlockHandler; + pTrident->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = TRIDENTCloseScreen; pScreen->SaveScreen = TRIDENTSaveScreen; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h index 754192162..7c07b73ff 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h @@ -1,5 +1,5 @@ /* - * Copyright 1992-1998 by Alan Hourihane, Wigan, England. + * Copyright 1992-2000 by Alan Hourihane, Wigan, England. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -21,7 +21,7 @@ * * Author: Alan Hourihane, alanh@fairlite.demon.co.uk */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h,v 1.16 2000/12/04 08:46:17 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h,v 1.18 2000/12/07 19:03:40 alanh Exp $ */ #define DEBUG 1 @@ -84,14 +84,14 @@ #define CursorBG4 0x4F #define CursorControl 0x50 #define PCIRetry 0x55 +#define PreEndControl 0x56 +#define PreEndFetch 0x57 #define PCIMaster 0x60 #define Enhancement0 0x62 #define NewEDO 0x64 #define TVinterface 0xC0 #define TVMode 0xC1 #define ClockControl 0xCF -#define PreEndControl 0x56 -#define PreEndFetch 0x57 /* 3CE */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c new file mode 100644 index 000000000..6c8e301fe --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c @@ -0,0 +1,1127 @@ +/* + * Copyright 1992-2000 by Alan Hourihane, Wigan, England. + * + * 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 Alan Hourihane not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Alan Hourihane makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL ALAN HOURIHANE 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. + * + * Author: Alan Hourihane, alanh@fairlite.demon.co.uk + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c,v 1.2 2000/12/14 19:29:44 dawes Exp $ */ + +#include "xf86.h" +#include "xf86_OSproc.h" +#include "xf86Resources.h" +#include "xf86_ansic.h" +#include "compiler.h" +#include "xf86PciInfo.h" +#include "xf86Pci.h" +#include "xf86fbman.h" +#include "regionstr.h" + +#include "trident.h" +#include "trident_regs.h" +#include "Xv.h" +#include "xaa.h" +#include "xaalocal.h" +#include "dixstruct.h" +#include "fourcc.h" + +#define OFF_DELAY 200 /* milliseconds */ +#define FREE_DELAY 60000 + +#define OFF_TIMER 0x01 +#define FREE_TIMER 0x02 +#define CLIENT_VIDEO_ON 0x04 + +#define TIMER_MASK (OFF_TIMER | FREE_TIMER) + +#ifndef XvExtension +void TRIDENTInitVideo(ScreenPtr pScreen) {} +void TRIDENTResetVideo(ScrnInfoPtr pScrn) {} +#else + +static XF86VideoAdaptorPtr TRIDENTSetupImageVideo(ScreenPtr); +static void TRIDENTInitOffscreenImages(ScreenPtr); +static void TRIDENTStopVideo(ScrnInfoPtr, pointer, Bool); +static int TRIDENTSetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer); +static int TRIDENTGetPortAttribute(ScrnInfoPtr, Atom ,INT32 *, pointer); +static void TRIDENTQueryBestSize(ScrnInfoPtr, Bool, + short, short, short, short, unsigned int *, unsigned int *, pointer); +static int TRIDENTPutImage( ScrnInfoPtr, + short, short, short, short, short, short, short, short, + int, unsigned char*, short, short, Bool, RegionPtr, pointer); +static int TRIDENTQueryImageAttributes(ScrnInfoPtr, + int, unsigned short *, unsigned short *, int *, int *); +static void TRIDENTVideoTimerCallback(ScrnInfoPtr pScrn, Time time); + +#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) + +static Atom xvColorKey; + +void TRIDENTInitVideo(ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; + XF86VideoAdaptorPtr newAdaptor = NULL; + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + int num_adaptors; + + if (!pTrident->NoAccel) { + newAdaptor = TRIDENTSetupImageVideo(pScreen); + TRIDENTInitOffscreenImages(pScreen); + } + + num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); + + if(newAdaptor) { + if(!num_adaptors) { + num_adaptors = 1; + adaptors = &newAdaptor; + } else { + newAdaptors = /* need to free this someplace */ + xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*)); + if(newAdaptors) { + memcpy(newAdaptors, adaptors, num_adaptors * + sizeof(XF86VideoAdaptorPtr)); + newAdaptors[num_adaptors] = newAdaptor; + adaptors = newAdaptors; + num_adaptors++; + } + } + } + + if(num_adaptors) + xf86XVScreenInit(pScreen, adaptors, num_adaptors); + + if(newAdaptors) + xfree(newAdaptors); +} + +/* client libraries expect an encoding */ +static XF86VideoEncodingRec DummyEncoding[1] = +{ + { + 0, + "XV_IMAGE", + 1024, 1024, + {1, 1} + } +}; + +#define NUM_FORMATS 4 + +static XF86VideoFormatRec Formats[NUM_FORMATS] = +{ + {8, PseudoColor}, {15, TrueColor}, {16, TrueColor}, {24, TrueColor} +}; + +#define NUM_ATTRIBUTES 1 + +static XF86AttributeRec Attributes[NUM_ATTRIBUTES] = +{ + {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"} +}; + +#define NUM_IMAGES 4 + +static XF86ImageRec Images[NUM_IMAGES] = +{ + { + 0x35315652, + XvRGB, + LSBFirst, + {'R','V','1','5', + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + 16, + XvPacked, + 1, + 15, 0x001F, 0x03E0, 0x7C00, + 0, 0, 0, + 0, 0, 0, + 0, 0, 0, + {'R','V','B',0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + XvTopToBottom + }, + { + 0x36315652, + XvRGB, + LSBFirst, + {'R','V','1','6', + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, + 16, + XvPacked, + 1, + 16, 0x001F, 0x07E0, 0xF800, + 0, 0, 0, + 0, 0, 0, + 0, 0, 0, + {'R','V','B',0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + XvTopToBottom + }, + XVIMAGE_YV12, + XVIMAGE_YUY2 +}; + +typedef struct { + FBLinearPtr linear; + RegionRec clip; + CARD32 colorKey; + CARD32 videoStatus; + Time offTime; + Time freeTime; +} TRIDENTPortPrivRec, *TRIDENTPortPrivPtr; + + +#define GET_PORT_PRIVATE(pScrn) \ + (TRIDENTPortPrivPtr)((TRIDENTPTR(pScrn))->adaptor->pPortPrivates[0].ptr) + +void TRIDENTResetVideo(ScrnInfoPtr pScrn) +{ + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + TRIDENTPortPrivPtr pPriv = pTrident->adaptor->pPortPrivates[0].ptr; + int vgaIOBase = VGAHWPTR(pScrn)->IOBase; + int red, green, blue; + int tmp; + + OUTW(vgaIOBase + 4, 0x008E); + OUTW(vgaIOBase + 4, 0x008F); + + OUTW(vgaIOBase + 4, 0x80B9); + + OUTW(0x3C4, 0x3037); + OUTW(0x3C4, 0xC057); + OUTW(0x3C4, 0x3420); + + switch (pScrn->depth) { + case 8: + OUTW(0x3C4, (pPriv->colorKey<<8) | 0x50); + OUTW(0x3C4, 0x0051); + OUTW(0x3C4, 0x0052); + OUTW(0x3C4, 0xFF54); + OUTW(0x3C4, 0x0055); + OUTW(0x3C4, 0x0056); + break; + default: + red = (pPriv->colorKey & pScrn->mask.red) >> pScrn->offset.red; + green = (pPriv->colorKey & pScrn->mask.green) >> pScrn->offset.green; + blue = (pPriv->colorKey & pScrn->mask.blue) >> pScrn->offset.blue; + switch (pScrn->depth) { + case 15: + tmp = (red << 11) | (green << 6) | (blue); + OUTW(0x3C4, (tmp & 0xff) << 8 | 0x50); + OUTW(0x3C4, (tmp & 0xff00) | 0x51); + OUTW(0x3C4, 0x0052); + OUTW(0x3C4, 0xFF54); + OUTW(0x3C4, 0xFF55); + OUTW(0x3C4, 0x0056); + break; + case 16: + tmp = (red << 11) | (green << 5) | (blue); + OUTW(0x3C4, (tmp & 0xff) << 8 | 0x50); + OUTW(0x3C4, (tmp & 0xff00) | 0x51); + OUTW(0x3C4, 0x0052); + OUTW(0x3C4, 0xFF54); + OUTW(0x3C4, 0xFF55); + OUTW(0x3C4, 0x0056); + break; + case 24: + OUTW(0x3C4, (red<<8) | 0x50); + OUTW(0x3C4, (green<<8) | 0x51); + OUTW(0x3C4, (blue<<8) | 0x52); + OUTW(0x3C4, 0xFF54); + OUTW(0x3C4, 0xFF55); + OUTW(0x3C4, 0xFF56); + break; + } + } +} + + +static XF86VideoAdaptorPtr +TRIDENTSetupImageVideo(ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + XF86VideoAdaptorPtr adapt; + TRIDENTPortPrivPtr pPriv; + + if(!(adapt = xcalloc(1, sizeof(XF86VideoAdaptorRec) + + sizeof(TRIDENTPortPrivRec) + + sizeof(DevUnion)))) + return NULL; + + adapt->type = XvWindowMask | XvInputMask | XvImageMask; + adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; + adapt->name = "Trident Backend Scaler"; + adapt->nEncodings = 1; + adapt->pEncodings = DummyEncoding; + adapt->nFormats = NUM_FORMATS; + adapt->pFormats = Formats; + adapt->nPorts = 1; + adapt->pPortPrivates = (DevUnion*)(&adapt[1]); + pPriv = (TRIDENTPortPrivPtr)(&adapt->pPortPrivates[1]); + adapt->pPortPrivates[0].ptr = (pointer)(pPriv); + adapt->pAttributes = Attributes; + adapt->nImages = NUM_IMAGES; + adapt->nAttributes = NUM_ATTRIBUTES; + adapt->pImages = Images; + adapt->PutVideo = NULL; + adapt->PutStill = NULL; + adapt->GetVideo = NULL; + adapt->GetStill = NULL; + adapt->StopVideo = TRIDENTStopVideo; + adapt->SetPortAttribute = TRIDENTSetPortAttribute; + adapt->GetPortAttribute = TRIDENTGetPortAttribute; + adapt->QueryBestSize = TRIDENTQueryBestSize; + adapt->PutImage = TRIDENTPutImage; + adapt->QueryImageAttributes = TRIDENTQueryImageAttributes; + + if ((pScrn->depth == 15) || (pScrn->depth == 24)) + pPriv->colorKey = 0; /* FIXME */ + else + pPriv->colorKey = pTrident->videoKey; + pPriv->videoStatus = 0; + + /* gotta uninit this someplace */ + REGION_INIT(pScreen, &pPriv->clip, NullBox, 0); + + pTrident->adaptor = adapt; + + xvColorKey = MAKE_ATOM("XV_COLORKEY"); + + TRIDENTResetVideo(pScrn); + + return adapt; +} + + +static Bool +RegionsEqual(RegionPtr A, RegionPtr B) +{ + int *dataA, *dataB; + int num; + + num = REGION_NUM_RECTS(A); + if(num != REGION_NUM_RECTS(B)) + return FALSE; + + if((A->extents.x1 != B->extents.x1) || + (A->extents.x2 != B->extents.x2) || + (A->extents.y1 != B->extents.y1) || + (A->extents.y2 != B->extents.y2)) + return FALSE; + + dataA = (int*)REGION_RECTS(A); + dataB = (int*)REGION_RECTS(B); + + while(num--) { + if((dataA[0] != dataB[0]) || (dataA[1] != dataB[1])) + return FALSE; + dataA += 2; + dataB += 2; + } + + return TRUE; +} + +/* TRIDENTClipVideo - + + Takes the dst box in standard X BoxRec form (top and left + edges inclusive, bottom and right exclusive). The new dst + box is returned. The source boundaries are given (x1, y1 + inclusive, x2, y2 exclusive) and returned are the new source + boundaries in 16.16 fixed point. +*/ + +#define DummyScreen screenInfo.screens[0] + +static Bool +TRIDENTClipVideo( + BoxPtr dst, + INT32 *x1, + INT32 *x2, + INT32 *y1, + INT32 *y2, + RegionPtr reg, + INT32 width, + INT32 height +){ + INT32 vscale, hscale, delta; + BoxPtr extents = REGION_EXTENTS(DummyScreen, reg); + int diff; + + hscale = ((*x2 - *x1) << 16) / (dst->x2 - dst->x1); + vscale = ((*y2 - *y1) << 16) / (dst->y2 - dst->y1); + + *x1 <<= 16; *x2 <<= 16; + *y1 <<= 16; *y2 <<= 16; + + diff = extents->x1 - dst->x1; + if(diff > 0) { + dst->x1 = extents->x1; + *x1 += diff * hscale; + } + diff = dst->x2 - extents->x2; + if(diff > 0) { + dst->x2 = extents->x2; + *x2 -= diff * hscale; + } + diff = extents->y1 - dst->y1; + if(diff > 0) { + dst->y1 = extents->y1; + *y1 += diff * vscale; + } + diff = dst->y2 - extents->y2; + if(diff > 0) { + dst->y2 = extents->y2; + *y2 -= diff * vscale; + } + + if(*x1 < 0) { + diff = (- *x1 + hscale - 1)/ hscale; + dst->x1 += diff; + *x1 += diff * hscale; + } + delta = *x2 - (width << 16); + if(delta > 0) { + diff = (delta + hscale - 1)/ hscale; + dst->x2 -= diff; + *x2 -= diff * hscale; + } + if(*x1 >= *x2) return FALSE; + + if(*y1 < 0) { + diff = (- *y1 + vscale - 1)/ vscale; + dst->y1 += diff; + *y1 += diff * vscale; + } + delta = *y2 - (height << 16); + if(delta > 0) { + diff = (delta + vscale - 1)/ vscale; + dst->y2 -= diff; + *y2 -= diff * vscale; + } + if(*y1 >= *y2) return FALSE; + + if((dst->x1 != extents->x1) || (dst->x2 != extents->x2) || + (dst->y1 != extents->y1) || (dst->y2 != extents->y2)) + { + RegionRec clipReg; + REGION_INIT(DummyScreen, &clipReg, dst, 1); + REGION_INTERSECT(DummyScreen, reg, reg, &clipReg); + REGION_UNINIT(DummyScreen, &clipReg); + } + return TRUE; +} + + +static void +TRIDENTStopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit) +{ + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + TRIDENTPortPrivPtr pPriv = (TRIDENTPortPrivPtr)data; + int vgaIOBase = VGAHWPTR(pScrn)->IOBase; + + REGION_EMPTY(pScrn->pScreen, &pPriv->clip); + + if(exit) { + if(pPriv->videoStatus & CLIENT_VIDEO_ON) { + OUTW(vgaIOBase + 4, 0x008E); + OUTW(vgaIOBase + 4, 0x008F); + } + if(pPriv->linear) { + xf86FreeOffscreenLinear(pPriv->linear); + pPriv->linear = NULL; + } + pPriv->videoStatus = 0; + } else { + if(pPriv->videoStatus & CLIENT_VIDEO_ON) { + pPriv->videoStatus |= OFF_TIMER; + pPriv->offTime = currentTime.milliseconds + OFF_DELAY; + } + } +} + +static int +TRIDENTSetPortAttribute( + ScrnInfoPtr pScrn, + Atom attribute, + INT32 value, + pointer data +){ + TRIDENTPortPrivPtr pPriv = (TRIDENTPortPrivPtr)data; + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + + if(attribute == xvColorKey) { + int red, green, blue; + int tmp; + pPriv->colorKey = value; + switch (pScrn->depth) { + case 8: + OUTW(0x3C4, (pPriv->colorKey<<8) | 0x50); + OUTW(0x3C4, 0x0051); + OUTW(0x3C4, 0x0052); + break; + default: + red = (pPriv->colorKey & pScrn->mask.red) >> pScrn->offset.red; + green = (pPriv->colorKey & pScrn->mask.green) >> pScrn->offset.green; + blue = (pPriv->colorKey & pScrn->mask.blue) >> pScrn->offset.blue; + switch (pScrn->depth) { + case 15: + tmp = (red << 11) | (green << 6) | (blue); + OUTW(0x3C4, (tmp&0xff)<<8 | 0x50); + OUTW(0x3C4, (tmp&0xff00) | 0x51); + OUTW(0x3C4, 0x0052); + break; + case 16: + tmp = (red << 11) | (green << 5) | (blue); + OUTW(0x3C4, (tmp&0xff)<<8 | 0x50); + OUTW(0x3C4, (tmp&0xff00) | 0x51); + OUTW(0x3C4, 0x0052); + break; + case 24: + OUTW(0x3C4, (red<<8) | 0x50); + OUTW(0x3C4, (green<<8) | 0x51); + OUTW(0x3C4, (blue<<8) | 0x52); + break; + } + } + REGION_EMPTY(pScrn->pScreen, &pPriv->clip); + } else return BadMatch; + + return Success; +} + +static int +TRIDENTGetPortAttribute( + ScrnInfoPtr pScrn, + Atom attribute, + INT32 *value, + pointer data +){ + TRIDENTPortPrivPtr pPriv = (TRIDENTPortPrivPtr)data; + + if(attribute == xvColorKey) { + *value = pPriv->colorKey; + } else return BadMatch; + + return Success; +} + +static void +TRIDENTQueryBestSize( + ScrnInfoPtr pScrn, + Bool motion, + short vid_w, short vid_h, + short drw_w, short drw_h, + unsigned int *p_w, unsigned int *p_h, + pointer data +){ + *p_w = drw_w; + *p_h = drw_h; + + if(*p_w > 16384) *p_w = 16384; +} + + +static void +TRIDENTCopyData( + unsigned char *src, + unsigned char *dst, + int srcPitch, + int dstPitch, + int h, + int w +){ + w <<= 1; + while(h--) { + memcpy(dst, src, w); + src += srcPitch; + dst += dstPitch; + } +} + +static void +TRIDENTCopyMungedData( + unsigned char *src1, + unsigned char *src2, + unsigned char *src3, + unsigned char *dst1, + int srcPitch, + int srcPitch2, + int dstPitch, + int h, + int w +){ + CARD32 *dst = (CARD32*)dst1; + int i, j; + + dstPitch >>= 2; + w >>= 1; + + for(j = 0; j < h; j++) { + for(i = 0; i < w; i++) { + dst[i] = src1[i << 1] | (src1[(i << 1) + 1] << 16) | + (src3[i] << 8) | (src2[i] << 24); + } + dst += dstPitch; + src1 += srcPitch; + if(j & 1) { + src2 += srcPitch2; + src3 += srcPitch2; + } + } +} + +static FBLinearPtr +TRIDENTAllocateMemory( + ScrnInfoPtr pScrn, + FBLinearPtr linear, + int size +){ + ScreenPtr pScreen; + FBLinearPtr new_linear; + + if(linear) { + if(linear->size >= size) + return linear; + + if(xf86ResizeOffscreenLinear(linear, size)) + return linear; + + xf86FreeOffscreenLinear(linear); + } + + pScreen = screenInfo.screens[pScrn->scrnIndex]; + + new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16, + NULL, NULL, NULL); + + if(!new_linear) { + int max_size; + + xf86QueryLargestOffscreenLinear(pScreen, &max_size, 16, + PRIORITY_EXTREME); + + if(max_size < size) + return NULL; + + xf86PurgeUnlockedOffscreenAreas(pScreen); + new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16, + NULL, NULL, NULL); + } + + return new_linear; +} + +static void +TRIDENTDisplayVideo( + ScrnInfoPtr pScrn, + int id, + int offset, + short width, short height, + int pitch, + int x1, int y1, int x2, int y2, + BoxPtr dstBox, + short src_w, short src_h, + short drw_w, short drw_h +){ + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + int vgaIOBase = VGAHWPTR(pScrn)->IOBase; + int zoomx1, zoomx2, zoomy1, zoomy2; + int tx1,tx2; + int ty1,ty2; + + switch(id) { + case 0x35315652: /* RGB15 */ + case 0x36315652: /* RGB16 */ + OUTW(vgaIOBase + 4, 0x22BF); + break; + case FOURCC_YV12: /* YV12 */ + case FOURCC_YUY2: /* YUY2 */ + default: + OUTW(vgaIOBase + 4, 0x00BF); + break; + } + + tx1 = dstBox->x1 + pTrident->hsync; + tx2 = dstBox->x2 + pTrident->hsync; + ty1 = dstBox->y1 + pTrident->vsync - 2; + ty2 = dstBox->y2 + pTrident->vsync + 2; + + /* Crude way to deal with off the left edge - FIXME - doesn't work well */ + tx1 -= (x1 >> 16); + + OUTW(vgaIOBase + 4, (tx1 & 0xff) <<8 | 0x86); + OUTW(vgaIOBase + 4, (tx1 & 0xff00) | 0x87); + OUTW(vgaIOBase + 4, (ty1 & 0xff) <<8 | 0x88); + OUTW(vgaIOBase + 4, (ty1 & 0xff00) | 0x89); + OUTW(vgaIOBase + 4, (tx2 & 0xff) <<8 | 0x8A); + OUTW(vgaIOBase + 4, (tx2 & 0xff00) | 0x8B); + OUTW(vgaIOBase + 4, (ty2 & 0xff) <<8 | 0x8C); + OUTW(vgaIOBase + 4, (ty2 & 0xff00) | 0x8D); + + OUTW(vgaIOBase + 4, (((width<<1) & 0xff)<<8) | 0x90); + OUTW(vgaIOBase + 4, ((width<<1) & 0xff00) | 0x91); + OUTW(vgaIOBase + 4, ((offset>>3) & 0xff) << 8 | 0x92); + OUTW(vgaIOBase + 4, ((offset>>3) & 0xff00) | 0x93); + OUTW(vgaIOBase + 4, ((offset>>3) & 0xff0000) >> 8 | 0x94); + + /* Horizontal Zoom */ + if (drw_w == src_w) { + OUTW(vgaIOBase + 4, 0x0080); + OUTW(vgaIOBase + 4, 0x0081); + } else + if (drw_w > src_w) { + zoomx1 = ((float)src_w/(float)drw_w); + zoomx2 = ( ((float)src_w/(float)drw_w) - (int)zoomx1 ) * 1024; + OUTW(vgaIOBase + 4, (zoomx2&0xff)<<8 | 0x80); + OUTW(vgaIOBase + 4, (zoomx1&0x0f)<<10 | (zoomx2&0x0300) | 0x81); + } else { + zoomx1 = ((float)drw_w/(float)src_w); + zoomx2 = ( ((float)drw_w/(float)src_w) - (int)zoomx1 ) * 1024; + OUTW(vgaIOBase + 4, (zoomx2&0xff)<<8 | 0x80); + OUTW(vgaIOBase + 4, (zoomx2&0x0300)| + (((int)((float)src_w/(float)drw_w)-1)&7)<<10 | 0x8081); + } + + /* Vertical Zoom */ + if (drw_h == src_h) { + OUTW(vgaIOBase + 4, 0x0082); + OUTW(vgaIOBase + 4, 0x0083); + } else + if (drw_h > src_h) { + zoomy1 = ((float)src_h/(float)drw_h); + zoomy2 = ( ((float)src_h/(float)drw_h) - (int)zoomy1 ) * 1024; + OUTW(vgaIOBase + 4, (zoomy2&0xff)<<8 | 0x82); + OUTW(vgaIOBase + 4, (zoomy1&0x0f)<<10 | (zoomy2&0x0300) | 0x83); + } else { + zoomy1 = ((float)drw_h/(float)src_h); + zoomy2 = ( ((float)drw_h/(float)src_h) - (int)zoomy1 ) * 1024; + OUTW(vgaIOBase + 4, (zoomy2&0xff)<<8 | 0x82); + OUTW(vgaIOBase + 4, (zoomy2&0x0300)| + (((int)((float)src_h/(float)drw_h)-1)&7)<<10 | 0x8083); + } + + OUTW(vgaIOBase + 4, 0x0895); + OUTW(vgaIOBase + 4, ((width+2)>>2)<<8 | 0x96); + + OUTW(vgaIOBase + 4, 0x0097); + OUTW(vgaIOBase + 4, 0x00BA); + OUTW(vgaIOBase + 4, 0x00BB); + OUTW(vgaIOBase + 4, 0xFFBC); + OUTW(vgaIOBase + 4, 0xFFBD); + OUTW(vgaIOBase + 4, 0x04BE); + + OUTW(vgaIOBase + 4, 0xD48E); + OUTW(vgaIOBase + 4, 0x208F); +} + +static int +TRIDENTPutImage( + ScrnInfoPtr pScrn, + short src_x, short src_y, + short drw_x, short drw_y, + short src_w, short src_h, + short drw_w, short drw_h, + int id, unsigned char* buf, + short width, short height, + Bool sync, + RegionPtr clipBoxes, pointer data +){ + TRIDENTPortPrivPtr pPriv = (TRIDENTPortPrivPtr)data; + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + INT32 x1, x2, y1, y2; + unsigned char *dst_start; + int pitch, new_size, offset, offset2 = 0, offset3 = 0; + int srcPitch, srcPitch2 = 0, dstPitch; + int top, left, npixels, nlines, bpp; + BoxRec dstBox; + CARD32 tmp; + + /* Clip */ + x1 = src_x; + x2 = src_x + src_w; + y1 = src_y; + y2 = src_y + src_h; + + dstBox.x1 = drw_x; + dstBox.x2 = drw_x + drw_w; + dstBox.y1 = drw_y; + dstBox.y2 = drw_y + drw_h; + + if(!TRIDENTClipVideo(&dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height)) + return Success; + + dstBox.x1 -= pScrn->frameX0; + dstBox.x2 -= pScrn->frameX0; + dstBox.y1 -= pScrn->frameY0; + dstBox.y2 -= pScrn->frameY0; + + bpp = pScrn->bitsPerPixel >> 3; + pitch = bpp * pScrn->displayWidth; + + dstPitch = ((width << 1) + 15) & ~15; + new_size = ((dstPitch * height) + bpp - 1) / bpp; + + switch(id) { + case FOURCC_YV12: + case FOURCC_I420: + srcPitch = (width + 3) & ~3; + offset2 = srcPitch * height; + srcPitch2 = ((width >> 1) + 3) & ~3; + offset3 = (srcPitch2 * (height >> 1)) + offset2; + break; + case FOURCC_UYVY: + case FOURCC_YUY2: + default: + srcPitch = (width << 1); + break; + } + + if(!(pPriv->linear = TRIDENTAllocateMemory(pScrn, pPriv->linear, new_size))) + return BadAlloc; + + /* copy data */ + top = y1 >> 16; + left = (x1 >> 16) & ~1; + npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left; + left <<= 1; + + offset = pPriv->linear->offset * bpp; + dst_start = pTrident->FbBase + offset + left + (top * dstPitch); + + switch(id) { + case FOURCC_YV12: + case FOURCC_I420: + top &= ~1; + tmp = ((top >> 1) * srcPitch2) + (left >> 2); + offset2 += tmp; + offset3 += tmp; + if(id == FOURCC_I420) { + tmp = offset2; + offset2 = offset3; + offset3 = tmp; + } + nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top; + TRIDENTCopyMungedData(buf + (top * srcPitch) + (left >> 1), + buf + offset2, buf + offset3, dst_start, + srcPitch, srcPitch2, dstPitch, nlines, npixels); + break; + case FOURCC_UYVY: + case FOURCC_YUY2: + default: + buf += (top * srcPitch) + left; + nlines = ((y2 + 0xffff) >> 16) - top; + TRIDENTCopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels); + break; + } + + /* update cliplist */ + if(!RegionsEqual(&pPriv->clip, clipBoxes)) { + REGION_COPY(pScreen, &pPriv->clip, clipBoxes); + /* draw these */ + XAAFillSolidRects(pScrn, pPriv->colorKey, GXcopy, ~0, + REGION_NUM_RECTS(clipBoxes), + REGION_RECTS(clipBoxes)); + } + + offset += top * dstPitch; + TRIDENTDisplayVideo(pScrn, id, offset, width, height, dstPitch, + x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h); + + pPriv->videoStatus = CLIENT_VIDEO_ON; + + pTrident->VideoTimerCallback = TRIDENTVideoTimerCallback; + + return Success; +} + +static int +TRIDENTQueryImageAttributes( + ScrnInfoPtr pScrn, + int id, + unsigned short *w, unsigned short *h, + int *pitches, int *offsets +){ + int size, tmp; + + if(*w > 1024) *w = 1024; + if(*h > 1024) *h = 1024; + + *w = (*w + 1) & ~1; + if(offsets) offsets[0] = 0; + + switch(id) { + case FOURCC_YV12: /* YV12 */ + *h = (*h + 1) & ~1; + size = (*w + 3) & ~3; + if(pitches) pitches[0] = size; + size *= *h; + if(offsets) offsets[1] = size; + tmp = ((*w >> 1) + 3) & ~3; + if(pitches) pitches[1] = pitches[2] = tmp; + tmp *= (*h >> 1); + size += tmp; + if(offsets) offsets[2] = size; + size += tmp; + break; + default: /* RGB15, RGB16, YUY2 */ + size = *w << 1; + if(pitches) pitches[0] = size; + size *= *h; + break; + } + + return size; +} + +/****************** Offscreen stuff ***************/ + +typedef struct { + FBLinearPtr linear; + Bool isOn; +} OffscreenPrivRec, * OffscreenPrivPtr; + +static int +TRIDENTAllocateSurface( + ScrnInfoPtr pScrn, + int id, + unsigned short w, + unsigned short h, + XF86SurfacePtr surface +){ + FBLinearPtr linear; + int pitch, fbpitch, size, bpp; + OffscreenPrivPtr pPriv; + + if((w > 1024) || (h > 1024)) + return BadAlloc; + + w = (w + 1) & ~1; + pitch = ((w << 1) + 15) & ~15; + bpp = pScrn->bitsPerPixel >> 3; + fbpitch = bpp * pScrn->displayWidth; + size = ((pitch * h) + bpp - 1) / bpp; + + if(!(linear = TRIDENTAllocateMemory(pScrn, NULL, size))) + return BadAlloc; + + surface->width = w; + surface->height = h; + + if(!(surface->pitches = xalloc(sizeof(int)))) { + xf86FreeOffscreenLinear(linear); + return BadAlloc; + } + if(!(surface->offsets = xalloc(sizeof(int)))) { + xfree(surface->pitches); + xf86FreeOffscreenLinear(linear); + return BadAlloc; + } + if(!(pPriv = xalloc(sizeof(OffscreenPrivRec)))) { + xfree(surface->pitches); + xfree(surface->offsets); + xf86FreeOffscreenLinear(linear); + return BadAlloc; + } + + pPriv->linear = linear; + pPriv->isOn = FALSE; + + surface->pScrn = pScrn; + surface->id = id; + surface->pitches[0] = pitch; + surface->offsets[0] = linear->offset * bpp; + surface->devPrivate.ptr = (pointer)pPriv; + + return Success; +} + +static int +TRIDENTStopSurface( + XF86SurfacePtr surface +){ + OffscreenPrivPtr pPriv = (OffscreenPrivPtr)surface->devPrivate.ptr; + + if(pPriv->isOn) { + TRIDENTPtr pTrident = TRIDENTPTR(surface->pScrn); + int vgaIOBase = VGAHWPTR(surface->pScrn)->IOBase; + OUTW(vgaIOBase + 4, 0x008E); + OUTW(vgaIOBase + 4, 0x008F); + pPriv->isOn = FALSE; + } + + return Success; +} + + +static int +TRIDENTFreeSurface( + XF86SurfacePtr surface +){ + OffscreenPrivPtr pPriv = (OffscreenPrivPtr)surface->devPrivate.ptr; + + if(pPriv->isOn) + TRIDENTStopSurface(surface); + xf86FreeOffscreenLinear(pPriv->linear); + xfree(surface->pitches); + xfree(surface->offsets); + xfree(surface->devPrivate.ptr); + + return Success; +} + +static int +TRIDENTGetSurfaceAttribute( + ScrnInfoPtr pScrn, + Atom attribute, + INT32 *value +){ + return TRIDENTGetPortAttribute(pScrn, attribute, value, + (pointer)(GET_PORT_PRIVATE(pScrn))); +} + +static int +TRIDENTSetSurfaceAttribute( + ScrnInfoPtr pScrn, + Atom attribute, + INT32 value +){ + return TRIDENTSetPortAttribute(pScrn, attribute, value, + (pointer)(GET_PORT_PRIVATE(pScrn))); +} + +static int +TRIDENTDisplaySurface( + XF86SurfacePtr surface, + short src_x, short src_y, + short drw_x, short drw_y, + short src_w, short src_h, + short drw_w, short drw_h, + RegionPtr clipBoxes +){ + OffscreenPrivPtr pPriv = (OffscreenPrivPtr)surface->devPrivate.ptr; + ScrnInfoPtr pScrn = surface->pScrn; + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + TRIDENTPortPrivPtr portPriv = pTrident->adaptor->pPortPrivates[0].ptr; + INT32 x1, y1, x2, y2; + BoxRec dstBox; + + x1 = src_x; + x2 = src_x + src_w; + y1 = src_y; + y2 = src_y + src_h; + + dstBox.x1 = drw_x; + dstBox.x2 = drw_x + drw_w; + dstBox.y1 = drw_y; + dstBox.y2 = drw_y + drw_h; + + if(!TRIDENTClipVideo(&dstBox, &x1, &x2, &y1, &y2, clipBoxes, + surface->width, surface->height)) + { + return Success; + } + + dstBox.x1 -= pScrn->frameX0; + dstBox.x2 -= pScrn->frameX0; + dstBox.y1 -= pScrn->frameY0; + dstBox.y2 -= pScrn->frameY0; + + TRIDENTResetVideo(pScrn); + + TRIDENTDisplayVideo(pScrn, surface->id, surface->offsets[0], + surface->width, surface->height, surface->pitches[0], + x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h); + + XAAFillSolidRects(pScrn, portPriv->colorKey, GXcopy, ~0, + REGION_NUM_RECTS(clipBoxes), + REGION_RECTS(clipBoxes)); + + pPriv->isOn = TRUE; + /* we've prempted the XvImage stream so set its free timer */ + if(portPriv->videoStatus & CLIENT_VIDEO_ON) { + REGION_EMPTY(pScrn->pScreen, &portPriv->clip); + UpdateCurrentTime(); + portPriv->videoStatus = FREE_TIMER; + portPriv->freeTime = currentTime.milliseconds + FREE_DELAY; + pTrident->VideoTimerCallback = TRIDENTVideoTimerCallback; + } + + return Success; +} + +static void +TRIDENTInitOffscreenImages(ScreenPtr pScreen) +{ + XF86OffscreenImagePtr offscreenImages; + + /* need to free this someplace */ + if(!(offscreenImages = xalloc(sizeof(XF86OffscreenImageRec)))) + return; + + offscreenImages[0].image = &Images[0]; + offscreenImages[0].flags = VIDEO_OVERLAID_IMAGES | + VIDEO_CLIP_TO_VIEWPORT; + offscreenImages[0].alloc_surface = TRIDENTAllocateSurface; + offscreenImages[0].free_surface = TRIDENTFreeSurface; + offscreenImages[0].display = TRIDENTDisplaySurface; + offscreenImages[0].stop = TRIDENTStopSurface; + offscreenImages[0].setAttribute = TRIDENTSetSurfaceAttribute; + offscreenImages[0].getAttribute = TRIDENTGetSurfaceAttribute; + offscreenImages[0].max_width = 1024; + offscreenImages[0].max_height = 1024; + offscreenImages[0].num_attributes = NUM_ATTRIBUTES; + offscreenImages[0].attributes = Attributes; + + xf86XVRegisterOffscreenImages(pScreen, offscreenImages, 1); +} + +static void +TRIDENTVideoTimerCallback(ScrnInfoPtr pScrn, Time time) +{ + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + TRIDENTPortPrivPtr pPriv = pTrident->adaptor->pPortPrivates[0].ptr; + int vgaIOBase = VGAHWPTR(pScrn)->IOBase; + + if(pPriv->videoStatus & TIMER_MASK) { + if(pPriv->videoStatus & OFF_TIMER) { + if(pPriv->offTime < time) { + OUTW(vgaIOBase + 4, 0x008E); + OUTW(vgaIOBase + 4, 0x008F); + pPriv->videoStatus = FREE_TIMER; + pPriv->freeTime = time + FREE_DELAY; + } + } else { /* FREE_TIMER */ + if(pPriv->freeTime < time) { + if(pPriv->linear) { + xf86FreeOffscreenLinear(pPriv->linear); + pPriv->linear = NULL; + } + pPriv->videoStatus = 0; + pTrident->VideoTimerCallback = NULL; + } + } + } else /* shouldn't get here */ + pTrident->VideoTimerCallback = NULL; +} + +#endif /* !XvExtension */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c index 5db5f4f57..f3fa8a226 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c @@ -1,4 +1,27 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c,v 1.13 2000/09/19 12:46:19 eich Exp $ */ +/* + * Copyright 1992-2000 by Alan Hourihane, Wigan, England. + * + * 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 Alan Hourihane not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Alan Hourihane makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL ALAN HOURIHANE 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. + * + * Author: Alan Hourihane, alanh@fairlite.demon.co.uk + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c,v 1.15 2000/12/14 19:29:45 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -47,7 +70,7 @@ TGUISetClock(ScrnInfoPtr pScrn, int clock, CARD8 *a, CARD8 *b) freq = clock; - for (k=0;k<=endk;k++) + for (k=endk;k>=0;k--) for (n=startn;n<=endn;n++) for (m=1;m<=endm;m++) { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/tridentramdac.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/tridentramdac.c index 2fc50c015..f4117b90f 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/tridentramdac.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/tridentramdac.c @@ -1,5 +1,5 @@ /* - * Copyright 1998 by Alan Hourihane, Wigan, England. + * Copyright 1992-2000 by Alan Hourihane, Wigan, England. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -24,7 +24,7 @@ * TridentOutIndReg() and TridentInIndReg() are used to access * the indirect Trident RAMDAC registers only. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/tridentramdac.c,v 1.3 1999/04/25 10:02:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/tridentramdac.c,v 1.4 2000/12/07 16:48:06 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/tseng/Imakefile index dc9de4004..3828036eb 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tseng/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/tseng/Imakefile @@ -4,18 +4,18 @@ XCOMM $XConsortium: Imakefile /main/10 1996/09/28 17:29:32 rws $ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/Imakefile,v 1.19 2000/11/03 18:46:14 eich Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/Imakefile,v 1.20 2000/12/06 15:35:24 eich Exp $ #define IHaveModules #include <Server.tmpl> SRCS = tseng_driver.c tseng_ramdac.c tseng_bank.c tseng_clock.c \ tseng_accel.c tseng_acl.c tseng_colexp.c tseng_cursor.c \ - tseng_dpms.c + tseng_dpms.c tseng_dga.c OBJS = tseng_driver.o tseng_ramdac.o tseng_bank.o tseng_clock.o \ tseng_accel.o tseng_acl.o tseng_colexp.o tseng_cursor.o \ - tseng_dpms.o + tseng_dpms.o tseng_dga.o #if defined(XF86DriverSDK) INCLUDES = -I. -I../../include @@ -24,7 +24,7 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/fb -I$(XF86SRC)/xaa \ -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \ - -I$(XF86SRC)/xf24_32bpp \ + -I$(XF86SRC)/xf24_32bpp -I$(SERVERSRC)/Xext \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ @@ -65,5 +65,6 @@ InstallDriverSDKNonExecFile(tseng_dpms.c,$(DRIVERSDKDIR)/drivers/tseng) InstallDriverSDKNonExecFile(tseng_driver.c,$(DRIVERSDKDIR)/drivers/tseng) InstallDriverSDKNonExecFile(tseng_inline.h,$(DRIVERSDKDIR)/drivers/tseng) InstallDriverSDKNonExecFile(tseng_ramdac.c,$(DRIVERSDKDIR)/drivers/tseng) +InstallDriverSDKNonExecFile(tseng_dga.c,$(DRIVERSDKDIR)/drivers/tseng) InstallDriverSDKObjectModule(tseng,$(DRIVERSDKMODULEDIR),drivers) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.cpp b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.cpp index 4b15e24ad..45fe633cd 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.cpp,v 1.5 2000/08/08 08:58:06 eich Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.cpp,v 1.6 2000/12/11 20:18:39 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH TSENG __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH TSENG __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME tseng \- Tseng Labs video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h index 30664b2da..4277fd6c1 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h @@ -1,5 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h,v 1.32 2000/11/03 18:46:15 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h,v 1.33 2000/12/06 15:35:24 eich Exp $ */ @@ -200,9 +200,9 @@ typedef struct { t_tseng_bus Bustype; /* W32 bus type (currently used for lin mem on W32i) */ t_tseng_type ChipType; /* "Chipset" causes confusion with pScrn->chipset */ int ChipRev; - CARD32 LinFbAddress; + memType LinFbAddress; unsigned char *FbBase; - CARD32 LinFbAddressMask; + memType LinFbAddressMask; long FbMapSize; miBankInfoRec BankInfo; CARD32 IOAddress; /* PCI config space base address for ET6000 */ @@ -239,6 +239,10 @@ typedef struct { int tseng_old_dir; int old_x; int old_y; + int DGAnumModes; + Bool DGAactive; + DGAModePtr DGAModes; + int DGAViewportStatus; } TsengRec, *TsengPtr; #define TsengPTR(p) ((TsengPtr)((p)->driverPrivate)) @@ -292,6 +296,18 @@ typedef struct { #define ET6000_programmable_clock \ ( pScrn->progClock && (pTseng->ClockChip == CLOCKCHIP_ET6000) ) + +/* + * tseng_driver.c for DGA + */ +Bool TsengModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); +void TsengAdjustFrame(int scrnIndex, int x, int y, int flags); + +/* + * tseng_dga.c + */ +Bool TsengDGAInit(ScreenPtr pScreen); + /* * From tseng_bank.c */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_acl.c b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_acl.c index ffda6cd37..9a62e4ec3 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_acl.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_acl.c @@ -1,5 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_acl.c,v 1.24 2000/10/17 16:53:18 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_acl.c,v 1.25 2000/12/14 16:33:10 eich Exp $ */ @@ -112,9 +112,8 @@ tseng_recover_timeout(TsengPtr pTseng) } void -tseng_init_acl(ScreenPtr pScreen) +tseng_init_acl(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; TsengPtr pTseng = TsengPTR(pScrn); PDEBUG(" tseng_init_acl\n"); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_acl.h b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_acl.h index 02c577110..b7ca4b327 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_acl.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_acl.h @@ -1,5 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_acl.h,v 1.19 2000/08/08 08:58:06 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_acl.h,v 1.20 2000/12/14 16:33:10 eich Exp $ */ #ifndef _TSENG_ACL_H @@ -222,7 +222,7 @@ tseng_wait(TsengPtr pTseng, int reg, char *name, unsigned char mask) /***********************************************************************/ -void tseng_init_acl(ScreenPtr pScreen); +void tseng_init_acl(ScrnInfoPtr pScrn); Bool TsengXAAInit(ScreenPtr pScreen); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_dga.c b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_dga.c new file mode 100644 index 000000000..b6d064126 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_dga.c @@ -0,0 +1,250 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_dga.c,v 1.1 2000/12/06 15:35:24 eich Exp $ */ +/* + * Copyright 2000 by Rainer Keller, <Rainer.Keller@studmail.uni-stuttgart.de>. + * + * 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 Alan Hourihane not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Alan Hourihane makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL ALAN HOURIHANE 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. + * + * Authors: Adapted from: Alan Hourihane, <alanh@fairlite.demon.co.uk> + * by: Rainer Keller, <Rainer.Keller@studmail.uni-stuttgart.de> + */ + +#include "tseng.h" +#include "dgaproc.h" + +static Bool Tseng_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, + int *, int *, int *); +static Bool Tseng_SetMode(ScrnInfoPtr, DGAModePtr); +static void Tseng_Sync(ScrnInfoPtr); +static int Tseng_GetViewport(ScrnInfoPtr); +static void Tseng_SetViewport(ScrnInfoPtr, int, int, int); +static void Tseng_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long); +static void Tseng_BlitRect(ScrnInfoPtr, int, int, int, int, int, int); +/* +static void Tseng_BlitTransRect(ScrnInfoPtr, int, int, int, int, int, int, + unsigned long); +*/ + +static +DGAFunctionRec TsengDGAFuncs = { + Tseng_OpenFramebuffer, + NULL, /* Tseng_CloseFramebuffer */ + Tseng_SetMode, + Tseng_SetViewport, + Tseng_GetViewport, + Tseng_Sync, + Tseng_FillRect, + Tseng_BlitRect, + NULL /* Tseng_BlitTransRect */ +}; + + + + +Bool +TsengDGAInit(ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + TsengPtr pTseng = TsengPTR(pScrn); + DGAModePtr modes = NULL, newmodes = NULL, currentMode; + DisplayModePtr pMode, firstMode; + int Bpp = pScrn->bitsPerPixel >> 3; + int num = 0; + int imlines = (pScrn->videoRam * 1024) / + (pScrn->displayWidth * (pScrn->bitsPerPixel >> 3)); + + + if (!pTseng->UseLinMem) + return FALSE; + + if (!pTseng->DGAnumModes) { + ErrorF("DGAINIT\n"); + pMode = firstMode = pScrn->modes; + while (pMode) { + newmodes = xrealloc(modes, (num + 1) * sizeof (DGAModeRec)); + if (!newmodes) { + xfree(modes); + return FALSE; + } + modes = newmodes; + currentMode = modes + num; + num++; + (void)memset(currentMode, 1, sizeof(DGAModeRec)); + currentMode->mode = pMode; + currentMode->flags = DGA_PIXMAP_AVAILABLE + | ((pTseng->UseAccel) ? (DGA_FILL_RECT | DGA_BLIT_RECT) : 0); + if (pMode->Flags & V_DBLSCAN) + currentMode->flags |= DGA_DOUBLESCAN; + if(pMode->Flags & V_INTERLACE) + currentMode->flags |= DGA_INTERLACED; + currentMode->byteOrder = pScrn->imageByteOrder; + currentMode->depth = pScrn->depth; + currentMode->bitsPerPixel = pScrn->bitsPerPixel; + currentMode->red_mask = pScrn->mask.red; + currentMode->green_mask = pScrn->mask.green; + currentMode->blue_mask = pScrn->mask.blue; + currentMode->visualClass = (Bpp == 1) ? PseudoColor : TrueColor; + currentMode->viewportWidth = pMode->HDisplay; + currentMode->viewportHeight = pMode->VDisplay; + currentMode->xViewportStep = 1; /* The granularity of x and y pos. */ + currentMode->yViewportStep = 1; + currentMode->viewportFlags = 0 /*DGA_FLIP_RETRACE*/; + currentMode->offset = 0; + currentMode->address = pTseng->FbBase; + currentMode->bytesPerScanline = ((pScrn->displayWidth * Bpp) + 3) & ~3L; + currentMode->pixmapWidth = currentMode->imageWidth = pScrn->displayWidth; + currentMode->pixmapHeight = currentMode->imageHeight = imlines; + currentMode->maxViewportX = currentMode->imageWidth - + currentMode->viewportWidth; + /* this might need to get clamped to some maximum */ + currentMode->maxViewportY = currentMode->imageHeight - + currentMode->viewportHeight; + + pMode = pMode->next; + if(pMode == firstMode) + break; + } + pTseng->DGAnumModes = num; + pTseng->DGAModes = modes; + } + return DGAInit(pScreen, &TsengDGAFuncs, pTseng->DGAModes, pTseng->DGAnumModes); +} + +static Bool +Tseng_OpenFramebuffer( + ScrnInfoPtr pScrn, + char **name, + unsigned char **mem, + int *size, + int *offset, + int *flags +){ + TsengPtr pTseng = TsengPTR(pScrn); + + *name = NULL; /* no special device */ + *mem = (unsigned char*)pTseng->LinFbAddress; + *size = pTseng->FbMapSize; + *offset = 0; /* Always */ + *flags = 0; /* Root permissions OS-dependent */ + + return TRUE; +} + + +static Bool +Tseng_SetMode( + ScrnInfoPtr pScrn, + DGAModePtr pMode +){ + TsengPtr pTseng = TsengPTR(pScrn); + static int OldDisplayWidth[MAXSCREENS]; + int index = pScrn->pScreen->myNum; + Bool ret; + + if(!pMode) { /* restore the original mode */ + /* put the ScreenParameters back */ + pScrn->displayWidth = OldDisplayWidth[index]; + ret = TsengModeInit(xf86Screens[index], pScrn->currentMode); + pTseng->DGAactive = FALSE; + } else { + if(!pTseng->DGAactive) { /* save the old parameters */ + OldDisplayWidth[index] = pScrn->displayWidth; + + pTseng->DGAactive = TRUE; + } + pScrn->displayWidth = pMode->bytesPerScanline / + (pMode->bitsPerPixel >> 3); + + ret = TsengModeInit(xf86Screens[index], pMode->mode); + } + return ret; +} + +static void +Tseng_SetViewport( + ScrnInfoPtr pScrn, + int x, int y, + int flags +){ + TsengPtr pTseng = TsengPTR(pScrn); + vgaHWPtr hwp = VGAHWPTR(pScrn); + + TsengAdjustFrame(pScrn->pScreen->myNum, x, y, flags); + while((hwp->readST01(hwp) & 0x08)); + while(!(hwp->readST01(hwp) & 0x08)); + + pTseng->DGAViewportStatus = 0; /* TsengAdjustFrame loops until finished */ +} + +static int +Tseng_GetViewport( + ScrnInfoPtr pScrn +){ + TsengPtr pTseng = TsengPTR(pScrn); + + return pTseng->DGAViewportStatus; +} + + + +static void +Tseng_Sync( + ScrnInfoPtr pScrn +){ + TsengPtr pTseng = TsengPTR(pScrn); + + if(pTseng->AccelInfoRec) { + (*pTseng->AccelInfoRec->Sync)(pScrn); + } +} + +static void +Tseng_FillRect ( + ScrnInfoPtr pScrn, + int x, int y, int w, int h, + unsigned long color +){ + TsengPtr pTseng = TsengPTR(pScrn); + + if(pTseng->AccelInfoRec) { + (*pTseng->AccelInfoRec->SetupForSolidFill)(pScrn, color, GXcopy, ~0); + (*pTseng->AccelInfoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h); + SET_SYNC_FLAG(pTseng->AccelInfoRec); + } +} + +static void +Tseng_BlitRect( + ScrnInfoPtr pScrn, + int srcx, int srcy, + int w, int h, + int dstx, int dsty +){ + TsengPtr pTseng = TsengPTR(pScrn); + + if(pTseng->AccelInfoRec) { + int xdir = ((srcx < dstx) && (srcy == dsty)) ? -1 : 1; + int ydir = (srcy < dsty) ? -1 : 1; + + (*pTseng->AccelInfoRec->SetupForScreenToScreenCopy)( + pScrn, xdir, ydir, GXcopy, ~0, -1); + (*pTseng->AccelInfoRec->SubsequentScreenToScreenCopy)( + pScrn, srcx, srcy, dstx, dsty, w, h); + SET_SYNC_FLAG(pTseng->AccelInfoRec); + } +} diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c index 52496e1a0..76911b3b6 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c,v 1.77 2000/12/02 15:30:59 tsi Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c,v 1.79 2000/12/14 16:33:10 eich Exp $ * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -75,9 +75,6 @@ static Bool TsengSaveScreen(ScreenPtr pScreen, int mode); /* Required if the driver supports mode switching */ static Bool TsengSwitchMode(int scrnIndex, DisplayModePtr mode, int flags); -/* Required if the driver supports moving the viewport */ -static void TsengAdjustFrame(int scrnIndex, int x, int y, int flags); - /* Optional functions */ static void TsengFreeScreen(int scrnIndex, int flags); static ModeStatus TsengValidMode(int scrnIndex, DisplayModePtr mode, @@ -91,7 +88,6 @@ static Bool TsengMapMem(ScrnInfoPtr pScrn); static Bool TsengUnmapMem(ScrnInfoPtr pScrn); static void TsengSave(ScrnInfoPtr pScrn); static void TsengRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, TsengRegPtr tsengReg, int flags); -static Bool TsengModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); static void TsengUnlock(void); static void TsengLock(void); @@ -1271,7 +1267,8 @@ TsengProcessOptions(ScrnInfoPtr pScrn) pTseng->HWCursor ? "HW" : "SW"); if (pScrn->bitsPerPixel >= 8) { - pTseng->UseAccel = TRUE; + if (pTseng->ChipType != TYPE_ET4000) + pTseng->UseAccel = TRUE; if (xf86ReturnOptValBool(TsengOptions, OPTION_NOACCEL, FALSE)) { pTseng->UseAccel = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); @@ -1845,12 +1842,13 @@ TsengPreInit(ScrnInfoPtr pScrn, int flags) } /* Load XAA if needed */ - if (pTseng->UseAccel) + if (pTseng->UseAccel) { if (!xf86LoadSubModule(pScrn, "xaa")) { TsengFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymLists(xaaSymbols, NULL); + xf86LoaderReqSymLists(xaaSymbols, NULL); + } /* Load ramdac if needed */ if (pTseng->HWCursor) { if (!xf86LoadSubModule(pScrn, "ramdac")) { @@ -2003,7 +2001,6 @@ TsengScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn = xf86Screens[pScreen->myNum]; pTseng = TsengPTR(pScrn); - /* Map the Tseng memory areas */ if (!TsengMapMem(pScrn)) return FALSE; @@ -2032,7 +2029,6 @@ TsengScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) * support TrueColor and not DirectColor. To deal with this, call * miSetVisualTypes for each visual supported. */ - if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; @@ -2068,11 +2064,15 @@ TsengScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) #endif break; } + if (!ret) return FALSE; xf86SetBlackWhitePixels(pScreen); + if (pScrn->depth >= 8) + TsengDGAInit(pScreen); + if (pScrn->bitsPerPixel > 8) { /* Fixup RGB ordering */ visual = pScreen->visuals + pScreen->numVisuals; @@ -2119,7 +2119,7 @@ TsengScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) */ TsengSetupAccelMemory(scrnIndex, pScreen); if (pTseng->UseAccel) { - tseng_init_acl(pScreen); /* set up accelerator */ + tseng_init_acl(pScrn); /* set up accelerator */ if (!TsengXAAInit(pScreen)) { /* set up XAA interface */ return FALSE; } @@ -2176,13 +2176,19 @@ static Bool TsengEnterVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + TsengPtr pTseng = TsengPTR(pScrn); PDEBUG(" TsengEnterVT\n"); vgaHWUnlock(VGAHWPTR(pScrn)); TsengUnlock(); - return TsengModeInit(pScrn, pScrn->currentMode); + if (!TsengModeInit(pScrn, pScrn->currentMode)) + return FALSE; + if (pTseng->UseAccel) { + tseng_init_acl(pScrn); /* set up accelerator */ + } + return TRUE; } static void @@ -2318,8 +2324,8 @@ TsengMapMem(ScrnInfoPtr pScrn) } } else { vgaHWPtr hwp = VGAHWPTR(pScrn); + pTseng->FbBase = hwp->Base; if (pTseng->UseAccel) { - pTseng->FbBase = hwp->Base; pTseng->MMioBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, pTseng->PciTag, @@ -2366,7 +2372,7 @@ TsengFreeScreen(int scrnIndex, int flags) TsengFreeRec(xf86Screens[scrnIndex]); } -static Bool +Bool TsengModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) { vgaHWPtr hwp; @@ -2710,7 +2716,7 @@ TsengSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) /* * adjust the current video frame (viewport) to display the mousecursor. */ -static void +void TsengAdjustFrame(int scrnIndex, int x, int y, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_ramdac.c b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_ramdac.c index 7a4c6f8f0..42d87b443 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_ramdac.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_ramdac.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_ramdac.c,v 1.23 2000/08/08 08:58:07 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_ramdac.c,v 1.24 2000/12/06 15:35:25 eich Exp $ */ @@ -618,6 +618,8 @@ tseng_set_ramdac_bpp(ScrnInfoPtr pScrn, DisplayModePtr mode) cmd_array = CMD_MU4910; cmd_dest = &(pTseng->ModeReg.ATTdac_cmd); break; + default: + break; } if (cmd_array != NULL) { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.cpp b/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.cpp index fb06a6567..e18e938d5 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.cpp,v 1.4 2000/06/14 02:13:16 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.cpp,v 1.5 2000/12/11 20:18:40 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH V4L __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH V4L __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME v4l \- Video 4 Linux driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.cpp b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.cpp index c56806118..de0e2cecd 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.cpp,v 1.1 2000/10/20 14:59:01 alanh Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.cpp,v 1.2 2000/12/11 20:18:42 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH VESA __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH VESA __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME vesa \- Generic VESA video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vga/vga.cpp b/xc/programs/Xserver/hw/xfree86/drivers/vga/vga.cpp index b837d4320..1be1c9e5d 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/vga/vga.cpp +++ b/xc/programs/Xserver/hw/xfree86/drivers/vga/vga.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/vga.cpp,v 1.6 2000/06/14 02:13:16 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/vga.cpp,v 1.7 2000/12/11 20:18:43 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH VGA __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH VGA __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME vga \- Generic VGA video driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c b/xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c index c1b0fa988..60c024c09 100644 --- a/xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c +++ b/xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c,v 1.1 2000/02/13 03:06:38 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c,v 1.2 2000/12/07 15:43:45 tsi Exp $ */ #include "X.h" #include "os.h" @@ -10,7 +10,7 @@ */ memType -getValidBIOSBase(PCITAG tag, int num) +getValidBIOSBase(PCITAG tag, int *num) { return 0; } diff --git a/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh b/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh index c38c1814c..8b6df0d29 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh +++ b/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh @@ -1,13 +1,13 @@ #!/bin/sh # -# $XFree86: xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh,v 1.14 2000/07/06 23:39:04 dawes Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh,v 1.18 2000/12/15 03:01:45 dawes Exp $ # # Copyright © 2000 by Precision Insight, Inc. # Copyright © 2000 by VA Linux Systems, Inc. # Portions Copyright © 1996-2000 by The XFree86 Project, Inc. # -# This script should be used to install XFree86 4.0.1. +# This script should be used to install XFree86 4.0.2. # # Parts of this script are based on the old preinst.sh and postinst.sh # scripts. @@ -17,7 +17,7 @@ # Authors: David Dawes <dawes@xfree86.org> # -VERSION=4.0.1 +VERSION=4.0.2 RUNDIR=/usr/X11R6 ETCDIR=/etc/X11 @@ -267,6 +267,7 @@ GetOsInfo() tmp="`strings $LibcPath | grep -i 'c library'`" OsLibcMajor=`expr "$tmp" : '.* \([0-9][0-9]*\)'` OsLibcMinor=`expr "$tmp" : '.* [0-9][0-9]*\.\([0-9][0-9]*\)'` + OsLibcTeeny=`expr "$tmp" : '.* [0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)'` case "$OsLibcMajor" in 2) # 2 is the glibc version @@ -279,15 +280,23 @@ GetOsInfo() if [ X"$OsLibcMajor" != X ]; then Echo "libc version is '$OsLibcMajor" if [ X"$OsLibcMinor" != X ]; then - Echo ".$OsLibcMinor'." + Echo ".$OsLibcMinor" + if [ X"$OsLibcTeeny" != X ]; then + Echo ".$OsLibcTeeny" + if [ $OsLibcTeeny -gt 80 ]; then + OsLibcMinor=`expr $OsLibcMinor + 1` + fi + fi + Echo "'" + Echo " ($OsLibcMajor.$OsLibcMinor)" else - Echo "'." + Echo "'" fi - needNL=YES - fi - if [ X"$needNL" = XYES ]; then - echo "" + echo "." fi +# if [ X"$needNL" = XYES ]; then +# echo "" +# fi echo "" } @@ -336,6 +345,23 @@ DoOsChecks() FindDistName() { case "$OsName" in + Darwin) + case "$OsArch" in + Power*) + case "$OsVersion" in + 1.[2-9]) + DistName="Darwin" + ;; + *) + Message="No Darwin binaries available for this OS version" + ;; + esac + ;; + *) + Message="Darwin binaries are only available for Power Mac platforms" + ;; + esac + ;; DGUX) # Check this string case "$OsArch" in i*86) @@ -404,8 +430,11 @@ FindDistName() 1) DistName="Linux-ix86-glibc21" ;; + 2) + DistName="Linux-ix86-glibc22" + ;; *) - Message="No dist available for glibc 2.$OsLibcMinor. Try Linux-ix86-glibc21" + Message="No dist available for glibc 2.$OsLibcMinor. Try Linux-ix86-glibc22" ;; esac ;; @@ -456,13 +485,13 @@ FindDistName() case "$OsArch" in i386) case "$OsVersion" in - 1.[3-9]*) # Check this + 1.[4-9]*) # Check this case "$OsObjFormat" in a.out) DistName="NetBSD-1.4.1" ;; *) - DistName="NetBSD-current-ELF" + DistName="NetBSD-1.5" ;; esac ;; @@ -480,8 +509,8 @@ FindDistName() case "$OsArch" in i386) case "$OsVersion" in - 2.[6-9]*) # Check this - DistName="OpenBSD-2.6" + 2.[89]*) # Check this + DistName="OpenBSD-2.8" ;; *) Message="No OpenBSD/i386 binaries available for this version" @@ -587,6 +616,9 @@ GetOsInfo # Make OS-specific adjustments case "$OsName" in +Darwin) + SERVDIST="Xxserv.tgz" + ;; FreeBSD|NetBSD|OpenBSD) VARDIST="Xvar.tgz" XKBDIR="/var/db/xkb" @@ -1159,3 +1191,6 @@ echo "" echo "Installation complete." exit 0 +### Local Variables: *** +### tab-width: 4 *** +### End: *** diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/bin-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/bin-excl new file mode 100644 index 000000000..e799d5a70 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/bin-excl @@ -0,0 +1,6 @@ +bin/Xnest +bin/Xprt +bin/Xvfb +bin/X +bin/xfs +bin/Xdarwin diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/bin-list new file mode 100644 index 000000000..ba077a403 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/bin-list @@ -0,0 +1 @@ +bin diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/dir b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/dir new file mode 100644 index 000000000..11c5b9da7 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/dir @@ -0,0 +1 @@ +usr/X11R6 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/etc-dir b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/etc-dir new file mode 100644 index 000000000..412cec0c3 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/etc-dir @@ -0,0 +1 @@ +etc/X11 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/etc-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/etc-list new file mode 100644 index 000000000..9c558e357 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/etc-list @@ -0,0 +1 @@ +. diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/fsrv-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/fsrv-list new file mode 100644 index 000000000..e4decc9eb --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/fsrv-list @@ -0,0 +1,2 @@ +bin/xfs +man/cat1/xfs.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/host.def new file mode 100644 index 000000000..aeae712b4 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/host.def @@ -0,0 +1,8 @@ +/* + * Host.def for building Darwin bindists + * + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/host.def,v 1.1 2000/12/10 00:06:21 herrb Exp $ + */ + +#define InstallEmptyHostDef + diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/lib-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/lib-excl new file mode 100644 index 000000000..d7fb5cb03 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/lib-excl @@ -0,0 +1,14 @@ +lib/X11/XF86Setup +lib/X11/app-defaults +lib/X11/config +lib/X11/doc +lib/X11/fonts +lib/X11/fs +lib/X11/lbxproxy +lib/X11/proxymngr +lib/X11/rstart +lib/X11/twm +lib/X11/xdm +lib/X11/xinit +lib/X11/xsm +lib/X11/xserver diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/lib-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/lib-list new file mode 100644 index 000000000..9673fea05 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/lib-list @@ -0,0 +1,2 @@ +lib/X11 +include/X11/bitmaps diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/man-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/man-excl new file mode 100644 index 000000000..1ea82551a --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/man-excl @@ -0,0 +1,3 @@ +man/cat1/XF86Setup.0 +man/cat1/xfs.0 +man/cat1/xmseconfig.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/man-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/man-list new file mode 100644 index 000000000..2a3700c15 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/man-list @@ -0,0 +1 @@ +man diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/nest-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/nest-list new file mode 100644 index 000000000..eff754d76 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/nest-list @@ -0,0 +1 @@ +bin/Xnest diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prog-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prog-excl new file mode 100644 index 000000000..113d220ef --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prog-excl @@ -0,0 +1,5 @@ +lib/Server +lib/X11 +lib/lib*.so* +lib/modules +include/X11/bitmaps diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prog-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prog-list new file mode 100644 index 000000000..059b71061 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prog-list @@ -0,0 +1,3 @@ +lib +include +lib/X11/config diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prt-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prt-list new file mode 100644 index 000000000..0646e7927 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/prt-list @@ -0,0 +1 @@ +bin/Xprt diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/vfb-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/vfb-list new file mode 100644 index 000000000..e2d161bbc --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/vfb-list @@ -0,0 +1 @@ +bin/Xvfb diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/xserv-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/xserv-list new file mode 100644 index 000000000..3d270e398 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin/xserv-list @@ -0,0 +1,2 @@ +bin/Xdarwin +bin/X diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/bin-list index 7bd4548b9..512a75054 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/bin-list @@ -10,10 +10,12 @@ lib/libXaw.so.6.1 lib/libXaw.so.7.0 lib/libXext.so.6.4 lib/libXfont.so.1.3 +lib/libXft.so.1.0 lib/libXi.so.6.0 lib/libXmu.so.6.2 lib/libXp.so.6.2 lib/libXpm.so.4.11 +lib/libXrender.so.1.0 lib/libXt.so.6.0 lib/libXtst.so.6.1 lib/libdps.so.1.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/bin-list index ba81399ed..85cbab2a5 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/bin-list @@ -4,6 +4,8 @@ lib/libGL.so.1 lib/libGL.so lib/libICE.so.6 lib/libICE.so +lib/libOSMesa.so.3 +lib/libOSMesa.so lib/libPEX5.so.6 lib/libPEX5.so lib/libSM.so.6 @@ -21,6 +23,8 @@ lib/libXext.so.6 lib/libXext.so lib/libXfont.so.1 lib/libXfont.so +lib/libXft.so.1 +lib/libXft.so lib/libXi.so.6 lib/libXi.so lib/libXmu.so.6 @@ -29,6 +33,8 @@ lib/libXp.so.6 lib/libXp.so lib/libXpm.so.4 lib/libXpm.so +lib/libXrender.so.1 +lib/libXrender.so lib/libXt.so.6 lib/libXt.so lib/libXtst.so.6 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/bin-list index 10aaba215..9f9e96aa1 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/bin-list @@ -5,6 +5,9 @@ lib/libGL.so lib/libICE.so.6.3 lib/libICE.so.6 lib/libICE.so +lib/libOSMesa.so.3.3 +lib/libOSMesa.so.3 +lib/libOSMesa.so lib/libPEX5.so.6.0 lib/libPEX5.so.6 lib/libPEX5.so @@ -28,6 +31,9 @@ lib/libXext.so lib/libXfont.so.1.3 lib/libXfont.so.1 lib/libXfont.so +lib/libXft.so.1.0 +lib/libXft.so.1 +lib/libXft.so lib/libXi.so.6.0 lib/libXi.so.6 lib/libXi.so @@ -40,6 +46,9 @@ lib/libXp.so lib/libXpm.so.4.11 lib/libXpm.so.4 lib/libXpm.so +lib/libXrender.so.1.0 +lib/libXrender.so.1 +lib/libXrender.so lib/libXt.so.6.0 lib/libXt.so.6 lib/libXt.so diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def index 4d596c623..b5c6671f8 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def @@ -1,8 +1,16 @@ /* * Host.def for building Linux/alpha bindists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def,v 1.4 2000/03/07 14:47:32 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def,v 1.5 2000/12/18 14:34:58 dawes Exp $ */ #define InstallEmptyHostDef +/* Need to have glide 3 installed, where available */ + +#if LinuxCLibMajorVersion > 5 +#define HasGlide3 YES +#endif + +#define BuildXF86DRI YES + diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/var-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/var-list index ff72b5c73..a65b41774 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/var-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/var-list @@ -1 +1 @@ -state +lib diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/bin-list index 10aaba215..9f9e96aa1 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/bin-list @@ -5,6 +5,9 @@ lib/libGL.so lib/libICE.so.6.3 lib/libICE.so.6 lib/libICE.so +lib/libOSMesa.so.3.3 +lib/libOSMesa.so.3 +lib/libOSMesa.so lib/libPEX5.so.6.0 lib/libPEX5.so.6 lib/libPEX5.so @@ -28,6 +31,9 @@ lib/libXext.so lib/libXfont.so.1.3 lib/libXfont.so.1 lib/libXfont.so +lib/libXft.so.1.0 +lib/libXft.so.1 +lib/libXft.so lib/libXi.so.6.0 lib/libXi.so.6 lib/libXi.so @@ -40,6 +46,9 @@ lib/libXp.so lib/libXpm.so.4.11 lib/libXpm.so.4 lib/libXpm.so +lib/libXrender.so.1.0 +lib/libXrender.so.1 +lib/libXrender.so lib/libXt.so.6.0 lib/libXt.so.6 lib/libXt.so diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/var-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/var-list index ff72b5c73..a65b41774 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/var-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/var-list @@ -1 +1 @@ -state +lib diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/bin-list index 10aaba215..9f9e96aa1 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/bin-list @@ -5,6 +5,9 @@ lib/libGL.so lib/libICE.so.6.3 lib/libICE.so.6 lib/libICE.so +lib/libOSMesa.so.3.3 +lib/libOSMesa.so.3 +lib/libOSMesa.so lib/libPEX5.so.6.0 lib/libPEX5.so.6 lib/libPEX5.so @@ -28,6 +31,9 @@ lib/libXext.so lib/libXfont.so.1.3 lib/libXfont.so.1 lib/libXfont.so +lib/libXft.so.1.0 +lib/libXft.so.1 +lib/libXft.so lib/libXi.so.6.0 lib/libXi.so.6 lib/libXi.so @@ -40,6 +46,9 @@ lib/libXp.so lib/libXpm.so.4.11 lib/libXpm.so.4 lib/libXpm.so +lib/libXrender.so.1.0 +lib/libXrender.so.1 +lib/libXrender.so lib/libXt.so.6.0 lib/libXt.so.6 lib/libXt.so diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/var-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/var-list index ff72b5c73..a65b41774 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/var-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/var-list @@ -1 +1 @@ -state +lib diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/bin-list index 10aaba215..9f9e96aa1 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/bin-list @@ -5,6 +5,9 @@ lib/libGL.so lib/libICE.so.6.3 lib/libICE.so.6 lib/libICE.so +lib/libOSMesa.so.3.3 +lib/libOSMesa.so.3 +lib/libOSMesa.so lib/libPEX5.so.6.0 lib/libPEX5.so.6 lib/libPEX5.so @@ -28,6 +31,9 @@ lib/libXext.so lib/libXfont.so.1.3 lib/libXfont.so.1 lib/libXfont.so +lib/libXft.so.1.0 +lib/libXft.so.1 +lib/libXft.so lib/libXi.so.6.0 lib/libXi.so.6 lib/libXi.so @@ -40,6 +46,9 @@ lib/libXp.so lib/libXpm.so.4.11 lib/libXpm.so.4 lib/libXpm.so +lib/libXrender.so.1.0 +lib/libXrender.so.1 +lib/libXrender.so lib/libXt.so.6.0 lib/libXt.so.6 lib/libXt.so diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/var-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/var-list index ff72b5c73..a65b41774 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/var-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-mips/var-list @@ -1 +1 @@ -state +lib diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/bin-list index 10aaba215..9f9e96aa1 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/bin-list @@ -5,6 +5,9 @@ lib/libGL.so lib/libICE.so.6.3 lib/libICE.so.6 lib/libICE.so +lib/libOSMesa.so.3.3 +lib/libOSMesa.so.3 +lib/libOSMesa.so lib/libPEX5.so.6.0 lib/libPEX5.so.6 lib/libPEX5.so @@ -28,6 +31,9 @@ lib/libXext.so lib/libXfont.so.1.3 lib/libXfont.so.1 lib/libXfont.so +lib/libXft.so.1.0 +lib/libXft.so.1 +lib/libXft.so lib/libXi.so.6.0 lib/libXi.so.6 lib/libXi.so @@ -40,6 +46,9 @@ lib/libXp.so lib/libXpm.so.4.11 lib/libXpm.so.4 lib/libXpm.so +lib/libXrender.so.1.0 +lib/libXrender.so.1 +lib/libXrender.so lib/libXt.so.6.0 lib/libXt.so.6 lib/libXt.so diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/var-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/var-list index ff72b5c73..a65b41774 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/var-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/var-list @@ -1 +1 @@ -state +lib diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/bin-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/bin-excl new file mode 100644 index 000000000..e88ea2ba6 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/bin-excl @@ -0,0 +1,6 @@ +bin/Xnest +bin/Xprt +bin/Xvfb +bin/X +bin/xfs +bin/XFree86 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/bin-list new file mode 100644 index 000000000..3d7c2a6d6 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/bin-list @@ -0,0 +1,23 @@ +bin +lib/libGL.so.1.2 +lib/libICE.so.6.3 +lib/libPEX5.so.6.0 +lib/libSM.so.6.0 +lib/libX11.so.6.2 +lib/libXIE.so.6.0 +lib/libXaw.so.6.1 +lib/libXaw.so.7.0 +lib/libXext.so.6.4 +lib/libXfont.so.1.3 +lib/libXft.so.1.0 +lib/libXi.so.6.0 +lib/libXmu.so.6.2 +lib/libXp.so.6.2 +lib/libXpm.so.4.11 +lib/libXrender.so.1.0 +lib/libXt.so.6.0 +lib/libXtst.so.6.1 +lib/libdps.so.1.0 +lib/libdpstk.so.1.0 +lib/liboldX.so.6.0 +lib/libpsres.so.1.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/dir b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/dir new file mode 100644 index 000000000..11c5b9da7 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/dir @@ -0,0 +1 @@ +usr/X11R6 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/etc-dir b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/etc-dir new file mode 100644 index 000000000..412cec0c3 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/etc-dir @@ -0,0 +1 @@ +etc/X11 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/etc-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/etc-list new file mode 100644 index 000000000..9c558e357 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/etc-list @@ -0,0 +1 @@ +. diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/fsrv-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/fsrv-list new file mode 100644 index 000000000..e4decc9eb --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/fsrv-list @@ -0,0 +1,2 @@ +bin/xfs +man/cat1/xfs.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/host.def new file mode 100644 index 000000000..e34b1b202 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/host.def @@ -0,0 +1,8 @@ +/* + * Host.def for building NetBSD bindists + * + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/host.def,v 1.1 2000/12/09 21:46:27 herrb Exp $ + */ + +#define InstallEmptyHostDef + diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/lib-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/lib-excl new file mode 100644 index 000000000..d7fb5cb03 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/lib-excl @@ -0,0 +1,14 @@ +lib/X11/XF86Setup +lib/X11/app-defaults +lib/X11/config +lib/X11/doc +lib/X11/fonts +lib/X11/fs +lib/X11/lbxproxy +lib/X11/proxymngr +lib/X11/rstart +lib/X11/twm +lib/X11/xdm +lib/X11/xinit +lib/X11/xsm +lib/X11/xserver diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/lib-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/lib-list new file mode 100644 index 000000000..9673fea05 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/lib-list @@ -0,0 +1,2 @@ +lib/X11 +include/X11/bitmaps diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/man-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/man-excl new file mode 100644 index 000000000..1ea82551a --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/man-excl @@ -0,0 +1,3 @@ +man/cat1/XF86Setup.0 +man/cat1/xfs.0 +man/cat1/xmseconfig.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/man-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/man-list new file mode 100644 index 000000000..2a3700c15 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/man-list @@ -0,0 +1 @@ +man diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/mod-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/mod-list new file mode 100644 index 000000000..7054fc153 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/mod-list @@ -0,0 +1 @@ +lib/modules diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/nest-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/nest-list new file mode 100644 index 000000000..eff754d76 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/nest-list @@ -0,0 +1 @@ +bin/Xnest diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/prog-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/prog-excl new file mode 100644 index 000000000..113d220ef --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/prog-excl @@ -0,0 +1,5 @@ +lib/Server +lib/X11 +lib/lib*.so* +lib/modules +include/X11/bitmaps diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/prog-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/prog-list new file mode 100644 index 000000000..059b71061 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/prog-list @@ -0,0 +1,3 @@ +lib +include +lib/X11/config diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/prt-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/prt-list new file mode 100644 index 000000000..0646e7927 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/prt-list @@ -0,0 +1 @@ +bin/Xprt diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/var-dir b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/var-dir new file mode 100644 index 000000000..186857b9e --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/var-dir @@ -0,0 +1 @@ +var diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/var-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/var-list new file mode 100644 index 000000000..65eef93d6 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/var-list @@ -0,0 +1 @@ +db diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/vfb-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/vfb-list new file mode 100644 index 000000000..e2d161bbc --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/vfb-list @@ -0,0 +1 @@ +bin/Xvfb diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/xserv-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/xserv-list new file mode 100644 index 000000000..334bbd1e4 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/xserv-list @@ -0,0 +1,2 @@ +bin/XFree86 +bin/X diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/bin-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/bin-excl index c7f43558f..e88ea2ba6 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/bin-excl +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/bin-excl @@ -1,10 +1,6 @@ -bin/XF86_* -bin/XF98_* -bin/XF86Setup bin/Xnest bin/Xprt bin/Xvfb bin/X bin/xfs -bin/xmseconfig bin/XFree86 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/bin-list index 293d1c4a4..80b1f62b6 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/bin-list @@ -1,21 +1,66 @@ bin +lib/libGL.so +lib/libGL.so.1 lib/libGL.so.1.2 +lib/libICE.so +lib/libICE.so.6 lib/libICE.so.6.3 +lib/libPEX5.so +lib/libPEX5.so.6 lib/libPEX5.so.6.0 +lib/libSM.so +lib/libSM.so.6 lib/libSM.so.6.0 +lib/libX11.so +lib/libX11.so.6 lib/libX11.so.6.2 +lib/libXIE.so +lib/libXIE.so.6 lib/libXIE.so.6.0 +lib/libXaw.so +lib/libXaw.so.6 lib/libXaw.so.6.1 +lib/libXaw.so.7 lib/libXaw.so.7.0 +lib/libXext.so +lib/libXext.so.6 lib/libXext.so.6.4 +lib/libXfont.so +lib/libXfont.so.1 lib/libXfont.so.1.3 +lib/libXft.so +lib/libXft.so.1 +lib/libXft.so.1.0 +lib/libXi.so +lib/libXi.so.6 lib/libXi.so.6.0 +lib/libXmu.so +lib/libXmu.so.6 lib/libXmu.so.6.2 +lib/libXp.so +lib/libXp.so.6 lib/libXp.so.6.2 +lib/libXpm.so +lib/libXpm.so.4 lib/libXpm.so.4.11 +lib/libXrender.so +lib/libXrender.so.1 +lib/libXrender.so.1.0 +lib/libXt.so +lib/libXt.so.6 lib/libXt.so.6.0 +lib/libXtst.so +lib/libXtst.so.6 lib/libXtst.so.6.1 +lib/libdps.so +lib/libdps.so.1 lib/libdps.so.1.0 +lib/libdpstk.so +lib/libdpstk.so.1 lib/libdpstk.so.1.0 +lib/liboldX.so +lib/liboldX.so.6 lib/liboldX.so.6.0 +lib/libpsres.so +lib/libpsres.so.1 lib/libpsres.so.1.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/bin-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/bin-excl index c7f43558f..e88ea2ba6 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/bin-excl +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/bin-excl @@ -1,10 +1,6 @@ -bin/XF86_* -bin/XF98_* -bin/XF86Setup bin/Xnest bin/Xprt bin/Xvfb bin/X bin/xfs -bin/xmseconfig bin/XFree86 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/bin-list index bb6e90d8a..75cc08f7e 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/bin-list @@ -10,10 +10,12 @@ lib/libXaw.so.6.1 lib/libXaw.so.7.0 lib/libXext.so.6.4 lib/libXfont.so.1.3 +lib/libXft.so.1.0 lib/libXi.so.6.0 lib/libXmu.so.6.2 lib/libXp.so.6.2 lib/libXpm.so.4.11 +lib/libXrender.so.1.0 lib/libXt.so.6.0 lib/libXtst.so.6.1 lib/libdps.so.1.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/bin-list index 40ea17e7e..38a00bb51 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/bin-list @@ -18,6 +18,8 @@ lib/libXext.so.6.4 lib/libXext.so lib/libXfont.so.1.3 lib/libXfont.so +lib/libXft.so.1.0 +lib/libXft.so lib/libXi.so.6.0 lib/libXi.so lib/libXmu.so.6.2 @@ -26,6 +28,8 @@ lib/libXp.so.6.2 lib/libXp.so lib/libXpm.so.4.11 lib/libXpm.so +lib/libXrender.so.1.0 +lib/libXrender.so lib/libXt.so.6.0 lib/libXt.so lib/libXtst.so.6.1 @@ -36,3 +40,5 @@ lib/libdpstk.so.1.0 lib/libdpstk.so lib/libpsres.so.1.0 lib/libpsres.so +lib/liboldX.so.6.0 +lib/liboldX.so diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/bin-list index 40ea17e7e..38a00bb51 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/bin-list @@ -18,6 +18,8 @@ lib/libXext.so.6.4 lib/libXext.so lib/libXfont.so.1.3 lib/libXfont.so +lib/libXft.so.1.0 +lib/libXft.so lib/libXi.so.6.0 lib/libXi.so lib/libXmu.so.6.2 @@ -26,6 +28,8 @@ lib/libXp.so.6.2 lib/libXp.so lib/libXpm.so.4.11 lib/libXpm.so +lib/libXrender.so.1.0 +lib/libXrender.so lib/libXt.so.6.0 lib/libXt.so lib/libXtst.so.6.1 @@ -36,3 +40,5 @@ lib/libdpstk.so.1.0 lib/libdpstk.so lib/libpsres.so.1.0 lib/libpsres.so +lib/liboldX.so.6.0 +lib/liboldX.so diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/bin-list index 40ea17e7e..38a00bb51 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/bin-list @@ -18,6 +18,8 @@ lib/libXext.so.6.4 lib/libXext.so lib/libXfont.so.1.3 lib/libXfont.so +lib/libXft.so.1.0 +lib/libXft.so lib/libXi.so.6.0 lib/libXi.so lib/libXmu.so.6.2 @@ -26,6 +28,8 @@ lib/libXp.so.6.2 lib/libXp.so lib/libXpm.so.4.11 lib/libXpm.so +lib/libXrender.so.1.0 +lib/libXrender.so lib/libXt.so.6.0 lib/libXt.so lib/libXtst.so.6.1 @@ -36,3 +40,5 @@ lib/libdpstk.so.1.0 lib/libdpstk.so lib/libpsres.so.1.0 lib/libpsres.so +lib/liboldX.so.6.0 +lib/liboldX.so diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist b/xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist index 588f5d00c..e9def824a 100755 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist @@ -1,6 +1,6 @@ #!/bin/sh # -# $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist,v 1.3 2000/02/22 17:11:41 dawes Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist,v 1.4 2000/12/14 21:50:09 dawes Exp $ # Usage() @@ -9,11 +9,11 @@ Usage() exit 1 } -listonly=NO +createlist=NO case $1 in -l) - listonly=YES + createlist=YES shift ;; esac @@ -81,7 +81,7 @@ if [ ! -d $TODIR/$BINDIR ]; then mkdir $TODIR/$BINDIR fi -if [ $listonly = YES ]; then +if [ $createlist = YES ]; then GenList exit 0; fi @@ -126,6 +126,6 @@ for d in $SUBDIRS; do ) done -GenList +# GenList exit 0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/fnts-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/fnts-list index 28f12daf4..f2fda4316 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/fnts-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/fnts-list @@ -3,3 +3,4 @@ lib/X11/fonts/misc lib/X11/fonts/PEX lib/X11/fonts/CID lib/X11/fonts/local +lib/X11/fonts/util diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/host.def index e39bb10f6..43db4801a 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/host.def @@ -6,7 +6,7 @@ * - XFree86 doctools package (requires groff) * - nroff/troff or groff * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/common/host.def,v 1.6 2000/12/05 00:32:03 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/common/host.def,v 1.8 2000/12/15 21:54:37 dawes Exp $ */ #define HasSgmlFmt YES @@ -14,9 +14,12 @@ #define InstallJapaneseDocs YES #define BuildSpecsDocs YES -#define SpecsDocDirs BDF CTEXT FSProtocol ICCCM \ - XProtocol Xserver X11 XDMCP XLFD Xaw \ - Xmu Xt Xext Xi xfs /*PEX5*/ ICE SM xtrans \ - xterm rstart GL Xv i18n programs +#define SpecsDocDirs BDF CTEXT FSProtocol GL ICCCM ICE \ + /*PEX5*/ PM Render SM X11 XDMCP XIM XLFD \ + XProtocol Xaw Xext Xi Xmu Xserver Xt Xv \ + i18n programs rstart xfs xterm xtrans + +#define InstallHardcopyDocs YES +#define HardcopyDocDirs RX XIE XKB XPRINT diff --git a/xc/programs/Xserver/hw/xfree86/etc/pcitweak.man b/xc/programs/Xserver/hw/xfree86/etc/pcitweak.man index df177915e..12d3cc5b1 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/pcitweak.man +++ b/xc/programs/Xserver/hw/xfree86/etc/pcitweak.man @@ -1,5 +1,5 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.man,v 3.1 2000/07/30 17:12:21 dawes Exp $ -.TH PCITWEAK 1 "Version 4.0.1" "XFree86" +.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/pcitweak.man,v 3.2 2000/12/11 20:18:44 dawes Exp $ +.TH PCITWEAK 1 "Version 4.0.2" "XFree86" .SH NAME pcitweak - read/write PCI config space .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/etc/scanpci.man b/xc/programs/Xserver/hw/xfree86/etc/scanpci.man index 6f964aa70..65126f5ec 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/scanpci.man +++ b/xc/programs/Xserver/hw/xfree86/etc/scanpci.man @@ -1,5 +1,5 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.man,v 3.1 2000/07/30 17:12:22 dawes Exp $ -.TH SCANPCI 1 "Version 4.0.1" "XFree86" +.\" $XFree86: xc/programs/Xserver/hw/xfree86/etc/scanpci.man,v 3.2 2000/12/11 20:18:45 dawes Exp $ +.TH SCANPCI 1 "Version 4.0.2" "XFree86" .SH NAME scanpci - scan/probe PCI buses .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/fbdevhw/Imakefile b/xc/programs/Xserver/hw/xfree86/fbdevhw/Imakefile index 2d87ff273..4be54a029 100644 --- a/xc/programs/Xserver/hw/xfree86/fbdevhw/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/fbdevhw/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/Imakefile,v 1.8 2000/08/11 23:33:50 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/Imakefile,v 1.9 2000/12/17 22:23:37 dawes Exp $ #define IHaveModules #include <Server.tmpl> @@ -25,9 +25,9 @@ NormalLintTarget($(SRCS)) #ifdef LinuxArchitecture InstallLibraryModule(fbdevhw,$(MODULEDIR),linux) +#endif CppManTarget(fbdevhw,) InstallModuleManPage(fbdevhw) -#endif #ifndef OS2Architecture DependTarget() diff --git a/xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.cpp b/xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.cpp index 778703b7f..7e6787f32 100644 --- a/xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.cpp +++ b/xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.cpp @@ -1,5 +1,5 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.cpp,v 1.2 2000/06/14 02:13:16 dawes Exp $ -.TH FBDEVHW __drivermansuffix__ "Version 4.0.1" "XFree86" +.\" $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.cpp,v 1.4 2000/12/11 20:29:50 dawes Exp $ +.TH FBDEVHW __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME fbdevhw \- os-specific submodule for framebuffer device access .SH DESCRIPTION @@ -14,7 +14,7 @@ fbdev(__drivermansuffix__) is a non-accelerated driver which runs on top of the fbdevhw module. fbdevhw can be used by other drivers too, this is usually activated with `Option "UseFBDev"' in the device section. .SH "SEE ALSO" -XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(1), +XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__), fbdev(__drivermansuffix__) .SH AUTHORS Authors include: Gerd Knorr, based on the XF68_FBDev Server code diff --git a/xc/programs/Xserver/hw/xfree86/input/citron/citron.cpp b/xc/programs/Xserver/hw/xfree86/input/citron/citron.cpp index 444eae0dc..49ec05c56 100644 --- a/xc/programs/Xserver/hw/xfree86/input/citron/citron.cpp +++ b/xc/programs/Xserver/hw/xfree86/input/citron/citron.cpp @@ -1,37 +1,21 @@ .\" Copyright (c) 2000 Peter Kunzmann <support@@citron.de> .\" -.\" This is free documentation; you can redistribute it and/or -.\" modify it under the terms of the GNU General Public License as -.\" published by the Free Software Foundation; either version 2 of -.\" the License, or (at your option) any later version. +.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/citron/citron.cpp,v 1.4 2000/12/17 22:27:40 dawes Exp $ .\" -.\" The GNU General Public License's references to "object code" -.\" and "executables" are to be interpreted as the output of any -.\" document formatting or typesetting system, including -.\" intermediate and printed output. -.\" -.\" This manual is distributed in the hope that it will be useful, -.\" but WITHOUT ANY WARRANTY; without even the implied warranty of -.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -.\" GNU General Public License for more details. -.\" -.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/citron/citron.cpp,v 1.1 2000/11/02 02:51:21 dawes Exp $ -.\" -.TH CITRON 4 "Version 4.0.1" "XFREE86" +.\" shorthand for double quote that works everywhere. +.ds q \N'34' +.TH CITRON __drivermansuffix__ "Version 4.0.2" "XFREE86" .SH NAME citron \- Citron Infrared Touch Driver (CiTouch) .SH SYNOPSIS -.B "Section ""InputDevice""" -.br -.BI " Identifier """ idevname """" -.br -.B " Driver ""citron""" -.br -.BI " Option ""Device"" """ devpath """" -.br +.nf +.B "Section \*qInputDevice\*q" +.BI " Identifier \*q" idevname \*q +.B " Driver \*qcitron\*q" +.BI " Option \*qDevice\*q \*q" devpath \*q \ \ ... -.br .B EndSection +.fi .SH DESCRIPTION .B citron is a XFree86 input driver for @@ -61,7 +45,7 @@ touches. 15.1 inch Infrared Touch .SH CONFIGURATION DETAILS -Please refer to XF86Config(5x) for general configuration +Please refer to XF86Config(__filemansuffix__) for general configuration details and for options that can be used with all input drivers. This section only covers configuration details specific to this driver. For better understanding please read also the @@ -78,24 +62,24 @@ The following driver .B Options are supported: .TP 7 -.BI "Option ""Device"" """ devpath """ +.BI "Option \*qDevice\*q \*q" devpath \*q Specify the device path for the citron touch. Valid devices are: .PP .RS 12 -/dev/ttyS0, /dev/ttyS1, .... -This option is mandatory. +/dev/ttyS0, /dev/ttyS1, ... .RE -.PP .RS 7 -It's important to specify the right device Note: com1 -> /dev/ttyS0, com2 -> /dev/ttyS1 .... +This option is mandatory. +.PP +It's important to specify the right device Note: com1 -> /dev/ttyS0, com2 -> /dev/ttyS1, ... .RE .TP 7 -.BI "Option ""ScreenNumber"" """ "screennumber" """ +.BI "Option \*qScreenNumber\*q \*q" screennumber \*q sets the .I screennumber for the -.I citron +.B citron InputDevice. .PP .RS 7 @@ -104,9 +88,11 @@ ScreenNumber: "0" .RE .TP 7 -.BI "Option ""MinX, MinY"" """ value """ +.BI "Option \*qMinX\*q \*q" value \*q +.TP 7 +.BI "Option \*qMinY\*q \*q" value \*q These are the minimum X and Y values for the -.I citron +.B citron input device. .PP .RS 7 @@ -121,9 +107,11 @@ MinX: "0" MinY: "0" .RE .TP 7 -.BI "Option ""MaxX, MaxY"" """ value """ +.BI "Option \*qMaxX\*q \*q" value \*q +.TP 7 +.BI "Option \*qMaxY\*q \*q" value \*q These are the maximum X and Y values for the -.I citron +.B citron input device. .PP .RS 7 @@ -138,7 +126,7 @@ MaxX: "65535" MaxY: "65535" .RE .TP 7 -.BI "Option ""ButtonNumber"" """ value """ +.BI "Option \*qButtonNumber\*q \*q" value \*q This value is responsible for the .I button number that is returned within the xf86PostButton event message @@ -152,7 +140,7 @@ that is returned within the xf86PostButton event message .RE .TP 7 -.BI "Option ""ButtonThreshold"" """ value """ +.BI "Option \*qButtonThreshold\*q \*q" value \*q This value is responsible for the .I button threshold. It changes the pressure sensitivity of the touch. A higher number @@ -196,7 +184,7 @@ the .PP .RE .TP 7 -.BI "Option ""SleepMode"" """ mode """ +.BI "Option \*qSleepMode\*q \*q" mode \*q This value is responsible for the .I sleep-mode of the touch. @@ -226,7 +214,7 @@ GP_OUT output set according to the Sleep-Mode status .RE .TP 7 -.BI "Option ""SleepTime"" """ time """ +.BI "Option \*qSleepTime\*q \*q" time \*q This value is responsible for the .I sleep-time of the touch. It is the activation time in seconds @@ -241,7 +229,7 @@ of the touch. It is the activation time in seconds .RE .TP 7 -.BI "Option ""SleepScan"" """ scan """ +.BI "Option \*qSleepScan\*q \*q" scan \*q This value is responsible for the .I scan-time of the touch. This is the time interval between two scan operations @@ -257,7 +245,7 @@ of milliseconds. .RE .TP 7 -.BI "Option ""PWMActive"" """ value """ +.BI "Option \*qPWMActive\*q \*q" value \*q This value determines the mark-to-space ratio of the .I PWM output while in normal operation (sleep-mode not active). @@ -276,7 +264,7 @@ to do backlight-dimming via the touch. .RE .TP 7 -.BI "Option ""PWMSleep"" """ value """ +.BI "Option \*qPWMSleep\*q \*q" value \*q This value determines the mark-to-space ratio of the .I PWM output while in sleep-mode (-> @@ -293,24 +281,27 @@ Higher values result in longer pulse widths. .RE .TP 7 -.BI "Option ""ClickMode"" """ mode """ +.BI "Option \*qClickMode\*q \*q" mode \*q With mode one can select between 5 .I ClickModes -.I """1"" = ClickMode Enter +.B \*q1\*q += ClickMode Enter With this mode every interruption of the infrared beams will activate a ButtonPress event and after the interruption a ButtonRelease event will be sent. -.I """2"" = ClickMode Dual +.B \*q2\*q += ClickMode Dual With this mode every interruption will sent a Proximity event and every second interruption a ButtonPress event. With the release of the interruption (while one interruption is still active) a ButtonRelease event will be sent. -.I """3"" = ClickMode Dual Exit +.B \*q3\*q += ClickMode Dual Exit With this mode every interruption will sent a ProximityIn event and every second interruption a ButtonPress event. With the release of @@ -318,16 +309,18 @@ the interruption (while one interruption is still active) no ButtonRelease event will be sent. Only if all interruptions are released a ButtonRelease followed by a ProximityOut event will be sent. -.I """4"" = ClickMode ZPress +.B \*q4\*q += ClickMode ZPress With this mode every interruption will sent a ProximityIn event. Only if a certain pressure is exceeded a ButtonPress event will occur. If the pressure falls below a certain limit a ButtonRelease event will be sent. After also the interruption is released a ProximityOut event is generated. -.I """5"" = ClickMode ZPress Exit +.B \*q5\*q += ClickMode ZPress Exit -This mode is similat to "Clickmode Dual Exit". +This mode is similar to "Clickmode Dual Exit". The first interruption of the beams will sent a ProximityIn event. Only if a certain pressure is exceeded a ButtonPress event will occur. If the pressure falls below a certain limit no ButtonRelease event will be sent. @@ -343,7 +336,7 @@ a ProximityOut event is generated. .RE .TP 7 -.BI "Option ""Origin"" """ value """ +.BI "Option \*qOrigin\*q \*q" value \*q This value sets the coordinates origin to one of the four corners of the screen. The following values are accepted: @@ -372,7 +365,7 @@ the maximum speed. .RE .TP 7 -.BI "Option ""DozeMode"" """ mode """ +.BI "Option \*qDozeMode\*q \*q" mode \*q This value is responsible for the .I doze-mode of the touch. @@ -380,15 +373,20 @@ of the touch. .PP Determines the behaviour of the Doze-Mode. .PP -0x00 No message at either activation or deactivation +.B 0x00 +No message at either activation or deactivation -0x01 Message at activation +.B 0x01 +Message at activation -0x02 Message at deactivation +.B 0x02 +Message at deactivation -0x03 Message at activation and deactivation +.B 0x03 +Message at activation and deactivation -0x10 GP_OUT output set according to the Doze-Mode status +.B 0x10 +GP_OUT output set according to the Doze-Mode status If the GP_OUT output is already controlled by the .I Sleep-Mode @@ -404,7 +402,7 @@ it is no longer available as an output port anymore. .RE .TP 7 -.BI "Option ""DozeTime"" """ time """ +.BI "Option \*qDozeTime\*q \*q" time \*q This value is responsible for the .I doze-time of the touch. It is the activation time in seconds @@ -420,7 +418,7 @@ of the touch. It is the activation time in seconds .RE .TP 7 -.BI "Option ""DozeScan"" """ scan """ +.BI "Option \*qDozeScan\*q \*q" scan \*q This value is responsible for the .I scan-time of the touch. This is the time interval between two scan operations @@ -436,7 +434,7 @@ of milliseconds. .RE .TP 7 -.BI "Option ""DeltaX"" """ value """ +.BI "Option \*qDeltaX\*q \*q" value \*q This value determines a virtual area at the left and right side of the current cursor position where the cursor didn't move. Within this area no "MotionNotify" event will be sent. @@ -451,7 +449,7 @@ Within this area no "MotionNotify" event will be sent. .RE .TP 7 -.BI "Option ""DeltaY"" """ value """ +.BI "Option \*qDeltaY\*q \*q" value \*q This value determines a virtual area at the top and bottom of the current cursor position where the cursor didn't move. Within this area no "MotionNotify" event will be sent. @@ -465,7 +463,7 @@ Within this area no "MotionNotify" event will be sent. .RE .TP 7 -.BI "Option ""Beep"" """ value """ +.BI "Option \*qBeep\*q \*q" value \*q This value determines if a "ButtonPress" and/or a "ButtonRelease" event should sound the buzzer. "0" deactivates the buzzer while every other value will activate it. @@ -479,7 +477,7 @@ every other value will activate it. .RE .TP 7 -.BI "Option ""PressVol"" """ value """ +.BI "Option \*qPressVol\*q \*q" value \*q This value determines the volume of the buzzer (0-100%) when a "ButtonPress" event is sent. .RS 7 @@ -493,7 +491,7 @@ when a "ButtonPress" event is sent. .RE .TP 7 -.BI "Option ""PressPitch"" """ value """ +.BI "Option \*qPressPitch\*q \*q" value \*q This value determines the pitch of the tone when a "ButtonPress" event is sent. .RS 7 @@ -508,7 +506,7 @@ when a "ButtonPress" event is sent. .RE .TP 7 -.BI "Option ""PressDur"" """ value """ +.BI "Option \*qPressDur\*q \*q" value \*q This value determines the duration of the tone in ms when a "ButtonPress" event is sent. .RS 7 @@ -521,7 +519,7 @@ when a "ButtonPress" event is sent. .RE .TP 7 -.BI "Option ""ReleaseVol"" """ value """ +.BI "Option \*qReleaseVol\*q \*q" value \*q This value determines the volume of the buzzer (0-100%) when a "ButtonRelease" event is sent. .RS 7 @@ -535,7 +533,7 @@ when a "ButtonRelease" event is sent. .RE .TP 7 -.BI "Option ""ReleasePitch"" """ value """ +.BI "Option \*qReleasePitch\*q \*q" value \*q This value determines the pitch of the tone when when a "ButtonRelease" event is sent. .RS 7 @@ -550,7 +548,7 @@ when a "ButtonRelease" event is sent. .RE .TP 7 -.BI "Option ""ReleseDur"" """ value """ +.BI "Option \*qReleseDur\*q \*q" value \*q This value determines the duration of the tone in ms when when a "ButtonRelease" event is sent. .RS 7 @@ -565,7 +563,7 @@ when a "ButtonRelease" event is sent. .RE .TP 7 -.BI "Option ""BeamTimeout"" """ value """ +.BI "Option \*qBeamTimeout\*q \*q" value \*q Determines the time span in seconds, that has to elapse before a beam is considered defective, blanked-out and excluded from the coordinates evaluation. @@ -582,7 +580,7 @@ evaluation. .RE .TP 7 -.BI "Option ""TouchTime"" """ value """ +.BI "Option \*qTouchTime\*q \*q" value \*q Determines the minimum time span in steps of 10ms for a valid interruption. In order for an interruption to be reported to the host computer as valid, it needs to remain at @@ -598,7 +596,7 @@ the same spot for at least the time span declared here. .RE .TP 7 -.BI "Option ""EnterCount"" """ count """ +.BI "Option \*qEnterCount\*q \*q" count \*q Number of skipped "enter reports". Reports are sent approx. every 20ms. .RS 7 @@ -612,7 +610,7 @@ every 20ms. .RE .TP 7 -.BI "Option ""DualCount"" """ count """ +.BI "Option \*qDualCount\*q \*q" count \*q Number of skipped "dual touch error". Reports are sent approx. every 20ms. This option is only available for "ZPress" and "ZPress Exit" modes. @@ -626,6 +624,6 @@ every 20ms. This option is only available for "ZPress" and .SH "SEE ALSO" -XFree86(1), XF86Config(5x), xf86config(1), Xserver(1), X(1). +XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__). .SH AUTHORS 2000 - written by Citron GmbH (support@citron.de) diff --git a/xc/programs/Xserver/hw/xfree86/input/dynapro/dynapro.cpp b/xc/programs/Xserver/hw/xfree86/input/dynapro/dynapro.cpp index ddf710e77..0948955fd 100644 --- a/xc/programs/Xserver/hw/xfree86/input/dynapro/dynapro.cpp +++ b/xc/programs/Xserver/hw/xfree86/input/dynapro/dynapro.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/dynapro/dynapro.cpp,v 1.4 2000/06/14 02:13:17 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/dynapro/dynapro.cpp,v 1.5 2000/12/11 20:18:48 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH DYNAPRO __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH DYNAPRO __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME dynapro \- Dynapro input driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/input/elographics/elographics.cpp b/xc/programs/Xserver/hw/xfree86/input/elographics/elographics.cpp index 58c01e3b9..03f7792e6 100644 --- a/xc/programs/Xserver/hw/xfree86/input/elographics/elographics.cpp +++ b/xc/programs/Xserver/hw/xfree86/input/elographics/elographics.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/elographics/elographics.cpp,v 1.2 2000/06/14 02:13:17 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/elographics/elographics.cpp,v 1.3 2000/12/11 20:18:49 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH ELOGRAPHICS __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH ELOGRAPHICS __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME elographics \- Elographics input driver .SH SYNOPSIS @@ -34,7 +34,7 @@ section only covers configuration details specific to this driver. .PP Config details... .SH "SEE ALSO" -XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(1). +XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__). .SH AUTHORS Authors include... Patrick Lecoanet diff --git a/xc/programs/Xserver/hw/xfree86/input/keyboard/keyboard.cpp b/xc/programs/Xserver/hw/xfree86/input/keyboard/keyboard.cpp index ff163e5c2..bce88740e 100644 --- a/xc/programs/Xserver/hw/xfree86/input/keyboard/keyboard.cpp +++ b/xc/programs/Xserver/hw/xfree86/input/keyboard/keyboard.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/keyboard/keyboard.cpp,v 1.4 2000/06/14 02:13:17 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/keyboard/keyboard.cpp,v 1.5 2000/12/11 20:18:50 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH KEYBOARD __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH KEYBOARD __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME keyboard \- Keyboard input driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/input/microtouch/microtouch.cpp b/xc/programs/Xserver/hw/xfree86/input/microtouch/microtouch.cpp index c29ebd7bb..ebda94e8f 100644 --- a/xc/programs/Xserver/hw/xfree86/input/microtouch/microtouch.cpp +++ b/xc/programs/Xserver/hw/xfree86/input/microtouch/microtouch.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/microtouch/microtouch.cpp,v 1.4 2000/06/14 02:13:18 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/microtouch/microtouch.cpp,v 1.5 2000/12/11 20:18:51 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH MICROTOUCH __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH MICROTOUCH __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME microtouch \- MicroTouch input driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c b/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c index d9b3f0ef9..0fdf42ee0 100644 --- a/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c +++ b/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c,v 1.37 2000/12/02 01:16:24 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c,v 1.38 2000/12/18 15:52:22 dawes Exp $ */ /* * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. @@ -502,6 +502,7 @@ MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags) pMse->protocolID = protocolID; pMse->oldProtocolID = protocolID; /* hack */ pMse->origProtocolID = protocolID; + pMse->origProtocol = protocol; pMse->class = ProtocolIDToClass(protocolID); /* Collect the options, and process the common options. */ diff --git a/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.cpp b/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.cpp index d71323380..cd4840111 100644 --- a/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.cpp +++ b/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/mouse/mouse.cpp,v 1.4 2000/06/14 02:13:18 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/mouse/mouse.cpp,v 1.6 2000/12/12 18:54:32 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH MOUSE __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH MOUSE __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME mouse \- Mouse input driver .SH SYNOPSIS @@ -81,7 +81,7 @@ which only have two physical buttons. The third button is emulated by pressing both buttons simultaneously. Default: off .TP 7 .BI "Option \*qEmulate3Timeout\*q \*q" integer \*q -Sets the timeout (in milliseconds) that the driver waits before decicing +Sets the timeout (in milliseconds) that the driver waits before deciding if two buttons where pressed "simultaneously" when 3 button emulation is enabled. Default: 50. .TP 7 diff --git a/xc/programs/Xserver/hw/xfree86/input/mutouch/mutouch.cpp b/xc/programs/Xserver/hw/xfree86/input/mutouch/mutouch.cpp index 936a44d13..7b74b62fa 100644 --- a/xc/programs/Xserver/hw/xfree86/input/mutouch/mutouch.cpp +++ b/xc/programs/Xserver/hw/xfree86/input/mutouch/mutouch.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/mutouch/mutouch.cpp,v 1.2 2000/06/14 02:13:18 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/mutouch/mutouch.cpp,v 1.3 2000/12/11 20:18:54 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH MUTOUCH __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH MUTOUCH __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME mutouch \- Microtouch input driver .SH SYNOPSIS @@ -34,7 +34,7 @@ section only covers configuration details specific to this driver. .PP Config details... .SH "SEE ALSO" -XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(1). +XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__). .SH AUTHORS Authors include... Patrick Lecoanet diff --git a/xc/programs/Xserver/hw/xfree86/input/penmount/penmount.cpp b/xc/programs/Xserver/hw/xfree86/input/penmount/penmount.cpp index 8fe1ddd7e..3526c47b6 100644 --- a/xc/programs/Xserver/hw/xfree86/input/penmount/penmount.cpp +++ b/xc/programs/Xserver/hw/xfree86/input/penmount/penmount.cpp @@ -1,5 +1,5 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/penmount/penmount.cpp,v 1.1 2000/08/01 18:59:58 dawes Exp $ -.TH PENNMOUNT __drivermansuffix__ "Version 4.0.1" "XFree86" +.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/penmount/penmount.cpp,v 1.2 2000/12/11 20:18:55 dawes Exp $ +.TH PENNMOUNT __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME penmount \- PenMount input driver .SH SYNOPSIS @@ -32,6 +32,6 @@ section only covers configuration details specific to this driver. .PP Config details... .SH "SEE ALSO" -XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(1). +XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__). .SH AUTHORS Authors include... diff --git a/xc/programs/Xserver/hw/xfree86/input/void/void.cpp b/xc/programs/Xserver/hw/xfree86/input/void/void.cpp index 0a6b756a1..4c12a3c44 100644 --- a/xc/programs/Xserver/hw/xfree86/input/void/void.cpp +++ b/xc/programs/Xserver/hw/xfree86/input/void/void.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/void/void.cpp,v 1.4 2000/06/14 02:13:19 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/void/void.cpp,v 1.5 2000/12/11 20:18:56 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH VOID __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH VOID __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME void \- null input driver .SH SYNOPSIS diff --git a/xc/programs/Xserver/hw/xfree86/input/wacom/wacom.cpp b/xc/programs/Xserver/hw/xfree86/input/wacom/wacom.cpp index 7233cc226..6df170c42 100644 --- a/xc/programs/Xserver/hw/xfree86/input/wacom/wacom.cpp +++ b/xc/programs/Xserver/hw/xfree86/input/wacom/wacom.cpp @@ -1,7 +1,7 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/wacom/wacom.cpp,v 1.5 2000/12/01 17:43:06 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/wacom/wacom.cpp,v 1.9 2000/12/18 00:17:18 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH WACOM __drivermansuffix__ "Version 4.0.1" "XFree86" +.TH WACOM __drivermansuffix__ "Version 4.0.2" "XFree86" .SH NAME wacom \- Wacom input driver .SH SYNOPSIS @@ -15,22 +15,102 @@ wacom \- Wacom input driver .fi .SH DESCRIPTION .B wacom -is an XFree86 input driver for Wacom devices... +is an XFree86 input driver for Wacom devices. .PP The .B wacom driver functions as a pointer input device, and may be used as the X server's core pointer. -THIS MAN PAGE NEEDS TO BE FILLED IN. .SH SUPPORTED HARDWARE -What is supported... +This driver supports the Wacom IV and Wacom V protocols. +Preliminary support is available for USB devices on some Linux platforms. .SH CONFIGURATION DETAILS Please refer to XF86Config(__filemansuffix__) for general configuration details and for options that can be used with all input drivers. This section only covers configuration details specific to this driver. .PP -Config details... +Multiple instances of the Wacom devices can cohabit. It can be useful +to define multiple devices with different active zones. Each device +supports the following entries: +.RS 8 +.TP 4 +.B Option \fI"Type"\fP \fI"stylus"|"eraser"|"cursor"\fP +sets the type of tool the device represent. This option is mandatory. +.TP 4 +.B Option \fI"Device"\fP \fI"path"\fP +sets the path to the special file which represents serial line where +the tablet is plugged. You have to specify it for each subsection with +the same value if you want to have multiple devices with the same tablet. +This option is mandatory. +.TP 4 +.B Option \fI"USB"\fP \fI"on"\fP +tells the driver to dialog with the tablet the USB way. This option is +only available on some Linux platforms. +.TP 4 +.B Option \fI"DeviceName"\fP \fI"name"\fP +sets the name of the X device. +.TP 4 +.B Option \fI"Suppress"\fP \fI"Inumber"\fP +sets the position increment under which not to transmit coordinates. +This entry must be specified only in the first Wacom subsection if you have +multiple devices for one tablet. If you don't specify this entry, the default value +is computed to +.TP 4 +.B Option \fI"Mode"\fP \fI"Relative"|"Absolute"\fP +sets the mode of the device. +.TP 4 +.B Option \fI"Tilt"\fP \fI"on"\fP +enables tilt report if your tablet supports it (ROM version 1.4 and above). +If this is enabled, multiple devices at the same time will not be reported. +.TP 4 +.B Option \fI"HistorySize"\fP \fI"number"\fP +sets the motion history size. By default the value is zero. +.TP 4 +.B Option \fI"AlwaysCore"\fP \fI"on"\fP +enables the sharing of the core pointer. When this feature is enabled, the +device will take control of the core pointer (and thus will emit core events) +and at the same time will be able, when asked so, to report extended events. +You can use the last available integer feedback to control this feature. When +the value of the feedback is zero, the feature is disabled. The feature is +enabled for any other value. +.TP 4 +.B Option \fI"TopX"\fP \fI"number"\fP +X coordinate of the top corner of the active zone. +.TP 4 +.B Option \fI"TopY"\fP \fI"number"\fP +Y coordinate of the top corner of the active zone. +.TP 4 +.B Option \fI"BottomX"\fP \fI"Inumber"\fP +X coordinate of the bottom corner of the active zone. +.TP 4 +.B Option \fI"BottomY"\fP \fI"number"\fP +Y coordinate of the bottom corner of the active zone. +.TP 4 +.B Option \fI"KeepShape"\fP \fI"on"\fP +When this option is enabled, the active zone begins according to TopX +and TopY. The bottom corner is adjusted to keep the ratio width/height +of the active zone the same as the screen while maximizing the area +described by TopX, TopY, BottomX, BottomY. +.TP 4 +.B Option \fI"DebugLevel"\fP \fInumber \fP +sets the level of debugging info reported. +.TP 4 +.B Option \fI"BaudRate"\fP \fI"38400"\fP, \fI"19200"\fP or \fI"9600"\fP (default) +changes the serial link speed. This option is only available for +wacom V models (Intuos). +.TP 4 +.B Option \fI"Serial"\fP \fI"number"\fP +sets the serial number associated with the physical device. This allows +to have multiple devices of the same type (i.e. multiple pens). This +option is only available on wacom V devices (Intuos). To see which +serial number belongs to a device, you have to set the DebugLevel to 6 and +watch the output of the X server. +.TP 4 +.B Option \fI"Threshold"\fP \fI"number"\fP +sets the pressure threshold used to generate a button 1 events of stylus +devices for some models of tablets (Intuos and Graphire). +.RE .SH "SEE ALSO" XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__). .SH AUTHORS -Frederic Lepied +Frederic Lepied <lepied@xfree86.org> diff --git a/xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c b/xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c index 973b793de..60a229c06 100644 --- a/xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c +++ b/xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c @@ -22,7 +22,7 @@ * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c,v 1.21 2000/12/01 17:43:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c,v 1.24 2000/12/07 20:26:24 dawes Exp $ */ /* * This driver is only able to handle the Wacom IV and Wacom V protocols. @@ -58,24 +58,25 @@ static const char identification[] = "$Identification: 20 $"; +#include <xf86Version.h> + +#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(3,9,0,0,0) +#define XFREE86_V4 1 +#endif + #ifdef LINUX_INPUT #include <asm/types.h> #include <linux/input.h> -#ifndef O_NDELAY -#ifndef O_NONBLOCK -#define O_NONBLOCK 04000 +/* keithp - a hack to avoid redefinitions of these in xf86str.h */ +#ifdef BUS_PCI +#undef BUS_PCI #endif -#define O_NDELAY O_NONBLOCK +#ifdef BUS_ISA +#undef BUS_ISA #endif #endif -#include <xf86Version.h> - -#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(3,9,0,0,0) -#define XFREE86_V4 1 -#endif - #ifdef XFREE86_V4 /* post 3.9 headers */ @@ -101,8 +102,6 @@ static const char identification[] = "$Identification: 20 $"; #include <xf86Module.h> #endif -#undef memset -#define memset xf86memset #undef sleep #define sleep(t) xf86WaitForInput(-1, 1000 * (t)) #define wait_for_fd(fd) xf86WaitForInput((fd), 1000) @@ -311,6 +310,7 @@ typedef struct _WacomCommonRec int wcmInitNumber; /* magic number for the init phasis */ unsigned int wcmLinkSpeed; /* serial link speed */ Bool (*wcmOpen)(LocalDevicePtr /*local*/); /* function used to open the line (serial or USB) */ + unsigned int wcmLastSerial; /* last device (used by the USB part) */ } WacomCommonRec, *WacomCommonPtr; /****************************************************************************** @@ -555,7 +555,6 @@ static LocalDevicePtr xf86WcmAllocateEraser(void); #endif #ifndef XFREE86_V4 -#if !defined(sun) || defined(i386) /* *************************************************************************** * @@ -843,7 +842,6 @@ xf86WcmConfig(LocalDevicePtr *array, return Success; } -#endif #endif /* Pre 3.9 stuff */ #if 0 @@ -2096,16 +2094,15 @@ xf86WcmReadUSBInput(LocalDevicePtr local) { WacomDevicePtr priv = (WacomDevicePtr) local->private; WacomCommonPtr common = priv->common; - int device = common->wcmIndex; - int serial; - int is_proximity; - int x; - int y; - int pressure; - int buttons; - int tilt_x; - int tilt_y; - int wheel; + int serial = common->wcmLastSerial; + int is_proximity = priv->oldProximity; + int x = priv->oldX; + int y = priv->oldY; + int pressure = priv->oldZ; + int buttons = priv->oldButtons; + int tilt_x = priv->oldTiltX; + int tilt_y = priv->oldTiltY; + int wheel = priv->oldWheel; ssize_t len; int idx; @@ -2127,6 +2124,7 @@ xf86WcmReadUSBInput(LocalDevicePtr local) switch (event->type) { case EV_ABS: + DBG(10, ErrorF("event->code=%d\n", event->code)); switch (event->code) { case ABS_X: x = event->value; @@ -2159,23 +2157,26 @@ xf86WcmReadUSBInput(LocalDevicePtr local) case REL_WHEEL: /* FIXME */ break; + default: + ErrorF("wacom: relative event received (%d)!!!\n", event->code); + break; } break; /* EV_REL */ case EV_KEY: switch (event->code) { case BTN_TOOL_PEN: - device = STYLUS_ID; + common->wcmIndex = STYLUS_ID; is_proximity = (event->value != 0); break; case BTN_TOOL_RUBBER: - device = ERASER_ID; + common->wcmIndex = ERASER_ID; is_proximity = (event->value != 0); break; case BTN_TOOL_MOUSE: - device = CURSOR_ID; + common->wcmIndex = CURSOR_ID; is_proximity = (event->value != 0); break; @@ -2206,31 +2207,29 @@ xf86WcmReadUSBInput(LocalDevicePtr local) break; /* EV_KEY */ } -#if 0 - if ((priv->oldX != -1) && - (ABS(x - priv->oldX) <= common->wcmSuppress) && - (ABS(y - priv->oldY) <= common->wcmSuppress) && - (ABS(pressure - priv->oldZ) < 3) && - (ABS(tilt_x - priv->oldTiltX) < 3) && - (ABS(tilt_y - priv->oldTiltY) < 3)) { - DBG(10, ErrorF("filtered\n")); - continue; - } -#endif + if ((is_proximity == priv->oldProximity) && + (buttons == priv->oldButtons) && + (ABS(x - priv->oldX) <= common->wcmSuppress) && + (ABS(y - priv->oldY) <= common->wcmSuppress) && + (ABS(pressure - priv->oldZ) < 3) && + (ABS(tilt_x - priv->oldTiltX) < 3) && + (ABS(tilt_y - priv->oldTiltY) < 3)) { + DBG(10, ErrorF("filtered\n")); + continue; + } for (idx=0; idx<common->wcmNumDevices; idx++) { - WacomDevicePtr dev; - int id; - - dev = common->wcmDevices[idx]->private; + WacomDevicePtr dev = common->wcmDevices[idx]->private; + int id; + id = DEVICE_ID (dev->flags); /* Find the device the current events are meant for */ - if (id == device) { + if (id == common->wcmIndex) { xf86WcmSendEvents(common->wcmDevices[idx], - device, + common->wcmIndex, serial, - (device == STYLUS_ID || device == ERASER_ID), + (common->wcmIndex == STYLUS_ID || common->wcmIndex == ERASER_ID), !!(buttons), is_proximity, x, y, pressure, buttons, @@ -2243,7 +2242,11 @@ xf86WcmReadUSBInput(LocalDevicePtr local) priv->oldZ = pressure; priv->oldTiltX = tilt_x; priv->oldTiltY = tilt_y; - } + priv->oldProximity = is_proximity; + priv->oldButtons = buttons; + priv->oldWheel = wheel; + common->wcmLastSerial = serial; + } } /* @@ -2260,7 +2263,11 @@ xf86WcmUSBOpen(LocalDevicePtr local) WacomDevicePtr priv = (WacomDevicePtr)local->private; WacomCommonPtr common = priv->common; +#ifdef XFREE86_V4 + local->fd = xf86OpenSerial(local->options); +#else SYSCALL(local->fd = open(common->wcmDevice, O_RDONLY|O_NDELAY, 0)); +#endif if (local->fd == -1) { ErrorF("Error opening %s : %s\n", common->wcmDevice, strerror(errno)); return !Success; @@ -2551,7 +2558,7 @@ xf86WcmOpen(LocalDevicePtr local) * config header don't use buffer+xx because the header size * varies on different tablets */ - if (sscanf(buffer, "%[^,],%d,%d,%d,%d", &header, &a, &b, &common->wcmResolX, &common->wcmResolY) == 5) { + if (sscanf(buffer, "%[^,],%d,%d,%d,%d", header, &a, &b, &common->wcmResolX, &common->wcmResolY) == 5) { DBG(6, ErrorF("WC_CONFIG Header = %s\n", header)); } else { @@ -2603,7 +2610,7 @@ xf86WcmOpen(LocalDevicePtr local) * config header don't use buffer+xx because the header size * varies on different tablets */ - if (sscanf(buffer, "%[^,],%d,%d,%d,%d", &header, &a, &b, &common->wcmResolX, &common->wcmResolY) == 5) { + if (sscanf(buffer, "%[^,],%d,%d,%d,%d", header, &a, &b, &common->wcmResolX, &common->wcmResolY) == 5) { DBG(6, ErrorF("WC_CONFIG Header = %s\n", header)); } else { @@ -3180,16 +3187,9 @@ static LocalDevicePtr xf86WcmAllocate(char * name, int flag) { -#ifdef XFREE86_V4 - LocalDevicePtr local = xf86AllocateInput(wcmDrv, 0); -#else - LocalDevicePtr local = (LocalDevicePtr) xalloc(sizeof(LocalDeviceRec)); -#endif - WacomDevicePtr priv = (WacomDevicePtr) xalloc(sizeof(WacomDeviceRec)); - WacomCommonPtr common = (WacomCommonPtr) xalloc(sizeof(WacomCommonRec)); -#if defined(sun) && !defined(i386) - char *dev_name = (char *) getenv("WACOM_DEV"); -#endif + LocalDevicePtr local; + WacomDevicePtr priv; + WacomCommonPtr common; priv = (WacomDevicePtr) xalloc(sizeof(WacomDeviceRec)); if (!priv) @@ -3214,11 +3214,6 @@ xf86WcmAllocate(char * name, local->name = name; local->flags = 0; -#ifndef XFREE86_V4 -#if !defined(sun) || defined(i386) - local->device_config = xf86WcmConfig; -#endif -#endif local->device_control = xf86WcmProc; local->read_input = xf86WcmReadInput; local->control_proc = xf86WcmChangeControl; @@ -3255,13 +3250,6 @@ xf86WcmAllocate(char * name, priv->initNumber = 0; /* magic number for the init phasis */ common->wcmDevice = ""; /* device file name */ -#if defined(sun) && !defined(i386) - if (dev_name) { - common->wcmDevice = (char*) xalloc(strlen(dev_name)+1); - strcpy(common->wcmDevice, dev_name); - ErrorF("xf86WcmOpen port changed to '%s'\n", common->wcmDevice); - } -#endif common->wcmSuppress = -1; /* transmit position if increment is superior */ common->wcmFlags = 0; /* various flags */ common->wcmDevices = (LocalDevicePtr*) xalloc(sizeof(LocalDevicePtr)); @@ -3282,7 +3270,8 @@ xf86WcmAllocate(char * name, common->wcmThreshold = INVALID_THRESHOLD; /* button 1 threshold for some tablet models */ common->wcmInitNumber = 0; /* magic number for the init phasis */ common->wcmLinkSpeed = 9600; /* serial link speed */ - common->wcmOpen = xf86WcmOpen; /* function used to open the line (serial or USB) */ + common->wcmOpen = xf86WcmOpen; /* function used to open the line (serial or USB) */ + common->wcmLastSerial = 0; /* last device (used by the USB part) */ return local; } diff --git a/xc/programs/Xserver/hw/xfree86/int10/Imakefile b/xc/programs/Xserver/hw/xfree86/int10/Imakefile index 1664f33a6..bac5ad834 100644 --- a/xc/programs/Xserver/hw/xfree86/int10/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/int10/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/int10/Imakefile,v 1.12 2000/11/14 00:11:21 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/int10/Imakefile,v 1.13 2000/12/07 15:43:45 tsi Exp $ /* An OS-independent INT10 module/library */ @@ -37,8 +37,8 @@ X86EMUDEFINES = -D__DRIVER__ -DFORCE_POST -D_CEXPORT= -DNO_LONG_LONG # if defined(i386Architecture) ARCHDEFINES = -D_PC -# elif defined(ia64Architecture) -ARCHDEFINES = -D_PC_IO -DPC_PCI +# elif defined(ia64Architecture) +ARCHDEFINES = -D_PC_IO -D_PC_PCI # endif INT10DEFINES = -D_X86EMU $(ARCHDEFINES) diff --git a/xc/programs/Xserver/hw/xfree86/int10/helper_exec.c b/xc/programs/Xserver/hw/xfree86/int10/helper_exec.c index 94f13a65f..7db309a7c 100644 --- a/xc/programs/Xserver/hw/xfree86/int10/helper_exec.c +++ b/xc/programs/Xserver/hw/xfree86/int10/helper_exec.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_exec.c,v 1.10 2000/11/18 19:37:14 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_exec.c,v 1.11 2000/12/06 15:35:26 eich Exp $ */ /* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment @@ -16,6 +16,7 @@ */ #include "xf86.h" #include "xf86str.h" +#include "xf86_OSproc.h" #include "xf86_ansic.h" #include "compiler.h" #include "xf86Pci.h" @@ -30,7 +31,7 @@ static int pciCfg1out(CARD16 addr, CARD32 val); #define REG pInt -void +int setup_int(xf86Int10InfoPtr pInt) { if (pInt != Int10Current) { @@ -53,12 +54,14 @@ setup_int(xf86Int10InfoPtr pInt) X86_FS = 0; X86_GS = 0; X86_EFLAGS = (X86_IF_MASK | X86_IOPL_MASK); - + + return xf86BlockSIGIO(); } void -finish_int(xf86Int10InfoPtr pInt) +finish_int(xf86Int10InfoPtr pInt, int sig) { + xf86UnblockSIGIO(sig); pInt->ax = (CARD16) X86_EAX; pInt->bx = (CARD16) X86_EBX; pInt->cx = (CARD16) X86_ECX; diff --git a/xc/programs/Xserver/hw/xfree86/int10/xf86int10.h b/xc/programs/Xserver/hw/xfree86/int10/xf86int10.h index 3dbdf098b..3b7aea634 100644 --- a/xc/programs/Xserver/hw/xfree86/int10/xf86int10.h +++ b/xc/programs/Xserver/hw/xfree86/int10/xf86int10.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.h,v 1.13 2000/11/21 23:10:38 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.h,v 1.15 2000/12/06 18:08:55 eich Exp $ */ /* * XFree86 int10 module @@ -66,7 +66,7 @@ void xf86ExecX86int10(xf86Int10InfoPtr pInt); #define I_S_DEFAULT_INT_VECT 0xFF065 #define SYS_SIZE 0x100000 #define SYS_BIOS 0xF0000 -#if 0 +#if 1 #define BIOS_SIZE 0x10000 #else /* a bug in DGUX requires this - let's try it */ #define BIOS_SIZE (0x10000 - 1) @@ -106,8 +106,8 @@ extern xf86Int10InfoPtr Int10Current; int int_handler(xf86Int10InfoPtr pInt); /* helper_exec.c */ -void setup_int(xf86Int10InfoPtr pInt); -void finish_int(xf86Int10InfoPtr); +int setup_int(xf86Int10InfoPtr pInt); +void finish_int(xf86Int10InfoPtr, int sig); CARD32 getIntVect(xf86Int10InfoPtr pInt,int num); int vm86_GP_fault(xf86Int10InfoPtr pInt); void pushw(xf86Int10InfoPtr pInt, CARD16 val); diff --git a/xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c b/xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c index 6b052a836..975348181 100644 --- a/xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c +++ b/xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c,v 1.8 2000/09/29 08:59:47 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c,v 1.9 2000/12/06 15:35:26 eich Exp $ */ /* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment @@ -93,13 +93,13 @@ x86emu_do_int(int num) void xf86ExecX86int10(xf86Int10InfoPtr pInt) { - setup_int(pInt); + int sig = setup_int(pInt); if (int_handler(pInt)) { X86EMU_exec(); } - finish_int(pInt); + finish_int(pInt, sig); } Bool diff --git a/xc/programs/Xserver/hw/xfree86/loader/coffloader.c b/xc/programs/Xserver/hw/xfree86/loader/coffloader.c index fd464072d..58e304ea7 100644 --- a/xc/programs/Xserver/hw/xfree86/loader/coffloader.c +++ b/xc/programs/Xserver/hw/xfree86/loader/coffloader.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.c,v 1.12 2000/11/20 22:12:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.c,v 1.14 2000/12/13 16:52:00 tsi Exp $ */ /* * @@ -47,6 +47,8 @@ #include "loader.h" #include "coffloader.h" +#define NO_COMPILER_H_EXTRAS +#include "compiler.h" /* #ifndef LDTEST #define COFFDEBUG ErrorF diff --git a/xc/programs/Xserver/hw/xfree86/loader/elfloader.c b/xc/programs/Xserver/hw/xfree86/loader/elfloader.c index b98afb81e..c3bfba0a8 100644 --- a/xc/programs/Xserver/hw/xfree86/loader/elfloader.c +++ b/xc/programs/Xserver/hw/xfree86/loader/elfloader.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.29 2000/11/20 22:12:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.31 2000/12/13 16:52:01 tsi Exp $ */ /* * @@ -46,6 +46,9 @@ #include "sym.h" #include "loader.h" +#define NO_COMPILER_H_EXTRAS +#include "compiler.h" + /* #ifndef LDTEST #define ELFDEBUG ErrorF diff --git a/xc/programs/Xserver/hw/xfree86/loader/loader.c b/xc/programs/Xserver/hw/xfree86/loader/loader.c index b4cf43d55..da84d2f25 100644 --- a/xc/programs/Xserver/hw/xfree86/loader/loader.c +++ b/xc/programs/Xserver/hw/xfree86/loader/loader.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.c,v 1.47 2000/11/13 23:09:55 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loader.c,v 1.49 2000/12/13 16:52:01 tsi Exp $ */ /* * @@ -49,6 +49,9 @@ #include "xf86.h" #include "xf86Priv.h" +#define NO_COMPILER_H_EXTRAS +#include "compiler.h" + extern LOOKUP miLookupTab[]; extern LOOKUP xfree86LookupTab[]; extern LOOKUP dixLookupTab[]; diff --git a/xc/programs/Xserver/hw/xfree86/loader/loadmod.c b/xc/programs/Xserver/hw/xfree86/loader/loadmod.c index fbc631453..cb2ff6b53 100644 --- a/xc/programs/Xserver/hw/xfree86/loader/loadmod.c +++ b/xc/programs/Xserver/hw/xfree86/loader/loadmod.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadmod.c,v 1.57 2000/11/13 23:09:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/loadmod.c,v 1.58 2000/12/13 16:52:01 tsi Exp $ */ /* * @@ -28,7 +28,7 @@ #include "os.h" /* For stat() and related stuff */ #define NO_OSLIB_PROTOTYPES -/* #define NO_COMPILER_H */ +#define NO_COMPILER_H_EXTRAS #include "xf86_OSlib.h" #if defined(SVR4) #include <sys/stat.h> diff --git a/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c b/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c index 0218e73ba..df0730da8 100644 --- a/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c +++ b/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.174 2000/12/02 01:16:25 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.178 2000/12/08 22:31:52 dawes Exp $ */ /* * @@ -54,6 +54,10 @@ #include "xf86Priv.h" #include "vbe.h" #include "xf86sbusBus.h" +#ifdef __alpha__ +/* MMIO function prototypes */ +#include "compiler.h" +#endif #ifdef __FreeBSD__ /* XXX used in drmOpen(). This should change to use a less os-specific @@ -261,6 +265,7 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(xf86GetPciConfigInfo) SYMFUNC(xf86SetPciVideo) SYMFUNC(xf86ClaimIsaSlot) + SYMFUNC(xf86ClaimFbSlot) SYMFUNC(xf86ParsePciBusString) SYMFUNC(xf86ComparePciBusString) SYMFUNC(xf86ParseIsaBusString) @@ -364,6 +369,7 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(xf86AddEnabledDevice) SYMFUNC(xf86RemoveEnabledDevice) SYMFUNC(xf86InterceptSignals) + SYMFUNC(xf86EnableVTSwitch) /* xf86Helper.c */ SYMFUNC(xf86AddDriver) @@ -432,6 +438,7 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(xf86GetOS) SYMFUNC(xf86ConfigPciEntity) SYMFUNC(xf86ConfigIsaEntity) + SYMFUNC(xf86ConfigFbEntity) SYMFUNC(xf86ConfigActivePciEntity) SYMFUNC(xf86ConfigActiveIsaEntity) SYMFUNC(xf86ConfigPciEntityInactive) diff --git a/xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib b/xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib index 16dece64a..1c610f12f 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib +++ b/xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib @@ -134,8 +134,7 @@ pointer xf86MapVidMem(int ScreenNum, int Region, pointer Base, */ } -void xf86UnMapVidMem(int ScreenNum, int Region, pointer Base, - unsigned long Size) +void xf86UnMapVidMem(int ScreenNum, pointer Base, unsigned long Size) { /* * Handle unmapping the video memory. This should undo what @@ -502,7 +501,7 @@ xf86cos(double x) -$XFree86: xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib,v 3.6 1997/08/26 10:01:33 hohndel Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/os-support/README.OS-lib,v 3.7 2000/12/09 03:31:38 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c b/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c index 376654f77..91e029a14 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c,v 1.15 2000/02/12 20:45:41 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c,v 1.17 2000/12/18 15:52:25 dawes Exp $ */ /* * Copyright 1999 by The XFree86 Project, Inc. @@ -161,11 +161,26 @@ static void SetSysMouseRes(InputInfoPtr pInfo, const char *protocol, int rate, int res) { mousemode_t mode; + MouseDevPtr pMse; + + pMse = pInfo->private; mode.rate = rate > 0 ? rate : -1; mode.resolution = res > 0 ? res : -1; mode.accelfactor = -1; +#if defined(__FreeBSD__) + if (xf86NameCmp(pMse->origProtocol, "Auto") == 0) { + /* + * As the FreeBSD sysmouse driver defaults to protocol level 0 + * everytime it is opened we enforce protocol level 1 again at + * this point. + */ + mode.level = 1; + } else + mode.level = -1; +#else mode.level = -1; +#endif ioctl(pInfo->fd, MOUSE_SETMODE, &mode); } #endif diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_video.c b/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_video.c index d5b13298e..c44b686c0 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_video.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_video.c,v 3.38 2000/11/19 16:38:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_video.c,v 3.40 2000/12/13 07:02:45 herrb Exp $ */ /* * Copyright 1992 by Rich Murphey <Rich@Rice.edu> * Copyright 1993 by David Wexelblat <dwex@goblin.org> @@ -113,6 +113,16 @@ struct memAccess ioMemInfo = { CONSOLE_GET_IO_INFO, NULL, NULL, #define MAP_FAILED ((caddr_t)-1) #endif +#ifdef __OpenBSD__ +#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\ + "\tin /etc/sysctl.conf and reboot your machine\n" \ + "\trefer to xf86(4) for details\n" +#define SECURELEVEL_MSG \ + "A card in your system needs more than the aperture driver\n" \ + "\tYou need to rebuild a kernel with \"Option INSECURE\"\n" \ + "\tand set securelevel=-1 in /etc/rc.securelevel\n" +#endif + #ifdef __alpha__ extern unsigned long dense_base(void); @@ -258,8 +268,14 @@ checkDevMem(Bool warn) } else { if (warn) { +#ifndef __OpenBSD__ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" "\t(%s)\n", DEV_MEM, DEV_APERTURE, strerror(errno)); +#else /* __OpenBSD__ */ + xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" + "\t(%s)\n%s", DEV_MEM, DEV_APERTURE, strerror(errno), + SYSCTL_MSG); +#endif /* __OpenBSD__ */ } } @@ -403,6 +419,11 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, xf86Msg(X_WARNING, "xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n", DEV_MEM, Len, Base, Offset, strerror(errno)); +#ifdef __OpenBSD__ + if (Base < 0xa0000) { + xf86Msg(X_WARNING, SECURELEVEL_MSG); + } +#endif return(-1); } #ifdef DEBUG @@ -411,7 +432,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, #endif (void)memcpy(Buf, (void *)(ptr + Offset), Len); (void)munmap((caddr_t)ptr, mlen); - xf86Msg(X_INFO, "xf86ReadBIOS(%x, %x, Buf, %x)" + xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)" "-> %02x %02x %02x %02x...\n", Base, Offset, Len, Buf[0], Buf[1], Buf[2], Buf[3]); return(Len); @@ -667,8 +688,13 @@ xf86EnableIO() if (i386_iopl(TRUE) < 0) { +#ifndef __OpenBSD__ FatalError("%s: Failed to set IOPL for extended I/O\n", "xf86EnableIO"); +#else + FatalError("%s: Failed to set IOPL for extended I/O\n%s", + "xf86EnableIO", SYSCTL_MSG); +#endif } ExtendedEnabled = TRUE; @@ -816,23 +842,6 @@ xf86EnableInterrupts() return; } -/************************************************************************/ -/* This is required for the loader */ -/************************************************************************/ -#if defined(__powerpc__) -void -ppc_flush_icache(char *addr) -{ - __asm__ volatile ( - "dcbf 0,%0;" - "sync;" - "icbi 0,%0;" - "sync;" - "isync;" - : : "r"(addr) : "memory"); -} -#endif - #ifdef __NetBSD__ /***************************************************************************/ diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c b/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c index b25c3041e..4d600aaf9 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c,v 1.40 2000/11/18 19:37:22 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c,v 1.42 2000/12/07 15:43:45 tsi Exp $ */ /* * Pci.c - New server PCI access functions * @@ -1066,27 +1066,37 @@ readPciBIOS(unsigned long Offset, PCITAG Tag, int basereg, */ romsave = pciReadLong(Tag, PCI_MAP_ROM_REG); romaddr = PCIGETROM(romsave); - if ((newbase = getValidBIOSBase(Tag,basereg)) != romaddr) { + if ((newbase = getValidBIOSBase(Tag, &basereg)) != romaddr) { romaddr = PCIGETROM(newbase); if (romaddr != 0 && romaddr == newbase) { #if 1 + /* move mem base out of the way if in conflict with ROM */ if ((basereg >= 0) && (basereg <= 5)) { - savebase = pciReadLong(Tag, PCI_MAP_REG_START + (basereg << 2)); - if (PCIGETROM(savebase) == romaddr) + savebase = pciReadLong(Tag, PCI_MAP_REG_START + (basereg << 2)); + if (PCIGETROM(savebase) == romaddr) { + xf86MsgVerb(X_INFO,5,"xf86ReadPciBios: modifying membase[%i]" + " for device %i:%i:%i\n", basereg, + PCI_BUS_FROM_TAG(Tag), PCI_DEV_FROM_TAG(Tag), + PCI_FUNC_FROM_TAG(Tag)); pciWriteLong(Tag, PCI_MAP_REG_START + (basereg << 2), 0); + } } #endif pciWriteLong(Tag, PCI_MAP_ROM_REG, romaddr); } else romaddr = 0; } -#ifdef DEBUG - ErrorF("ValidBIOSBase: %x\n",newbase); -#endif + + if (romaddr == 0) { xf86Msg(X_WARNING, "xf86ReadPciBIOS: cannot locate a BIOS address\n"); return -1; - } + } + else + xf86MsgVerb(X_INFO,5,"xf86ReadPciBIOS: found ValidBIOSBase for %i:%i:%i:" + " %x\n", PCI_BUS_FROM_TAG(Tag), PCI_DEV_FROM_TAG(Tag), + PCI_FUNC_FROM_TAG(Tag),newbase); + hostbase = pciBusAddrToHostAddr(Tag, PCI_MEM, PCIGETROM(romaddr)); #ifdef DEBUG ErrorF("ReadPciBIOS: base = 0x%x\n",romaddr); @@ -1119,7 +1129,7 @@ xf86ReadPciBIOS(unsigned long Offset, PCITAG Tag, int basereg, size = readPciBIOS(Offset,Tag,basereg,Buf,Len); - if (Buf[0] == 0x55 && Buf[1] == 0xaa) + if (size != -1 && Buf[0] == 0x55 && Buf[1] == 0xaa) return size; num = pciTestMultiDeviceCard(PCI_BUS_FROM_TAG(Tag), @@ -1139,7 +1149,7 @@ xf86ReadPciBIOS(unsigned long Offset, PCITAG Tag, int basereg, PCI_CMD_STAT_REG,(Acc2 | PCI_ENA)); size = readPciBIOS(Offset,pTag[i],0,Buf,Len); ((WriteProcPtr)(pciLongFunc(pTag[i],WRITE)))(pTag[i],PCI_CMD_STAT_REG,Acc2); - if (((CARD8*)Buf)[0] == 0x55 && ((CARD8*)Buf)[1] == 0xaa) + if (size != -1 && ((CARD8*)Buf)[0] == 0x55 && ((CARD8*)Buf)[1] == 0xaa) break; } ((WriteProcPtr)(pciLongFunc(Tag,WRITE)))(Tag,PCI_CMD_STAT_REG,Acc1); diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_cce.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_cce.c index 0b1576a90..d978d53e1 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_cce.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_cce.c @@ -114,7 +114,7 @@ int R128_READ_PLL(drm_device_t *dev, int addr) return R128_READ(R128_CLOCK_CNTL_DATA); } - +#if 0 static void r128_status( drm_r128_private_t *dev_priv ) { printk( "GUI_STAT = 0x%08x\n", @@ -130,6 +130,7 @@ static void r128_status( drm_r128_private_t *dev_priv ) printk( "PM4_BUFFER_CNTL = 0x%08x\n", (unsigned int)R128_READ( R128_PM4_BUFFER_CNTL ) ); } +#endif /* ================================================================ @@ -701,6 +702,7 @@ int r128_engine_reset( struct inode *inode, struct file *filp, #define R128_BUFFER_USED 0xffffffff #define R128_BUFFER_FREE 0 +#if 0 static int r128_freelist_init( drm_device_t *dev ) { drm_device_dma_t *dma = dev->dma; @@ -746,6 +748,7 @@ static int r128_freelist_init( drm_device_t *dev ) return 0; } +#endif drm_buf_t *r128_freelist_get( drm_device_t *dev ) { @@ -834,6 +837,7 @@ void r128_update_ring_snapshot( drm_r128_private_t *dev_priv ) ring->space += ring->size; } +#if 0 static int r128_verify_command( drm_r128_private_t *dev_priv, u32 cmd, int *size ) { @@ -974,6 +978,7 @@ static int r128_submit_packet_ring_insecure( drm_r128_private_t *dev_priv, #endif return 0; } +#endif /* Internal packet submission routine. This uses the insecure versions * of the packet submission functions, and thus should only be used for diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drm.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drm.h index b81d2fca2..68a55d5dc 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drm.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drm.h @@ -219,8 +219,6 @@ typedef struct drm_r128_clear { int x, y, w, h; unsigned int clear_color; unsigned int clear_depth; - unsigned int color_mask; - unsigned int depth_mask; } drm_r128_clear_t; typedef struct drm_r128_vertex { diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c index 89b68696e..dbfc9b740 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_drv.c @@ -37,10 +37,10 @@ #define R128_NAME "r128" #define R128_DESC "ATI Rage 128" -#define R128_DATE "20001201" +#define R128_DATE "20001215" #define R128_MAJOR 2 #define R128_MINOR 1 -#define R128_PATCHLEVEL 0 +#define R128_PATCHLEVEL 2 static drm_device_t r128_device; drm_ctx_t r128_res_ctx; diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_state.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_state.c index faad25a2d..3f52c14b3 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_state.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/r128_state.c @@ -297,10 +297,11 @@ static void r128_clear_box( drm_r128_private_t *dev_priv, color = ((r << 16) | (g << 8) | b); break; case 32: - default: fb_bpp = R128_GMC_DST_32BPP; color = (((0xff) << 24) | (r << 16) | (g << 8) | b); break; + default: + return; } offset = dev_priv->back_offset; @@ -362,9 +363,7 @@ static void r128_cce_dispatch_clear( drm_device_t *dev, unsigned int flags, int cx, int cy, int cw, int ch, unsigned int clear_color, - unsigned int clear_depth, - unsigned int color_mask, - unsigned int depth_mask ) + unsigned int clear_depth ) { drm_r128_private_t *dev_priv = dev->dev_private; drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; @@ -381,21 +380,17 @@ static void r128_cce_dispatch_clear( drm_device_t *dev, case 16: fb_bpp = R128_GMC_DST_16BPP; break; - case 24: - fb_bpp = R128_GMC_DST_24BPP; - break; case 32: - default: fb_bpp = R128_GMC_DST_32BPP; break; + default: + return; } switch ( dev_priv->depth_bpp ) { case 16: depth_bpp = R128_GMC_DST_16BPP; break; case 24: - depth_bpp = R128_GMC_DST_32BPP; - break; case 32: depth_bpp = R128_GMC_DST_32BPP; break; @@ -417,7 +412,7 @@ static void r128_cce_dispatch_clear( drm_device_t *dev, BEGIN_RING( 2 ); OUT_RING( CCE_PACKET0( R128_DP_WRITE_MASK, 0 ) ); - OUT_RING( color_mask ); + OUT_RING( sarea_priv->context_state.plane_3d_mask_c ); ADVANCE_RING(); } @@ -465,10 +460,7 @@ static void r128_cce_dispatch_clear( drm_device_t *dev, } if ( flags & R128_DEPTH ) { - BEGIN_RING( 8 ); - - OUT_RING( CCE_PACKET0( R128_DP_WRITE_MASK, 0 ) ); - OUT_RING( depth_mask ); + BEGIN_RING( 6 ); OUT_RING( CCE_PACKET3( R128_CNTL_PAINT_MULTI, 4 ) ); OUT_RING( R128_GMC_DST_PITCH_OFFSET_CNTL @@ -477,7 +469,8 @@ static void r128_cce_dispatch_clear( drm_device_t *dev, | R128_GMC_SRC_DATATYPE_COLOR | R128_ROP3_P | R128_GMC_CLR_CMP_CNTL_DIS - | R128_GMC_AUX_CLIP_DIS ); + | R128_GMC_AUX_CLIP_DIS + | R128_GMC_WR_MSK_DIS ); OUT_RING( dev_priv->depth_pitch_offset_c ); OUT_RING( clear_depth ); @@ -513,9 +506,6 @@ static void r128_cce_dispatch_swap( drm_device_t *dev ) case 16: fb_bpp = R128_GMC_DST_16BPP; break; - case 24: - fb_bpp = R128_GMC_DST_24BPP; - break; case 32: default: fb_bpp = R128_GMC_DST_32BPP; @@ -542,21 +532,12 @@ static void r128_cce_dispatch_swap( drm_device_t *dev ) | R128_GMC_AUX_CLIP_DIS | R128_GMC_WR_MSK_DIS ); -#if 1 OUT_RING( dev_priv->back_pitch_offset_c ); OUT_RING( dev_priv->front_pitch_offset_c ); OUT_RING( (x << 16) | y ); OUT_RING( (x << 16) | y ); OUT_RING( (w << 16) | h ); -#else - OUT_RING( dev_priv->depth_pitch_offset_c /*& ~R128_DST_TILE*/ ); - OUT_RING( dev_priv->front_pitch_offset_c ); - - OUT_RING( (0 << 16) | 0 ); - OUT_RING( (0 << 16) | 0 ); - OUT_RING( (800 << 16) | 600 ); -#endif ADVANCE_RING(); } @@ -925,6 +906,9 @@ static int r128_cce_dispatch_blit( drm_device_t *dev, /* ================================================================ * Tiled depth buffer management + * + * FIXME: These should all set the destination write mask for when we + * have hardware stencil support. */ static int r128_cce_dispatch_write_span( drm_device_t *dev, @@ -946,8 +930,6 @@ static int r128_cce_dispatch_write_span( drm_device_t *dev, depth_bpp = R128_GMC_DST_16BPP; break; case 24: - depth_bpp = R128_GMC_DST_32BPP; - break; case 32: depth_bpp = R128_GMC_DST_32BPP; break; @@ -1057,8 +1039,6 @@ static int r128_cce_dispatch_write_pixels( drm_device_t *dev, depth_bpp = R128_GMC_DST_16BPP; break; case 24: - depth_bpp = R128_GMC_DST_32BPP; - break; case 32: depth_bpp = R128_GMC_DST_32BPP; break; @@ -1190,8 +1170,6 @@ static int r128_cce_dispatch_read_span( drm_device_t *dev, depth_bpp = R128_GMC_DST_16BPP; break; case 24: - depth_bpp = R128_GMC_DST_32BPP; - break; case 32: depth_bpp = R128_GMC_DST_32BPP; break; @@ -1249,8 +1227,6 @@ static int r128_cce_dispatch_read_pixels( drm_device_t *dev, depth_bpp = R128_GMC_DST_16BPP; break; case 24: - depth_bpp = R128_GMC_DST_32BPP; - break; case 32: depth_bpp = R128_GMC_DST_32BPP; break; @@ -1367,8 +1343,7 @@ int r128_cce_clear( struct inode *inode, struct file *filp, r128_cce_dispatch_clear( dev, clear.flags, clear.x, clear.y, clear.w, clear.h, - clear.clear_color, clear.clear_depth, - clear.color_mask, clear.depth_mask ); + clear.clear_color, clear.clear_depth ); /* Make sure we restore the 3D state next time. */ diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c index b40299e4a..e1c8134f8 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c @@ -26,7 +26,7 @@ * Author: Kevin E. Martin <martin@valinux.com> * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c,v 1.5 2000/12/04 19:21:54 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c,v 1.6 2000/12/12 17:17:14 dawes Exp $ */ #ifdef XFree86Server # include "xf86.h" @@ -219,8 +219,8 @@ int drmR128SwapBuffers( int fd ) int drmR128Clear( int fd, unsigned int flags, int x, int y, int w, int h, - unsigned int clear_color, unsigned int clear_depth, - unsigned int color_mask, unsigned int depth_mask ) + unsigned int clear_color, + unsigned int clear_depth ) { drm_r128_clear_t clear; @@ -231,8 +231,6 @@ int drmR128Clear( int fd, unsigned int flags, clear.h = h; clear.clear_color = clear_color; clear.clear_depth = clear_depth; - clear.color_mask = color_mask; - clear.depth_mask = depth_mask; if ( ioctl( fd, DRM_IOCTL_R128_CLEAR, &clear ) < 0 ) { return -errno; diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c index ea0e96190..c8aa428f6 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c,v 1.18 2000/11/21 23:10:40 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c,v 1.19 2000/12/06 15:35:31 eich Exp $ */ /* * linux specific part of the int10 module * Copyright 1999 Egbert Eich @@ -426,12 +426,12 @@ do_vm86(xf86Int10InfoPtr pInt) void xf86ExecX86int10(xf86Int10InfoPtr pInt) { - setup_int(pInt); + int sig = setup_int(pInt); if (int_handler(pInt)) while(do_vm86(pInt)) {}; - finish_int(pInt); + finish_int(pInt,sig); } static int diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_apm.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_apm.c index 03bff4aad..4d2a62707 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_apm.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_apm.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_apm.c,v 3.8 2000/12/01 17:43:07 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_apm.c,v 3.9 2000/12/08 20:13:37 eich Exp $ */ #include "X.h" #include "os.h" @@ -121,8 +121,10 @@ xf86OSPMOpen(void) if (APMihPtr || !xf86Info.pmFlag) return NULL; - if (access( APM_PROC, R_OK ) || ((fd = open( APM_PROC, O_RDONLY)) == -1)) + if (access( APM_PROC, R_OK ) || ((fd = open( APM_PROC, O_RDONLY)) == -1)) { + xf86MsgVerb(X_WARNING,3,"Cannot open APM\n"); return NULL; + } close( fd ); #ifdef DEBUG ErrorF("APM: Opening device\n"); @@ -131,8 +133,10 @@ xf86OSPMOpen(void) xf86PMGetEventFromOs = lnxPMGetEventFromOs; xf86PMConfirmEventToOs = lnxPMConfirmEventToOs; APMihPtr = xf86AddInputHandler(fd,xf86HandlePMEvents,NULL); + xf86MsgVerb(X_INFO,3,"Open APM successful\n"); return lnxCloseAPM; } + xf86MsgVerb(X_WARNING,3,"Open APM failed\n"); return NULL; } diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c index 673591460..dec8fe5b2 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c,v 3.42 2000/12/01 08:56:02 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c,v 3.44 2000/12/06 18:08:55 eich Exp $ */ /* * Copyright 1992 by Orest Zborowski <obz@Kodak.com> * Copyright 1993 by David Wexelblat <dwex@goblin.org> @@ -69,7 +69,7 @@ extern void sethae(unsigned long hae); # define isJensen (axpSystem == JENSEN) # endif -# define BUS_BASE _bus_base() +# define BUS_BASE bus_base #else @@ -421,17 +421,6 @@ unmapVidMem(int ScreenNum, pointer Base, unsigned long Size) /* FIXME: init this... */ volatile unsigned char *ioBase = MAP_FAILED; -void -ppc_flush_icache(char *addr) -{ - __asm__ volatile ( - "dcbf 0,%0;" - "sync;" - "icbi 0,%0;" - "sync;" - "isync;" - : : "r"(addr) : "memory"); -} #endif void diff --git a/xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c b/xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c index 32b1b4650..7d5dad40b 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c,v 3.2 2000/11/16 19:45:04 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c,v 3.3 2000/12/08 20:13:38 eich Exp $ */ #include "X.h" #include "xf86.h" @@ -14,12 +14,13 @@ xf86UDelay(long usec) struct timeval start, interrupt; #else int sigio; - + sigio = xf86BlockSIGIO(); xf86usleep(usec); xf86UnblockSIGIO(sigio); #endif -#if 0 + +#if 0 gettimeofday(&start,NULL); do { @@ -29,7 +30,7 @@ xf86UDelay(long usec) if ((usec = usec - (interrupt.tv_sec - start.tv_sec) * 1000000 - (interrupt.tv_usec - start.tv_usec)) < 0) break; - + start = interrupt; } while (1); #endif } diff --git a/xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile b/xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile index 8ae037e55..dc7af59b0 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile,v 3.10 2000/08/15 16:05:39 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sco/Imakefile,v 3.11 2000/12/13 18:38:05 robin Exp $ @@ -8,12 +8,12 @@ XCOMM $XConsortium: Imakefile /main/4 1996/09/28 17:24:25 rws $ #include <Server.tmpl> SRCS = sco_init.c sco_video.c sco_io.c bios_devmem.c VTsw_sco.c \ - sysv_kbd.c std_kbdEv.c sysv_tty.c std_mseEv.c sco_mouse.c \ + sysv_kbd.c std_kbdEv.c sysv_tty.c sco_mouse.c \ libc_wrapper.c stdResource.c stdPci.o sigiostubs.c pm_noop.c \ kmod_noop.c agp_noop.c OBJS = sco_init.o sco_video.o sco_io.o bios_devmem.o VTsw_sco.o \ - sysv_kbd.o std_kbdEv.o sysv_tty.o std_mseEv.o sco_mouse.o \ + sysv_kbd.o std_kbdEv.o sysv_tty.o sco_mouse.o \ libc_wrapper.o stdResource.o stdPci.o sigiostubs.o pm_noop.o \ kmod_noop.o agp_noop.o @@ -31,7 +31,6 @@ LinkSourceFile(bios_devmem.c,../shared) LinkSourceFile(sysv_kbd.c,../shared) LinkSourceFile(std_kbdEv.c,../shared) LinkSourceFile(sysv_tty.c,../shared) -LinkSourceFile(std_mseEv.c,../shared) LinkSourceFile(libc_wrapper.c,../shared) LinkSourceFile(stdResource.c,../shared) LinkSourceFile(stdPci.c,../shared) diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c index 9a7a85a31..b1a61e362 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c,v 1.70 2000/09/26 15:57:20 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c,v 1.71 2000/12/06 20:39:54 dawes Exp $ */ /* * Copyright 1997 by The XFree86 Project, Inc. * @@ -82,6 +82,7 @@ extern int mmapFd; #endif #define NEED_XF86_TYPES +#define NEED_XF86_PROTOTYPES #define DONT_DEFINE_WRAPPERS #include "xf86_ansic.h" diff --git a/xc/programs/Xserver/hw/xfree86/os-support/sol8_x86/sol8_keynames.h b/xc/programs/Xserver/hw/xfree86/os-support/sol8_x86/sol8_keynames.h index 941d350e1..40095aa87 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/sol8_x86/sol8_keynames.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/sol8_x86/sol8_keynames.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sol8_x86/sol8_keynames.h,v 1.4 2000/12/05 00:32:04 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/sol8_x86/sol8_keynames.h,v 1.8 2000/12/18 02:25:58 dawes Exp $ */ #ifndef _SOL8KEYNAMES_H #define _SOL8KEYNAMES_H @@ -22,7 +22,7 @@ unsigned char sol8map[256] = { KEY_0, /* 11 */ KEY_Minus, /* 12 */ KEY_Equal, /* 13 */ - KEY_UNKNOWN, /* 14 */ + 0x7D, /*KEY_P_YEN*/ /* 14 */ KEY_BackSpace, /* 15 */ KEY_Tab, /* 16 */ KEY_Q, /* 17 */ @@ -53,7 +53,7 @@ unsigned char sol8map[256] = { KEY_UNKNOWN, /* 42 */ KEY_Enter, /* 43 */ KEY_ShiftL, /* 44 */ - KEY_BSlash, /* 45 */ + KEY_Less, /* 45 */ KEY_Z, /* 46 */ KEY_X, /* 47 */ KEY_C, /* 48 */ @@ -64,7 +64,7 @@ unsigned char sol8map[256] = { KEY_Comma, /* 53 */ KEY_Period, /* 54 */ KEY_Slash, /* 55 */ - KEY_UNKNOWN, /* 56 */ + 0x73, /*KEY_P_BKSL*/ /* 56 */ KEY_ShiftR, /* 57 */ KEY_LCtrl, /* 58 */ KEY_LMeta, /* 59 */ @@ -136,6 +136,14 @@ unsigned char sol8map[256] = { KEY_ScrollLock, /* 125 */ KEY_Pause, /* 126 */ KEY_UNKNOWN, /* 127 */ + KEY_UNKNOWN, /* 128 */ + KEY_UNKNOWN, /* 129 */ + KEY_UNKNOWN, /* 130 */ + 0x7B, /*KEY_P_NFER*/ /* 131 */ + 0x79, /*KEY_P_XFER*/ /* 132 */ + 0x70, /*KEY_HKTG*/ /* 133 */ + KEY_UNKNOWN, /* 134 */ + /* The rest default to KEY_UNKNOWN */ }; #endif diff --git a/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c b/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c index 0b32b0218..2559b2799 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c,v 1.13 2000/10/12 11:19:41 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c,v 1.14 2000/12/06 15:35:32 eich Exp $ */ #include "xf86.h" #include "xf86_ansic.h" @@ -238,18 +238,22 @@ vbeReadEDID(vbeInfoPtr pVbe) xf86ExecX86int10(pVbe->pInt10); - if ((pVbe->pInt10->ax & 0xff) != 0x4f) + if ((pVbe->pInt10->ax & 0xff) != 0x4f) { + xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC invalid\n"); goto error; + } switch (pVbe->pInt10->ax & 0xff00) { - case 0: + case 0x0: xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC read successfully\n"); tmp = (unsigned char *)xnfalloc(128); memcpy(tmp,page,128); break; - case 1: + case 0x100: xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC read failed\n"); break; default: + xf86DrvMsgVerb(screen,X_INFO,3,"VESA VBE DDC unkown failure %i\n", + pVbe->pInt10->ax & 0xff00); break; } diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h index cc5966497..d1d7c14b5 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h,v 1.11 2000/10/24 18:07:51 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86OSmouse.h,v 1.12 2000/12/18 15:52:25 dawes Exp $ */ /* * Copyright (c) 1997-1999 by The XFree86 Project, Inc. @@ -136,6 +136,7 @@ typedef struct _MouseDevRec { pointer mousePriv; /* private area */ InputInfoPtr pInfo; int origProtocolID; + const char * origProtocol; } MouseDevRec, *MouseDevPtr; /* Z axis mapping */ diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h index ef7a81ab2..8dda78810 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h @@ -64,7 +64,7 @@ * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.48 2000/11/21 23:10:40 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.49 2000/12/07 15:43:45 tsi Exp $ */ #ifndef _XF86_OSPROC_H #define _XF86_OSPROC_H @@ -195,16 +195,6 @@ extern Bool xf86UnbindGARTMemory(int screenNum, int key); extern Bool xf86EnableAGP(int screenNum, CARD32 mode); #if defined(__alpha__) -/* entry points for Mmio memory access routines */ -extern int (*xf86ReadMmio8)(pointer, unsigned long); -extern int (*xf86ReadMmio16)(pointer, unsigned long); -extern int (*xf86ReadMmio32)(pointer, unsigned long); -extern void (*xf86WriteMmio8)(int, pointer, unsigned long); -extern void (*xf86WriteMmio16)(int, pointer, unsigned long); -extern void (*xf86WriteMmio32)(int, pointer, unsigned long); -extern void (*xf86WriteMmioNB8)(int, pointer, unsigned long); -extern void (*xf86WriteMmioNB16)(int, pointer, unsigned long); -extern void (*xf86WriteMmioNB32)(int, pointer, unsigned long); extern void xf86JensenMemToBus(char *, long, long, int); extern void xf86JensenBusToMem(char *, char *, unsigned long, int); extern void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int); diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h index 58c86a106..7d3b9a804 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h @@ -22,7 +22,7 @@ * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.43 2000/10/24 22:45:10 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.44 2000/12/06 20:39:53 dawes Exp $ */ #ifndef _XF86_ANSIC_H #define _XF86_ANSIC_H @@ -133,6 +133,9 @@ #define MAXLONG LONG_MAX #endif +#endif /* XFree86LOADER || NEED_XF86_TYPES */ + +#if defined(XFree86LOADER) || defined(NEED_XF86_PROTOTYPES) /* * ANSI C compilers only. */ @@ -304,7 +307,7 @@ extern int xf86shmctl(int id, int xf86cmd, pointer *buf); extern int xf86setjmp(xf86jmp_buf env); extern void xf86longjmp(xf86jmp_buf env, int val); -#else /* XFree86LOADER || NEED_XF86_TYPES */ +#else /* XFree86LOADER || NEED_XF86_PROTOTYPES */ #include <unistd.h> #include <stdio.h> #include <sys/ioctl.h> @@ -315,7 +318,7 @@ extern void xf86longjmp(xf86jmp_buf env, int val); #include <sys/ipc.h> #include <sys/shm.h> #endif -#endif /* XFree86LOADER NEED_XF86_TYPES */ +#endif /* XFree86LOADER || NEED_XF86_PROTOTYPES */ /* * These things are always required by drivers (but not by libc_wrapper.c), diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h index 1e2823c17..8d799f152 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h @@ -25,7 +25,7 @@ * * Author: Kevin E. Martin <kevin@precisioninsight.com> * - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h,v 3.3 2000/12/04 21:04:47 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drmR128.h,v 3.5 2000/12/12 17:17:13 dawes Exp $ * */ @@ -79,15 +79,15 @@ extern int drmR128EngineReset( int fd ); extern int drmR128SwapBuffers( int fd ); extern int drmR128Clear( int fd, unsigned int flags, int x, int y, int w, int h, - unsigned int clear_color, unsigned int clear_depth, - unsigned int color_mask, unsigned int depth_mask ); + unsigned int clear_color, + unsigned int clear_depth ); -extern int drmR128FlushVertexBuffer( int fd, int prim, int index, +extern int drmR128FlushVertexBuffer( int fd, int prim, int indx, int count, int discard ); -extern int drmR128FlushIndices( int fd, int prim, int index, +extern int drmR128FlushIndices( int fd, int prim, int indx, int start, int end, int discard ); -extern int drmR128TextureBlit( int fd, int index, +extern int drmR128TextureBlit( int fd, int indx, int offset, int pitch, int format, int x, int y, int width, int height ); diff --git a/xc/programs/Xserver/hw/xfree86/parser/Monitor.c b/xc/programs/Xserver/hw/xfree86/parser/Monitor.c index 9009cc231..339ddf9ba 100644 --- a/xc/programs/Xserver/hw/xfree86/parser/Monitor.c +++ b/xc/programs/Xserver/hw/xfree86/parser/Monitor.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Monitor.c,v 1.17 2000/11/15 00:22:27 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/Monitor.c,v 1.18 2000/12/05 19:06:53 paulo Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -424,83 +424,71 @@ xf86parseMonitorSection (void) case HORIZSYNC: if (xf86getToken (NULL) != NUMBER) Error (HORIZSYNC_MSG, NULL); - ptr->mon_hsync[ptr->mon_n_hsync].lo = val.realnum; - if (xf86getToken (NULL) == DASH) - { - if (xf86getToken (NULL) != NUMBER) - Error (HORIZSYNC_MSG, NULL); - ptr->mon_hsync[ptr->mon_n_hsync].hi = val.realnum; - } - else - { - xf86unGetToken (token); - ptr->mon_hsync[ptr->mon_n_hsync].hi = - ptr->mon_hsync[ptr->mon_n_hsync].lo; - } - ptr->mon_n_hsync++; - while ((token = xf86getToken (NULL)) == COMMA) - { - if (ptr->mon_n_hsync == CONF_MAX_HSYNC) - Error ("Sorry. Too many horizontal sync intervals.", NULL); - if (xf86getToken (NULL) != NUMBER) - Error (HORIZSYNC_MSG, NULL); + do { ptr->mon_hsync[ptr->mon_n_hsync].lo = val.realnum; - if (xf86getToken (NULL) == DASH) + switch (token = xf86getToken (NULL)) { - if (xf86getToken (NULL) != NUMBER) - Error (HORIZSYNC_MSG, NULL); - ptr->mon_hsync[ptr->mon_n_hsync].hi = val.realnum; - } - else - { - xf86unGetToken (token); - ptr->mon_hsync[ptr->mon_n_hsync].hi = + case COMMA: + ptr->mon_hsync[ptr->mon_n_hsync].hi = ptr->mon_hsync[ptr->mon_n_hsync].lo; + break; + case DASH: + if (xf86getToken (NULL) != NUMBER || + val.realnum < ptr->mon_hsync[ptr->mon_n_hsync].lo) + Error (HORIZSYNC_MSG, NULL); + ptr->mon_hsync[ptr->mon_n_hsync].hi = val.realnum; + break; + default: + /* We cannot currently know if a '\n' was found, + * or this is a real error + */ + ptr->mon_hsync[ptr->mon_n_hsync].hi = + ptr->mon_hsync[ptr->mon_n_hsync].lo; + ptr->mon_n_hsync++; + goto HorizDone; } + if (ptr->mon_n_hsync == CONF_MAX_HSYNC) + Error ("Sorry. Too many horizontal sync intervals.", NULL); ptr->mon_n_hsync++; - } + } while ((token = xf86getToken (NULL)) == NUMBER); +HorizDone: xf86unGetToken (token); break; + case VERTREFRESH: if (xf86getToken (NULL) != NUMBER) Error (VERTREFRESH_MSG, NULL); - ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo = val.realnum; - if (xf86getToken (NULL) == DASH) - { - if (xf86getToken (NULL) != NUMBER) - Error (VERTREFRESH_MSG, NULL); - ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi = val.realnum; - } - else - { - xf86unGetToken (token); - ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi = - ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo; - } - ptr->mon_n_vrefresh++; - while ((token = xf86getToken (NULL)) == COMMA) - { - if (ptr->mon_n_vrefresh == CONF_MAX_HSYNC) - Error ("Sorry. Too many vertical refresh intervals.", NULL); - if (xf86getToken (NULL) != NUMBER) - Error (VERTREFRESH_MSG, NULL); + do { ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo = val.realnum; - if (xf86getToken (NULL) == DASH) + switch (token = xf86getToken (NULL)) { - if (xf86getToken (NULL) != NUMBER) - Error (VERTREFRESH_MSG, NULL); - ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi = val.realnum; - } - else - { - xf86unGetToken (token); - ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi = + case COMMA: + ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi = ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo; + break; + case DASH: + if (xf86getToken (NULL) != NUMBER || + val.realnum < ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo) + Error (VERTREFRESH_MSG, NULL); + ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi = val.realnum; + break; + default: + /* We cannot currently know if a '\n' was found, + * or this is a real error + */ + ptr->mon_vrefresh[ptr->mon_n_vrefresh].hi = + ptr->mon_vrefresh[ptr->mon_n_vrefresh].lo; + ptr->mon_n_vrefresh++; + goto VertDone; } + if (ptr->mon_n_vrefresh == CONF_MAX_VREFRESH) + Error ("Sorry. Too many vertical refresh intervals.", NULL); ptr->mon_n_vrefresh++; - } + } while ((token = xf86getToken (NULL)) == NUMBER); +VertDone: xf86unGetToken (token); break; + case GAMMA: if( xf86getToken (NULL) != NUMBER ) { diff --git a/xc/programs/Xserver/hw/xfree86/parser/read.c b/xc/programs/Xserver/hw/xfree86/parser/read.c index f06fb22ac..bc6efd521 100644 --- a/xc/programs/Xserver/hw/xfree86/parser/read.c +++ b/xc/programs/Xserver/hw/xfree86/parser/read.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/read.c,v 1.16 2000/11/30 20:45:34 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/read.c,v 1.17 2000/12/06 15:35:32 eich Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -200,6 +200,30 @@ xf86addListItem (GenericListPtr head, GenericListPtr new) return (new); } +/* + * Test if one chained list contains the other. + * In this case both list have the same endpoint (provided they don't loop) + */ +int +xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2) +{ + GenericListPtr p = list_1; + GenericListPtr last_1 = NULL, last_2 = NULL; + + while (p) { + last_1 = p; + p = p->next; + } + + p = list_2; + while (p) { + last_2 = p; + p = p->next; + } + + return (!(last_1 == last_2)); +} + void xf86freeConfig (XF86ConfigPtr p) { diff --git a/xc/programs/Xserver/hw/xfree86/parser/xf86Parser.h b/xc/programs/Xserver/hw/xfree86/parser/xf86Parser.h index 3bfce72a9..9ed384ea3 100644 --- a/xc/programs/Xserver/hw/xfree86/parser/xf86Parser.h +++ b/xc/programs/Xserver/hw/xfree86/parser/xf86Parser.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Parser.h,v 1.26 2000/11/15 00:22:27 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Parser.h,v 1.27 2000/12/06 15:35:33 eich Exp $ */ /* * * Copyright (c) 1997 Metro Link Incorporated @@ -423,6 +423,7 @@ XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident, XF86ConfVideoAdaptorPtr p); GenericListPtr xf86addListItem(GenericListPtr head, GenericListPtr c_new); +int xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2); int xf86pathIsAbsolute(const char *path); int xf86pathIsSafe(const char *path); diff --git a/xc/programs/Xserver/hw/xfree86/xf86Version.h b/xc/programs/Xserver/hw/xfree86/xf86Version.h index 8d45406f6..f42d9c350 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86Version.h +++ b/xc/programs/Xserver/hw/xfree86/xf86Version.h @@ -1,13 +1,13 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.454 2000/12/04 18:49:49 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.460 2000/12/18 05:55:35 dawes Exp $ */ -#define XF86_VERSION " 4.0.1h " +#define XF86_VERSION " 4.0.2 " /* The finer points in versions... */ #define XF86_VERSION_MAJOR 4 #define XF86_VERSION_MINOR 0 -#define XF86_VERSION_SUBMINOR 1 +#define XF86_VERSION_SUBMINOR 2 #define XF86_VERSION_BETA 0 /* 0="", 1="A", 2="B", etc... */ -#define XF86_VERSION_ALPHA 8 /* 0="", 1="a", 2="b", etc... */ +#define XF86_VERSION_ALPHA 0 /* 0="", 1="a", 2="b", etc... */ #define XF86_VERSION_NUMERIC(major,minor,subminor,beta,alpha) \ ((((((((major << 7) | minor) << 7) | subminor) << 5) | beta) << 5) | alpha) @@ -18,6 +18,6 @@ XF86_VERSION_BETA, \ XF86_VERSION_ALPHA) -#define XF86_DATE "4 December 2000" +#define XF86_DATE "18 December 2000" /* $XConsortium: xf86Version.h /main/78 1996/10/28 05:42:10 kaleb $ */ diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile b/xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile index a893c2643..04af09f21 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile,v 1.10 2000/11/30 20:55:16 paulo Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/Imakefile,v 1.13 2000/12/14 01:21:57 dawes Exp $ XCOMM CDEBUGFLAGS=-g -Wall -ansi -pedantic @@ -7,6 +7,11 @@ LDSRCS = libc_wrapper.c loader.c LDOBJS = libc_wrapper.o loader.o #endif +#if HasNCurses +TEXTSRC = text-mode.c +TEXTOBJ = text-mode.o +#endif + SRCS =\ accessx.c\ card-cfg.c\ @@ -24,6 +29,7 @@ SRCS =\ screen.c\ startx.c\ stubs.c\ + $(TEXTSRC)\ vidmode.c\ xf86config.c @@ -44,6 +50,7 @@ OBJS =\ screen.o\ startx.o\ stubs.o\ + $(TEXTOBJ)\ vidmode.o\ xf86config.o @@ -77,10 +84,19 @@ LOADERLIB = -L../loader -lxloader -L../dummylib -ldummy MODULEDEFINES = -DUSE_MODULES INCLUDES = -I../common -I../loader -I$(XF86OSSRC) \ -I$(SERVERSRC)/include -I$(XINCLUDESRC) -WRAPPERDEFINES = -DSELF_CONTAINED_WRAPPER +#if !HasSnprintf +SNPRINTF_DEFS = -DNEED_SNPRINTF +#endif +WRAPPERDEFINES = -DSELF_CONTAINED_WRAPPER $(SNPRINTF_DEFS) #endif -DEFINES = -DXF86CONFIG=\"XConfigFile\" $(MODULEDEFINES) +#if HasNCurses +CURSESLIB = NCursesLibName +CURSESDEFINES = -DHAS_NCURSES +#endif + +DEFINES = -DXF86CONFIG=\"XConfigFile\" $(MODULEDEFINES) \ + $(CURSESDEFINES) #if HasDlopen DLLIB = DlLibrary @@ -88,13 +104,16 @@ DLLIB = DlLibrary LOCAL_LIBRARIES = $(XKBUILIB) $(XKBFILELIB) -lxf86config $(XXF86MISCLIB) \ $(XXF86VMLIB) $(XAWLIB) $(XMULIB) $(XTOOLLIB) \ - $(XPMLIB) $(LOADERLIB) $(DLLIB) $(XLIB) -lm + $(XPMLIB) $(LOADERLIB) $(DLLIB) $(XLIB) $(CURSESLIB) \ + RegexLibrary -lm NormalProgramTarget($(PROG),$(OBJS),,$(LOCAL_LIBRARIES),) InstallProgramWithFlags($(PROG),$(BINDIR),NullParameter) InstallMultipleFlags($(XBMPICS),$(INCDIR)/X11/bitmaps,$(INSTINCFLAGS)) InstallMultipleFlags($(XPMPICS),$(INCDIR)/X11/pixmaps,$(INSTINCFLAGS)) InstallAppDefaults(XF86Cfg) + +CppManTarget(xf86cfg,) InstallManPage(xf86cfg,$(MANDIR)) NormalLibraryObjectRule() diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/config.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/config.c index 175f55302..e628c8dbc 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/config.c +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/config.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.c,v 1.5 2000/10/29 14:24:13 tsi Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.c,v 1.6 2000/12/08 21:51:04 paulo Exp $ */ #include "config.h" @@ -42,23 +42,6 @@ #include <X11/Xaw/Command.h> #include <X11/Shell.h> -#define CONFPATH "%A," "%R," \ - "/etc/X11/%R," "%P/etc/X11/%R," \ - "%E," "%F," \ - "/etc/X11/%F," "%P/etc/X11/%F," \ - "%D/%X," \ - "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \ - "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \ - "%P/etc/X11/%X," \ - "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \ - "%P/lib/X11/%X" -#define USER_CONFPATH "/etc/X11/%S," "%P/etc/X11/%S," \ - "/etc/X11/%G," "%P/etc/X11/%G," \ - "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \ - "%P/etc/X11/%X," \ - "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \ - "%P/lib/X11/%X" - /* * Prototypes */ diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/config.h b/xc/programs/Xserver/hw/xfree86/xf86cfg/config.h index cb1fd7242..0e564300c 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/config.h +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/config.h @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.h,v 1.8 2000/11/30 20:55:16 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.h,v 1.9 2000/12/08 21:51:05 paulo Exp $ */ #include <X11/IntrinsicP.h> @@ -94,6 +94,23 @@ #define UNUSED 0 #define USED 1 +#define CONFPATH "%A," "%R," \ + "/etc/X11/%R," "%P/etc/X11/%R," \ + "%E," "%F," \ + "/etc/X11/%F," "%P/etc/X11/%F," \ + "%D/%X," \ + "/etc/X11/%X-%M," "/etc/X11/%X," "/etc/%X," \ + "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \ + "%P/etc/X11/%X," \ + "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \ + "%P/lib/X11/%X" +#define USER_CONFPATH "/etc/X11/%S," "%P/etc/X11/%S," \ + "/etc/X11/%G," "%P/etc/X11/%G," \ + "%P/etc/X11/%X.%H," "%P/etc/X11/%X-%M," \ + "%P/etc/X11/%X," \ + "%P/lib/X11/%X.%H," "%P/lib/X11/%X-%M," \ + "%P/lib/X11/%X" + /* * Types */ diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c index 40eac0f45..0661aecec 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c,v 1.11 2000/12/01 18:31:07 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c,v 1.13 2000/12/09 02:23:26 dawes Exp $ */ #include <X11/IntrinsicP.h> @@ -101,6 +101,10 @@ extern void AccessXConfigureStart(void); extern void AccessXConfigureEnd(void); extern void CloseAccessXAction(Widget, XEvent*, String*, Cardinal*); +#ifdef HAS_NCURSES +extern void TextMode(void); +#endif + /* * Initialization */ @@ -118,6 +122,8 @@ static char XF86Config_path_static[1024]; static char XkbConfig_path_static[1024]; Bool xf86config_set = False; +Bool textmode = False; + xf86cfgComputer computer; xf86cfgDevice cpu_device; Cursor no_cursor; @@ -220,7 +226,18 @@ main(int argc, char *argv[]) if (i + 1 < argc) XF86RGB_path = argv[++i]; } +#ifdef HAS_NCURSES + else if (strcmp(argv[i], "-textmode") == 0) + textmode = True; +#endif } + +#ifdef HAS_NCURSES + if (textmode) { + TextMode(); + exit(0); + } +#endif startedx = startx(); /* if (XF86Config_path == NULL) diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.c index c1737d9d5..1f5720a8e 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.c +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.c,v 1.8 2000/10/20 14:59:05 alanh Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/keyboard-cfg.c,v 1.10 2000/12/11 18:47:46 paulo Exp $ */ #include "xf86config.h" @@ -54,7 +54,11 @@ static XF86XkbDescInfo xkb_model; static XF86XkbDescInfo xkb_layout; static XF86XkbDescInfo xkb_variant; static XF86XkbDescInfo xkb_option; +#ifdef XFREE98_XKB +static char *XkbRulesFile = "lib/X11/xkb/rules/xfree98"; +#else static char *XkbRulesFile = "lib/X11/xkb/rules/xfree86"; +#endif static XF86ConfInputPtr current_input; static char *model, *layout; @@ -498,10 +502,10 @@ WriteXKBConfiguration(char *filename, XkbConfigRtrnPtr conf) fprintf(fp, "Rules = %s\n", conf->rules_file); if (conf->model != NULL) - fprintf(fp, "Model = %s\n", + fprintf(fp, "Model = \"%s\"\n", conf->model); if (conf->layout != NULL) - fprintf(fp, "Layout = %s\n", + fprintf(fp, "Layout = \"%s\"\n", conf->layout); if (conf->variant != NULL) fprintf(fp, "Variant = %s\n", diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c index 364e96fa9..9914ad7a9 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c,v 1.5 2000/12/01 18:31:07 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c,v 1.6 2000/12/08 21:51:06 paulo Exp $ */ #include "xf86config.h" @@ -63,6 +63,7 @@ static char *standard_modes[] = { "640x480", "800x600", "1024x768", + "1280x960", "1280x1024", "320x200", "320x240", diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/startx.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/startx.c index c983bacbe..b5199c00a 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/startx.c +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/startx.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/startx.c,v 1.5 2000/11/30 20:55:18 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/startx.c,v 1.6 2000/12/06 15:35:34 eich Exp $ */ #include "config.h" @@ -57,13 +57,17 @@ startx(void) char commandline[PATH_MAX * 4]; int c_pos; int len; - + /* + * The name of the 4.0 binary is XFree86. X might also + * be the name of the 3.3 binary. Therefore don't change + * name to 'X'. + */ if (XFree86_path) c_pos = XmuSnprintf(commandline, sizeof(commandline), - "%s/X :8 -configure ",XFree86_path); + "%s/XFree86 :8 -configure ",XFree86_path); else c_pos = XmuSnprintf(commandline, sizeof(commandline), - "%s/bin/X :8 -configure ", XFree86Dir); + "%s/bin/XFree86 :8 -configure ", XFree86Dir); if (XF86Module_path && ((len = sizeof(commandline) - c_pos) > 0)) c_pos += XmuSnprintf(commandline + c_pos,len, " -modulepath %s",XF86Module_path); @@ -95,10 +99,11 @@ startx(void) switch (xpid = fork()) { case 0: { char path[PATH_MAX]; + /* Don't change to X! see above */ if (XFree86_path) - XmuSnprintf(path, sizeof(path), "%s/X", XFree86_path); + XmuSnprintf(path, sizeof(path), "%s/XFree86", XFree86_path); else - XmuSnprintf(path, sizeof(path), "%s/bin/X", XFree86Dir); + XmuSnprintf(path, sizeof(path), "%s/bin/XFree86", XFree86Dir); execl(path, "X", ":8", /*"+xinerama",*/ "+accessx","-allowMouseOpenFail", "-xf86config", XF86Config_path, NULL); exit(-127); diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c new file mode 100644 index 000000000..82a83d15d --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c @@ -0,0 +1,3252 @@ +/* + * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com) + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Conectiva Linux shall + * not be used in advertising or otherwise to promote the sale, use or other + * dealings in this Software without prior written authorization from + * Conectiva Linux. + * + * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> + * + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c,v 1.7 2000/12/13 12:58:20 tsi Exp $ + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ncurses.h> +#include <ctype.h> +#include <X11/Xlib.h> +#include <X11/extensions/XKBstr.h> +#include <X11/extensions/XKBrules.h> +#include "cards.h" +#include "config.h" +#include "xf86config.h" + +#define XKB_RULES_DIR "/usr/X11R6/lib/X11/xkb/rules" + +#define TAB 9 +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) + +void TextMode(void); + +static void ClearScreen(void); +static void PaintWindow(WINDOW*, char*, int, int, int, int); +static void PaintBox(WINDOW*, int, int, int, int); +static void PaintButton(WINDOW*, char*, int, int, int); +static void PrintWrap(WINDOW*, char*, int, int, int); +static int Dialog(char*, char*, int, int, char*, char*, int); +static void PaintItem(WINDOW*, char*, int, int); +static int DialogMenu(char*, char*, int, int, int, int, char**, char*, char*, int); +static void PaintCheckItem(WINDOW*, char*, int, int, int); +static int DialogCheckBox(char*, char*, int, int, int, int, char**, char*, char*, char*); +static char *DialogInput(char*, char*, int, int, char*, char*, char*, int); +static void PaintScroller(WINDOW*, int, int, int); + +static int MouseConfig(void); +static int KeyboardConfig(void); +static int MonitorConfig(void); +static int CardConfig(void); +static int ScreenConfig(void); +static int LayoutConfig(void); +static int WriteXF86Config(void); + +static XF86ConfLayoutPtr CopyLayout(XF86ConfLayoutPtr); +static XF86ConfAdjacencyPtr CopyAdjacency(XF86ConfAdjacencyPtr); +static XF86ConfInputrefPtr CopyInputref(XF86ConfInputrefPtr); +static XF86ConfInactivePtr CopyInactive(XF86ConfInactivePtr); +static void FreeLayout(XF86ConfLayoutPtr); + +#ifdef USE_MODULES +extern void LoaderInit(void); +extern void LoaderSetPath(char*); +extern char **LoaderListDirs(char**, char**); + +extern int xf86Verbose; +#endif + +extern int string_to_parser_range(char*, parser_range*, int); +#define PARSER_RANGE_SIZE 256 +/* string must have at least 256 bytes */ +extern int parser_range_to_string(char*, parser_range*, int); + +static Bool newconfig; + +static chtype screen_attr = A_NORMAL; +static chtype dialog_attr = A_REVERSE; +static chtype highlight_border_attr = A_REVERSE; +static chtype shadow_border_attr = A_REVERSE; +static chtype title_attr = A_NORMAL; +static chtype button_active_attr = A_NORMAL; +static chtype button_inactive_attr = A_NORMAL; +static int menu_width, item_x; +static char Edit[] = "Edit "; + +static char *main_menu[] = { +#define CONF_MOUSE 0 + "Configure mouse", +#define CONF_KEYBOARD 1 + "Configure keyboard", +#define CONF_MONITOR 2 + "Configure monitor", +#define CONF_CARD 3 + "Configure card", +#define CONF_SCREEN 4 + "Configure screen", +#define CONF_LAYOUT 5 + "Configure layout", +#define CONF_FINISH 6 + "Write XF86Config and quit", +#define CONF_QUIT 7 + "Quit", +}; + +void +TextMode(void) +{ + static int first = 1; + int i, choice = CONF_MOUSE; + + initscr(); + noecho(); + nonl(); + keypad(stdscr, TRUE); + + if (first) { + const char *filename; + + first = 0; + + if (has_colors()) { + start_color(); + init_pair(1, COLOR_BLACK, COLOR_BLACK); + screen_attr = A_BOLD | COLOR_PAIR(1); + + init_pair(2, COLOR_BLACK, COLOR_WHITE); + dialog_attr = COLOR_PAIR(2); + + init_pair(3, COLOR_BLACK, COLOR_WHITE); + shadow_border_attr = A_BOLD | COLOR_PAIR(3); + + init_pair(4, COLOR_WHITE, COLOR_WHITE); + highlight_border_attr = A_BOLD | COLOR_PAIR(4); + + init_pair(5, COLOR_WHITE, COLOR_BLUE); + title_attr = A_BOLD | COLOR_PAIR(5); + button_active_attr = title_attr; + + init_pair(6, COLOR_WHITE, COLOR_BLACK); + button_inactive_attr = A_BOLD | COLOR_PAIR(6); + } + + if ((filename = xf86openConfigFile(getuid() == 0 ? + CONFPATH : USER_CONFPATH, + XF86Config_path, NULL)) != NULL) { + XF86Config_path = (char *)filename; + if ((XF86Config = xf86readConfigFile()) == NULL) { + ClearScreen(); + refresh(); + Dialog("Configuration error", + "Error parsing configuration file.", + 7, 50, " Ok ", NULL, 0); + } + } + if (XF86Config == NULL) { + XF86Config = (XF86ConfigPtr)XtCalloc(1, sizeof(XF86ConfigRec)); + newconfig = True; + } + else + newconfig = False; + } + + ClearScreen(); + refresh(); + + /*CONSTCOND*/ + while (1) { + int cancel = FALSE; + + ClearScreen(); + refresh(); + if (Dialog("XFree86 Configuration", + "This program will create the XF86Config file, based on " + "menu selections you make.\n" + "\n" + "The XF86Config file usually resides in /usr/X11R6/etc/X11 " + "or /etc/X11. A sample XF86Config file is supplied with " + "XFree86; it is configured for a standard VGA card and " + "monitor with 640x480 resolution. This program will ask for " + "a pathname when it is ready to write the file.\n" + "\n" + "You can either take the sample XF86Config as a base and " + "edit it for your configuration, or let this program " + "produce a base XF86Config file for your configuration and " + "fine-tune it.", + 20, 60, " Ok ", " Cancel ", 0) != 0) + break; + + while (!cancel) { + ClearScreen(); + refresh(); + switch (DialogMenu("Main menu", + "Choose one of the options:", + 17, 60, 8, sizeof(main_menu) / + sizeof(main_menu[0]), main_menu, + " Ok ", " Cancel ", choice)) { + case CONF_MOUSE: + i = MouseConfig(); + if (i > 0 && choice == CONF_MOUSE) + choice = CONF_KEYBOARD; + else if (i == 0) + choice = CONF_MOUSE; + break; + case CONF_KEYBOARD: + i = KeyboardConfig(); + if (i > 0 && choice <= CONF_KEYBOARD) + choice = CONF_MONITOR; + else if (i == 0) + choice = CONF_KEYBOARD; + break; + case CONF_MONITOR: + i = MonitorConfig(); + if (i > 0 && choice <= CONF_MONITOR) + choice = CONF_CARD; + else if (i == 0) + choice = CONF_MONITOR; + break; + case CONF_CARD: + i = CardConfig(); + if (i > 0 && choice <= CONF_CARD) + choice = CONF_SCREEN; + else if (i == 0) + choice = CONF_CARD; + break; + case CONF_SCREEN: + i = ScreenConfig(); + if (i > 0 && choice <= CONF_SCREEN) + choice = CONF_LAYOUT; + else if (i == 0) + choice = CONF_SCREEN; + break; + case CONF_LAYOUT: + i = LayoutConfig(); + if (i > 0 && choice <= CONF_LAYOUT) + choice = CONF_FINISH; + else if (i == 0) + choice = CONF_LAYOUT; + break; + case CONF_FINISH: + if (WriteXF86Config() < 0) + break; + /*FALLTROUGH*/ + case CONF_QUIT: + endwin(); + exit(0); + default: + cancel = TRUE; + break; + } + } + } + + endwin(); +} + +static int +WriteXF86Config(void) +{ + char *xf86config; + + ClearScreen(); + refresh(); + xf86config = DialogInput("Write XF86Config", "Write configuration to file:", + 10, 60, XF86Config_path ? XF86Config_path : + "/etc/X11/XF86Config", " Ok ", " Cancel ", 0); + + if (xf86config == NULL) + return (-1); + + if (newconfig) { + if (XF86Config->conf_modules == NULL) { + static char *modules[] = {"xie", "pex5", "glx", "dri", "dbe", + "record", "extmod", "type1"}; + XF86LoadPtr load; + int i; + + XF86Config->conf_modules = (XF86ConfModulePtr) + XtCalloc(1, sizeof(XF86ConfModuleRec)); + + for (i = 0; i < sizeof(modules) / sizeof(modules[0]); i++) { + load = (XF86LoadPtr)XtCalloc(1, sizeof(XF86LoadRec)); + load->load_name = XtNewString(modules[i]); + XF86Config->conf_modules->mod_load_lst = + xf86addModule(XF86Config->conf_modules->mod_load_lst, load); + } + } + } + + if (!xf86writeConfigFile(xf86config, XF86Config)) { + char msg[1024]; + + XmuSnprintf(msg, sizeof(msg), "Failed to write configuration file %s.", + xf86config); + ClearScreen(); + refresh(); + (void)Dialog("Write failed!", msg, 8, 60, " Ok ", NULL, 0); + XtFree(xf86config); + return (-1); + } + XtFree(xf86config); + + return (1); +} + +static char *protocols[] = { + "Auto", + "Microsoft", + "PS/2", + "BusMouse", + "GlidePoint", + "IntelliMouse", + "Logitech", + "MMHitTab", + "MMSeries", + "MouseMan", + "MouseSystems", + "SysMouse", + "ThinkingMouse", +}; + +static int +MouseConfig(void) +{ + int i, nlist, def, proto, emul; + char **list = NULL, *device, *str; + XF86ConfInputPtr *inputs = NULL; + XF86ConfInputPtr input = XF86Config->conf_input_lst; + XF86OptionPtr option; + + nlist = 0; + while (input) { + if (strcmp(input->inp_driver, "mouse") == 0) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); + list[nlist] = XtMalloc(sizeof(Edit) + + strlen(input->inp_identifier) + 1); + sprintf(list[nlist], "%s%s", Edit, input->inp_identifier); + inputs = (XF86ConfInputPtr*)XtRealloc((XtPointer)inputs, (nlist + 1) * + sizeof(XF86ConfInputPtr)); + inputs[nlist] = input; + ++nlist; + } + input = (XF86ConfInputPtr)(input->list.next); + } + + input = NULL; + + if (nlist) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*)); + list[nlist++] = XtNewString("Add new mouse"); + if (nlist == 2) { + i = strlen("Remove ") + strlen(inputs[0]->inp_identifier) + 1; + list[nlist] = XtMalloc(i); + XmuSnprintf(list[nlist], i, "Remove %s", inputs[0]->inp_identifier); + ++nlist; + } + else + list[nlist++] = XtNewString("Remove mouse"); + ClearScreen(); + refresh(); + i = DialogMenu("Mouse configuration", + "You can edit or remove a previously configured mouse, " + "or add a new one.", 14, 60, 4, nlist, list, + " Ok ", " Cancel ", 0); + if (i < 0) { + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)inputs); + return (-1); + } + if (nlist > 2 && i == nlist - 1) { + if (nlist > 3) { + for (i = 0; i < nlist - 2; i++) { + /* XXX Remove the "Edit " from list entries */ + memmove(list[i], list[i] + sizeof(Edit) - 1, + strlen(list[i]) - sizeof(Edit) + 2); + } + ClearScreen(); + refresh(); + i = DialogMenu("Remove mouse", + "Select which mouse to remove", + 13, 60, 4, nlist - 2, list, + " Remove ", " Cancel ", 0); + if (i < 0) { + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)inputs); + return (-1); + } + input = inputs[i]; + } + else + input = inputs[0]; + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)inputs); + xf86removeInput(XF86Config, input); + return (0); + } + if (i < nlist - 2) + input = inputs[i]; + } + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)inputs); + + if (input == NULL) { + char label[32]; + + input = (XF86ConfInputPtr)XtCalloc(1, sizeof(XF86ConfInputRec)); + XmuSnprintf(label, sizeof(label), "Mouse%d", nlist ? nlist - 2 : 0); + ClearScreen(); + refresh(); + input->inp_identifier = + DialogInput("Mouse identifier", + "Enter an identifier for your mouse definition:", + 11, 40, label, + " Next >>", " Cancel ", 0); + if (input->inp_identifier == NULL) { + XtFree((XtPointer)input); + return (-1); + } + } + + def = 0; + option = xf86findOption(input->inp_option_lst, "Protocol"); + if (option) + for (i = 0; i < sizeof(protocols)/sizeof(protocols[0]); i++) + if (strcasecmp(option->opt_val, protocols[i]) == 0) { + def = i; + break; + } + + ClearScreen(); + refresh(); + i = DialogMenu("Select mouse protocol", + "If you have a serial mouse, it probably will work with " + "the \"Auto\" protocol. But, if it is an old serial " + "mouse probably it is not PNP; in that case, most serial " + "mouses understand the \"Microsoft\" protocol.", + 19, 60, 7, sizeof(protocols) / + sizeof(protocols[0]), protocols, " Next >>", " Cancel ", def); + if (i < 0) { + if (input->inp_driver == NULL) { + XtFree(input->inp_driver); + XtFree((XtPointer)input); + } + return (i); + } + proto = i; + + def = 0; + if (input->inp_driver) { + option = xf86findOption(input->inp_option_lst, "Emulate3Buttons"); + def = option ? 0 : 1; + } + ClearScreen(); + refresh(); + i = Dialog("Mouse 3 buttons emulation", + "If your mouse has only two buttons, it is recommended that " + "you enable Emulate3Buttons.\n" + "\n" + "Do you want to enable Emulate3Buttons?", + 10, 60, " Yes ", " No ", def); + if (i < 0) + return (i); + emul = !i; + + str = NULL; + option = xf86findOption(input->inp_option_lst, "Device"); + if (option) + str = option->opt_val; + if (str == NULL) + str = "/dev/mouse"; + + ClearScreen(); + refresh(); + device = DialogInput("Select mouse device", + "Enter mouse device:", 10, 40, str, + " Finish ", " Cancel ", 0); + if (device == NULL) { + if (input->inp_driver == NULL) { + XtFree(input->inp_driver); + XtFree((XtPointer)input); + } + return (-1); + } + + /* Finish mouse configuration */ + option = xf86findOption(input->inp_option_lst, "Protocol"); + if (option) { + XtFree((XtPointer)option->opt_val); + option->opt_val = XtNewString(protocols[proto]); + } + else + input->inp_option_lst = xf86addNewOption(input->inp_option_lst, + XtNewString("Protocol"), XtNewString(protocols[proto])); + + option = xf86findOption(input->inp_option_lst, "Emulate3Buttons"); + if (option && !emul) { + xf86removeOption(&input->inp_option_lst, "Emulate3Buttons"); + } + else if (option == NULL && emul) + input->inp_option_lst = xf86addNewOption(input->inp_option_lst, + XtNewString("Emulate3Buttons"), NULL); + + option = xf86findOption(input->inp_option_lst, "Device"); + if (option) { + XtFree((XtPointer)option->opt_val); + option->opt_val = device; + } + else + input->inp_option_lst = xf86addNewOption(input->inp_option_lst, + XtNewString("Device"), device); + + if (input->inp_driver == NULL) { + input->inp_driver = XtNewString("mouse"); + XF86Config->conf_input_lst = + xf86addInput(XF86Config->conf_input_lst, input); + } + + return (1); +} + +static int +KeyboardConfig(void) +{ + int i; + char *rulesfile; + static int first = 1; + static XkbRF_RulesPtr rules; + static char **models, **layouts; + XF86ConfInputPtr *inputs = NULL, input = XF86Config->conf_input_lst; + char **list = NULL, *model, *layout; + int nlist, def; + XF86OptionPtr option; + + nlist = 0; + while (input) { + if (strcmp(input->inp_driver, "keyboard") == 0) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); + list[nlist] = XtMalloc(sizeof(Edit) + + strlen(input->inp_identifier) + 1); + sprintf(list[nlist], "%s%s", Edit, input->inp_identifier); + inputs = (XF86ConfInputPtr*)XtRealloc((XtPointer)inputs, (nlist + 1) * + sizeof(XF86ConfInputPtr)); + inputs[nlist] = input; + ++nlist; + } + input = (XF86ConfInputPtr)(input->list.next); + } + + input = NULL; + + if (nlist) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*)); + list[nlist++] = XtNewString("Add new keyboard"); + if (nlist == 2) { + i = strlen("Remove ") + strlen(inputs[0]->inp_identifier) + 1; + list[nlist] = XtMalloc(i); + XmuSnprintf(list[nlist], i, "Remove %s", inputs[0]->inp_identifier); + ++nlist; + } + else + list[nlist++] = XtNewString("Remove keyboard"); + ClearScreen(); + refresh(); + i = DialogMenu("Keyboard configuration", + "You can edit or remove a previously configured " + "keyboard, or add a new one.", 14, 60, 4, nlist, list, + " Ok ", " Cancel ", 0); + if (i < 0) { + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)inputs); + return (-1); + } + if (nlist > 2 && i == nlist - 1) { + if (nlist > 3) { + for (i = 0; i < nlist - 2; i++) { + /* XXX Remove the "Edit " from list entries */ + memmove(list[i], list[i] + sizeof(Edit) - 1, + strlen(list[i]) - sizeof(Edit) + 2); + } + ClearScreen(); + refresh(); + i = DialogMenu("Remove keyboard", + "Select which keyboard to remove", + 13, 60, 4, nlist - 2, list, + " Remove ", " Cancel ", 0); + if (i < 0) { + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)inputs); + return (-1); + } + input = inputs[i]; + } + else + input = inputs[0]; + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)inputs); + xf86removeInput(XF86Config, input); + return (0); + } + if (i < nlist - 2) + input = inputs[i]; + } + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)inputs); + + if (input == NULL) { + char label[32]; + + input = (XF86ConfInputPtr)XtCalloc(1, sizeof(XF86ConfInputRec)); + XmuSnprintf(label, sizeof(label), "Keyboard%d", nlist ? nlist - 2 : 0); + ClearScreen(); + refresh(); + input->inp_identifier = + DialogInput("Keyboard identifier", + "Enter an identifier for your mouse definition:", + 11, 40, label, + " Next >>", " Cancel ", 0); + if (input->inp_identifier == NULL) { + XtFree((XtPointer)input); + return (-1); + } + } + + if (first) { + first = 0; +#ifdef XFREE98_XKB + rulesfile = XKB_RULES_DIR "/xfree98"; +#else + rulesfile = XKB_RULES_DIR "/xfree86"; +#endif + rules = XkbRF_Load(rulesfile, "", True, False); + if (rules == NULL) { + ClearScreen(); + refresh(); + Dialog("Configuration error", + "XKB rules file not found.\n" + "\n" + "Keyboard XKB options will be set to default values.", + 10, 50, " Ok ", NULL, 0); + if (input->inp_driver == NULL) { + input->inp_option_lst = + xf86addNewOption(input->inp_option_lst, + XtNewString("XkbModel"), XtNewString("pc101")); + input->inp_option_lst = + xf86addNewOption(input->inp_option_lst, + XtNewString("XkbLayout"), XtNewString("us")); + input->inp_driver = XtNewString("keyboard"); + XF86Config->conf_input_lst = + xf86addInput(XF86Config, input); + } + return (0); + } + models = (char**)XtMalloc(sizeof(char*) * rules->models.num_desc); + for (i = 0; i < rules->models.num_desc; i++) + models[i] = XtNewString(rules->models.desc[i].desc); + layouts = (char**)XtMalloc(sizeof(char*) * rules->layouts.num_desc); + for (i = 0; i < rules->layouts.num_desc; i++) + layouts[i] = XtNewString(rules->layouts.desc[i].desc); + } + else if (rules == NULL) + return (-1); + + def = 0; + option = xf86findOption(input->inp_option_lst, "XkbModel"); + if (option) { + for (i = 0; i < rules->models.num_desc; i++) + if (strcasecmp(option->opt_val, rules->models.desc[i].name) == 0) { + def = i; + break; + } + } + ClearScreen(); + refresh(); + i = DialogMenu("Keyboard model", + "Please select one of the following keyboard types that is " + "the better description of your keyboard. If nothing really " + "matches, choose \"Generic 101-key PC\".\n", + 20, 60, 9, rules->models.num_desc, + models, " Next >>", " Cancel ", def); + if (i < 0) + return (i); + model = rules->models.desc[i].name; + + def = 0; + option = xf86findOption(input->inp_option_lst, "XkbLayout"); + if (option) { + for (i = 0; i < rules->layouts.num_desc; i++) + if (strcasecmp(option->opt_val, rules->layouts.desc[i].name) == 0) { + def = i; + break; + } + } + ClearScreen(); + refresh(); + i = DialogMenu("Keyboard layout", + "Select keyboard layout:", + 20, 60, 11, rules->layouts.num_desc, + layouts, " Finish ", " Cancel ", def); + if (i < 0) + return (i); + layout = rules->layouts.desc[i].name; + + /* Finish keyboard configuration */ + option = xf86findOption(input->inp_option_lst, "XkbModel"); + if (option) { + XtFree((XtPointer)option->opt_val); + option->opt_val = XtNewString(model); + } + else + input->inp_option_lst = xf86addNewOption(input->inp_option_lst, + XtNewString("XkbModel"), XtNewString(model)); + + option = xf86findOption(input->inp_option_lst, "XkbLayout"); + if (option) { + XtFree((XtPointer)option->opt_val); + option->opt_val = XtNewString(layout); + } + else + input->inp_option_lst = xf86addNewOption(input->inp_option_lst, + XtNewString("XkbLayout"), XtNewString(layout)); + + if (input->inp_driver == NULL) { + input->inp_driver = XtNewString("keyboard"); + XF86Config->conf_input_lst = + xf86addInput(XF86Config->conf_input_lst, input); + } + + return (1); +} + +static char *hsync[] = { +#define CONF_MONITOR_HSYNC 0 + "Enter your own horizontal sync range", + "31.5; Standard VGA, 640x480 @ 60 Hz", + "31.5 - 35.1; Super VGA, 800x600 @ 56 Hz", + "31.5, 35.5; 8514 Compatible, 1024x768 @ 87 Hz interlaced (no 800x600)", + "31.5, 35.15, 35.5; Super VGA, 1024x768 @ 87 Hz int., 800x600 @ 56 Hz", + "31.5 - 37.9; Extended Super VGA, 800x600 @ 60 Hz, 640x480 @ 72 Hz", + "31.5 - 48.5; Non-Interlaced SVGA, 1024x768 @ 60 Hz, 800x600 @ 72 Hz", + "31.5 - 57.0; High Frequency SVGA, 1024x768 @ 70 Hz", + "31.5 - 64.3; Monitor that can do 1280x1024 @ 60 Hz", + "31.5 - 79.0; Monitor that can do 1280x1024 @ 74 Hz", + "31.5 - 82.0; Monitor that can do 1280x1024 @ 76 Hz", +}; + +static char *vrefresh[] = { +#define CONF_MONITOR_VREFRESH 0 + "Enter your own vertical sync range", + "50 - 70", + "50 - 90", + "50 - 100", + "40 - 150", +}; + +static int +MonitorConfig(void) +{ + int i; + XF86ConfMonitorPtr *monitors = NULL, monitor = XF86Config->conf_monitor_lst; + char **list = NULL, *identifier = NULL, *tmp; + int nlist, def; + char hsync_str[256], vrefresh_str[256]; + + nlist = 0; + while (monitor) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); + list[nlist] = XtMalloc(sizeof(Edit) + + strlen(monitor->mon_identifier) + 1); + sprintf(list[nlist], "%s%s", Edit, monitor->mon_identifier); + monitors = (XF86ConfMonitorPtr*)XtRealloc((XtPointer)monitors, (nlist + 1) * + sizeof(XF86ConfMonitorPtr)); + monitors[nlist] = monitor; + ++nlist; + monitor = (XF86ConfMonitorPtr)(monitor->list.next); + } + + monitor = NULL; + + if (nlist) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*)); + list[nlist++] = XtNewString("Add new monitor"); + if (nlist == 2) { + i = strlen("Remove ") + strlen(monitors[0]->mon_identifier) + 1; + list[nlist] = XtMalloc(i); + XmuSnprintf(list[nlist], i, "Remove %s", monitors[0]->mon_identifier); + ++nlist; + } + else + list[nlist++] = XtNewString("Remove monitor"); + ClearScreen(); + refresh(); + i = DialogMenu("Monitor configuration", + "You can edit or remove a previously configured " + "monitor, or add a new one.", 14, 60, 4, nlist, list, + " Ok ", " Cancel ", 0); + if (i < 0) { + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)monitors); + return (-1); + } + if (nlist > 2 && i == nlist - 1) { + if (nlist > 3) { + for (i = 0; i < nlist - 2; i++) { + /* XXX Remove the "Edit " from list entries */ + memmove(list[i], list[i] + sizeof(Edit) - 1, + strlen(list[i]) - sizeof(Edit) + 2); + } + ClearScreen(); + refresh(); + i = DialogMenu("Remove monitor", + "Select which monitor to remove", + 13, 60, 4, nlist - 2, list, + " Remove ", " Cancel ", 0); + if (i < 0) { + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)monitors); + return (-1); + } + monitor = monitors[i]; + } + else + monitor = monitors[0]; + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)monitors); + xf86removeMonitor(XF86Config, monitor); + return (0); + } + if (i < nlist - 2) + monitor = monitors[i]; + } + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)monitors); + + if (monitor == NULL) { + char label[32]; + + monitor = (XF86ConfMonitorPtr)XtCalloc(1, sizeof(XF86ConfMonitorRec)); + XmuSnprintf(label, sizeof(label), "Monitor%d", nlist ? nlist - 2 : 0); + ClearScreen(); + refresh(); + identifier = + DialogInput("Monitor identifier", + "Enter an identifier for your monitor definition:", + 11, 40, label, + " Next >>", " Cancel ", 0); + if (identifier == NULL) { + XtFree((XtPointer)monitor); + return (-1); + } + } + + if (monitor->mon_identifier == NULL) { + ClearScreen(); + refresh(); + i = Dialog("Monitor configuration", + "Now we want to set the specifications of the monitor. The " + "two critical parameters are the vertical refresh rate, which " + "is the rate at which the whole screen is refreshed, and most " + "importantly the horizontal sync rate, which is the rate at " + "which scanlines are displayed.\n" + "\n" + "The valid range for horizontal sync and vertical sync should " + "be documented in the manual of your monitor.", + 15, 60, " Next >>", " Cancel ", 0); + if (i != 0) { + XtFree(identifier); + XtFree((XtPointer)monitor); + return (-1); + } + } + + def = 0; + if (monitor->mon_identifier) { + int len; + + parser_range_to_string(hsync_str, &(monitor->mon_hsync[0]), + monitor->mon_n_hsync); + len = strlen(hsync_str); + for (i = 1; i < sizeof(hsync) / sizeof(hsync[0]); i++) { + tmp = strchr(hsync[i], ';'); + if (strncmp(hsync_str, hsync[i], len) == 0) { + def = i; + break; + } + } + } + else + strcpy(hsync_str, "31.5"); + + ClearScreen(); + refresh(); + i = DialogMenu("Monitor HorizSync", + "You must indicate the horizontal sync range of your " + "monitor. You can either select one of the predefined " + "ranges below that correspond to industry-standard monitor " + "types, or give a specific range.", + 22, 78, 11, sizeof(hsync) / + sizeof(hsync[0]), hsync, " Next >>", " Cancel ", def); + if (i < 0) { + if (monitor->mon_identifier == NULL) { + XtFree(identifier); + XtFree((XtPointer)monitor); + } + return (-1); + } + if (i == CONF_MONITOR_HSYNC) { + ClearScreen(); + refresh(); + tmp = DialogInput("Monitor HorizSync", + "Please enter the horizontal sync range of your " + "monitor, in the format used in the table of monitor " + "types above. You can either specify one or more " + "continuous ranges (e.g. 15-25, 30-50), or one or more " + "fixed sync frequencies.\n" + "\n" + "Horizontal sync range:", 16, 62, hsync_str, + " Ok ", " Cancel ", def); + if (tmp == NULL) { + if (monitor->mon_identifier == NULL) { + XtFree(identifier); + XtFree((XtPointer)monitor); + } + return (-1); + } + XmuSnprintf(hsync_str, sizeof(hsync_str), "%s", tmp); + XtFree(tmp); + } + else { + tmp = strchr(hsync[i], ';'); + strncpy(hsync_str, hsync[i], tmp - hsync[i]); + hsync_str[tmp - hsync[i]] = '\0'; + } + + def = 0; + if (monitor->mon_identifier) { + parser_range_to_string(vrefresh_str, &(monitor->mon_vrefresh[0]), + monitor->mon_n_vrefresh); + for (i = 1; i < sizeof(vrefresh) / sizeof(vrefresh[0]); i++) { + if (strcmp(vrefresh_str, vrefresh[i]) == 0) { + def = i; + break; + } + } + } + else + strcpy(vrefresh_str, "50 - 70"); + ClearScreen(); + refresh(); + i = DialogMenu("Monitor VertRefresh", + "You must indicate the vertical sync range of your monitor. " + "You can either select one of the predefined ranges below " + "that correspond to industry-standard monitor types, or " + "give a specific range. For interlaced modes, the number " + "that counts is the high one (e.g. 87 Hz rather than 43 Hz).", + 19, 60, 5, sizeof(vrefresh) / + sizeof(vrefresh[0]), vrefresh, " Finish ", " Cancel ", def); + if (i < 0) { + if (monitor->mon_identifier == NULL) { + XtFree(identifier); + XtFree((XtPointer)monitor); + } + return (i); + } + if (i == CONF_MONITOR_VREFRESH) { + ClearScreen(); + refresh(); + tmp = DialogInput("Monitor VertRefresh", + "Vertical sync range:", 10, 50, vrefresh_str, + " Done ", " Cancel ", 0); + if (tmp == NULL) { + if (monitor->mon_identifier == NULL) { + XtFree(identifier); + XtFree((XtPointer)monitor); + } + return (-1); + } + XmuSnprintf(vrefresh_str, sizeof(vrefresh_str), "%s", tmp); + XtFree(tmp); + } + else + strcpy(vrefresh_str, vrefresh[i]); + + /* Finish monitor configuration */ + monitor->mon_n_hsync = string_to_parser_range(hsync_str, + &(monitor->mon_hsync[0]), CONF_MAX_HSYNC); + monitor->mon_n_vrefresh = string_to_parser_range(vrefresh_str, + &(monitor->mon_vrefresh[0]), CONF_MAX_VREFRESH); + if (monitor->mon_identifier == NULL) { + monitor->mon_identifier = identifier; + XF86Config->conf_monitor_lst = + xf86addMonitor(XF86Config->conf_monitor_lst, monitor); + } + + return (1); +} + +static int +CardConfig(void) +{ + int i; + XF86ConfDevicePtr *devices = NULL, device = XF86Config->conf_device_lst; + char **list = NULL, *identifier = NULL, *driver, *busid, *tmp; + int nlist, def; + CardsEntry *entry = NULL; +#ifdef USE_MODULES + static char **drivers; + static int ndrivers; + static char *path = NULL, *modules = "lib/modules"; + const char *subdirs[] = { + "drivers", + NULL + }; + + if (XF86Module_path == NULL) { + XF86Module_path = XtMalloc(strlen(XFree86Dir) + strlen(modules) + 2); + sprintf(XF86Module_path, "%s/%s", XFree86Dir, modules); + } + + if (drivers == NULL) { + xf86Verbose = 0; + LoaderInit(); + path = XtNewString(XF86Module_path); + LoaderSetPath(path); + drivers = LoaderListDirs((char**)subdirs, NULL); + for (; drivers[ndrivers]; ndrivers++) + ; + } +#else + static char *drivers[] = { + "apm", + "ark", + "ati", + "chips", + "cirrus", + "cyrix", + "fbdev", + "glint", + "i128", + "i740", + "i810", + "imstt", + "mga", + "neomagic", + "r128", + "radeon", + "rendition", + "s3virge", + "siliconmotion", + "sis", + "tdfx", + "tga", + "trident", + "tseng", + "vga", + "vesa", + }; + static int ndrivers = sizeof(drivers) / sizeof(drivers[0]); +#endif + + nlist = 0; + while (device) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); + list[nlist] = XtMalloc(sizeof(Edit) + + strlen(device->dev_identifier) + 1); + sprintf(list[nlist], "%s%s", Edit, device->dev_identifier); + devices = (XF86ConfDevicePtr*)XtRealloc((XtPointer)devices, (nlist + 1) * + sizeof(XF86ConfDevicePtr)); + devices[nlist] = device; + ++nlist; + device = (XF86ConfDevicePtr)(device->list.next); + } + + device = NULL; + + if (nlist) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*)); + list[nlist++] = XtNewString("Add new card"); + if (nlist == 2) { + i = strlen("Remove ") + strlen(devices[0]->dev_identifier) + 1; + list[nlist] = XtMalloc(i); + XmuSnprintf(list[nlist], i, "Remove %s", devices[0]->dev_identifier); + ++nlist; + } + else + list[nlist++] = XtNewString("Remove device"); + ClearScreen(); + refresh(); + i = DialogMenu("Card configuration", + "You can edit or remove a previously configured " + "card, or add a new one.", 14, 60, 4, nlist, list, + " Ok ", " Cancel ", 0); + if (i < 0) { + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)devices); + return (-1); + } + if (nlist > 2 && i == nlist - 1) { + if (nlist > 3) { + for (i = 0; i < nlist - 2; i++) { + /* XXX Remove the "Edit " from list entries */ + memmove(list[i], list[i] + sizeof(Edit) - 1, + strlen(list[i]) - sizeof(Edit) + 2); + } + ClearScreen(); + refresh(); + i = DialogMenu("Remove card", + "Select which card to remove", + 13, 60, 4, nlist - 2, list, + " Remove ", " Cancel ", 0); + if (i < 0) { + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)devices); + return (-1); + } + device = devices[i]; + } + else + device = devices[0]; + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)devices); + xf86removeDevice(XF86Config, device); + return (0); + } + if (i < nlist - 2) + device = devices[i]; + } + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)devices); + + if (device == NULL) { + char label[32]; + + device = (XF86ConfDevicePtr)XtCalloc(1, sizeof(XF86ConfDeviceRec)); + device->dev_chipid = device->dev_chiprev = device->dev_irq = -1; + XmuSnprintf(label, sizeof(label), "Card%d", nlist ? nlist - 2 : 0); + ClearScreen(); + refresh(); + identifier = + DialogInput("Card identifier", + "Enter an identifier for your card definition:", + 11, 40, label, + " Next >>", " Cancel ", 0); + if (identifier == NULL) { + XtFree((XtPointer)device); + return (-1); + } + } + + ClearScreen(); + refresh(); + if (Dialog("Card configuration", + "Now we must configure video card specific settings. At this " + "point you can choose to make a selection out of a database of " + "video card definitions.\n" + "\n" + "The database entries include information about the chipset, " + "what driver to run, the Ramdac and ClockChip, and comments " + "that will be included in the Device section. However, a lot " + "of definitions only hint about what driver to run (based on " + "the chipset the card uses) and are untested.\n" + "\n" + "Do you want to look at the card database?", + 18, 60, " Yes ", " No ", device->dev_identifier != NULL) == 0) { + static char **cards; + static int ncards; + + if (cards == NULL) { + ReadCardsDatabase(); + cards = GetCardNames(&ncards); + cards = (char**)XtRealloc((XtPointer)cards, + (ncards + 1) * sizeof(char*)); + for (i = ncards; i > 0; i--) + cards[i] = cards[i - 1]; + cards[0] = "** Unlisted card **"; + } + if (device->dev_card) + entry = LookupCard(device->dev_card); + def = 0; + if (entry) { + for (i = 0; i < NumCardsEntry; i++) + if (strcasecmp(CardsDB[i]->name, entry->name) == 0) { + def = i + 1; + break; + } + /* make sure entry is set to null again */ + entry = NULL; + } + + i = DialogMenu("Card database", + "Select name that better matches your card:", + 20, 70, 11, ncards, cards, "Next >>", " Cancel ", def); + if (i > 0) + entry = LookupCard(cards[i]); + } + + def = 0; + tmp = device->dev_driver ? device->dev_driver : entry && entry->driver ? + entry->driver : "vga"; + for (i = 0; i < ndrivers; i++) + if (strcmp(drivers[i], tmp) == 0) { + def = i; + break; + } + + ClearScreen(); + refresh(); + i = DialogMenu("Card driver", + "You can select the driver for your card here, or just press " + "Enter to use the default/current:", 20, 50, 9, + ndrivers, drivers, " Ok ", " Cancel ", def); + if (i < 0) { + if (device->dev_identifier == NULL) { + XtFree(identifier); + XtFree((XtPointer)device); + } + return (-1); + } + driver = ndrivers ? drivers[i] : "vga"; + + ClearScreen(); + refresh(); + tmp = device->dev_busid ? device->dev_busid : ""; + busid = DialogInput("Card BusID", + "You normally does not need to fill this field " + "if you have only one video card:", 11, 50, tmp, + " Finish ", " Cancel ", 0); + + /* Finish card configuration */ + if (entry) { + XtFree(device->dev_card); + device->dev_card = XtNewString(entry->name); + if (entry->chipset) { + XtFree(device->dev_chipset); + device->dev_chipset = XtNewString(entry->chipset); + } + if (entry->ramdac) { + XtFree(device->dev_ramdac); + device->dev_ramdac = XtNewString(entry->ramdac); + } + if (entry->clockchip) { + XtFree(entry->clockchip); + device->dev_clockchip = XtNewString(entry->clockchip); + } + } + if (busid) { + XtFree(device->dev_busid); + if (*busid) + device->dev_busid = busid; + else { + device->dev_busid = NULL; + XtFree(busid); + } + } + XtFree(device->dev_driver); + device->dev_driver = XtNewString(driver); + if (device->dev_identifier == NULL) { + device->dev_identifier = identifier; + XF86Config->conf_device_lst = + xf86addDevice(XF86Config->conf_device_lst, device); + } + + return (1); +} + +static char *depths[] = { + "1 bit, monochrome", + "4 bit, 16 colors", + "8 bit, 256 colors", + "15 bits, 32Kb colors", + "16 bits, 65Kb colors", + "24 bits, 16Mb colors", +}; + +static char *modes[] = { + "1600x1200", + "1280x1024", + "1280x960", + "1152x864", + "1024x768", + "800x600", + "640x480", + "640x400", + "512x384", + "400x300", + "320x240", + "320x200", +}; + +static int +ScreenConfig(void) +{ + int i, disp_allocated; + XF86ConfScreenPtr *screens = NULL, screen = XF86Config->conf_screen_lst; + char **list = NULL, *identifier = NULL; + int nlist, def; + XF86ConfDevicePtr device; + XF86ConfMonitorPtr monitor; + XF86ConfDisplayPtr display; + XF86ModePtr mode, ptr; + char *checks; + + nlist = 0; + while (screen) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); + list[nlist] = XtMalloc(sizeof(Edit) + + strlen(screen->scrn_identifier) + 1); + sprintf(list[nlist], "%s%s", Edit, screen->scrn_identifier); + screens = (XF86ConfScreenPtr*)XtRealloc((XtPointer)screens, (nlist + 1) * + sizeof(XF86ConfScreenPtr)); + screens[nlist] = screen; + ++nlist; + screen = (XF86ConfScreenPtr)(screen->list.next); + } + + screen = NULL; + + if (nlist) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*)); + list[nlist++] = XtNewString("Add new screen"); + if (nlist == 2) { + i = strlen("Remove ") + strlen(screens[0]->scrn_identifier) + 1; + list[nlist] = XtMalloc(i); + XmuSnprintf(list[nlist], i, "Remove %s", screens[0]->scrn_identifier); + ++nlist; + } + else + list[nlist++] = XtNewString("Remove screen"); + ClearScreen(); + refresh(); + i = DialogMenu("Screen configuration", + "You can edit or remove a previously configured " + "screen, or add a new one.", 14, 60, 4, nlist, list, + " Ok ", " Cancel ", 0); + if (i < 0) { + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)screens); + return (-1); + } + if (nlist > 2 && i == nlist - 1) { + if (nlist > 3) { + for (i = 0; i < nlist - 2; i++) { + /* XXX Remove the "Edit " from list entries */ + memmove(list[i], list[i] + sizeof(Edit) - 1, + strlen(list[i]) - sizeof(Edit) + 2); + } + ClearScreen(); + refresh(); + i = DialogMenu("Remove screen", + "Select which screen to remove", + 13, 60, 4, nlist - 2, list, + " Remove ", " Cancel ", 0); + if (i < 0) { + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)screens); + return (-1); + } + screen = screens[i]; + } + else + screen = screens[0]; + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)screens); + xf86removeScreen(XF86Config, screen); + return (0); + } + if (i < nlist - 2) + screen = screens[i]; + } + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)screens); + + if (screen == NULL) { + char label[256]; + XF86ConfDevicePtr *devices = NULL; + XF86ConfMonitorPtr *monitors = NULL; + + device = XF86Config->conf_device_lst; + monitor = XF86Config->conf_monitor_lst; + + if (device == NULL || monitor == NULL) { + ClearScreen(); + refresh(); + Dialog("Configuration error", + "You need to configure (at least) one card and one " + "monitor before creating a screen definition.", + 9, 50, " Ok ", NULL, 0); + + return (-1); + } + + XmuSnprintf(label, sizeof(label), "Screen%d", nlist ? nlist - 2 : 0); + ClearScreen(); + refresh(); + identifier = + DialogInput("Screen identifier", + "Enter an identifier for your screen definition:", + 11, 40, label, + " Next >>", " Cancel ", 0); + if (identifier == NULL) + return (-1); + + nlist = 0; + list = NULL; + while (device) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); + list[nlist] = XtNewString(device->dev_identifier); + devices = (XF86ConfDevicePtr*)XtRealloc((XtPointer)devices, (nlist + 1) * + sizeof(XF86ConfDevicePtr)); + devices[nlist] = device; + ++nlist; + device = (XF86ConfDevicePtr)(device->list.next); + } + ClearScreen(); + refresh(); + i = DialogMenu("Screen card", "Please select a video card:", + 13, 60, 4, nlist, list, " Next >>", " Cancel ", 0); + for (def = 0; def < nlist; def++) + XtFree(list[def]); + XtFree((XtPointer)list); + if (i < 0) { + XtFree(identifier); + XtFree((XtPointer)devices); + return (-1); + } + device = devices[i]; + XtFree((XtPointer)devices); + + nlist = 0; + list = NULL; + while (monitor) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); + list[nlist] = XtNewString(monitor->mon_identifier); + monitors = (XF86ConfMonitorPtr*)XtRealloc((XtPointer)monitors, (nlist + 1) * + sizeof(XF86ConfMonitorPtr)); + monitors[nlist] = monitor; + ++nlist; + monitor = (XF86ConfMonitorPtr)(monitor->list.next); + } + XmuSnprintf(label, sizeof(label), + "Select the monitor connected to \"%s\":", + device->dev_identifier); + ClearScreen(); + refresh(); + i = DialogMenu("Screen monitor", label, + 13, 60, 4, nlist, list, " Next >>", " Cancel ", 0); + for (def = 0; def < nlist; def++) + XtFree(list[def]); + XtFree((XtPointer)list); + if (i < 0) { + XtFree(identifier); + XtFree((XtPointer)monitors); + return (-1); + } + monitor = monitors[i]; + XtFree((XtPointer)monitors); + + screen = (XF86ConfScreenPtr)XtCalloc(1, sizeof(XF86ConfScreenRec)); + screen->scrn_device = device; + screen->scrn_monitor = monitor; + } + + if (screen->scrn_defaultdepth == 1) + def = 0; + else if (screen->scrn_defaultdepth == 4) + def = 1; + else if (screen->scrn_defaultdepth == 8) + def = 2; + else if (screen->scrn_defaultdepth == 15) + def = 3; + else if (screen->scrn_defaultdepth == 16) + def = 4; + else if (screen->scrn_defaultdepth == 24) + def = 5; + else + def = 2; + ClearScreen(); + refresh(); + i = DialogMenu("Screen depth", + "Please specify which color depth you want to use by default:", + 15, 60, 6, sizeof(depths) / sizeof(depths[0]), depths, + " Next >>", " Cancel ", def); + if (i < 0) { + if (screen->scrn_identifier == NULL) { + XtFree(identifier); + XtFree((XtPointer)screen); + } + return (-1); + } + else + /* XXX depths must begin with the depth number */ + screen->scrn_defaultdepth = atoi(depths[i]); + + def = 0; /* use def to count how many modes are selected*/ + nlist = 0; + list = NULL; + checks = XtMalloc(sizeof(modes) / sizeof(modes[0])); + /* XXX list fields in the code below are not allocated */ + disp_allocated = 0; + display = screen->scrn_display_lst; + while (display && display->disp_depth != screen->scrn_defaultdepth) + display = (XF86ConfDisplayPtr)(display->list.next); + if (display == NULL) { + display = (XF86ConfDisplayPtr)XtCalloc(1, sizeof(XF86ConfDisplayRec)); + display->disp_white.red = display->disp_black.red = -1; + display->disp_depth = screen->scrn_defaultdepth; + disp_allocated = 1; + } + else { + mode = display->disp_mode_lst; + while (mode) { + for (i = 0; i < sizeof(modes) / sizeof(modes[0]); i++) + if (strcmp(modes[i], mode->mode_name) == 0) { + break; + } + + if (i == sizeof(modes) / sizeof(modes[0])) { + list = (char**)XtRealloc((XtPointer)list, + (nlist + 1) * sizeof(char*)); + list[nlist] = mode->mode_name; + checks = XtRealloc(checks, sizeof(modes) / sizeof(modes[0]) + + nlist + 1); + checks[nlist] = 1; + ++def; + nlist++; + break; + } + mode = (XF86ModePtr)(mode->list.next); + } + } + + for (i = 0; i < sizeof(modes) / sizeof(modes[0]); i++) + checks[i + nlist] = 0; + + mode = display->disp_mode_lst; + while (mode) { + for (i = 0; i < sizeof(modes) / sizeof(modes[0]); i++) + if (strcmp(modes[i], mode->mode_name) == 0) { + ++def; + checks[i + nlist] = 1; + break; + } + mode = (XF86ModePtr)(mode->list.next); + } + + if (nlist == 0 && def == 0) + checks[6] = 1; /* 640x480 */ + list = (char**)XtRealloc((XtPointer)list, (nlist + sizeof(modes) / + sizeof(modes[0])) * sizeof(char*)); + for (i = 0; i < sizeof(modes) / sizeof(modes[0]); i++) + list[i + nlist] = modes[i]; + nlist += sizeof(modes) / sizeof(modes[0]); + + ClearScreen(); + refresh(); + i = DialogCheckBox("Screen modes", + "Select the video modes for this screen:", + 17, 60, 8, sizeof(modes) / sizeof(modes[0]), modes, + " Finish ", " Cancel ", checks); + if (i < 0) { + if (screen->scrn_identifier == NULL) { + XtFree(identifier); + XtFree((XtPointer)screen); + XtFree((XtPointer)list); + if (disp_allocated) + XtFree((XtPointer)display); + } + return (-1); + } + + mode = display->disp_mode_lst; + while (mode) { + ptr = (XF86ModePtr)(mode->list.next); + XtFree(mode->mode_name); + XtFree((XtPointer)mode); + mode = ptr; + } + display->disp_mode_lst = NULL; + + for (i = 0; i < nlist; i++) { + if (checks[i]) { + mode = (XF86ModePtr)XtCalloc(1, sizeof(XF86ModeRec)); + mode->mode_name = XtNewString(list[i]); + if (display->disp_mode_lst == NULL) + display->disp_mode_lst = ptr = mode; + else { + ptr->list.next = mode; + ptr = mode; + } + } + } + XtFree((XtPointer)list); + + if (disp_allocated) { + display->list.next = screen->scrn_display_lst; + if (screen->scrn_display_lst == NULL) + screen->scrn_display_lst = display; + else + screen->scrn_display_lst->list.next = display; + } + + if (screen->scrn_identifier == NULL) { + screen->scrn_identifier = identifier; + screen->scrn_monitor_str = XtNewString(monitor->mon_identifier); + screen->scrn_device_str = XtNewString(device->dev_identifier); + XF86Config->conf_screen_lst = + xf86addScreen(XF86Config->conf_screen_lst, screen); + } + + return (1); +} + +static XF86ConfAdjacencyPtr +CopyAdjacency(XF86ConfAdjacencyPtr ptr) +{ + XF86ConfAdjacencyPtr adj = (XF86ConfAdjacencyPtr) + XtCalloc(1, sizeof(XF86ConfAdjacencyRec)); + + adj->adj_scrnum = ptr->adj_scrnum; + adj->adj_screen = ptr->adj_screen; + adj->adj_screen_str = XtNewString(adj->adj_screen_str); + adj->adj_top = ptr->adj_top; + if (ptr->adj_top_str) + adj->adj_top_str = XtNewString(ptr->adj_top_str); + adj->adj_bottom = ptr->adj_bottom; + if (ptr->adj_bottom_str) + adj->adj_bottom_str = XtNewString(ptr->adj_bottom_str); + adj->adj_left = ptr->adj_left; + if (ptr->adj_left_str) + adj->adj_left_str = XtNewString(ptr->adj_left_str); + adj->adj_right = ptr->adj_right; + if (ptr->adj_right_str) + adj->adj_right_str = XtNewString(ptr->adj_right_str); + adj->adj_where = ptr->adj_where; + adj->adj_x = ptr->adj_x; + adj->adj_y = ptr->adj_y; + if (ptr->adj_refscreen) + adj->adj_refscreen = XtNewString(ptr->adj_refscreen); + + return (adj); +} + +static XF86ConfInactivePtr +CopyInactive(XF86ConfInactivePtr ptr) +{ + XF86ConfInactivePtr inac = (XF86ConfInactivePtr) + XtCalloc(1, sizeof(XF86ConfInactiveRec)); + + inac->inactive_device = ptr->inactive_device; + if (ptr->inactive_device_str) + inac->inactive_device_str = XtNewString(ptr->inactive_device_str); + + return (inac); +} + +static XF86ConfInputrefPtr +CopyInputref(XF86ConfInputrefPtr ptr) +{ + XF86ConfInputrefPtr iref = (XF86ConfInputrefPtr) + XtCalloc(1, sizeof(XF86ConfInputrefRec)); + XF86OptionPtr opt = ptr->iref_option_lst; + + iref->iref_inputdev = ptr->iref_inputdev; + if (ptr->iref_inputdev_str) + iref->iref_inputdev_str = XtNewString(ptr->iref_inputdev_str); + while (opt) { + iref->iref_option_lst = xf86addNewOption(iref->iref_option_lst, + XtNewString(opt->opt_name), + opt->opt_val ? XtNewString(opt->opt_val) : NULL); + opt = (XF86OptionPtr)(opt->list.next); + } + + return (iref); +} + +static XF86ConfLayoutPtr +CopyLayout(XF86ConfLayoutPtr ptr) +{ + XF86ConfLayoutPtr lay = (XF86ConfLayoutPtr) + XtCalloc(1, sizeof(XF86ConfLayoutRec)); + XF86ConfAdjacencyPtr adj = ptr->lay_adjacency_lst, padj; + XF86ConfInactivePtr inac = ptr->lay_inactive_lst, pinac; + XF86ConfInputrefPtr iref = ptr->lay_input_lst, piref; + XF86OptionPtr opt = ptr->lay_option_lst; + + if (ptr->lay_identifier) + lay->lay_identifier = XtNewString(ptr->lay_identifier); + if (adj) { + padj = lay->lay_adjacency_lst = CopyAdjacency(adj); + adj = (XF86ConfAdjacencyPtr)(adj->list.next); + while (adj) { + padj->list.next = CopyAdjacency(adj); + padj = (XF86ConfAdjacencyPtr)(padj->list.next); + adj = (XF86ConfAdjacencyPtr)(adj->list.next); + } + } + if (inac) { + pinac = lay->lay_inactive_lst = CopyInactive(inac); + inac = (XF86ConfInactivePtr)(inac->list.next); + while (inac) { + pinac->list.next = CopyInactive(inac); + pinac = (XF86ConfInactivePtr)(pinac->list.next); + inac = (XF86ConfInactivePtr)(inac->list.next); + } + } + if (iref) { + piref = lay->lay_input_lst = CopyInputref(iref); + iref = (XF86ConfInputrefPtr)(iref->list.next); + while (iref) { + piref->list.next = CopyInputref(iref); + piref = (XF86ConfInputrefPtr)(piref->list.next); + iref = (XF86ConfInputrefPtr)(iref->list.next); + } + } + + while (opt) { + lay->lay_option_lst = xf86addNewOption(lay->lay_option_lst, + XtNewString(opt->opt_name), + opt->opt_val ? XtNewString(opt->opt_val) : NULL); + opt = (XF86OptionPtr)(opt->list.next); + } + + return (lay); +} + +static void +FreeLayout(XF86ConfLayoutPtr lay) +{ + static XF86ConfigRec xf86config; + + xf86config.conf_layout_lst = lay; + xf86removeLayout(&xf86config, lay); +} + +static int +LayoutConfig(void) +{ + int i; + XF86ConfLayoutPtr *layouts = NULL, rlayout = NULL, + layout = XF86Config->conf_layout_lst; + XF86ConfInputPtr input = XF86Config->conf_input_lst; + char **list = NULL, *identifier = NULL; + XF86ConfInputPtr *mouses = NULL, *keyboards = NULL, mouse, keyboard; + XF86ConfInputrefPtr iref, piref, mref, kref; + XF86ConfAdjacencyPtr adj, padj; + int nmouses, nkeyboards; + int nlist; + XF86OptionPtr option; + XF86ConfScreenPtr screen, *screens; + + nmouses = nkeyboards = 0; + while (input) { + if (strcmp(input->inp_driver, "mouse") == 0) { + mouses = (XF86ConfInputPtr*)XtRealloc((XtPointer)mouses, + (nmouses + 1) * sizeof(XF86ConfInputPtr)); + mouses[nmouses] = input; + ++nmouses; + } + else if (strcmp(input->inp_driver, "keyboard") == 0) { + keyboards = (XF86ConfInputPtr*)XtRealloc((XtPointer)keyboards, + (nkeyboards + 1) * sizeof(XF86ConfInputPtr)); + keyboards[nkeyboards] = input; + ++nkeyboards; + } + input = (XF86ConfInputPtr)(input->list.next); + } + if (XF86Config->conf_screen_lst == NULL || + nmouses == 0 || nkeyboards == 0) { + XtFree((XtPointer)mouses); + XtFree((XtPointer)keyboards); + ClearScreen(); + refresh(); + Dialog("Configuration error", + "You need to configure (at least) one screen, mouse " + "and keyboard before creating a layout definition.", + 9, 50, " Ok ", NULL, 0); + return (-1); + } + + nlist = 0; + while (layout) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); + list[nlist] = XtMalloc(sizeof(Edit) + + strlen(layout->lay_identifier) + 1); + sprintf(list[nlist], "%s%s", Edit, layout->lay_identifier); + layouts = (XF86ConfLayoutPtr*)XtRealloc((XtPointer)layouts, (nlist + 1) * + sizeof(XF86ConfLayoutPtr)); + layouts[nlist] = layout; + ++nlist; + layout = (XF86ConfLayoutPtr)(layout->list.next); + } + + layout = NULL; + + if (nlist) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 2) * sizeof(char*)); + list[nlist++] = XtNewString("Add new layout"); + if (nlist == 2) { + i = strlen("Remove ") + strlen(layouts[0]->lay_identifier) + 1; + list[nlist] = XtMalloc(i); + XmuSnprintf(list[nlist], i, "Remove %s", layouts[0]->lay_identifier); + ++nlist; + } + else + list[nlist++] = XtNewString("Remove layout"); + ClearScreen(); + refresh(); + i = DialogMenu("Layout configuration", + "You can edit or remove a previously configured " + "layout, or add a new one.", 14, 60, 4, nlist, list, + " Ok ", " Cancel ", 0); + if (i < 0) { + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)layouts); + XtFree((XtPointer)mouses); + XtFree((XtPointer)keyboards); + return (-1); + } + if (nlist > 2 && i == nlist - 1) { + if (nlist > 3) { + for (i = 0; i < nlist - 2; i++) { + /* XXX Remove the "Edit " from list entries */ + memmove(list[i], list[i] + sizeof(Edit) - 1, + strlen(list[i]) - sizeof(Edit) + 2); + } + ClearScreen(); + refresh(); + i = DialogMenu("Remove layout", + "Select which layout to remove", + 13, 60, 4, nlist - 2, list, + " Remove ", " Cancel ", 0); + if (i < 0) { + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)layouts); + XtFree((XtPointer)mouses); + XtFree((XtPointer)keyboards); + return (-1); + } + layout = layouts[i]; + } + else + layout = layouts[0]; + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)layouts); + XtFree((XtPointer)mouses); + XtFree((XtPointer)keyboards); + xf86removeLayout(XF86Config, layout); + return (0); + } + if (i < nlist - 2) + layout = layouts[i]; + } + for (i = 0; i < nlist; i++) + XtFree(list[i]); + XtFree((XtPointer)list); + XtFree((XtPointer)layouts); + + if (layout == NULL) { + char label[32]; + + layout = (XF86ConfLayoutPtr)XtCalloc(1, sizeof(XF86ConfLayoutRec)); + XmuSnprintf(label, sizeof(label), "Layout%d", nlist ? nlist - 2 : 0); + ClearScreen(); + refresh(); + identifier = + DialogInput("Layout identifier", + "Enter an identifier for your layout definition:", + 11, 40, label, + " Next >>", " Cancel ", 0); + if (identifier == NULL) { + XtFree((XtPointer)layout); + XtFree((XtPointer)mouses); + XtFree((XtPointer)keyboards); + return (-1); + } + } + else { + /* So that we can safely change it */ + rlayout = layout; + layout = CopyLayout(rlayout); + } + + + mouse = keyboard = NULL; + + /* Mouse */ + piref = NULL; + iref = layout->lay_input_lst; + while (iref) { + if (strcmp(iref->iref_inputdev->inp_driver, "mouse") == 0) { + if (mouse == NULL) + piref = iref; + if (xf86findOption(iref->iref_option_lst, "CorePointer")) { + mouse = iref->iref_inputdev; + piref = iref; + break; + } + } + iref = (XF86ConfInputrefPtr)(iref->list.next); + } + if (mouse == NULL) { + if (piref) { + mref = piref; + mouse = piref->iref_inputdev; + piref->iref_option_lst = + xf86addNewOption(piref->iref_option_lst, + XtNewString("CorePointer"), NULL); + } + else { + mouse = mouses[0]; + mref = iref = (XF86ConfInputrefPtr)XtCalloc(1, sizeof(XF86ConfInputrefRec)); + iref->iref_inputdev_str = XtNewString(mouse->inp_identifier); + iref->iref_inputdev = mouse; + iref->iref_option_lst = + xf86addNewOption(iref->iref_option_lst, + XtNewString("CorePointer"), NULL); + iref->list.next = layout->lay_input_lst; + if (layout->lay_input_lst == NULL) + layout->lay_input_lst = iref; + else { + iref->list.next = layout->lay_input_lst; + layout->lay_input_lst = iref; + } + } + } + else + mref = piref; + + /* XXX list fields are not allocated */ + if (nmouses > 1) { + nlist = 0; + list = (char**)XtMalloc(sizeof(char*)); + list[nlist++] = mouse->inp_identifier; + input = XF86Config->conf_input_lst; + while (input) { + if (input != mouse && strcmp(input->inp_driver, "mouse") == 0) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); + list[nlist++] = input->inp_identifier; + } + input = (XF86ConfInputPtr)(input->list.next); + } + ClearScreen(); + refresh(); + i = DialogMenu("Select Core Pointer", + "Select the mouse connected to you computer", + 12, 60, 4, nlist, list, " Ok ", " Cancel ", 0); + if (i < 0) { + XtFree((XtPointer)mouses); + XtFree((XtPointer)keyboards); + XtFree((XtPointer)list); + if (layout->lay_identifier == NULL) + XtFree(identifier); + FreeLayout(layout); + return (-1); + } + if (i > 0) { + /* Did not select the default one */ + iref = layout->lay_input_lst; + while (iref) { + if (strcasecmp(iref->iref_inputdev_str, list[i]) == 0) { + if ((option = xf86findOption(iref->iref_option_lst, + "SendCoreEvents")) != NULL) { + XtFree(option->opt_name); + option->opt_name = XtNewString("CorePointer"); + } + else + iref->iref_option_lst = + xf86addNewOption(iref->iref_option_lst, + "CorePointer", NULL); + option = xf86findOption(mref->iref_option_lst, + "CorePointer"); + XtFree(option->opt_name); + option->opt_name = XtNewString("SendCoreEvents"); + break; + } + iref = (XF86ConfInputrefPtr)(iref->list.next); + } + } + + /* XXX Write code to add/remove more mouses here */ + } + + + /* Keyboard */ + piref = NULL; + iref = layout->lay_input_lst; + while (iref) { + if (strcmp(iref->iref_inputdev->inp_driver, "keyboard") == 0) { + if (keyboard == NULL) + piref = iref; + if (xf86findOption(iref->iref_option_lst, "CoreKeyboard")) { + keyboard = iref->iref_inputdev; + piref = iref; + break; + } + } + iref = (XF86ConfInputrefPtr)(iref->list.next); + } + if (keyboard == NULL) { + if (piref) { + kref = piref; + keyboard = piref->iref_inputdev; + piref->iref_option_lst = + xf86addNewOption(piref->iref_option_lst, + XtNewString("CoreKeyboard"), NULL); + } + else { + keyboard = keyboards[0]; + kref = iref = (XF86ConfInputrefPtr)XtCalloc(1, sizeof(XF86ConfInputrefRec)); + iref->iref_inputdev_str = XtNewString(keyboard->inp_identifier); + iref->iref_inputdev = keyboard; + iref->iref_option_lst = + xf86addNewOption(iref->iref_option_lst, + XtNewString("CoreKeyboard"), NULL); + iref->list.next = layout->lay_input_lst; + if (layout->lay_input_lst == NULL) + layout->lay_input_lst = iref; + else { + iref->list.next = layout->lay_input_lst; + layout->lay_input_lst = iref; + } + } + } + else + kref = piref; + + /* XXX list fields are not allocated */ + if (nkeyboards > 1) { + nlist = 0; + list = (char**)XtMalloc(sizeof(char*)); + list[nlist++] = keyboard->inp_identifier; + input = XF86Config->conf_input_lst; + while (input) { + if (input != keyboard && strcmp(input->inp_driver, "keyboard") == 0) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); + list[nlist++] = input->inp_identifier; + } + input = (XF86ConfInputPtr)(input->list.next); + } + ClearScreen(); + refresh(); + i = DialogMenu("Select Core Keyboard", + "Select the keyboard connected to you computer", + 12, 60, 4, nlist, list, " Ok ", " Cancel ", 0); + if (i < 0) { + XtFree((XtPointer)mouses); + XtFree((XtPointer)keyboards); + XtFree((XtPointer)list); + if (layout->lay_identifier == NULL) + XtFree(identifier); + FreeLayout(layout); + return (-1); + } + if (i > 0) { + /* Did not select the default one */ + iref = layout->lay_input_lst; + while (iref) { + if (strcasecmp(iref->iref_inputdev_str, list[i]) == 0) { + if ((option = xf86findOption(iref->iref_option_lst, + "SendCoreEvents")) != NULL) { + XtFree(option->opt_name); + option->opt_name = XtNewString("CoreKeyboard"); + } + else + iref->iref_option_lst = + xf86addNewOption(iref->iref_option_lst, + "CoreKeyboard", NULL); + option = xf86findOption(kref->iref_option_lst, + "CoreKeyboard"); + XtFree(option->opt_name); + option->opt_name = XtNewString("SendCoreEvents"); + break; + } + iref = (XF86ConfInputrefPtr)(iref->list.next); + } + } + + /* XXX Write code to add/remove more keyboards here */ + } + + XtFree((XtPointer)mouses); + XtFree((XtPointer)keyboards); + + /* Just one screen */ + if (XF86Config->conf_screen_lst->list.next == NULL) { + ClearScreen(); + refresh(); + Dialog("Layout configuration", + (nmouses > 1 && nkeyboards > 1) ? + "As you have only one screen configured, I can now finish " + "creating this Layout configuration." + : + "As you have only one screen, mouse and keyboard configured, " + "I can now finish creating this Layout configuration.", + 12, 60, " Finish ", NULL, 0); + + goto LayoutFinish; + } + + + /* The code below just adds a screen to the right of the last + * one, or allows removing a screen. + * Needs some review, and adding more options. + */ + + /*CONSTCOND*/ + while (1) { + static char *screen_opts[] = { + "Add a new screen to layout", + "Remove screen from layout", + "Finish layout configuration", + }; + + ClearScreen(); + refresh(); + i = DialogMenu("Layout configuration", "Please choose one option:", + 12, 60, 3, sizeof(screen_opts) / sizeof(screen_opts[0]), + screen_opts, " Done ", " Cancel all changes ", 2); + + /* cancel */ + if (i < 0) { + XtFree(identifier); + FreeLayout(layout); + return (-1); + } + + /* add new screen */ + else if (i == 0) { + nlist = 0; + list = NULL; + screens = NULL; + screen = XF86Config->conf_screen_lst; + while (screen) { + adj = layout->lay_adjacency_lst; + while (adj) { + if (adj->adj_screen == screen) + break; + adj = (XF86ConfAdjacencyPtr)(adj->list.next); + } + if (adj == NULL) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); + screens = (XF86ConfScreenPtr*)XtRealloc((XtPointer)screens, + (nlist + 1) * sizeof(XF86ConfScreenPtr)); + /* NOT duplicated */ + list[nlist] = screen->scrn_identifier; + screens[nlist] = screen; + ++nlist; + } + screen = (XF86ConfScreenPtr)(screen->list.next); + } + + if (nlist == 0) + continue; + + ClearScreen(); + refresh(); + i = DialogMenu("Layout add screen", "Choose screen to add:", + 12, 60, 3, nlist, list, + " Add ", " Cancel ", 0); + if (i >= 0) { + padj = layout->lay_adjacency_lst; + adj = (XF86ConfAdjacencyPtr) + XtCalloc(1, sizeof(XF86ConfAdjacencyRec)); + adj->adj_screen = screens[i]; + if (padj == NULL) { + adj->adj_where = CONF_ADJ_ABSOLUTE; + layout->lay_adjacency_lst = adj; + } + else { + while (padj->list.next) + padj = (XF86ConfAdjacencyPtr)(padj->list.next); + padj->list.next = adj; + adj->adj_where = CONF_ADJ_RIGHTOF; + adj->adj_refscreen = + XtNewString(padj->adj_screen->scrn_identifier); + } + } + XtFree((XtPointer)list); + XtFree((XtPointer)screens); + } + + /* remove a screen */ + else if (i == 1) { + nlist = 0; + list = NULL; + screens = NULL; + adj = layout->lay_adjacency_lst; + + while (adj) { + list = (char**)XtRealloc((XtPointer)list, (nlist + 1) * sizeof(char*)); + screens = (XF86ConfScreenPtr*)XtRealloc((XtPointer)screens, + (nlist + 1) * sizeof(XF86ConfScreenPtr)); + list[nlist] = adj->adj_screen->scrn_identifier; + screens[nlist] = adj->adj_screen; + ++nlist; + adj = (XF86ConfAdjacencyPtr)(adj->list.next); + } + + if (nlist == 0) + continue; + + ClearScreen(); + refresh(); + i = DialogMenu("Layout remove screen", "Choose screen to remove:", + 12, 60, 3, nlist, list, + " Remove ", " Cancel ", 0); + + adj = padj = layout->lay_adjacency_lst; + while (adj) { + if (adj->adj_screen == screens[i]) { + padj = (XF86ConfAdjacencyPtr)(padj->list.next); + if (padj && adj->adj_where == CONF_ADJ_RIGHTOF && + padj->adj_where == CONF_ADJ_RIGHTOF) { + XtFree(padj->adj_refscreen); + padj->adj_refscreen = XtNewString(adj->adj_refscreen); + } + xf86removeAdjacency(layout, adj); + break; + } + padj = adj; + adj = (XF86ConfAdjacencyPtr)(padj->list.next); + } + XtFree((XtPointer)list); + XtFree((XtPointer)screens); + } + + /* finish screen configuration */ + else + break; + } + +LayoutFinish: + if (layout->lay_adjacency_lst == NULL) { + adj = (XF86ConfAdjacencyPtr)XtCalloc(1, sizeof(XF86ConfAdjacencyRec)); + adj->adj_screen = XF86Config->conf_screen_lst; + adj->adj_screen_str = XtNewString(XF86Config->conf_screen_lst->scrn_identifier); + adj->adj_where = CONF_ADJ_ABSOLUTE; + layout->lay_adjacency_lst = adj; + } + if (rlayout) { + /* just edited this layout */ + if (nmouses > 1 || nkeyboards > 1) { + XF86ConfAdjacencyPtr tadj = rlayout->lay_adjacency_lst; + XF86ConfInactivePtr tinac = rlayout->lay_inactive_lst; + XF86ConfInputrefPtr tinp = rlayout->lay_input_lst; + + rlayout->lay_adjacency_lst = layout->lay_adjacency_lst; + rlayout->lay_inactive_lst = layout->lay_inactive_lst; + rlayout->lay_input_lst = layout->lay_input_lst; + + layout->lay_adjacency_lst = tadj; + layout->lay_inactive_lst = tinac; + layout->lay_input_lst = tinp; + FreeLayout(layout); + } + return (0); + } + else { + layout->lay_identifier = identifier; + XF86Config->conf_layout_lst = + xf86addLayout(XF86Config->conf_layout_lst, layout); + } + + return (1); +} + +static void +ClearScreen(void) +{ + int i, j; + + wattrset(stdscr, screen_attr); + for (i = 0; i < LINES; i++) { + wmove(stdscr, i, 0); + for (j = 0; j < COLS; j++) + waddch(stdscr, ACS_PLUS); + } + touchwin(stdscr); +} + +static int +Dialog(char *title, char * prompt, int height, int width, + char *label1, char *label2, int button) +{ + int x, x1, x2, y, key, l1len, l2len; + WINDOW *dialog; + + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + PaintWindow(dialog, title, 0, 0, height, width); + wattrset(dialog, dialog_attr); + PrintWrap(dialog, prompt, width - 3, 2, 3); + + l1len = strlen(label1); + if (label2) + l2len = strlen(label2); + else { + l2len = button = 0; + } + + x1 = (width - (l1len + l2len)) / (label2 ? 3 : 2); + x2 = x1 + x1 + l1len; + y = height - 3; + if (!button) { + if (label2) + PaintButton(dialog, label2, y, x2, FALSE); + PaintButton(dialog, label1, y, x1, TRUE); + } + else { + PaintButton(dialog, label1, y, x1, FALSE); + if (label2) + PaintButton(dialog, label2, y, x2, TRUE); + } + wrefresh(dialog); + + /*CONSTCOND*/ + while (1) { + key = wgetch(dialog); + switch (key) { + case KEY_LEFT: + case KEY_RIGHT: + if (!button) { + if (label2) { + button = 1; + PaintButton(dialog, label1, y, x1, FALSE); + PaintButton(dialog, label2, y, x2, TRUE); + } + + } + else { + if (label2) { + button = 0; + PaintButton(dialog, label2, y, x2, FALSE); + PaintButton(dialog, label1, y, x1, TRUE); + } + } + wrefresh(dialog); + break; + case ' ': + case '\r': + case '\n': + delwin(dialog); + return button; + } + } + /*NOTREACHED*/ +} + +static void +PaintWindow(WINDOW *win, char *title_str, int y, int x, int height, int width) +{ + int i, j; + + if (title_str != NULL) { + j = (width - strlen(title_str)) / 2 - 1; + + wattrset(win, title_attr); + wmove(win, x, y); + for (i = 0; i < j; i++) + waddch(win, ' '); + waddstr(win, title_str); + for (; i < width; i++) + waddch(win, ' '); + } + + wattrset(win, 0); + + for (i = 1; i < height; i++) { + wmove(win, y + i, x); + for (j = 0; j < width; j++) + if (i == height - 1 && !j) + waddch(win, highlight_border_attr | ACS_LLCORNER); + else if (i == height - 1 && j == width - 1) + waddch(win, shadow_border_attr | ACS_LRCORNER); + else if (i == height - 1) + waddch(win, shadow_border_attr | ACS_HLINE); + else if (!j) + waddch(win, highlight_border_attr | ACS_VLINE); + else if (j == width - 1) + waddch(win, shadow_border_attr | ACS_VLINE); + else + waddch(win, dialog_attr | ' '); + } + +} + +static void +PaintBox(WINDOW *win, int y, int x, int height, int width) +{ + int i, j; + + wattrset(win, 0); + + for (i = 0; i < height; i++) { + wmove(win, y + i, x); + for (j = 0; j < width; j++) + if (!i && !j) + waddch(win, shadow_border_attr | ACS_ULCORNER); + else if (i == height - 1 && !j) + waddch(win, shadow_border_attr | ACS_LLCORNER); + else if (!i && j == width-1) + waddch(win, highlight_border_attr | ACS_URCORNER); + else if (i == height - 1 && j == width - 1) + waddch(win, highlight_border_attr | ACS_LRCORNER); + else if (!i) + waddch(win, shadow_border_attr | ACS_HLINE); + else if (i == height - 1) + waddch(win, highlight_border_attr | ACS_HLINE); + else if (!j) + waddch(win, shadow_border_attr | ACS_VLINE); + else if (j == width - 1) + waddch(win, highlight_border_attr | ACS_VLINE); + else + waddch(win, dialog_attr | ' '); + } + +} + +static void +PaintButton(WINDOW *win, char *label, int y, int x, int selected) +{ + int i, temp; + + wmove(win, y, x); + wattrset(win, selected ? button_active_attr : button_inactive_attr); + waddstr(win, selected ? "[" : " "); + temp = strspn(label, " "); + label += temp; + wattrset(win, selected ? button_active_attr : button_inactive_attr); + for (i = 0; i < temp; i++) + waddch(win, ' '); + wattrset(win, selected ? button_active_attr : button_inactive_attr); + waddch(win, label[0]); + wattrset(win, selected ? button_active_attr : button_inactive_attr); + waddstr(win, label + 1); + wattrset(win, selected ? button_active_attr : button_inactive_attr); + waddstr(win, selected ? "]" : " "); + wmove(win, y, x + temp + 1); +} + +static void +PrintWrap(WINDOW *win, char *prompt, int width, int y, int x) +{ + int cur_x, cur_y, len, yinc; + char *word, *tempstr = XtMalloc(strlen(prompt) + 1); + + cur_x = x; + cur_y = y; + + while (*prompt == '\n') { + ++cur_y; + ++prompt; + } + + strcpy(tempstr, prompt); + + for (word = strtok(tempstr, " \n"); word != NULL; word = strtok(NULL, " \n")) { + yinc = 0; + len = strlen(word); + while (prompt[word - tempstr + len + yinc] == '\n') + ++yinc; + if (cur_x + strlen(word) > width) { + cur_y++; + cur_x = x; + } + wmove(win, cur_y, cur_x); + waddstr(win, word); + getyx(win, cur_y, cur_x); + if (yinc) { + cur_y += yinc; + cur_x = x; + } + else + cur_x++; + } + + free(tempstr); +} + +static int +DialogMenu(char *title, char *prompt, int height, int width, int menu_height, + int item_no, char **items, char *label1, char *label2, int choice) +{ + int i, x, y, cur_x, cur_y, box_x, box_y, key = 0, button = 0, + scroll = 0, max_choice, nscroll, max_scroll, x1, x2, l1len, l2len; + WINDOW *dialog, *menu; + + max_choice = MIN(menu_height, item_no); + max_scroll = MAX(0, item_no - max_choice); + + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + PaintWindow(dialog, title, 0, 0, height, width); + + wattrset(dialog, dialog_attr); + PrintWrap(dialog, prompt, width - 3, 2, 3); + + l1len = strlen(label1); + l2len = strlen(label2); + + x1 = (width - (l1len + l2len)) / 3; + x2 = x1 + x1 + l1len; + + menu_width = width - 6; + getyx(dialog, cur_y, cur_x); + box_y = cur_y + 1; + box_x = (width - menu_width) / 2 - 1; + + menu = subwin(dialog, menu_height, menu_width, y + box_y + 1, x + box_x + 1); + keypad(menu, TRUE); + + /* draw a box around the menu items */ + PaintBox(dialog, box_y, box_x, menu_height + 2, menu_width + 2); + + item_x = 3; + + if (choice > menu_height) { + scroll = MIN(max_scroll, choice); + choice -= scroll; + } + + for (i = 0; i < max_choice; i++) + PaintItem(menu, items[i + scroll], i, i == choice); + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + + x = width / 2 - 11; + y = height - 3; + PaintButton(dialog, label2, y, x2, FALSE); + PaintButton(dialog, label1, y, x1, TRUE); + wrefresh(dialog); + + /*CONSTCOND*/ + while (1) { + i = choice; + key = wgetch(dialog); + + if (menu_height > 1 && key == KEY_PPAGE) { + if (!choice) { + if (scroll) { + /* Scroll menu down */ + getyx(dialog, cur_y, cur_x); + + nscroll = max_choice > scroll ? -scroll : -max_choice; + scrollok(menu, TRUE); + wscrl(menu, nscroll); + scrollok(menu, FALSE); + + PaintItem(menu, items[i = scroll + nscroll], 0, TRUE); + for (++i; i <= scroll; i++) + PaintItem(menu, items[i], i - (scroll + nscroll), FALSE); + scroll += nscroll; + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + wrefresh(dialog); + continue; + } + } + i = 0; + } + else if (menu_height > 1 && key == KEY_NPAGE) { + if (choice == max_choice - 1) { + if (scroll < max_scroll) { + /* Scroll menu up */ + getyx(dialog, cur_y, cur_x); + + nscroll = (scroll + max_choice > max_scroll ? + max_scroll : scroll + max_choice) - scroll; + scrollok(menu, TRUE); + wscrl(menu, nscroll); + scrollok(menu, FALSE); + + scroll += nscroll; + for (i = 0; i < max_choice - 1; i++) + PaintItem(menu, items[i + scroll], i, FALSE); + PaintItem(menu, items[i + scroll], max_choice - 1, TRUE); + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + wrefresh(dialog); + continue; + } + } + i = max_choice - 1; + } + else if (key == KEY_UP) { + if (!choice) { + if (scroll) { + /* Scroll menu down */ + getyx(dialog, cur_y, cur_x); + if (menu_height > 1) { + PaintItem(menu, items[scroll], 0, FALSE); + scrollok(menu, TRUE); + wscrl(menu, - 1); + scrollok(menu, FALSE); + } + scroll--; + PaintItem(menu, items[scroll], 0, TRUE); + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + wrefresh(dialog); + continue; + } + } + else + i = choice - 1; + } + else if (key == KEY_DOWN) { + if (choice == max_choice - 1) { + if (scroll + choice < item_no - 1) { + /* Scroll menu up */ + getyx(dialog, cur_y, cur_x); + if (menu_height > 1) { + PaintItem(menu, items[scroll + max_choice - 1], max_choice - 1, FALSE); + scrollok(menu, TRUE); + scroll(menu); + scrollok(menu, FALSE); + } + scroll++; + PaintItem(menu, items[scroll + max_choice - 1], max_choice - 1, TRUE); + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + wrefresh(dialog); + continue; + } + } + else + i = MIN(choice + 1, item_no - 1); + } + + if (i != choice) { + getyx(dialog, cur_y, cur_x); + PaintItem(menu, items[scroll + choice], choice, FALSE); + + choice = i; + PaintItem(menu, items[scroll + choice], choice, TRUE); + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + wmove(dialog, cur_y, cur_x); + wrefresh(dialog); + continue; + } + + switch (key) { + case TAB: + case KEY_LEFT: + case KEY_RIGHT: + if (!button) { + button = 1; + PaintButton(dialog, label1, y, x1, FALSE); + PaintButton(dialog, label2, y, x2, TRUE); + } + else { + button = 0; + PaintButton(dialog, label2, y, x2, FALSE); + PaintButton(dialog, label1, y, x1, TRUE); + } + wrefresh(dialog); + break; + case ' ': + case '\r': + case '\n': + delwin(dialog); + return (!button ? scroll + choice : -1); + default: + for (i = scroll + choice + 1; i < item_no; i++) + if (toupper(items[i][0]) == toupper(key)) + break; + if (i == item_no) { + for (i = 0; i < scroll + choice; i++) + if (toupper(items[i][0]) == toupper(key)) + break; + } + getyx(dialog, cur_y, cur_x); + if (i < item_no && i != scroll + choice) { + if (i >= scroll && i < scroll + max_choice) { + /* it is already visible */ + PaintItem(menu, items[scroll + choice], choice, FALSE); + choice = i - scroll; + } + else { + scroll = MIN(i, max_scroll); + choice = i - scroll; + for (i = 0; i < max_choice; i++) + if (i != choice) + PaintItem(menu, items[scroll + i], i, FALSE); + } + PaintItem(menu, items[scroll + choice], choice, TRUE); + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + wmove(dialog, cur_y, cur_x); + wrefresh(dialog); + } + break; + } + } + /*NOTREACHED*/ +} + +static void +PaintItem(WINDOW *win, char *item, int choice, int selected) +{ + int i; + + wattrset(win, selected ? title_attr : dialog_attr); + wmove(win, choice, 1); + for (i = 1; i < menu_width; i++) + waddch(win, ' '); + wmove(win, choice, item_x); + wattrset(win, selected ? title_attr : dialog_attr); + waddstr(win, item); +} + +static void +PaintScroller(WINDOW *win, int offset, int lenght, int visible) +{ + int i, pos; + + if (lenght > visible) + pos = (visible / (double)lenght) * offset; + else + pos = offset; + wattrset(win, shadow_border_attr); + for (i = 0; i < visible; i++) { + wmove(win, i, 0); + waddch(win, i == pos ? ACS_BLOCK : ACS_VLINE); + } +} + +static int +DialogCheckBox(char *title, char *prompt, int height, int width, int menu_height, + int item_no, char **items, char *label1, char *label2, char *checks) +{ + int i, x, y, cur_x, cur_y, box_x, box_y, key = 0, button = 0, choice = 0, + scroll = 0, max_choice, nscroll, max_scroll, x1, x2, l1len, l2len; + WINDOW *dialog, *menu; + + max_choice = MIN(menu_height, item_no); + max_scroll = MAX(0, item_no - max_choice); + + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + PaintWindow(dialog, title, 0, 0, height, width); + + wattrset(dialog, dialog_attr); + PrintWrap(dialog, prompt, width - 3, 2, 3); + + l1len = strlen(label1); + l2len = strlen(label2); + + x1 = (width - (l1len + l2len)) / 3; + x2 = x1 + x1 + l1len; + + menu_width = width - 6; + getyx(dialog, cur_y, cur_x); + box_y = cur_y + 1; + box_x = (width - menu_width) / 2 - 1; + + menu = subwin(dialog, menu_height, menu_width, y + box_y + 1, x + box_x + 1); + keypad(menu, TRUE); + + /* draw a box around the menu items */ + PaintBox(dialog, box_y, box_x, menu_height + 2, menu_width + 2); + + item_x = 3; + + for (i = 0; i < max_choice; i++) + PaintCheckItem(menu, items[i + scroll], i, i == 0, checks[i + scroll]); + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + + x = width / 2 - 11; + y = height - 3; + PaintButton(dialog, label2, y, x2, FALSE); + PaintButton(dialog, label1, y, x1, TRUE); + wrefresh(dialog); + + /*CONSTCOND*/ + while (1) { + i = choice; + key = wgetch(dialog); + + if (menu_height > 1 && key == KEY_PPAGE) { + if (!choice) { + if (scroll) { + /* Scroll menu down */ + getyx(dialog, cur_y, cur_x); + + nscroll = max_choice > scroll ? -scroll : -max_choice; + scrollok(menu, TRUE); + wscrl(menu, nscroll); + scrollok(menu, FALSE); + + i = scroll + nscroll; + PaintCheckItem(menu, items[i], 0, TRUE, checks[i]); + for (++i; i <= scroll; i++) + PaintCheckItem(menu, items[i], i - (scroll + nscroll), FALSE, checks[i]); + scroll += nscroll; + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + wrefresh(dialog); + continue; + } + } + i = 0; + } + else if (menu_height > 1 && key == KEY_NPAGE) { + if (choice == max_choice - 1) { + if (scroll < max_scroll) { + /* Scroll menu up */ + getyx(dialog, cur_y, cur_x); + + nscroll = (scroll + max_choice > max_scroll ? + max_scroll : scroll + max_choice) - scroll; + scrollok(menu, TRUE); + wscrl(menu, nscroll); + scrollok(menu, FALSE); + + scroll += nscroll; + for (i = 0; i < max_choice - 1; i++) + PaintCheckItem(menu, items[i + scroll], i, FALSE, checks[i + scroll]); + PaintCheckItem(menu, items[i + scroll], max_choice - 1, TRUE, checks[i + scroll]); + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + wrefresh(dialog); + continue; + } + } + i = max_choice - 1; + } + else if (key == KEY_UP) { + if (!choice) { + if (scroll) { + /* Scroll menu down */ + getyx(dialog, cur_y, cur_x); + if (menu_height > 1) { + PaintCheckItem(menu, items[scroll], 0, FALSE, checks[scroll]); + scrollok(menu, TRUE); + wscrl(menu, - 1); + scrollok(menu, FALSE); + } + scroll--; + PaintCheckItem(menu, items[scroll], 0, TRUE, checks[scroll]); + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + wrefresh(dialog); + continue; + } + } + else + i = choice - 1; + } + else if (key == KEY_DOWN) { + if (choice == max_choice - 1) { + if (scroll + choice < item_no - 1) { + /* Scroll menu up */ + getyx(dialog, cur_y, cur_x); + if (menu_height > 1) { + PaintCheckItem(menu, items[scroll + max_choice - 1], max_choice - 1, FALSE, checks[scroll + max_choice - 1]); + scrollok(menu, TRUE); + scroll(menu); + scrollok(menu, FALSE); + } + scroll++; + PaintCheckItem(menu, items[scroll + max_choice - 1], max_choice - 1, TRUE, checks[scroll + max_choice - 1]); + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + wrefresh(dialog); + continue; + } + } + else + i = MIN(choice + 1, item_no - 1); + } + + if (i != choice) { + getyx(dialog, cur_y, cur_x); + PaintCheckItem(menu, items[scroll + choice], choice, FALSE, checks[scroll + choice]); + + choice = i; + PaintCheckItem(menu, items[scroll + choice], choice, TRUE, checks[scroll + choice]); + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + wmove(dialog, cur_y, cur_x); + wrefresh(dialog); + continue; + } + + switch (key) { + case TAB: + case KEY_LEFT: + case KEY_RIGHT: + if (!button) { + button = 1; + PaintButton(dialog, label1, y, x1, FALSE); + PaintButton(dialog, label2, y, x2, TRUE); + } + else { + button = 0; + PaintButton(dialog, label2, y, x2, FALSE); + PaintButton(dialog, label1, y, x1, TRUE); + } + wrefresh(dialog); + break; + case ' ': + getyx(dialog, cur_y, cur_x); + checks[scroll + choice] = !checks[scroll + choice]; + PaintCheckItem(menu, items[scroll + choice], choice, TRUE, checks[scroll + choice]); + wmove(dialog, cur_y, cur_x); + wnoutrefresh(menu); + wrefresh(dialog); + break; + case '\r': + case '\n': + delwin(dialog); + return (!button ? 0 : -1); + default: + for (i = scroll + choice + 1; i < item_no; i++) + if (toupper(items[i][0]) == toupper(key)) + break; + if (i == item_no) { + for (i = 0; i < scroll + choice; i++) + if (toupper(items[i][0]) == toupper(key)) + break; + } + getyx(dialog, cur_y, cur_x); + if (i < item_no && i != scroll + choice) { + if (i >= scroll && i < scroll + max_choice) { + /* it is already visible */ + PaintCheckItem(menu, items[scroll + choice], choice, FALSE, checks[scroll + choice]); + choice = i - scroll; + } + else { + scroll = MIN(i, max_scroll); + choice = i - scroll; + for (i = 0; i < max_choice; i++) + if (i != choice) + PaintCheckItem(menu, items[scroll + i], i, FALSE, checks[scroll + i]); + } + PaintCheckItem(menu, items[scroll + choice], choice, TRUE, checks[scroll + choice]); + PaintScroller(menu, scroll + choice, item_no, menu_height); + wnoutrefresh(menu); + wmove(dialog, cur_y, cur_x); + wrefresh(dialog); + } + break; + } + } + /*NOTREACHED*/ +} + +static void +PaintCheckItem(WINDOW *win, char *item, int choice, int selected, int checked) +{ + int i; + + wattrset(win, selected ? title_attr : dialog_attr); + wmove(win, choice, 1); + for (i = 1; i < menu_width; i++) + waddch(win, ' '); + wmove(win, choice, item_x); + wattrset(win, selected ? title_attr : dialog_attr); + wprintw(win, "[%c] ", checked ? 'X' : ' '); + waddstr(win, item); +} + +static char * +DialogInput(char *title, char *prompt, int height, int width, char *init, + char *label1, char *label2, int def_button) +{ + int i, x, y, box_y, box_x, box_width, len, + input_x = 0, scroll = 0, key = 0, button = -1, x1, x2, l1len, l2len; + char instr[1024 + 1]; + WINDOW *dialog; + + x = (COLS - width) / 2; + y = (LINES - height) / 2; + + dialog = newwin(height, width, y, x); + keypad(dialog, TRUE); + + PaintWindow(dialog, title, 0, 0, height, width); + + wattrset(dialog, dialog_attr); + PrintWrap(dialog, prompt, width - 3, 2, 3); + + l1len = strlen(label1); + l2len = strlen(label2); + + x1 = (width - (l1len + l2len)) / 3; + x2 = x1 + x1 + l1len; + + box_width = width - 6; + getyx(dialog, y, x); + box_y = y + 2; + box_x = (width - box_width) / 2; + PaintBox(dialog, y + 1, box_x - 1, 3, box_width + 2); + + x = width / 2 - 11; + y = height - 3; + PaintButton(dialog, label2, y, x2, def_button == 1); + PaintButton(dialog, label1, y, x1, def_button == 0); + + memset(instr, '\0', sizeof(instr)); + wmove(dialog, box_y, box_x); + wattrset(dialog, dialog_attr); + if (init) + strncpy(instr, init, sizeof(instr) - 2); + + input_x = len = strlen(instr); + if (input_x >= box_width) { + scroll = input_x - box_width + 1; + input_x = box_width - 1; + for (i = 0; i < box_width - 1; i++) + waddch(dialog, instr[scroll + i]); + } + else + waddstr(dialog, instr); + + wmove(dialog, box_y, box_x + input_x); + + wrefresh(dialog); + + while (1) { + key = wgetch(dialog); + if (button == -1) { /* Input box selected */ + switch (key) { + case TAB: + case KEY_UP: + case KEY_DOWN: + break; + case KEY_LEFT: + if (scroll && !input_x) { + --scroll; + wmove(dialog, box_y, box_x); + for (i = 0; i < box_width; i++) + waddch(dialog, instr[scroll + input_x + i] ? instr[scroll + input_x + i] : ' '); + wmove(dialog, box_y, input_x + box_x); + wrefresh(dialog); + } + else if (input_x) { + wmove(dialog, box_y, --input_x + box_x); + wrefresh(dialog); + } + continue; + case KEY_RIGHT: + if (input_x == box_width - 1) { + ++scroll; + wmove(dialog, box_y, box_x); + for (i = scroll; i < scroll + box_width; i++) + waddch(dialog, instr[scroll + i] ? instr[scroll + i] : ' '); + wmove(dialog, box_y, input_x + box_x); + wrefresh(dialog); + } + else if (input_x + scroll < len) { + wmove(dialog, box_y, ++input_x + box_x); + wrefresh(dialog); + } + continue; + case KEY_BACKSPACE: + case 0177: + if (input_x || scroll) { + wattrset(dialog, dialog_attr); + + if (scroll + input_x < len) + memmove(instr + scroll + input_x - 1, + instr + scroll + input_x, + len - (scroll + input_x)); + instr[--len] = '\0'; + + if (!input_x) { + scroll = scroll < box_width - 1 ? 0 : scroll - (box_width - 1); + wmove(dialog, box_y, box_x); + for (i = 0; i < box_width; i++) + waddch(dialog, instr[scroll + input_x + i] ? instr[scroll + input_x + i] : ' '); + input_x = len - scroll; + } + else { + wmove(dialog, box_y, --input_x + box_x); + for (i = scroll + input_x; i < len && + i < scroll + box_width; i++) + waddch(dialog, instr[i]); + waddch(dialog, ' '); + } + wmove(dialog, box_y, input_x + box_x); + wrefresh(dialog); + } + continue; + default: + if (key < 0x100 && isprint(key)) { + if (scroll + input_x < sizeof(instr) - 1) { + wattrset(dialog, dialog_attr); + if (scroll + input_x < len) { + memmove(instr + scroll + input_x + 1, + instr + scroll + input_x, + len - (scroll + input_x)); + } + instr[scroll + input_x] = key; + instr[++len] = '\0'; + if (input_x == box_width - 1) { + scroll++; + wmove(dialog, box_y, box_x); + for (i = 0; i < box_width - 1; i++) + waddch(dialog, instr[scroll + i]); + } + else { + wmove(dialog, box_y, input_x++ + box_x); + for (i = scroll + input_x - 1; i < len && + i < scroll + box_width; i++) + waddch(dialog, instr[i]); + wmove(dialog, box_y, input_x + box_x); + } + wrefresh(dialog); + } + else + flash(); /* Alarm user about overflow */ + continue; + } + } + } + + switch (key) { + case KEY_UP: + case KEY_LEFT: + switch (button) { + case -1: + button = 1; /* Indicates "Cancel" button is selected */ + PaintButton(dialog, label1, y, x1, FALSE); + PaintButton(dialog, label2, y, x2, TRUE); + wrefresh(dialog); + break; + case 0: + button = -1; /* Indicates input box is selected */ + PaintButton(dialog, label2, y, x2, FALSE); + PaintButton(dialog, label1, y, x1, TRUE); + wmove(dialog, box_y, box_x + input_x); + wrefresh(dialog); + break; + case 1: + button = 0; /* Indicates "OK" button is selected */ + PaintButton(dialog, label2, y, x2, FALSE); + PaintButton(dialog, label1, y, x1, TRUE); + wrefresh(dialog); + break; + } + break; + case TAB: + case KEY_DOWN: + case KEY_RIGHT: + switch (button) { + case -1: + button = 0; /* Indicates "OK" button is selected */ + PaintButton(dialog, label2, y, x2, FALSE); + PaintButton(dialog, label1, y, x1, TRUE); + wrefresh(dialog); + break; + case 0: + button = 1; /* Indicates "Cancel" button is selected */ + PaintButton(dialog, label1, y, x1, FALSE); + PaintButton(dialog, label2, y, x2, TRUE); + wrefresh(dialog); + break; + case 1: + button = -1; /* Indicates input box is selected */ + PaintButton(dialog, label2, y, x2, FALSE); + PaintButton(dialog, label1, y, x1, TRUE); + wmove(dialog, box_y, box_x + input_x); + wrefresh(dialog); + break; + } + break; + case ' ': + case '\r': + case '\n': + delwin(dialog); + return (button == -1 ? XtNewString(instr) : NULL); + } + } +} diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.cpp b/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.cpp new file mode 100644 index 000000000..97019cba0 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.cpp @@ -0,0 +1,148 @@ +.\" +.\" Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com) +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining a +.\" copy of this software and associated documentation files (the "Software"), +.\" to deal in the Software without restriction, including without limitation +.\" the rights to use, copy, modify, merge, publish, distribute, sublicense, +.\" and/or sell copies of the Software, and to permit persons to whom the +.\" Software is furnished to do so, subject to the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be included in +.\" all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +.\" CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +.\" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +.\" OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +.\" SOFTWARE. +.\" +.\" Except as contained in this notice, the name of Conectiva Linux shall +.\" not be used in advertising or otherwise to promote the sale, use or other +.\" dealings in this Software without prior written authorization from +.\" Conectiva Linux. +.\" +.\" Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> +.\" +.\" $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.cpp,v 1.1 2000/12/11 20:48:56 dawes Exp $ +.\" +.TH xf86cfg 1 "Version 4.0.2" "XFree86" +.SH NAME +xf86cfg - Graphical configuration tool for XFree86 4.0 +.SH SYNOPSIS +.B xf86cfg +[-xf86config \fIXF86Config\fP] [-modulepath \fImoduledir\fP] +[-fontpath \fIfontsdir\fP] [-toolkitoption ...] +.SH DESCRITPION +.I Xf86cfg +is a tool to configure \fIXFree86 4.0\fP, and can be used to either write the +initial configuration file or make customizations to the current configuration. +.PP +When the \fBDISPLAY\fP environment variable is not set, xf86cfg will run +the command \fIXFree86 -configure\fP to allow the xserver detect the +hardware in the computer, and write an initial \fIXF86Config\fP file +in the user's home directory. Then, it will start XFree86 and allow +customizations. +.br +If the \fBDISPLAY\fP environment variable is set, xf86cfg will read the +default \fIXF86Config\fP, that may not be the same being used by the current +server, and allow customizations. +.PP +To use an alternative location for modules or fonts the respective search +paths may be specified. +.PP +Unless there is an \fBApply\fP button in the current xf86cfg dialog, the +changes made will take place the next time \fIXFree86\fP is started. + +.PP +Xf86cfg allows addition and configuration of new devices, such as video cards, +monitors, keyboards and mouses. +.PP +Screen layout configuration for xinerama or traditional multi-head is also +available. +.PP +Modelines can be configured or optimized. +.PP +AccessX basic configurations can be made in the xf86cfg's accessx section. + +.SH OPTIONS +.TP 8 +.I -xf86config +Specifies an alternate XF86Config file for configuration. +.TP 8 +.I -modulepath +Specifies where xf86cfg, and the server it may start, should look for +XFree86 modules. +.TP 8 +.I -serverpath +Specifies the complete path, not including the binary name, of the +XFree86 binary. +.TP 8 +.I -fontpath +Specifies the path to the fonts that should be used by the server started +by xf86cfg. +.TP 8 +.I -rgbpath +Specifies the path to the rgb.txt file that should be used by the server +started by xf86cfg, if any. +.TP 8 +.I -textmode +If xf86cfg was compiled with support to ncurses, this option makes xf86cfg +enters a text mode interface. + +.SH ENVIRONMENT +.TP 8 +.I DISPLAY +Default host and display number +.TP 8 +.I XWINHOME +Directory where XFree86 was installed, defaults to /usr/X11R6. +.TP 8 +.I XENVIRONMENT +Name of a resource file that overrides the global resources +stored in the RESOURCE_MANAGER property + +.SH FILES +.TP 8 +.I /etc/XF86Config +Server configuration file +.TP 8 +.I /etc/X11/XF86Config +Server configuration file +.TP 8 +.I /usr/X11R6/etc/XF86Config +Server configuration file +.TP 8 +.I <XRoot>/lib/X11/XF86Config.\fIhostname\fP +Server configuration file +.TP 8 +.I <XRoot>/lib/X11/XF86Config +Server configuration file +.TP 8 +.I <XRoot>/lib/X11/app-default/XF86Cfg +Specifies xf86cfg resources +.TP 8 +.I <Xroot>/lib/X11/xkb/X0-config.keyboard +Keyboard specific configuration + +.SH "SEE ALSO" +.IR XFree86 (1) +.IR XF86Config (__filemansuffix__) + +.SH COPYRIGHT +.TP 8 +Copyright 2000, Conectiva Linux S.A. +\fIhttp://www.conectiva.com\fP +.TP 8 +Copyright 2000, The XFree86 Project +\fIhttp://www.XFree86.org\fP + +.SH AUTHORS +.TP 8 +Paulo César Pereira de Andrade \fI<pcpa@conectiva.com.br>\fP +The XFree86 Project + +.SH BUGS +Probably. diff --git a/xc/programs/Xserver/hw/xfree86/xf86config/Cards b/xc/programs/Xserver/hw/xfree86/xf86config/Cards index 20fa52a5b..512250bbb 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86config/Cards +++ b/xc/programs/Xserver/hw/xfree86/xf86config/Cards @@ -18,7 +18,7 @@ # The majority of entries are just a binding of a model name to a # chipset/server and untested. # -# $XFree86: xc/programs/Xserver/hw/xfree86/xf86config/Cards,v 3.74 2000/12/01 23:27:55 paulo Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/xf86config/Cards,v 3.75 2000/12/12 17:01:40 dawes Exp $ # VGA @@ -2776,6 +2776,12 @@ DRIVER glint LINE #Option "no_accel" NOCLOCKPROBE +NAME Appian Jeronimo 2000 +CHIPSET PERMEDIA 3 +SERVER XFree86 +DRIVER glint +NOCLOCKPROBE + # Alliance Semiconductor NAME Diamond Stealth Video 2500 diff --git a/xc/programs/Xserver/hw/xfree86/xf86config/Imakefile b/xc/programs/Xserver/hw/xfree86/xf86config/Imakefile index d0d55980d..d7155bb58 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86config/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/xf86config/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/xf86config/Imakefile,v 3.8 2000/10/27 18:31:06 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/xf86config/Imakefile,v 3.9 2000/12/11 20:49:01 dawes Exp $ @@ -27,4 +27,6 @@ InstallNamedProg(xf86config.cmd,xf86config.cmd,$(BINDIR)) DependTarget() InstallNonExecFile(Cards,$(LIBDIR)) -InstallManPageLong(xf86conf,$(MANDIR),xf86config) + +CppManTarget(xf86config,) +InstallManPage(xf86config,$(MANDIR)) diff --git a/xc/programs/Xserver/hw/xfree86/xf86config/xf86config.cpp b/xc/programs/Xserver/hw/xfree86/xf86config/xf86config.cpp new file mode 100644 index 000000000..106ecc1d3 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/xf86config/xf86config.cpp @@ -0,0 +1,16 @@ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/xf86config/xf86config.cpp,v 1.1 2000/12/11 20:49:07 dawes Exp $ +.TH xf86config 1 "Version 4.0.2" "XFree86" +.SH NAME +xf86config \- generate an XF86Config file +.SH SYNOPSIS +.B xf86config +.SH DESCRIPTION +\fIxf86config\fP is an interactive program for generating an XF86Config file +for use with XFree86 X servers. +.SH FILES +<xroot>/lib/X11/Cards Video cards database +.SH "SEE ALSO" +XFree86(1), XF86Config(__filemansuffix__), reconfig(1) +.SH AUTHOR +Harm Hanemaayer. +.\" $TOG: xf86conf.man /main/9 1997/07/19 10:53:08 kaleb $ |