diff options
author | dawes <dawes> | 2001-06-14 21:52:36 +0000 |
---|---|---|
committer | dawes <dawes> | 2001-06-14 21:52:36 +0000 |
commit | 9d8ac1f4820f6a1984bcc9e4a4151ba9f0acdc1f (patch) | |
tree | c337d03f29b9e9b8dbe806c9ada6c9db11559892 | |
parent | d7e11f5cb2c191e4478fca7c6b964a6e600decfa (diff) |
Import of XFree86 4.1.0X_4_1_0
912 files changed, 33208 insertions, 11180 deletions
diff --git a/xc/config/Imakefile b/xc/config/Imakefile index 82dd53141..fc3db9c95 100644 --- a/xc/config/Imakefile +++ b/xc/config/Imakefile @@ -1,5 +1,5 @@ XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:41:45 cpqbld Exp $ -XCOMM $XFree86: xc/config/Imakefile,v 1.3 2001/01/17 16:22:29 dawes Exp $ +XCOMM $XFree86: xc/config/Imakefile,v 1.3.2.1 2001/05/31 22:20:18 dawes Exp $ #define IHaveSubdirs #define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" @@ -12,5 +12,19 @@ PSWRAPDIR = pswrap #endif SUBDIRS = cf $(BOOTSTRAPSUBDIRS) util $(PSWRAPDIR) +#if defined(XFree86VersionString) && defined(ProjectRoot) && \ + defined(BuildBindist) +all:: version + +version: cf/version.def + RemoveFile(version) + echo XFree86VersionString > version + +InstallNamedNonExec(version,.XFree86_Version,ProjectRoot) + +clean:: + RemoveFile(version) +#endif + MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) diff --git a/xc/config/cf/FreeBSD.cf b/xc/config/cf/FreeBSD.cf index 6b8f994e6..03ef7ea4c 100644 --- a/xc/config/cf/FreeBSD.cf +++ b/xc/config/cf/FreeBSD.cf @@ -2,7 +2,7 @@ XCOMM platform: $Xorg: FreeBSD.cf,v 1.3 2000/08/17 19:41:45 cpqbld Exp $ XCOMM XCOMM XCOMM -XCOMM platform: $XFree86: xc/config/cf/FreeBSD.cf,v 3.108 2001/04/19 19:54:41 dawes Exp $ +XCOMM platform: $XFree86: xc/config/cf/FreeBSD.cf,v 3.109 2001/05/03 20:12:35 alanh Exp $ #ifndef UseElfFormat #define UseElfFormat DefaultToElfFormat @@ -155,9 +155,6 @@ XCOMM operating system: OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVe #define CppCmd /usr/bin/cpp #define PreProcessCmd CppCmd #define StandardCppOptions -traditional -#define CppCmd /usr/bin/cpp -#define PreProcessCmd CppCmd -#define StandardCppOptions -traditional #define StandardCppDefines /**/ #ifndef DefaultCCOptions #if defined(UseInstalled) diff --git a/xc/config/cf/X11.tmpl b/xc/config/cf/X11.tmpl index 9f6e26fa4..31141da0a 100644 --- a/xc/config/cf/X11.tmpl +++ b/xc/config/cf/X11.tmpl @@ -5,7 +5,7 @@ XCOMM XCOMM XCOMM XCOMM -XCOMM $XFree86: xc/config/cf/X11.tmpl,v 1.114 2001/04/23 15:53:45 dawes Exp $ +XCOMM $XFree86: xc/config/cf/X11.tmpl,v 1.115.2.3 2001/06/01 02:24:14 dawes Exp $ /*************************************************************************** * * @@ -257,7 +257,7 @@ VENDORMANVERSION = XVendorManVersionString #define BuildPexExt NO #endif #ifndef BuildPexLib -#define BuildPexLib (BuildPex && !BuildServersOnly) +#define BuildPexLib (BuildPexExt && !BuildServersOnly) #endif #ifndef BuildXInputExt #define BuildXInputExt NO @@ -1348,6 +1348,7 @@ XCOMM X Window System make variables; these need to be coordinated with rules RGB = $(BINDIR)/rgb FONTC = $(BINDIR)/bdftopcf MKFONTDIR = $(BINDIR)/mkfontdir + XFTCACHE = $(BINDIR)/xftcache MKHTMLINDEX = $(BINDIR)/mkhtmlindex UCS2ANY = $(BINDIR)/ucs2any.pl BDFTRUNCATE = $(BINDIR)/bdftruncate.pl @@ -1356,7 +1357,7 @@ XCOMM X Window System make variables; these need to be coordinated with rules RGB = $(CLIENTENVSETUP) $(XBUILDBINDIR)/rgb FONTC = $(CLIENTENVSETUP) $(XBUILDBINDIR)/bdftopcf MKFONTDIR = $(CLIENTENVSETUP) $(XBUILDBINDIR)/mkfontdir - XFTCACHE = $(CLIENTENVSETUP) $(XBUILDBINDIR)/xftcache + XFTCACHE = $(CLIENTENVSETUP) XFT_CONFIG=$(XFTLIBSRC)/XftConfig $(XBUILDBINDIR)/xftcache #if HasPerl MKHTMLINDEX = RunPerlScript($(CONFIGSRC)/util/mkhtmlindex.pl,) #else @@ -1826,18 +1827,6 @@ ProjectUnsharedLibReferences(XINERAMA,Xinerama,$(XINERAMALIBSRC),XBuildLibDir) #endif #endif -#if BuildXineramaLibrary - XINERAMALIBSRC = $(LIBSRC)/Xinerama -#if SharedLibXinerama -#ifndef SharedXineramaRev -#define SharedXineramaRev 1.0 -#endif -SharedLibReferences(XINERAMA,Xinerama,$(XINERAMALIBSRC),SOXINERAMAREV,SharedXineramaRev) -#else -ProjectUnsharedLibReferences(XINERAMA,Xinerama,$(XINERAMALIBSRC),XBuildLibDir) -#endif -#endif - #if BuildDPSLibrary DPSLIBSRC = $(LIBSRC)/dps #if SharedLibDps @@ -2928,23 +2917,27 @@ clean:: @@\ #define PostProcessTroffPS(temp,real) $(MV) temp real #endif -#ifndef MakeSimpleDoc -#define MakeSimpleDoc(file,srcs) @@\ +#ifndef MakeDepSimpleDoc +#define MakeDepSimpleDoc(file,deps,srcs) @@\ all:: file.PS file.txt @@\ .PRECIOUS: file.PS @@\ @@\ -file.PS: srcs @@\ +file.PS: deps @@\ -$(TROFF) $(MSMACROS) $(XDOCMACROS) srcs 2> index.raw > file.nPS \@@\ && PostProcessTroffPS(file.nPS,$@) @@\ @if grep '^[^1-9.]' index.raw; then exit 1; else test $$? -le 1; fi @@\ @@\ -file.txt: srcs @@\ +file.txt: deps @@\ $(NROFF) $(MSMACROS) $(XDOCMACROS) srcs 2> index.raw | $(COL) $(COLFLAGS) > $@ @@\ @@\ clean:: @@\ $(RM) index.raw file.nPS file.PS file.txt #endif +#ifndef MakeSimpleDoc(file,srcs) +#define MakeSimpleDoc(file,srcs) MakeDepSimpleDoc(file,srcs,srcs) +#endif + #ifndef MakeTblDoc #define MakeTblDoc(file,srcs) @@\ all:: file.PS file.txt @@\ diff --git a/xc/config/cf/bsdLib.rules b/xc/config/cf/bsdLib.rules index b58aed256..d4a838878 100644 --- a/xc/config/cf/bsdLib.rules +++ b/xc/config/cf/bsdLib.rules @@ -4,7 +4,7 @@ XCOMM $Xorg: bsdLib.rules,v 1.3 2000/08/17 19:41:47 cpqbld Exp $ -XCOMM $XFree86: xc/config/cf/bsdLib.rules,v 3.15 2001/02/16 01:26:08 dawes Exp $ +XCOMM $XFree86: xc/config/cf/bsdLib.rules,v 3.15.2.1 2001/05/24 16:35:38 dawes Exp $ /* * NetBSD/FreeBSD shared library rules */ @@ -185,7 +185,7 @@ LintLibReferences(varname,libname,libsource) #define ShLibIncludeFile <bsdLib.tmpl> #endif #ifndef SharedLibraryLoadFlags -#define SharedLibraryLoadFlags -shared -Wl,-rpath,$(USRLIBDIR) +#define SharedLibraryLoadFlags -shared -Wl,-rpath,$(USRLIBDIRPATH) #endif #ifndef PositionIndependentCFlags #define PositionIndependentCFlags -fPIC diff --git a/xc/config/cf/bsdLib.tmpl b/xc/config/cf/bsdLib.tmpl index b0c890515..e60448927 100644 --- a/xc/config/cf/bsdLib.tmpl +++ b/xc/config/cf/bsdLib.tmpl @@ -1,5 +1,5 @@ XCOMM $Xorg: bsdLib.tmpl,v 1.3 2000/08/17 19:41:47 cpqbld Exp $ -XCOMM $XFree86: xc/config/cf/bsdLib.tmpl,v 3.8 2001/03/02 23:01:27 dawes Exp $ +XCOMM $XFree86: xc/config/cf/bsdLib.tmpl,v 3.8.2.1 2001/05/24 16:35:38 dawes Exp $ /* * NetBSD/FreeBSD/OpenBSD shared library template @@ -46,20 +46,20 @@ XMULIB = $(XMULIBONLY) $(XTOOLLIB) $(XLIB) #if !defined(SharedX11Reqs) #define SharedX11Reqs #endif -#define SharedOldXReqs $(LDPRELIB) $(XLIBONLY) +#define SharedOldXReqs $(LDPRELIBS) $(XLIBONLY) #ifndef SharedXtReqs -#define SharedXtReqs $(LDPRELIB) $(XLIBONLY) $(SMLIB) $(ICELIB) +#define SharedXtReqs $(LDPRELIBS) $(XLIBONLY) $(SMLIB) $(ICELIB) #endif -#define SharedXawReqs $(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XPMLIB) $(XLIB) -#define SharedXaw6Reqs $(LDPRELIB) $(XMULIB) $(XTOOLLIB) $(XLIB) -#define SharedXmuReqs $(LDPRELIB) $(XTOOLLIB) $(XLIB) -#define SharedXextReqs $(LDPRELIB) $(XLIBONLY) -#define SharedXiReqs $(LDPRELIB) $(XLIB) -#define SharedPexReqs $(LDPRELIB) $(XLIBONLY) MathLibrary -#define SharedXtstReqs $(LDPRELIB) $(XLIB) -#define SharedXieReqs $(LDPRELIB) $(XLIBONLY) -#define SharedSMReqs $(LDPRELIB) $(ICELIB) -#define SharedFrescoReqs $(LDPRELIB) $(XLIBONLY) FrescoSysLibs -#define SharedXtfReqs $(LDPRELIB) $(FRESCOLIB) $(XTOOLLIB) $(XLIB) FrescoSysLibs +#define SharedXawReqs $(LDPRELIBS) $(XMULIB) $(XTOOLLIB) $(XPMLIB) $(XLIB) +#define SharedXaw6Reqs $(LDPRELIBS) $(XMULIB) $(XTOOLLIB) $(XLIB) +#define SharedXmuReqs $(LDPRELIBS) $(XTOOLLIB) $(XLIB) +#define SharedXextReqs $(LDPRELIBS) $(XLIBONLY) +#define SharedXiReqs $(LDPRELIBS) $(XLIB) +#define SharedPexReqs $(LDPRELIBS) $(XLIBONLY) MathLibrary +#define SharedXtstReqs $(LDPRELIBS) $(XLIB) +#define SharedXieReqs $(LDPRELIBS) $(XLIBONLY) +#define SharedSMReqs $(LDPRELIBS) $(ICELIB) +#define SharedFrescoReqs $(LDPRELIBS) $(XLIBONLY) FrescoSysLibs +#define SharedXtfReqs $(LDPRELIBS) $(FRESCOLIB) $(XTOOLLIB) $(XLIB) FrescoSysLibs #endif /* UseElfFormat */ diff --git a/xc/config/cf/cygwin.cf b/xc/config/cf/cygwin.cf index 60242bf47..ff48187e0 100644 --- a/xc/config/cf/cygwin.cf +++ b/xc/config/cf/cygwin.cf @@ -1,4 +1,4 @@ -XCOMM platform: $XFree86: xc/config/cf/cygwin.cf,v 3.9 2001/04/27 12:32:42 alanh Exp $ +XCOMM platform: $XFree86: xc/config/cf/cygwin.cf,v 3.16.2.1 2001/05/30 14:29:27 alanh Exp $ #ifndef OSName #define OSName Cygwin @@ -10,10 +10,10 @@ XCOMM platform: $XFree86: xc/config/cf/cygwin.cf,v 3.9 2001/04/27 12:32:42 alan #define OSMajorVersion 1 #endif #ifndef OSMinorVersion -#define OSMinorVersion 1 +#define OSMinorVersion 3 #endif #ifndef OSTeenyVersion -#define OSTeenyVersion 8 +#define OSTeenyVersion 1 #endif #define ProjectRoot /usr/X11R6 @@ -34,9 +34,14 @@ XCOMM platform: $XFree86: xc/config/cf/cygwin.cf,v 3.9 2001/04/27 12:32:42 alan #define HasLibCrypt YES #define HasPutenv YES #define HasPoll NO -#define HasShm NO +#if UseCygIPC +# define HasShm YES +# define ServerExtraSysLibs -lcygipc +#else +# define HasShm NO +# define ServerExtraSysLibs /**/ +#endif #define HasSnprintf YES -#define HasZlib YES /* * Cygwin has Tcl/Tk, but you need to keep the version numbers @@ -50,6 +55,7 @@ XCOMM platform: $XFree86: xc/config/cf/cygwin.cf,v 3.9 2001/04/27 12:32:42 alan #define HasSockets YES #define GzipFontCompression YES +#define HasZlib YES #define SharedLibFont NO #define AvoidNullMakeCommand YES @@ -65,11 +71,6 @@ XCOMM platform: $XFree86: xc/config/cf/cygwin.cf,v 3.9 2001/04/27 12:32:42 alan #define ExpandManNames NO #define HasDlopen NO #define HasGnuMake YES -#ifndef DefaultCCOptions -#define DefaultCCOptions -Wall -#endif /* DefaultCCOptions */ -#define DefaultGcc2i386Opt -O2 -#define LibraryCDebugFlags -O2 #define UseGccMakeDepend YES /* @@ -101,13 +102,20 @@ XCOMM platform: $XFree86: xc/config/cf/cygwin.cf,v 3.9 2001/04/27 12:32:42 alan #define LdCombineFlags -r -#define OptimizedCDebugFlags -O2 -fno-strength-reduce -fpcc-struct-return -m486 +# ifndef OptimizedCDebugFlags +# define OptimizedCDebugFlags DefaultGcc2i386Opt +# endif #define StandardDefines -D__i386__ -DWIN32_LEAN_AND_MEAN -DX_LOCALE -D_X86_ -D__STDC__ -DNO_TCP_H -D__CYGWIN__ -D_XOPEN_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DX_SOURCE #define XawI18nDefines -DUSE_XWCHAR_STRING -DUSE_XMBTOWC #define HasWChar32 YES -#define StandardCppDefines -traditional StandardDefines +#define StandardCppOptions -traditional +#if UseCygIPC +# define StandardCppDefines -DHAS_SHM StandardDefines +#else +# define StandardCppDefines StandardDefines +#endif #define ServerOSDefines XFree86ServerDefines -DDDXTIME -DFD_SETSIZE=256 -DDXOSINIT #define XkbServerDefines -DXKB_ALWAYS_USES_SOFT_REPEAT #define ServerExtraDefines -DGCCUSESGAS XFree86ServerDefines @@ -122,12 +130,41 @@ XCOMM platform: $XFree86: xc/config/cf/cygwin.cf,v 3.9 2001/04/27 12:32:42 alan */ #define BuildDebug NO #define XFree86Devel NO -#define BuildPexExt YES + +/* + * Xinerama is multiple monitor support and will require special code, + * if it even makes sense to enable such a beast in Cygwin/XFree86. + */ #define BuildXinerama NO + +/* + * PEX and XIE were deprecated on 2001-05-29, as Keith Packard says, + * "they are so broken as to be unusable in real applications," furthermore, + * "neither PEX nor XIE have seen any development for almost a decade". + * + * XIE is the X Image Extension Protocol, not to be confused with + * XInputExt, which is the X Input Extension. + */ +#define BuildPexExt NO +#define BuildXIE NO + +/* + * Rush is a non standard extension for cooperation between the glide + * library and the X server. Cygwin/XFree86 will never need Rush, + * as all graphics requests are processed through GDI or DirectDraw. + */ +#define BuildXF86RushExt NO + +/* + * DPMS is the Display Power Management System. Cygwin/XFree86 doesn't + * own the display hardware, Windows does, so it doesn't make sense + * for Cygwin/XFree86 to try to provide power management. + */ +#define BuildDPMS NO +#define BuildDPMSExt NO +#define DPMSDefines /**/ + #define BuildGlxExt YES -#define BuildXIE YES -#define BuildXF86RushExt YES -#define BuildXF86RushLibrary YES #define BuildXInputExt YES #define BuildXF86VidModeExt YES #define BuildXF86DGA NO @@ -153,9 +190,7 @@ XCOMM platform: $XFree86: xc/config/cf/cygwin.cf,v 3.9 2001/04/27 12:32:42 alan #define BuildAppgroup YES #define BuildShapeExt YES #define BuildScanpci NO -#define BuildDPMS NO -#define BuildDPMSExt NO -#define DPMSDefines /**/ + #define BuildScreenSaverExt NO /* @@ -163,10 +198,14 @@ XCOMM platform: $XFree86: xc/config/cf/cygwin.cf,v 3.9 2001/04/27 12:32:42 alan */ #define BuildPlugin NO -/* DPS is the Adobe Display Postscript library */ -#define BuildDPS YES -#define BuildDPSLibraries YES -#define BuildDPSLibrary YES +/* + * DPS is the Adobe Display Postscript (r) library. + * It seems that we do not yet have a postscript client library + * to work in conjunction with DPS; the remedy to this may be + * as simple as flipping a build switch or instaling Ghostscript. + * In any case, some work needs to be done before DPS will work. + */ +#define BuildDPS NO /* * Doing a loadable server would probably take some extra work. diff --git a/xc/config/cf/darwin.cf b/xc/config/cf/darwin.cf index c32d5d227..2d253737e 100644 --- a/xc/config/cf/darwin.cf +++ b/xc/config/cf/darwin.cf @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/config/cf/darwin.cf,v 1.11 2001/04/16 06:51:46 torrey Exp $ +XCOMM $XFree86: xc/config/cf/darwin.cf,v 1.14 2001/05/18 17:48:23 torrey Exp $ /* Darwin / Mac OS X configuration by John Carmack <johnc@idsoftware.com> */ @@ -40,8 +40,9 @@ XCOMM $XFree86: xc/config/cf/darwin.cf,v 1.11 2001/04/16 06:51:46 torrey Exp $ /* we don't have a dbm library */ #define DBMLibrary /**/ -/* our cpp isn't in /lib/cpp */ +/* our cpp isn't in /lib/cpp and it doesn't like -undef */ #define CppCmd /usr/bin/cpp +#define RawCppCmd CppCmd /* we have a gcc compatible compiler, but its not called gcc */ #define CcCmd /usr/bin/cc diff --git a/xc/config/cf/linux.cf b/xc/config/cf/linux.cf index d3e4762e8..8f9b372dc 100644 --- a/xc/config/cf/linux.cf +++ b/xc/config/cf/linux.cf @@ -4,7 +4,7 @@ XCOMM platform: $Xorg: linux.cf,v 1.3 2000/08/17 19:41:47 cpqbld Exp $ -XCOMM platform: $XFree86: xc/config/cf/linux.cf,v 3.165 2001/04/19 19:54:43 dawes Exp $ +XCOMM platform: $XFree86: xc/config/cf/linux.cf,v 3.165.2.1 2001/06/01 02:24:14 dawes Exp $ #ifndef LinuxElfDefault # define LinuxElfDefault YES @@ -271,7 +271,7 @@ InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class # elif defined(AlphaArchitecture) # define BuildXF86DRI YES # elif defined(PpcArchitecture) -# define BuildXF86DRI NO +# define BuildXF86DRI YES # elif defined(Mc68020Architecture) # define BuildXF86DRI NO # elif defined(Arm32Architecture) diff --git a/xc/config/cf/sun.cf b/xc/config/cf/sun.cf index f8fda7124..90da33fbe 100644 --- a/xc/config/cf/sun.cf +++ b/xc/config/cf/sun.cf @@ -3,7 +3,7 @@ XCOMM platform: $Xorg: sun.cf,v 1.4 2000/08/17 19:41:48 cpqbld Exp $ -XCOMM platform: $XFree86: xc/config/cf/sun.cf,v 3.55 2001/01/17 16:38:49 dawes Exp $ +XCOMM platform: $XFree86: xc/config/cf/sun.cf,v 3.56 2001/05/11 09:03:05 alanh Exp $ #ifndef OSName # define OSName DefaultOSName @@ -437,6 +437,17 @@ man_keywords:: @@\ # endif #endif +/* PAM appeared in SunOS 5.6 */ +#if !defined(HasPam) +# if (OSMajorVersion > 5) || (OSMajorVersion == 5 && OSMinorVersion >= 6) +# define HasPam YES +# endif +#endif + +#ifndef PamLibraries +#define PamLibraries -lpam +#endif + #define MotifDefines \ -DNO_ISDIR -DNO_REGCOMP -DNO_ALLOCA -DBOGUS_MB_MAX -DNO_CONST #define PamUnixDefines -DPAM_NIS diff --git a/xc/config/cf/xfree86.cf b/xc/config/cf/xfree86.cf index f19945e5e..186cb7623 100644 --- a/xc/config/cf/xfree86.cf +++ b/xc/config/cf/xfree86.cf @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/config/cf/xfree86.cf,v 3.358 2001/04/20 16:00:46 alanh Exp $ +XCOMM $XFree86: xc/config/cf/xfree86.cf,v 3.360.2.1 2001/05/22 21:25:40 dawes Exp $ /* * This configuration file contains all of the configuration * information for the XFree86 based X Servers. @@ -463,8 +463,19 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $ # define XF86Int10 YES # endif +# ifndef DevelDrivers +# if XFree86Devel +# define DevelDrivers /* */ +# else +# define DevelDrivers /* */ +# endif +# endif + # ifndef XF86CardDrivers -# define XF86CardDrivers newport XF86OSCardDrivers XF86ExtraCardDrivers +# define XF86CardDrivers mga glint nv s3virge sis savage \ + trident chips tdfx fbdev ati \ + DevelDrivers newport \ + XF86OSCardDrivers XF86ExtraCardDrivers # endif #endif @@ -554,7 +565,7 @@ XCOMM $Xorg: xfree86.cf,v 1.4 2000/08/17 19:41:49 cpqbld Exp $ # define TdfxDriDriver /**/ # endif # ifndef DriDrivers -# define DriDrivers gamma TdfxDriDriver mga r128 radeon +# define DriDrivers gamma TdfxDriDriver mga r128 radeon sis # endif #endif diff --git a/xc/config/makedepend/cppsetup.c b/xc/config/makedepend/cppsetup.c index 1190f39c8..5ec48c413 100644 --- a/xc/config/makedepend/cppsetup.c +++ b/xc/config/makedepend/cppsetup.c @@ -20,7 +20,7 @@ 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/config/makedepend/cppsetup.c,v 3.8 2001/04/27 03:03:51 tsi Exp $ */ +/* $XFree86: xc/config/makedepend/cppsetup.c,v 3.9 2001/04/29 23:25:02 tsi Exp $ */ #include "def.h" @@ -195,7 +195,7 @@ my_eval_variable (IfParser *ip, const char *var, int len) } while (s); var = ParseIfExpression(ip, var, &val); - if (var && *var) debug(3, ("extraneous: '%s'\n", var)); + if (var && *var) debug(4, ("extraneous: '%s'\n", var)); return val; } diff --git a/xc/config/makedepend/def.h b/xc/config/makedepend/def.h index 0c1823fcf..2b02b2b55 100644 --- a/xc/config/makedepend/def.h +++ b/xc/config/makedepend/def.h @@ -20,7 +20,7 @@ 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/config/makedepend/def.h,v 3.8 2001/01/17 16:38:58 dawes Exp $ */ +/* $XFree86: xc/config/makedepend/def.h,v 3.9 2001/04/29 23:25:02 tsi Exp $ */ #include "Xos.h" #include "Xfuncproto.h" @@ -65,11 +65,13 @@ in this Software without prior written authorization from The Open Group. #define ELIF 13 #define EJECT 14 #define WARNING 15 -#define IFFALSE 16 /* pseudo value --- never matched */ -#define ELIFFALSE 17 /* pseudo value --- never matched */ -#define INCLUDEDOT 18 /* pseudo value --- never matched */ -#define IFGUESSFALSE 19 /* pseudo value --- never matched */ -#define ELIFGUESSFALSE 20 /* pseudo value --- never matched */ +#define INCLUDENEXT 16 +#define IFFALSE 17 /* pseudo value --- never matched */ +#define ELIFFALSE 18 /* pseudo value --- never matched */ +#define INCLUDEDOT 19 /* pseudo value --- never matched */ +#define IFGUESSFALSE 20 /* pseudo value --- never matched */ +#define ELIFGUESSFALSE 21 /* pseudo value --- never matched */ +#define INCLUDENEXTDOT 22 /* pseudo value --- never matched */ #ifdef DEBUG extern int _debugmask; @@ -147,7 +149,7 @@ void included_by(struct inclist *ip, struct inclist *newfile); struct inclist *newinclude(char *newfile, char *incstring); void inc_clean (void); -struct inclist *inc_path(char *file, char *include, boolean dot); +struct inclist *inc_path(char *file, char *include, int type); void freefile(struct filepointer *fp); @@ -164,7 +166,7 @@ void recursive_pr_include(struct inclist *head, void add_include(struct filepointer *filep, struct inclist *file, struct inclist *file_red, - char *include, boolean dot, + char *include, int type, boolean failOK); int cppsetup(char *line, struct filepointer *filep, diff --git a/xc/config/makedepend/ifparser.c b/xc/config/makedepend/ifparser.c index 4cc74a07e..795ebfba1 100644 --- a/xc/config/makedepend/ifparser.c +++ b/xc/config/makedepend/ifparser.c @@ -58,7 +58,7 @@ * * ParseIfExpression parse a string for #if */ -/* $XFree86: xc/config/makedepend/ifparser.c,v 3.8 2001/01/17 16:38:58 dawes Exp $ */ +/* $XFree86: xc/config/makedepend/ifparser.c,v 3.9 2001/04/29 23:25:02 tsi Exp $ */ #include "ifparser.h" #include <ctype.h> @@ -93,19 +93,48 @@ parse_variable (IfParser *g, const char *cp, const char **varp) static const char * parse_number (IfParser *g, const char *cp, long *valp) { + long base = 10; SKIPSPACE (cp); if (!isdigit(*cp)) return CALLFUNC(g, handle_error) (g, cp, "number"); - *valp = strtol(cp, (char **)&cp, 0); - /* skip trailing qualifiers */ + *valp = 0; + + if (*cp == '0') { + cp++; + if ((*cp == 'x') || (*cp == 'X')) { + base = 16; + cp++; + } else { + base = 8; + } + } + + /* Ignore overflows and assume ASCII, what source is usually written in */ + while (1) { + int increment = -1; + if (base == 8) { + if ((*cp >= '0') && (*cp <= '7')) + increment = *cp++ - '0'; + } else if (base == 16) { + if ((*cp >= '0') && (*cp <= '9')) + increment = *cp++ - '0'; + else if ((*cp >= 'A') && (*cp <= 'F')) + increment = *cp++ - ('A' - 10); + else if ((*cp >= 'a') && (*cp <= 'f')) + increment = *cp++ - ('a' - 10); + } else { /* Decimal */ + if ((*cp >= '0') && (*cp <= '9')) + increment = *cp++ - '0'; + } + if (increment < 0) + break; + *valp = (*valp * base) + increment; + } + + /* Skip trailing qualifiers */ while (*cp == 'U' || *cp == 'u' || *cp == 'L' || *cp == 'l') cp++; -#if 0 - *valp = atoi (cp); - /* EMPTY */ - for (cp++; isdigit(*cp); cp++) ; -#endif return cp; } diff --git a/xc/config/makedepend/include.c b/xc/config/makedepend/include.c index aad51a1e8..62eb495db 100644 --- a/xc/config/makedepend/include.c +++ b/xc/config/makedepend/include.c @@ -20,14 +20,15 @@ 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/config/makedepend/include.c,v 3.5 2001/01/17 16:38:59 dawes Exp $ */ +/* $XFree86: xc/config/makedepend/include.c,v 3.6 2001/04/29 23:25:02 tsi Exp $ */ #include "def.h" extern struct inclist inclist[ MAXFILES ], - *inclistp; -extern char *includedirs[ ]; + *inclistp, *inclistnext; +extern char *includedirs[ ], + **includedirsnext; extern char *notdotdot[ ]; extern boolean show_where_not; extern boolean warn_multiple; @@ -165,6 +166,7 @@ newinclude(char *newfile, char *incstring) else ip->i_incstring = copy(incstring); + inclistnext = inclistp; return(ip); } @@ -229,81 +231,84 @@ inc_clean (void) } struct inclist * -inc_path(char *file, char *include, boolean dot) +inc_path(char *file, char *include, int type) { - static char path[ BUFSIZ ]; + static char path[ BUFSIZ ]; register char **pp, *p; register struct inclist *ip; - struct stat st; - boolean found = FALSE; + struct stat st; /* * Check all previously found include files for a path that * has already been expanded. */ - for (ip = inclist; ip->i_file; ip++) - if ((strcmp(ip->i_incstring, include) == 0) && - !(ip->i_flags & INCLUDED_SYM)) - { - found = TRUE; - break; - } + if ((type == INCLUDE) || (type == INCLUDEDOT)) + inclistnext = inclist; + ip = inclistnext; + + for (; ip->i_file; ip++) { + if ((strcmp(ip->i_incstring, include) == 0) && + !(ip->i_flags & INCLUDED_SYM)) { + inclistnext = ip + 1; + return ip; + } + } - /* - * If the path was surrounded by "" or is an absolute path, - * then check the exact path provided. - */ - if (!found && (dot || *include == '/')) { - if (stat(include, &st) == 0) { - ip = newinclude(include, include); - found = TRUE; + if (inclistnext == inclist) { + /* + * If the path was surrounded by "" or is an absolute path, + * then check the exact path provided. + */ + if ((type == INCLUDEDOT) || + (type == INCLUDENEXTDOT) || + (*include == '/')) { + if (stat(include, &st) == 0) + return newinclude(include, include); + if (show_where_not) + warning1("\tnot in %s\n", include); + } + + /* + * If the path was surrounded by "" see if this include file is + * in the directory of the file being parsed. + */ + if ((type == INCLUDEDOT) || (type == INCLUDENEXTDOT)) { + for (p=file+strlen(file); p>file; p--) + if (*p == '/') + break; + if (p == file) { + strcpy(path, include); + } else { + strncpy(path, file, (p-file) + 1); + path[ (p-file) + 1 ] = '\0'; + strcpy(path + (p-file) + 1, include); + } + remove_dotdot(path); + if (stat(path, &st) == 0) + return newinclude(path, include); + if (show_where_not) + warning1("\tnot in %s\n", path); } - else if (show_where_not) - warning1("\tnot in %s\n", include); } /* - * If the path was surrounded by "" see if this include file is in the - * directory of the file being parsed. + * Check the include directories specified. Standard include dirs + * should be at the end. */ - if (!found && dot) { - for (p=file+strlen(file); p>file; p--) - if (*p == '/') - break; - if (p == file) - strcpy(path, include); - else { - strncpy(path, file, (p-file) + 1); - path[ (p-file) + 1 ] = '\0'; - strcpy(path + (p-file) + 1, include); - } + if ((type == INCLUDE) || (type == INCLUDEDOT)) + includedirsnext = includedirs; + pp = includedirsnext; + + for (; *pp; pp++) { + sprintf(path, "%s/%s", *pp, include); remove_dotdot(path); if (stat(path, &st) == 0) { - ip = newinclude(path, include); - found = TRUE; + includedirsnext = pp + 1; + return newinclude(path, include); } - else if (show_where_not) + if (show_where_not) warning1("\tnot in %s\n", path); } - /* - * Check the include directories specified. (standard include dir - * should be at the end.) - */ - if (!found) - for (pp = includedirs; *pp; pp++) { - sprintf(path, "%s/%s", *pp, include); - remove_dotdot(path); - if (stat(path, &st) == 0) { - ip = newinclude(path, include); - found = TRUE; - break; - } - else if (show_where_not) - warning1("\tnot in %s\n", path); - } - - if (!found) - ip = NULL; - return(ip); + return NULL; } diff --git a/xc/config/makedepend/main.c b/xc/config/makedepend/main.c index b10465fec..abc06b83a 100644 --- a/xc/config/makedepend/main.c +++ b/xc/config/makedepend/main.c @@ -20,7 +20,7 @@ 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/config/makedepend/main.c,v 3.19 2001/04/25 16:44:55 tsi Exp $ */ +/* $XFree86: xc/config/makedepend/main.c,v 3.20 2001/04/29 23:25:02 tsi Exp $ */ #include "def.h" #ifdef hpux @@ -72,6 +72,7 @@ char *directives[] = { "elif", "eject", "warning", + "include_next", NULL }; @@ -81,10 +82,12 @@ char *directives[] = { struct inclist inclist[ MAXFILES ], *inclistp = inclist, + *inclistnext = inclist, maininclist; char *filelist[ MAXFILES ]; -char *includedirs[ MAXDIRS + 1 ]; +char *includedirs[ MAXDIRS + 1 ], + **includedirsnext = includedirs; char *notdotdot[ MAXDIRS ]; char *objprefix = ""; char *objsuffix = OBJSUFFIX; diff --git a/xc/config/makedepend/parse.c b/xc/config/makedepend/parse.c index 677b4d63c..2f57c59b6 100644 --- a/xc/config/makedepend/parse.c +++ b/xc/config/makedepend/parse.c @@ -20,12 +20,16 @@ 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/config/makedepend/parse.c,v 1.7 2001/01/17 16:38:59 dawes Exp $ */ +/* $XFree86: xc/config/makedepend/parse.c,v 1.9 2001/05/18 16:03:05 tsi Exp $ */ #include "def.h" extern char *directives[]; -extern struct inclist maininclist; +extern struct inclist inclist[ MAXFILES ], + *inclistnext, + maininclist; +extern char *includedirs[ ], + **includedirsnext; static int deftype (char *line, struct filepointer *filep, struct inclist *file_red, struct inclist *file, @@ -71,6 +75,8 @@ gobble(struct filepointer *filep, struct inclist *file, case SCCS: case EJECT: case WARNING: + case INCLUDENEXT: + case INCLUDENEXTDOT: break; case ELIF: case ELIFFALSE: @@ -93,7 +99,7 @@ deftype (char *line, struct filepointer *filep, struct inclist *file_red, struct inclist *file, int parse_it) { register char *p; - char *directive, savechar; + char *directive, savechar, *q; register int ret; /* @@ -104,7 +110,7 @@ deftype (char *line, struct filepointer *filep, directive++; p = directive; - while (*p >= 'a' && *p <= 'z') + while ((*p == '_') || (*p >= 'a' && *p <= 'z')) p++; savechar = *p; *p = '\0'; @@ -150,6 +156,11 @@ deftype (char *line, struct filepointer *filep, */ while (*p == ' ' || *p == '\t') p++; + q = p + strlen(p); + do { + q--; + } while (*q == ' ' || *q == '\t'); + q[1] = '\0'; switch (ret) { case IF: /* @@ -172,8 +183,10 @@ deftype (char *line, struct filepointer *filep, *line = '\0'; break; case INCLUDE: - debug(2,("%s, line %d: #include %s\n", - file->i_file, filep->f_line, p)); + case INCLUDENEXT: + debug(2,("%s, line %d: #include%s %s\n", + file->i_file, filep->f_line, + (ret == INCLUDE) ? "" : "_next", p)); /* Support ANSI macro substitution */ { @@ -198,7 +211,10 @@ deftype (char *line, struct filepointer *filep, if (! *p) return(-2); if (*p++ == '"') { - ret = INCLUDEDOT; + if (ret == INCLUDE) + ret = INCLUDEDOT; + else + ret = INCLUDENEXTDOT; while (*p && *p != '"') *line++ = *p++; } else @@ -506,6 +522,8 @@ int find_includes(struct filepointer *filep, struct inclist *file, struct inclist *file_red, int recursion, boolean failOK) { + struct inclist *inclistp; + char **includedirsp; register char *line; register int type; boolean recfailOK; @@ -591,10 +609,14 @@ find_includes(struct filepointer *filep, struct inclist *file, undefine(line, file_red); break; case INCLUDE: - add_include(filep, file, file_red, line, FALSE, failOK); - break; case INCLUDEDOT: - add_include(filep, file, file_red, line, TRUE, failOK); + case INCLUDENEXT: + case INCLUDENEXTDOT: + inclistp = inclistnext; + includedirsp = includedirsnext; + add_include(filep, file, file_red, line, type, failOK); + inclistnext = inclistp; + includedirsnext = includedirsp; break; case ERROR: case WARNING: diff --git a/xc/config/makedepend/pr.c b/xc/config/makedepend/pr.c index 9b797b1f8..481cf8052 100644 --- a/xc/config/makedepend/pr.c +++ b/xc/config/makedepend/pr.c @@ -20,7 +20,7 @@ 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/config/makedepend/pr.c,v 1.3 2001/01/17 16:39:00 dawes Exp $ */ +/* $XFree86: xc/config/makedepend/pr.c,v 1.4 2001/04/29 23:25:02 tsi Exp $ */ #include "def.h" @@ -35,7 +35,7 @@ extern boolean show_where_not; void add_include(struct filepointer *filep, struct inclist *file, - struct inclist *file_red, char *include, boolean dot, + struct inclist *file_red, char *include, int type, boolean failOK) { register struct inclist *newfile; @@ -44,7 +44,7 @@ add_include(struct filepointer *filep, struct inclist *file, /* * First decide what the pathname of this include file really is. */ - newfile = inc_path(file->i_file, include, dot); + newfile = inc_path(file->i_file, include, type); if (newfile == NULL) { if (failOK) return; @@ -55,7 +55,7 @@ add_include(struct filepointer *filep, struct inclist *file, warning("%s, line %d: ", file->i_file, filep->f_line); warning1("cannot find include file \"%s\"\n", include); show_where_not = TRUE; - newfile = inc_path(file->i_file, include, dot); + newfile = inc_path(file->i_file, include, type); show_where_not = FALSE; } diff --git a/xc/config/util/gccmdep.cpp b/xc/config/util/gccmdep.cpp index 31c4a414f..d8dac5cd6 100644 --- a/xc/config/util/gccmdep.cpp +++ b/xc/config/util/gccmdep.cpp @@ -3,7 +3,7 @@ XCOMM!/bin/sh XCOMM XCOMM makedepend which uses 'gcc -M' XCOMM -XCOMM $XFree86: xc/config/util/gccmdep.cpp,v 3.8 2001/03/15 18:39:00 tsi Exp $ +XCOMM $XFree86: xc/config/util/gccmdep.cpp,v 3.8.2.1 2001/05/22 21:25:40 dawes Exp $ XCOMM XCOMM Based on mdepend.cpp and code supplied by Hongjiu Lu <hjl@nynexst.com> XCOMM @@ -23,7 +23,6 @@ endmarker= magic_string='# DO NOT DELETE' append=n args= -asmfiles= while [ $# != 0 ]; do if [ "$endmarker"x != x -a "$endmarker" = "$1" ]; then @@ -110,20 +109,7 @@ if [ X"$makefile" != X- ]; then fi fi -XCOMM need to link .s files to .S -for i in $files; do - case $i in - *.s) - dir=`dirname $i` - base=`basename $i .s` - (cd $dir; $RM ${base}.S; $LN ${base}.s ${base}.S) - asmfiles="$asmfiles ${base}.S" - ;; - esac -done - -CMD="$CC -M $args `echo $files | sed -e 's,\.s$,\.S,g' -e 's,\.s ,\.S ,g'` | \ - sed -e 's,\.S$,\.s,g' -e 's,\.S ,\.s ,g'" +CMD="$CC -M $args $files" if [ X"$makefile" != X- ]; then CMD="$CMD >> $TMP" fi @@ -134,8 +120,5 @@ if [ X"$makefile" != X- ]; then $MV $TMP $makefile fi -if [ x"$asmfiles" != x ]; then - $RM $asmfiles -fi $RM ${TMP}* exit 0 diff --git a/xc/extras/Mesa/docs/RELNOTES-3.4.2 b/xc/extras/Mesa/docs/RELNOTES-3.4.2 new file mode 100644 index 000000000..6661c4123 --- /dev/null +++ b/xc/extras/Mesa/docs/RELNOTES-3.4.2 @@ -0,0 +1,22 @@ + + Mesa 3.4.2 release notes + + May 17, 2001 + + PLEASE READ!!!! + + + +Introduction +------------ + +Mesa uses an even/odd version number scheme like the Linux kernel. +Odd numbered versions (such as 3.3) designate new developmental releases. +Even numbered versions (such as 3.4) designate stable releases. + +Mesa 3.4.2 is a maintenance release that simply fixes bugs found since +the Mesa 3.4.1 release. For details, see the VERSIONS file. + + +---------------------------------------------------------------------- +$Id: RELNOTES-3.4.2,v 1.1.1.1 2001/06/14 21:52:51 dawes Exp $ diff --git a/xc/extras/Mesa/include/GL/gl.h b/xc/extras/Mesa/include/GL/gl.h index 89e371bd9..c8dc72542 100644 --- a/xc/extras/Mesa/include/GL/gl.h +++ b/xc/extras/Mesa/include/GL/gl.h @@ -22,7 +22,6 @@ * 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/extras/Mesa/include/GL/gl.h,v 1.9 2001/04/09 23:08:58 dawes Exp $ */ #ifndef __gl_h_ diff --git a/xc/extras/Mesa/src/X/fakeglx.c b/xc/extras/Mesa/src/X/fakeglx.c index 36b14fea0..c05385239 100644 --- a/xc/extras/Mesa/src/X/fakeglx.c +++ b/xc/extras/Mesa/src/X/fakeglx.c @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 3.4 + * Version: 3.4.2 * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul 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"), @@ -64,7 +64,7 @@ #define SERVER_MINOR_VERSION 3 /* This is appended onto the glXGetClient/ServerString version strings. */ -#define MESA_GLX_VERSION "Mesa 3.4.1" +#define MESA_GLX_VERSION "Mesa 3.4.2" /* Who implemented this GLX? */ #define VENDOR "Brian Paul" @@ -336,22 +336,40 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo ) ); } else if (is_usable_visual( visinfo )) { - /* Configure this visual as RGB, double-buffered, depth-buffered. */ - /* This is surely wrong for some people's needs but what else */ - /* can be done? They should use glXChooseVisual(). */ - return save_glx_visual( dpy, visinfo, - GL_TRUE, /* rgb */ - GL_FALSE, /* alpha */ - GL_TRUE, /* double */ - GL_FALSE, /* stereo */ - DEFAULT_SOFTWARE_DEPTH_BITS, - 8 * sizeof(GLstencil), - 8 * sizeof(GLaccum), /* r */ - 8 * sizeof(GLaccum), /* g */ - 8 * sizeof(GLaccum), /* b */ - 8 * sizeof(GLaccum), /* a */ - 0 /* level */ - ); + if (getenv("MESA_GLX_FORCE_CI")) { + /* Configure this visual as a COLOR INDEX visual. */ + return save_glx_visual( dpy, visinfo, + GL_FALSE, /* rgb */ + GL_FALSE, /* alpha */ + GL_TRUE, /* double */ + GL_FALSE, /* stereo */ + DEFAULT_SOFTWARE_DEPTH_BITS, + 8 * sizeof(GLstencil), + 0 * sizeof(GLaccum), /* r */ + 0 * sizeof(GLaccum), /* g */ + 0 * sizeof(GLaccum), /* b */ + 0 * sizeof(GLaccum), /* a */ + 0 /* level */ + ); + } + else { + /* Configure this visual as RGB, double-buffered, depth-buffered. */ + /* This is surely wrong for some people's needs but what else */ + /* can be done? They should use glXChooseVisual(). */ + return save_glx_visual( dpy, visinfo, + GL_TRUE, /* rgb */ + GL_FALSE, /* alpha */ + GL_TRUE, /* double */ + GL_FALSE, /* stereo */ + DEFAULT_SOFTWARE_DEPTH_BITS, + 8 * sizeof(GLstencil), + 8 * sizeof(GLaccum), /* r */ + 8 * sizeof(GLaccum), /* g */ + 8 * sizeof(GLaccum), /* b */ + 8 * sizeof(GLaccum), /* a */ + 0 /* level */ + ); + } } else { fprintf(stderr,"Mesa: error in glXCreateContext: bad visual\n"); diff --git a/xc/extras/Mesa/src/X/xfonts.c b/xc/extras/Mesa/src/X/xfonts.c index 005ee3912..70190e4be 100644 --- a/xc/extras/Mesa/src/X/xfonts.c +++ b/xc/extras/Mesa/src/X/xfonts.c @@ -259,7 +259,7 @@ void Fake_glXUseXFont( Font font, int first, int count, int listbase ) bm = (GLubyte *) MALLOC((max_bm_width * max_bm_height) * sizeof (GLubyte)); if (!bm) { - XFreeFontInfo( NULL, fs, 0 ); + XFreeFontInfo( NULL, fs, 1 ); gl_error(NULL, GL_OUT_OF_MEMORY, "Couldn't allocate bitmap in glXUseXFont()"); return; @@ -374,7 +374,7 @@ bm_height); } FREE(bm); - XFreeFontInfo( NULL, fs, 0 ); + XFreeFontInfo( NULL, fs, 1 ); XFreeGC (dpy, gc); /* Restore saved packing modes. */ diff --git a/xc/extras/Mesa/src/X/xmesa1.c b/xc/extras/Mesa/src/X/xmesa1.c index 6bc339916..847cb2613 100644 --- a/xc/extras/Mesa/src/X/xmesa1.c +++ b/xc/extras/Mesa/src/X/xmesa1.c @@ -1,10 +1,10 @@ -/* $Id: xmesa1.c,v 1.1.1.11 2001/04/09 16:27:27 dawes Exp $ */ +/* $Id: xmesa1.c,v 1.1.1.12 2001/06/14 21:52:51 dawes Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.4 + * Version: 3.4.2 * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul 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"), @@ -2513,7 +2513,7 @@ const char *XMesaGetString( XMesaContext c, int name ) { (void) c; if (name==XMESA_VERSION) { - return "3.4.1"; + return "3.4.2"; } else if (name==XMESA_EXTENSIONS) { return ""; diff --git a/xc/extras/Mesa/src/X/xmesa2.c b/xc/extras/Mesa/src/X/xmesa2.c index 96d6d8761..10178dcba 100644 --- a/xc/extras/Mesa/src/X/xmesa2.c +++ b/xc/extras/Mesa/src/X/xmesa2.c @@ -3467,11 +3467,32 @@ static void write_span_mono_pixmap( MONO_SPAN_ARGS ) XMesaFillRectangle( dpy, buffer, gc, (int) x, (int) y, n, 1 ); } else { +#if 0 for (i=0;i<n;i++,x++) { if (mask[i]) { XMesaDrawPoint( dpy, buffer, gc, (int) x, (int) y ); } } +#else + /* This version is usually faster. Contributed by Jeff Epler + * and cleaned up by Keith Whitwell. + */ + for (i = 0; i < n; ) { + GLuint start = i; + /* Identify and emit contiguous rendered pixels + */ + for( ; i < n && mask[i]; i++) + /* Nothing */; + if (start < i) + XMesaFillRectangle( dpy, buffer, gc, + (int)(x+start), (int) y, + (int)(i-start), 1); + /* Eat up non-rendered pixels + */ + for(; i < n && !mask[i]; i++) + /* Nothing */; + } +#endif } } @@ -4194,10 +4215,18 @@ static void write_span_index8_pixmap( INDEX8_SPAN_ARGS ) XMesaGC gc = xmesa->xm_buffer->gc2; register GLuint i; y = FLIP(xmesa->xm_buffer, y); - for (i=0;i<n;i++,x++) { - if (mask[i]) { - XMesaSetForeground( dpy, gc, (unsigned long) index[i] ); - XMesaDrawPoint( dpy, buffer, gc, (int) x, (int) y ); + if (mask) { + for (i=0;i<n;i++,x++) { + if (mask[i]) { + XMesaSetForeground( dpy, gc, (unsigned long) index[i] ); + XMesaDrawPoint( dpy, buffer, gc, (int) x, (int) y ); + } + } + } + else { + for (i=0;i<n;i++,x++) { + XMesaSetForeground( dpy, gc, (unsigned long) index[i] ); + XMesaDrawPoint( dpy, buffer, gc, (int) x, (int) y ); } } } @@ -4212,9 +4241,16 @@ static void write_span_index_ximage( INDEX_SPAN_ARGS ) XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; y = FLIP(xmesa->xm_buffer, y); - for (i=0;i<n;i++,x++) { - if (mask[i]) { - XMesaPutPixel( img, x, y, (unsigned long) index[i] ); + if (mask) { + for (i=0;i<n;i++,x++) { + if (mask[i]) { + XMesaPutPixel( img, x, y, (unsigned long) index[i] ); + } + } + } + else { + for (i=0;i<n;i++,x++) { + XMesaPutPixel( img, x, y, (unsigned long) index[i] ); } } } diff --git a/xc/extras/Mesa/src/X/xmesaP.h b/xc/extras/Mesa/src/X/xmesaP.h index 4d7718c53..6fd339c53 100644 --- a/xc/extras/Mesa/src/X/xmesaP.h +++ b/xc/extras/Mesa/src/X/xmesaP.h @@ -226,7 +226,11 @@ struct xmesa_buffer { /* Used to do XAllocColor/XFreeColors accounting: */ int num_alloced; +#if defined(XFree86Server) Pixel alloced_colors[256]; +#else + unsigned long alloced_colors[256]; +#endif #if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) __DRIdrawablePrivate *driDrawPriv; /* back pointer to DRI drawable diff --git a/xc/extras/Mesa/src/X86/common_x86_asm.S b/xc/extras/Mesa/src/X86/common_x86_asm.S index 440aae749..df4b96615 100644 --- a/xc/extras/Mesa/src/X86/common_x86_asm.S +++ b/xc/extras/Mesa/src/X86/common_x86_asm.S @@ -32,7 +32,6 @@ * * Cleaned up and simplified by Gareth Hughes <gareth@valinux.com> */ -/* $XFree86: xc/extras/Mesa/src/X86/common_x86_asm.S,v 1.8 2001/03/21 02:48:58 dawes Exp $ */ #include "assyntax.h" #include "common_x86_features.h" diff --git a/xc/extras/Mesa/src/aatriangle.c b/xc/extras/Mesa/src/aatriangle.c index cb6adcd6f..d631b0a6f 100644 --- a/xc/extras/Mesa/src/aatriangle.c +++ b/xc/extras/Mesa/src/aatriangle.c @@ -142,25 +142,26 @@ static GLfloat compute_coveragef(const GLfloat v0[3], const GLfloat v1[3], const GLfloat v2[3], GLint winx, GLint winy) { +#define B 0.125 static const GLfloat samples[16][2] = { /* start with the four corners */ - { 0.00, 0.00 }, - { 0.75, 0.00 }, - { 0.00, 0.75 }, - { 0.75, 0.75 }, + { 0.00+B, 0.00+B }, + { 0.75+B, 0.00+B }, + { 0.00+B, 0.75+B }, + { 0.75+B, 0.75+B }, /* continue with interior samples */ - { 0.25, 0.00 }, - { 0.50, 0.00 }, - { 0.00, 0.25 }, - { 0.25, 0.25 }, - { 0.50, 0.25 }, - { 0.75, 0.25 }, - { 0.00, 0.50 }, - { 0.25, 0.50 }, - { 0.50, 0.50 }, - { 0.75, 0.50 }, - { 0.25, 0.75 }, - { 0.50, 0.75 } + { 0.25+B, 0.00+B }, + { 0.50+B, 0.00+B }, + { 0.00+B, 0.25+B }, + { 0.25+B, 0.25+B }, + { 0.50+B, 0.25+B }, + { 0.75+B, 0.25+B }, + { 0.00+B, 0.50+B }, + { 0.25+B, 0.50+B }, + { 0.50+B, 0.50+B }, + { 0.75+B, 0.50+B }, + { 0.25+B, 0.75+B }, + { 0.50+B, 0.75+B } }; const GLfloat x = (GLfloat) winx; const GLfloat y = (GLfloat) winy; @@ -230,23 +231,23 @@ compute_coveragei(const GLfloat v0[3], const GLfloat v1[3], */ static const GLfloat samples[15][2] = { /* start with the four corners */ - { 0.00, 0.00 }, - { 0.75, 0.00 }, - { 0.00, 0.75 }, - { 0.75, 0.75 }, + { 0.00+B, 0.00+B }, + { 0.75+B, 0.00+B }, + { 0.00+B, 0.75+B }, + { 0.75+B, 0.75+B }, /* continue with interior samples */ - { 0.25, 0.00 }, - { 0.50, 0.00 }, - { 0.00, 0.25 }, - { 0.25, 0.25 }, - { 0.50, 0.25 }, - { 0.75, 0.25 }, - { 0.00, 0.50 }, - { 0.25, 0.50 }, + { 0.25+B, 0.00+B }, + { 0.50+B, 0.00+B }, + { 0.00+B, 0.25+B }, + { 0.25+B, 0.25+B }, + { 0.50+B, 0.25+B }, + { 0.75+B, 0.25+B }, + { 0.00+B, 0.50+B }, + { 0.25+B, 0.50+B }, /*{ 0.50, 0.50 },*/ - { 0.75, 0.50 }, - { 0.25, 0.75 }, - { 0.50, 0.75 } + { 0.75+B, 0.50+B }, + { 0.25+B, 0.75+B }, + { 0.50+B, 0.75+B } }; const GLfloat x = (GLfloat) winx; const GLfloat y = (GLfloat) winy; diff --git a/xc/extras/Mesa/src/aatritemp.h b/xc/extras/Mesa/src/aatritemp.h index 38c2fa24a..2115ee9cf 100644 --- a/xc/extras/Mesa/src/aatritemp.h +++ b/xc/extras/Mesa/src/aatritemp.h @@ -253,43 +253,45 @@ ix = startX; count = 0; while (coverage > 0.0F) { + /* (cx,cy) = center of fragment */ + GLfloat cx = ix + 0.5F, cy = iy + 0.5F; #ifdef DO_Z - z[count] = (GLdepth) solve_plane(ix, iy, zPlane); + z[count] = (GLdepth) solve_plane(cx, cy, zPlane); #endif #ifdef DO_RGBA - rgba[count][RCOMP] = solve_plane_0_255(ix, iy, rPlane); - rgba[count][GCOMP] = solve_plane_0_255(ix, iy, gPlane); - rgba[count][BCOMP] = solve_plane_0_255(ix, iy, bPlane); - rgba[count][ACOMP] = (GLubyte) (solve_plane_0_255(ix, iy, aPlane) * coverage); + rgba[count][RCOMP] = solve_plane_0_255(cx, cy, rPlane); + rgba[count][GCOMP] = solve_plane_0_255(cx, cy, gPlane); + rgba[count][BCOMP] = solve_plane_0_255(cx, cy, bPlane); + rgba[count][ACOMP] = (GLubyte) (solve_plane_0_255(cx, cy, aPlane) * coverage); #endif #ifdef DO_INDEX { GLint frac = compute_coveragei(pMin, pMid, pMax, ix, iy); - GLint indx = (GLint) solve_plane(ix, iy, iPlane); + GLint indx = (GLint) solve_plane(cx, cy, iPlane); index[count] = (indx & ~0xf) | frac; } #endif #ifdef DO_SPEC - spec[count][RCOMP] = solve_plane_0_255(ix, iy, srPlane); - spec[count][GCOMP] = solve_plane_0_255(ix, iy, sgPlane); - spec[count][BCOMP] = solve_plane_0_255(ix, iy, sbPlane); + spec[count][RCOMP] = solve_plane_0_255(cx, cy, srPlane); + spec[count][GCOMP] = solve_plane_0_255(cx, cy, sgPlane); + spec[count][BCOMP] = solve_plane_0_255(cx, cy, sbPlane); #endif #ifdef DO_STUV0 { - GLfloat invQ = solve_plane_recip(ix, iy, v0Plane); - s[0][count] = solve_plane(ix, iy, s0Plane) * invQ; - t[0][count] = solve_plane(ix, iy, t0Plane) * invQ; - u[0][count] = solve_plane(ix, iy, u0Plane) * invQ; + const GLfloat invQ = solve_plane_recip(cx, cy, v0Plane); + s[0][count] = solve_plane(cx, cy, s0Plane) * invQ; + t[0][count] = solve_plane(cx, cy, t0Plane) * invQ; + u[0][count] = solve_plane(cx, cy, u0Plane) * invQ; lambda[0][count] = compute_lambda(s0Plane, t0Plane, invQ, width0, height0); } #endif #ifdef DO_STUV1 { - GLfloat invQ = solve_plane_recip(ix, iy, v1Plane); - s[1][count] = solve_plane(ix, iy, s1Plane) * invQ; - t[1][count] = solve_plane(ix, iy, t1Plane) * invQ; - u[1][count] = solve_plane(ix, iy, u1Plane) * invQ; + const GLfloat invQ = solve_plane_recip(cx, cy, v1Plane); + s[1][count] = solve_plane(cx, cy, s1Plane) * invQ; + t[1][count] = solve_plane(cx, cy, t1Plane) * invQ; + u[1][count] = solve_plane(cx, cy, u1Plane) * invQ; lambda[1][count] = compute_lambda(s1Plane, t1Plane, invQ, width1, height1); } @@ -362,43 +364,45 @@ ix = startX; count = 0; while (coverage > 0.0F) { + /* (cx,cy) = center of fragment */ + const GLfloat cx = ix + 0.5F, cy = iy + 0.5F; #ifdef DO_Z - z[ix] = (GLdepth) solve_plane(ix, iy, zPlane); + z[ix] = (GLdepth) solve_plane(cx, cy, zPlane); #endif #ifdef DO_RGBA - rgba[ix][RCOMP] = solve_plane_0_255(ix, iy, rPlane); - rgba[ix][GCOMP] = solve_plane_0_255(ix, iy, gPlane); - rgba[ix][BCOMP] = solve_plane_0_255(ix, iy, bPlane); - rgba[ix][ACOMP] = (GLubyte) (solve_plane_0_255(ix, iy, aPlane) * coverage); + rgba[ix][RCOMP] = solve_plane_0_255(cx, cy, rPlane); + rgba[ix][GCOMP] = solve_plane_0_255(cx, cy, gPlane); + rgba[ix][BCOMP] = solve_plane_0_255(cx, cy, bPlane); + rgba[ix][ACOMP] = (GLubyte) (solve_plane_0_255(cx, cy, aPlane) * coverage); #endif #ifdef DO_INDEX { GLint frac = compute_coveragei(pMin, pMax, pMid, ix, iy); - GLint indx = (GLint) solve_plane(ix, iy, iPlane); + GLint indx = (GLint) solve_plane(cx, cy, iPlane); index[ix] = (indx & ~0xf) | frac; } #endif #ifdef DO_SPEC - spec[ix][RCOMP] = solve_plane_0_255(ix, iy, srPlane); - spec[ix][GCOMP] = solve_plane_0_255(ix, iy, sgPlane); - spec[ix][BCOMP] = solve_plane_0_255(ix, iy, sbPlane); + spec[ix][RCOMP] = solve_plane_0_255(cx, cy, srPlane); + spec[ix][GCOMP] = solve_plane_0_255(cx, cy, sgPlane); + spec[ix][BCOMP] = solve_plane_0_255(cx, cy, sbPlane); #endif #ifdef DO_STUV0 { - GLfloat invQ = solve_plane_recip(ix, iy, v0Plane); - s[0][ix] = solve_plane(ix, iy, s0Plane) * invQ; - t[0][ix] = solve_plane(ix, iy, t0Plane) * invQ; - u[0][ix] = solve_plane(ix, iy, u0Plane) * invQ; + const GLfloat invQ = solve_plane_recip(cx, cy, v0Plane); + s[0][ix] = solve_plane(cx, cy, s0Plane) * invQ; + t[0][ix] = solve_plane(cx, cy, t0Plane) * invQ; + u[0][ix] = solve_plane(cx, cy, u0Plane) * invQ; lambda[0][ix] = compute_lambda(s0Plane, t0Plane, invQ, width0, height0); } #endif #ifdef DO_STUV1 { - GLfloat invQ = solve_plane_recip(ix, iy, v1Plane); - s[1][ix] = solve_plane(ix, iy, s1Plane) * invQ; - t[1][ix] = solve_plane(ix, iy, t1Plane) * invQ; - u[1][ix] = solve_plane(ix, iy, u1Plane) * invQ; + const GLfloat invQ = solve_plane_recip(cx, cy, v1Plane); + s[1][ix] = solve_plane(cx, cy, s1Plane) * invQ; + t[1][ix] = solve_plane(cx, cy, t1Plane) * invQ; + u[1][ix] = solve_plane(cx, cy, u1Plane) * invQ; lambda[1][ix] = compute_lambda(s1Plane, t1Plane, invQ, width1, height1); } diff --git a/xc/extras/Mesa/src/alphabuf.c b/xc/extras/Mesa/src/alphabuf.c index 6f2332407..046ad0ddc 100644 --- a/xc/extras/Mesa/src/alphabuf.c +++ b/xc/extras/Mesa/src/alphabuf.c @@ -166,12 +166,13 @@ _mesa_clear_alpha_buffers( GLcontext *ctx ) GLint j; GLint rowLen = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1; GLint rows = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin + 1; + GLint width = ctx->DrawBuffer->Width; GLubyte *aptr = buffer + ctx->DrawBuffer->Ymin * ctx->DrawBuffer->Width + ctx->DrawBuffer->Xmin; for (j = 0; j < rows; j++) { MEMSET( aptr, aclear, rowLen ); - aptr += rowLen; + aptr += width; } } else { diff --git a/xc/extras/Mesa/src/buffers.c b/xc/extras/Mesa/src/buffers.c index 214e644cb..437cda37e 100644 --- a/xc/extras/Mesa/src/buffers.c +++ b/xc/extras/Mesa/src/buffers.c @@ -167,7 +167,7 @@ clear_color_buffer(GLcontext *ctx) } else { /* Color index mode */ - ASSERT(ctx->Color.IndexMask == (GLuint) ~0); + ASSERT(ctx->Color.IndexMask == ((1 << ctx->Visual->IndexBits) - 1)); if (ctx->Visual->IndexBits == 8) { /* 8-bit clear */ GLubyte span[MAX_WIDTH]; diff --git a/xc/extras/Mesa/src/config.h b/xc/extras/Mesa/src/config.h index 07ff841f6..01440943f 100644 --- a/xc/extras/Mesa/src/config.h +++ b/xc/extras/Mesa/src/config.h @@ -106,7 +106,7 @@ /* Maximum viewport/image size: */ #define MAX_WIDTH 2048 -#define MAX_HEIGHT 1200 +#define MAX_HEIGHT 2048 /* Maxmimum size for CVA. May be overridden by the drivers. */ #define MAX_ARRAY_LOCK_SIZE 3000 diff --git a/xc/extras/Mesa/src/copy_tmp.h b/xc/extras/Mesa/src/copy_tmp.h index ffc0f66c2..8a4ec826f 100644 --- a/xc/extras/Mesa/src/copy_tmp.h +++ b/xc/extras/Mesa/src/copy_tmp.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/extras/Mesa/src/copy_tmp.h,v 1.4 2001/04/01 13:59:57 tsi Exp $ */ + /* * Mesa 3-D graphics library * Version: 3.1 @@ -27,7 +27,8 @@ * New (3.1) transformation code written by Keith Whitwell. */ -#undef COPY_FUNC + +#undef COPY_FUNC #define COPY_FUNC( BITS ) \ static void TAG2(copy, BITS)(GLvector4f *to, const GLvector4f *f, \ const GLubyte mask[] ) \ diff --git a/xc/extras/Mesa/src/cva.c b/xc/extras/Mesa/src/cva.c index 1f1c83358..028853e5a 100644 --- a/xc/extras/Mesa/src/cva.c +++ b/xc/extras/Mesa/src/cva.c @@ -612,7 +612,7 @@ void gl_prepare_arrays_cva( struct vertex_buffer *VB ) if (enable & VERT_INDEX) { GLvector1ui *index = VB->IndexPtr = &cva->v.Index; - VB->Index[0] = VB->Index[1] = VB->IndexPtr; + VB->Index[0] = VB->Index[1] = VB->IndexPtr = &cva->v.Index; #ifdef VAO client_data = &ctx->Array.Current->Index; diff --git a/xc/extras/Mesa/src/extensions.c b/xc/extras/Mesa/src/extensions.c index a86c77e02..f24c55539 100644 --- a/xc/extras/Mesa/src/extensions.c +++ b/xc/extras/Mesa/src/extensions.c @@ -52,7 +52,7 @@ static struct { int enabled; const char *name; } default_extensions[] = { { DEFAULT_ON, "GL_ARB_multitexture" }, { DEFAULT_OFF, "GL_ARB_texture_compression" }, { DEFAULT_OFF, "GL_ARB_texture_cube_map" }, /* in progress */ - { ALWAYS_ENABLED, "GL_ARB_tranpose_matrix" }, + { ALWAYS_ENABLED, "GL_ARB_transpose_matrix" }, { ALWAYS_ENABLED, "GL_EXT_abgr" }, { DEFAULT_ON, "GL_EXT_blend_color" }, { DEFAULT_ON, "GL_EXT_blend_func_separate" }, diff --git a/xc/extras/Mesa/src/fog_tmp.h b/xc/extras/Mesa/src/fog_tmp.h index 830173129..cec9c0d91 100644 --- a/xc/extras/Mesa/src/fog_tmp.h +++ b/xc/extras/Mesa/src/fog_tmp.h @@ -178,7 +178,6 @@ static void TAG(fog_ci_vertices)( struct vertex_buffer *VB, VB->IndexPtr = VB->FoggedIndex[side]; out = VB->IndexPtr->start; - /* NOTE: the use of casts generates better/faster code for MIPS */ for ( i = 0; i < n ; i++, STRIDE_F(v,stride), STRIDE_UI(in,in_stride)) CULLCHECK { @@ -364,12 +363,11 @@ static void TAG(fog_ci_vertices)( struct vertex_buffer *VB, (void) flag; (void) cullmask; - in = VB->Index[side]->start; in_stride = VB->Index[side]->stride; - VB->IndexPtr = VB->FoggedIndex[side]; - out = VB->IndexPtr->start; - + VB->Index[side] = VB->FoggedIndex[side]; + VB->IndexPtr = VB->Index[0]; + out = (GLuint *)VB->Index[side]->start; /* NOTE: the extensive use of casts generates better/faster code for MIPS */ if (vertex_size > 2) { @@ -385,7 +383,7 @@ static void TAG(fog_ci_vertices)( struct vertex_buffer *VB, CULLCHECK { GLfloat f = (fogend - ABSF(v[2])) * d; f = CLAMP( f, 0.0, 1.0 ); - *out = (GLint) ((GLfloat)(GLint) *in + (1.0F-f) * fogindex); + out[i] = (GLint) ((GLfloat)(GLint) *in + (1.0F-f) * fogindex); } } break; @@ -398,7 +396,7 @@ static void TAG(fog_ci_vertices)( struct vertex_buffer *VB, { CULLCHECK { GLfloat f = exp( d * ABSF(v[2]) ); - *out = (GLint) ((GLfloat)(GLint) *in + (1.0F-f) * fogindex); + out[i] = (GLint) ((GLfloat)(GLint) *in + (1.0F-f) * fogindex); } } break; @@ -421,7 +419,8 @@ static void TAG(fog_ci_vertices)( struct vertex_buffer *VB, gl_problem(ctx, "Bad fog mode in gl_fog_ci_vertices"); return; } - } else if (ctx->Fog.Mode == GL_LINEAR) { + } + else if (ctx->Fog.Mode == GL_LINEAR) { GLuint fogindex; GLfloat f = ctx->Fog.End / (ctx->Fog.End - ctx->Fog.Start); @@ -431,7 +430,7 @@ static void TAG(fog_ci_vertices)( struct vertex_buffer *VB, for ( i = 0; i < n ; i++, STRIDE_F(v,stride), STRIDE_UI(in,in_stride)) { CULLCHECK { - *out = *in + fogindex; + out[i] = *in + fogindex; } } } diff --git a/xc/extras/Mesa/src/get.c b/xc/extras/Mesa/src/get.c index d724141cb..086010965 100644 --- a/xc/extras/Mesa/src/get.c +++ b/xc/extras/Mesa/src/get.c @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 3.4 + * Version: 3.4.2 * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul 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"), @@ -5094,7 +5094,7 @@ _mesa_GetString( GLenum name ) GET_CURRENT_CONTEXT(ctx); static const char *vendor = "Brian Paul"; static const char *renderer = "Mesa"; - static const char *version = "1.2 Mesa 3.4.1"; + static const char *version = "1.2 Mesa 3.4.2"; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGetString", 0); diff --git a/xc/extras/Mesa/src/image.c b/xc/extras/Mesa/src/image.c index 87ba3699c..4742db514 100644 --- a/xc/extras/Mesa/src/image.c +++ b/xc/extras/Mesa/src/image.c @@ -2302,9 +2302,6 @@ _mesa_unpack_ubyte_color_span( GLcontext *ctx, srcType == GL_UNSIGNED_INT_10_10_10_2 || srcType == GL_UNSIGNED_INT_2_10_10_10_REV); - /* this is intended for RGBA mode only */ - assert(ctx->Visual->RGBAflag); - applyTransferOps &= (ctx->Pixel.ScaleOrBiasRGBA || ctx->Pixel.MapColorFlag || ctx->ColorMatrix.type != MATRIX_IDENTITY || diff --git a/xc/extras/Mesa/src/imaging.c b/xc/extras/Mesa/src/imaging.c index c6d7d9bdf..83cfa5c81 100644 --- a/xc/extras/Mesa/src/imaging.c +++ b/xc/extras/Mesa/src/imaging.c @@ -1035,7 +1035,7 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, G { const GLfloat *scale = ctx->Pixel.ConvolutionFilterScale[1]; const GLfloat *bias = ctx->Pixel.ConvolutionFilterBias[1]; - for (i = 0; i < width * height * 4; i++) { + for (i = 0; i < width * height; i++) { GLfloat r = ctx->Convolution2D.Filter[i * 4 + 0]; GLfloat g = ctx->Convolution2D.Filter[i * 4 + 1]; GLfloat b = ctx->Convolution2D.Filter[i * 4 + 2]; diff --git a/xc/extras/Mesa/src/interp_tmp.h b/xc/extras/Mesa/src/interp_tmp.h index 0c9b4c287..19013ab00 100644 --- a/xc/extras/Mesa/src/interp_tmp.h +++ b/xc/extras/Mesa/src/interp_tmp.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/extras/Mesa/src/interp_tmp.h,v 1.5 2001/04/01 13:59:57 tsi Exp $ */ + /* * Mesa 3-D graphics library * Version: 3.1 @@ -23,7 +23,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#undef INTERP_UBYTE +#undef INTERP_UBYTE #define INTERP_UBYTE( out, t, a, b ) { \ GLfloat fa = UBYTE_COLOR_TO_FLOAT_COLOR(a); \ GLfloat fb = UBYTE_COLOR_TO_FLOAT_COLOR(b); \ @@ -33,7 +33,7 @@ #if 1 -#undef INTERP_RGBA +#undef INTERP_RGBA #define INTERP_RGBA(nr, t, out, a, b) { \ int i; \ for (i = 0; i < nr; i++) { \ @@ -45,7 +45,7 @@ } #else -#undef INTERP_RGBA +#undef INTERP_RGBA #define INTERP_RGBA(nr, t, out, a, b) { \ int n; \ const GLuint ti = FloatToInt(t*256.0F); \ diff --git a/xc/extras/Mesa/src/logic.c b/xc/extras/Mesa/src/logic.c index 31d6462fb..8a4edae02 100644 --- a/xc/extras/Mesa/src/logic.c +++ b/xc/extras/Mesa/src/logic.c @@ -297,7 +297,7 @@ static void rgba_logicop( const GLcontext *ctx, GLuint n, case GL_NAND: for (i=0;i<n;i++) { if (mask[i]) { - src[i] = ~(src[i] & src[i]); + src[i] = ~(src[i] & dest[i]); } } break; diff --git a/xc/extras/Mesa/src/stencil.c b/xc/extras/Mesa/src/stencil.c index 77755c313..24080e3c3 100644 --- a/xc/extras/Mesa/src/stencil.c +++ b/xc/extras/Mesa/src/stencil.c @@ -1390,7 +1390,7 @@ clear_hardware_stencil_buffer( GLcontext *ctx ) else { /* clear whole buffer without masking */ const GLint width = ctx->DrawBuffer->Width; - const GLint height = ctx->DrawBuffer->Width; + const GLint height = ctx->DrawBuffer->Height; const GLint x = ctx->DrawBuffer->Xmin; GLstencil stencil[MAX_WIDTH]; GLint y, i; diff --git a/xc/extras/Mesa/src/teximage.c b/xc/extras/Mesa/src/teximage.c index e1d676dbb..ce1a11347 100644 --- a/xc/extras/Mesa/src/teximage.c +++ b/xc/extras/Mesa/src/teximage.c @@ -447,6 +447,7 @@ _mesa_select_tex_object(GLcontext *ctx, struct gl_texture_unit *texUnit, case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB: case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB: case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB: + case GL_TEXTURE_CUBE_MAP_ARB: return ctx->Extensions.HaveTextureCubeMap ? texUnit->CurrentCubeMap : NULL; case GL_PROXY_TEXTURE_CUBE_MAP_ARB: diff --git a/xc/extras/Mesa/src/teximage.h b/xc/extras/Mesa/src/teximage.h index ebc45e690..45ce79a1b 100644 --- a/xc/extras/Mesa/src/teximage.h +++ b/xc/extras/Mesa/src/teximage.h @@ -2,19 +2,19 @@ /* * Mesa 3-D graphics library * Version: 3.4 - * + * * Copyright (C) 1999-2000 Brian Paul 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 * 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 @@ -142,7 +142,7 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, extern void -_mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, +_mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width ); @@ -152,7 +152,7 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, GLint x, GLint y, GLsizei width, GLsizei height ); -extern void +extern void _mesa_CopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ); @@ -204,4 +204,3 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img); #endif - diff --git a/xc/extras/Mesa/src/texstate.c b/xc/extras/Mesa/src/texstate.c index d74feb578..95e64647d 100644 --- a/xc/extras/Mesa/src/texstate.c +++ b/xc/extras/Mesa/src/texstate.c @@ -890,22 +890,46 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = img->Border; return; case GL_TEXTURE_RED_SIZE: - *params = img->TexFormat->RedBits; + if (img->Format == GL_RGB || img->Format == GL_RGBA) + *params = img->TexFormat->RedBits; + else + *params = 0; return; case GL_TEXTURE_GREEN_SIZE: - *params = img->TexFormat->GreenBits; + if (img->Format == GL_RGB || img->Format == GL_RGBA) + *params = img->TexFormat->GreenBits; + else + *params = 0; return; case GL_TEXTURE_BLUE_SIZE: - *params = img->TexFormat->BlueBits; + if (img->Format == GL_RGB || img->Format == GL_RGBA) + *params = img->TexFormat->BlueBits; + else + *params = 0; return; case GL_TEXTURE_ALPHA_SIZE: - *params = img->TexFormat->AlphaBits; + if (img->Format == GL_ALPHA || img->Format == GL_LUMINANCE_ALPHA || + img->Format == GL_RGBA) + *params = img->TexFormat->AlphaBits; + else + *params = 0; return; case GL_TEXTURE_INTENSITY_SIZE: - *params = img->TexFormat->IntensityBits; + if (img->Format != GL_INTENSITY) + *params = 0; + else if (img->TexFormat->IntensityBits > 0) + *params = img->TexFormat->IntensityBits; + else /* intensity probably stored as rgb texture */ + *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); return; case GL_TEXTURE_LUMINANCE_SIZE: - *params = img->TexFormat->LuminanceBits; + if (img->Format != GL_LUMINANCE && + img->Format != GL_LUMINANCE_ALPHA) + *params = 0; + else if (img->TexFormat->LuminanceBits) + *params = img->TexFormat->LuminanceBits; + else /* luminance probably stored as rgb texture */ + *params = img->TexFormat->RedBits; return; case GL_TEXTURE_INDEX_SIZE_EXT: *params = img->TexFormat->IndexBits; @@ -1616,7 +1640,7 @@ _mesa_ActiveTextureARB( GLenum target ) } } else { - gl_error(ctx, GL_INVALID_OPERATION, "glActiveTextureARB(target)"); + gl_error(ctx, GL_INVALID_ENUM, "glActiveTextureARB(target)"); } } @@ -1635,7 +1659,7 @@ _mesa_ClientActiveTextureARB( GLenum target ) ctx->Array.ActiveTexture = texUnit; } else { - gl_error(ctx, GL_INVALID_OPERATION, "glActiveTextureARB(target)"); + gl_error(ctx, GL_INVALID_ENUM, "glClientActiveTextureARB(target)"); } } diff --git a/xc/extras/Mesa/src/texture.c b/xc/extras/Mesa/src/texture.c index 6a2b2dfb1..e361a1196 100644 --- a/xc/extras/Mesa/src/texture.c +++ b/xc/extras/Mesa/src/texture.c @@ -2063,10 +2063,12 @@ _mesa_texture_combine(const GLcontext *ctx, const GLubyte red = FLOAT_TO_UBYTE(textureUnit->EnvColor[0]); const GLubyte green = FLOAT_TO_UBYTE(textureUnit->EnvColor[1]); const GLubyte blue = FLOAT_TO_UBYTE(textureUnit->EnvColor[2]); + const GLubyte alpha = FLOAT_TO_UBYTE(textureUnit->EnvColor[3]); for (i = 0; i < n; i++) { c[i][RCOMP] = red; c[i][GCOMP] = green; c[i][BCOMP] = blue; + c[i][ACOMP] = alpha; } argRGB[j] = ccolor[j]; } @@ -2079,6 +2081,7 @@ _mesa_texture_combine(const GLcontext *ctx, GLubyte (*src)[4] = argRGB[j]; GLubyte (*dst)[4] = ccolor[j]; + /* point to new arg[j] storage */ argRGB[j] = ccolor[j]; if (textureUnit->CombineOperandRGB[j] == GL_ONE_MINUS_SRC_COLOR) { @@ -2089,7 +2092,6 @@ _mesa_texture_combine(const GLcontext *ctx, } } else if (textureUnit->CombineOperandRGB[j] == GL_SRC_ALPHA) { - src = argA[j]; for (i = 0; i < n; i++) { dst[i][RCOMP] = src[i][ACOMP]; dst[i][GCOMP] = src[i][ACOMP]; @@ -2097,7 +2099,6 @@ _mesa_texture_combine(const GLcontext *ctx, } } else { /* GL_ONE_MINUS_SRC_ALPHA */ - src = argA[j]; for (i = 0; i < n; i++) { dst[i][RCOMP] = 255 - src[i][ACOMP]; dst[i][GCOMP] = 255 - src[i][ACOMP]; diff --git a/xc/extras/Mesa/src/texutil.c b/xc/extras/Mesa/src/texutil.c index 4143830c1..13f6c7a3a 100644 --- a/xc/extras/Mesa/src/texutil.c +++ b/xc/extras/Mesa/src/texutil.c @@ -39,7 +39,7 @@ #include "types.h" #endif -#define DBG 0 +#define DEBUG_TEXUTIL 0 struct gl_texture_convert { @@ -63,20 +63,6 @@ typedef void (*unconvert_func)( struct gl_texture_convert *convert ); #define CONVERT_STRIDE_BIT 0x1 #define CONVERT_PACKING_BIT 0x2 -#ifdef __GNUC__ -#define ERROR_STRING __FUNCTION__ -#else -#define ERROR_STRING __FILE__ ":" __LINE__ -#endif -#define UNCONVERT_ERROR( format ) \ -do { \ - static char buffer[128]; \ - sprintf( buffer, "illegal format %s in " ERROR_STRING "\n", \ - gl_lookup_enum_by_nr( format ) ); \ - gl_problem( NULL, buffer ); \ -} while (0) - - /* ================================================================ * RGBA8888 textures: @@ -184,8 +170,7 @@ unconvert_teximage_rgba8888( struct gl_texture_convert *convert ) break; } default: - UNCONVERT_ERROR( convert->format ); - break; + gl_problem(NULL, "texture unconvert error"); } } @@ -274,8 +259,7 @@ unconvert_teximage_abgr8888( struct gl_texture_convert *convert ) break; } default: - UNCONVERT_ERROR( convert->format ); - break; + gl_problem(NULL, "texture unconvert error"); } } @@ -386,8 +370,7 @@ unconvert_teximage_argb8888( struct gl_texture_convert *convert ) break; } default: - UNCONVERT_ERROR( convert->format ); - break; + gl_problem(NULL, "texture unconvert error"); } } @@ -417,7 +400,7 @@ convert_texsubimage3d_rgb888( struct gl_texture_convert *convert ) static void unconvert_teximage_rgb888( struct gl_texture_convert *convert ) { - UNCONVERT_ERROR( convert->format ); + gl_problem(NULL, "texture unconvert error"); } @@ -446,7 +429,7 @@ convert_texsubimage3d_bgr888( struct gl_texture_convert *convert ) static void unconvert_teximage_bgr888( struct gl_texture_convert *convert ) { - UNCONVERT_ERROR( convert->format ); + gl_problem(NULL, "texture unconvert error"); } @@ -560,8 +543,7 @@ unconvert_teximage_rgb565( struct gl_texture_convert *convert ) } break; default: - UNCONVERT_ERROR( convert->format ); - break; + gl_problem(NULL, "texture unconvert error"); } } @@ -649,8 +631,7 @@ unconvert_teximage_argb4444( struct gl_texture_convert *convert ) } break; default: - UNCONVERT_ERROR( convert->format ); - break; + gl_problem(NULL, "texture unconvert error"); } } @@ -738,8 +719,7 @@ unconvert_teximage_argb1555( struct gl_texture_convert *convert ) } break; default: - UNCONVERT_ERROR( convert->format ); - break; + gl_problem(NULL, "texture unconvert error"); } } @@ -855,8 +835,7 @@ unconvert_teximage_al88( struct gl_texture_convert *convert ) break; } default: - UNCONVERT_ERROR( convert->format ); - break; + gl_problem(NULL, "texture unconvert error"); } } @@ -886,7 +865,7 @@ convert_texsubimage3d_rgb332( struct gl_texture_convert *convert ) static void unconvert_teximage_rgb332( struct gl_texture_convert *convert ) { - UNCONVERT_ERROR( convert->format ); + gl_problem(NULL, "texture unconvert error"); } @@ -952,8 +931,7 @@ unconvert_teximage_ci8( struct gl_texture_convert *convert ) MEMCPY( convert->dstImage, src, texels ); break; default: - UNCONVERT_ERROR( convert->format ); - break; + gl_problem(NULL, "texture unconvert error"); } } @@ -1244,7 +1222,7 @@ void _mesa_unconvert_teximage3d( GLint mesaFormat, GLenum format, * all aspect ratios). This can be made a lot faster, but I don't * really care enough... */ -void _mesa_rescale_teximage2d( const struct gl_texture_format *texFormat, +void _mesa_rescale_teximage2d( GLint texelBytes, GLint srcWidth, GLint srcHeight, GLint dstWidth, GLint dstHeight, const GLvoid *srcImage, GLvoid *dstImage ) @@ -1289,7 +1267,7 @@ do { \ } \ } while (0) - switch ( texFormat->TexelBytes ) { + switch ( texelBytes ) { case 4: RESCALE_IMAGE( GLuint ); break; diff --git a/xc/extras/Mesa/src/texutil.h b/xc/extras/Mesa/src/texutil.h index a3e842667..f0e4a984c 100644 --- a/xc/extras/Mesa/src/texutil.h +++ b/xc/extras/Mesa/src/texutil.h @@ -79,7 +79,7 @@ _mesa_unconvert_teximage3d( GLint mesaFormat, GLenum format, * all aspect ratios). FIXME: Make this a subimage update as well... */ extern void -_mesa_rescale_teximage2d( const struct gl_texture_format *texFormat, +_mesa_rescale_teximage2d( GLint texelBytes, GLint srcWidth, GLint srcHeight, GLint dstWidth, GLint dstHeight, const GLvoid *srcImage, GLvoid *dstImage ); diff --git a/xc/extras/Mesa/src/texutil_tmp.h b/xc/extras/Mesa/src/texutil_tmp.h index ea6c4ee52..0008e44c0 100644 --- a/xc/extras/Mesa/src/texutil_tmp.h +++ b/xc/extras/Mesa/src/texutil_tmp.h @@ -22,8 +22,9 @@ TAG(texsubimage2d)( struct gl_texture_convert *convert ) GLint dwords, i; (void) dwords; (void) i; - if ( DBG ) - fprintf( stderr, __FUNCTION__ "\n" ); +#if DEBUG_TEXUTIL + fprintf( stderr, __FUNCTION__ "\n" ); +#endif #ifdef CONVERT_DIRECT MEMCPY( dst, src, convert->height * DST_ROW_WIDTH ); @@ -53,8 +54,9 @@ TAG(texsubimage3d)( struct gl_texture_convert *convert ) GLint dwords, i; (void) dwords; (void) i; - if ( DBG ) - fprintf( stderr, __FUNCTION__ "\n" ); +#if DEBUG_TEXUTIL + fprintf( stderr, __FUNCTION__ "\n" ); +#endif #ifdef CONVERT_DIRECT MEMCPY( dst, src, convert->depth * convert->height * DST_ROW_WIDTH ); @@ -88,13 +90,13 @@ TAG(texsubimage2d_stride)( struct gl_texture_convert *convert ) adjust = convert->imageWidth - convert->width; - if ( DBG ) { - fprintf( stderr, __FUNCTION__ ":\n" ); - fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n", - convert->xoffset, convert->yoffset, convert->width, - convert->height, convert->imageWidth ); - fprintf( stderr, " adjust=%d\n", adjust ); - } +#if DEBUG_TEXUTIL + fprintf( stderr, __FUNCTION__ ":\n" ); + fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n", + convert->xoffset, convert->yoffset, convert->width, + convert->height, convert->imageWidth ); + fprintf( stderr, " adjust=%d\n", adjust ); +#endif for ( row = 0 ; row < convert->height ; row++ ) { for ( col = 0 ; col < convert->width ; col++ ) { @@ -122,13 +124,13 @@ TAG(texsubimage3d_stride)( struct gl_texture_convert *convert ) adjust = convert->imageWidth - convert->width; - if ( DBG ) { - fprintf( stderr, __FUNCTION__ ":\n" ); - fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n", - convert->xoffset, convert->yoffset, convert->width, - convert->height, convert->imageWidth ); - fprintf( stderr, " adjust=%d\n", adjust ); - } +#if DEBUG_TEXUTIL + fprintf( stderr, __FUNCTION__ ":\n" ); + fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n", + convert->xoffset, convert->yoffset, convert->width, + convert->height, convert->imageWidth ); + fprintf( stderr, " adjust=%d\n", adjust ); +#endif for ( img = 0 ; img < convert->depth ; img++ ) { for ( row = 0 ; row < convert->height ; row++ ) { @@ -166,8 +168,9 @@ TAG(texsubimage2d_pack)( struct gl_texture_convert *convert ) GLint row, col; (void) col; - if ( DBG ) - fprintf( stderr, __FUNCTION__ "\n" ); +#if DEBUG_TEXUTIL + fprintf( stderr, __FUNCTION__ "\n" ); +#endif width = ((convert->width + DST_TEXELS_PER_DWORD - 1) & ~(DST_TEXELS_PER_DWORD - 1)); @@ -210,8 +213,9 @@ TAG(texsubimage3d_pack)( struct gl_texture_convert *convert ) GLint row, col, img; (void) col; - if ( DBG ) - fprintf( stderr, __FUNCTION__ "\n" ); +#if DEBUG_TEXUTIL + fprintf( stderr, __FUNCTION__ "\n" ); +#endif width = ((convert->width + DST_TEXELS_PER_DWORD - 1) & ~(DST_TEXELS_PER_DWORD - 1)); @@ -260,13 +264,13 @@ TAG(texsubimage2d_stride_pack)( struct gl_texture_convert *convert ) adjust = convert->imageWidth - convert->width; - if ( DBG ) { - fprintf( stderr, __FUNCTION__ ":\n" ); - fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n", - convert->xoffset, convert->yoffset, convert->width, - convert->height, convert->imageWidth ); - fprintf( stderr, " adjust=%d\n", adjust ); - } +#if DEBUG_TEXUTIL + fprintf( stderr, __FUNCTION__ ":\n" ); + fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n", + convert->xoffset, convert->yoffset, convert->width, + convert->height, convert->imageWidth ); + fprintf( stderr, " adjust=%d\n", adjust ); +#endif for ( row = 0 ; row < convert->height ; row++ ) { #ifdef CONVERT_DIRECT @@ -309,13 +313,13 @@ TAG(texsubimage3d_stride_pack)( struct gl_texture_convert *convert ) adjust = convert->imageWidth - convert->width; - if ( DBG ) { - fprintf( stderr, __FUNCTION__ ":\n" ); - fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n", - convert->xoffset, convert->yoffset, convert->width, - convert->height, convert->imageWidth ); - fprintf( stderr, " adjust=%d\n", adjust ); - } +#if DEBUG_TEXUTIL + fprintf( stderr, __FUNCTION__ ":\n" ); + fprintf( stderr, " x=%d y=%d w=%d h=%d s=%d\n", + convert->xoffset, convert->yoffset, convert->width, + convert->height, convert->imageWidth ); + fprintf( stderr, " adjust=%d\n", adjust ); +#endif for ( img = 0 ; img < convert->depth ; img++ ) { for ( row = 0 ; row < convert->height ; row++ ) { diff --git a/xc/extras/Mesa/src/triangle.c b/xc/extras/Mesa/src/triangle.c index eb59d56ab..5949bd782 100644 --- a/xc/extras/Mesa/src/triangle.c +++ b/xc/extras/Mesa/src/triangle.c @@ -1300,17 +1300,27 @@ static void lambda_multitextured_triangle1( GLcontext *ctx, GLuint v0, #define SETUP_CODE \ const struct gl_texture_object *obj0 = ctx->Texture.Unit[0].Current; \ - const GLint baseLevel0 = obj0->BaseLevel; \ - const struct gl_texture_image *texImage0 = obj0->Image[baseLevel0]; \ - const GLfloat twidth0 = (GLfloat) texImage0->Width; \ - const GLfloat theight0 = (GLfloat) texImage0->Height; \ const struct gl_texture_object *obj1 = ctx->Texture.Unit[1].Current; \ - const GLint baseLevel1 = obj1->BaseLevel; \ - const struct gl_texture_image *texImage1 = obj1->Image[baseLevel1]; \ - const GLfloat twidth1 = (GLfloat) texImage1->Width; \ - const GLfloat theight1 = (GLfloat) texImage1->Height; \ + const struct gl_texture_image *texImage0, *texImage1; \ + GLfloat twidth0, theight0, twidth1, theight1; \ const GLboolean flat_shade = (ctx->Light.ShadeModel==GL_FLAT); \ GLint r, g, b, a; \ + if (obj0) { \ + texImage0 = obj0->Image[obj0->BaseLevel]; \ + twidth0 = texImage0->Width; \ + theight0 = texImage0->Height; \ + } \ + else { \ + twidth0 = theight0 = 1; \ + } \ + if (obj1) { \ + texImage1 = obj1->Image[obj1->BaseLevel]; \ + twidth1 = texImage1->Width; \ + theight1 = texImage1->Height; \ + } \ + else { \ + twidth1 = theight1 = 1; \ + } \ if (flat_shade) { \ r = VB->ColorPtr->data[pv][0]; \ g = VB->ColorPtr->data[pv][1]; \ diff --git a/xc/extras/Mesa/src/tritemp.h b/xc/extras/Mesa/src/tritemp.h index 9605d00f8..71e62a31a 100644 --- a/xc/extras/Mesa/src/tritemp.h +++ b/xc/extras/Mesa/src/tritemp.h @@ -2,19 +2,19 @@ /* * Mesa 3-D graphics library * Version: 3.4.1 - * + * * Copyright (C) 1999-2001 Brian Paul 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 * 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 @@ -56,7 +56,7 @@ * * Optionally, one may provide one-time setup code per triangle: * SETUP_CODE - code which is to be executed once per triangle - * + * * The following macro MUST be defined: * INNER_LOOP(LEFT,RIGHT,Y) - code to write a span of pixels. * Something like: @@ -226,7 +226,7 @@ * By stepping rasterization parameters along the major edge, * we can avoid recomputing them at the discontinuity where * the top and bottom edges meet. However, this forces us to - * be able to scan both left-to-right and right-to-left. + * be able to scan both left-to-right and right-to-left. * Also, we must determine whether the major edge is at the * left or right side of the triangle. We do this by * computing the magnitude of the cross-product of the major @@ -444,7 +444,7 @@ dtdy = oneOverArea * (eMaj.dx * eBot_dt - eMaj_dt * eBot.dx); } else { dtdx = 0; - dtdy = 0; + dtdy = 0; } if (VB->TexCoordPtr[0]->size > 2) @@ -552,7 +552,7 @@ * inside the triangle. * * Next we creep down the major edge until we reach that y, - * and compute the corresponding x coordinate on the edge. + * and compute the corresponding x coordinate on the edge. * Then we find the half-integral x that lies on or just * inside the edge. This is the first pixel that might lie in * the interior of the triangle. (We won't know for sure @@ -783,7 +783,7 @@ t0 = VB->TexCoordPtr[0]->data[vLower][1] * T_SCALE; ft = (GLfixed)(t0 * FIXED_SCALE + dtdx * adjx + dtdy * adjy) + FIXED_HALF; fdtOuter = SignedFloatToFixed(dtdy + dxOuter * dtdx); - } + } else { t0 = 0; @@ -800,7 +800,7 @@ sLeft = s0 + (dsdx * adjx + dsdy * adjy) * (1.0F/FIXED_SCALE); dsOuter = dsdy + dxOuter * dsdx; if (VB->TexCoordPtr[0]->size > 1) - { + { t0 = VB->TexCoordPtr[0]->data[vLower][1] * invW; tLeft = t0 + (dtdx * adjx + dtdy * adjy) * (1.0F/FIXED_SCALE); dtOuter = dtdy + dxOuter * dtdx; @@ -808,7 +808,7 @@ tLeft = dtOuter = 0; } if (VB->TexCoordPtr[0]->size > 2) - { + { u0 = VB->TexCoordPtr[0]->data[vLower][2] * invW; uLeft = u0 + (dudx * adjx + dudy * adjy) * (1.0F/FIXED_SCALE); duOuter = dudy + dxOuter * dudx; @@ -816,7 +816,7 @@ uLeft = duOuter = 0; } if (VB->TexCoordPtr[0]->size > 3) - { + { v0 = VB->TexCoordPtr[0]->data[vLower][3] * invW; } else { v0 = invW; @@ -833,7 +833,7 @@ s1Left = s0 + (ds1dx * adjx + ds1dy * adjy) * (1.0F/FIXED_SCALE); ds1Outer = ds1dy + dxOuter * ds1dx; if (VB->TexCoordPtr[0]->size > 1) - { + { t0 = VB->TexCoordPtr[1]->data[vLower][1] * invW; t1Left = t0 + (dt1dx * adjx + dt1dy * adjy) * (1.0F/FIXED_SCALE); dt1Outer = dt1dy + dxOuter * dt1dx; @@ -841,7 +841,7 @@ t1Left = dt1Outer = 0; } if (VB->TexCoordPtr[0]->size > 2) - { + { u0 = VB->TexCoordPtr[1]->data[vLower][2] * invW; u1Left = u0 + (du1dx * adjx + du1dy * adjy) * (1.0F/FIXED_SCALE); du1Outer = du1dy + dxOuter * du1dx; @@ -849,7 +849,7 @@ u1Left = du1Outer = 0; } if (VB->TexCoordPtr[0]->size > 3) - { + { v0 = VB->TexCoordPtr[1]->data[vLower][3] * invW; } else { v0 = invW; diff --git a/xc/extras/Mesa/src/vbxform.c b/xc/extras/Mesa/src/vbxform.c index f89207acd..9cfea485d 100644 --- a/xc/extras/Mesa/src/vbxform.c +++ b/xc/extras/Mesa/src/vbxform.c @@ -169,7 +169,7 @@ void gl_reset_vb( struct vertex_buffer *VB ) } if (clipor & CLIP_USER_BIT) - MEMSET(VB->UserClipMask + VB->Start, 0, VB->Count); + MEMSET(VB->UserClipMask + VB->Start, 0, VB->Count - VB->Start); VB->NormCullStart = 0; VB->Parity = (VB->LastPrimitive^VB->Count)&1; @@ -890,6 +890,7 @@ void gl_execute_cassette( GLcontext *ctx, struct immediate *IM ) VB->ColorPtr = &IM->v.Color; VB->Color[0] = VB->Color[1] = VB->ColorPtr; VB->IndexPtr = &IM->v.Index; + VB->Index[0] = VB->Index[1] = VB->IndexPtr; VB->EdgeFlagPtr = &IM->v.EdgeFlag; VB->TexCoordPtr[0] = &IM->v.TexCoord[0]; VB->TexCoordPtr[1] = &IM->v.TexCoord[1]; diff --git a/xc/extras/freetype2/CHANGES b/xc/extras/freetype2/CHANGES index ca80f4787..674907d95 100644 --- a/xc/extras/freetype2/CHANGES +++ b/xc/extras/freetype2/CHANGES @@ -1,3 +1,135 @@ +LATEST CHANGES BETWEEN 2.0.2 and 2.0.1 + + + I. CHANGES TO THE MODULES / FONT DRIVERS: + + - THE TRUETYPE BYTECODE INTERPRETER IS NOW TURNED OFF, in order to + avoid legal problems with the Apple patents. It seems that we + mistakenly turned this option on in previous releases of the build. + + note that if you want to use the bytecode interpreter, in order to + get high-quality TrueType rendering, you'll need to toggle by hand + the definition of the TT_CONFIG_OPTION_BYTECODE_INTERPRETER macro + in the file "include/freetype/config/ftoption.h" + + - The CFF driver has been improved by Tom Kacvinsky and Sander van der Wal: + + * support for "seac" emulation + * support for "dotsection" + * support for retrieving glyph names through "FT_Get_Glyph_Name" + + The first two items are necessary to correctly a large number of + Type 1 fonts converted to the CFF formats by Adobe Acrobat. + + + - the Type 1 driver was also improved by Tom & others: + + * better EM size computation + + * better support for synthetic (transformed) fonts + + * the Type 1 driver returns the charstrings corresponding to + each glyph in the "glyph->control_data" field after a call to + "FT_Load_Glyph" (thanks Ha Shao) + + + - various other bugfixes, including the following: + + * fixed a nasty memory leak in the Type 1 driver + + * the autohinter and the pcf driver used static writable data + when they shouldn't + + * many casts were added to make the code more 64-bits safe. + it also now compiles on Windows XP 64-bits without warnings + + * some incorrect writable statics were removed in the "autohint" + and "pcf" drivers. FT2 now compiles on Epoc again.. + + + II. CHANGES TO THE HIGH-LEVEL API + + - the library header files inclusion scheme has been changed. The old + scheme looked like: + + #include <freetype/freetype.h> + #include <freetype/ftglyph.h> + #include <freetype/ftcache.h> + #include <freetype/cache/ftimage.h> + + use: + + #include <ft2build.h> + #include FT_FREETYPE_H + #include FT_GLYPH_H + #include FT_CACHE_H + #include FT_CACHE_IMAGE_H + + NOTE THAT THE OLD INCLUSION SCHEME WILL STILL WORK WITH THIS RELEASE. + HOWEVER, WE DON'T GUARANTEE THAT THIS WILL STILL BE TRUE IN THE NEXT + ONE (A.K.A. FREETYPE 2.1) + + the file <ft2build.h> is used to define the header filename macros. + The complete and commented list of macros is available in the API + reference under the section name "Header File Macros" in Chapter I. + + For more information, see section I of the following document: + + http://www.freetype.org/freetype2/docs/tutorial/step1.html + or http://freetype.sourceforge.net/freetype2/docs/tutorial/step1.html + + + - many, many comments have been added to the public source file in + order to automatically generate the API Reference through the + "docmaker.py" Python script. + + The latter has been updated to support the grouping of sections + in chapters, and better index sort. See: + + http://www.freetype.org/freetype2/docs/reference/ft2-toc.html + + + III. CHANGES TO THE BUILD PROCESS + + + - if you're not building FreeType 2 with our own build system (i.e. with + your own Makefiles or project files), you'll need to be aware that the + build process as changed a little bit. Namely: + + - you don't need to put the "src" directory in the include path + when compiling any FT2 component + + - instead, simply put the component's directory in the current + include path. + + So, if you were doing something like: + + cc -c -Iinclude -Isrc src/base/ftbase.c + + change the line to: + + cc -c -Iinclude -Isrc/base src/base/ftbase.c + + + If you were doing something like: + + cd src/base + cc -c -I../../include -I.. ftbase.c + + change it to: + + cd src/base + cc -c -I../../include ftbase.c + + + - the build system has changed slightly when compiling by hand (either + from the command line or from an IDE). You don't need to put the "src" + directory in the include path anymore. Rather, place each component's + path.. See INSTALL and "docs/BUILD" for details.. + + + +========================================================================= LATEST CHANGES BETWEEN 2.0.1 and 2.0: 2.0.1 introduces a few changes: diff --git a/xc/extras/freetype2/ChangeLog b/xc/extras/freetype2/ChangeLog index 937b2ec6f..1b1759f84 100644 --- a/xc/extras/freetype2/ChangeLog +++ b/xc/extras/freetype2/ChangeLog @@ -1,14 +1,639 @@ +2001-03-20 Werner Lemberg <wl@gnu.org> + + * builds/win32/detekt.mk: Fix .PHONY target for Intel compiler. + +2001-03-20 David Turner <david.turner@freetype.org> + + * include/freetype/config/ftheader.h, include/freetype/ftsnames.h: + Renamed "ftnames.h" to "ftsnames.h", and FT_NAMES_H to + FT_SFNT_NAMES_H. + + * docs/docmaker.py: Added generation of INDEX link in table of + contents. + + * INSTALL, docs/BUILD: Updated documentation to indicate that the + compilation process has changed slightly (no more `src' required in + the include path). + + * builds/*/*-def.mk: Changed the objects directory from "obj" to + "objs". + + * include/freetype/config/ftheader.h: Removed obsolete macros like + FT_SOURCE_FILE, etc. and added cache-specific macro definitions that + were previously defined in <freetype/ftcache.h>. Added comments to + be included in a new API Reference section. + + * src/*/*: Removed the use of FT_SOURCE_FILE, etc. Now, each + component needs to add its own directory to the include path at + compile time. Modified all "rules.mk" and "descrip.mms" + accordingly. + +2001-03-20 Werner Lemberg <wl@gnu.org> + + * builds/unix/configure.in: Add $ft_version. + * builds/unix/freetype-config.in: Use it. + * builds/unix/configure: Updated. + +2001-03-19 Tom Kacvinsky <tjk@ams.org> + + * src/type1/t1load.c (parse_font_matrix): Assign the units per em + value an unsigned short value, first by shifting right 16 bits, + then by casting the results to FT_UShort. + + * src/cff/cffparse.c (cff_parse_font_bbox): Assign the units per em + value an unsigned short value, first by shifting right 16 bits, + then by casting the results to FT_UShort. + +2001-03-17 David Turner <david.turner@freetype.org> + + * src/cid/cidobjs.c, src/cid/cidload.c, src/pcf/pcfread.c, + src/type1/t1load.c, src/type1/t1objs.c: Added a few casts to remove + compiler warnings in pedantic modes. + + * include/config/ft2build.h, include/config/ftheader.h: The file + "ft2build.h" was renamed to "ftheader.h" to avoid conflicts with the + top-level <ft2build.h>. + + * include/config/ftheader.h: Added new section describing the #include + macros. + +2001-03-17 Tom Kacvinsky <tjk@ams.org> + + * src/cff/cffparse.c (cff_parse_font_bbox): Obtain rounded FT_Fixed + values for the bounding box numbers. + + * src/cff/cffobjs.c (CFF_Init_Face): When processing a CFF/CEF font, + set `root->ascender' (`root->descender') to the integer part of + `root->bbox.yMax' (`root->bbox.yMin', respectively). + +2001-03-16 Tom Kacvinsky <tjk@ams.org> + + * src/cff/cffdrivr.c (get_cff_glyph_name): New function. Used in + cff_get_interface to facilitate getting a glyph name for glyph index + via FT_Get_Glyph_Name(). + + (cff_get_interface): Added support for getting a glyph name via the + "glyph_name" module interface. Uses the new function + get_cff_glyph_name(). + Submitted by Sander van der Wal <svdwal@xs4all.nl> + + * src/cff/cffobjs.c (CFF_Init_Face): Logical or the face flags with + FT_FACE_FLAG_GLYPH_NAMES only if FT_CONFIG_OPTION_NO_GLYPH_NAMES is + not defined. This is to add support for getting a glyph name from a + glyph index via FT_Get_Glyph_Name(). + Submitted by Sander van der Wal <svdwal@xs4all.nl> + + * src/cff/cffgload.c (CFF_Parse_CharStrings): Added support for + deprecated operator "dotsection". + Submitted by Sander van der Wal <svdwal@xs4all.nl> + +2001-03-12 Werner Lemberg <wl@gnu.org> + + * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Fix error + messages. + + * INSTALL, docs/BUILD: We need GNU make 3.78.1 or newer. + +2001-03-12 Tom Kacvinsky <tjk@ams.org> + + * include/freetype/internal/psaux.h: Changed the lenIV member of + the T1_Decoder_ struct to be an FT_Int instead of an FT_UInt. + + * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Adjust + for lenIV seed bytes at the start of a decrypted subroutine. + + * src/cid/cidload.c (cid_read_subrs): Decrypt subroutines only + if lenIV >= 0. + + * src/cid/cidgload.c (cid_load_glyph): Decrypt charstrings only + if lenIV >= 0. + +2001-03-11 Werner Lemberg <wl@gnu.org> + + * TODO: Updated. + + * src/pcf/pcfread.c: Put READ_Fields() always in a conditional to + avoid compiler warnings. + +2001-03-10 Tom Kacvinsky <tjk@ams.org> + + * TODO: New file. + + * include/freetype/freetype.h: Added prototypes and notes for + three new functions: FT_RoundFix, FT_CeilFix, and FT_FloorFix. + * src/base/ftcalc.c (FT_RoundFix, FT_CeilFix, FT_FloorFix): Added + implementation code. + + * src/cid/cidobjs.c (CID_Init_Face): Use calculated units_per_EM, + and if that is not available, default to 1000 units per EM. Changed + assignment code for ascender and descender values. + * src/cid/cidload.c (parse_font_matrix): Added units_per_EM + processing. + (parse_font_bbox): Changed to use FT_Fixed number handling. + + * src/type1/t1objs.c (T1_Init_Face): Changed the assignment code + for ascender, descender, and max_advance_width. + * src/type1/t1load.c (parse_font_bbox): Changed to use FT_Fixed + number handling. + +2001-03-10 Henrik Grubbström <grubba@roxen.com> + + * src/*/*.c: Added many casts to make code more 64bit-safe. + +2001-03-07 Werner Lemberg <wl@gnu.org> + + * INSTALL, docs/BUILD: We need GNU make 3.78 or newer. + +2001-03-07 Tom Kacvinsky <tjk@ams.org> + + * src/type1/t1objs.c (T1_Init_Face): Minor correction: We must wait + until parse_font_bbox is changed before we use logical shift rights + in the assignments of `root->ascender', `root->descender', and + `root->max_advance_width'. + + (T1_Done_Face): Free `char_name' table to avoid a memory leak. + Submitted by Sander van der Wal <svdwal@xs4all.nl>. + +2001-03-05 Tom Kacvinsky <tjk@ams.org> + + * src/cff/cffgload.c (CFF_Load_Glyph): Set glyph control data to the + the Type 2 glyph charstring (used by conversion programs). + Submitted by Ha Shao <hashao@chinese.com>. + +2001-03-04 Antoine Leca <Antoine.Leca@renault.fr> + + * include/freetype/ttnameid.h: Correct a stupid typo which prevented + correct compilation (TT_MS_LANGID_TIGRIGNA_ETHIOPIA appeared twice). + +2001-03-04 Werner Lemberg <wl@gnu.org> + + * src/autohint/ahtypes.h (AH_Hinter): Add elements + `disable_horz_edges', `disable_vert_edges'. + * src/autohint/ahhint.c (ah_hint_edges_3, ah_hinter_hint_edges): Use + them (and remove static variables with the same names). + * src/pcf/pcfutil.c (BitOrderInvert): Add `const'. + * docs/glnames.py: Updated to latest pstables.h changes. + + * builds/unix/detect.mk: Add test for Hurd. + * builds/hurd/detect.mk: Removed. + +2001-03-04 Sander van der Wal <svdwal@xs4all.nl> + + * src/psnames/pstables.h: Add more `const'. + * src/pcf/pcfutil.c: Ditto. + +2001-03-04 Werner Lemberg <wl@gnu.org> + + * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Fixing typo + (FT_Glyph_Done -> FT_Done_Glyph). + +2001-03-01 Antoine Leca <Antoine.Leca@renault.fr> + + * include/freetype/ttnameid.h: Added some new Microsoft language + codes and LCIDs as found in Office Xp. + +2001-02-28 David Turner <david.turner@freetype.org> + + * builds/hurd/detect.mk: New file. Added support to detect the GNU + Hurd operating system as Unix-like. Fix submitted by Anthony Fok + <foka@debian.org>. + + * src/type1/t1gload.c (T1_Load_Glyph): Set glyph control data to the + the Type 1 glyph charstring (used by conversion programs). + Submitted by Ha Shao <hashao@chinese.com>. + +2001-02-22 David Turner <david.turner@freetype.org> + + * src/base/ftgrays.c (grays_sweep): The function didn't exit + immediately if `num_cells' was 0 as it should. Thanks to Boris for + finding this out. + + * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Fixed memory leak when + bitmap rendering fails (thanks to Graham Asher). + +2001-02-13 Werner Lemberg <wl@gnu.org> + + * docs/docmaker.py (DocSection::add_element): Use + `self.print_error()'. + + * builds/unix/config.{guess,sub}: Updated (from ftp.gnu.org). + +2001-02-13 David Turner <david.turner@freetype.org> + + * docs/docmaker.py, include/freetype/*.h: Updated the DocMaker + script to support chapters and section block ordering. Updated the + public header files accordingly. + + * src/base/ftglyph.c (FT_Glyph_Copy): Advance width and glyph format + were not correctly copied. + +2001-02-08 Tom Kacvinsky <tjk@ams.org> + + * src/cff/cffparse.c (cff_parse_font_matrix): Removed an + unnecessary fprintf( stderr, ... ). + +2001-02-07 Tom Kacvinsky <tjk@ams.org> + + * src/type1/t1objs.c (T1_Init_Face): Added code to get the + units_per_EM from the value assigned in parse_font_matrix, if + available. Default to 1000 if not available. + + * src/cff/cffparse.c (cff_parse_font_matrix): Added logic to get + the units_per_EM from the FontMatrix. + + (cff_parse_fixed_thousand): New function. Gets a real number from + the CFF font, but multiplies by 1000 (this is to avoid rounding + errors when placing this real number into a 16.16 fixed number). + + (cff_parse_real): Added code so that the integer part is moved + into the high sixteen bits of the 16.16 fixed number. + + * src/cff/cffobjs.c (CFF_Init_Face): Added logic to get the units + per EM from the CFF dictionary, if available. + + * include/freetype/internal/cfftypes.h: In struct CFF_Font_Dict_, + added a units_per_em member to facilitate passing of units_per_em + from function cff_parse_font_matrix. + + * src/type1/t1load.c (is_alpha): Make `-' a legal alphanumeric + character. This is so that font names with `-' are fully parsed, + etc... + +2001-02-02 Werner Lemberg <wl@gnu.org> + + * src/psaux/psobjs.c (shift_elements): Remove if clause (which is + obsolete now). + + (reallocate_t1_table, PS_Table_Done): Replace REALLOC() with ALLOC() + + MEM_Copy() to avoid a memory bug. + +2001-02-01 David Turner <david.turner@freetype.org> + + * docs/docmaker.py: Improved the index sorting routine to place + capital letters before small ones. Added the "<order>" marker to + section blocks in order to give the order of blocks. + +2001-01-30 Antoine Leca <Antoine.Leca@renault.fr> + + * include/freetype/ttnameid.h: Latest updates to Microsoft language + ID codes. + +2001-01-24 Tom Kacvinsky <tjk@ams.org> + + * src/cff/t1load.c (parse_font_matrix): Added heuristic to get + units_per_EM from the font matrix. + + (parse_dict): Deleted test to see whether the FontInfo keyword has + been seen. Deletion of this test allows fonts without FontInfo + dictionaries to be parsed by the Type 1 driver. + + (T1_Open_Face): Deleted empty subroutines array test to make sure + fonts with no subroutines still are parsed. + +2001-01-17 Francesco Zappa Nardelli <francesco.zappa.nardelli@ens.fr> + + * src/pcfread.c (pcf_get_properties, pcf_get_metrics, + pcf_get_bitmaps): Fix compiler errors. + +2001-01-11 David Turner <david.turner@freetype.org> + + * src/pcf/pcfread.c: Removed some compilation warnings related + to comparison of signed vs. unsigned integers. + + * include/freetype/internal/ftdebug.h: Changed the debug trace + constants from trace_t2xxxx to trace_cffxxxx to be able to compile + the CFF driver in debug mode. + +2001-01-11 Matthew Crosby <mcrosby@marthon.org> + + * builds/unix/freetype-config.in: Fix problems with separate + --prefix and --exec-prefix. + +2001-01-11 David Turner <david.turner@freetype.org> + + * docs/docmaker.py: Added cross-references generation as well as + more robust handling of pathname wildcard matching. + +2001-01-10 Werner Lemberg <wl@gnu.org> + + * docs/docmaker.py: Minor improvements to reduce unwanted spaces + and empty lines in output. + +2001-01-09 David Turner <david.turner@freetype.org> + + * docs/docmaker.py: Improved script to generate table of contents + and index pages. It also supports wildcards on non Unix systems. + + * include/freetype/*.h, include/freetype/cache/*.h: Updated comments + to include section definitions/delimitations for the API Reference + generator. + + * include/freetype/freetype.h: Moved declaration of + `FT_Generic_Finalizer' and the `FT_Generic' structure to... + * include/freetype/fttypes.h: here. + +2001-01-04 Werner Lemberg <wl@gnu.org> + + * include/freetype/ttnameid.h: Updated Unicode code range comments. + +2001-01-03 Tom Kacvinsky <tjk@ams.org> + + * src/cff/rules.mk: Use cffgload.{c,h} instead of t2gload.{c,h}. + + * include/freetype/internal/internal.h: Changed to use cfftypes.h + (cfferrs.h) instead of t2types.h (t2errors.h, respectively). + + * include/freetype/internal/cfftypes.h: Merged in changes from + t2types.h and made this the canonical `types' header for the CFF + driver. + + * include/freetype/internal/t2types.h: This file was merged with + cfftypes.h and is no longer necessary. + + * include/freetype/internal/t2errors.h: Renamed to cfferrs.h. + + * src/cff/cffobjs.c, src/cff/cffobjs.h, src/cff/cffparse.c, + src/cff/cffdrivr.c, src/cff/cff.c, src/cff/cffload.c, + src/cff/cffgload.c, src/cff/cffgload.h: Changed to use + cffgload.{c,h} instead of t2gload.{c,h}. All occurences of t2_ + (T2_) were replaced with cff_ (CFF_, respectively). + + * src/cff/t2gload.h: Renamed cffgload.h. + + * src/cff/t2gload.c: Renamed cffgload.c + +2000-01-02 Jouk Jansen <joukj@hrem.stm.tudelft.nl> + + * builds/vms: Support files for VMS architecture added. + * descrip.mms, src/*/descrip.mms: VMS makefiles added. + * README.VMS: New file. + +2000-01-01 Werner Lemberg <wl@gnu.org> + + * LICENSE.TXT: Added info about PCF driver license. + +2001-01-01 Francesco Zappa Nardelli <francesco.zappa.nardelli@ens.fr> + + * src/pcf/*: New driver module for PCF font format (used in + X Windows). + * include/freetype/internal/ftdebug.h (FT_Trace): Added values for + PCF driver. + * include/freetype/internal/pcftypes.h: New file. + * include/freetype/config/ftmodule.h: Added PCF driver module. + +2001-01-01 Werner Lemberg <wl@gnu.org> + + * src/winfonts/winfnt.c (FNT_Get_Char_Index): Fix parameter type. + +2000-12-31 Werner Lemberg <wl@gnu.org> + + * builds/modules.mk (clean_module_list): Fixed deletion of module + file in case `make make_module_list' is called before `make setup'. + +2000-12-30 Werner Lemberg <wl@gnu.org> + + * src/cff/cffload.c (CFF_Load_Charset): Improved error messages. + (CFF_Load_Charset, CFF_Load_Encoding): Remove unnecessary variable + definition. + +2000-12-30 Tom Kacvinsky <tjk@ams.org> + + * include/freetype/internal/t2types.h, + include/freetype/internal/cfftypes.h: Changed the structures for + CFF_Encoding and CFF_Encoding for the new implementations of the + charset and encoding parsers in the CFF driver. + + * src/cff/t2gload.c (t2_lookup_glyph_by_stdcharcode, + t2_operator_seac): Added these functions for use in implementing the + seac emulation provided by the Type 2 endchar operator. + (T2_Parse_CharStrings): Added seac emulation for the endchar + operator. + + * src/cff/cffload.c (CFF_Load_Encoding, CFF_Load_Charset, + CFF_Done_Encoding, CFF_Done_Charset): Extended to load and parse the + charset/encoding tables, and free the memory used by them when the + CFF driver is finished with them. Added tables + + cff_isoadobe_charset + cff_expert_charset + cff_expertsubset_charset + cff_standard_encoding + cff_expert_encoding + + so that the encoding/charset parser can handle predefined encodings and + charsets. + +2000-12-24 Tom Kacvinsky <tjk@ams.org> + + * src/cff/t2gload.c (T2_Load_Glyph): Added code so that the font + transform is applied. + + * src/cff/cffparse.c (cff_parse_font_matrix): Added code so that + the font matrix numbers are scaled by 1/(matrix->yy). Also, the + offset vector now contains integer values instead of 16.16 fixed + numbers. + +2000-12-22 Tom Kacvinsky <tjk@ams.org> + + * src/autohint/ahhint.c (ah_hinter_load_glyph): + Removed unnecessary comments and commented-out code. + +2000-12-21 David Turner <david.turner@freetype.org> + + * src/cid/cidafm.c, src/cid/cidafm.h: removed un-needed files, + we'll work on supporting CID AFM files later I guess :-) + +2000-12-21 Tom Kacvinsky <tjk@ams.org> + + * src/autohint/ahhint.c (ah_hinter_load, ah_hinter_load_glyph): + Changed so that fonts with a non-standard FontMatrix render + correctly. Previously, the first glyph rendered from such a + font did not have the tranformation matrix applied. + +2000-12-17 Werner Lemberg <wl@gnu.org> + + * *.mk: Added lots of `.PHONY' targets. + +2000-12-17 Karsten Fleischer <kfleisc1@ford.com> + + * *.mk: Implemented `platform' target to disable auto-detection. + +2000-12-14 Werner Lemberg <wl@gnu.org> + + * docs/design/modules.html: Removed. Covered by design-*.html. + + * INSTALL: Added info about makepp. + +2000-12-14 David Turner <david.turner@freetype.org> + + Added support for clipped direct rendering in the smooth renderer. + This should not break binary compatibility of existing applications. + + * include/freetype/fttypes.h, include/freetype/ftimage.h: Move + definition of the FT_BBox structure from the former to the latter. + * include/freetype/ftimage.h: Add `ft_raster_flag_clip' value to + FT_Raster_Flag enumeration. + Add `clip_box' element to FT_Raster_Params structure. + * src/smooth/ftgrays.c (grays_convert_glyph): Implement it. + + * INSTALL: Updated installation instructions on Win32, listing the + new "make setup list" target used to list supported + compilers/targets. + + * src/raster/ftraster.c (ft_black_render): Test for unsupported + direct rendering before testing arguments. + +2000-12-13 David Turner <david.turner@freetype.org> + + * include/freetype/config/ft2build.h, + include/freetype/internal/internal.h: Fixed header inclusion macros + to use direct definitions. This is the only way to do these things + in a portable way :-( The rest of the code should follow shortly + though everything compiles now. + + * builds/compiler/intelc.mk, builds/compiler/watcom.mk: New files. + + * builds/win32/detect.mk: Added support for the Intel C/C++ + compiler, as well as _preliminary_ (read: doesn't work!) support for + Watcom. Also added a new setup target. Type "make setup list" for + a list of supported command-line compilers on Win32. + + * src/base/ftdebug.c: Added dummy symbol to avoid empty file if + conditionals are off. + +2000-12-13 Werner Lemberg <wl@gnu.org> + + * builds/unix/ftsystem.c: Fixed typos. Fixed inclusion of wrong + ftconfig.h file. + +2000-12-12 Werner Lemberg <wl@gnu.org> + + * include/freetype/config/ft2build.h (FT2_ROOT, FT2_CONFIG_ROOT): + Removed. ANSI C doesn't (explicitly) allow macro expansion in + arguments using `##'. + (FT2_PUBLIC_FILE, FT2_CONFIG_FILE, FT2_INTERNAL_FILE): Use directory + names directly. Make them configurable. Use `##' to strip leading + and trailing spaces from arguments. + + * builds/unix/ft2unix.h: Adapted. + + * src/base/ftsystem.c (ft_alloc, ft_realloc, ft_free, ft_io_stream, + ft_close_stream): Use FT_CALLBACK_DEF. + + * builds/unix/ftsystem.c: Use new header scheme. + (FT_Done_Memory): Use free() from FT_Memory structure. + + * src/base/ftinit.c, src/base/ftmac.c: Header scheme fixes. + +2000-12-11 Werner Lemberg <wl@gnu.org> + + * include/freetype/config/ft2build.h (FT2_CONFIG_ROOT, + FT2_PUBLIC_FILE, FT2_CONFIG_FILE, FT2_INTERNAL_FILE, + FT_SOURCE_FILE): Use `##' operator to be really ANSI C compliant. + +2000-12-09 Werner Lemberg <wl@gnu.org> + + * builds/unix/detect.mk: Remove unused USE_CFLAGS variable. + +2000-12-08 Werner Lemberg <wl@gnu.org> + + * */*.h: Changed body inclusion macro names to start and end with + `__' (those which haven't converted yet). Fixed minor conversion + issues. + + * src/winfonts/winfnt.c: Updated to new header inclusion scheme. + + * src/truetype/ttinterp.c: Remove unused CALC_Length() macro. + +2000-12-07 David Turner <david.turner@freetype.org> + + * */*.[ch]: Changed source files to adhere to the new + header inclusion scheme. Not completely tested but works for now + here. + + * src/cff/t2driver.c: Renamed and updated to... + * src/cff/cffdrivr.c: New file. + * src/cff/t2driver.h: Renamed and updated to... + * src/cff/cffdrivr.h: New file. + * src/cff/t2load.c: Renamed and updated to... + * src/cff/cffload.c: New file. + * src/cff/t2load.h: Renamed and updated to... + * src/cff/cffload.h: New file. + * src/cff/t2objs.c: Renamed and updated to... + * src/cff/cffobjs.c: New file. + * src/cff/t2objs.h: Renamed and updated to... + * src/cff/cffobjs.h: New file. + * src/cff/t2parse.c: Renamed and updated to... + * src/cff/cffparse.c: New file. + * src/cff/t2parse.h: Renamed and updated to... + * src/cff/cffparse.h: New file. + * src/cff/t2tokens.h: Renamed and updated to... + * src/cff/cfftoken.h: New file. + + * src/cff/cff.c, src/cff/rules.mk: Updated. + +2000-12-06 David Turner <david.turner@freetype.org> + + * src/cache/ftlru.c (FT_Lru_Done): Fixed memory leak. + +2000-12-06 Werner Lemberg <wl@gnu.org> + + * builds/module.mk: Replaced `xxx #' with `xxx$(space). + * builds/os2/detekt.mk, builds/win32/detekt.mk: Moved comment to + avoid trailing spaces in variable. + * builds/freetype.mk: Use $(D) instead of $D to make statement more + readable. + + * docs/docmaker.py: Formatting. + +2000-12-05 David Turner <david.turner@freetype.org> + + * src/psaux/psauxmod.c: Fixed a broken inclusion of component + header files (an FT_FLAT_COMPILE test was missing). + + * src/cache/ftcmanag.c (FTC_Manager_Done): Fixed a bug that caused + an occasional crash when the function was called (due to a dangling + pointer). + + * src/base/ftsystem.c (FT_Done_Memory): Fixed an obvious bug: + The ANSI "free()" function was called instead of "memory->free()". + + * docs/docmaker.py: Added section filtering, multi-page generation + (index page generation is still missing though). + +2000-12-04 David Turner <david.turner@freetype.org> + + * builds/unix/install.mk, builds/unix/ft2unix.h: The file "ft2unix.h" + is now installed as <ft2build.h> for Unix systems. Note that we + still use the "freetype2/freetype" installation path for now. + + * */*.[ch]: Now using <ft2build.h> as the default build and setup + configuration file in all public headers. Internal source files + still need some changes though. + + * builds/devel/ft2build.h, builds/devel/ftoption.h: Created a new + directory to hold all development options for both the Unix and + Win32 developer builds. + + * builds/win32/detect.mk, builds/win32/w32-bccd.mk, + builds/win32/w32-dev.mk: Changed the developer build targets to + "devel-gcc" and "devel-bcc" in order to be able to develop with the + Borland C++ compiler. + 2000-12-01 David Turner <david.turner@freetype.org> + * Version 2.0.1 released. + ========================= + * builds/unix/configure.in, builds/unix/configure, - builds/cygwin/configure.in, builds/cygwin/configure: setting - "version_info" to 6:1:0 for the 2.0.1 release + builds/cygwin/configure.in, builds/cygwin/configure: Setting + "version_info" to 6:1:0 for the 2.0.1 release. - * CHANGES: added a summary of changes between 2.0.1 and 2.0 + * CHANGES: Added a summary of changes between 2.0.1 and 2.0. - * builds/unix/ftconfig.in, builds/cygwin/ftconfig.in: changes + * builds/unix/ftconfig.in, builds/cygwin/ftconfig.in: Changes to allow compilation under Unix with the Unix-specific config - files.. + files. 2000-12-01 Werner Lemberg <wl@gnu.org> @@ -98,7 +723,7 @@ * include/freetype/internal/ftdebug.h: Replaced FT_CAT and FT_XCAT with a direct solution (which also satifies picky compilers). -2000-11-28 YAMANO-UCHI Hidetoshi <mer@din.or.jp> +2000-11-28 YAMANO-UCHI Hidetoshi <mer@din.or.jp> * src/truetype/ttobjs.c (TT_Init_Size): Fix #ifdef's to work with disabled interpreter also. @@ -141,17 +766,17 @@ 2000-11-22 Tom Kacvinsky <tjk@ams.org> - * src/cff/t2objs.c (T2_Init_Face): For pure CFF fonts, set + * src/cff/t2objs.c (T2_Init_Face): For pure CFF fonts, set `root->num_faces' to `cff->num_faces' and set `units_per_EM' to 1000. * src/cff/t2parse.c (parse_t2_real): Fixed real number parsing loop. - + * src/cff/t2load.c (T2_Get_String): Called T2_Get_Name with a sid that was off by one. -2000-11-16 David Turner <david@freetype.org> +2000-11-16 David Turner <david@freetype.org> * src/autohint/ahtypes.h (AH_Hinter): Added new fields to control auto-hinting of synthetic Type 1 fonts. diff --git a/xc/extras/freetype2/INSTALL b/xc/extras/freetype2/INSTALL index 777fb4e1a..07c2641b6 100644 --- a/xc/extras/freetype2/INSTALL +++ b/xc/extras/freetype2/INSTALL @@ -1,59 +1,73 @@ In order to build the library, read the `BUILD' document in the `docs' -directory. This is only a quick starter: +directory. This is only a quick starter. -I. From the command line: - You need to have GNU Make installed on your system to compile the - library from the command line. This will _not_ work with other - make tools (including BSD make)! +I. From the command line +------------------------ + + You need to have GNU Make (version 3.78.1 or newer) installed on + your system to compile the library from the command line. This will + _NOT_ work with other make tools (including BSD make)! + + [Well, this is not really correct. Recently, a perl implementation + of make called `makepp' has appeared which can also build FreeType 2 + successfully on Unix platforms. See http://LNC.usc.edu/~holt/makepp + for more details.] - Go to the `freetype2' directory. - - On Unix (any C compiler should work): + - Unix (any C compiler should work): - make setup (don't worry, this will invoke a configure script) - make - make install - Alternatively, you can pass parameters to the configure script + Alternatively, you can pass parameters to the configure script within the CFG variable, as in: - make setup CFG="--prefix=/usr" - make - make install - - On Windows: + - Windows: - We provide a version of GNU Make for Win32 on the FreeType site. + We provide a version of GNU Make for Win32 on the FreeType site. See http://www.freetype.org/download.html for details. - If you are using gcc: + - gcc (Mingw, _not_ CygWin): + + - make setup + - make - - make setup - - make - If you are using Visual C++: - - - make setup visualc - - make - - If you are using Win32-lCC: + - Visual C++: - - make setup lcc - - make - - If you are using the Borland C++ Builder compiler: - - - make setup bcc32 - - make + - make setup visualc + - make -II. In your own environment (IDE): - - You need to add the directories "freetype2/include" and "freetype2/src" - to your include path when compiling the library. + - other compilers: + + - make setup xxxx + - make + + where "xxxx" is a special target corresponding to your compiler. + To see a list of supported compilers in this release, type: + + make setup list + + +II. In your own environment (IDE) +--------------------------------- + + You need to add the directories "freetype2/include" to your include + path when compiling the library. + + FreeType 2 is made of several components; each one of them is + located in a subdirectory of "freetype2/src". For example, + `freetype2/src/truetype/' contains the TrueType font driver. - Compile each library component through the following files: + DO NOT COMPILE ALL C FILES! Rather, compile the following ones: -- base components (required) @@ -65,20 +79,20 @@ II. In your own environment (IDE): src/base/ftbbox.c src/base/ftmm.c - src/base/ftmac.c -- only on the Macintosh + src/base/ftmac.c -- only on the Macintosh -- other components are optional - src/autohint/autohint.c -- auto hinting module - src/cache/ftcache.c -- cache sub-system (in beta) - src/sfnt/sfnt.c -- SFNT files support (TrueType & OpenType) - src/cff/cff.c -- CFF/OpenType font driver - src/psnames/psnames.c -- Postscript glyph names support - src/psaux/psaux.c -- Postscript Type 1 parsing - src/truetype/truetype.c -- TrueType font driver - src/type1/type1.c -- Type 1 font driver - src/cid/type1cid.c -- Type 1 CID-keyed font driver - src/winfonts/winfonts.c -- Windows FONT / FNT font driver + src/autohint/autohint.c -- auto hinting module + src/cache/ftcache.c -- cache sub-system (in beta) + src/sfnt/sfnt.c -- SFNT files support (TrueType & OpenType) + src/cff/cff.c -- CFF/OpenType font driver + src/psnames/psnames.c -- Postscript glyph names support + src/psaux/psaux.c -- Postscript Type 1 parsing + src/truetype/truetype.c -- TrueType font driver + src/type1/type1.c -- Type 1 font driver + src/cid/type1cid.c -- Type 1 CID-keyed font driver + src/winfonts/winfonts.c -- Windows FONT / FNT font driver Note: diff --git a/xc/extras/freetype2/LICENSE.TXT b/xc/extras/freetype2/LICENSE.TXT index 6780d1273..741bc9f45 100644 --- a/xc/extras/freetype2/LICENSE.TXT +++ b/xc/extras/freetype2/LICENSE.TXT @@ -5,3 +5,6 @@ fits your needs best: . The FreeType License, in file `docs/FTL.txt'. . The GNU General Public License, in file `docs/GPL.txt'. + +The contributed PCF driver comes with a license similar to that of X Windows +which is compatible to the above two licenses (see file src/pcf/readme). diff --git a/xc/extras/freetype2/README b/xc/extras/freetype2/README new file mode 100644 index 000000000..c69ddc817 --- /dev/null +++ b/xc/extras/freetype2/README @@ -0,0 +1,20 @@ + + FreeType 2.0.2 + ============== + + Please read the CHANGES file, it contains IMPORTANT INFORMATION + + Read the files "INSTALL" or "docs/BUILD" for installation instructions + + Note that the FreeType 2 documentation is now available as a separate + package from our sites. See: + + ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.0.2.tar.bz2 + ftp://ftp.freetype.org/pub/freetype2/ftdocs-2.0.2.tar.gz + ftp://ftp.freetype.org/pub/freetype2/ftdoc202.zip + + Enjoy.. :-) + + + The FreeType Team + diff --git a/xc/extras/freetype2/README.VMS b/xc/extras/freetype2/README.VMS new file mode 100644 index 000000000..a82b9fd01 --- /dev/null +++ b/xc/extras/freetype2/README.VMS @@ -0,0 +1,35 @@ +How to build the freetype2 library on VMS +----------------------------------------- + +Just type one of the following depending on the type of external entries you +want: + + mms + +or + + mms/macro=("COMP_FLAGS=/name=(as_is,short)") + +The library is avalaible in the directory + + [.LIB] + +To compile applications using freetype2 you'll need to define the logical +FREETYPE pointing to the directory + + [.INCLUDE.FREETYPE] + +(i.e., if the directory in which this README.VMS file is located is +$disk:[freetype] then define the logical with + + define freetype $disk:[freetype.include.freetype] + +This version has been tested with Compaq C V6.2-006 on OpenVMS Alpha V7.2-1. + + + Any problems can be reported to + + joukj@hrem.stm.tudelft.nl + + + Jouk Jansen diff --git a/xc/extras/freetype2/TODO b/xc/extras/freetype2/TODO new file mode 100644 index 000000000..0c17acaad --- /dev/null +++ b/xc/extras/freetype2/TODO @@ -0,0 +1,12 @@ +Here is a list of items that need to be addressed in FreeType 2: + +* Add synthesized Unicode charmap processing to the CFF driver. + +* Fix Visual C++ project file + +* Fix a bug in the TrueType driver: linear horizontal advances of composites + are not returned properly. + +* Change the build system to work with the "Jam" tool instead of the + terribly complex and error-prone GNU Makefiles we're currently using + diff --git a/xc/extras/freetype2/builds/ansi/ansi-def.mk b/xc/extras/freetype2/builds/ansi/ansi-def.mk index 9533a2842..9d4685ef1 100644 --- a/xc/extras/freetype2/builds/ansi/ansi-def.mk +++ b/xc/extras/freetype2/builds/ansi/ansi-def.mk @@ -34,7 +34,7 @@ PLATFORM := ansi # make -f $TOP/Makefile # ifndef OBJ_DIR - OBJ_DIR := $(TOP)$(SEP)obj + OBJ_DIR := $(TOP)$(SEP)objs endif @@ -93,6 +93,8 @@ ANSIFLAGS := ifdef BUILD_PROJECT + .PHONY: clean_project distclean_project + # Now include the main sub-makefile. It contains all the rules used to # build the library with the previous variables defined. # diff --git a/xc/extras/freetype2/builds/compiler/bcc-dev.mk b/xc/extras/freetype2/builds/compiler/bcc-dev.mk index e9b2eea5e..b603ed98f 100644 --- a/xc/extras/freetype2/builds/compiler/bcc-dev.mk +++ b/xc/extras/freetype2/builds/compiler/bcc-dev.mk @@ -61,7 +61,7 @@ T := -o # ANSI compliance. # ifndef CFLAGS - CFLAGS := -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus + CFLAGS := -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus endif # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. diff --git a/xc/extras/freetype2/builds/compiler/intelc.mk b/xc/extras/freetype2/builds/compiler/intelc.mk new file mode 100644 index 000000000..0c3088a73 --- /dev/null +++ b/xc/extras/freetype2/builds/compiler/intelc.mk @@ -0,0 +1,84 @@ +# +# FreeType 2 Intel C/C++ definitions (VC++ compatibility mode) +# + + +# Copyright 1996-2000 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +# compiler command line name +# +CC := icl + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := obj +SO := obj + + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := lib +SA := lib + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := /I + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := /D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := /Fl + + +# Target flag. +# +T := /Fo + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enfore +# ANSI compliance. +# +# Note that the Intel C/C++ compiler version 4.5 complains about +# the use of FT_FIELD_OFFSET with "value must be arithmetic type"! +# This really looks like a bug in the compiler because the macro +# _does_ compute an arithmetic value, so we disable this warning +# with "/Qwd32". +# +ifndef CFLAGS + CFLAGS := /nologo /c /Ox /G5 /W3 /Qwd32 +endif + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +ANSIFLAGS := /Qansi /Za + +# Library linking +# +#CLEAN_LIBRARY = +LINK_LIBRARY = lib /nologo /out:$@ $(OBJECTS_LIST) + +# EOF diff --git a/xc/extras/freetype2/builds/compiler/visualc.mk b/xc/extras/freetype2/builds/compiler/visualc.mk index 432f7af2a..235a4df06 100644 --- a/xc/extras/freetype2/builds/compiler/visualc.mk +++ b/xc/extras/freetype2/builds/compiler/visualc.mk @@ -70,6 +70,7 @@ endif # ANSIFLAGS := /Za + # Library linking # #CLEAN_LIBRARY = diff --git a/xc/extras/freetype2/builds/compiler/watcom.mk b/xc/extras/freetype2/builds/compiler/watcom.mk new file mode 100644 index 000000000..e1e2d1154 --- /dev/null +++ b/xc/extras/freetype2/builds/compiler/watcom.mk @@ -0,0 +1,82 @@ +# +# FreeType 2 Watcom-specific definitions +# + + +# Copyright 1996-2000 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +# Compiler command line name +# +CC := wcc386 + + +# The object file extension (for standard and static libraries). This can be +# .o, .tco, .obj, etc., depending on the platform. +# +O := obj +SO := obj + + +# The library file extension (for standard and static libraries). This can +# be .a, .lib, etc., depending on the platform. +# +A := lib +SA := lib + + +# Path inclusion flag. Some compilers use a different flag than `-I' to +# specify an additional include path. Examples are `/i=' or `-J'. +# +I := -I= + + +# C flag used to define a macro before the compilation of a given source +# object. Usually it is `-D' like in `-DDEBUG'. +# +D := -D + + +# The link flag used to specify a given library file on link. Note that +# this is only used to compile the demo programs, not the library itself. +# +L := -l + + +# Target flag. +# +T := -FO= + + +# C flags +# +# These should concern: debug output, optimization & warnings. +# +# Use the ANSIFLAGS variable to define the compiler flags used to enfore +# ANSI compliance. +# +ifndef CFLAGS + CFLAGS := -zq +endif + +# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. +# +ANSIFLAGS := -za + + +# Library linking +# +ifndef CLEAN_LIBRARY + CLEAN_LIBRARY = $(DELETE) $(subst $(SEP),$(HOSTSEP),$(PROJECT_LIBRARY)) \ + $(NO_OUTPUT) +endif +LINK_LIBRARY = wlib -q -o = $@ $(OBJECTS_LIST) + +# EOF diff --git a/xc/extras/freetype2/builds/cygwin/cygwin-def.in b/xc/extras/freetype2/builds/cygwin/cygwin-def.in index 5fd1d7400..a1c2ae53e 100644 --- a/xc/extras/freetype2/builds/cygwin/cygwin-def.in +++ b/xc/extras/freetype2/builds/cygwin/cygwin-def.in @@ -66,7 +66,7 @@ version_info := @version_info@ # make -f $TOP/Makefile # ifndef OBJ_DIR - OBJ_DIR := $(shell cd $(TOP)/obj; pwd) + OBJ_DIR := $(shell cd $(TOP)/objs; pwd) endif diff --git a/xc/extras/freetype2/builds/cygwin/cygwin-dev.mk b/xc/extras/freetype2/builds/cygwin/cygwin-dev.mk index a38367c83..9feb2945b 100644 --- a/xc/extras/freetype2/builds/cygwin/cygwin-dev.mk +++ b/xc/extras/freetype2/builds/cygwin/cygwin-dev.mk @@ -1,8 +1,8 @@ # -# FreeType 2 Configuration rules for CygWin + GCC +# FreeType 2 Configuration rules for Cygwin # # Development version without optimizations & libtool -# and no installation +# and no installation. # @@ -17,6 +17,8 @@ include $(TOP)/builds/cygwin/cygwinddef.mk +BUILD := $(TOP)/builds/devel + include $(TOP)/builds/compiler/gcc-dev.mk include $(TOP)/builds/link_std.mk diff --git a/xc/extras/freetype2/builds/cygwin/cygwinddef.mk b/xc/extras/freetype2/builds/cygwin/cygwinddef.mk index 3e9d918e2..b593db5d2 100644 --- a/xc/extras/freetype2/builds/cygwin/cygwinddef.mk +++ b/xc/extras/freetype2/builds/cygwin/cygwinddef.mk @@ -1,6 +1,6 @@ # # FreeType 2 configuration rules templates for -# development under Unix-like platforms with no configure script (gcc only) +# development under Unix with no configure script (gcc only) # @@ -19,31 +19,37 @@ ifndef TOP endif TOP := $(shell cd $(TOP); pwd) -DELETE := rm -f -SEP := / -HOSTSEP := $(SEP) +DELETE := rm -f +SEP := / +HOSTSEP := $(SEP) + # we use a special devel ftoption.h -BUILD := $(TOP)/builds/cygwin/devel -# do not set it to 'cygwin', or libtool will trick you -PLATFORM := cygwindev +BUILD := $(TOP)/builds/devel + +# do not set the platform to `unix', or libtool will trick you +PLATFORM := unixdev + # The directory where all object files are placed. # ifndef OBJ_DIR - OBJ_DIR := $(shell cd $(TOP)/obj; pwd) + OBJ_DIR := $(shell cd $(TOP)/objs; pwd) endif + # library file name # LIBRARY := lib$(PROJECT) + # The directory where all library files are placed. # -# By default, this is the same as $(OBJ_DIR), however, this can be changed +# By default, this is the same as $(OBJ_DIR); however, this can be changed # to suit particular needs. # LIB_DIR := $(OBJ_DIR) + # NO_OUTPUT := 2> /dev/null diff --git a/xc/extras/freetype2/builds/cygwin/ftconfig.in b/xc/extras/freetype2/builds/cygwin/ftconfig.in index 5071eefaa..02db171c8 100644 --- a/xc/extras/freetype2/builds/cygwin/ftconfig.in +++ b/xc/extras/freetype2/builds/cygwin/ftconfig.in @@ -37,13 +37,7 @@ #ifndef __FTCONFIG_H__ #define __FTCONFIG_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif - - - /* Include the header file containing all developer build options */ -#include FT_BUILD_H +#include <ft2build.h> #include FT_CONFIG_OPTIONS_H @@ -126,7 +120,6 @@ FT_BEGIN_HEADER #else - /*************************************************************************/ /* */ /* Many compilers provide the non-ANSI `long long' 64-bit type. You can */ @@ -240,15 +233,15 @@ FT_BEGIN_HEADER /* */ #ifdef __cplusplus -#define FT_CALLBACK_DEF extern "C" -#define FT_CALLBACK_TABLE extern "C" -#define FT_CALLBACK_TABLE_DEF extern "C" +#define FT_CALLBACK_DEF extern "C" +#define FT_CALLBACK_TABLE extern "C" +#define FT_CALLBACK_TABLE_DEF extern "C" #else -#define FT_CALLBACK_DEF static -#define FT_CALLBACK_TABLE extern -#define FT_CALLBACK_TABLE_DEF +#define FT_CALLBACK_DEF static +#define FT_CALLBACK_TABLE extern +#define FT_CALLBACK_TABLE_DEF /* nothing */ #endif /* __cplusplus */ diff --git a/xc/extras/freetype2/builds/cygwin/install.mk b/xc/extras/freetype2/builds/cygwin/install.mk index 938ac7897..16403f643 100644 --- a/xc/extras/freetype2/builds/cygwin/install.mk +++ b/xc/extras/freetype2/builds/cygwin/install.mk @@ -33,6 +33,7 @@ install: $(PROJECT_LIBRARY) -for P in $(CACHE_H) ; do \ $(INSTALL_DATA) $$P $(includedir)/freetype2/freetype/cache ; \ done + $(INSTALL_DATA) $(BUILD)/ft2unix.h $(includedir)/ft2build.h $(INSTALL_SCRIPT) -m 755 $(BUILD)/freetype-config \ $(bindir)/freetype-config @@ -53,12 +54,12 @@ uninstall: # Unix cleaning and distclean rules. # -clean_project_cygwin: +clean_project_unix: -$(DELETE) $(BASE_OBJECTS) $(OBJ_M) $(OBJ_S) -$(DELETE) $(patsubst %.$O,%.$(SO),$(BASE_OBJECTS) $(OBJ_M) $(OBJ_S)) \ $(CLEAN) -distclean_project_cygwin: clean_project_cygwin +distclean_project_unix: clean_project_unix -$(DELETE) $(PROJECT_LIBRARY) -$(DELETE) $(OBJ_DIR)/.libs/* -$(DELDIR) $(OBJ_DIR)/.libs diff --git a/xc/extras/freetype2/builds/detect.mk b/xc/extras/freetype2/builds/detect.mk index 83a222001..eaf1ddec5 100644 --- a/xc/extras/freetype2/builds/detect.mk +++ b/xc/extras/freetype2/builds/detect.mk @@ -70,17 +70,39 @@ CONFIG_RULES = $(BUILD)$(SEP)$(CONFIG_FILE) # BACKSLASH := $(strip \ ) -# Now, include all detection rule files found in the `builds/<system>' -# directories. Note that the calling order of the various `detect.mk' files -# isn't predictable. +# Find all auto-detectable platforms. # -include $(wildcard $(BUILD_CONFIG_)*/detect.mk) +PLATFORMS_ := $(notdir $(subst /detect.mk,,$(wildcard $(BUILD_CONFIG_)*/detect.mk))) +.PHONY: $(PLATFORMS_) ansi + +# Filter out platform specified as setup target. +# +PLATFORM := $(firstword $(filter $(MAKECMDGOALS),$(PLATFORMS_))) + +# If no setup target platform was specified, enable auto-detection/ +# default platform. +# +ifeq ($(PLATFORM),) + PLATFORM := ansi +endif + +# If the user has explicitly asked for `ansi' on the command line, +# disable auto-detection. +# +ifeq ($(findstring ansi,$(MAKECMDGOALS)),) + # Now, include all detection rule files found in the `builds/<system>' + # directories. Note that the calling order of the various `detect.mk' + # files isn't predictable. + # + include $(wildcard $(BUILD_CONFIG_)*/detect.mk) +endif # In case no detection rule file was successful, use the default. # ifndef CONFIG_FILE CONFIG_FILE := ansi.mk setup: std_setup + .PHONY: setup endif # The following targets are equivalent, with the exception that they use diff --git a/xc/extras/freetype2/builds/dos/detect.mk b/xc/extras/freetype2/builds/dos/detect.mk index 450c7e0c6..65eb42d36 100644 --- a/xc/extras/freetype2/builds/dos/detect.mk +++ b/xc/extras/freetype2/builds/dos/detect.mk @@ -13,43 +13,24 @@ # fully. -# Test for DJGPP by checking the DJGPP environment variable, which must be -# set in order to use the system (ie. it will always be present when the -# `make' utility is run). -# -ifeq ($(PLATFORM),ansi) - - ifdef DJGPP - # We are definitely using DJGPP - PLATFORM := dos - DELETE := del - COPY := copy - CONFIG_FILE := dos-gcc.mk - SEP := / - ifndef CC - CC := gcc - endif # test CC - - setup : dos_setup - - endif # test DJGPP -endif # test PLATFORM - +.PHONY: setup -# We test for the COMSPEC environment variable, then run the `ver' -# command-line program to see if its output contains the word `Dos'. -# -# If this is true, we are running a Dos-ish platform (or an emulation). -# ifeq ($(PLATFORM),ansi) - ifdef COMSPEC - # - # We try to recognize a Cygwin session, in which case we're - # certainly not running on DOS! - # - ifneq ($(OSTYPE),cygwin) + # Test for DJGPP by checking the DJGPP environment variable, which must be + # set in order to use the system (ie. it will always be present when the + # `make' utility is run). + # + # We test for the COMSPEC environment variable, then run the `ver' + # command-line program to see if its output contains the word `Dos'. + # + # If this is true, we are running a Dos-ish platform (or an emulation). + # + ifdef DJGPP + PLATFORM := dos + else + ifdef COMSPEC is_dos := $(findstring Dos,$(shell ver)) # We try to recognize a Dos session under OS/2. The `ver' command @@ -59,58 +40,66 @@ ifeq ($(PLATFORM),ansi) # substring `MDOS\COMMAND' # ifeq ($(is_dos),) - is_dos := $(findstring MDOS\COMMAND,$(COMSPEC)) + is_dos := $(findstring MDOS\COMMAND,$(COMSPEC)) endif - endif # test Cygwin - endif # test COMSPEC + endif # test COMSPEC - ifneq ($(is_dos),) + ifneq ($(is_dos),) - PLATFORM := dos - DELETE := del - COPY := copy - - # Use DJGPP (i.e. gcc) by default. - # - CONFIG_FILE := dos-gcc.mk - SEP := / - ifndef CC - CC := gcc - endif - - # additionally, we provide hooks for various other compilers - # - ifneq ($(findstring turboc,$(MAKECMDGOALS)),) # Turbo C - CONFIG_FILE := dos-tcc.mk - SEP := $(BACKSLASH) - CC := tcc - .PHONY: turboc - endif - - ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++ - CONFIG_FILE := dos-wat.mk - SEP := $(BACKSLASH) - CC := wcc386 - .PHONY: watcom - endif - - ifneq ($(findstring borlandc16,$(MAKECMDGOALS)),) # Borland C/C++ 16-bit - CONFIG_FILE := dos-bcc.mk - SEP := $(BACKSLASH) - CC := bcc - .PHONY: borlandc16 - endif - - ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C/C++ 32-bit - CONFIG_FILE := dos-bcc.mk - SEP := $(BACKSLASH) - CC := bcc32 - .PHONY: borlandc - endif - - setup: dos_setup - - endif # test Dos -endif # test PLATFORM + PLATFORM := dos + + endif # test Dos + endif # test DJGPP +endif # test PLATFORM ansi + +ifeq ($(PLATFORM),dos) + DELETE := del + COPY := copy + + # Use DJGPP (i.e. gcc) by default. + # + CONFIG_FILE := dos-gcc.mk + SEP := / + ifndef CC + CC := gcc + endif + + # additionally, we provide hooks for various other compilers + # + ifneq ($(findstring turboc,$(MAKECMDGOALS)),) # Turbo C + CONFIG_FILE := dos-tcc.mk + SEP := $(BACKSLASH) + CC := tcc + turboc: setup + .PHONY: turboc + endif + + ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++ + CONFIG_FILE := dos-wat.mk + SEP := $(BACKSLASH) + CC := wcc386 + watcom: setup + .PHONY: watcom + endif + + ifneq ($(findstring borlandc16,$(MAKECMDGOALS)),) # Borland C/C++ 16-bit + CONFIG_FILE := dos-bcc.mk + SEP := $(BACKSLASH) + CC := bcc + borlandc16: setup + .PHONY: borlandc16 + endif + + ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C/C++ 32-bit + CONFIG_FILE := dos-bcc.mk + SEP := $(BACKSLASH) + CC := bcc32 + borlandc: setup + .PHONY: borlandc + endif + + setup: dos_setup + +endif # test PLATFORM dos # EOF diff --git a/xc/extras/freetype2/builds/dos/dos-def.mk b/xc/extras/freetype2/builds/dos/dos-def.mk index 16f4e0dea..19c130165 100644 --- a/xc/extras/freetype2/builds/dos/dos-def.mk +++ b/xc/extras/freetype2/builds/dos/dos-def.mk @@ -34,7 +34,7 @@ endif # make -f %TOP%/Makefile # ifndef OBJ_DIR - OBJ_DIR := $(TOP)$(SEP)obj + OBJ_DIR := $(TOP)$(SEP)objs endif @@ -58,6 +58,8 @@ NO_OUTPUT = &> nul ifdef BUILD_PROJECT + .PHONY: clean_project distclean_project + # Now include the main sub-makefile. It contains all the rules used to # build the library with the previous variables defined. # diff --git a/xc/extras/freetype2/builds/freetype.mk b/xc/extras/freetype2/builds/freetype.mk index 67489ffb1..532de0f4b 100644 --- a/xc/extras/freetype2/builds/freetype.mk +++ b/xc/extras/freetype2/builds/freetype.mk @@ -70,7 +70,7 @@ # The targets `objects' and `library' are defined at the end of this # Makefile after all other rules have been included. # -.PHONY: single objects library +.PHONY: single multi objects library # default target -- build single objects and library # @@ -91,6 +91,15 @@ SRC := $(TOP)$(SEP)src # BASE_DIR := $(SRC)$(SEP)base +# The build header file used to define all public header file names +# as macro. +# +ifndef FT_BUILD_H + FT_BUILD_H := $(TOP)$(SEP)include$(SEP)ft2build.h + FTBUILD_CMD := +else + FTBUILD_CMD = $(D)FT_BUILD_H=$(FT_BUILD_H) +endif # A few short-cuts in order to avoid typing $(SEP) all the time for the # directory separator. @@ -121,7 +130,7 @@ PROJECT_LIBRARY := $(LIB_)$(LIBRARY).$A # in the `freetype/builds/<system>' directory, as these # files will override the default sources. # -INCLUDES := $(BUILD) $(TOP)$(SEP)include $(SRC) +INCLUDES := $(BUILD) $(TOP)$(SEP)include INCLUDE_FLAGS = $(INCLUDES:%=$I%) @@ -246,6 +255,8 @@ library: $(PROJECT_LIBRARY) $(FT_COMPILE) $T$@ $< +.PHONY: clean_project_std distclean_project_std + # Standard cleaning and distclean rules. These are not accepted # on all systems though. # @@ -256,6 +267,9 @@ distclean_project_std: clean_project_std -$(DELETE) $(PROJECT_LIBRARY) -$(DELETE) *.orig *~ core *.core $(DISTCLEAN) + +.PHONY: clean_project_dos distclean_project_dos + # The Dos command shell does not support very long list of arguments, so # we are stuck with wildcards. # @@ -267,12 +281,17 @@ distclean_project_dos: clean_project_dos -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(PROJECT_LIBRARY)) \ $(DISTCLEAN) $(NO_OUTPUT) + +.PHONY: remove_config_mk + # Remove configuration file (used for distclean). # remove_config_mk: -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(CONFIG_MK)) $(NO_OUTPUT) +.PHONY: clean distclean + # The `config.mk' file must define `clean_freetype' and # `distclean_freetype'. Implementations may use to relay these to either # the `std' or `dos' versions from above, or simply provide their own diff --git a/xc/extras/freetype2/builds/link_dos.mk b/xc/extras/freetype2/builds/link_dos.mk index 5b1d497e7..b35115b59 100644 --- a/xc/extras/freetype2/builds/link_dos.mk +++ b/xc/extras/freetype2/builds/link_dos.mk @@ -15,6 +15,8 @@ ifdef BUILD_PROJECT + .PHONY: clean_project distclean_project + # Now include the main sub-makefile. It contains all the rules used to # build the library with the previous variables defined. # diff --git a/xc/extras/freetype2/builds/link_std.mk b/xc/extras/freetype2/builds/link_std.mk index ecba73b8e..2a7b26df7 100644 --- a/xc/extras/freetype2/builds/link_std.mk +++ b/xc/extras/freetype2/builds/link_std.mk @@ -15,6 +15,8 @@ ifdef BUILD_PROJECT + .PHONY: clean_project distclean_project + # Now include the main sub-makefile. It contains all the rules used to # build the library with the previous variables defined. # diff --git a/xc/extras/freetype2/builds/modules.mk b/xc/extras/freetype2/builds/modules.mk index 68f3d6ba4..3f911de42 100644 --- a/xc/extras/freetype2/builds/modules.mk +++ b/xc/extras/freetype2/builds/modules.mk @@ -20,7 +20,7 @@ # This file is in charge of handling the generation of the modules list # file. -.PHONY: make_module_list clean_module_list remake_module_list +.PHONY: make_module_list clean_module_list # MODULE_LIST, as its name suggests, indicates where the modules list # resides. For now, it is in `include/freetype/config/ftmodule.h'. @@ -32,39 +32,39 @@ endif # To build the modules list, we invoke the `make_module_list' target. # # This rule is commented out by default since FreeType comes already with -# a ftmodule.h file. +# an ftmodule.h file. # #$(MODULE_LIST): make_module_list + +ifneq ($(findstring $(PLATFORM),dos win32 win16 os2),) + OPEN_MODULE := @echo$(space) + CLOSE_MODULE := >> $(subst $(SEP),$(HOSTSEP),$(MODULE_LIST)) + REMOVE_MODULE := @-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(MODULE_LIST)) +else + OPEN_MODULE := @echo " + CLOSE_MODULE := " >> $(MODULE_LIST) + REMOVE_MODULE := @-$(DELETE) $(MODULE_LIST) +endif + + # Before the modules list file can be generated, we must remove the file in # order to `clean' the list. # clean_module_list: - @-$(DELETE) $(subst $(SEP),$(HOSTSEP),$(MODULE_LIST)) + $(REMOVE_MODULE) @-echo Regenerating the modules list in $(MODULE_LIST)... make_module_list: clean_module_list @echo done. - -# Trailing spaces are protected with a `#' sign to avoid accidental -# removing. -# -ifneq ($(findstring $(PLATFORM),dos win32 win16 os2),) - OPEN_MODULE := @echo # - CLOSE_MODULE := >> $(subst $(SEP),$(HOSTSEP),$(MODULE_LIST)) -else - OPEN_MODULE := @echo " - CLOSE_MODULE := " >> $(MODULE_LIST) -endif - # $(OPEN_DRIVER) & $(CLOSE_DRIVER) are used to specify a given font driver # in the `module.mk' rules file. # OPEN_DRIVER := $(OPEN_MODULE)FT_USE_MODULE( CLOSE_DRIVER := )$(CLOSE_MODULE) -ECHO_DRIVER := @echo "* module: # +ECHO_DRIVER := @echo "* module:$(space) ECHO_DRIVER_DESC := ( ECHO_DRIVER_DONE := )" diff --git a/xc/extras/freetype2/builds/os2/detect.mk b/xc/extras/freetype2/builds/os2/detect.mk index 4e4757613..d332be7f4 100644 --- a/xc/extras/freetype2/builds/os2/detect.mk +++ b/xc/extras/freetype2/builds/os2/detect.mk @@ -13,50 +13,63 @@ # fully. +.PHONY: setup + + ifeq ($(PLATFORM),ansi) ifdef OS2_SHELL PLATFORM := os2 - COPY := copy - DELETE := del - CONFIG_FILE := os2-gcc.mk # gcc-emx by default + endif # test OS2_SHELL +endif + +ifeq ($(PLATFORM),os2) + + COPY := copy + DELETE := del + + # gcc-emx by default + CONFIG_FILE := os2-gcc.mk + SEP := / + + # additionally, we provide hooks for various other compilers + # + ifneq ($(findstring visualage,$(MAKECMDGOALS)),) # Visual Age C++ + CONFIG_FILE := os2-icc.mk + SEP := $(BACKSLASH) + CC := icc + visualage: setup + .PHONY: visualage + endif + + ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++ + CONFIG_FILE := os2-wat.mk + SEP := $(BACKSLASH) + CC := wcc386 + watcom: setup + .PHONY: watcom + endif + + ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C++ 32-bit + CONFIG_FILE := os2-bcc.mk + SEP := $(BACKSLASH) + CC := bcc32 + borlandc: setup + .PHONY: borlandc + endif + + ifneq ($(findstring devel,$(MAKECMDGOALS)),) # development target + CONFIG_FILE := os2-dev.mk + CC := gcc SEP := / + devel: setup + .PHONY: devel + endif - # additionally, we provide hooks for various other compilers - # - ifneq ($(findstring visualage,$(MAKECMDGOALS)),) # Visual Age C++ - CONFIG_FILE := os2-icc.mk - SEP := $(BACKSLASH) - CC := icc - .PHONY: visualage - endif - - ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++ - CONFIG_FILE := os2-wat.mk - SEP := $(BACKSLASH) - CC := wcc386 - .PHONY: watcom - endif - - ifneq ($(findstring borlandc,$(MAKECMDGOALS)),) # Borland C++ 32-bit - CONFIG_FILE := os2-bcc.mk - SEP := $(BACKSLASH) - CC := bcc32 - .PHONY: borlandc - endif - - ifneq ($(findstring devel,$(MAKECMDGOALS)),) # development target - CONFIG_FILE := os2-dev.mk - CC := gcc - SEP := / - devel: setup - endif - - setup: dos_setup + setup: dos_setup - endif # test OS2_SHELL -endif # test PLATFORM +endif # test PLATFORM os2 # EOF diff --git a/xc/extras/freetype2/builds/os2/os2-def.mk b/xc/extras/freetype2/builds/os2/os2-def.mk index 42f505dbd..e25f90ce3 100644 --- a/xc/extras/freetype2/builds/os2/os2-def.mk +++ b/xc/extras/freetype2/builds/os2/os2-def.mk @@ -34,7 +34,7 @@ endif # make -f %TOP%/Makefile # ifndef OBJ_DIR - OBJ_DIR := $(TOP)$(SEP)obj + OBJ_DIR := $(TOP)$(SEP)objs endif @@ -58,6 +58,8 @@ NO_OUTPUT = 2> nul ifdef BUILD_LIBRARY + .PHONY: clean_project distclean_project + # Now include the main sub-makefile. It contains all the rules used to # build the library with the previous variables defined. # diff --git a/xc/extras/freetype2/builds/os2/os2-dev.mk b/xc/extras/freetype2/builds/os2/os2-dev.mk index 0df4bbc0c..db7f3d5cb 100644 --- a/xc/extras/freetype2/builds/os2/os2-dev.mk +++ b/xc/extras/freetype2/builds/os2/os2-dev.mk @@ -109,6 +109,8 @@ ANSIFLAGS := -ansi -pedantic ifdef BUILD_FREETYPE + .PHONY: clean_freetype distclean_freetype + # Now include the main sub-makefile. It contains all the rules used to # build the library with the previous variables defined. # diff --git a/xc/extras/freetype2/builds/os2/os2-gcc.mk b/xc/extras/freetype2/builds/os2/os2-gcc.mk index 2bed13304..6470c7275 100644 --- a/xc/extras/freetype2/builds/os2/os2-gcc.mk +++ b/xc/extras/freetype2/builds/os2/os2-gcc.mk @@ -108,6 +108,8 @@ ANSIFLAGS := -ansi -pedantic ifdef BUILD_FREETYPE + .PHONY: clean_freetype distclean_freetype + # Now include the main sub-makefile. It contains all the rules used to # build the library with the previous variables defined. # diff --git a/xc/extras/freetype2/builds/toplevel.mk b/xc/extras/freetype2/builds/toplevel.mk index fe1af48f1..f05ca0dad 100644 --- a/xc/extras/freetype2/builds/toplevel.mk +++ b/xc/extras/freetype2/builds/toplevel.mk @@ -34,7 +34,7 @@ # details on host platform detection and library builds. -.PHONY: setup distclean +.PHONY: all setup distclean modules # The `space' variable is used to avoid trailing spaces in defining the # `T' variable later. @@ -71,6 +71,8 @@ endif # ifdef check_platform + # This is the first rule `make' sees. + # all: setup ifdef USE_MODULES @@ -92,7 +94,8 @@ ifdef check_platform # This rule makes sense for Unix only to remove files created by a run # of the configure script which hasn't been successful (so that no # `config.mk' has been created). It uses the built-in $(RM) command of - # GNU make. + # GNU make. Similarly, `nul' is created if e.g. `make setup win32' has + # been erroneously used. # distclean: $(RM) builds/unix/config.cache @@ -100,6 +103,7 @@ ifdef check_platform $(RM) builds/unix/config.status $(RM) builds/unix/unix-def.mk $(RM) builds/unix/unix-cc.mk + $(RM) nul # IMPORTANT: # diff --git a/xc/extras/freetype2/builds/unix/config.guess b/xc/extras/freetype2/builds/unix/config.guess index 646ae05af..9b77b5728 100644 --- a/xc/extras/freetype2/builds/unix/config.guess +++ b/xc/extras/freetype2/builds/unix/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. -version='2000-07-27' +timestamp='2001-02-13' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -32,30 +32,41 @@ version='2000-07-27' # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you -# don't specify an explicit system type (host/target name). -# -# Only a few systems have been added to this list; please add others -# (but try to keep the structure clean). -# +# don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] -Output the configuration name of this system. +Output the configuration name of the system \`$me' is run on. Operation modes: - -h, --help print this help, then exit - -V, --version print version number, then exit" + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do - case "$1" in - --version | --vers* | -V ) + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; @@ -64,9 +75,7 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - exec >&2 - echo "$me: invalid option $1" - echo "$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; @@ -78,19 +87,30 @@ if test $# != 0; then exit 1 fi -# Use $HOST_CC if defined. $CC may point to a cross-compiler -if test x"$CC_FOR_BUILD" = x; then - if test x"$HOST_CC" != x; then - CC_FOR_BUILD="$HOST_CC" - else - if test x"$CC" != x; then - CC_FOR_BUILD="$CC" - else - CC_FOR_BUILD=cc - fi - fi -fi +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int dummy(){}" > $dummy.c + for c in cc gcc c89 ; do + ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 + if test $? = 0 ; then + CC_FOR_BUILD="$c"; break + fi + done + rm -f $dummy.c $dummy.o $dummy.rel + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 8/24/94.) @@ -100,12 +120,9 @@ fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 - # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -129,16 +146,24 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ibmrt|romp-ibm) machine=romp-ibm ;; *) machine=${UNAME_MACHINE}-unknown ;; esac - # The Operating System including object format. - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE}" in + i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: @@ -247,7 +272,7 @@ EOF arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; - SR2?01:HI-UX/MPP:*:*) + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) @@ -437,6 +462,14 @@ EOF i?86:AIX:*:*) echo i386-ibm-aix exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then sed 's/^ //' << EOF >$dummy.c @@ -459,9 +492,9 @@ EOF echo rs6000-ibm-aix3.2 fi exit 0 ;; - *:AIX:*:4) + *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` - if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -469,7 +502,7 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=4.${UNAME_RELEASE} + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; @@ -495,10 +528,28 @@ EOF echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) + case "${HPUX_REV}" in + 11.[0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + esac ;; + esac + fi ;; + esac + if [ "${HP_ARCH}" = "" ]; then sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE @@ -533,11 +584,16 @@ EOF } EOF (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy + fi ;; esac - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; 3050*:HI-UX:*:*) sed 's/^ //' << EOF >$dummy.c #include <unistd.h> @@ -628,23 +684,24 @@ EOF CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY*T3E:*:*:*) + CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; - F300:UNIX_System_V:*:*) + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; - F301:UNIX_System_V:*:*) - echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` - exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -669,6 +726,9 @@ EOF i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -690,30 +750,66 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + mips:Linux:*:*) + cat >$dummy.c <<EOF +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ +int main (int argc, char *argv[]) { +#else +int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __MIPSEB__ + printf ("%s-unknown-linux-gnu\n", argv[1]); +#endif +#ifdef __MIPSEL__ + printf ("%sel-unknown-linux-gnu\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; *:Linux:*:*) - # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. - ld_help_string=`cd /; ld --help 2>&1` - ld_supported_emulations=`echo $ld_help_string \ + ld_supported_emulations=`cd /; ld --help 2>&1 \ | sed -ne '/supported emulations:/!d s/[ ][ ]*/ /g s/.*supported emulations: *// s/ .*// p'` case "$ld_supported_emulations" in - *ia64) - echo "${UNAME_MACHINE}-unknown-linux" - exit 0 - ;; i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; elf_i?86) - echo "${UNAME_MACHINE}-pc-linux" - exit 0 + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" @@ -723,6 +819,10 @@ EOF echo "${UNAME_MACHINE}-unknown-linux-gnuaout" exit 0 ;; + elf32_sparc) + echo "${UNAME_MACHINE}-unknown-linux-gnu" + exit 0 + ;; armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" exit 0 @@ -771,10 +871,6 @@ EOF echo powerpc-unknown-linux-gnu${LIBC} exit 0 ;; - shelf_linux) - echo "${UNAME_MACHINE}-unknown-linux-gnu" - exit 0 - ;; esac if test "${UNAME_MACHINE}" = "alpha" ; then @@ -807,24 +903,12 @@ EOF $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; + 0-0) UNAME_MACHINE="alpha" ;; + 1-0) UNAME_MACHINE="alphaev5" ;; + 1-1) UNAME_MACHINE="alphaev56" ;; + 1-101) UNAME_MACHINE="alphapca56" ;; + 2-303) UNAME_MACHINE="alphaev6" ;; + 2-307) UNAME_MACHINE="alphaev67" ;; esac objdump --private-headers $dummy | \ @@ -835,35 +919,14 @@ EOF fi rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 - elif test "${UNAME_MACHINE}" = "mips" ; then - cat >$dummy.c <<EOF -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif -#ifdef __MIPSEB__ - printf ("%s-unknown-linux-gnu\n", argv[1]); -#endif -#ifdef __MIPSEL__ - printf ("%sel-unknown-linux-gnu\n", argv[1]); -#endif - return 0; -} -EOF - $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy - elif test "${UNAME_MACHINE}" = "s390"; then - echo s390-ibm-linux && exit 0 else # Either a pre-BFD a.out linker (linux-gnuoldld) # or one that does not give us useful --help. # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. # If ld does not provide *any* "supported emulations:" # that means it is gnuoldld. - echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" - test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + test -z "$ld_supported_emulations" \ + && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 case "${UNAME_MACHINE}" in i?86) @@ -900,6 +963,7 @@ EOF EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 fi ;; # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions # are messed up and put the nodename in both sysname and nodename. @@ -977,7 +1041,7 @@ EOF exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -1000,9 +1064,12 @@ EOF TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; - rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; @@ -1036,7 +1103,7 @@ EOF mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; - news*:NEWS-OS:*:6*) + news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) @@ -1079,9 +1146,12 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-W:NONSTOP_KERNEL:*:*) + NSR-[KW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; @@ -1099,6 +1169,29 @@ EOF fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; + i?86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1190,11 +1283,24 @@ main () #endif #if defined (vax) -#if !defined (ultrix) - printf ("vax-dec-bsd\n"); exit (0); -#else - printf ("vax-dec-ultrix\n"); exit (0); -#endif +# if !defined (ultrix) +# include <sys/param.h> +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif #endif #if defined (alliant) && defined (i860) @@ -1241,8 +1347,9 @@ fi cat >&2 <<EOF $0: unable to guess system type -The $version version of this script cannot recognize your system type. -Please download the most up to date version of the config scripts: +This script, last modified $timestamp, has failed to recognize +the operating system you are using. It is advised that you +download the most up to date version of the config scripts from ftp://ftp.gnu.org/pub/gnu/config/ @@ -1251,7 +1358,7 @@ send the following data and any information you think might be pertinent to <config-patches@gnu.org> in order to provide the needed information to handle your system. -config.guess version = $version +config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` @@ -1278,7 +1385,7 @@ exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "version='" +# time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: diff --git a/xc/extras/freetype2/builds/unix/config.sub b/xc/extras/freetype2/builds/unix/config.sub index 1f731e493..b7d9794bb 100644 --- a/xc/extras/freetype2/builds/unix/config.sub +++ b/xc/extras/freetype2/builds/unix/config.sub @@ -1,9 +1,9 @@ #! /bin/sh -# Configuration validation subroutine script, version 1.1. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. -version='2000-07-27' +timestamp='2001-02-13' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -60,16 +60,30 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS Canonicalize a configuration name. Operation modes: - -h, --help print this help, then exit - -V, --version print version number, then exit" + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do - case "$1" in - --version | --vers* | -V ) + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; @@ -78,9 +92,7 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - exec >&2 - echo "$me: invalid option $1" - echo "$help" + echo "$me: invalid option $1$help" exit 1 ;; *local*) @@ -105,7 +117,7 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu*) + nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -203,22 +215,24 @@ esac case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. - tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ - | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \ + | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \ + | pyramid | mn10200 | mn10300 | tron | a29k \ | 580 | i960 | h8300 \ - | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \ + | x86 | ppcbe | mipsbe | mipsle | shbe | shle \ | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ | hppa64 \ | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ | alphaev6[78] \ | we32k | ns16k | clipper | i370 | sh | sh[34] \ | powerpc | powerpcle \ - | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ + | 1750a | dsp16xx | pdp10 | pdp11 \ + | mips16 | mips64 | mipsel | mips64el \ | mips64orion | mips64orionel | mipstx39 | mipstx39el \ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ | mips64vr5000 | miprs64vr5000el | mcore \ | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ - | thumb | d10v | d30v | fr30 | avr) + | thumb | d10v | d30v | fr30 | avr | openrisc) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -232,7 +246,7 @@ case $basic_machine in # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. - i[234567]86) + i[234567]86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. @@ -243,26 +257,27 @@ case $basic_machine in # Recognize the basic CPU types with company name. # FIXME: clean up the formatting here. vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ - | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \ + | arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ | xmp-* | ymp-* \ - | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \ + | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \ | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ | hppa2.0n-* | hppa64-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ | alphaev6[78]-* \ | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ | clipper-* | orion-* \ - | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ | mips64el-* | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ | mipstx39-* | mipstx39el-* | mcore-* \ - | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ + | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ - | bs2000-* | tic54x-* | c54x-*) + | bs2000-* | tic54x-* | c54x-* | x86_64-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. @@ -353,8 +368,8 @@ case $basic_machine in basic_machine=cray2-cray os=-unicos ;; - [ctj]90-cray) - basic_machine=c90-cray + [cjt]90) + basic_machine=${basic_machine}-cray os=-unicos ;; crds | unos) @@ -410,6 +425,10 @@ case $basic_machine in basic_machine=tron-gmicro os=-sysv ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 @@ -509,14 +528,6 @@ case $basic_machine in basic_machine=i386-unknown os=-vsta ;; - i386-go32 | go32) - basic_machine=i386-unknown - os=-go32 - ;; - i386-mingw32 | mingw32) - basic_machine=i386-unknown - os=-mingw32 - ;; iris | iris4d) basic_machine=mips-sgi case $os in @@ -542,6 +553,10 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; miniframe) basic_machine=m68000-convergent ;; @@ -572,7 +587,7 @@ case $basic_machine in os=-coff ;; msdos) - basic_machine=i386-unknown + basic_machine=i386-pc os=-msdos ;; mvs) @@ -636,6 +651,10 @@ case $basic_machine in basic_machine=i960-intel os=-mon960 ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; np1) basic_machine=np1-gould ;; @@ -671,28 +690,28 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; - pentium | p5 | k5 | k6 | nexen) + pentium | p5 | k5 | k6 | nexgen) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) - basic_machine=i786-pc + basic_machine=i686-pc ;; - pentium-* | p5-* | k5-* | k6-* | nexen-*) + pentium-* | p5-* | k5-* | k6-* | nexgen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; - power) basic_machine=rs6000-ibm + power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; @@ -707,6 +726,10 @@ case $basic_machine in ps2) basic_machine=i386-ibm ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -897,6 +920,10 @@ case $basic_machine in vax) basic_machine=vax-dec ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; pdp11) basic_machine=pdp11-dec ;; @@ -904,7 +931,7 @@ case $basic_machine in basic_machine=we32k-att ;; sh3 | sh4) - base_machine=sh-unknown + basic_machine=sh-unknown ;; sparc | sparcv9) basic_machine=sparc-sun @@ -987,7 +1014,8 @@ case $os in | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit*) + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1048,7 +1076,7 @@ case $os in -ns2 ) os=-nextstep2 ;; - -nsk) + -nsk*) os=-nsk ;; # Preserve the version number of sinix5. @@ -1085,7 +1113,7 @@ case $os in -xenix) os=-xenix ;; - -*mint | -*MiNT) + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) @@ -1119,6 +1147,9 @@ case $basic_machine in arm*-semi) os=-aout ;; + pdp10-*) + os=-tops20 + ;; pdp11-*) os=-none ;; @@ -1227,7 +1258,7 @@ case $basic_machine in *-masscomp) os=-rtu ;; - f301-fujitsu) + f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) @@ -1305,7 +1336,7 @@ case $basic_machine in -mpw* | -macos*) vendor=apple ;; - -*mint | -*MiNT) + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; esac @@ -1318,7 +1349,7 @@ exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "version='" +# time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: diff --git a/xc/extras/freetype2/builds/unix/configure b/xc/extras/freetype2/builds/unix/configure index aaf190f4b..074707a00 100755 --- a/xc/extras/freetype2/builds/unix/configure +++ b/xc/extras/freetype2/builds/unix/configure @@ -536,6 +536,8 @@ fi version_info='6:1:0' +ft_version=`echo $version_info | tr : .` + ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do @@ -584,7 +586,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:588: checking host system type" >&5 +echo "configure:590: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -605,7 +607,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:609: checking target system type" >&5 +echo "configure:611: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -623,7 +625,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:627: checking build system type" >&5 +echo "configure:629: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -649,7 +651,7 @@ test "$host_alias" != "$target_alias" && # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:653: checking for $ac_word" >&5 +echo "configure:655: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -679,7 +681,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:683: checking for $ac_word" >&5 +echo "configure:685: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -730,7 +732,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:734: checking for $ac_word" >&5 +echo "configure:736: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -762,7 +764,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:766: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:768: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -773,12 +775,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 777 "configure" +#line 779 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -804,12 +806,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:808: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:810: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:813: checking whether we are using GNU C" >&5 +echo "configure:815: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -818,7 +820,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -837,7 +839,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:841: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:843: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -869,7 +871,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:873: checking how to run the C preprocessor" >&5 +echo "configure:875: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -884,13 +886,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 888 "configure" +#line 890 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -901,13 +903,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 905 "configure" +#line 907 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -918,13 +920,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 922 "configure" +#line 924 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -971,7 +973,7 @@ fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:975: checking for $ac_word" >&5 +echo "configure:977: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RMF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1000,7 +1002,7 @@ fi # Extract the first word of "rmdir", so it can be a program name with args. set dummy rmdir; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1004: checking for $ac_word" >&5 +echo "configure:1006: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RMDIR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1039,7 +1041,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1043: checking for a BSD compatible install" >&5 +echo "configure:1045: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1099,12 +1101,12 @@ case "$INSTALL" in esac echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1103: checking for ANSI C header files" >&5 +echo "configure:1105: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1108 "configure" +#line 1110 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -1112,7 +1114,7 @@ else #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1116: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1118: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1129,7 +1131,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1133 "configure" +#line 1135 "configure" #include "confdefs.h" #include <string.h> EOF @@ -1147,7 +1149,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 1151 "configure" +#line 1153 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -1168,7 +1170,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 1172 "configure" +#line 1174 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1179,7 +1181,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1206,17 +1208,17 @@ for ac_hdr in fcntl.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1210: checking for $ac_hdr" >&5 +echo "configure:1212: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1215 "configure" +#line 1217 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1244,12 +1246,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1248: checking for working const" >&5 +echo "configure:1250: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1253 "configure" +#line 1255 "configure" #include "confdefs.h" int main() { @@ -1298,7 +1300,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:1302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1319,7 +1321,7 @@ EOF fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:1323: checking size of int" >&5 +echo "configure:1325: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1327,7 +1329,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 1331 "configure" +#line 1333 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -1338,7 +1340,7 @@ main() exit(0); } EOF -if { (eval echo configure:1342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -1358,7 +1360,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:1362: checking size of long" >&5 +echo "configure:1364: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1366,7 +1368,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 1370 "configure" +#line 1372 "configure" #include "confdefs.h" #include <stdio.h> main() @@ -1377,7 +1379,7 @@ main() exit(0); } EOF -if { (eval echo configure:1381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -1402,17 +1404,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1406: checking for $ac_hdr" >&5 +echo "configure:1408: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1411 "configure" +#line 1413 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1416: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1418: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1441,12 +1443,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1445: checking for $ac_func" >&5 +echo "configure:1447: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1450 "configure" +#line 1452 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1469,7 +1471,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1494,7 +1496,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1498: checking for working mmap" >&5 +echo "configure:1500: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1502,7 +1504,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 1506 "configure" +#line 1508 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -1642,7 +1644,7 @@ main() } EOF -if { (eval echo configure:1646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -1670,12 +1672,12 @@ else FTSYS_SRC='$(BUILD)/ftsystem.c' echo $ac_n "checking whether munmap must be declared""... $ac_c" 1>&6 -echo "configure:1674: checking whether munmap must be declared" >&5 +echo "configure:1676: checking whether munmap must be declared" >&5 if eval "test \"`echo '$''{'ft_cv_munmap_decl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1679 "configure" +#line 1681 "configure" #include "confdefs.h" #ifdef HAVE_UNISTD_H @@ -1686,7 +1688,7 @@ int main() { char *(*pfn) = (char *(*))munmap ; return 0; } EOF -if { (eval echo configure:1690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ft_cv_munmap_decl=no else @@ -1706,9 +1708,9 @@ EOF fi echo $ac_n "checking for munmap's first parameter type""... $ac_c" 1>&6 -echo "configure:1710: checking for munmap's first parameter type" >&5 +echo "configure:1712: checking for munmap's first parameter type" >&5 cat > conftest.$ac_ext <<EOF -#line 1712 "configure" +#line 1714 "configure" #include "confdefs.h" #include <unistd.h> @@ -1718,7 +1720,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""void *" 1>&6;cat >> confdefs.h <<\EOF #define MUNMAP_USES_VOIDP 1 @@ -1738,12 +1740,12 @@ fi for ac_func in memcpy memmove do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1742: checking for $ac_func" >&5 +echo "configure:1744: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1747 "configure" +#line 1749 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -1766,7 +1768,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:1770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1863,7 +1865,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1867: checking for $ac_word" >&5 +echo "configure:1869: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1902,7 +1904,7 @@ ac_prog=ld if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1906: checking for ld used by GCC" >&5 +echo "configure:1908: checking for ld used by GCC" >&5 ac_prog=`($CC -print-prog-name=ld) 2>&5` case "$ac_prog" in # Accept absolute paths. @@ -1926,10 +1928,10 @@ echo "configure:1906: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1930: checking for GNU ld" >&5 +echo "configure:1932: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1933: checking for non-GNU ld" >&5 +echo "configure:1935: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1964,7 +1966,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1968: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1970: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1980,7 +1982,7 @@ echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1984: checking for BSD-compatible nm" >&5 +echo "configure:1986: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2016,7 +2018,7 @@ NM="$ac_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:2020: checking whether ln -s works" >&5 +echo "configure:2022: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2065,8 +2067,8 @@ test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" case "$lt_target" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2069 "configure"' > conftest.$ac_ext - if { (eval echo configure:2070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2071 "configure"' > conftest.$ac_ext + if { (eval echo configure:2072: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -2087,19 +2089,19 @@ case "$lt_target" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2091: checking whether the C compiler needs -belf" >&5 +echo "configure:2093: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2096 "configure" +#line 2098 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:2103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2335,6 +2337,7 @@ s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@version_info@%$version_info%g +s%@ft_version@%$ft_version%g s%@host@%$host%g s%@host_alias@%$host_alias%g s%@host_cpu@%$host_cpu%g diff --git a/xc/extras/freetype2/builds/unix/configure.in b/xc/extras/freetype2/builds/unix/configure.in index 6a1bbeb5a..fc7547aad 100644 --- a/xc/extras/freetype2/builds/unix/configure.in +++ b/xc/extras/freetype2/builds/unix/configure.in @@ -10,6 +10,8 @@ AC_CONFIG_HEADER(ftconfig.h:ftconfig.in) version_info='6:1:0' AC_SUBST(version_info) +ft_version=`echo $version_info | tr : .` +AC_SUBST(ft_version) dnl checks for system type AC_CANONICAL_SYSTEM diff --git a/xc/extras/freetype2/builds/unix/detect.mk b/xc/extras/freetype2/builds/unix/detect.mk index cbdefd5ad..32de899f1 100644 --- a/xc/extras/freetype2/builds/unix/detect.mk +++ b/xc/extras/freetype2/builds/unix/detect.mk @@ -12,60 +12,67 @@ # indicate that you have read the license and understand and accept it # fully. -.PHONY: devel lcc setup unix +.PHONY: setup ifeq ($(PLATFORM),ansi) - has_init := $(strip $(wildcard /sbin/init)) - ifneq ($(has_init),) + is_unix := $(strip $(wildcard /sbin/init) $(wildcard /hurd/auth)) + ifneq ($(is_unix),) PLATFORM := unix - COPY := cp - DELETE := rm -f + endif # test is_unix +endif # test PLATFORM ansi - # If `devel' is the requested target, we use a special configuration - # file named `unix-dev.mk'. It disables optimization and libtool. +ifeq ($(PLATFORM),unix) + COPY := cp + DELETE := rm -f + + # If `devel' is the requested target, we use a special configuration + # file named `unix-dev.mk'. It disables optimization and libtool. + # + ifneq ($(findstring devel,$(MAKECMDGOALS)),) + CONFIG_FILE := unix-dev.mk + CC := gcc + devel: setup + .PHONY: devel + else + + # If `lcc' is the requested target, we use a special configuration + # file named `unix-lcc.mk'. It disables libtool for LCC. # - ifneq ($(findstring devel,$(MAKECMDGOALS)),) - CONFIG_FILE := unix-dev.mk - CC := gcc - devel: setup + ifneq ($(findstring lcc,$(MAKECMDGOALS)),) + CONFIG_FILE := unix-lcc.mk + CC := lcc + lcc: setup + .PHONY: lcc else - # If `lccl' is the requested target, we use a special configuration - # file named `unix-lcc.mk'. It disables libtool for LCC + # If a Unix platform is detected, the configure script is called and + # `unix-def.mk' together with `unix-cc.mk' is created. + # + # Arguments to `configure' should be in the CFG variable. Example: + # + # make CFG="--prefix=/usr --disable-static" + # + # If you need to set CFLAGS or LDFLAGS, do it here also. + # + # Feel free to add support for other platform specific compilers in + # this directory (e.g. solaris.mk + changes here to detect the + # platform). # - ifneq ($(findstring lcc,$(MAKECMDGOALS)),) - CONFIG_FILE := unix-lcc.mk - CC := lcc - lcc: setup - else - # If a Unix platform is detected, the configure script is called and - # `unix-def.mk' together with `unix-cc.mk' is created. - # - # Arguments to `configure' should be in the CFG variable. Example: - # - # make CFG="--prefix=/usr --disable-static" - # - # If you need to set CFLAGS or LDFLAGS, do it here also. - # - # Feel free to add support for other platform specific compilers in - # this directory (e.g. solaris.mk + changes here to detect the - # platform). - # - CONFIG_FILE := unix.mk - setup: unix-def.mk - unix: setup - endif + CONFIG_FILE := unix.mk + setup: unix-def.mk + unix: setup + .PHONY: unix endif + endif - setup: std_setup + setup: std_setup - unix-def.mk: $(TOP)/builds/unix/unix-def.in - cd builds/unix; $(USE_CFLAGS) ./configure $(CFG) + unix-def.mk: $(TOP)/builds/unix/unix-def.in + cd builds/unix; ./configure $(CFG) - endif # test Unix -endif # test PLATFORM +endif # test PLATFORM unix # EOF diff --git a/xc/extras/freetype2/builds/unix/freetype-config.in b/xc/extras/freetype2/builds/unix/freetype-config.in index 577626db6..566338ac1 100644 --- a/xc/extras/freetype2/builds/unix/freetype-config.in +++ b/xc/extras/freetype2/builds/unix/freetype-config.in @@ -2,7 +2,6 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ -exec_prefix_set=no usage() { @@ -23,7 +22,6 @@ if test $# -eq 0; then usage 1 1>&2 fi - while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; @@ -33,6 +31,7 @@ while test $# -gt 0; do case $1 in --prefix=*) prefix=$optarg + local_prefix=yes ;; --prefix) echo_prefix=yes @@ -40,12 +39,13 @@ while test $# -gt 0; do --exec-prefix=*) exec_prefix=$optarg exec_prefix_set=yes + local_prefix=yes ;; --exec-prefix) echo_exec_prefix=yes ;; --version) - echo @version_info@ + echo @ft_version@ exit 0 ;; --cflags) @@ -64,8 +64,10 @@ while test $# -gt 0; do shift done -if test "$exec_prefix_set" = "no"; then - exec_prefix=$prefix +if test "$local_prefix" = "yes" ; then + if test "$exec_prefix_set" != "yes"; then + exec_prefix=$prefix + fi fi if test "$echo_prefix" = "yes"; then diff --git a/xc/extras/freetype2/builds/unix/ft2unix.h b/xc/extras/freetype2/builds/unix/ft2unix.h new file mode 100644 index 000000000..0099f09d1 --- /dev/null +++ b/xc/extras/freetype2/builds/unix/ft2unix.h @@ -0,0 +1,59 @@ +/***************************************************************************/ +/* */ +/* ft2build.h */ +/* */ +/* Build macros of the FreeType 2 library. */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This is a Unix-specific version of <ft2build.h> that should be used */ + /* exclusively *after* installation of the library. */ + /* */ + /* it assumes that "/usr/local/include/freetype2", or wathever is */ + /* returned by the "freetype-config --cflags" command is in your */ + /* compilation include path.. */ + /* */ + /* We don't need to do anything special in this release. However, for */ + /* FreeType 2.1, the following installation changes will be performed: */ + /* */ + /* - the content of "freetype-2.1/include/freetype" will be */ + /* installed to "/usr/local/include/freetype2" instead of */ + /* "/usr/local/include/freetype2/freetype" */ + /* */ + /* - this file will #include <freetype2/config/ftheader.h>, instead */ + /* of <freetype/config/ftheader.h> */ + /* */ + /* - the content of "ftheader.h" will be processed through sed to */ + /* replace all "<freetype/xxx>" with "<freetype2/xxxx>" */ + /* */ + /* - adding "/usr/local/include/freetype2" to your compilation */ + /* include path will not be necessary anymore. The command */ + /* "freetype-config --cflags" will return an empty string */ + /* */ + /* - client applications who adhere to the new inclusion scheme */ + /* WILL NOT NEED TO BE MODIFIED to compile with FT 2.1 !! */ + /* */ + /*************************************************************************/ + +#ifndef __FT2_BUILD_UNIX_H__ +#define __FT2_BUILD_UNIX_H__ + +/* "/usr/local/include/freetype2" must be in your current inclusion path */ +#include <freetype/config/ftheader.h> + +#endif /* __FT2_BUILD_UNIX_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/builds/unix/ftconfig.in b/xc/extras/freetype2/builds/unix/ftconfig.in index 5071eefaa..02db171c8 100644 --- a/xc/extras/freetype2/builds/unix/ftconfig.in +++ b/xc/extras/freetype2/builds/unix/ftconfig.in @@ -37,13 +37,7 @@ #ifndef __FTCONFIG_H__ #define __FTCONFIG_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif - - - /* Include the header file containing all developer build options */ -#include FT_BUILD_H +#include <ft2build.h> #include FT_CONFIG_OPTIONS_H @@ -126,7 +120,6 @@ FT_BEGIN_HEADER #else - /*************************************************************************/ /* */ /* Many compilers provide the non-ANSI `long long' 64-bit type. You can */ @@ -240,15 +233,15 @@ FT_BEGIN_HEADER /* */ #ifdef __cplusplus -#define FT_CALLBACK_DEF extern "C" -#define FT_CALLBACK_TABLE extern "C" -#define FT_CALLBACK_TABLE_DEF extern "C" +#define FT_CALLBACK_DEF extern "C" +#define FT_CALLBACK_TABLE extern "C" +#define FT_CALLBACK_TABLE_DEF extern "C" #else -#define FT_CALLBACK_DEF static -#define FT_CALLBACK_TABLE extern -#define FT_CALLBACK_TABLE_DEF +#define FT_CALLBACK_DEF static +#define FT_CALLBACK_TABLE extern +#define FT_CALLBACK_TABLE_DEF /* nothing */ #endif /* __cplusplus */ diff --git a/xc/extras/freetype2/builds/unix/ftsystem.c b/xc/extras/freetype2/builds/unix/ftsystem.c index f365c95e4..da36b2b2f 100644 --- a/xc/extras/freetype2/builds/unix/ftsystem.c +++ b/xc/extras/freetype2/builds/unix/ftsystem.c @@ -16,17 +16,14 @@ /***************************************************************************/ +#include <ft2build.h> +/* we use our special ftconfig.h file, not the standard one */ #include <ftconfig.h> -#include <freetype/internal/ftdebug.h> -#include <freetype/ftsystem.h> -#include <freetype/fterrors.h> -#include <freetype/fttypes.h> -#include <freetype/internal/ftobjs.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - +#include FT_INTERNAL_DEBUG_H +#include FT_SYSTEM_H +#include FT_ERRORS_H +#include FT_TYPES_H +#include FT_INTERNAL_OBJECTS_H /* memory-mapping includes and definitions */ #ifdef HAVE_UNISTD_H @@ -59,6 +56,7 @@ #endif /* NEED_DECLARATION_MUNMAP */ +#include <sys/types.h> #include <sys/stat.h> #ifdef HAVE_FCNTL_H @@ -87,10 +85,11 @@ /* */ /* <Input> */ /* memory :: A pointer to the memory object. */ + /* */ /* size :: The requested size in bytes. */ /* */ /* <Return> */ - /* block :: The address of newly allocated block. */ + /* The address of newly allocated block. */ /* */ FT_CALLBACK_DEF void* ft_alloc( FT_Memory memory, @@ -201,23 +200,8 @@ } - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_New_Stream */ - /* */ - /* <Description> */ - /* Creates a new stream object. */ - /* */ - /* <Input> */ - /* filepathname :: The name of the stream (usually a file) to be */ - /* opened. */ - /* */ - /* stream :: A pointer to the stream object. */ - /* */ - /* <Return> */ - /* FreeType error code. 0 means success. */ - /* */ + /* documentation is in ftobjs.h */ + FT_EXPORT_DEF( FT_Error ) FT_New_Stream( const char* filepathname, FT_Stream stream ) { @@ -285,17 +269,8 @@ } - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_New_Memory */ - /* */ - /* <Description> */ - /* Creates a new memory object. */ - /* */ - /* <Return> */ - /* A pointer to the new memory object. 0 in case of error. */ - /* */ + /* documentation is in ftobjs.h */ + FT_EXPORT_DEF( FT_Memory ) FT_New_Memory( void ) { FT_Memory memory; @@ -314,20 +289,11 @@ } - /*************************************************************************/ - /* */ - /* <Function> */ - /* FT_Done_Memory */ - /* */ - /* <Description> */ - /* Discards memory manager. */ - /* */ - /* <Input> */ - /* memory :: A handle to the memory manager. */ - /* */ + /* documentation is in ftobjs.h */ + FT_EXPORT_DEF( void ) FT_Done_Memory( FT_Memory memory ) { - free( memory ); + memory->free( memory, memory ); } diff --git a/xc/extras/freetype2/builds/unix/install.mk b/xc/extras/freetype2/builds/unix/install.mk index 0b0707261..c38f88e24 100644 --- a/xc/extras/freetype2/builds/unix/install.mk +++ b/xc/extras/freetype2/builds/unix/install.mk @@ -13,6 +13,8 @@ # fully. +.PHONY: install uninstall + # Unix installation and deinstallation targets. install: $(PROJECT_LIBRARY) $(MKINSTALLDIRS) $(libdir) \ @@ -33,6 +35,7 @@ install: $(PROJECT_LIBRARY) -for P in $(CACHE_H) ; do \ $(INSTALL_DATA) $$P $(includedir)/freetype2/freetype/cache ; \ done + $(INSTALL_DATA) $(BUILD)/ft2unix.h $(includedir)/ft2build.h $(INSTALL_SCRIPT) -m 755 $(BUILD)/freetype-config \ $(bindir)/freetype-config @@ -48,9 +51,12 @@ uninstall: -$(DELETE) $(includedir)/freetype2/freetype/* -$(DELDIR) $(includedir)/freetype2/freetype -$(DELDIR) $(includedir)/freetype2 + -$(DELETE) $(includedir)/ft2build.h -$(DELETE) $(bindir)/freetype-config +.PHONY: clean_project_unix distclean_project_unix + # Unix cleaning and distclean rules. # clean_project_unix: diff --git a/xc/extras/freetype2/builds/unix/unix-def.in b/xc/extras/freetype2/builds/unix/unix-def.in index 1c1ce714a..f7781bc50 100644 --- a/xc/extras/freetype2/builds/unix/unix-def.in +++ b/xc/extras/freetype2/builds/unix/unix-def.in @@ -66,7 +66,7 @@ version_info := @version_info@ # make -f $TOP/Makefile # ifndef OBJ_DIR - OBJ_DIR := $(shell cd $(TOP)/obj; pwd) + OBJ_DIR := $(shell cd $(TOP)/objs; pwd) endif diff --git a/xc/extras/freetype2/builds/unix/unix-dev.mk b/xc/extras/freetype2/builds/unix/unix-dev.mk index 1dcd9ee79..7d5d45963 100644 --- a/xc/extras/freetype2/builds/unix/unix-dev.mk +++ b/xc/extras/freetype2/builds/unix/unix-dev.mk @@ -17,6 +17,8 @@ include $(TOP)/builds/unix/unixddef.mk +BUILD := $(TOP)/builds/devel + include $(TOP)/builds/compiler/gcc-dev.mk include $(TOP)/builds/link_std.mk diff --git a/xc/extras/freetype2/builds/unix/unix.mk b/xc/extras/freetype2/builds/unix/unix.mk index 027f3c96b..5488d7baa 100644 --- a/xc/extras/freetype2/builds/unix/unix.mk +++ b/xc/extras/freetype2/builds/unix/unix.mk @@ -18,6 +18,8 @@ include $(TOP)/builds/unix/unix-cc.mk ifdef BUILD_PROJECT + .PHONY: clean_project distclean_project + # Now include the main sub-makefile. It contains all the rules used to # build the library with the previous variables defined. # diff --git a/xc/extras/freetype2/builds/unix/unixddef.mk b/xc/extras/freetype2/builds/unix/unixddef.mk index 0ddc6c561..b593db5d2 100644 --- a/xc/extras/freetype2/builds/unix/unixddef.mk +++ b/xc/extras/freetype2/builds/unix/unixddef.mk @@ -22,8 +22,10 @@ TOP := $(shell cd $(TOP); pwd) DELETE := rm -f SEP := / HOSTSEP := $(SEP) + # we use a special devel ftoption.h -BUILD := $(TOP)/builds/unix/devel +BUILD := $(TOP)/builds/devel + # do not set the platform to `unix', or libtool will trick you PLATFORM := unixdev @@ -31,7 +33,7 @@ PLATFORM := unixdev # The directory where all object files are placed. # ifndef OBJ_DIR - OBJ_DIR := $(shell cd $(TOP)/obj; pwd) + OBJ_DIR := $(shell cd $(TOP)/objs; pwd) endif diff --git a/xc/extras/freetype2/builds/vms/descrip.mms b/xc/extras/freetype2/builds/vms/descrip.mms new file mode 100644 index 000000000..730c1ce54 --- /dev/null +++ b/xc/extras/freetype2/builds/vms/descrip.mms @@ -0,0 +1,25 @@ +# +# FreeType 2 system rules for VMS +# + + +# Copyright 2001 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([],[--.include],[--.src.base]) + +OBJS=ftsystem.obj + +all : $(OBJS) + library/create [--.lib]freetype.olb $(OBJS) + +ftsystem.obj : ftsystem.c ftconfig.h + +# EOF diff --git a/xc/extras/freetype2/builds/vms/ftconfig.h b/xc/extras/freetype2/builds/vms/ftconfig.h new file mode 100644 index 000000000..6183bd726 --- /dev/null +++ b/xc/extras/freetype2/builds/vms/ftconfig.h @@ -0,0 +1,238 @@ +/***************************************************************************/ +/* */ +/* ftconfig.h */ +/* */ +/* VMS-specific configuration file (specification only). */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This header file contains a number of macro definitions that are used */ + /* by the rest of the engine. Most of the macros here are automatically */ + /* determined at compile time, and you should not need to change it to */ + /* port FreeType, except to compile the library with a non-ANSI */ + /* compiler. */ + /* */ + /* Note however that if some specific modifications are needed, we */ + /* advise you to place a modified copy in your build directory. */ + /* */ + /* The build directory is usually `freetype/builds/<system>', and */ + /* contains system-specific files that are always included first when */ + /* building the library. */ + /* */ + /*************************************************************************/ + + +#ifndef FTCONFIG_H +#define FTCONFIG_H + + + /* Include the header file containing all developer build options */ +#include <ft2build.h> +#include FT_CONFIG_OPTIONS_H + +FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* PLATFORM-SPECIFIC CONFIGURATION MACROS */ + /* */ + /* These macros can be toggled to suit a specific system. The current */ + /* ones are defaults used to compile FreeType in an ANSI C environment */ + /* (16bit compilers are also supported). Copy this file to your own */ + /* `freetype/builds/<system>' directory, and edit it to port the engine. */ + /* */ + /*************************************************************************/ + + +#define HAVE_UNISTD_H 1 +#define HAVE_FCNTL_H 1 + +#define SIZEOF_INT 4 +#define SIZEOF_LONG 4 + + +#define FT_SIZEOF_INT 4 +#define FT_SIZEOF_LONG 4 + + + /* Preferred alignment of data */ +#define FT_ALIGNMENT 8 + + + /* UNUSED is a macro used to indicate that a given parameter is not used */ + /* -- this is only used to get rid of unpleasant compiler warnings */ +#ifndef FT_UNUSED +#define FT_UNUSED( arg ) ( (arg) = (arg) ) +#endif + + + /*************************************************************************/ + /* */ + /* AUTOMATIC CONFIGURATION MACROS */ + /* */ + /* These macros are computed from the ones defined above. Don't touch */ + /* their definition, unless you know precisely what you are doing. No */ + /* porter should need to mess with them. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* IntN types */ + /* */ + /* Used to guarantee the size of some specific integers. */ + /* */ + typedef signed short FT_Int16; + typedef unsigned short FT_UInt16; + +#if FT_SIZEOF_INT == 4 + + typedef signed int FT_Int32; + typedef unsigned int FT_UInt32; + +#elif FT_SIZEOF_LONG == 4 + + typedef signed long FT_Int32; + typedef unsigned long FT_UInt32; + +#else +#error "no 32bit type found -- please check your configuration files" +#endif + +#if FT_SIZEOF_LONG == 8 + + /* FT_LONG64 must be defined if a 64-bit type is available */ +#define FT_LONG64 +#define FT_INT64 long + +#else + + + /*************************************************************************/ + /* */ + /* Many compilers provide the non-ANSI `long long' 64-bit type. You can */ + /* activate it by defining the FTCALC_USE_LONG_LONG macro in */ + /* `ftoption.h'. */ + /* */ + /* Note that this will produce many -ansi warnings during library */ + /* compilation, and that in many cases, the generated code will be */ + /* neither smaller nor faster! */ + /* */ +#ifdef FTCALC_USE_LONG_LONG + +#define FT_LONG64 +#define FT_INT64 long long + +#endif /* FTCALC_USE_LONG_LONG */ +#endif /* FT_SIZEOF_LONG == 8 */ + + +#ifdef FT_MAKE_OPTION_SINGLE_OBJECT + +#define LOCAL_DEF static +#define LOCAL_FUNC static + +#else + +#ifdef __cplusplus +#define LOCAL_DEF extern "C" +#define LOCAL_FUNC extern "C" +#else +#define LOCAL_DEF extern +#define LOCAL_FUNC extern +#endif + +#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */ + +#ifndef FT_BASE + +#ifdef __cplusplus +#define FT_BASE( x ) extern "C" x +#else +#define FT_BASE( x ) extern x +#endif + +#endif /* !FT_BASE */ + +#ifndef BASE_DEF + +#ifdef __cplusplus +#define BASE_DEF( x ) extern "C" x +#else +#define BASE_DEF( x ) extern x +#endif + +#endif /* !BASE_DEF */ + + +#ifndef FT_EXPORT + +#ifdef __cplusplus +#define FT_EXPORT( x ) extern "C" x +#else +#define FT_EXPORT( x ) extern x +#endif + +#endif /* !FT_EXPORT */ + +#ifndef FT_EXPORT_DEF + +#ifdef __cplusplus +#define FT_EXPORT_DEF( x ) extern "C" x +#else +#define FT_EXPORT_DEF( x ) extern x +#endif + +#endif /* !FT_EXPORT_DEF */ + + +#ifndef FT_EXPORT_VAR + +#ifdef __cplusplus +#define FT_EXPORT_VAR( x ) extern "C" x +#else +#define FT_EXPORT_VAR( x ) extern x +#endif + +#endif /* !FT_EXPORT_VAR */ + + + /* This is special. Within C++, you must specify `extern "C"' for */ + /* functions which are used via function pointers, and you also */ + /* must do that for structures which contain function pointers to */ + /* assure C linkage -- it's not possible to have (local) anonymous */ + /* functions which are accessed by (global) function pointers. */ + /* */ +#ifdef __cplusplus + +#define FT_CALLBACK_DEF extern "C" +#define FT_CALLBACK_TABLE extern "C" +#define FT_CALLBACK_TABLE_DEF extern "C" + +#else + +#define FT_CALLBACK_DEF static +#define FT_CALLBACK_TABLE extern +#define FT_CALLBACK_TABLE_DEF + +#endif /* __cplusplus */ + +FT_END_HEADER + +#endif /* FTCONFIG_H */ + + +/* END */ diff --git a/xc/extras/freetype2/builds/vms/ftsystem.c b/xc/extras/freetype2/builds/vms/ftsystem.c new file mode 100644 index 000000000..da36b2b2f --- /dev/null +++ b/xc/extras/freetype2/builds/vms/ftsystem.c @@ -0,0 +1,300 @@ +/***************************************************************************/ +/* */ +/* ftsystem.c */ +/* */ +/* Unix-specific FreeType low-level system interface (body). */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include <ft2build.h> +/* we use our special ftconfig.h file, not the standard one */ +#include <ftconfig.h> +#include FT_INTERNAL_DEBUG_H +#include FT_SYSTEM_H +#include FT_ERRORS_H +#include FT_TYPES_H +#include FT_INTERNAL_OBJECTS_H + + /* memory-mapping includes and definitions */ +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + +#include <sys/mman.h> +#ifndef MAP_FILE +#define MAP_FILE 0x00 +#endif + +#ifdef MUNMAP_USES_VOIDP +#define MUNMAP_ARG_CAST void * +#else +#define MUNMAP_ARG_CAST char * +#endif + +#ifdef NEED_MUNMAP_DECL + +#ifdef __cplusplus + extern "C" +#else + extern +#endif + int munmap( char* addr, + int len ); + +#define MUNMAP_ARG_CAST char * + +#endif /* NEED_DECLARATION_MUNMAP */ + + +#include <sys/types.h> +#include <sys/stat.h> + +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + + + /*************************************************************************/ + /* */ + /* MEMORY MANAGEMENT INTERFACE */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* ft_alloc */ + /* */ + /* <Description> */ + /* The memory allocation function. */ + /* */ + /* <Input> */ + /* memory :: A pointer to the memory object. */ + /* */ + /* size :: The requested size in bytes. */ + /* */ + /* <Return> */ + /* The address of newly allocated block. */ + /* */ + FT_CALLBACK_DEF + void* ft_alloc( FT_Memory memory, + long size ) + { + FT_UNUSED( memory ); + + return malloc( size ); + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* ft_realloc */ + /* */ + /* <Description> */ + /* The memory reallocation function. */ + /* */ + /* <Input> */ + /* memory :: A pointer to the memory object. */ + /* */ + /* cur_size :: The current size of the allocated memory block. */ + /* */ + /* new_size :: The newly requested size in bytes. */ + /* */ + /* block :: The current address of the block in memory. */ + /* */ + /* <Return> */ + /* The address of the reallocated memory block. */ + /* */ + FT_CALLBACK_DEF + void* ft_realloc( FT_Memory memory, + long cur_size, + long new_size, + void* block ) + { + FT_UNUSED( memory ); + FT_UNUSED( cur_size ); + + return realloc( block, new_size ); + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* ft_free */ + /* */ + /* <Description> */ + /* The memory release function. */ + /* */ + /* <Input> */ + /* memory :: A pointer to the memory object. */ + /* */ + /* block :: The address of block in memory to be freed. */ + /* */ + FT_CALLBACK_DEF + void ft_free( FT_Memory memory, + void* block ) + { + FT_UNUSED( memory ); + + free( block ); + } + + + /*************************************************************************/ + /* */ + /* RESOURCE MANAGEMENT INTERFACE */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_io + + /* We use the macro STREAM_FILE for convenience to extract the */ + /* system-specific stream handle from a given FreeType stream object */ +#define STREAM_FILE( stream ) ( (FILE*)stream->descriptor.pointer ) + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* ft_close_stream */ + /* */ + /* <Description> */ + /* The function to close a stream. */ + /* */ + /* <Input> */ + /* stream :: A pointer to the stream object. */ + /* */ + FT_CALLBACK_DEF + void ft_close_stream( FT_Stream stream ) + { + munmap( (MUNMAP_ARG_CAST)stream->descriptor.pointer, stream->size ); + + stream->descriptor.pointer = NULL; + stream->size = 0; + stream->base = 0; + } + + + /* documentation is in ftobjs.h */ + + FT_EXPORT_DEF( FT_Error ) FT_New_Stream( const char* filepathname, + FT_Stream stream ) + { + int file; + struct stat stat_buf; + + + if ( !stream ) + return FT_Err_Invalid_Stream_Handle; + + /* open the file */ + file = open( filepathname, O_RDONLY ); + if ( file < 0 ) + { + FT_ERROR(( "FT_New_Stream:" )); + FT_ERROR(( " could not open `%s'\n", filepathname )); + return FT_Err_Cannot_Open_Resource; + } + + if ( fstat( file, &stat_buf ) < 0 ) + { + FT_ERROR(( "FT_New_Stream:" )); + FT_ERROR(( " could not `fstat' file `%s'\n", filepathname )); + goto Fail_Map; + } + + stream->size = stat_buf.st_size; + stream->pos = 0; + stream->base = (unsigned char *)mmap( NULL, + stream->size, + PROT_READ, + MAP_FILE | MAP_PRIVATE, + file, + 0 ); + + if ( (long)stream->base == -1 ) + { + FT_ERROR(( "FT_New_Stream:" )); + FT_ERROR(( " could not `mmap' file `%s'\n", filepathname )); + goto Fail_Map; + } + + close( file ); + + stream->descriptor.pointer = stream->base; + stream->pathname.pointer = (char*)filepathname; + + stream->close = ft_close_stream; + stream->read = 0; + + FT_TRACE1(( "FT_New_Stream:" )); + FT_TRACE1(( " opened `%s' (%d bytes) successfully\n", + filepathname, stream->size )); + + return FT_Err_Ok; + + Fail_Map: + close( file ); + + stream->base = NULL; + stream->size = 0; + stream->pos = 0; + + return FT_Err_Cannot_Open_Stream; + } + + + /* documentation is in ftobjs.h */ + + FT_EXPORT_DEF( FT_Memory ) FT_New_Memory( void ) + { + FT_Memory memory; + + + memory = (FT_Memory)malloc( sizeof ( *memory ) ); + if ( memory ) + { + memory->user = 0; + memory->alloc = ft_alloc; + memory->realloc = ft_realloc; + memory->free = ft_free; + } + + return memory; + } + + + /* documentation is in ftobjs.h */ + + FT_EXPORT_DEF( void ) FT_Done_Memory( FT_Memory memory ) + { + memory->free( memory, memory ); + } + + +/* END */ diff --git a/xc/extras/freetype2/builds/win32/detect.mk b/xc/extras/freetype2/builds/win32/detect.mk index 6e4624c3a..c28d67f96 100644 --- a/xc/extras/freetype2/builds/win32/detect.mk +++ b/xc/extras/freetype2/builds/win32/detect.mk @@ -13,6 +13,9 @@ # fully. +.PHONY: setup + + ifeq ($(PLATFORM),ansi) # Detecting Windows NT is easy, as the OS variable must be defined and @@ -21,11 +24,7 @@ ifeq ($(PLATFORM),ansi) # ifeq ($(OS),Windows_NT) - # Check if we are running on a CygWin system by checking the OSTYPE - # variable. - ifneq ($(OSTYPE),cygwin) - is_windows := 1 - endif + is_windows := 1 # We test for the COMSPEC environment variable, then run the `ver' # command-line program to see if its output contains the word `Windows'. @@ -33,79 +32,124 @@ ifeq ($(PLATFORM),ansi) # If this is true, we are running a win32 platform (or an emulation). # else - ifneq ($(OSTYPE),cygwin) - ifdef COMSPEC - is_windows := $(findstring Windows,$(strip $(shell ver))) - endif - endif # test CygWin + ifdef COMSPEC + is_windows := $(findstring Windows,$(strip $(shell ver))) + endif endif # test NT ifdef is_windows PLATFORM := win32 - DELETE := del - COPY := copy - - CONFIG_FILE := w32-gcc.mk # gcc Makefile by default - SEP := / - ifeq ($(firstword $(CC)),cc) - CC := gcc - endif - - # additionally, we provide hooks for various other compilers - # - ifneq ($(findstring visualc,$(MAKECMDGOALS)),) # Visual C/C++ - CONFIG_FILE := w32-vcc.mk - SEP := $(BACKSLASH) - CC := cl - visualc: setup - endif - - ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++ - CONFIG_FILE := w32-wat.mk - SEP := $(BACKSLASH) - CC := wcc386 - watcom: setup - endif - - ifneq ($(findstring visualage,$(MAKECMDGOALS)),) # Visual Age C++ - CONFIG_FILE := w32-icc.mk - SEP := $(BACKSLASH) - CC := icc - visualage: setup - endif - - ifneq ($(findstring lcc,$(MAKECMDGOALS)),) # LCC-Win32 - CONFIG_FILE := w32-lcc.mk - SEP := $(BACKSLASH) - CC := lcc - lcc: setup - endif - ifneq ($(findstring mingw32,$(MAKECMDGOALS)),) # mingw32 - CONFIG_FILE := w32-mingw32.mk - SEP := $(BACKSLASH) - CC := gcc - mingw32: setup - endif - - ifneq ($(findstring bcc32,$(MAKECMDGOALS)),) # Borland C++ - CONFIG_FILE := w32-bcc.mk - SEP := $(BACKSLASH) - CC := bcc32 - bcc32: setup - endif + endif +endif # test PLATFORM ansi + +ifeq ($(PLATFORM),win32) + + DELETE := del + COPY := copy + + # gcc Makefile by default + CONFIG_FILE := w32-gcc.mk + SEP := / + ifeq ($(firstword $(CC)),cc) + CC := gcc + endif + + ifneq ($(findstring list,$(MAKECMDGOALS)),) # test for the "list" target + dump_target_list: + @echo ÿ + @echo $(PROJECT_TITLE) build system -- supported compilers + @echo ÿ + @echo Several command-line compilers are supported on Win32: + @echo ÿ + @echo ÿÿmake setupÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿgcc (with Mingw) + @echo ÿÿmake setup visualcÿÿÿÿÿÿÿÿÿÿÿÿÿMicrosoft Visual C++ + @echo ÿÿmake setup bcc32ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿBorland C/C++ + @echo ÿÿmake setup lccÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿWin32-LCC + @echo ÿÿmake setup intelcÿÿÿÿÿÿÿÿÿÿÿÿÿÿIntel C/C++ + @echo ÿ + + setup: dump_target_list + .PHONY: dump_target_list list + else + setup: dos_setup + endif - ifneq ($(findstring devel,$(MAKECMDGOALS)),) # development target - CONFIG_FILE := w32-dev.mk - CC := gcc - SEP := / - devel: setup - endif + # additionally, we provide hooks for various other compilers + # + ifneq ($(findstring visualc,$(MAKECMDGOALS)),) # Visual C/C++ + CONFIG_FILE := w32-vcc.mk + SEP := $(BACKSLASH) + CC := cl + visualc: setup + .PHONY: visualc + endif + + ifneq ($(findstring intelc,$(MAKECMDGOALS)),) # Intel C/C++ + CONFIG_FILE := w32-intl.mk + SEP := $(BACKSLASH) + CC := cl + visualc: setup + .PHONY: intelc + endif + + ifneq ($(findstring watcom,$(MAKECMDGOALS)),) # Watcom C/C++ + CONFIG_FILE := w32-wat.mk + SEP := $(BACKSLASH) + CC := wcc386 + watcom: setup + .PHONY: watcom + endif + + ifneq ($(findstring visualage,$(MAKECMDGOALS)),) # Visual Age C++ + CONFIG_FILE := w32-icc.mk + SEP := $(BACKSLASH) + CC := icc + visualage: setup + .PHONY: visualage + endif + + ifneq ($(findstring lcc,$(MAKECMDGOALS)),) # LCC-Win32 + CONFIG_FILE := w32-lcc.mk + SEP := $(BACKSLASH) + CC := lcc + lcc: setup + .PHONY: lcc + endif + + ifneq ($(findstring mingw32,$(MAKECMDGOALS)),) # mingw32 + CONFIG_FILE := w32-mingw32.mk + SEP := $(BACKSLASH) + CC := gcc + mingw32: setup + .PHONY: mingw32 + endif + + ifneq ($(findstring bcc32,$(MAKECMDGOALS)),) # Borland C++ + CONFIG_FILE := w32-bcc.mk + SEP := $(BACKSLASH) + CC := bcc32 + bcc32: setup + .PHONY: bcc32 + endif + + ifneq ($(findstring devel-bcc,$(MAKECMDGOALS)),) # development target + CONFIG_FILE := w32-bccd.mk + CC := bcc32 + SEP := / + devel-bcc: setup + .PHONY: devel-bcc + endif - setup: dos_setup + ifneq ($(findstring devel-gcc,$(MAKECMDGOALS)),) # development target + CONFIG_FILE := w32-dev.mk + CC := gcc + SEP := / + devel-gcc: setup + .PHONY: devel-gcc + endif - endif # test is_windows -endif # test PLATFORM +endif # test PLATFORM win32 # EOF diff --git a/xc/extras/freetype2/builds/win32/w32-bccd.mk b/xc/extras/freetype2/builds/win32/w32-bccd.mk index 943f72ca2..3c56d5dcd 100644 --- a/xc/extras/freetype2/builds/win32/w32-bccd.mk +++ b/xc/extras/freetype2/builds/win32/w32-bccd.mk @@ -13,8 +13,11 @@ # fully. -SEP := / +SEP := / + include $(TOP)/builds/win32/win32-def.mk +BUILD := $(TOP)/builds/devel + include $(TOP)/builds/compiler/bcc-dev.mk # include linking instructions diff --git a/xc/extras/freetype2/builds/win32/w32-dev.mk b/xc/extras/freetype2/builds/win32/w32-dev.mk index 28146d889..42932d07a 100644 --- a/xc/extras/freetype2/builds/win32/w32-dev.mk +++ b/xc/extras/freetype2/builds/win32/w32-dev.mk @@ -24,12 +24,15 @@ ifndef TOP endif SEP := / -BUILD := $(TOP)/builds/win32/devel include $(TOP)/builds/win32/win32-def.mk +BUILD := $(TOP)/builds/devel + include $(TOP)/builds/compiler/gcc-dev.mk # include linking instructions include $(TOP)/builds/link_dos.mk + + # EOF diff --git a/xc/extras/freetype2/builds/win32/w32-intl.mk b/xc/extras/freetype2/builds/win32/w32-intl.mk new file mode 100644 index 000000000..6ae022fc6 --- /dev/null +++ b/xc/extras/freetype2/builds/win32/w32-intl.mk @@ -0,0 +1,23 @@ +# +# FreeType 2 configuration rules for Intel C/C++ on Win32 +# + + +# Copyright 1996-2000 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +SEP := / +include $(TOP)/builds/win32/win32-def.mk +include $(TOP)/builds/compiler/intelc.mk + +# include linking instructions +include $(TOP)/builds/link_dos.mk + +# EOF diff --git a/xc/extras/freetype2/builds/win32/w32-wat.mk b/xc/extras/freetype2/builds/win32/w32-wat.mk new file mode 100644 index 000000000..b5fed58dd --- /dev/null +++ b/xc/extras/freetype2/builds/win32/w32-wat.mk @@ -0,0 +1,26 @@ +# +# FreeType 2 configuration rules for Watcom C/C++ +# + + +# Copyright 1996-2000 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +SEP := / +ISEP := $(strip \ ) + +include $(TOP)/builds/win32/win32-def.mk +include $(TOP)/builds/compiler/watcom.mk + +# include linking instructions +include $(TOP)/builds/link_dos.mk + +# EOF + diff --git a/xc/extras/freetype2/builds/win32/win32-def.mk b/xc/extras/freetype2/builds/win32/win32-def.mk index eabd59fb3..590237cb1 100644 --- a/xc/extras/freetype2/builds/win32/win32-def.mk +++ b/xc/extras/freetype2/builds/win32/win32-def.mk @@ -36,7 +36,7 @@ endif # make -f %TOP%/Makefile # ifndef OBJ_DIR - OBJ_DIR := $(TOP)$(SEP)obj + OBJ_DIR := $(TOP)$(SEP)objs endif diff --git a/xc/extras/freetype2/descrip.mms b/xc/extras/freetype2/descrip.mms new file mode 100644 index 000000000..72aa291d2 --- /dev/null +++ b/xc/extras/freetype2/descrip.mms @@ -0,0 +1,65 @@ +# +# FreeType 2 build system -- top-level Makefile for VMS +# + + +# Copyright 2001 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +all : + define freetype [--.include.freetype] + define psaux [-.psaux] + define autohint [-.autohint] + define base [-.base] + define cache [-.cache] + define cff [-.cff] + define cid [-.cid] + define pcf [-.pcf] + define psnames [-.psnames] + define raster [-.raster] + define sfnt [-.sfnt] + define smooth [-.smooth] + define truetype [-.truetype] + define type1 [-.type1] + define winfonts [-.winfonts] + if f$search("lib.dir") .eqs. "" then create/directory [.lib] + set default [.builds.vms] + $(MMS)$(MMSQUALIFIERS) + set default [--.src.autohint] + $(MMS)$(MMSQUALIFIERS) + set default [-.base] + $(MMS)$(MMSQUALIFIERS) + set default [-.cache] + $(MMS)$(MMSQUALIFIERS) + set default [-.cff] + $(MMS)$(MMSQUALIFIERS) + set default [-.cid] + $(MMS)$(MMSQUALIFIERS) + set default [-.pcf] + $(MMS)$(MMSQUALIFIERS) + set default [-.psaux] + $(MMS)$(MMSQUALIFIERS) + set default [-.psnames] + $(MMS)$(MMSQUALIFIERS) + set default [-.raster] + $(MMS)$(MMSQUALIFIERS) + set default [-.sfnt] + $(MMS)$(MMSQUALIFIERS) + set default [-.smooth] + $(MMS)$(MMSQUALIFIERS) + set default [-.truetype] + $(MMS)$(MMSQUALIFIERS) + set default [-.type1] + $(MMS)$(MMSQUALIFIERS) + set default [-.winfonts] + $(MMS)$(MMSQUALIFIERS) + set default [--] + +# EOF diff --git a/xc/extras/freetype2/docs/BUILD b/xc/extras/freetype2/docs/BUILD index 86b292157..7bf70bf1e 100644 --- a/xc/extras/freetype2/docs/BUILD +++ b/xc/extras/freetype2/docs/BUILD @@ -13,8 +13,11 @@ instructions on how to compile the library on your favorite platform. I. QUICK COMMAND-LINE GUIDE --------------------------- - Install GNU Make, then try the following on Unix or any system with - gcc: + THE FOLLOWING WILL ONLY WORK WITH GNU MAKE, IT WILL FAIL MISERABLY + WITH OTHER MAKE TOOLS, FOR EXAMPLE "BSD MAKE". + + Install GNU Make (version 3.78.1 or newer), then try the following + on Unix or any system with gcc: make // this will setup the build make // this will build the library @@ -59,6 +62,9 @@ II. COMMAND-LINE COMPILATION Make -- trying to build the library with any other Make tool will *fail*. + NEARLY ALL OTHER MAKE TOOLS WILL FAIL, INCLUDING "BSD MAKE", SO + REALLY INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM! + Make sure that you are invoking GNU Make from the command line, by typing something like: @@ -66,6 +72,8 @@ II. COMMAND-LINE COMPILATION to display its version number. + VERSION 3.78.1 OR NEWER IS NEEDED! + b. Invoke `make' Go to the root directory of FreeType 2, then simply invoke GNU @@ -175,12 +183,12 @@ III. DETAILED COMPILATION PROCEDURE However, you can create a single object file by compiling the file `src/base/ftbase.c', which basically contains - #include <base/ftcalc.c> - #include <base/ftobjs.c> - #include <base/ftstream.c> - #include <base/ftlist.c> - #include <base/ftoutln.c> - #include <base/ftextend.c> + #include "ftcalc.c" + #include "ftobjs.c" + #include "ftstream.c" + #include "ftlist.c" + #include "ftoutln.c" + #include "ftextend.c" Similarly, each component has a single `englobing' C file to compile it as a stand-alone object: @@ -200,7 +208,7 @@ III. DETAILED COMPILATION PROCEDURE src/truetype/truetype.c - the TrueType font driver src/type1/type1.c - the Type 1 font driver - The last module of FreeType 2, winfonts (implementing support for + The last module of FreeType 2, `winfonts' (implementing support for Windows FNT format), is a single file. To compile one component, do the following: @@ -208,21 +216,23 @@ III. DETAILED COMPILATION PROCEDURE - Add the top-level `include' directory to your compilation include path - - Add the `src' directory to your compilation include path. + - Add the `src/<component>' directory to your compilation include + path, or simply `cd' to the component's source directory. - Compile the component `source' file (see list below); you don't - need to be in the component's directory. + need to be in the component's directory if you added + `src/<component>' to your include path. For example, the following line can be used to compile the truetype driver on Unix: cd freetype2/ - cc -c -Iinclude -Isrc src/truetype/truetype.c + cc -c -Iinclude -Isrc/truetype src/truetype/truetype.c Alternatively: cd freetype2/src/truetype - cc -c -I../../include -I.. truetype.c + cc -c -I../../include truetype.c Finally, FreeType 2 contains some other components: @@ -242,13 +252,9 @@ III. DETAILED COMPILATION PROCEDURE IV. Support for flat-directory compilation ------------------------------------------ - It is now possible to put all FreeType 2 source files into a single + It is possible to put all FreeType 2 source files into a single directory, with the exception of the `include' hierarchy. - Note that you still need to only compile the `wrapper' sources - described above. Define the `FT_FLAT_COMPILE' macro when - compiling. Here an example: - 1. Copy all files in current directory: cp freetype2/src/base/*.[hc] . @@ -258,11 +264,13 @@ IV. Support for flat-directory compilation 2. Compile sources: - cc -c -DFT_FLAT_COMPILE -Ifreetype2/include ftsystem.c - cc -c -DFT_FLAT_COMPILE -Ifreetype2/include ftinit.c - cc -c -DFT_FLAT_COMPILE -Ifreetype2/include ftdebug.c - cc -c -DFT_FLAT_COMPILE -Ifreetype2/include ftbase.c + cc -c -Ifreetype2/include ftsystem.c + cc -c -Ifreetype2/include ftinit.c + cc -c -Ifreetype2/include ftdebug.c + cc -c -Ifreetype2/include ftbase.c etc. + You don't need to define the FT_FLAT_COMPILATION macro (as this was + required in previous releases of FreeType 2). End of file diff --git a/xc/extras/freetype2/docs/docmaker.py b/xc/extras/freetype2/docs/docmaker.py index 85b17f20d..067e162b4 100755 --- a/xc/extras/freetype2/docs/docmaker.py +++ b/xc/extras/freetype2/docs/docmaker.py @@ -8,9 +8,9 @@ # - David # -import fileinput, sys, string +import fileinput, sys, string, glob -html_header = """ +html_header = """\ <html> <header> <title>FreeType 2 API Reference</title> @@ -18,42 +18,93 @@ html_header = """ <style content="text/css"> P { text-align=justify } H1 { text-align=center } - H2 { text-align=center } LI { text-align=justify } </style> </header> -<body text="#000000" - bgcolor="#FFFFFF" - link="#0000EF" - vlink="#51188E" - alink="#FF0000"> +<body text=#000000 + bgcolor=#FFFFFF + link=#0000EF + vlink=#51188E + alink=#FF0000> <center><h1>FreeType 2 API Reference</h1></center> """ -html_footer = """ +html_footer = """\ </body> -</html> -""" +</html>""" -code_header = """ -<font color=blue><pre> -""" +section_title_header = "<center><h1>" +section_title_footer = "</h1></center>" -code_footer = """ -</pre></font> -""" +code_header = "<font color=blue><pre>" +code_footer = "</pre></font>" para_header = "<p>" para_footer = "</p>" -block_header = """<center><hr width="550"><table width="550"><tr><td>""" -block_footer = "</table></center>" +block_header = "<center><table width=75%><tr><td>" +block_footer = "</td></tr></table><hr width=75%></center>" + +description_header = "<center><table width=87%><tr><td>" +description_footer = "</td></tr></table></center><br>" + +marker_header = "<center><table width=87% cellpadding=5><tr bgcolor=#EEEEFF><td><em><b>" +marker_inter = "</b></em></td></tr><tr><td>" +marker_footer = "</td></tr></table></center>" + +source_header = "<center><table width=87%><tr bgcolor=#D6E8FF width=100%><td><pre>" +source_footer = "</pre></table></center><br>" + +chapter_header = "<center><table width=75%><tr><td><h2>" +chapter_inter = "</h2><ul>" +chapter_footer = "</ul></td></tr></table></center>" + +current_section = None + + +# This function is used to sort the index. It's a simple lexicographical +# sort, except that it places capital letters before small ones. +# +def index_sort( s1, s2 ): + if not s1: + return -1 + + if not s2: + return 1 + + l1 = len( s1 ) + l2 = len( s2 ) + m1 = string.lower( s1 ) + m2 = string.lower( s2 ) + + for i in range( l1 ): + if i >= l2 or m1[i] > m2[i]: + return 1 + + if m1[i] < m2[i]: + return -1 + + if s1[i] < s2[i]: + return -1 + + if s1[i] > s2[i]: + return 1 + + if l2 > l1: + return -1 + + return 0 + + +# sort input_list, placing the elements of order_list in front +# +def sort_order_list( input_list, order_list ): + new_list = order_list[:] + for id in input_list: + if not id in order_list: + new_list.append( id ) + return new_list -source_header = """<center><table width="550"><tr bgcolor="#D6E8FF" width="100%"><td><pre> -""" -source_footer = """</pre></table></center> -<br><br> -""" # The FreeType 2 reference is extracted from the source files. These contain # various comment blocks that follow one of the following formats: @@ -84,7 +135,7 @@ source_footer = """</pre></table></center> # /* */ # /**************************/ # -# Each block contains a list of markers, each one can be followed by +# Each block contains a list of markers; each one can be followed by # some arbitrary text or a list of fields. Here's an example: # # <Struct> @@ -98,18 +149,18 @@ source_footer = """</pre></table></center> # y :: vertical coordinate # # -# This example defines three markers: 'Struct', 'Description' & 'Fields' +# This example defines three markers: 'Struct', 'Description' & 'Fields'. # The first two markers contain arbitrary text, while the last one contains -# a list of field +# a list of fields. # -# each field is simple of the format: WORD :: TEXT.... +# Each field is simple of the format: WORD :: TEXT... # -# Note that typically, each comment block is followed by some source -# code declaration that may need to be kept in the reference.. +# Note that typically each comment block is followed by some source +# code declaration that may need to be kept in the reference. # # Note that markers can alternatively be written as "@MARKER:" -# instead of "<MAKRER>". All marker identifiers are converted to -# lower case during parsing, in order to simply sorting.. +# instead of "<MARKER>". All marker identifiers are converted to +# lower case during parsing in order to simply sorting. # # We associate with each block the following source lines that do not # begin with a comment. For example, the following: @@ -129,7 +180,7 @@ source_footer = """</pre></table></center> # # # will only keep the first two lines of sources with -# the "blabla" block +# the "blabla" block. # # However, the comment will be kept, with following source lines # if it contains a starting '#' or '@' as in: @@ -142,16 +193,16 @@ source_footer = """</pre></table></center> -############################################################################## +############################################################################# # # The DocCode class is used to store source code lines # -# self.lines contains a set of source code lines that will +# 'self.lines' contains a set of source code lines that will # be dumped as HTML in a <PRE> tag. # -# the object is filled line by line by the parser, it strips the +# The object is filled line by line by the parser; it strips the # leading "margin" space from each input line before storing it -# in self.lines +# in 'self.lines'. # class DocCode: @@ -159,8 +210,10 @@ class DocCode: self.lines = [] self.margin = margin + def add( self, line ): # remove margin whitespace + # if string.strip( line[: self.margin] ) == "": line = line[self.margin :] self.lines.append( line ) @@ -171,118 +224,180 @@ class DocCode: print "--" + line print "" + def get_identifier( self ): # this function should never be called - return "UNKNOWN_CODE_IDENTIFIER!!" + # + return "UNKNOWN_CODE_IDENTIFIER!" - def dump_html( self ): + def dump_html( self, identifiers = None ): # clean the last empty lines + # l = len( self.lines ) - 1 while l > 0 and string.strip( self.lines[l - 1] ) == "": l = l - 1 - print code_header - for line in self.lines[0 : l]: - print line - print code_footer + # the code footer should be directly appended to the last code + # line to avoid an additional blank line + # + sys.stdout.write( code_header ) + for line in self.lines[0 : l+1]: + sys.stdout.write( '\n' + line ) + sys.stdout.write( code_footer ) -############################################################################## + +############################################################################# # -# The DocParagraph is used to store text paragraphs -# self.words is simply a list of words for the paragraph +# The DocParagraph is used to store text paragraphs. +# 'self.words' is simply a list of words for the paragraph. # -# the paragraph is filled line by line by the parser.. +# The paragraph is filled line by line by the parser. # class DocParagraph: def __init__( self ): self.words = [] + def add( self, line ): - # get rid of unwanted spaces in the paragraph + # Get rid of unwanted spaces in the paragraph. # - # the following line is the same as + # The following two lines are the same as # # self.words.extend( string.split( line ) ) # - # but older Python versions don't have the `extend' attribute + # but older Python versions don't have the `extend' attribute. # - last = len(self.words) - self.words[last:last] = string.split( line ) + last = len( self.words ) + self.words[last : last] = string.split( line ) + - # this function is used to retrieve the first word of a given - # paragraph.. + # This function is used to retrieve the first word of a given + # paragraph. + # def get_identifier( self ): if self.words: return self.words[0] # should never happen - return "UNKNOWN_PARA_IDENTIFIER!!" + # + return "UNKNOWN_PARA_IDENTIFIER!" - def dump( self ): + def get_words( self ): + return self.words[:] + + def dump( self, identifiers = None ): max_width = 50 cursor = 0 line = "" + extra = None + alphanum = string.lowercase + string.uppercase + string.digits + '_' for word in self.words: + # process cross references if needed + # + if identifiers and word and word[0] == '@': + word = word[1 :] + + # we need to find non-alphanumeric characters + # + i = len( word ) + while i > 0 and not word[i - 1] in alphanum: + i = i - 1 + + if i > 0: + extra = word[i :] + word = word[0 : i] + + block = identifiers.get( word ) + if block: + word = '<a href="' + block.html_address() + '">' + word + '</a>' + else: + word = '?' + word if cursor + len( word ) + 1 > max_width: print line cursor = 0 line = "" - line = line + word + " " + line = line + word + if not extra: + line = line + " " + cursor = cursor + len( word ) + 1 + # handle trailing periods, commas, etc. at the end of + # cross references. + # + if extra: + if cursor + len( extra ) + 1 > max_width: + print line + cursor = 0 + line = "" + + line = line + extra + " " + cursor = cursor + len( extra ) + 1 + extra = None + if cursor > 0: print line - #print "§" #for debugging only + # print "§" # for debugging only + + + def dump_string( self ): + s = "" + space = "" + for word in self.words: + s = s + space + word + space = " " + return s - def dump_html( self ): + def dump_html( self, identifiers = None ): print para_header - self.dump() + self.dump( identifiers ) print para_footer -########################################################################### + +############################################################################# # # DocContent is used to store the content of a given marker. # -# the "self.items" list contains (field,elements) record, where +# The "self.items" list contains (field,elements) records, where # "field" corresponds to a given structure fields or function # parameter (indicated by a "::"), or NULL for a normal section -# of text/code +# of text/code. # -# hence, the following example: +# Hence, the following example: # # <MyMarker> -# this is an example of what can be put in a content section, +# This is an example of what can be put in a content section, # -# a second line of example text +# A second line of example text. # -# x :: a simple test field, with some content -# y :: even before, this field has some code content +# x :: A simple test field, with some contents. +# y :: Even before, this field has some code contents. # { # y = x+2; # } # # should be stored as +# # [ ( None, [ DocParagraph, DocParagraph] ), # ( "x", [ DocParagraph ] ), # ( "y", [ DocParagraph, DocCode ] ) ] # -# in self.items -# -# the DocContent object is entirely built at creation time, you must -# pass a list of input text lines lin the "lines_list" parameter.. +# in 'self.items'. # +# The DocContent object is entirely built at creation time; you must +# pass a list of input text lines in the "lines_list" parameter. # class DocContent: @@ -300,7 +415,6 @@ class DocContent: field = None # the current field for aline in lines_list: - if code_mode == 0: line = string.lstrip( aline ) l = len( line ) @@ -308,8 +422,8 @@ class DocContent: # if the line is empty, this is the end of the current # paragraph + # if l == 0 or line == '{': - if paragraph: elements.append( paragraph ) paragraph = None @@ -328,21 +442,24 @@ class DocContent: # the token `::' # if len( words ) >= 2 and words[1] == "::": - # start a new field - complete current paragraph if any + # if paragraph: elements.append( paragraph ) paragraph = None # append previous "field" to self.items + # self.items.append( ( field, elements ) ) # start new field and elements list + # field = words[0] elements = [] words = words[2 :] # append remaining words to current paragraph + # if len( words ) > 0: line = string.join( words ) if not paragraph: @@ -350,14 +467,15 @@ class DocContent: paragraph.add( line ) else: - # we're in code mode.. + # we are in code mode... + # line = aline - # the code block ends with a line that has a single '}' on it - # that is located at the same column that the opening - # accolade.. + # the code block ends with a line that has a single '}' on + # it that is located at the same column that the opening + # accolade... + # if line == " " * code_margin + '}': - if code: elements.append( code ) code = None @@ -366,6 +484,7 @@ class DocContent: code_margin = 0 # otherwise, add the line to the current paragraph + # else: if not code: code = DocCode() @@ -387,7 +506,19 @@ class DocContent: return element.get_identifier() # should never happen - return "UNKNOWN_CONTENT_IDENTIFIER!!" + # + return "UNKNOWN_CONTENT_IDENTIFIER!" + + + def get_title( self ): + if self.items: + item = self.items[0] + for element in item[1]: + return element.dump_string() + + # should never happen + # + return "UNKNOWN_CONTENT_TITLE!" def dump( self ): @@ -400,10 +531,10 @@ class DocContent: element.dump() if field: - print "</field> " + print "</field>" - def dump_html( self ): + def dump_html( self, identifiers = None ): n = len( self.items ) in_table = 0 @@ -412,13 +543,13 @@ class DocContent: field = item[0] if not field: - if in_table: print "</td></tr></table>" in_table = 0 for element in item[1]: - element.dump_html() + element.dump_html( identifiers ) + else: if not in_table: print "<table cellpadding=4><tr valign=top><td>" @@ -429,36 +560,71 @@ class DocContent: print "<b>" + field + "</b></td><td>" for element in item[1]: - element.dump_html() + element.dump_html( identifiers ) if in_table: print "</td></tr></table>" -###################################################################################### + def dump_html_in_table( self, identifiers = None ): + n = len( self.items ) + in_table = 0 + + for i in range( n ): + item = self.items[i] + field = item[0] + + if not field: + if item[1]: + print "<tr><td colspan=2>" + for element in item[1]: + element.dump_html( identifiers ) + print "</td></tr>" + + else: + print "<tr><td><b>" + field + "</b></td><td>" + + for element in item[1]: + element.dump_html( identifiers ) + + print "</td></tr>" + + + +############################################################################# # # # The DocBlock class is used to store a given comment block. It contains # a list of markers, as well as a list of contents for each marker. # -# "self.items" is a list of ( marker, contents ) elements, where +# "self.items" is a list of (marker, contents) elements, where # 'marker' is a lowercase marker string, and 'contents' is a DocContent -# object +# object. # # "self.source" is simply a list of text lines taken from the -# uncommented source itself.. +# uncommented source itself. +# +# Finally, "self.name" is a simple identifier used to uniquely identify +# the block. It is taken from the first word of the first +# paragraph of the first marker of a given block, i.e: +# +# <Type> Goo +# <Description> Bla bla bla # -# finally, "self.identifier" is a simple identifier used to -# uniquely identify the block +# will have a name of "Goo" # class DocBlock: def __init__( self, block_line_list = [], source_line_list = [] ): - self.items = [] # current ( marker, contents ) list - self.identifier = None - marker = None # current marker - content = [] # current content lines list - alphanum = string.letters + string.digits + "_" + self.items = [] # current ( marker, contents ) list + self.section = None # section this block belongs to + self.filename = "unknown" # filename defining this block + self.lineno = 0 # line number in filename + + marker = None # current marker + content = [] # current content lines list + alphanum = string.letters + string.digits + "_" + self.name = None for line in block_line_list: line2 = string.lstrip( line ) @@ -481,7 +647,7 @@ class DocBlock: self.add( marker, content ) marker = line2[1 : i] content = [] - line2 = string.lstrip( line2[i + 1 :] ) + line2 = string.lstrip( line2[i+1 :] ) l = len( line2 ) line = " " * margin + line2 @@ -494,15 +660,21 @@ class DocBlock: if self.items: self.source = source_line_list + # now retrieve block name when possible + # + if self.items: + first = self.items[0] + self.name = first[1].get_identifier() + - # this function is used to add a new element to self.items - # 'marker' is a marker string, or None - # 'lines' is a list of text lines used to compute a list of - # DocContent objects + # This function adds a new element to 'self.items'. + # 'marker' is a marker string, or None. + # 'lines' is a list of text lines used to compute a list of + # DocContent objects. # def add( self, marker, lines ): - # remove the first and last empty lines from the content list + # l = len( lines ) if l > 0: i = 0 @@ -513,14 +685,43 @@ class DocBlock: lines = lines[i : l] l = len( lines ) - # add a new marker only if its marker and its content list aren't empty + # add a new marker only if its marker and its content list + # aren't empty + # if l > 0 and marker: - content = DocContent(lines) - self.items.append( ( string.lower(marker), content ) ) - if not self.identifier: - self.identifier = content.get_identifier() + content = DocContent( lines ) + self.items.append( ( string.lower( marker ), content ) ) + def find_content( self, marker ): + for item in self.items: + if ( item[0] == marker ): + return item[1] + return None + + + def html_address( self ): + section = self.section + if section and section.filename: + return section.filename + '#' + self.name + + return "" # this block is not in a section? + + + def location( self ): + return self.filename + ':' + str( self.lineno ) + + + def print_warning( self, message ): + sys.stderr.write( "WARNING:" + + self.location() + ": " + message + '\n' ) + + + def print_error( self, message ): + sys.stderr.write( "ERROR:" + + self.location() + ": " + message + '\n' ) + sys.exit() + def dump( self ): for i in range( len( self.items ) ): @@ -528,21 +729,31 @@ class DocBlock: content = self.items[i][1] content.dump() - def dump_html( self ): - types = [ 'type', 'struct', 'functype', 'function', 'constant', - 'enum', 'macro' ] + def dump_html( self, identifiers = None ): + types = ['type', 'struct', 'functype', 'function', + 'constant', 'enum', 'macro', 'structure', 'also'] + + parameters = ['input', 'inout', 'output', 'return'] if not self.items: - return + return # start of a block + # print block_header - print "<h2>" + self.identifier + "</h2>" + # place html anchor if needed + # + if self.name: + print '<a name="' + self.name + '">' + print "<h4>" + self.name + "</h4>" + print "</a>" # print source code + # if not self.source: + print block_footer return lines = self.source @@ -550,38 +761,455 @@ class DocBlock: while l >= 0 and string.strip( lines[l] ) == "": l = l - 1 print source_header - for line in lines[0 : l + 1]: - print line + print "" + for line in lines[0 : l+1]: + print line print source_footer + in_table = 0 + # dump each (marker,content) element + # for element in self.items: - marker = element[0] content = element[1] if marker == "description": - print "<ul>" - content.dump_html() - print "</ul>" + print description_header + content.dump_html( identifiers ) + print description_footer - elif not (marker in types): - print "<h4>" + marker + "</h4>" - print "<ul>" - content.dump_html() - print "</ul>" + elif not ( marker in types ): + sys.stdout.write( marker_header ) + sys.stdout.write( marker ) + sys.stdout.write( marker_inter + '\n' ) + content.dump_html( identifiers ) + print marker_footer - print "" + print "" print block_footer -# filter a given list of DocBlocks. Returns a new list -# of DocBlock objects that only contains element whose -# "type" (i.e. first marker) is in the "types" parameter + +############################################################################# +# +# The DocSection class is used to store a given documentation section. +# +# Each section is made of an identifier, an abstract and a description. +# +# For example, look at: # -def filter_blocks( block_list, types ): +# <Section> Basic_Data_Types +# +# <Title> FreeType 2 Basic Data Types +# +# <Abstract> +# Definitions of basic FreeType data types +# +# <Description> +# FreeType defines several basic data types for all its +# operations... +# +class DocSection: + def __init__( self, block ): + self.block = block + self.name = string.lower( block.name ) + self.abstract = block.find_content( "abstract" ) + self.description = block.find_content( "description" ) + self.elements = {} + self.list = [] + self.filename = self.name + ".html" + self.chapter = None + + # sys.stderr.write( "new section '" + self.name + "'" ) + + + def add_element( self, block ): + # check that we don't have a duplicate element in this + # section + # + if self.elements.has_key( block.name ): + self.print_error( "duplicate element definition for " + + "'" + block.name + "' " + + "in section " + + "'" + self.name + "'\n" + + "previous definition in " + + "'" + self.elements[block.name].location() + "'" ) + + self.elements[block.name] = block + self.list.append( block ) + + + def print_warning( self, message ): + self.block.print_warning( message ) + + + def print_error( self, message ): + self.block.print_error( message ) + + + def dump_html( self, identifiers = None ): + """make an HTML page from a given DocSection""" + + # print HTML header + # + print html_header + + # print title + # + print section_title_header + print self.title + print section_title_footer + + # print description + # + print block_header + self.description.dump_html( identifiers ) + print block_footer + + # print elements + # + for element in self.list: + element.dump_html( identifiers ) + + print html_footer + + +class DocSectionList: + + def __init__( self ): + self.sections = {} # map section names to section objects + self.list = [] # list of sections (in creation order) + self.current_section = None # current section + self.identifiers = {} # map identifiers to blocks + + + def append_section( self, block ): + name = string.lower( block.name ) + abstract = block.find_content( "abstract" ) + + if self.sections.has_key( name ): + # There is already a section with this name in our + # list. We will try to complete it. + # + section = self.sections[name] + if section.abstract: + # This section already has an abstract defined; + # simply check that the new section doesn't + # provide a new one. + # + if abstract: + section.block.print_error( + "duplicate section definition for " + + "'" + name + "'\n" + + "previous definition in " + + "'" + section.block.location() + "'\n" + + "second definition in " + + "'" + block.location() + "'" ) + else: + # The old section didn't contain an abstract; we are + # now going to replace it. + # + section.abstract = abstract + section.description = block.find_content( "description" ) + section.block = block + + else: + # a new section + # + section = DocSection( block ) + self.sections[name] = section + self.list.append( section ) + + self.current_section = section + + + def append_block( self, block ): + if block.name: + section = block.find_content( "section" ) + if section: + self.append_section( block ) + + elif self.current_section: + self.current_section.add_element( block ) + block.section = self.current_section + self.identifiers[block.name] = block + + + def prepare_files( self, file_prefix = None ): + # prepare the section list, by computing section filenames + # and the index + # + if file_prefix: + prefix = file_prefix + "-" + else: + prefix = "" + + # compute section names + # + for section in self.sections.values(): + title_content = section.block.find_content( "title" ) + if title_content: + section.title = title_content.get_title() + else: + section.title = "UNKNOWN_SECTION_TITLE!" + + # sort section elements according to the <order> marker if + # available + # + for section in self.sections.values(): + order = section.block.find_content( "order" ) + if order: + # sys.stderr.write( "<order> found at " + # + section.block.location() + '\n' ) + order_list = [] + for item in order.items: + for element in item[1]: + words = None + try: + words = element.get_words() + except: + section.block.print_warning( + "invalid content in <order> marker\n" ) + if words: + for word in words: + block = self.identifiers.get( word ) + if block: + if block.section == section: + order_list.append( block ) + else: + section.block.print_warning( + "invalid reference to " + + "'" + word + "' " + + "defined in other section" ) + else: + section.block.print_warning( + "invalid reference to " + + "'" + word + "'" ) + + # now sort the list of blocks according to the order list + # + new_list = order_list[:] + for block in section.list: + if not block in order_list: + new_list.append( block ) + + section.list = new_list + + # compute section filenames + # + for section in self.sections.values(): + section.filename = prefix + section.name + ".html" + + self.toc_filename = prefix + "toc.html" + self.index_filename = prefix + "index.html" + + # compute the sorted list of identifiers for the index + # + self.index = self.identifiers.keys() + self.index.sort( index_sort ) + + + def dump_html_sections( self ): + old_stdout = sys.stdout + + for section in self.sections.values(): + if section.filename: + new_file = open( section.filename, "w" ) + sys.stdout = new_file + section.dump_html( self.identifiers ) + new_file.close() + + sys.stdout = old_stdout + + + def dump_html_index( self ): + old_stdout = sys.stdout + new_file = open( self.index_filename, "w" ) + sys.stdout = new_file + + num_columns = 3 + total = len( self.index ) + line = 0 + + print html_header + print "<center><h1>General Index</h1></center>" + print "<center><table cellpadding=5><tr valign=top><td>" + + for ident in self.index: + block = self.identifiers[ident] + if block: + sys.stdout.write( '<a href="' + block.html_address() + '">' ) + sys.stdout.write( block.name ) + sys.stdout.write( '</a><br>' + '\n' ) + + if line * num_columns >= total: + print "</td><td>" + line = 0 + else: + line = line + 1 + else: + sys.stderr.write( "identifier '" + ident + + "' has no definition" + '\n' ) + + print "</tr></table></center>" + print html_footer + + sys.stdout = old_stdout + + + +# Filter a given list of DocBlocks. Returns a new list of DocBlock objects +# that only contains element whose "type" (i.e. first marker) is in the +# "types" parameter. +# +class DocChapter: + + def __init__( self, block ): + self.sections_names = [] # ordered list of section names + self.sections = [] # ordered list of DocSection objects + # for this chapter + self.block = block + + # look for chapter title + content = block.find_content( "title" ) + if content: + self.title = content.get_title() + else: + self.title = "UNKNOWN CHAPTER TITLE" + + # look for section list + content = block.find_content( "sections" ) + if not content: + block.print_error( "chapter has no <sections> content" ) + + # compute list of section names + slist = [] + for item in content.items: + for element in item[1]: + try: + words = element.get_words() + l = len( slist ) + slist[l : l] = words + except: + block.print_warning( + "invalid content in <sections> marker" ) + + self.section_names = slist + + +class DocDocument: + + def __init__( self ): + self.section_list = DocSectionList() # section list object + self.chapters = [] # list of chapters + self.lost_sections = [] # list of sections with + # no chapter + + def append_block( self, block ): + if block.name: + content = block.find_content( "chapter" ) + if content: + # it's a chapter definition -- add it to our list + chapter = DocChapter( block ) + self.chapters.append( chapter ) + else: + self.section_list.append_block( block ) + + + def prepare_chapters( self ): + # check section names + # + for chapter in self.chapters: + slist = [] + for name in chapter.section_names: + section = self.section_list.sections.get( name ) + if not section: + chapter.block.print_warning( + "invalid reference to unknown section '" + name + "'" ) + else: + section.chapter = chapter + slist.append( section ) + + chapter.sections = slist + + for section in self.section_list.list: + if not section.chapter: + section.block.print_warning( + "section '" + section.name + "' is not in any chapter" ) + self.lost_sections.append( section ) + + + def prepare_files( self, file_prefix = None ): + self.section_list.prepare_files( file_prefix ) + self.prepare_chapters() + + + def dump_toc_html( self ): + # dump an html table of contents + # + old_stdout = sys.stdout + new_file = open( self.section_list.toc_filename, "w" ) + sys.stdout = new_file + + print html_header + + print "<center><h1>Table of Contents</h1></center>" + + for chapter in self.chapters: + print chapter_header + chapter.title + chapter_inter + + print "<table cellpadding=5>" + for section in chapter.sections: + if section.abstract: + print "<tr valign=top><td>" + sys.stdout.write( '<a href="' + section.filename + '">' ) + sys.stdout.write( section.title ) + sys.stdout.write( "</a></td><td>" + '\n' ) + section.abstract.dump_html( self.section_list.identifiers ) + print "</td></tr>" + + print "</table>" + + print chapter_footer + + # list lost sections + if self.lost_sections: + print chapter_header + "OTHER SECTIONS:" + chapter_inter + + print "<table cellpadding=5>" + for section in self.lost_sections: + if section.abstract: + print "<tr valign=top><td>" + sys.stdout.write( '<a href="' + section.filename + '">' ) + sys.stdout.write( section.title ) + sys.stdout.write( "</a></td><td>" + '\n' ) + section.abstract.dump_html( self.section_list.identifiers ) + print "</td></tr>" + + print "</table>" + + print chapter_footer + + # index + print chapter_header + '<a href="' + self.section_list.index_filename + '">Index</a>' + chapter_footer + + print html_footer + + sys.stdout = old_stdout + + + def dump_index_html( self ): + self.section_list.dump_html_index() + + + def dump_sections_html( self ): + self.section_list.dump_html_sections() + + +def filter_blocks_by_type( block_list, types ): new_list = [] for block in block_list: if block.items: @@ -593,17 +1221,22 @@ def filter_blocks( block_list, types ): return new_list -# perform a lexicographical comparison of two DocBlock -# objects. Returns -1, 0 or 1 +def filter_section_blocks( block ): + return block.section != None + + +# Perform a lexicographical comparison of two DocBlock +# objects. Returns -1, 0 or 1. # def block_lexicographical_compare( b1, b2 ): - if not b1.identifier: + if not b1.name: return -1 - if not b2.identifier: + if not b2.name: return 1 - id1 = string.lower(b1.identifier) - id2 = string.lower(b2.identifier) + id1 = string.lower( b1.name ) + id2 = string.lower( b2.name ) + if id1 < id2: return -1 elif id1 == id2: @@ -612,20 +1245,9 @@ def block_lexicographical_compare( b1, b2 ): return 1 -def block_make_list( source_block_list ): - list = [] - - for block in source_block_list: - docblock = DocBlock( block[0], block[1] ) - list.append( docblock ) - - return list - - # dump a list block as a single HTML page # def dump_html_1( block_list ): - print html_header for block in block_list: @@ -634,16 +1256,54 @@ def dump_html_1( block_list ): print html_footer +def file_exists( pathname ): + result = 1 + try: + file = open( pathname, "r" ) + file.close() + except: + result = None + + return result + + +def add_new_block( list, filename, lineno, block_lines, source_lines ): + """add a new block to the list""" + block = DocBlock( block_lines, source_lines ) + block.filename = filename + block.lineno = lineno + list.append( block ) def make_block_list(): """parse a file and extract comments blocks from it""" + file_list = [] + # sys.stderr.write( repr( sys.argv[1 :] ) + '\n' ) + + for pathname in sys.argv[1 :]: + if string.find( pathname, '*' ) >= 0: + newpath = glob.glob( pathname ) + newpath.sort() # sort files -- this is important because + # of the order of files + else: + newpath = [pathname] + + last = len( file_list ) + file_list[last : last] = newpath + + if len( file_list ) == 0: + file_list = None + else: + # now filter the file list to remove non-existing ones + file_list = filter( file_exists, file_list ) + list = [] block = [] format = 0 + lineno = 0 - # we use "format" to store the state of our parser: + # We use "format" to store the state of our parser: # # 0 - wait for beginning of comment # 1 - parse comment format 1 @@ -652,18 +1312,17 @@ def make_block_list(): # 4 - wait for beginning of source (or comment ??) # 5 - process source # + comment = [] + source = [] + state = 0 - comment = [] - source = [] - state = 0 - - for line in fileinput.input(): - + for line in fileinput.input( file_list ): l = len( line ) if l > 0 and line[l - 1] == '\012': - line = line[0 : l - 1] + line = line[0 : l-1] # stripped version of the line + # line2 = string.strip( line ) l = len( line2 ) @@ -679,13 +1338,13 @@ def make_block_list(): # /* #..... # if format >= 4 and l > 2 and line2[0 : 2] == '/*': - if l < 4 or ( line2[3] != '@' and line2[3:4] != ' @' and - line2[3] != '#' and line2[3:4] != ' #'): - list.append( ( block, source ) ) + if l < 4 or ( line2[2] != '@' and line2[2 : 4] != ' @' and + line2[2] != '#' and line2[2 : 4] != ' #'): + add_new_block( list, fileinput.filename(), + lineno, block, source ) format = 0 if format == 0: #### wait for beginning of comment #### - if l > 3 and line2[0 : 3] == '/**': i = 3 while i < l and line2[i] == '*': @@ -698,6 +1357,7 @@ def make_block_list(): block = [] source = [] format = 1 + lineno = fileinput.lineno() elif i == l - 1 and line2[i] == '/': # this is '/**' followed by any number of '*', followed @@ -706,6 +1366,7 @@ def make_block_list(): block = [] source = [] format = 2 + lineno = fileinput.lineno() ############################################################## # @@ -713,20 +1374,23 @@ def make_block_list(): # elif format == 1: - # if the line doesn't begin with a "*", something went - # wrong, and we must exit, and forget the current block.. + # If the line doesn't begin with a "*", something went + # wrong, and we must exit, and forget the current block. + # if l == 0 or line2[0] != '*': block = [] format = 0 - # otherwise, we test for an end of block, which is an - # arbitrary number of '*', followed by '/' + # Otherwise, we test for an end of block, which is an + # arbitrary number of '*', followed by '/'. + # else: i = 1 while i < l and line2[i] == '*': i = i + 1 # test for the end of the block + # if i < l and line2[i] == '/': if block != []: format = 4 @@ -734,7 +1398,8 @@ def make_block_list(): format = 0 else: # otherwise simply append line to current block - block.append( line2[i:] ) + # + block.append( line2[i :] ) continue @@ -744,8 +1409,9 @@ def make_block_list(): # elif format == 2: - # if the line doesn't begin with '/*' and end with '*/', - # this is the end of the format 2 format + # If the line doesn't begin with '/*' and end with '*/', + # this is the end of the format 2 format. + # if l < 4 or line2[: 2] != '/*' or line2[-2 :] != '*/': if block != []: format = 4 @@ -754,9 +1420,11 @@ def make_block_list(): else: # remove the start and end comment delimiters, then # right-strip the line + # line2 = string.rstrip( line2[2 : -2] ) # check for end of a format2 block, i.e. a run of '*' + # if string.count( line2, '*' ) == l - 4: if block != []: format = 4 @@ -764,23 +1432,20 @@ def make_block_list(): format = 0 else: # otherwise, add the line to the current block + # block.append( line2 ) continue - - if format >= 4: #### source processing #### - if l > 0: format = 5 if format == 5: source.append( line ) - if format >= 4: - list.append( [block, source] ) + add_new_block( list, fileinput.filename(), lineno, block, source ) return list @@ -800,24 +1465,41 @@ def dump_block_list( list ): print "---------the end-----------------------" - def main( argv ): """main program loop""" + + # we begin by simply building a list of DocBlock elements + # sys.stderr.write( "extracting comment blocks from sources...\n" ) list = make_block_list() - list = block_make_list(list) - list2 = filter_blocks( list, ['type','macro','enum','constant', 'functype'] ) - #list2 = list - list2.sort( block_lexicographical_compare ) + # now, sort the blocks into sections + # + document = DocDocument() + for block in list: + document.append_block( block ) + + document.prepare_files( "ft2" ) + + document.dump_toc_html() + document.dump_sections_html() + document.dump_index_html() - dump_html_1( list2 ) - #dump_doc_blocks( list ) - #dump_block_lists( list ) - #dump_html_1( list ) +## section_list = DocSectionList() +## for block in list: +## section_list.append_block( block ) +## +## section_list.prepare_files( "ft2" ) + +## # dump the section list TOC and sections +## # +## section_list.dump_html_toc() +## section_list.dump_html_sections() +## section_list.dump_html_index() # If called from the command line +# if __name__ == '__main__': main( sys.argv ) diff --git a/xc/extras/freetype2/docs/glnames.py b/xc/extras/freetype2/docs/glnames.py index 5553ceb17..6179f0071 100644 --- a/xc/extras/freetype2/docs/glnames.py +++ b/xc/extras/freetype2/docs/glnames.py @@ -1533,7 +1533,7 @@ def dump_glyph_list( file, glyph_list, adobe_extra ): name_list = [] - write( " static const char* standard_glyph_names[] =\n" ) + write( " static const char* const standard_glyph_names[] =\n" ) write( " {\n" ) for name in glyph_list: @@ -1666,7 +1666,7 @@ def main(): name_list = dump_glyph_list( file, base_list, adobe_list ) # dump t1_standard_list - write( " static const char** t1_standard_glyphs = " \ + write( " static const char* const * const t1_standard_glyphs = " \ + "standard_glyph_names + " + repr( t1_bias ) + ";\n" ) write( "\n" ) write( "\n" ) diff --git a/xc/extras/freetype2/include/freetype/cache/ftcchunk.h b/xc/extras/freetype2/include/freetype/cache/ftcchunk.h index 50e06da96..f5ed7eba3 100644 --- a/xc/extras/freetype2/include/freetype/cache/ftcchunk.h +++ b/xc/extras/freetype2/include/freetype/cache/ftcchunk.h @@ -45,18 +45,17 @@ #ifndef __FTCCHUNK_H__ #define __FTCCHUNK_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_CACHE_H -#include FT_CACHE_MANAGER_H + +#include <ft2build.h> +#include FT_CACHE_H +#include FT_CACHE_MANAGER_H + FT_BEGIN_HEADER /* maximum number of chunk sets in a given chunk cache */ -#define FTC_MAX_CHUNK_SETS 16 +#define FTC_MAX_CHUNK_SETS 16 typedef struct FTC_ChunkNodeRec_* FTC_ChunkNode; diff --git a/xc/extras/freetype2/include/freetype/cache/ftcglyph.h b/xc/extras/freetype2/include/freetype/cache/ftcglyph.h index 812eaf1bc..93aac63da 100644 --- a/xc/extras/freetype2/include/freetype/cache/ftcglyph.h +++ b/xc/extras/freetype2/include/freetype/cache/ftcglyph.h @@ -53,13 +53,13 @@ #ifndef __FTCGLYPH_H__ #define __FTCGLYPH_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_CACHE_H -#include FT_CACHE_MANAGER_H -#include <stddef.h> + +#include <ft2build.h> +#include FT_CACHE_H +#include FT_CACHE_MANAGER_H + +#include <stddef.h> + FT_BEGIN_HEADER @@ -201,6 +201,7 @@ FT_BEGIN_HEADER FT_UInt gindex, FTC_GlyphNode *anode ); + FT_END_HEADER #endif /* __FTCGLYPH_H__ */ diff --git a/xc/extras/freetype2/include/freetype/cache/ftcimage.h b/xc/extras/freetype2/include/freetype/cache/ftcimage.h index e68988eb0..2746db529 100644 --- a/xc/extras/freetype2/include/freetype/cache/ftcimage.h +++ b/xc/extras/freetype2/include/freetype/cache/ftcimage.h @@ -1,6 +1,6 @@ /***************************************************************************/ /* */ -/* ftcimage.c */ +/* ftcimage.h */ /* */ /* FreeType Image cache (body). */ /* */ @@ -26,17 +26,24 @@ #ifndef __FTCIMAGE_H__ #define __FTCIMAGE_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_CACHE_H -#include FT_CACHE_INTERNAL_GLYPH_H + +#include <ft2build.h> +#include FT_CACHE_H +#include FT_CACHE_INTERNAL_GLYPH_H + FT_BEGIN_HEADER /*************************************************************************/ + /* */ + /* <Section> */ + /* cache_subsystem */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -47,25 +54,25 @@ FT_BEGIN_HEADER /*************************************************************************/ -#define FTC_IMAGE_FORMAT( x ) ( (x) & 7 ) +#define FTC_IMAGE_FORMAT( x ) ( (x) & 7 ) -#define ftc_image_format_bitmap 0 -#define ftc_image_format_outline 1 +#define ftc_image_format_bitmap 0 +#define ftc_image_format_outline 1 -#define ftc_image_flag_monochrome 16 -#define ftc_image_flag_unhinted 32 -#define ftc_image_flag_autohinted 64 -#define ftc_image_flag_unscaled 128 -#define ftc_image_flag_no_sbits 256 +#define ftc_image_flag_monochrome 16 +#define ftc_image_flag_unhinted 32 +#define ftc_image_flag_autohinted 64 +#define ftc_image_flag_unscaled 128 +#define ftc_image_flag_no_sbits 256 /* monochrome bitmap */ -#define ftc_image_mono ftc_image_format_bitmap | \ - ftc_image_flag_monochrome +#define ftc_image_mono ftc_image_format_bitmap | \ + ftc_image_flag_monochrome /* anti-aliased bitmap */ -#define ftc_image_grays ftc_image_format_bitmap +#define ftc_image_grays ftc_image_format_bitmap /* scaled outline */ -#define ftc_image_outline ftc_image_format_outline +#define ftc_image_outline ftc_image_format_outline /*************************************************************************/ @@ -161,6 +168,9 @@ FT_BEGIN_HEADER FT_Glyph *aglyph ); + /* */ + + FT_END_HEADER #endif /* __FTCIMAGE_H__ */ diff --git a/xc/extras/freetype2/include/freetype/cache/ftcmanag.h b/xc/extras/freetype2/include/freetype/cache/ftcmanag.h index ce1e98015..a8b8a8620 100644 --- a/xc/extras/freetype2/include/freetype/cache/ftcmanag.h +++ b/xc/extras/freetype2/include/freetype/cache/ftcmanag.h @@ -62,15 +62,23 @@ #ifndef __FTCMANAG_H__ #define __FTCMANAG_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_CACHE_H -#include FT_CACHE_INTERNAL_LRU_H + +#include <ft2build.h> +#include FT_CACHE_H +#include FT_CACHE_INTERNAL_LRU_H + FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* <Section> */ + /* cache_subsystem */ + /* */ + /*************************************************************************/ + + #define FTC_MAX_FACES_DEFAULT 2 #define FTC_MAX_SIZES_DEFAULT 4 #define FTC_MAX_BYTES_DEFAULT 200000 /* 200kByte by default! */ @@ -360,8 +368,10 @@ FT_BEGIN_HEADER } FTC_CacheRec; + /* */ + FT_END_HEADER #endif /* __FTCMANAG_H__ */ diff --git a/xc/extras/freetype2/include/freetype/cache/ftcsbits.h b/xc/extras/freetype2/include/freetype/cache/ftcsbits.h index 9104d21e6..a5555d965 100644 --- a/xc/extras/freetype2/include/freetype/cache/ftcsbits.h +++ b/xc/extras/freetype2/include/freetype/cache/ftcsbits.h @@ -19,23 +19,83 @@ #ifndef __FTCSBITS_H__ #define __FTCSBITS_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_CACHE_H -#include FT_CACHE_INTERNAL_CHUNK_H -#include FT_CACHE_IMAGE_H + +#include <ft2build.h> +#include FT_CACHE_H +#include FT_CACHE_INTERNAL_CHUNK_H +#include FT_CACHE_IMAGE_H + FT_BEGIN_HEADER - /* handle to small bitmap */ + + /*************************************************************************/ + /* */ + /* <Section> */ + /* cache_subsystem */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FTC_SBit */ + /* */ + /* <Description> */ + /* A handle to a small bitmap descriptor. See the FTC_SBitRec */ + /* structure for details. */ + /* */ typedef struct FTC_SBitRec_* FTC_SBit; - /* handle to small bitmap cache */ + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FTC_SBit_Cache */ + /* */ + /* <Description> */ + /* A handle to a small bitmap cache. These are special cache objects */ + /* used to store small glyph bitmaps (and anti-aliased pixmaps) in a */ + /* much more efficient way than the traditional glyph image cache */ + /* implemented by FTC_Image_Cache. */ + /* */ typedef struct FTC_SBit_CacheRec_* FTC_SBit_Cache; - /* a compact structure used to hold a single small bitmap */ + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FTC_SBitRec */ + /* */ + /* <Description> */ + /* A very compact structure used to describe a small glyph bitmap. */ + /* */ + /* <Fields> */ + /* width :: The bitmap width in pixels. */ + /* */ + /* height :: The bitmap height in pixels. */ + /* */ + /* left :: The horizontal distance from the pen position to the */ + /* left bitmap border (a.k.a. `left side bearing', or */ + /* `lsb'). */ + /* */ + /* top :: The vertical distance from the pen position (on the */ + /* baseline) to the upper bitmap border (a.k.a. `top side */ + /* bearing'). The distance is positive for upwards */ + /* Y coordinates. */ + /* */ + /* format :: The format of the glyph bitmap (monochrome or gray). */ + /* */ + /* pitch :: The number of bytes per bitmap line. May be positive */ + /* or negative. */ + /* */ + /* xadvance :: The horizontal advance width in pixels. */ + /* */ + /* yadvance :: The vertical advance height in pixels. */ + /* */ + /* buffer :: A pointer to the bitmap pixels. */ + /* */ typedef struct FTC_SBitRec_ { FT_Byte width; @@ -53,13 +113,64 @@ FT_BEGIN_HEADER } FTC_SBitRec; + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_SBit_Cache_New */ + /* */ + /* <Description> */ + /* Creates a new cache to store small glyph bitmaps. */ + /* */ + /* <Input> */ + /* manager :: A handle to the source cache manager. */ + /* */ + /* <Output> */ + /* acache :: A handle to the new sbit cache. NULL in case of error. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ FT_EXPORT( FT_Error ) FTC_SBit_Cache_New( FTC_Manager manager, FTC_SBit_Cache *acache ); + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FTC_SBit_Cache_Lookup */ + /* */ + /* <Description> */ + /* Looks up a given small glyph bitmap in a given sbit cache. */ + /* */ + /* <Input> */ + /* cache :: A handle to the source sbit cache. */ + /* desc :: A pointer to the glyph image descriptor. */ + /* gindex :: The glyph index. */ + /* */ + /* <Output> */ + /* sbit :: A handle to a small bitmap descriptor. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The small bitmap descriptor and its bit buffer are owned by the */ + /* cache and should never be freed by the application. They might */ + /* as well disappear from memory on the next cache lookup, so don't */ + /* treat them as persistent data. */ + /* */ + /* The descriptor's `buffer' field is set to 0 to indicate a missing */ + /* glyph bitmap. */ + /* */ FT_EXPORT( FT_Error ) FTC_SBit_Cache_Lookup( FTC_SBit_Cache cache, FTC_Image_Desc* desc, FT_UInt gindex, FTC_SBit *sbit ); + + + /* */ + + FT_END_HEADER #endif /* __FTCSBITS_H__ */ diff --git a/xc/extras/freetype2/include/freetype/cache/ftlru.h b/xc/extras/freetype2/include/freetype/cache/ftlru.h index 538a23826..a7d058782 100644 --- a/xc/extras/freetype2/include/freetype/cache/ftlru.h +++ b/xc/extras/freetype2/include/freetype/cache/ftlru.h @@ -58,11 +58,10 @@ #ifndef __FTLRU_H__ #define __FTLRU_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_FREETYPE_H + +#include <ft2build.h> +#include FT_FREETYPE_H + FT_BEGIN_HEADER @@ -165,6 +164,7 @@ FT_BEGIN_HEADER FT_Lru_Selector selector, FT_Pointer data ); + FT_END_HEADER #endif /* __FTLRU_H__ */ diff --git a/xc/extras/freetype2/include/freetype/config/ftconfig.h b/xc/extras/freetype2/include/freetype/config/ftconfig.h index dc92d94d7..49e90f875 100644 --- a/xc/extras/freetype2/include/freetype/config/ftconfig.h +++ b/xc/extras/freetype2/include/freetype/config/ftconfig.h @@ -39,16 +39,13 @@ #ifndef __FTCONFIG_H__ #define __FTCONFIG_H__ - /* Include the header file containing all developer build options */ -#ifndef FT_BUILD_H -#define FT_BUILD_H <freetype/config/ftbuild.h> -#endif +#include <ft2build.h> +#include FT_CONFIG_OPTIONS_H -#include FT_BUILD_H -#include FT_CONFIG_OPTIONS_H FT_BEGIN_HEADER + /*************************************************************************/ /* */ /* PLATFORM-SPECIFIC CONFIGURATION MACROS */ diff --git a/xc/extras/freetype2/include/freetype/config/ftheader.h b/xc/extras/freetype2/include/freetype/config/ftheader.h new file mode 100644 index 000000000..917f1c88e --- /dev/null +++ b/xc/extras/freetype2/include/freetype/config/ftheader.h @@ -0,0 +1,444 @@ +/***************************************************************************/ +/* */ +/* ftheader.h */ +/* */ +/* Build macros of the FreeType 2 library. */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + +#ifndef __FT_HEADER_H__ +#define __FT_HEADER_H__ + + /*************************************************************************/ + /* */ + /* <Macro> */ + /* FT_BEGIN_HEADER */ + /* */ + /* <Description> */ + /* This macro is used in association with @FT_END_HEADER in header */ + /* files to ensure that the declarations within are properly */ + /* encapsulated in an `extern "C" { .. }' block when included from a */ + /* C++ compiler. */ + /* */ +#ifdef __cplusplus +#define FT_BEGIN_HEADER extern "C" { +#else +#define FT_BEGIN_HEADER /* nothing */ +#endif + + + /*************************************************************************/ + /* */ + /* <Macro> */ + /* FT_END_HEADER */ + /* */ + /* <Description> */ + /* This macro is used in association with @FT_BEGIN_HEADER in header */ + /* files to ensure that the declarations within are properly */ + /* encapsulated in an `extern "C" { .. }' block when included from a */ + /* C++ compiler. */ + /* */ +#ifdef __cplusplus +#define FT_END_HEADER } +#else +#define FT_END_HEADER /* nothing */ +#endif + + + /*************************************************************************/ + /* */ + /* Aliases for the FreeType 2 public and configuration files. */ + /* */ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* <Section> */ + /* header_file_macros */ + /* */ + /* <Title> */ + /* Header File Macros */ + /* */ + /* <Abstract> */ + /* Macro definitions used to #include specific header files. */ + /* */ + /* <Description> */ + /* The following macros are defined to the name of specific */ + /* FreeType 2 header files. They can be used directly in #include */ + /* statements as in: */ + /* */ + /* { */ + /* #include FT_FREETYPE_H */ + /* #include FT_MULTIPLE_MASTERS_H */ + /* #include FT_GLYPH_H */ + /* } */ + /* */ + /* There are several reasons why we are now using macros to name */ + /* public header files. The first one is that such macros are not */ + /* limited to the infamous 8.3 naming rule required by DOS (and */ + /* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */ + /* */ + /* The second reason is that is allows for more flexibility in the */ + /* way FreeType 2 is installed on a given system. */ + /* */ + /*************************************************************************/ + + /* configuration files */ + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_CONFIG_CONFIG_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* FreeType 2 configuration data. */ + /* */ +#ifndef FT_CONFIG_CONFIG_H +#define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h> +#endif + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_CONFIG_OPTIONS_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* FreeType 2 project-specific configuration options. */ + /* */ +#ifndef FT_CONFIG_OPTIONS_H +#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h> +#endif + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_CONFIG_MODULES_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the list of FreeType 2 modules that are statically linked to new */ + /* library instances in @FT_Init_FreeType. */ + /* */ +#ifndef FT_CONFIG_MODULES_H +#define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h> +#endif + + /* public headers */ + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_FREETYPE_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the base FreeType 2 API. */ + /* */ +#define FT_FREETYPE_H <freetype/freetype.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_ERRORS_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the list of FreeType 2 error codes (and messages). */ + /* */ + /* It is included by @FT_FREETYPE_H. */ + /* */ +#define FT_ERRORS_H <freetype/fterrors.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_SYSTEM_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the FreeType 2 interface to low-level operations (i.e. memory */ + /* management and stream i/o). */ + /* */ + /* It is included by @FT_FREETYPE_H. */ + /* */ +#define FT_SYSTEM_H <freetype/ftsystem.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_IMAGE_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* types definitions related to glyph images (i.e. bitmaps, outlines, */ + /* scan-converter parameters). */ + /* */ + /* It is included by @FT_FREETYPE_H. */ + /* */ +#define FT_IMAGE_H <freetype/ftimage.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_TYPES_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the basic data types defined by FreeType 2. */ + /* */ + /* It is included by @FT_FREETYPE_H. */ + /* */ +#define FT_TYPES_H <freetype/fttypes.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_LIST_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the list management API of FreeType 2. */ + /* */ + /* (Most applications will never need to include this file.) */ + /* */ +#define FT_LIST_H <freetype/ftlist.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_OUTLINE_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the scalable outline management API of FreeType 2. */ + /* */ +#define FT_OUTLINE_H <freetype/ftoutln.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_MODULE_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the module management API of FreeType 2. */ + /* */ +#define FT_MODULE_H <freetype/ftmodule.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_RENDER_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the renderer module management API of FreeType 2. */ + /* */ +#define FT_RENDER_H <freetype/ftrender.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_TYPE1_TABLES_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the types and API specific to the Type 1 format. */ + /* */ +#define FT_TYPE1_TABLES_H <freetype/t1tables.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_TRUETYPE_IDS_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the enumeration values used to identify name strings, languages, */ + /* encodings, etc. This file really contains a _large_ set of */ + /* constant macro definitions, taken from the TrueType and OpenType */ + /* specifications. */ + /* */ +#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_TRUETYPE_TABLES_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the types and API specific to the TrueType (as well as OpenType) */ + /* format. */ + /* */ +#define FT_TRUETYPE_TABLES_H <freetype/tttables.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_TRUETYPE_TAGS_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the definitions of TrueType 4-byte `tags' used to identify blocks */ + /* in SFNT-based font formats (i.e. TrueType and OpenType). */ + /* */ +#define FT_TRUETYPE_TAGS_H <freetype/tttags.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_GLYPH_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the API of the optional glyph management component. */ + /* */ +#define FT_GLYPH_H <freetype/ftglyph.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_BBOX_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the API of the optional exact bounding box computation routines. */ + /* */ +#define FT_BBOX_H <freetype/ftbbox.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_CACHE_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the API of the optional FreeType 2 cache sub-system. */ + /* */ +#define FT_CACHE_H <freetype/ftcache.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_CACHE_IMAGE_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the `glyph image' API of the FreeType 2 cache sub-system. */ + /* */ + /* It is used to define a cache for @FT_Glyph elements. You can also */ + /* see the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need */ + /* to store small glyph bitmaps, as it will use less memory. */ + /* */ +#define FT_CACHE_IMAGE_H <freetype/cache/ftcimage.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_CACHE_SMALL_BITMAPS_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the `small bitmaps' API of the FreeType 2 cache sub-system. */ + /* */ + /* It is used to define a cache for small glyph bitmaps in a */ + /* relatively memory-efficient way. You can also use the API defined */ + /* in @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images, */ + /* including scalable outlines. */ + /* */ +#define FT_CACHE_SMALL_BITMAPS_H <freetype/cache/ftcsbits.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_MAC_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the Macintosh-specific FreeType 2 API. The latter is used to */ + /* access fonts embedded in resource forks. */ + /* */ + /* This header file must be explicitly included by client */ + /* applications compiled on the Mac (note that the base API still */ + /* works though). */ + /* */ +#define FT_MAC_H <freetype/ftmac.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_MULTIPLE_MASTERS_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the optional multiple-masters management API of FreeType 2. */ + /* */ +#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h> + + + /*************************************************************************/ + /* */ + /* @macro: */ + /* FT_SFNT_NAMES_H */ + /* */ + /* @description: */ + /* A macro used in #include statements to name the file containing */ + /* the optional FreeType 2 API used to access embedded `name' strings */ + /* in SFNT-based font formats (i.e. TrueType and OpenType). */ + /* */ +#define FT_SFNT_NAMES_H <freetype/ftsnames.h> + + /* */ + + +#define FT_SYNTHESIS_H <freetype/ftsynth.h> + +#define FT_CACHE_MANAGER_H <freetype/cache/ftcmanag.h> + +#define FT_CACHE_INTERNAL_LRU_H <freetype/cache/ftlru.h> +#define FT_CACHE_INTERNAL_GLYPH_H <freetype/cache/ftcglyph.h> +#define FT_CACHE_INTERNAL_CHUNK_H <freetype/cache/ftcchunk.h> + + /* now include internal headers definitions from <freetype/internal/...> */ + +#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h> +#include FT_INTERNAL_INTERNAL_H + + +#endif /* __FT2_BUILD_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/include/freetype/config/ftmodule.h b/xc/extras/freetype2/include/freetype/config/ftmodule.h index 8a9ea0a26..eb35a329a 100644 --- a/xc/extras/freetype2/include/freetype/config/ftmodule.h +++ b/xc/extras/freetype2/include/freetype/config/ftmodule.h @@ -1,6 +1,7 @@ FT_USE_MODULE(autohint_module_class) FT_USE_MODULE(cff_driver_class) FT_USE_MODULE(t1cid_driver_class) +FT_USE_MODULE(pcf_driver_class) FT_USE_MODULE(psaux_module_class) FT_USE_MODULE(psnames_module_class) FT_USE_MODULE(ft_raster1_renderer_class) diff --git a/xc/extras/freetype2/include/freetype/config/ftoption.h b/xc/extras/freetype2/include/freetype/config/ftoption.h index 032c842d5..9451be6a0 100644 --- a/xc/extras/freetype2/include/freetype/config/ftoption.h +++ b/xc/extras/freetype2/include/freetype/config/ftoption.h @@ -16,13 +16,14 @@ /***************************************************************************/ -#ifndef FTOPTION_H -#define FTOPTION_H +#ifndef __FTOPTION_H__ +#define __FTOPTION_H__ -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> + + +FT_BEGIN_HEADER /*************************************************************************/ @@ -310,7 +311,7 @@ /* By undefining this, you will only compile the code necessary to load */ /* TrueType glyphs without hinting. */ /* */ -#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER +#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER /*************************************************************************/ @@ -389,12 +390,10 @@ #undef T1_CONFIG_OPTION_NO_MM_SUPPORT -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* FTOPTION_H */ +#endif /* __FTOPTION_H__ */ /* END */ diff --git a/xc/extras/freetype2/include/freetype/freetype.h b/xc/extras/freetype2/include/freetype/freetype.h index 2b0793a4f..9ae157de3 100644 --- a/xc/extras/freetype2/include/freetype/freetype.h +++ b/xc/extras/freetype2/include/freetype/freetype.h @@ -19,18 +19,12 @@ #ifndef __FREETYPE_H__ #define __FREETYPE_H__ -/* include potentially build-specific directives and macros */ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H /*************************************************************************/ /* */ /* The `raster' component duplicates some of the declarations in */ /* freetype.h for stand-alone use if _FREETYPE_ isn't defined. */ /* */ -#define _FREETYPE_ /*************************************************************************/ @@ -43,12 +37,15 @@ #define FREETYPE_MINOR 0 +#include <ft2build.h> #include FT_CONFIG_CONFIG_H #include FT_ERRORS_H #include FT_TYPES_H + FT_BEGIN_HEADER + /*************************************************************************/ /*************************************************************************/ /* */ @@ -60,6 +57,103 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ + /* <Section> */ + /* base_interface */ + /* */ + /* <Title> */ + /* Base Interface */ + /* */ + /* <Abstract> */ + /* The FreeType 2 base font interface. */ + /* */ + /* <Description> */ + /* This section describes the public high-level API of FreeType 2. */ + /* */ + /* <Order> */ + /* FT_Library */ + /* FT_Face */ + /* FT_Size */ + /* FT_GlyphSlot */ + /* FT_CharMap */ + /* FT_Encoding */ + /* */ + /* FT_FaceRec */ + /* */ + /* FT_FACE_FLAG_SCALABLE */ + /* FT_FACE_FLAG_FIXED_SIZES */ + /* FT_FACE_FLAG_FIXED_WIDTH */ + /* FT_FACE_FLAG_HORIZONTAL */ + /* FT_FACE_FLAG_VERTICAL */ + /* FT_FACE_FLAG_SFNT */ + /* FT_FACE_FLAG_KERNING */ + /* FT_FACE_FLAG_MULTIPLE_MASTERS */ + /* FT_FACE_FLAG_GLYPH_NAMES */ + /* FT_FACE_FLAG_EXTERNAL_STREAM */ + /* FT_FACE_FLAG_FAST_GLYPHS */ + /* */ + /* FT_STYLE_FLAG_BOLD */ + /* FT_STYLE_FLAG_ITALIC */ + /* */ + /* FT_SizeRec */ + /* FT_Size_Metrics */ + /* */ + /* FT_GlyphSlotRec */ + /* FT_Glyph_Metrics */ + /* FT_SubGlyph */ + /* */ + /* FT_Bitmap_Size */ + /* */ + /* FT_Init_FreeType */ + /* FT_Done_FreeType */ + /* */ + /* FT_New_Face */ + /* FT_Done_Face */ + /* FT_New_Memory_Face */ + /* FT_Open_Face */ + /* FT_Open_Args */ + /* FT_Open_Flags */ + /* FT_Parameter */ + /* FT_Attach_File */ + /* FT_Attach_Stream */ + /* */ + /* FT_Set_Char_Size */ + /* FT_Set_Pixel_Sizes */ + /* FT_Set_Transform */ + /* FT_Load_Glyph */ + /* FT_Get_Char_Index */ + /* FT_Load_Char */ + /* */ + /* FT_LOAD_DEFAULT */ + /* FT_LOAD_RENDER */ + /* FT_LOAD_MONOCHROME */ + /* FT_LOAD_LINEAR_DESIGN */ + /* FT_LOAD_NO_SCALE */ + /* FT_LOAD_NO_HINTING */ + /* FT_LOAD_NO_BITMAP */ + /* FT_LOAD_CROP_BITMAP */ + /* */ + /* FT_LOAD_VERTICAL_LAYOUT */ + /* FT_LOAD_IGNORE_TRANSFORM */ + /* FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH */ + /* FT_LOAD_FORCE_AUTOHINT */ + /* FT_LOAD_NO_RECURSE */ + /* FT_LOAD_PEDANTIC */ + /* */ + /* FT_Render_Glyph */ + /* FT_Render_Mode */ + /* FT_Get_Kerning */ + /* FT_Kerning_Mode */ + /* FT_Get_Glyph_Name */ + /* */ + /* FT_CharMapRec */ + /* FT_Select_Charmap */ + /* FT_Set_Charmap */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ /* <Struct> */ /* FT_Glyph_Metrics */ /* */ @@ -103,59 +197,6 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ - /* <FuncType> */ - /* FT_Generic_Finalizer */ - /* */ - /* <Description> */ - /* Describes a function used to destroy the `client' data of any */ - /* FreeType object. See the description of the FT_Generic type for */ - /* details of usage. */ - /* */ - /* <Input> */ - /* The address of the FreeType object which is under finalization. */ - /* Its client data is accessed through its `generic' field. */ - /* */ - typedef void (*FT_Generic_Finalizer)(void* object); - - - /*************************************************************************/ - /* */ - /* <Struct> */ - /* FT_Generic */ - /* */ - /* <Description> */ - /* Client applications often need to associate their own data to a */ - /* variety of FreeType core objects. For example, a text layout API */ - /* might want to associate a glyph cache to a given size object. */ - /* */ - /* Most FreeType object contains a `generic' field, of type */ - /* FT_Generic, which usage is left to client applications and font */ - /* servers. */ - /* */ - /* It can be used to store a pointer to client-specific data, as well */ - /* as the address of a `finalizer' function, which will be called by */ - /* FreeType when the object is destroyed (for example, the previous */ - /* client example would put the address of the glyph cache destructor */ - /* in the `finalizer' field). */ - /* */ - /* <Fields> */ - /* data :: A typeless pointer to any client-specified data. This */ - /* field is completely ignored by the FreeType library. */ - /* */ - /* finalizer :: A pointer to a `generic finalizer' function, which */ - /* will be called when the object is destroyed. If this */ - /* field is set to NULL, no code will be called. */ - /* */ - typedef struct FT_Generic_ - { - void* data; - FT_Generic_Finalizer finalizer; - - } FT_Generic; - - - /*************************************************************************/ - /* */ /* <Struct> */ /* FT_Bitmap_Size */ /* */ @@ -783,33 +824,121 @@ FT_BEGIN_HEADER /* */ + /*********************************************************************** + * + * @macro: FT_HAS_HORIZONTAL (face) + * + * @description: + * a macro that returns true whenever a face object contains horizontal + * metrics. (this is true for all font formats though). + * + * @also: + * @FT_HAS_VERTICAL can be used to check for vertical metrics. + */ #define FT_HAS_HORIZONTAL( face ) \ ( face->face_flags & FT_FACE_FLAG_HORIZONTAL ) + /*********************************************************************** + * + * @macro: FT_HAS_VERTICAL (face) + * + * @description: + * a macro that returns true whenever a face object contains vertical + * metrics. + */ #define FT_HAS_VERTICAL( face ) \ ( face->face_flags & FT_FACE_FLAG_VERTICAL ) + /*********************************************************************** + * + * @macro: FT_HAS_KERNING (face) + * + * @description: + * a macro that returns true whenever a face object contains kerning + * data that can be accessed with @FT_Get_Kerning + */ #define FT_HAS_KERNING( face ) \ ( face->face_flags & FT_FACE_FLAG_KERNING ) + /*********************************************************************** + * + * @macro: FT_IS_SCALABLE (face) + * + * @description: + * a macro that returns true whenever a face object contains a scalable + * font face. I.e., true for TrueType, Type 1, CID and OpenType/CFF + * font formats. + */ #define FT_IS_SCALABLE( face ) \ ( face->face_flags & FT_FACE_FLAG_SCALABLE ) + + /*********************************************************************** + * + * @macro: FT_IS_SFNT (face) + * + * @description: + * a macro that returns true whenever a face object contains a font whose + * format is based on the SFNT storage scheme. This usually means: + * TrueType fonts, OpenType fonts, as well as SFNT-based embedded bitmap + * fonts. + * + * When this macro is true, all functions defined in @FT_SFNT_NAMES_H + * and @FT_TRUETYPE_TABLES_H are available + */ #define FT_IS_SFNT( face ) \ ( face->face_flags & FT_FACE_FLAG_SFNT ) + /*********************************************************************** + * + * @macro: FT_IS_FIXED_WIDTH (face) + * + * @description: + * a macro that returns true whenever a face object contains a font + * face that contains fixed-width (or "monospace", "fixed-pitch", etc..) + * glyphs. + */ #define FT_IS_FIXED_WIDTH( face ) \ ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) + + /*********************************************************************** + * + * @macro: FT_IS_FIXED_SIZES (face) + * + * @description: + * a macro that returns true whenever a face object contains some + * embedded bitmaps. See the 'fixed_sizes' field of the @FT_FaceRec + * structure. + */ #define FT_HAS_FIXED_SIZES( face ) \ ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES ) + /* */ + #define FT_HAS_FAST_GLYPHS( face ) \ ( face->face_flags & FT_FACE_FLAG_FAST_GLYPHS ) + /*********************************************************************** + * + * @macro: FT_HAS_GLYPH_NAMES (face) + * + * @description: + * a macro that returns true whenever a face object contains some + * glyph names that can be accessed through @FT_Get_Glyph_Names + */ #define FT_HAS_GLYPH_NAMES( face ) \ ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) + /*********************************************************************** + * + * @macro: FT_HAS_MULTIPLE_MASTERS (face) + * + * @description: + * a macro that returns true whenever a face object contains some + * multiple masters. The functions provided by @FT_MULTIPLE_MASTERS_H + * are then available to choose the exact design you want. + */ #define FT_HAS_MULTIPLE_MASTERS( face ) \ ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) @@ -1006,7 +1135,7 @@ FT_BEGIN_HEADER /* generic :: A typeless pointer which is unused by the */ /* FreeType library or any of its drivers. It */ /* can be used by client applications to link */ - /* their own data to each size object. */ + /* their own data to each glyph slot object. */ /* */ /* metrics :: The metrics of the last loaded glyph in the */ /* slot. The returned values depend on the last */ @@ -1089,9 +1218,10 @@ FT_BEGIN_HEADER /* image format. */ /* */ /* <Note> */ - /* If FT_Load_Glyph() is called with default flags (FT_LOAD_DEFAULT), */ - /* the glyph image is loaded in the glyph slot in its native format */ - /* (e.g. a vectorial outline for TrueType and Type 1 formats). */ + /* If @FT_Load_Glyph() is called with default flags (see */ + /* @FT_LOAD_DEFAULT ) the glyph image is loaded in the glyph slot in */ + /* its native format (e.g. a vectorial outline for TrueType and */ + /* Type 1 formats). */ /* */ /* This image can later be converted into a bitmap by calling */ /* FT_Render_Glyph(). This function finds the current renderer for */ @@ -1333,14 +1463,10 @@ FT_BEGIN_HEADER /* slot for the face object which can be accessed directly through */ /* `face->glyph'. */ /* */ - /* Note that additional slots can be added to each face with the */ - /* FT_New_GlyphSlot() API function. Slots are linked in a single */ - /* list through their `next' field. */ - /* */ /* FT_New_Face() can be used to determine and/or check the font */ /* format of a given font resource. If the `face_index' field is */ /* negative, the function will _not_ return any face handle in */ - /* `aface'. Its return value should be 0 if the resource is */ + /* `aface'. Its return value should be 0 if the font format is */ /* recognized, or non-zero if not. */ /* */ FT_EXPORT( FT_Error ) FT_New_Face( FT_Library library, @@ -1379,14 +1505,10 @@ FT_BEGIN_HEADER /* slot for the face object which can be accessed directly through */ /* `face->glyph'. */ /* */ - /* Note that additional slots can be added to each face with the */ - /* FT_New_GlyphSlot() API function. Slots are linked in a single */ - /* list through their `next' field. */ - /* */ /* FT_New_Memory_Face() can be used to determine and/or check the */ /* font format of a given font resource. If the `face_index' field */ /* is negative, the function will _not_ return any face handle in */ - /* `aface'. Its return value should be 0 if the resource is */ + /* `aface'. Its return value should be 0 if the font format is */ /* recognized, or non-zero if not. */ /* */ FT_EXPORT( FT_Error ) FT_New_Memory_Face( FT_Library library, @@ -1426,14 +1548,10 @@ FT_BEGIN_HEADER /* slot for the face object which can be accessed directly through */ /* `face->glyph'. */ /* */ - /* Note that additional slots can be added to each face with the */ - /* FT_New_GlyphSlot() API function. Slots are linked in a single */ - /* list through their `next' field. */ - /* */ /* FT_Open_Face() can be used to determine and/or check the font */ /* format of a given font resource. If the `face_index' field is */ /* negative, the function will _not_ return any face handle in */ - /* `*face'. Its return value should be 0 if the resource is */ + /* `*face'. Its return value should be 0 if the font format is */ /* recognized, or non-zero if not. */ /* */ FT_EXPORT( FT_Error ) FT_Open_Face( FT_Library library, @@ -2180,6 +2298,35 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ + /* <Section> */ + /* computations */ + /* */ + /* <Title> */ + /* Computations */ + /* */ + /* <Abstract> */ + /* Crunching fixed numbers and vectors */ + /* */ + /* <Description> */ + /* This section contains various functions used to perform */ + /* computations on 16.16 fixed-float numbers or 2d vectors. */ + /* */ + /* <Order> */ + /* FT_MulDiv */ + /* FT_MulFix */ + /* FT_DivFix */ + /* FT_RoundFix */ + /* FT_CeilFix */ + /* FT_FloorFix */ + /* FT_Vector_Transform */ + /* FT_Matrix_Multiply */ + /* FT_Matrix_Invert */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ /* <Function> */ /* FT_MulDiv */ /* */ @@ -2269,6 +2416,59 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ /* <Function> */ + /* FT_RoundFix */ + /* */ + /* <Description> */ + /* A very simple function used to round a 16.16 fixed number. */ + /* */ + /* <Input> */ + /* a :: The number to be rounded. */ + /* */ + /* <Return> */ + /* The result of `(a + 0x8000) & -0x10000'. */ + /* */ + FT_EXPORT( FT_Fixed ) FT_RoundFix( FT_Fixed a ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_CeilFix */ + /* */ + /* <Description> */ + /* A very simple function used to compute the ceiling function of a */ + /* 16.16 fixed number. */ + /* */ + /* <Input> */ + /* a :: The number for which the ceiling function is to be computed. */ + /* */ + /* <Return> */ + /* The result of `(a + 0x10000 - 1) & -0x10000'. */ + /* */ + FT_EXPORT( FT_Fixed ) FT_CeilFix( FT_Fixed a ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_FloorFix */ + /* */ + /* <Description> */ + /* A very simple function used to compute the floor function of a */ + /* 16.16 fixed number. */ + /* */ + /* <Input> */ + /* a :: The number for which the floor function is to be computed. */ + /* */ + /* <Return> */ + /* The result of `a & -0x10000'. */ + /* */ + FT_EXPORT( FT_Fixed ) FT_FloorFix( FT_Fixed a ); + + + /*************************************************************************/ + /* */ + /* <Function> */ /* FT_Vector_Transform */ /* */ /* <Description> */ @@ -2286,8 +2486,10 @@ FT_BEGIN_HEADER FT_EXPORT( void ) FT_Vector_Transform( FT_Vector* vec, FT_Matrix* matrix ); + /* */ + FT_END_HEADER #endif /* __FREETYPE_H__ */ diff --git a/xc/extras/freetype2/include/freetype/ftbbox.h b/xc/extras/freetype2/include/freetype/ftbbox.h index 5a8d2e769..ddc506c1f 100644 --- a/xc/extras/freetype2/include/freetype/ftbbox.h +++ b/xc/extras/freetype2/include/freetype/ftbbox.h @@ -30,14 +30,22 @@ #ifndef FTBBOX_H #define FTBBOX_H -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_FREETYPE_H + +#include <ft2build.h> +#include FT_FREETYPE_H + FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* <Section> */ + /* outline_processing */ + /* */ + /*************************************************************************/ + + /*************************************************************************/ /* */ /* <Function> */ @@ -65,6 +73,7 @@ FT_BEGIN_HEADER /* */ + FT_END_HEADER #endif /* FTBBOX_H */ diff --git a/xc/extras/freetype2/include/freetype/ftcache.h b/xc/extras/freetype2/include/freetype/ftcache.h index ddaf893a0..64d0c44d1 100644 --- a/xc/extras/freetype2/include/freetype/ftcache.h +++ b/xc/extras/freetype2/include/freetype/ftcache.h @@ -14,7 +14,6 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ -/* $XFree86: xc/extras/freetype2/include/freetype/ftcache.h,v 1.2 2001/02/13 17:20:10 tsi Exp $ */ /*************************************************************************/ @@ -35,35 +34,30 @@ #ifndef __FTCACHE_H__ #define __FTCACHE_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_GLYPH_H -FT_BEGIN_HEADER - -#ifndef USE_MAKEDEPEND - -#define FT_CACHE_MANAGER_H FT_PUBLIC_FILE(cache/ftcmanag.h) -#define FT_CACHE_IMAGE_H FT_PUBLIC_FILE(cache/ftcimage.h) -#define FT_CACHE_SMALL_BITMAPS_H FT_PUBLIC_FILE(cache/ftcsbits.h) - -#define FT_CACHE_INTERNAL_LRU_H FT_PUBLIC_FILE(cache/ftlru.h) -#define FT_CACHE_INTERNAL_GLYPH_H FT_PUBLIC_FILE(cache/ftcglyph.h) -#define FT_CACHE_INTERNAL_CHUNK_H FT_PUBLIC_FILE(cache/ftcchunk.h) +#include <ft2build.h> +#include FT_GLYPH_H -#else /* USE_MAKEDEPEND */ -#define FT_CACHE_MANAGER_H <freetype/cache/ftcmanag.h> -#define FT_CACHE_IMAGE_H <freetype/cache/ftcimage.h> -#define FT_CACHE_SMALL_BITMAPS_H <freetype/cache/ftcsbits.h> +FT_BEGIN_HEADER -#define FT_CACHE_INTERNAL_LRU_H <freetype/cache/ftlru.h> -#define FT_CACHE_INTERNAL_GLYPH_H <freetype/cache/ftcglyph.h> -#define FT_CACHE_INTERNAL_CHUNK_H <freetype/cache/ftcchunk.h> -#endif /* USE_MAKEDEPEND */ + /*************************************************************************/ + /* */ + /* <Section> */ + /* cache_subsystem */ + /* */ + /* <Title> */ + /* Cache Sub-System */ + /* */ + /* <Abstract> */ + /* How to cache face, size, and glyph data with FreeType 2. */ + /* */ + /* <Description> */ + /* This section describes the FreeType 2 cache sub-system which is */ + /* stile in beta. */ + /* */ + /*************************************************************************/ /*************************************************************************/ @@ -347,6 +341,9 @@ FT_BEGIN_HEADER FTC_Cache *acache ); + /* */ + + FT_END_HEADER #endif /* __FTCACHE_H__ */ diff --git a/xc/extras/freetype2/include/freetype/ftchapters.h b/xc/extras/freetype2/include/freetype/ftchapters.h new file mode 100644 index 000000000..af4ac1a97 --- /dev/null +++ b/xc/extras/freetype2/include/freetype/ftchapters.h @@ -0,0 +1,54 @@ +/***************************************************************************/ +/* */ +/* <Chapter> */ +/* core_api */ +/* */ +/* <Title> */ +/* Core API */ +/* */ +/* <Sections> */ +/* basic_types */ +/* base_interface */ +/* glyph_management */ +/* mac_specific */ +/* multiple_masters */ +/* truetype_tables */ +/* type1_tables */ +/* sfnt_names */ +/* module_management */ +/* system_interface */ +/* header_file_macros */ +/* */ +/***************************************************************************/ + + +/***************************************************************************/ +/* */ +/* <Chapter> */ +/* cache_subsystem */ +/* */ +/* <Title> */ +/* Cache Sub-System */ +/* */ +/* <Sections> */ +/* cache_subsystem */ +/* */ +/***************************************************************************/ + + +/***************************************************************************/ +/* */ +/* <Chapter> */ +/* support_api */ +/* */ +/* <Title> */ +/* Support API */ +/* */ +/* <Sections> */ +/* computations */ +/* list_processing */ +/* outline_processing */ +/* raster */ +/* */ +/***************************************************************************/ + diff --git a/xc/extras/freetype2/include/freetype/fterrors.h b/xc/extras/freetype2/include/freetype/fterrors.h index 8764b0167..5db4509f9 100644 --- a/xc/extras/freetype2/include/freetype/fterrors.h +++ b/xc/extras/freetype2/include/freetype/fterrors.h @@ -23,7 +23,7 @@ /* something like */ /* */ /* { */ - /* #undef FTERRORS_H */ + /* #undef __FTERRORS_H__ */ /* #define FT_ERRORDEF( e, v, s ) { e, s }, */ /* #define FT_ERROR_START_LIST { */ /* #define FT_ERROR_END_LIST { 0, 0 } }; */ @@ -34,7 +34,7 @@ /* const char* err_msg */ /* } ft_errors[] = */ /* */ - /* #include <freetype/fterrors.h> */ + /* #include FT_ERRORS_H */ /* } */ /* */ /* For C++ it might be necessary to use `extern "C" {' and to define */ diff --git a/xc/extras/freetype2/include/freetype/ftglyph.h b/xc/extras/freetype2/include/freetype/ftglyph.h index 010327c27..0e27c0417 100644 --- a/xc/extras/freetype2/include/freetype/ftglyph.h +++ b/xc/extras/freetype2/include/freetype/ftglyph.h @@ -32,15 +32,33 @@ #ifndef __FTGLYPH_H__ #define __FTGLYPH_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_FREETYPE_H + +#include <ft2build.h> +#include FT_FREETYPE_H + FT_BEGIN_HEADER + /*************************************************************************/ + /* */ + /* <Section> */ + /* glyph_management */ + /* */ + /* <Title> */ + /* Glyph Management */ + /* */ + /* <Abstract> */ + /* Generic interface to manage individual glyph data. */ + /* */ + /* <Description> */ + /* This section contains definitions used to manage glyph data */ + /* through generic FT_Glyph objects. Each of them can contain a */ + /* bitmap, a vector outline, or even images in other formats. */ + /* */ + /*************************************************************************/ + + /* forward declaration to a private type */ typedef struct FT_Glyph_Class_ FT_Glyph_Class; @@ -219,17 +237,8 @@ FT_BEGIN_HEADER FT_Matrix* matrix, FT_Vector* delta ); - - enum - { - ft_glyph_bbox_unscaled = 0, /* return unscaled font units */ - ft_glyph_bbox_subpixels = 0, /* return unfitted 26.6 coordinates */ - ft_glyph_bbox_gridfit = 1, /* return grid-fitted 26.6 coordinates */ - ft_glyph_bbox_truncate = 2, /* return coordinates in integer pixels */ - ft_glyph_bbox_pixels = 3 /* return grid-fitted pixel coordinates */ - }; - - + /* */ + /*************************************************************************/ /* */ /* <Function> */ @@ -292,6 +301,16 @@ FT_BEGIN_HEADER /* */ /* The default value for `bbox_mode' is `ft_glyph_bbox_pixels'. */ /* */ + enum + { + ft_glyph_bbox_unscaled = 0, /* return unscaled font units */ + ft_glyph_bbox_subpixels = 0, /* return unfitted 26.6 coordinates */ + ft_glyph_bbox_gridfit = 1, /* return grid-fitted 26.6 coordinates */ + ft_glyph_bbox_truncate = 2, /* return coordinates in integer pixels */ + ft_glyph_bbox_pixels = 3 /* return grid-fitted pixel coordinates */ + }; + + FT_EXPORT( void ) FT_Glyph_Get_CBox( FT_Glyph glyph, FT_UInt bbox_mode, FT_BBox *acbox ); @@ -390,6 +409,13 @@ FT_BEGIN_HEADER /* other helpful functions */ + /*************************************************************************/ + /* */ + /* <Section> */ + /* computations */ + /* */ + /*************************************************************************/ + /*************************************************************************/ /* */ @@ -430,6 +456,9 @@ FT_BEGIN_HEADER FT_EXPORT( FT_Error ) FT_Matrix_Invert( FT_Matrix* matrix ); + /* */ + + FT_END_HEADER #endif /* __FTGLYPH_H__ */ diff --git a/xc/extras/freetype2/include/freetype/ftimage.h b/xc/extras/freetype2/include/freetype/ftimage.h index 16f42ca6f..aec6db95c 100644 --- a/xc/extras/freetype2/include/freetype/ftimage.h +++ b/xc/extras/freetype2/include/freetype/ftimage.h @@ -28,16 +28,22 @@ #define __FTIMAGE_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H +#include <ft2build.h> + FT_BEGIN_HEADER /*************************************************************************/ /* */ + /* <Section> */ + /* basic_types */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ /* <Type> */ /* FT_Pos */ /* */ @@ -73,6 +79,33 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ + /* <Struct> */ + /* FT_BBox */ + /* */ + /* <Description> */ + /* A structure used to hold an outline's bounding box, i.e., the */ + /* coordinates of its extrema in the horizontal and vertical */ + /* directions. */ + /* */ + /* <Fields> */ + /* xMin :: The horizontal minimum (left-most). */ + /* */ + /* yMin :: The vertical minimum (bottom-most). */ + /* */ + /* xMax :: The horizontal maximum (right-most). */ + /* */ + /* yMax :: The vertical maximum (top-most). */ + /* */ + typedef struct FT_BBox_ + { + FT_Pos xMin, yMin; + FT_Pos xMax, yMax; + + } FT_BBox; + + + /*************************************************************************/ + /* */ /* <Enum> */ /* FT_Pixel_Mode */ /* */ @@ -230,6 +263,14 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ + /* <Section> */ + /* outline_processing */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ /* <Struct> */ /* FT_Outline */ /* */ @@ -348,7 +389,8 @@ FT_BEGIN_HEADER } FT_Outline_Flags; - + /* */ + #define FT_CURVE_TAG( flag ) ( flag & 3 ) #define FT_Curve_Tag_On 1 @@ -520,6 +562,14 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ + /* <Section> */ + /* basic_types */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ /* <Macro> */ /* FT_IMAGE_TAG */ /* */ @@ -599,6 +649,23 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ + /* <Section> */ + /* Raster */ + /* */ + /* <Title> */ + /* Scanline converter */ + /* */ + /* <Abstract> */ + /* How vectorial outlines are converted into bitmaps and pixmaps. */ + /* */ + /* <Description> */ + /* This section contains technical definitions. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ /* <Type> */ /* FT_Raster */ /* */ @@ -637,9 +704,9 @@ FT_BEGIN_HEADER /* */ typedef struct FT_Span_ { - short x; - unsigned short len; - unsigned char coverage; + short x; + unsigned short len; + unsigned char coverage; } FT_Span; @@ -749,23 +816,40 @@ FT_BEGIN_HEADER /* <Fields> */ /* ft_raster_flag_default :: This value is 0. */ /* */ - /* ft_raster_flag_aa :: Requests the rendering of an */ - /* anti-aliased glyph bitmap. If unset, a */ - /* monchrome bitmap will be rendered. */ - /* */ - /* ft_raster_flag_direct :: Requests direct rendering over the */ - /* target bitmap. Direct rendering uses */ - /* user-provided callbacks in order to */ - /* perform direct drawing or composition */ - /* over an existing bitmap. If this bit is */ - /* unset, the content of the target bitmap */ - /* *must be zeroed*! */ + /* ft_raster_flag_aa :: This flag is set to indicate that an */ + /* anti-aliased glyph image should be */ + /* generated. Otherwise, it will be */ + /* monochrome (1-bit) */ + /* */ + /* ft_raster_flag_direct :: This flag is set to indicate direct */ + /* rendering. In this mode, client */ + /* applications must provide their own span */ + /* callback. This lets them directly */ + /* draw or compose over an existing bitmap. */ + /* If this bit is not set, the target */ + /* pixmap's buffer _must_ be zeroed before */ + /* rendering. */ + /* */ + /* Note that for now, direct rendering is */ + /* only possible with anti-aliased glyphs. */ + /* */ + /* ft_raster_flag_clip :: This flag is only used in direct */ + /* rendering mode. If set, the output will */ + /* be clipped to a box specified in the */ + /* "clip_box" field of the FT_Raster_Params */ + /* structure. */ + /* */ + /* Note that by default, the glyph bitmap */ + /* is clipped to the target pixmap, except */ + /* in direct rendering mode where all spans */ + /* are generated if no clipping box is set. */ /* */ typedef enum { ft_raster_flag_default = 0, ft_raster_flag_aa = 1, - ft_raster_flag_direct = 2 + ft_raster_flag_direct = 2, + ft_raster_flag_clip = 4 } FT_Raster_Flag; @@ -798,6 +882,9 @@ FT_BEGIN_HEADER /* user :: User-supplied data that is passed to each drawing */ /* callback. */ /* */ + /* clip_box :: an optional clipping box. It is only used in */ + /* direct rendering mode */ + /* */ /* <Note> */ /* An anti-aliased glyph bitmap is drawn if the ft_raster_flag_aa bit */ /* flag is set in the `flags' field, otherwise a monochrome bitmap */ @@ -825,6 +912,7 @@ FT_BEGIN_HEADER FT_Raster_BitTest_Func bit_test; FT_Raster_BitSet_Func bit_set; void* user; + FT_BBox clip_box; } FT_Raster_Params; @@ -995,8 +1083,10 @@ FT_BEGIN_HEADER } FT_Raster_Funcs; -FT_END_HEADER + /* */ + +FT_END_HEADER #endif /* __FTIMAGE_H__ */ diff --git a/xc/extras/freetype2/include/freetype/ftlist.h b/xc/extras/freetype2/include/freetype/ftlist.h index bf847878a..814ef0858 100644 --- a/xc/extras/freetype2/include/freetype/ftlist.h +++ b/xc/extras/freetype2/include/freetype/ftlist.h @@ -1,6 +1,6 @@ /***************************************************************************/ /* */ -/* ftlist.c */ +/* ftlist.h */ /* */ /* Generic list support for FreeType (specification). */ /* */ @@ -27,17 +27,50 @@ #ifndef __FTLIST_H__ #define __FTLIST_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_FREETYPE_H + +#include <ft2build.h> +#include FT_FREETYPE_H + FT_BEGIN_HEADER /*************************************************************************/ /* */ + /* <Section> */ + /* list_processing */ + /* */ + /* <Title> */ + /* List Processing */ + /* */ + /* <Abstract> */ + /* Simple management of lists. */ + /* */ + /* <Description> */ + /* This section contains various definitions related to list */ + /* processing using doubly-linked nodes. */ + /* */ + /* <Order> */ + /* FT_List */ + /* FT_ListNode */ + /* FT_ListRec */ + /* FT_ListNodeRec */ + /* */ + /* FT_List_Add */ + /* FT_List_Insert */ + /* FT_List_Find */ + /* FT_List_Remove */ + /* FT_List_Up */ + /* FT_List_Iterate */ + /* FT_List_Iterator */ + /* FT_List_Finalize */ + /* FT_List_Destructor */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ /* <Function> */ /* FT_List_Find */ /* */ @@ -215,8 +248,12 @@ FT_BEGIN_HEADER void* user ); + /* */ + + FT_END_HEADER #endif /* __FTLIST_H__ */ + /* END */ diff --git a/xc/extras/freetype2/include/freetype/ftmac.h b/xc/extras/freetype2/include/freetype/ftmac.h index a036c5500..4c7f06938 100644 --- a/xc/extras/freetype2/include/freetype/ftmac.h +++ b/xc/extras/freetype2/include/freetype/ftmac.h @@ -29,9 +29,28 @@ #define __FT_MAC_H__ -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* mac_specific */ + /* */ + /* <Title> */ + /* Mac-Specific Interface */ + /* */ + /* <Abstract> */ + /* Only available on the Macintosh. */ + /* */ + /* <Description> */ + /* The following definitions are only available if FreeType is */ + /* compiled on a Macintosh. */ + /* */ + /*************************************************************************/ /*************************************************************************/ @@ -61,8 +80,10 @@ /* This function can be used to create FT_Face abjects from fonts */ /* that are installed in the system like so: */ /* */ + /* { */ /* fond = GetResource( 'FOND', fontName ); */ /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */ + /* } */ /* */ FT_EXPORT( FT_Error ) FT_New_Face_From_FOND( FT_Library library, Handle fond, @@ -70,9 +91,10 @@ FT_Face *aface ); -#ifdef __cplusplus - } -#endif + /* */ + + +FT_END_HEADER #endif /* __FT_MAC_H__ */ diff --git a/xc/extras/freetype2/include/freetype/ftmm.h b/xc/extras/freetype2/include/freetype/ftmm.h index 7734786d8..137ce8491 100644 --- a/xc/extras/freetype2/include/freetype/ftmm.h +++ b/xc/extras/freetype2/include/freetype/ftmm.h @@ -19,14 +19,33 @@ #ifndef __FTMM_H__ #define __FTMM_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_TYPE1_TABLES_H + +#include <ft2build.h> +#include FT_TYPE1_TABLES_H + FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* <Section> */ + /* multiple_masters */ + /* */ + /* <Title> */ + /* Multiple Masters */ + /* */ + /* <Abstract> */ + /* How to manage Multiple Masters fonts. */ + /* */ + /* <Description> */ + /* The following types and functions are used to manage Multiple */ + /* Master fonts, i.e. the selection of specific design instances by */ + /* setting design axis coordinates. */ + /* */ + /*************************************************************************/ + + /*************************************************************************/ /* */ /* <Struct> */ @@ -79,6 +98,7 @@ FT_BEGIN_HEADER } FT_Multi_Master; + /* */ typedef FT_Error (*FT_Get_MM_Func)( FT_Face face, FT_Multi_Master* master ); @@ -168,6 +188,9 @@ FT_BEGIN_HEADER FT_Fixed* coords ); + /* */ + + FT_END_HEADER #endif /* __FTMM_H__ */ diff --git a/xc/extras/freetype2/include/freetype/ftmodule.h b/xc/extras/freetype2/include/freetype/ftmodule.h index fd07aaa4f..3fcc95e8f 100644 --- a/xc/extras/freetype2/include/freetype/ftmodule.h +++ b/xc/extras/freetype2/include/freetype/ftmodule.h @@ -19,14 +19,32 @@ #ifndef __FTMODULE_H__ #define __FTMODULE_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_FREETYPE_H + +#include <ft2build.h> +#include FT_FREETYPE_H + FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* <Section> */ + /* module_management */ + /* */ + /* <Title> */ + /* Module Management */ + /* */ + /* <Abstract> */ + /* How to add, upgrade, and remove modules from FreeType. */ + /* */ + /* <Description> */ + /* The definitions below are used to manage modules within FreeType. */ + /* Modules can be added, upgraded, and removed at runtime. */ + /* */ + /*************************************************************************/ + + /* module bit flags */ typedef enum FT_Module_Flags_ { @@ -266,6 +284,9 @@ FT_BEGIN_HEADER FT_EXPORT( void ) FT_Add_Default_Modules( FT_Library library ); + /* */ + + FT_END_HEADER #endif /* __FTMODULE_H__ */ diff --git a/xc/extras/freetype2/include/freetype/ftoutln.h b/xc/extras/freetype2/include/freetype/ftoutln.h index 37e6b4ba1..da4d2cb6a 100644 --- a/xc/extras/freetype2/include/freetype/ftoutln.h +++ b/xc/extras/freetype2/include/freetype/ftoutln.h @@ -20,17 +20,58 @@ #ifndef __FTOUTLN_H__ #define __FTOUTLN_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_FREETYPE_H + +#include <ft2build.h> +#include FT_FREETYPE_H + FT_BEGIN_HEADER /*************************************************************************/ /* */ + /* <Section> */ + /* outline_processing */ + /* */ + /* <Title> */ + /* Outline Processing */ + /* */ + /* <Abstract> */ + /* Functions to create, transform, and render vectorial glyph images. */ + /* */ + /* <Description> */ + /* This section contains routines used to create and destroy scalable */ + /* glyph images known as `outlines'. These can also be measured, */ + /* transformed, and converted into bitmaps and pixmaps. */ + /* */ + /* <Order> */ + /* FT_Outline */ + /* FT_Outline_Flags */ + /* FT_Outline_New */ + /* FT_Outline_Done */ + /* FT_Outline_Copy */ + /* FT_Outline_Translate */ + /* FT_Outline_Transform */ + /* FT_Outline_Reverse */ + /* */ + /* FT_Outline_Get_CBox */ + /* FT_Outline_Get_BBox */ + /* */ + /* FT_Outline_Get_Bitmap */ + /* FT_Outline_Render */ + /* */ + /* FT_Outline_Decompose */ + /* FT_Outline_Funcs */ + /* FT_Outline_MoveTo_Func */ + /* FT_Outline_LineTo_Func */ + /* FT_Outline_ConicTo_Func */ + /* FT_Outline_CubicTo_Func */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ /* <Function> */ /* FT_Outline_Decompose */ /* */ @@ -316,6 +357,10 @@ FT_BEGIN_HEADER FT_Outline* outline, FT_Raster_Params* params ); + + /* */ + + FT_END_HEADER #endif /* __FTOUTLN_H__ */ diff --git a/xc/extras/freetype2/include/freetype/ftrender.h b/xc/extras/freetype2/include/freetype/ftrender.h index 2a19fc060..c6a0d2e77 100644 --- a/xc/extras/freetype2/include/freetype/ftrender.h +++ b/xc/extras/freetype2/include/freetype/ftrender.h @@ -19,16 +19,23 @@ #ifndef __FTRENDER_H__ #define __FTRENDER_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_MODULE_H -#include FT_GLYPH_H + +#include <ft2build.h> +#include FT_MODULE_H +#include FT_GLYPH_H + FT_BEGIN_HEADER + /*************************************************************************/ + /* */ + /* <Section> */ + /* module_management */ + /* */ + /*************************************************************************/ + + /* create a new glyph object */ typedef FT_Error (*FT_Glyph_Init_Func) ( FT_Glyph glyph, FT_GlyphSlot slot ); @@ -181,8 +188,10 @@ FT_BEGIN_HEADER FT_UInt num_params, FT_Parameter* parameters ); + /* */ + FT_END_HEADER #endif /* __FTRENDER_H__ */ diff --git a/xc/extras/freetype2/include/freetype/ftsnames.h b/xc/extras/freetype2/include/freetype/ftsnames.h new file mode 100644 index 000000000..b81b314d8 --- /dev/null +++ b/xc/extras/freetype2/include/freetype/ftsnames.h @@ -0,0 +1,159 @@ +/***************************************************************************/ +/* */ +/* ftsnames.h */ +/* */ +/* Simple interface to access SFNT name tables (which are used */ +/* to hold font names, copyright info, notices, etc.) (specification). */ +/* */ +/* This is _not_ used to retrieve glyph names! */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FT_SFNT_NAMES_H__ +#define __FT_SFNT_NAMES_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Section> */ + /* sfnt_names */ + /* */ + /* <Title> */ + /* SFNT Names */ + /* */ + /* <Abstract> */ + /* Access the names embedded in TrueType and OpenType files. */ + /* */ + /* <Description> */ + /* The TrueType and OpenType specification allow the inclusion of */ + /* a special `names table' in font files. This table contains */ + /* textual (and internationalized) information regarding the font, */ + /* like family name, copyright, version, etc. */ + /* */ + /* The definitions below are used to access them if available. */ + /* */ + /* Note that this has nothing to do with glyph names! */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* FT_SfntName */ + /* */ + /* <Description> */ + /* A structure used to model an SFNT `name' table entry. */ + /* */ + /* <Fields> */ + /* platform_id :: The platform ID for `string'. */ + /* */ + /* encoding_id :: The encoding ID for `string'. */ + /* */ + /* language_id :: The language ID for `string'. */ + /* */ + /* name_id :: An identifier for `string'. */ + /* */ + /* string :: The `name' string. Note that its format differs */ + /* depending on the (platform,encoding) pair. It can */ + /* be a Pascal String, a UTF-16 one, etc.. */ + /* */ + /* Generally speaking, the string is not */ + /* zero-terminated. Please refer to the TrueType */ + /* specification for details.. */ + /* */ + /* string_len :: The length of `string' in bytes. */ + /* */ + /* <Note> */ + /* Possible values for `platform_id', `encoding_id', `language_id', */ + /* and `name_id' are given in the file `ttnameid.h'. For details */ + /* please refer to the TrueType or OpenType specification. */ + /* */ + typedef struct FT_SfntName_ + { + FT_UShort platform_id; + FT_UShort encoding_id; + FT_UShort language_id; + FT_UShort name_id; + + FT_Byte* string; /* this string is *not* null-terminated! */ + FT_UInt string_len; /* in bytes */ + + } FT_SfntName; + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Sfnt_Name_Count */ + /* */ + /* <Description> */ + /* Retrieves the number of name strings in the SFNT `name' table. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face. */ + /* */ + /* <Return> */ + /* The number of strings in the `name' table. */ + /* */ + FT_EXPORT( FT_UInt ) FT_Get_Sfnt_Name_Count( FT_Face face ); + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* FT_Get_Sfnt_Name */ + /* */ + /* <Description> */ + /* Retrieves a string of the SFNT `name' table for a given index. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face. */ + /* */ + /* index :: The index of the `name' string. */ + /* */ + /* <Output> */ + /* aname :: The indexed FT_SfntName structure. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* The `string' array returned in the `aname' structure is not */ + /* null-terminated. */ + /* */ + /* Use FT_Get_Sfnt_Name_Count() to get the total number of available */ + /* `name' table entries, then do a loop until you get the right */ + /* platform, encoding, and name ID. */ + /* */ + FT_EXPORT( FT_Error ) FT_Get_Sfnt_Name( FT_Face face, + FT_UInt index, + FT_SfntName *aname ); + + + /* */ + + +FT_END_HEADER + +#endif /* __FT_SFNT_NAMES_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/include/freetype/ftsynth.h b/xc/extras/freetype2/include/freetype/ftsynth.h index e51aacf4b..902431902 100644 --- a/xc/extras/freetype2/include/freetype/ftsynth.h +++ b/xc/extras/freetype2/include/freetype/ftsynth.h @@ -37,14 +37,14 @@ #ifndef __FTSYNTH_H__ #define __FTSYNTH_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_FREETYPE_H + +#include <ft2build.h> +#include FT_FREETYPE_H + FT_BEGIN_HEADER + /* This code is completely experimental -- use with care! */ /* It will probably be completely rewritten in the future */ /* or even integrated into the library. */ @@ -56,8 +56,8 @@ FT_BEGIN_HEADER FT_Outline* outline, FT_Pos* advance ); -FT_END_HEADER +FT_END_HEADER #endif /* __FTSYNTH_H__ */ diff --git a/xc/extras/freetype2/include/freetype/ftsystem.h b/xc/extras/freetype2/include/freetype/ftsystem.h index 7620bd66d..f355421d2 100644 --- a/xc/extras/freetype2/include/freetype/ftsystem.h +++ b/xc/extras/freetype2/include/freetype/ftsystem.h @@ -16,37 +16,120 @@ /***************************************************************************/ -#ifndef FTSYSTEM_H -#define FTSYSTEM_H +#ifndef __FTSYSTEM_H__ +#define __FTSYSTEM_H__ -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> +FT_BEGIN_HEADER + + /************************************************************************** + * + * <Section> system_interface + * + * <Title> System Interface + * + * <Abstract> + * How FreeType manages memory and i/o + * + * <Description> + * This section contains various definitions related to memory + * management and i/o access. You'll need to understand this + * information if you want to use a custom memory manager or + * you own input i/o streams + * + */ + /*************************************************************************/ /* */ /* M E M O R Y M A N A G E M E N T */ /* */ /*************************************************************************/ - + /********************************************************************** + * + * @type: FT_Memory + * + * @description: + * a handle to a given memory manager object, defined with a + * @FT_MemoryRec structure. + */ typedef struct FT_MemoryRec_* FT_Memory; + /********************************************************************** + * + * @functype: FT_Alloc_Func + * + * @description: + * a function used to allocate "size" bytes from "memory" + * + * @input: + * memory :: handle to source memory manager + * size :: size in bytes to allocate + * + * @return: + * address of new memory block. 0 in case of failure + */ typedef void* (*FT_Alloc_Func)( FT_Memory memory, long size ); + + /********************************************************************** + * + * @functype: FT_Free_Func + * + * @description: + * a function used to release a given block of memory + * + * @input: + * memory :: handle to source memory manager + * block :: address of target memory block + */ typedef void (*FT_Free_Func)( FT_Memory memory, void* block ); + /********************************************************************** + * + * @functype: FT_Realloc_Func + * + * @description: + * a function used to re-allocate a given block of memory + * + * @input: + * memory :: handle to source memory manager + * cur_size :: the block's current size in bytes + * new_size :: the block's requested new size + * block :: the block's current address + * + * @return: + * new block address. 0 in case of memory shortage. + * + * @note: + * note that in case of error, the old block must still be available + */ typedef void* (*FT_Realloc_Func)( FT_Memory memory, long cur_size, long new_size, void* block ); + /********************************************************************** + * + * @struct: FT_MemoryRec + * + * @description: + * a structure used to describe a given memory manager to FreeType 2 + * + * @fields: + * user :: + * alloc :: + * free :: + * realloc :: + * + */ struct FT_MemoryRec_ { void* user; @@ -63,6 +146,26 @@ /*************************************************************************/ + /************************************************************************ + * + * @type: FT_Stream + * + * @description: + * a handle to an input stream. + */ + typedef struct FT_StreamRec_* FT_Stream; + + + + /************************************************************************ + * + * @struct: FT_StreamDesc + * + * @description: + * a union type used to store either a long or a pointer. This is + * used to store a file descriptor or a FILE* in an input stream + * + */ typedef union FT_StreamDesc_ { long value; @@ -71,17 +174,80 @@ } FT_StreamDesc; - typedef struct FT_StreamRec_* FT_Stream; - - + /************************************************************************ + * + * @functype: FT_Stream_IO + * + * @description: + * a function used to seek and read data from a given input stream + * + * @input: + * stream :: handle to source stream + * offset :: offset of read in stream (always from start) + * buffer :: address of read buffer + * count :: number of bytes to read from the stream + * + * @return: + * number of bytes effectively read by the stream + * + * @note: + * this function might be called to perform seek / skip with + * a "count" of 0 + */ typedef unsigned long (*FT_Stream_IO)( FT_Stream stream, unsigned long offset, unsigned char* buffer, unsigned long count ); + /************************************************************************ + * + * @functype: FT_Stream_Close + * + * @description: + * a function used to close a given input stream + * + * @input: + * stream :: handle to target stream + */ typedef void (*FT_Stream_Close)( FT_Stream stream ); + /************************************************************************ + * + * @struct: FT_StreamRec + * + * @description: + * a structure used to describe an input stream + * + * @input: + * base :: for memory-based stream, this is the address of the first + * stream byte in memory. this field should always be set to + * NULL for disk-based streams. + * + * size :: the stream size in bytes + * pos :: the current position within the stream + * + * descriptor :: this field is a union that can hold an integer or a pointer + * it is used by stream implementations to store file + * descriptors or FILE* pointers.. + * + * pathname :: this field is completely ignored by FreeType, however, + * it's often useful during debugging to use it to store + * the stream's filename, where available + * + * read :: the stream's input function + * close :: the stream close function + * + * memory :: memory manager to use to preload frames. this is set + * internally by FreeType and shouldn't be touched by + * stream implementations + * + * cursor :: this field is set and used internally by FreeType + * when parsing frames. + * + * limit :: this field is set and used internally by FreeType + * when parsing frames. + */ struct FT_StreamRec_ { unsigned char* base; @@ -89,8 +255,7 @@ unsigned long pos; FT_StreamDesc descriptor; - FT_StreamDesc pathname; /* ignored by FreeType -- */ - /* useful for debugging */ + FT_StreamDesc pathname; FT_Stream_IO read; FT_Stream_Close close; @@ -100,12 +265,12 @@ }; -#ifdef __cplusplus - } -#endif + /* */ + +FT_END_HEADER -#endif /* FTSYSTEM_H */ +#endif /* __FTSYSTEM_H__ */ /* END */ diff --git a/xc/extras/freetype2/include/freetype/fttypes.h b/xc/extras/freetype2/include/freetype/fttypes.h index e5eabb63c..32de95f31 100644 --- a/xc/extras/freetype2/include/freetype/fttypes.h +++ b/xc/extras/freetype2/include/freetype/fttypes.h @@ -19,17 +19,65 @@ #ifndef __FTTYPES_H__ #define __FTTYPES_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_SYSTEM_H -#include FT_IMAGE_H -#include <stddef.h> +#include <ft2build.h> +#include FT_SYSTEM_H +#include FT_IMAGE_H + +#include <stddef.h> + FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* <Section> */ + /* basic_types */ + /* */ + /* <Title> */ + /* Basic Types */ + /* */ + /* <Abstract> */ + /* The basic data types defined by the library. */ + /* */ + /* <Description> */ + /* This section contains the basic data types defined by FreeType 2, */ + /* ranging from simple scalar types to font specific ones. */ + /* */ + /* <Order> */ + /* FT_Byte */ + /* FT_Char */ + /* FT_Int */ + /* FT_UInt */ + /* FT_Short */ + /* FT_UShort */ + /* FT_Long */ + /* FT_ULong */ + /* FT_Bool */ + /* FT_Offset */ + /* FT_PtrDist */ + /* FT_Error */ + /* FT_Fixed */ + /* FT_Pointer */ + /* FT_Pos */ + /* FT_Vector */ + /* FT_BBox */ + /* FT_Matrix */ + /* */ + /* FT_Generic */ + /* FT_Generic_Finalizer */ + /* */ + /* FT_Bitmap */ + /* FT_Pixel_Mode */ + /* FT_Palette_Mode */ + /* FT_Glyph_Format */ + /* FT_IMAGE_TAG */ + /* FT_Glyph_Format */ + /* */ + /*************************************************************************/ + + /*************************************************************************/ /* */ /* <Type> */ @@ -224,6 +272,32 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ + /* <Type> */ + /* FT_Offset */ + /* */ + /* <Description> */ + /* This is equivalent to the ANSI C `size_t' type, i.e. the largest */ + /* _unsigned_ integer type used to express a file size or position, */ + /* or a memory block size. */ + /* */ + typedef size_t FT_Offset; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* FT_PtrDist */ + /* */ + /* <Description> */ + /* This is equivalent to the ANSI C `ptrdiff_t' type, i.e. the */ + /* largest _signed_ integer type used to express the distance */ + /* between two pointers. */ + /* */ + typedef size_t FT_PtrDist; + + + /*************************************************************************/ + /* */ /* <Struct> */ /* FT_UnitVector */ /* */ @@ -277,29 +351,55 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ + /* <FuncType> */ + /* FT_Generic_Finalizer */ + /* */ + /* <Description> */ + /* Describes a function used to destroy the `client' data of any */ + /* FreeType object. See the description of the FT_Generic type for */ + /* details of usage. */ + /* */ + /* <Input> */ + /* The address of the FreeType object which is under finalization. */ + /* Its client data is accessed through its `generic' field. */ + /* */ + typedef void (*FT_Generic_Finalizer)(void* object); + + + /*************************************************************************/ + /* */ /* <Struct> */ - /* FT_BBox */ + /* FT_Generic */ /* */ /* <Description> */ - /* A structure used to hold an outline's bounding box, i.e., the */ - /* coordinates of its extrema in the horizontal and vertical */ - /* directions. */ + /* Client applications often need to associate their own data to a */ + /* variety of FreeType core objects. For example, a text layout API */ + /* might want to associate a glyph cache to a given size object. */ /* */ - /* <Fields> */ - /* xMin :: The horizontal minimum (left-most). */ + /* Most FreeType object contains a `generic' field, of type */ + /* FT_Generic, which usage is left to client applications and font */ + /* servers. */ /* */ - /* yMin :: The vertical minimum (bottom-most). */ + /* It can be used to store a pointer to client-specific data, as well */ + /* as the address of a `finalizer' function, which will be called by */ + /* FreeType when the object is destroyed (for example, the previous */ + /* client example would put the address of the glyph cache destructor */ + /* in the `finalizer' field). */ /* */ - /* xMax :: The horizontal maximum (right-most). */ + /* <Fields> */ + /* data :: A typeless pointer to any client-specified data. This */ + /* field is completely ignored by the FreeType library. */ /* */ - /* yMax :: The vertical maximum (top-most). */ + /* finalizer :: A pointer to a `generic finalizer' function, which */ + /* will be called when the object is destroyed. If this */ + /* field is set to NULL, no code will be called. */ /* */ - typedef struct FT_BBox_ + typedef struct FT_Generic_ { - FT_Pos xMin, yMin; - FT_Pos xMax, yMax; + void* data; + FT_Generic_Finalizer finalizer; - } FT_BBox; + } FT_Generic; /*************************************************************************/ @@ -329,6 +429,14 @@ FT_BEGIN_HEADER /*************************************************************************/ /* */ + /* <Section> */ + /* list_processing */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ /* <Type> */ /* FT_ListNode */ /* */ @@ -396,10 +504,12 @@ FT_BEGIN_HEADER } FT_ListRec; + /* */ #define FT_IS_EMPTY( list ) ( (list).head == 0 ) + FT_END_HEADER #endif /* __FTTYPES_H__ */ diff --git a/xc/extras/freetype2/include/freetype/internal/autohint.h b/xc/extras/freetype2/include/freetype/internal/autohint.h index 958ee9bda..cbfc1855d 100644 --- a/xc/extras/freetype2/include/freetype/internal/autohint.h +++ b/xc/extras/freetype2/include/freetype/internal/autohint.h @@ -69,14 +69,14 @@ /* */ /*************************************************************************/ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_FREETYPE_H + +#include <ft2build.h> +#include FT_FREETYPE_H + FT_BEGIN_HEADER + typedef struct FT_AutoHinterRec_ *FT_AutoHinter; diff --git a/xc/extras/freetype2/include/freetype/internal/cfferrs.h b/xc/extras/freetype2/include/freetype/internal/cfferrs.h new file mode 100644 index 000000000..b6588d486 --- /dev/null +++ b/xc/extras/freetype2/include/freetype/internal/cfferrs.h @@ -0,0 +1,130 @@ +/***************************************************************************/ +/* */ +/* cfferrs.h */ +/* */ +/* OpenType error ID definitions (specification only). */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __CFFERRORS_H__ +#define __CFFERRORS_H__ + + +#include <ft2build.h> + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* Error codes declaration */ + /* */ + /* The error codes are grouped in `classes' used to indicate the `level' */ + /* at which the error happened. The class is given by an error code's */ + /* high byte. */ + /* */ + /*************************************************************************/ + + + /* Success is always 0. */ + +#define CFF_Err_Ok FT_Err_Ok + + /* High level API errors. */ + +#define CFF_Err_Invalid_File_Format FT_Err_Invalid_File_Format +#define CFF_Err_Invalid_Argument FT_Err_Invalid_Argument +#define CFF_Err_Invalid_Driver_Handle FT_Err_Invalid_Driver_Handle +#define CFF_Err_Invalid_Face_Handle FT_Err_Invalid_Face_Handle +#define CFF_Err_Invalid_Instance_Handle FT_Err_Invalid_Size_Handle +#define CFF_Err_Invalid_Glyph_Handle FT_Err_Invalid_Slot_Handle +#define CFF_Err_Invalid_CharMap_Handle FT_Err_Invalid_CharMap_Handle +#define CFF_Err_Invalid_Glyph_Index FT_Err_Invalid_Glyph_Index + +#define CFF_Err_Unimplemented_Feature FT_Err_Unimplemented_Feature + +#define CFF_Err_Invalid_Engine FT_Err_Invalid_Driver_Handle + + /* Internal errors. */ + +#define CFF_Err_Out_Of_Memory FT_Err_Out_Of_Memory +#define CFF_Err_Unlisted_Object FT_Err_Unlisted_Object + + /* General glyph outline errors. */ + +#define CFF_Err_Invalid_Composite FT_Err_Invalid_Composite + + /* Bytecode interpreter error codes. */ + + /* These error codes are produced by the TrueType */ + /* bytecode interpreter. They usually indicate a */ + /* broken font file, a broken glyph within a font */ + /* file, or a bug in the interpreter! */ + +#define CFF_Err_Invalid_Opcode 0x500 +#define CFF_Err_Too_Few_Arguments 0x501 +#define CFF_Err_Stack_Overflow 0x502 +#define CFF_Err_Code_Overflow 0x503 +#define CFF_Err_Bad_Argument 0x504 +#define CFF_Err_Divide_By_Zero 0x505 +#define CFF_Err_Storage_Overflow 0x506 +#define CFF_Err_Cvt_Overflow 0x507 +#define CFF_Err_Invalid_Reference 0x508 +#define CFF_Err_Invalid_Distance 0x509 +#define CFF_Err_Interpolate_Twilight 0x50A +#define CFF_Err_Debug_OpCode 0x50B +#define CFF_Err_ENDF_In_Exec_Stream 0x50C +#define CFF_Err_Out_Of_CodeRanges 0x50D +#define CFF_Err_Nested_DEFS 0x50E +#define CFF_Err_Invalid_CodeRange 0x50F +#define CFF_Err_Invalid_Displacement 0x510 +#define CFF_Err_Execution_Too_Long 0x511 + +#define CFF_Err_Too_Many_Instruction_Defs 0x512 +#define CFF_Err_Too_Many_Function_Defs 0x513 + + /* Other TrueType specific error codes. */ + +#define CFF_Err_Table_Missing 0x520 +#define CFF_Err_Too_Many_Extensions 0x521 +#define CFF_Err_Extensions_Unsupported 0x522 +#define CFF_Err_Invalid_Extension_Id 0x523 + +#define CFF_Err_No_Vertical_Data 0x524 + +#define CFF_Err_Max_Profile_Missing 0x530 +#define CFF_Err_Header_Table_Missing 0x531 +#define CFF_Err_Horiz_Header_Missing 0x532 +#define CFF_Err_Locations_Missing 0x533 +#define CFF_Err_Name_Table_Missing 0x534 +#define CFF_Err_CMap_Table_Missing 0x535 +#define CFF_Err_Hmtx_Table_Missing 0x536 +#define CFF_Err_OS2_Table_Missing 0x537 +#define CFF_Err_Post_Table_Missing 0x538 + +#define CFF_Err_Invalid_Horiz_Metrics 0x540 +#define CFF_Err_Invalid_CharMap_Format 0x541 +#define CFF_Err_Invalid_PPem 0x542 +#define CFF_Err_Invalid_Vert_Metrics 0x543 + +#define CFF_Err_Could_Not_Find_Context 0x550 + + +FT_END_HEADER + + +#endif /* __CFFERRORS_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/include/freetype/internal/cfftypes.h b/xc/extras/freetype2/include/freetype/internal/cfftypes.h new file mode 100644 index 000000000..f90d43b17 --- /dev/null +++ b/xc/extras/freetype2/include/freetype/internal/cfftypes.h @@ -0,0 +1,249 @@ +/***************************************************************************/ +/* */ +/* cfftypes.h */ +/* */ +/* Basic OpenType/CFF type definitions and interface (specification */ +/* only). */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __CFFTYPES_H__ +#define __CFFTYPES_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Struct> */ + /* CFF_Index */ + /* */ + /* <Description> */ + /* A structure used to model a CFF Index table. */ + /* */ + /* <Fields> */ + /* stream :: The source input stream. */ + /* */ + /* count :: The number of elements in the index. */ + /* */ + /* off_size :: The size in bytes of object offsets in index. */ + /* */ + /* data_offset :: The position of first data byte in the index's */ + /* bytes. */ + /* */ + /* offsets :: A table of element offsets in the index. */ + /* */ + /* bytes :: If the index is loaded in memory, its bytes. */ + /* */ + typedef struct CFF_Index_ + { + FT_Stream stream; + FT_UInt count; + FT_Byte off_size; + FT_ULong data_offset; + + FT_ULong* offsets; + FT_Byte* bytes; + + } CFF_Index; + + + typedef struct CFF_Encoding_ + { + FT_UInt format; + FT_ULong offset; + + FT_UShort* sids; + FT_UShort* codes; + + } CFF_Encoding; + + + typedef struct CFF_Charset_ + { + + FT_UInt format; + FT_ULong offset; + + FT_UShort* sids; + + } CFF_Charset; + + + typedef struct CFF_Font_Dict_ + { + FT_UInt version; + FT_UInt notice; + FT_UInt copyright; + FT_UInt full_name; + FT_UInt family_name; + FT_UInt weight; + FT_Bool is_fixed_pitch; + FT_Fixed italic_angle; + FT_Pos underline_position; + FT_Pos underline_thickness; + FT_Int paint_type; + FT_Int charstring_type; + FT_Matrix font_matrix; + FT_UShort units_per_em; + FT_Vector font_offset; + FT_ULong unique_id; + FT_BBox font_bbox; + FT_Pos stroke_width; + FT_ULong charset_offset; + FT_ULong encoding_offset; + FT_ULong charstrings_offset; + FT_ULong private_offset; + FT_ULong private_size; + FT_Long synthetic_base; + FT_UInt embedded_postscript; + FT_UInt base_font_name; + FT_UInt postscript; + + /* these should only be used for the top-level font dictionary */ + FT_UInt cid_registry; + FT_UInt cid_ordering; + FT_ULong cid_supplement; + + FT_Long cid_font_version; + FT_Long cid_font_revision; + FT_Long cid_font_type; + FT_Long cid_count; + FT_ULong cid_uid_base; + FT_ULong cid_fd_array_offset; + FT_ULong cid_fd_select_offset; + FT_UInt cid_font_name; + + } CFF_Font_Dict; + + + typedef struct CFF_Private_ + { + FT_Byte num_blue_values; + FT_Byte num_other_blues; + FT_Byte num_family_blues; + FT_Byte num_family_other_blues; + + FT_Pos blue_values[14]; + FT_Pos other_blues[10]; + FT_Pos family_blues[14]; + FT_Pos family_other_blues[10]; + + FT_Fixed blue_scale; + FT_Pos blue_shift; + FT_Pos blue_fuzz; + FT_Pos standard_width; + FT_Pos standard_height; + + FT_Byte num_snap_widths; + FT_Byte num_snap_heights; + FT_Pos snap_widths[13]; + FT_Pos snap_heights[13]; + FT_Bool force_bold; + FT_Fixed force_bold_threshold; + FT_Int lenIV; + FT_Int language_group; + FT_Fixed expansion_factor; + FT_Long initial_random_seed; + FT_ULong local_subrs_offset; + FT_Pos default_width; + FT_Pos nominal_width; + + } CFF_Private; + + + typedef struct CFF_FD_Select_ + { + FT_Byte format; + FT_UInt range_count; + + /* that's the table, taken from the file `as is' */ + FT_Byte* data; + FT_UInt data_size; + + /* small cache for format 3 only */ + FT_UInt cache_first; + FT_UInt cache_count; + FT_Byte cache_fd; + + } CFF_FD_Select; + + + /* A SubFont packs a font dict and a private dict together. They are */ + /* needed to support CID-keyed CFF fonts. */ + typedef struct CFF_SubFont_ + { + CFF_Font_Dict font_dict; + CFF_Private private_dict; + + CFF_Index local_subrs_index; + FT_UInt num_local_subrs; + FT_Byte** local_subrs; + + } CFF_SubFont; + + + /* maximum number of sub-fonts in a CID-keyed file */ +#define CFF_MAX_CID_FONTS 16 + + + typedef struct CFF_Font_ + { + FT_Stream stream; + FT_Memory memory; + FT_UInt num_faces; + FT_UInt num_glyphs; + + FT_Byte version_major; + FT_Byte version_minor; + FT_Byte header_size; + FT_Byte absolute_offsize; + + + CFF_Index name_index; + CFF_Index top_dict_index; + CFF_Index string_index; + CFF_Index global_subrs_index; + + CFF_Encoding encoding; + CFF_Charset charset; + + CFF_Index charstrings_index; + CFF_Index font_dict_index; + CFF_Index private_index; + CFF_Index local_subrs_index; + + FT_String* font_name; + FT_UInt num_global_subrs; + FT_Byte** global_subrs; + + CFF_SubFont top_font; + FT_UInt num_subfonts; + CFF_SubFont* subfonts[CFF_MAX_CID_FONTS]; + + CFF_FD_Select fd_select; + + } CFF_Font; + + +FT_END_HEADER + +#endif /* __CFFTYPES_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/include/freetype/internal/fnttypes.h b/xc/extras/freetype2/include/freetype/internal/fnttypes.h index 38b01f8fe..446b4b13c 100644 --- a/xc/extras/freetype2/include/freetype/internal/fnttypes.h +++ b/xc/extras/freetype2/include/freetype/internal/fnttypes.h @@ -20,11 +20,10 @@ #ifndef __FNTTYPES_H__ #define __FNTTYPES_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_FREETYPE_H + +#include <ft2build.h> +#include FT_FREETYPE_H + FT_BEGIN_HEADER @@ -68,8 +67,8 @@ FT_BEGIN_HEADER } WinResourceInfo; -#define WINFNT_MZ_MAGIC 0x5A4D -#define WINFNT_NE_MAGIC 0x454E +#define WINFNT_MZ_MAGIC 0x5A4D +#define WINFNT_NE_MAGIC 0x454E typedef struct WinFNT_Header_ diff --git a/xc/extras/freetype2/include/freetype/internal/ftcalc.h b/xc/extras/freetype2/include/freetype/internal/ftcalc.h index bac737084..14f2f6154 100644 --- a/xc/extras/freetype2/include/freetype/internal/ftcalc.h +++ b/xc/extras/freetype2/include/freetype/internal/ftcalc.h @@ -19,11 +19,10 @@ #ifndef __FTCALC_H__ #define __FTCALC_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_FREETYPE_H + +#include <ft2build.h> +#include FT_FREETYPE_H + FT_BEGIN_HEADER @@ -217,6 +216,7 @@ FT_BEGIN_HEADER #define ROUND_F26DOT6( x ) ( x >= 0 ? ( ( (x) + 32 ) & -64 ) \ : ( -( ( 32 - (x) ) & -64 ) ) ) + FT_END_HEADER #endif /* __FTCALC_H__ */ diff --git a/xc/extras/freetype2/include/freetype/internal/ftdebug.h b/xc/extras/freetype2/include/freetype/internal/ftdebug.h index 30fc1fe0d..db905ed3e 100644 --- a/xc/extras/freetype2/include/freetype/internal/ftdebug.h +++ b/xc/extras/freetype2/include/freetype/internal/ftdebug.h @@ -19,14 +19,14 @@ #ifndef __FTDEBUG_H__ #define __FTDEBUG_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_CONFIG_CONFIG_H + +#include <ft2build.h> +#include FT_CONFIG_CONFIG_H + FT_BEGIN_HEADER + #ifdef FT_DEBUG_LEVEL_TRACE @@ -82,11 +82,11 @@ FT_BEGIN_HEADER trace_psobjs, /* Type 2 driver components */ - trace_t2driver, - trace_t2gload, - trace_t2load, - trace_t2objs, - trace_t2parse, + trace_cffdriver, + trace_cffgload, + trace_cffload, + trace_cffobjs, + trace_cffparse, /* CID driver components */ trace_cidafm, @@ -99,6 +99,10 @@ FT_BEGIN_HEADER /* Windows fonts component */ trace_winfnt, + /* PCF fonts component */ + trace_pcfdriver, + trace_pcfread, + /* the last level must always be `trace_max' */ trace_max diff --git a/xc/extras/freetype2/include/freetype/internal/ftdriver.h b/xc/extras/freetype2/include/freetype/internal/ftdriver.h index 85706a7ee..2cd51ce0b 100644 --- a/xc/extras/freetype2/include/freetype/internal/ftdriver.h +++ b/xc/extras/freetype2/include/freetype/internal/ftdriver.h @@ -19,11 +19,10 @@ #ifndef __FTDRIVER_H__ #define __FTDRIVER_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_MODULE_H + +#include <ft2build.h> +#include FT_MODULE_H + FT_BEGIN_HEADER diff --git a/xc/extras/freetype2/include/freetype/internal/ftextend.h b/xc/extras/freetype2/include/freetype/internal/ftextend.h index 69fe3138e..05ef864e9 100644 --- a/xc/extras/freetype2/include/freetype/internal/ftextend.h +++ b/xc/extras/freetype2/include/freetype/internal/ftextend.h @@ -19,14 +19,14 @@ #ifndef __FTEXTEND_H__ #define __FTEXTEND_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_INTERNAL_OBJECTS_H + +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H + FT_BEGIN_HEADER + /*************************************************************************/ /* */ /* The extensions don't need to be integrated at compile time into the */ diff --git a/xc/extras/freetype2/include/freetype/internal/ftmemory.h b/xc/extras/freetype2/include/freetype/internal/ftmemory.h index a5b9b871b..27b572f1a 100644 --- a/xc/extras/freetype2/include/freetype/internal/ftmemory.h +++ b/xc/extras/freetype2/include/freetype/internal/ftmemory.h @@ -19,15 +19,15 @@ #ifndef __FTMEMORY_H__ #define __FTMEMORY_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_CONFIG_CONFIG_H -#include FT_TYPES_H + +#include <ft2build.h> +#include FT_CONFIG_CONFIG_H +#include FT_TYPES_H + FT_BEGIN_HEADER + /*************************************************************************/ /* */ /* <Macro> */ diff --git a/xc/extras/freetype2/include/freetype/internal/ftobjs.h b/xc/extras/freetype2/include/freetype/internal/ftobjs.h index 95c1e65ab..f295330d8 100644 --- a/xc/extras/freetype2/include/freetype/internal/ftobjs.h +++ b/xc/extras/freetype2/include/freetype/internal/ftobjs.h @@ -26,18 +26,17 @@ #ifndef __FTOBJS_H__ #define __FTOBJS_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H +#include <ft2build.h> #include FT_RENDER_H #include FT_INTERNAL_MEMORY_H #include FT_INTERNAL_DRIVER_H #include FT_INTERNAL_AUTOHINT_H + FT_BEGIN_HEADER + /*************************************************************************/ /* */ /* Some generic definitions. */ diff --git a/xc/extras/freetype2/include/freetype/internal/ftstream.h b/xc/extras/freetype2/include/freetype/internal/ftstream.h index 3eaede7d4..e590f4e95 100644 --- a/xc/extras/freetype2/include/freetype/internal/ftstream.h +++ b/xc/extras/freetype2/include/freetype/internal/ftstream.h @@ -19,11 +19,10 @@ #ifndef __FTSTREAM_H__ #define __FTSTREAM_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_INTERNAL_OBJECTS_H + +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H + FT_BEGIN_HEADER @@ -64,13 +63,13 @@ FT_BEGIN_HEADER ft_frame_short_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ), ft_frame_ulong_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ), - ft_frame_ulong_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ), - ft_frame_long_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ), + ft_frame_long_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ), + ft_frame_ulong_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ), ft_frame_long_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ), ft_frame_uoff3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ), - ft_frame_uoff3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ), - ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ), + ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ), + ft_frame_uoff3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ), ft_frame_off3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ), ft_frame_bytes = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ), @@ -81,7 +80,7 @@ FT_BEGIN_HEADER typedef struct FT_Frame_Field_ { - FT_Frame_Op value; + FT_Byte value; FT_Byte size; FT_UShort offset; @@ -93,8 +92,10 @@ FT_BEGIN_HEADER /* calling the FT_FRAME_START() macro. */ #define FT_FIELD_SIZE( f ) \ (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f ) + #define FT_FIELD_SIZE_DELTA( f ) \ (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] ) + #define FT_FIELD_OFFSET( f ) \ (FT_UShort)( offsetof( FT_STRUCTURE, f ) ) @@ -132,6 +133,7 @@ FT_BEGIN_HEADER count, \ FT_FIELD_OFFSET( field ) \ } + #define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 } diff --git a/xc/extras/freetype2/include/freetype/internal/internal.h b/xc/extras/freetype2/include/freetype/internal/internal.h index 202653749..ecda8a729 100644 --- a/xc/extras/freetype2/include/freetype/internal/internal.h +++ b/xc/extras/freetype2/include/freetype/internal/internal.h @@ -14,48 +14,16 @@ /* understand and accept it fully. */ /* */ /***************************************************************************/ -/* $XFree86: xc/extras/freetype2/include/freetype/internal/internal.h,v 1.2 2001/02/13 17:20:10 tsi Exp $ */ /*************************************************************************/ /* */ - /* This file is automatically included by `ftbuild.h'. */ + /* This file is automatically included by `ft2build.h'. */ /* Do not include it manually! */ /* */ /*************************************************************************/ -#ifndef USE_MAKEDEPEND - - /* don't add spaces around the argument of FT_INTERNAL_FILE! */ - -#define FT_INTERNAL_OBJECTS_H FT_INTERNAL_FILE(ftobjs.h) -#define FT_INTERNAL_STREAM_H FT_INTERNAL_FILE(ftstream.h) -#define FT_INTERNAL_MEMORY_H FT_INTERNAL_FILE(ftmemory.h) -#define FT_INTERNAL_EXTENSION_H FT_INTERNAL_FILE(ftextend.h) -#define FT_INTERNAL_DEBUG_H FT_INTERNAL_FILE(ftdebug.h) -#define FT_INTERNAL_CALC_H FT_INTERNAL_FILE(ftcalc.h) -#define FT_INTERNAL_DRIVER_H FT_INTERNAL_FILE(ftdriver.h) - -#define FT_INTERNAL_SFNT_H FT_INTERNAL_FILE(sfnt.h) - -#define FT_INTERNAL_TRUETYPE_TYPES_H FT_INTERNAL_FILE(tttypes.h) -#define FT_INTERNAL_TRUETYPE_ERRORS_H FT_INTERNAL_FILE(tterrors.h) - -#define FT_INTERNAL_TYPE1_ERRORS_H FT_INTERNAL_FILE(t1errors.h) -#define FT_INTERNAL_TYPE1_TYPES_H FT_INTERNAL_FILE(t1types.h) - -#define FT_INTERNAL_CFF_ERRORS_H FT_INTERNAL_FILE(t2errors.h) -#define FT_INTERNAL_CFF_TYPES_H FT_INTERNAL_FILE(t2types.h) - -#define FT_INTERNAL_POSTSCRIPT_NAMES_H FT_INTERNAL_FILE(psnames.h) -#define FT_INTERNAL_POSTSCRIPT_AUX_H FT_INTERNAL_FILE(psaux.h) - -#define FT_INTERNAL_AUTOHINT_H FT_INTERNAL_FILE(autohint.h) -#define FT_INTERNAL_FNT_TYPES_H FT_INTERNAL_FILE(fnttypes.h) - -#else /* USE_MAKEDEPEND */ - #define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h> #define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h> #define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h> @@ -63,6 +31,7 @@ #define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h> #define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h> #define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h> +#define FT_INTERNAL_EXTEND_H <freetype/internal/ftextend.h> #define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h> @@ -72,8 +41,8 @@ #define FT_INTERNAL_TYPE1_ERRORS_H <freetype/internal/t1errors.h> #define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h> -#define FT_INTERNAL_CFF_ERRORS_H <freetype/internal/t2errors.h> -#define FT_INTERNAL_CFF_TYPES_H <freetype/internal/t2types.h> +#define FT_INTERNAL_CFF_ERRORS_H <freetype/internal/cfferrs.h> +#define FT_INTERNAL_CFF_TYPES_H <freetype/internal/cfftypes.h> #define FT_INTERNAL_POSTSCRIPT_NAMES_H <freetype/internal/psnames.h> #define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h> @@ -81,7 +50,5 @@ #define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h> #define FT_INTERNAL_FNT_TYPES_H <freetype/internal/fnttypes.h> -#endif /* USE_MAKEDEPEND */ - /* END */ diff --git a/xc/extras/freetype2/include/freetype/internal/pcftypes.h b/xc/extras/freetype2/include/freetype/internal/pcftypes.h new file mode 100644 index 000000000..8febb2630 --- /dev/null +++ b/xc/extras/freetype2/include/freetype/internal/pcftypes.h @@ -0,0 +1,54 @@ +/* pcftypes.h + + FreeType font driver for pcf fonts + + Copyright (C) 2000 by + Francesco Zappa Nardelli + +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 THE +AUTHORS OR COPYRIGHT HOLDERS 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. +*/ + + +#ifndef __PCFTYPES_H__ +#define __PCFTYPES_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H + + +FT_BEGIN_HEADER + + + typedef struct PCF_Public_FaceRec_ + { + FT_FaceRec root; + + char* charset_encoding; + char* charset_registry; + + } PCF_Public_FaceRec, *PCF_Public_Face; + + +FT_END_HEADER + +#endif /* __PCFTYPES_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/include/freetype/internal/psaux.h b/xc/extras/freetype2/include/freetype/internal/psaux.h index 3db704938..298c5e109 100644 --- a/xc/extras/freetype2/include/freetype/internal/psaux.h +++ b/xc/extras/freetype2/include/freetype/internal/psaux.h @@ -20,12 +20,11 @@ #ifndef __PSAUX_H__ #define __PSAUX_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_INTERNAL_OBJECTS_H -#include FT_INTERNAL_TYPE1_TYPES_H + +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_TYPE1_TYPES_H + FT_BEGIN_HEADER @@ -588,7 +587,7 @@ FT_BEGIN_HEADER FT_UInt num_glyphs; FT_Byte** glyph_names; - FT_UInt lenIV; /* internal for sub routine calls */ + FT_Int lenIV; /* internal for sub routine calls */ FT_UInt num_subrs; FT_Byte** subrs; FT_Int* subrs_len; /* array of subrs length (optional) */ diff --git a/xc/extras/freetype2/include/freetype/internal/psnames.h b/xc/extras/freetype2/include/freetype/internal/psnames.h index cb6233f94..0e3157fc2 100644 --- a/xc/extras/freetype2/include/freetype/internal/psnames.h +++ b/xc/extras/freetype2/include/freetype/internal/psnames.h @@ -20,14 +20,14 @@ #ifndef __PSNAMES_H__ #define __PSNAMES_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_FREETYPE_H + +#include <ft2build.h> +#include FT_FREETYPE_H + FT_BEGIN_HEADER + /*************************************************************************/ /* */ /* <FuncType> */ diff --git a/xc/extras/freetype2/include/freetype/internal/sfnt.h b/xc/extras/freetype2/include/freetype/internal/sfnt.h index 6815ce690..9263a5b0c 100644 --- a/xc/extras/freetype2/include/freetype/internal/sfnt.h +++ b/xc/extras/freetype2/include/freetype/internal/sfnt.h @@ -19,15 +19,15 @@ #ifndef __SFNT_H__ #define __SFNT_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_INTERNAL_DRIVER_H -#include FT_INTERNAL_TRUETYPE_TYPES_H + +#include <ft2build.h> +#include FT_INTERNAL_DRIVER_H +#include FT_INTERNAL_TRUETYPE_TYPES_H + FT_BEGIN_HEADER + /*************************************************************************/ /* */ /* <FuncType> */ diff --git a/xc/extras/freetype2/include/freetype/internal/t1errors.h b/xc/extras/freetype2/include/freetype/internal/t1errors.h index 79fdf698b..7bb951f03 100644 --- a/xc/extras/freetype2/include/freetype/internal/t1errors.h +++ b/xc/extras/freetype2/include/freetype/internal/t1errors.h @@ -20,9 +20,10 @@ #define __T1ERRORS_H__ -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> + + +FT_BEGIN_HEADER /************************ error codes declaration **************/ @@ -66,10 +67,7 @@ #define T1_Err_Stack_Overflow FT_Err_Invalid_File_Format -#ifdef __cplusplus - } -#endif - +FT_END_HEADER #endif /* __T1ERRORS_H__ */ diff --git a/xc/extras/freetype2/include/freetype/internal/t1types.h b/xc/extras/freetype2/include/freetype/internal/t1types.h index 0aa42cc7d..01841f018 100644 --- a/xc/extras/freetype2/include/freetype/internal/t1types.h +++ b/xc/extras/freetype2/include/freetype/internal/t1types.h @@ -20,12 +20,11 @@ #ifndef __T1TYPES_H__ #define __T1TYPES_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_TYPE1_TABLES_H -#include FT_INTERNAL_POSTSCRIPT_NAMES_H + +#include<ft2build.h> +#include FT_TYPE1_TABLES_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H + FT_BEGIN_HEADER diff --git a/xc/extras/freetype2/include/freetype/internal/tterrors.h b/xc/extras/freetype2/include/freetype/internal/tterrors.h index 3f6c33474..e235d8117 100644 --- a/xc/extras/freetype2/include/freetype/internal/tterrors.h +++ b/xc/extras/freetype2/include/freetype/internal/tterrors.h @@ -20,9 +20,10 @@ #define __TTERRORS_H__ -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> + + +FT_BEGIN_HEADER /*************************************************************************/ @@ -120,9 +121,7 @@ #define TT_Err_Could_Not_Find_Context 0x450 -#ifdef __cplusplus - } -#endif +FT_END_HEADER #endif /* __TTERRORS_H__ */ diff --git a/xc/extras/freetype2/include/freetype/internal/tttypes.h b/xc/extras/freetype2/include/freetype/internal/tttypes.h index ef74ac2ac..095311a40 100644 --- a/xc/extras/freetype2/include/freetype/internal/tttypes.h +++ b/xc/extras/freetype2/include/freetype/internal/tttypes.h @@ -20,12 +20,11 @@ #ifndef __TTTYPES_H__ #define __TTTYPES_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H -#include FT_TRUETYPE_TABLES_H -#include FT_INTERNAL_OBJECTS_H + +#include <ft2build.h> +#include FT_TRUETYPE_TABLES_H +#include FT_INTERNAL_OBJECTS_H + FT_BEGIN_HEADER diff --git a/xc/extras/freetype2/include/freetype/t1tables.h b/xc/extras/freetype2/include/freetype/t1tables.h index 212627f69..cc23ddeb5 100644 --- a/xc/extras/freetype2/include/freetype/t1tables.h +++ b/xc/extras/freetype2/include/freetype/t1tables.h @@ -20,15 +20,32 @@ #ifndef __T1TABLES_H__ #define __T1TABLES_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H +#include <ft2build.h> #include FT_FREETYPE_H + FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* <Section> */ + /* type1_tables */ + /* */ + /* <Title> */ + /* Type 1 Tables */ + /* */ + /* <Abstract> */ + /* Type 1 (PostScript) specific font tables. */ + /* */ + /* <Description> */ + /* This section contains the definition of Type 1-specific tables, */ + /* including structures related to other PostScript font formats. */ + /* */ + /*************************************************************************/ + + /* Note that we separate font data in T1_FontInfo and T1_Private */ /* structures in order to support Multiple Master fonts. */ @@ -235,6 +252,9 @@ FT_BEGIN_HEADER } CID_Info; + /* */ + + FT_END_HEADER #endif /* __T1TABLES_H__ */ diff --git a/xc/extras/freetype2/include/freetype/ttnameid.h b/xc/extras/freetype2/include/freetype/ttnameid.h index fcb1d96a3..cf9a19585 100644 --- a/xc/extras/freetype2/include/freetype/ttnameid.h +++ b/xc/extras/freetype2/include/freetype/ttnameid.h @@ -20,9 +20,10 @@ #define __TTNAMEID_H__ -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> + + +FT_BEGIN_HEADER /*************************************************************************/ @@ -309,7 +310,14 @@ #define TT_MS_LANGID_CHINESE_PRC 0x0804 #define TT_MS_LANGID_CHINESE_HONG_KONG 0x0c04 #define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004 + +#if 1 /* this used to be this value (and it still is in many places) */ #define TT_MS_LANGID_CHINESE_MACAU 0x1404 +#else /* but beware, Microsoft may change its mind... + the most recent Word reference has the following: :-( */ +#define TT_MS_LANGID_CHINESE_MACAU TT_MS_LANGID_CHINESE_HONG_KONG +#endif + #define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405 #define TT_MS_LANGID_DANISH_DENMARK 0x0406 #define TT_MS_LANGID_GERMAN_GERMANY 0x0407 @@ -396,7 +404,11 @@ #define TT_MS_LANGID_LATVIAN_LATVIA 0x0426 #define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427 #define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA 0x0827 + +#if 0 /* this seems to be an error that have been dropped */ #define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0428 +#endif + #define TT_MS_LANGID_FARSI_IRAN 0x0429 #define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042a #define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042b @@ -417,8 +429,15 @@ #define TT_MS_LANGID_HINDI_INDIA 0x0439 #define TT_MS_LANGID_MALTESE_MALTA 0x043a #define TT_MS_LANGID_SAAMI_LAPONIA 0x043b + +#if 0 /* this seems to be a previous invertion */ #define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c #define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c +#else +#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM 0x083c +#define TT_MS_LANGID_IRISH_GAELIC_IRELAND 0x043c +#endif + #define TT_MS_LANGID_MALAY_MALAYSIA 0x043e #define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083e #define TT_MS_LANGID_KAZAK_KAZAKSTAN 0x043f @@ -439,6 +458,68 @@ #define TT_MS_LANGID_SANSKRIT_INDIA 0x044f #define TT_MS_LANGID_KONKANI_INDIA 0x0457 +/* new as of 2001-01-01 */ +#define TT_MS_LANGID_ARABIC_GENERAL 0x0001 +#define TT_MS_LANGID_CHINESE_GENERAL 0x0004 +#define TT_MS_LANGID_ENGLISH_GENERAL 0x0009 +#define TT_MS_LANGID_FRENCH_WEST_INDIES 0x1c0c +#define TT_MS_LANGID_FRENCH_REUNION 0x200c +#define TT_MS_LANGID_FRENCH_CONGO 0x240c + /* which was formerly: */ +#define TT_MS_LANGID_FRENCH_ZAIRE TT_MS_LANGID_FRENCH_CONGO + +#define TT_MS_LANGID_FRENCH_SENEGAL 0x280c +#define TT_MS_LANGID_FRENCH_CAMEROON 0x2c0c +#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE 0x300c +#define TT_MS_LANGID_FRENCH_MALI 0x340c +#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x101a +#define TT_MS_LANGID_URDU_INDIA 0x0820 +#define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428 +#define TT_MS_LANGID_YIDDISH_GERMANY 0x043d +#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN 0x0440 + /* alias declared in Windows 2000 */ +#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \ + TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN + +#define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442 +#define TT_MS_LANGID_MONGOLIAN_MONGOLIA 0x0450 +#define TT_MS_LANGID_TIBETAN_BHUTAN 0x0451 +#define TT_MS_LANGID_WELSH_WALES 0x0452 +#define TT_MS_LANGID_KHMER_CAMBODIA 0x0453 +#define TT_MS_LANGID_LAO_LAOS 0x0454 +#define TT_MS_LANGID_BURMESE_MYANMAR 0x0455 +#define TT_MS_LANGID_GALICIAN_SPAIN 0x0456 +#define TT_MS_LANGID_MANIPURI_INDIA 0x0458 +#define TT_MS_LANGID_SINDHI_INDIA 0x0459 +#define TT_MS_LANGID_KASHMIRI_PAKISTAN 0x0460 +#define TT_MS_LANGID_KASHMIRI_INDIA 0x0860 +#define TT_MS_LANGID_NEPALI_NEPAL 0x0461 +#define TT_MS_LANGID_NEPALI_INDIA 0x0861 +#define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462 + +/* new as of 2001-03-01 (from Office Xp) */ +#define TT_MS_LANGID_SYRIAC_SYRIA 0x045a +#define TT_MS_LANGID_SINHALESE_SRI_LANKA 0x045b +#define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463 +#define TT_MS_LANGID_ENGLISH_HONG_KONG 0x3c09 +#define TT_MS_LANGID_ENGLISH_INDIA 0x4009 +#define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409 +#define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809 +#define TT_MS_LANGID_CHEROKEE_UNITED_STATES 0x045c +#define TT_MS_LANGID_INUKTITUT_CANADA 0x045d +#define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045e +#define TT_MS_LANGID_TAMAZIGHT_MOROCCO 0x045f +#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN 0x085f +#define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464 +#define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465 + /* alias declared in Windows 2000 */ +#define TT_MS_LANGID_DIVEHI_MALDIVES TT_MS_LANGID_DHIVEHI_MALDIVES + /* language codes from 0x0466 to 0x0471 are unknown. */ +#define TT_MS_LANGID_OROMO_ETHIOPIA 0x0472 +#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA 0x0473 +#define TT_MS_LANGID_TIGRIGNA_ERYTHREA 0x0873 + + /*************************************************************************/ /* */ @@ -480,10 +561,10 @@ /* General Scripts Area */ - /* Bit 0 C0 Controls and Basic Latin */ + /* Bit 0 Basic Latin */ #define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */ /* Bit 1 C1 Controls and Latin-1 Supplement */ -#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+00A0-U+00FF */ +#define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */ /* Bit 2 Latin Extended-A */ #define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */ /* Bit 3 Latin Extended-B */ @@ -494,7 +575,7 @@ #define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */ /* Bit 6 Combining Diacritical Marks */ #define TT_UCR_COMBINING_DIACRITICS (1L << 6) /* U+0300-U+036F */ - /* Bit 7 Greek */ + /* Bit 7 Greek and Coptic */ #define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */ /* Bit 8 is reserved (was: Greek Symbols and Coptic) */ /* Bit 9 Cyrillic */ @@ -578,20 +659,22 @@ /* CJK Phonetics and Symbols Area */ - /* Bit 48 CJK Symbols And Punctuation */ + /* Bit 48 CJK Symbols and Punctuation */ #define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */ /* Bit 49 Hiragana */ #define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */ /* Bit 50 Katakana */ #define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */ - /* Bit 51 Bopomofo + Extended Bopomofo */ + /* Bit 51 Bopomofo + */ + /* Bopomofo Extended */ #define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */ /* U+31A0-U+31BF */ /* Bit 52 Hangul Compatibility Jamo */ #define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */ - /* Bit 53 CJK Miscellaneous */ + /* Bit 53 Kanbun */ #define TT_UCR_CJK_MISC (1L << 21) /* U+3190-U+319F */ - /* Bit 54 Enclosed CJK Letters And Months */ +#define TT_UCR_KANBUN TT_UCR_CJK_MISC + /* Bit 54 Enclosed CJK Letters and Months */ #define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */ /* Bit 55 CJK Compatibility */ #define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */ @@ -603,22 +686,26 @@ /* Surrogates Area */ - /* Bit 57 Surrogates */ -#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DFFF */ + /* Bit 57 High Surrogates + */ + /* High Private Use Surrogates + */ + /* Low Surrogates */ +#define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */ + /* U+DB80-U+DBFF */ + /* U+DC00-U+DFFF */ /* Bit 58 is reserved for Unicode SubRanges */ /* CJK Ideographs Area */ /* Bit 59 CJK Unified Ideographs + */ - /* CJK Radical Supplement + */ + /* CJK Radicals Supplement + */ /* Kangxi Radicals + */ - /* Ideographic Description + */ + /* Ideographic Description Characters + */ /* CJK Unified Ideographs Extension A */ #define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */ /* U+2E80-U+2EFF */ /* U+2F00-U+2FDF */ /* U+2FF0-U+2FFF */ - /* U+34E0-U+4DB5 */ + /* U+3400-U+4DB5 */ /* Private Use Area */ @@ -641,12 +728,12 @@ #define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */ /* Bit 67 Arabic Presentation Forms-B */ #define TT_UCR_ARABIC_PRESENTATIONS_B (1L << 3) /* U+FE70-U+FEFE */ - /* Bit 68 Halfwidth And Fullwidth Forms */ + /* Bit 68 Halfwidth and Fullwidth Forms */ #define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */ /* Bit 69 Specials */ #define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */ /* Bit 70 Tibetan */ -#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FCF */ +#define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */ /* Bit 71 Syriac */ #define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */ /* Bit 72 Thaana */ @@ -656,11 +743,11 @@ /* Bit 74 Myanmar */ #define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */ /* Bit 75 Ethiopic */ -#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+12BF */ +#define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */ /* Bit 76 Cherokee */ #define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */ - /* Bit 77 Canadian Aboriginal Syllabics */ -#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+14DF */ + /* Bit 77 Unified Canadian Aboriginal Syllabics */ +#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */ /* Bit 78 Ogham */ #define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */ /* Bit 79 Runic */ @@ -669,10 +756,11 @@ #define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */ /* Bit 81 Mongolian */ #define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */ - /* Bit 82 Braille */ + /* Bit 82 Braille Patterns */ #define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */ - /* Bit 83 Yi + Yi Radicals */ -#define TT_UCR_YI (1L << 19) /* U+A000-U+A48C */ + /* Bit 83 Yi Syllables + */ + /* Yi Radicals */ +#define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */ /* U+A490-U+A4CF */ @@ -713,10 +801,7 @@ #endif /* !HAVE_LIMIT_ON_IDENTS */ -#ifdef __cplusplus - } -#endif - +FT_END_HEADER #endif /* __TTNAMEID_H__ */ diff --git a/xc/extras/freetype2/include/freetype/tttables.h b/xc/extras/freetype2/include/freetype/tttables.h index 6de013fd6..e2caaf84f 100644 --- a/xc/extras/freetype2/include/freetype/tttables.h +++ b/xc/extras/freetype2/include/freetype/tttables.h @@ -20,17 +20,33 @@ #ifndef __TTTABLES_H__ #define __TTTABLES_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H +#include <ft2build.h> #include FT_FREETYPE_H + FT_BEGIN_HEADER /*************************************************************************/ /* */ + /* <Section> */ + /* truetype_tables */ + /* */ + /* <Title> */ + /* TrueType Tables */ + /* */ + /* <Abstract> */ + /* TrueType-specific table types and functions. */ + /* */ + /* <Description> */ + /* This section contains the definition of TrueType-specific tables */ + /* as well as some routines used to access and process them. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ /* <Struct> */ /* TT_Header */ /* */ @@ -521,6 +537,8 @@ FT_BEGIN_HEADER } TT_MaxProfile; + /* */ + typedef enum { ft_sfnt_head = 0, @@ -570,6 +588,9 @@ FT_BEGIN_HEADER FT_Sfnt_Tag tag ); + /* */ + + FT_END_HEADER #endif /* __TTTABLES_H__ */ diff --git a/xc/extras/freetype2/include/freetype/tttags.h b/xc/extras/freetype2/include/freetype/tttags.h index 4ab166913..4259c212e 100644 --- a/xc/extras/freetype2/include/freetype/tttags.h +++ b/xc/extras/freetype2/include/freetype/tttags.h @@ -19,15 +19,14 @@ #ifndef __TTAGS_H__ #define __TTAGS_H__ -#ifndef FT_BUILD_H -# define FT_BUILD_H <freetype/config/ftbuild.h> -#endif -#include FT_BUILD_H +#include <ft2build.h> #include FT_FREETYPE_H + FT_BEGIN_HEADER + #define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' ) #define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' ) #define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' ) @@ -66,6 +65,7 @@ FT_BEGIN_HEADER #define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' ) #define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' ) + FT_END_HEADER #endif /* __TTAGS_H__ */ diff --git a/xc/extras/freetype2/include/ft2build.h b/xc/extras/freetype2/include/ft2build.h new file mode 100644 index 000000000..cd94c00fc --- /dev/null +++ b/xc/extras/freetype2/include/ft2build.h @@ -0,0 +1,39 @@ +/***************************************************************************/ +/* */ +/* ft2build.h */ +/* */ +/* FreeType 2 build and setup macros. */ +/* (Generic version) */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /*************************************************************************/ + /* */ + /* This file corresponds to the default "ft2build.h" file for */ + /* FreeType 2. It uses the "freetype" include root. */ + /* */ + /* Note that specific platforms might use a different configuration. */ + /* See builds/unix/ft2unix.h for an example. */ + /* */ + /*************************************************************************/ + + +#ifndef __FT2_BUILD_GENERIC_H__ +#define __FT2_BUILD_GENERIC_H__ + +#include <freetype/config/ftheader.h> + +#endif /* __FT2_BUILD_GENERIC_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/objs/.cvsignore b/xc/extras/freetype2/objs/.cvsignore new file mode 100644 index 000000000..d17e85ed3 --- /dev/null +++ b/xc/extras/freetype2/objs/.cvsignore @@ -0,0 +1,3 @@ +*.lo +libfreetype.la +.libs diff --git a/xc/extras/freetype2/objs/README b/xc/extras/freetype2/objs/README new file mode 100644 index 000000000..91fdcbdc1 --- /dev/null +++ b/xc/extras/freetype2/objs/README @@ -0,0 +1 @@ +This directory contains all the object files created when building the library diff --git a/xc/extras/freetype2/src/autohint/ahangles.c b/xc/extras/freetype2/src/autohint/ahangles.c index caf834814..3f1b43cd4 100644 --- a/xc/extras/freetype2/src/autohint/ahangles.c +++ b/xc/extras/freetype2/src/autohint/ahangles.c @@ -20,16 +20,9 @@ /***************************************************************************/ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ahangles.h" -#else - -#include <autohint/ahangles.h> - -#endif - /* the following table has been automatically generated with */ /* the `mather.py' Python script */ diff --git a/xc/extras/freetype2/src/autohint/ahangles.h b/xc/extras/freetype2/src/autohint/ahangles.h index cf5abea45..f66ad1795 100644 --- a/xc/extras/freetype2/src/autohint/ahangles.h +++ b/xc/extras/freetype2/src/autohint/ahangles.h @@ -20,27 +20,16 @@ /***************************************************************************/ -#ifndef AHANGLES_H -#define AHANGLES_H +#ifndef __AHANGLES_H__ +#define __AHANGLES_H__ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H #include "ahtypes.h" -#else - -#include <autohint/ahtypes.h> - -#endif - -#include <freetype/internal/ftobjs.h> - - -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER /* PI expressed in ah_angles -- we don't really need an important */ @@ -62,12 +51,9 @@ AH_Angle ah_angle( FT_Vector* v ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* AHANGLES_H */ +#endif /* __AHANGLES_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/autohint/ahglobal.c b/xc/extras/freetype2/src/autohint/ahglobal.c index f44c075e9..68f68c40a 100644 --- a/xc/extras/freetype2/src/autohint/ahglobal.c +++ b/xc/extras/freetype2/src/autohint/ahglobal.c @@ -19,18 +19,10 @@ /***************************************************************************/ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ahglobal.h" #include "ahglyph.h" -#else - -#include <autohint/ahglobal.h> -#include <autohint/ahglyph.h> - -#endif - #define MAX_TEST_CHARACTERS 12 @@ -165,7 +157,7 @@ /* segment; we first need to find in which contour the extremum */ /* lies, then see its previous and next points */ { - FT_Int index = extremum - points; + FT_Int index = (FT_Int)( extremum - points ); FT_Int n; FT_Int first, last, prev, next, end; FT_Pos dist; diff --git a/xc/extras/freetype2/src/autohint/ahglobal.h b/xc/extras/freetype2/src/autohint/ahglobal.h index 705a0c70a..e2cce0e13 100644 --- a/xc/extras/freetype2/src/autohint/ahglobal.h +++ b/xc/extras/freetype2/src/autohint/ahglobal.h @@ -20,26 +20,16 @@ /***************************************************************************/ -#ifndef AHGLOBAL_H -#define AHGLOBAL_H +#ifndef __AHGLOBAL_H__ +#define __AHGLOBAL_H__ -#ifdef FT_FLAT_COMPILE +#include <ft2build.h> #include "ahtypes.h" +#include FT_INTERNAL_OBJECTS_H -#else -#include <autohint/ahtypes.h> - -#endif - - -#include <freetype/internal/ftobjs.h> /* for FT_LOCAL/FT_LOCAL_DEF */ - - -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER #define AH_IS_TOP_BLUE( b ) ( (b) == ah_blue_capital_top || \ @@ -51,12 +41,9 @@ FT_Error ah_hinter_compute_globals( AH_Hinter* hinter ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* AHGLOBAL_H */ +#endif /* __AHGLOBAL_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/autohint/ahglyph.c b/xc/extras/freetype2/src/autohint/ahglyph.c index d3b981799..23c26ed59 100644 --- a/xc/extras/freetype2/src/autohint/ahglyph.c +++ b/xc/extras/freetype2/src/autohint/ahglyph.c @@ -20,21 +20,11 @@ /***************************************************************************/ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ahglyph.h" #include "ahangles.h" #include "ahglobal.h" -#else - -#include <autohint/ahglyph.h> -#include <autohint/ahangles.h> -#include <autohint/ahglobal.h> - -#endif - - #include <stdio.h> @@ -1119,7 +1109,7 @@ } } - *p_num_edges = edge_limit - edges; + *p_num_edges = (FT_Int)( edge_limit - edges ); /*********************************************************************/ diff --git a/xc/extras/freetype2/src/autohint/ahglyph.h b/xc/extras/freetype2/src/autohint/ahglyph.h index e40753bae..d91065165 100644 --- a/xc/extras/freetype2/src/autohint/ahglyph.h +++ b/xc/extras/freetype2/src/autohint/ahglyph.h @@ -20,23 +20,15 @@ /***************************************************************************/ -#ifndef AHGLYPH_H -#define AHGLYPH_H +#ifndef __AHGLYPH_H__ +#define __AHGLYPH_H__ -#ifdef FT_FLAT_COMPILE +#include <ft2build.h> #include "ahtypes.h" -#else -#include <autohint/ahtypes.h> - -#endif - - -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER typedef enum AH_UV_ @@ -92,12 +84,9 @@ void ah_outline_done( AH_Outline* outline ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* AHGLYPH_H */ +#endif /* __AHGLYPH_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/autohint/ahhint.c b/xc/extras/freetype2/src/autohint/ahhint.c index 0d2b475ab..754687c3a 100644 --- a/xc/extras/freetype2/src/autohint/ahhint.c +++ b/xc/extras/freetype2/src/autohint/ahhint.c @@ -19,21 +19,11 @@ /***************************************************************************/ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ahhint.h" #include "ahglyph.h" #include "ahangles.h" - -#else - -#include <autohint/ahhint.h> -#include <autohint/ahglyph.h> -#include <autohint/ahangles.h> - -#endif - -#include <freetype/ftoutln.h> +#include FT_OUTLINE_H #define FACE_GLOBALS( face ) ((AH_Face_Globals*)(face)->autohint.data) @@ -50,10 +40,6 @@ /*************************************************************************/ - static int disable_horz_edges = 0; - static int disable_vert_edges = 0; - - /* snap a given width in scaled coordinates to one of the */ /* current standard widths */ static @@ -224,10 +210,10 @@ int has_serifs = 0; - if ( disable_vert_edges && !dimension ) + if ( hinter->disable_vert_edges && !dimension ) goto Next_Dimension; - if ( disable_horz_edges && dimension ) + if ( hinter->disable_horz_edges && dimension ) goto Next_Dimension; /* we begin by aligning all stems relative to the blue zone */ @@ -391,11 +377,11 @@ FT_LOCAL_DEF void ah_hinter_hint_edges( AH_Hinter* hinter, - int no_horz_edges, - int no_vert_edges ) + FT_Bool no_horz_edges, + FT_Bool no_vert_edges ) { - disable_horz_edges = no_horz_edges; - disable_vert_edges = no_vert_edges; + hinter->disable_horz_edges = no_horz_edges; + hinter->disable_vert_edges = no_vert_edges; /* AH_Interpolate_Blue_Edges( hinter ); -- doesn't seem to help */ /* reduce the problem of the disappearing eye in the `e' of Times... */ @@ -1020,14 +1006,15 @@ FT_UInt load_flags, FT_UInt depth ) { - FT_Face face = hinter->face; - FT_GlyphSlot slot = face->glyph; - FT_Fixed x_scale = face->size->metrics.x_scale; - FT_Fixed y_scale = face->size->metrics.y_scale; + FT_Face face = hinter->face; + FT_GlyphSlot slot = face->glyph; + FT_Slot_Internal internal = slot->internal; + FT_Fixed x_scale = face->size->metrics.x_scale; + FT_Fixed y_scale = face->size->metrics.y_scale; FT_Glyph_Metrics metrics; /* temporary metrics */ FT_Error error; - AH_Outline* outline = hinter->glyph; - AH_Loader* gloader = hinter->loader; + AH_Outline* outline = hinter->glyph; + AH_Loader* gloader = hinter->loader; FT_Bool no_horz_hints = ( load_flags & AH_HINT_NO_HORZ_EDGES ) != 0; FT_Bool no_vert_hints = @@ -1039,6 +1026,21 @@ if ( error ) goto Exit; + /* Set `hinter->transformed' after loading with FT_LOAD_NO_RECURSE. */ + hinter->transformed = internal->glyph_transformed; + + if ( hinter->transformed ) + { + FT_Matrix imatrix; + + imatrix = internal->glyph_matrix; + hinter->trans_delta = internal->glyph_delta; + hinter->trans_matrix = imatrix; + + FT_Matrix_Invert( &imatrix ); + FT_Vector_Transform( &hinter->trans_delta, &imatrix ); + } + /* save current glyph metrics */ metrics = slot->metrics; @@ -1348,9 +1350,11 @@ error = ah_hinter_new_face_globals( hinter, face, 0 ); if ( error ) goto Exit; + } hinter->globals = FACE_GLOBALS( face ); face_globals = FACE_GLOBALS( face ); + } /* now, we must check the current character pixel size to see if we */ @@ -1359,29 +1363,10 @@ face_globals->y_scale != y_scale ) ah_hinter_scale_globals( hinter, x_scale, y_scale ); - load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_RECURSE; - ah_loader_rewind( hinter->loader ); - { - FT_Slot_Internal internal = slot->internal; - - - hinter->transformed = internal->glyph_transformed; - if ( hinter->transformed ) - { - FT_Matrix imatrix; - - - imatrix = internal->glyph_matrix; - hinter->trans_delta = internal->glyph_delta; - hinter->trans_matrix = imatrix; + load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_RECURSE; - FT_Matrix_Invert( &imatrix ); - FT_Vector_Transform( &hinter->trans_delta, &imatrix ); - } - } - error = ah_hinter_load( hinter, glyph_index, load_flags, 0 ); Exit: diff --git a/xc/extras/freetype2/src/autohint/ahhint.h b/xc/extras/freetype2/src/autohint/ahhint.h index e9d5323af..fbd7230cf 100644 --- a/xc/extras/freetype2/src/autohint/ahhint.h +++ b/xc/extras/freetype2/src/autohint/ahhint.h @@ -19,24 +19,15 @@ /***************************************************************************/ -#ifndef AHHINT_H -#define AHHINT_H +#ifndef __AHHINT_H__ +#define __AHHINT_H__ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ahglobal.h" -#else - -#include <autohint/ahglobal.h> - -#endif - -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER #define AH_HINT_DEFAULT 0 @@ -76,12 +67,9 @@ void* global_hints ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* AHHINT_H */ +#endif /* __AHHINT_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/autohint/ahloader.h b/xc/extras/freetype2/src/autohint/ahloader.h index 78b1f1624..aea60c333 100644 --- a/xc/extras/freetype2/src/autohint/ahloader.h +++ b/xc/extras/freetype2/src/autohint/ahloader.h @@ -32,13 +32,14 @@ /*************************************************************************/ -#ifndef AHLOADER_H -#define AHLOADER_H +#ifndef __AHLOADER_H__ +#define __AHLOADER_H__ -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> + + +FT_BEGIN_HEADER #ifdef _STANDALONE_ @@ -105,7 +106,7 @@ #else /* _STANDALONE */ -#include <freetype/internal/ftobjs.h> +#include FT_INTERNAL_OBJECTS_H #define AH_Load FT_GlyphLoad #define AH_Loader FT_GlyphLoader @@ -124,12 +125,9 @@ #endif /* _STANDALONE_ */ -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* AHLOADER_H */ +#endif /* __AHLOADER_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/autohint/ahmodule.c b/xc/extras/freetype2/src/autohint/ahmodule.c index 67d96ede8..344975241 100644 --- a/xc/extras/freetype2/src/autohint/ahmodule.c +++ b/xc/extras/freetype2/src/autohint/ahmodule.c @@ -19,19 +19,10 @@ /***************************************************************************/ -#include <freetype/ftmodule.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_MODULE_H #include "ahhint.h" -#else - -#include <autohint/ahhint.h> - -#endif - typedef struct FT_AutoHinterRec_ { diff --git a/xc/extras/freetype2/src/autohint/ahmodule.h b/xc/extras/freetype2/src/autohint/ahmodule.h index b631049d5..f6643d2a3 100644 --- a/xc/extras/freetype2/src/autohint/ahmodule.h +++ b/xc/extras/freetype2/src/autohint/ahmodule.h @@ -19,25 +19,24 @@ /***************************************************************************/ -#ifndef AHMODULE_H -#define AHMODULE_H +#ifndef __AHMODULE_H__ +#define __AHMODULE_H__ -#include <freetype/ftmodule.h> +#include <ft2build.h> +#include FT_MODULE_H + + +FT_BEGIN_HEADER -#ifdef __cplusplus - extern "C" { -#endif FT_CALLBACK_TABLE const FT_Module_Class autohint_module_class; -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* AHMODULE_H */ +#endif /* __AHMODULE_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/autohint/ahoptim.c b/xc/extras/freetype2/src/autohint/ahoptim.c index deb440d49..848526c2b 100644 --- a/xc/extras/freetype2/src/autohint/ahoptim.c +++ b/xc/extras/freetype2/src/autohint/ahoptim.c @@ -31,19 +31,10 @@ /*************************************************************************/ -#include <freetype/internal/ftobjs.h> /* for ALLOC_ARRAY() and FREE() */ - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H /* for ALLOC_ARRAY() and FREE() */ #include "ahoptim.h" -#else - -#include <autohint/ahoptim.h> - -#endif - /* define this macro to use brute force optimisation -- this is slow, */ /* but a good way to perfect the distortion function `by hand' through */ @@ -57,7 +48,7 @@ #undef LOG #ifdef AH_DEBUG_OPTIM -#define LOG( x ) optim_log##x +#define LOG( x ) optim_log ## x #else diff --git a/xc/extras/freetype2/src/autohint/ahoptim.h b/xc/extras/freetype2/src/autohint/ahoptim.h index 24f5a5263..29b9c38c9 100644 --- a/xc/extras/freetype2/src/autohint/ahoptim.h +++ b/xc/extras/freetype2/src/autohint/ahoptim.h @@ -19,24 +19,15 @@ /***************************************************************************/ -#ifndef AHOPTIM_H -#define AHOPTIM_H +#ifndef __AHOPTIM_H__ +#define __AHOPTIM_H__ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ahtypes.h" -#else - -#include <autohint/ahtypes.h> - -#endif - -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER /* the maximal number of stem configurations to record */ @@ -135,12 +126,9 @@ void AH_Optimizer_Done( AH_Optimizer* optimizer ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* AHOPTIM_H */ +#endif /* __AHOPTIM_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/autohint/ahtypes.h b/xc/extras/freetype2/src/autohint/ahtypes.h index 66cb2f676..11b7519f7 100644 --- a/xc/extras/freetype2/src/autohint/ahtypes.h +++ b/xc/extras/freetype2/src/autohint/ahtypes.h @@ -20,23 +20,14 @@ /***************************************************************************/ -#ifndef AHTYPES_H -#define AHTYPES_H +#ifndef __AHTYPES_H__ +#define __AHTYPES_H__ -#include <freetype/internal/ftobjs.h> /* for freetype.h + FT_LOCAL etc. */ - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H #include "ahloader.h" -#else - -#include <autohint/ahloader.h> - -#endif - #define xxAH_DEBUG @@ -44,19 +35,16 @@ #ifdef AH_DEBUG #include <stdio.h> - -#define AH_LOG( x ) printf##x +#define AH_LOG( x ) printf ## x #else #define AH_LOG( x ) do ; while ( 0 ) /* nothing */ -#endif +#endif /* AH_DEBUG */ -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER /*************************************************************************/ @@ -492,15 +480,14 @@ FT_Vector trans_delta; FT_Matrix trans_matrix; + FT_Bool disable_horz_edges; + FT_Bool disable_vert_edges; } AH_Hinter; -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* AHTYPES_H */ +#endif /* __AHTYPES_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/autohint/autohint.c b/xc/extras/freetype2/src/autohint/autohint.c index 5916b6330..45ac2c27c 100644 --- a/xc/extras/freetype2/src/autohint/autohint.c +++ b/xc/extras/freetype2/src/autohint/autohint.c @@ -21,23 +21,12 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ahangles.c" #include "ahglyph.c" #include "ahglobal.c" #include "ahhint.c" #include "ahmodule.c" -#else - -#include <autohint/ahangles.c> -#include <autohint/ahglyph.c> -#include <autohint/ahglobal.c> -#include <autohint/ahhint.c> -#include <autohint/ahmodule.c> - -#endif - /* END */ diff --git a/xc/extras/freetype2/src/autohint/descrip.mms b/xc/extras/freetype2/src/autohint/descrip.mms new file mode 100644 index 000000000..cce93a48f --- /dev/null +++ b/xc/extras/freetype2/src/autohint/descrip.mms @@ -0,0 +1,25 @@ +# +# FreeType 2 auto-hinter module compilation rules for VMS +# + + +# Copyright 2001 Catharon Productions Inc. +# +# This file is part of the Catharon Typography Project and shall only +# be used, modified, and distributed under the terms of the Catharon +# Open Source License that should come with this file under the name +# `CatharonLicense.txt'. By continuing to use, modify, or distribute +# this file you indicate that you have read the license and +# understand and accept it fully. +# +# Note that this license is compatible with the FreeType license. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/incl=([--.include],[--.src.autohint]) + +OBJS=autohint.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/autohint/rules.mk b/xc/extras/freetype2/src/autohint/rules.mk index 87f7849ad..c6f275bf0 100644 --- a/xc/extras/freetype2/src/autohint/rules.mk +++ b/xc/extras/freetype2/src/autohint/rules.mk @@ -24,7 +24,7 @@ AUTO_DIR_ := $(AUTO_DIR)$(SEP) # compilation flags for the driver # -AUTO_COMPILE := $(FT_COMPILE) +AUTO_COMPILE := $(FT_COMPILE) $I$(AUTO_DIR) # AUTO driver sources (i.e., C files) diff --git a/xc/extras/freetype2/src/base/descrip.mms b/xc/extras/freetype2/src/base/descrip.mms new file mode 100644 index 000000000..f650ced6e --- /dev/null +++ b/xc/extras/freetype2/src/base/descrip.mms @@ -0,0 +1,23 @@ +# +# FreeType 2 base layer compilation rules for VMS +# + + +# Copyright 2001 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.builds.vms],[--.include],[--.src.base]) + +OBJS=ftbase.obj,ftinit.obj,ftglyph.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/base/ftbase.c b/xc/extras/freetype2/src/base/ftbase.c index a110af42b..1d61b5aa8 100644 --- a/xc/extras/freetype2/src/base/ftbase.c +++ b/xc/extras/freetype2/src/base/ftbase.c @@ -16,27 +16,19 @@ /***************************************************************************/ -#ifdef FT_FLAT_COMPILE +#include <ft2build.h> + +#define FT_MAKE_OPTION_SINGLE_OBJECT #include "ftcalc.c" #include "ftobjs.c" #include "ftstream.c" #include "ftlist.c" #include "ftoutln.c" -#include "ftextend.c" #include "ftnames.c" -#else /* FT_FLAT_COMPILE */ - -#include <base/ftcalc.c> -#include <base/ftobjs.c> -#include <base/ftstream.c> -#include <base/ftlist.c> -#include <base/ftoutln.c> -#include <base/ftextend.c> -#include <base/ftnames.c> - -#endif /* FT_FLAT_COMPILE */ - +#if 0 +#include "ftextend.c" +#endif /* END */ diff --git a/xc/extras/freetype2/src/base/ftbbox.c b/xc/extras/freetype2/src/base/ftbbox.c index 192902953..657227b05 100644 --- a/xc/extras/freetype2/src/base/ftbbox.c +++ b/xc/extras/freetype2/src/base/ftbbox.c @@ -24,9 +24,10 @@ /*************************************************************************/ -#include <freetype/ftbbox.h> -#include <freetype/ftimage.h> -#include <freetype/ftoutln.h> +#include <ft2build.h> +#include FT_BBOX_H +#include FT_IMAGE_H +#include FT_OUTLINE_H typedef struct TBBox_Rec_ diff --git a/xc/extras/freetype2/src/base/ftcalc.c b/xc/extras/freetype2/src/base/ftcalc.c index d42d6021f..ec7202ad0 100644 --- a/xc/extras/freetype2/src/base/ftcalc.c +++ b/xc/extras/freetype2/src/base/ftcalc.c @@ -26,14 +26,16 @@ /* */ /* Implementing basic computation routines. */ /* */ - /* FT_MulDiv(), FT_MulFix(), and FT_DivFix() are declared in freetype.h. */ + /* FT_MulDiv(), FT_MulFix(), FT_DivFix(), FT_RoundFix(), FT_CeilFix(), */ + /* and FT_FloorFix() are declared in freetype.h. */ /* */ /*************************************************************************/ -#include <freetype/internal/ftcalc.h> -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftobjs.h> /* for ABS() */ +#include <ft2build.h> +#include FT_INTERNAL_CALC_H +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_OBJECTS_H /*************************************************************************/ @@ -46,6 +48,33 @@ #define FT_COMPONENT trace_calc + /* The following three functions are available regardless of whether */ + /* FT_LONG64 or FT_CONFIG_OPTION_OLD_CALCS is defined. */ + + /* documentation is in freetype.h */ + + FT_EXPORT_DEF( FT_Fixed ) FT_RoundFix( FT_Fixed a ) + { + return( ( a + 0x8000L ) & -0x10000L ); + } + + + /* documentation is in freetype.h */ + + FT_EXPORT_DEF( FT_Fixed ) FT_CeilFix( FT_Fixed a ) + { + return( ( a + 0x10000L - 1 ) & -0x10000L ); + } + + + /* documentation is in freetype.h */ + + FT_EXPORT_DEF( FT_Fixed ) FT_FloorFix( FT_Fixed a ) + { + return( a & -0x10000L ); + } + + #ifdef FT_CONFIG_OPTION_OLD_CALCS static const FT_Long ft_square_roots[63] = diff --git a/xc/extras/freetype2/src/base/ftdebug.c b/xc/extras/freetype2/src/base/ftdebug.c index f291579af..f2a223755 100644 --- a/xc/extras/freetype2/src/base/ftdebug.c +++ b/xc/extras/freetype2/src/base/ftdebug.c @@ -41,7 +41,9 @@ /*************************************************************************/ -#include <freetype/internal/ftdebug.h> +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H + #ifdef FT_DEBUG_LEVEL_TRACE char ft_trace_levels[trace_max]; @@ -106,4 +108,8 @@ #endif /* FT_DEBUG_LEVEL_TRACE || FT_DEBUG_LEVEL_ERROR */ + /* ANSI C doesn't allow empty files, so we insert a dummy symbol */ + extern const int ft_debug_dummy; + + /* END */ diff --git a/xc/extras/freetype2/src/base/ftextend.c b/xc/extras/freetype2/src/base/ftextend.c index 7fd23c3d8..eba24c33d 100644 --- a/xc/extras/freetype2/src/base/ftextend.c +++ b/xc/extras/freetype2/src/base/ftextend.c @@ -1,6 +1,6 @@ /***************************************************************************/ /* */ -/* ftextend.h */ +/* ftextend.c */ /* */ /* FreeType extensions implementation (body). */ /* */ @@ -25,8 +25,9 @@ /*************************************************************************/ -#include <freetype/internal/ftextend.h> -#include <freetype/internal/ftdebug.h> +#include <ft2build.h> +#include FT_INTERNAL_EXTEND_H +#include FT_INTERNAL_DEBUG_H /*************************************************************************/ diff --git a/xc/extras/freetype2/src/base/ftglyph.c b/xc/extras/freetype2/src/base/ftglyph.c index 8ec96a7ea..811820f17 100644 --- a/xc/extras/freetype2/src/base/ftglyph.c +++ b/xc/extras/freetype2/src/base/ftglyph.c @@ -28,9 +28,10 @@ /*************************************************************************/ -#include <freetype/ftglyph.h> -#include <freetype/ftoutln.h> -#include <freetype/internal/ftobjs.h> +#include <ft2build.h> +#include FT_GLYPH_H +#include FT_OUTLINE_H +#include FT_INTERNAL_OBJECTS_H /*************************************************************************/ @@ -395,6 +396,9 @@ if ( error ) goto Exit; + copy->advance = source->advance; + copy->format = source->format; + if ( clazz->glyph_copy ) error = clazz->glyph_copy( source, copy ); @@ -598,6 +602,12 @@ if ( !error ) error = FT_Render_Glyph_Internal( glyph->library, &dummy, render_mode ); + if ( error ) + { + FT_Done_Glyph( FT_GLYPH( bitmap ) ); + goto Exit; + } + if ( !destroy && origin ) { FT_Vector v; diff --git a/xc/extras/freetype2/src/base/ftinit.c b/xc/extras/freetype2/src/base/ftinit.c index 79f751c89..9a0d21642 100644 --- a/xc/extras/freetype2/src/base/ftinit.c +++ b/xc/extras/freetype2/src/base/ftinit.c @@ -37,10 +37,11 @@ /*************************************************************************/ -#include <freetype/config/ftconfig.h> -#include <freetype/internal/ftobjs.h> -#include <freetype/internal/ftdebug.h> -#include <freetype/ftmodule.h> +#include <ft2build.h> +#include FT_CONFIG_CONFIG_H +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DEBUG_H +#include FT_MODULE_H /*************************************************************************/ @@ -59,7 +60,9 @@ #define FT_USE_MODULE( x ) extern const FT_Module_Class* x; #endif -#include <freetype/config/ftmodule.h> + +#include FT_CONFIG_MODULES_H + #undef FT_USE_MODULE #define FT_USE_MODULE( x ) (const FT_Module_Class*)&x, @@ -67,7 +70,7 @@ static const FT_Module_Class* const ft_default_modules[] = { -#include <freetype/config/ftmodule.h> +#include FT_CONFIG_MODULES_H 0 }; diff --git a/xc/extras/freetype2/src/base/ftlist.c b/xc/extras/freetype2/src/base/ftlist.c index b2688b0af..94564e063 100644 --- a/xc/extras/freetype2/src/base/ftlist.c +++ b/xc/extras/freetype2/src/base/ftlist.c @@ -23,9 +23,10 @@ /*************************************************************************/ -#include <freetype/ftlist.h> -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftobjs.h> +#include <ft2build.h> +#include FT_LIST_H +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_OBJECTS_H /*************************************************************************/ diff --git a/xc/extras/freetype2/src/base/ftmac.c b/xc/extras/freetype2/src/base/ftmac.c index 6feaa31e6..fff02f401 100644 --- a/xc/extras/freetype2/src/base/ftmac.c +++ b/xc/extras/freetype2/src/base/ftmac.c @@ -56,10 +56,12 @@ and delegate the rest of the work to it, by calling FT_Open_Face(). */ -#include <freetype/freetype.h> -#include <freetype/internal/ftstream.h> -#include <truetype/ttobjs.h> -#include <type1/t1objs.h> + +#include <ft2build.h> +#include FT_FREETYPE_H +#include FT_INTERNAL_STREAM_H +#include "truetype/ttobjs.h" +#include "type1/t1objs.h" #include <Resources.h> #include <Fonts.h> @@ -67,7 +69,7 @@ #include <ctype.h> /* for isupper() and isalnum() */ -#include <ftmac.h> +#include FT_MAC_H diff --git a/xc/extras/freetype2/src/base/ftmm.c b/xc/extras/freetype2/src/base/ftmm.c index d6c06050d..7e9dbe00f 100644 --- a/xc/extras/freetype2/src/base/ftmm.c +++ b/xc/extras/freetype2/src/base/ftmm.c @@ -16,8 +16,9 @@ /***************************************************************************/ -#include <freetype/ftmm.h> -#include <freetype/internal/ftobjs.h> +#include <ft2build.h> +#include FT_MULTIPLE_MASTERS_H +#include FT_INTERNAL_OBJECTS_H /*************************************************************************/ diff --git a/xc/extras/freetype2/src/base/ftnames.c b/xc/extras/freetype2/src/base/ftnames.c index 106f6b1dc..8ef57d160 100644 --- a/xc/extras/freetype2/src/base/ftnames.c +++ b/xc/extras/freetype2/src/base/ftnames.c @@ -19,8 +19,9 @@ /***************************************************************************/ -#include <freetype/ftnames.h> -#include <freetype/internal/tttypes.h> +#include <ft2build.h> +#include FT_SFNT_NAMES_H +#include FT_INTERNAL_TRUETYPE_TYPES_H #ifdef TT_CONFIG_OPTION_SFNT_NAMES @@ -48,7 +49,7 @@ TT_Face ttface = (TT_Face)face; - if ( index < ttface->num_names ) + if ( index < (FT_UInt)ttface->num_names ) { TT_NameRec* name = ttface->name_table.names + index; diff --git a/xc/extras/freetype2/src/base/ftobjs.c b/xc/extras/freetype2/src/base/ftobjs.c index 636a765bb..ecd99af01 100644 --- a/xc/extras/freetype2/src/base/ftobjs.c +++ b/xc/extras/freetype2/src/base/ftobjs.c @@ -16,12 +16,12 @@ /***************************************************************************/ -#include <freetype/ftlist.h> -#include <freetype/internal/ftobjs.h> -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftstream.h> - -#include <freetype/tttables.h> +#include <ft2build.h> +#include FT_LIST_H +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_TABLES_H #include <string.h> /* for strcmp() */ @@ -2079,10 +2079,10 @@ } - FT_LOCAL_DEF - FT_Error FT_Render_Glyph_Internal( FT_Library library, - FT_GlyphSlot slot, - FT_UInt render_mode ) + FT_EXPORT_DEF( FT_Error ) FT_Render_Glyph_Internal( + FT_Library library, + FT_GlyphSlot slot, + FT_UInt render_mode ) { FT_Error error = FT_Err_Ok; FT_Renderer renderer; diff --git a/xc/extras/freetype2/src/base/ftoutln.c b/xc/extras/freetype2/src/base/ftoutln.c index fdd0098d7..f8294c68d 100644 --- a/xc/extras/freetype2/src/base/ftoutln.c +++ b/xc/extras/freetype2/src/base/ftoutln.c @@ -23,8 +23,9 @@ /*************************************************************************/ -#include <freetype/ftoutln.h> -#include <freetype/internal/ftobjs.h> +#include <ft2build.h> +#include FT_OUTLINE_H +#include FT_INTERNAL_OBJECTS_H /*************************************************************************/ diff --git a/xc/extras/freetype2/src/base/ftstream.c b/xc/extras/freetype2/src/base/ftstream.c index 5b4e1dc99..1ada68c09 100644 --- a/xc/extras/freetype2/src/base/ftstream.c +++ b/xc/extras/freetype2/src/base/ftstream.c @@ -16,8 +16,9 @@ /***************************************************************************/ -#include <freetype/internal/ftstream.h> -#include <freetype/internal/ftdebug.h> +#include <ft2build.h> +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_DEBUG_H /*************************************************************************/ diff --git a/xc/extras/freetype2/src/base/ftsynth.c b/xc/extras/freetype2/src/base/ftsynth.c index 4858649d1..604e1bf4c 100644 --- a/xc/extras/freetype2/src/base/ftsynth.c +++ b/xc/extras/freetype2/src/base/ftsynth.c @@ -16,9 +16,10 @@ /***************************************************************************/ -#include <freetype/internal/ftobjs.h> -#include <freetype/ftoutln.h> -#include <freetype/ftsynth.h> +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H +#include FT_OUTLINE_H +#include FT_SYNTHESIS_H #define FT_BOLD_THRESHOLD 0x0100 diff --git a/xc/extras/freetype2/src/base/ftsystem.c b/xc/extras/freetype2/src/base/ftsystem.c index da77ae61a..3de938293 100644 --- a/xc/extras/freetype2/src/base/ftsystem.c +++ b/xc/extras/freetype2/src/base/ftsystem.c @@ -25,11 +25,12 @@ /*************************************************************************/ -#include <freetype/config/ftconfig.h> -#include <freetype/internal/ftdebug.h> -#include <freetype/ftsystem.h> -#include <freetype/fterrors.h> -#include <freetype/fttypes.h> +#include <ft2build.h> +#include FT_CONFIG_CONFIG_H +#include FT_INTERNAL_DEBUG_H +#include FT_SYSTEM_H +#include FT_ERRORS_H +#include FT_TYPES_H #include <stdio.h> #include <stdlib.h> @@ -67,7 +68,7 @@ /* <Return> */ /* The address of newly allocated block. */ /* */ - static + FT_CALLBACK_DEF void* ft_alloc( FT_Memory memory, long size ) { @@ -97,7 +98,7 @@ /* <Return> */ /* The address of the reallocated memory block. */ /* */ - static + FT_CALLBACK_DEF void* ft_realloc( FT_Memory memory, long cur_size, long new_size, @@ -123,7 +124,7 @@ /* */ /* block :: The address of block in memory to be freed. */ /* */ - static + FT_CALLBACK_DEF void ft_free( FT_Memory memory, void* block ) { @@ -165,7 +166,7 @@ /* <Input> */ /* stream :: A pointer to the stream object. */ /* */ - static + FT_CALLBACK_DEF void ft_close_stream( FT_Stream stream ) { fclose( STREAM_FILE( stream ) ); @@ -196,7 +197,7 @@ /* <Return> */ /* The number of bytes actually read. */ /* */ - static + FT_CALLBACK_DEF unsigned long ft_io_stream( FT_Stream stream, unsigned long offset, unsigned char* buffer, @@ -276,7 +277,7 @@ FT_EXPORT_DEF( void ) FT_Done_Memory( FT_Memory memory ) { - free( memory ); + memory->free( memory, memory ); } diff --git a/xc/extras/freetype2/src/cache/descrip.mms b/xc/extras/freetype2/src/cache/descrip.mms new file mode 100644 index 000000000..b87c1c6f9 --- /dev/null +++ b/xc/extras/freetype2/src/cache/descrip.mms @@ -0,0 +1,23 @@ +# +# FreeType 2 Cache compilation rules for VMS +# + + +# Copyright 2001 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.cache]) + +OBJS=ftcache.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/cache/ftcache.c b/xc/extras/freetype2/src/cache/ftcache.c index f5cf47bd5..324d1b6e0 100644 --- a/xc/extras/freetype2/src/cache/ftcache.c +++ b/xc/extras/freetype2/src/cache/ftcache.c @@ -18,8 +18,7 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ftlru.c" #include "ftcmanag.c" #include "ftcglyph.c" @@ -27,16 +26,5 @@ #include "ftcimage.c" #include "ftcsbits.c" -#else - -#include <cache/ftlru.c> -#include <cache/ftcmanag.c> -#include <cache/ftcglyph.c> -#include <cache/ftcchunk.c> -#include <cache/ftcimage.c> -#include <cache/ftcsbits.c> - -#endif - /* END */ diff --git a/xc/extras/freetype2/src/cache/ftcchunk.c b/xc/extras/freetype2/src/cache/ftcchunk.c index 4689cfb70..f7bb541d8 100644 --- a/xc/extras/freetype2/src/cache/ftcchunk.c +++ b/xc/extras/freetype2/src/cache/ftcchunk.c @@ -16,11 +16,12 @@ /***************************************************************************/ -#include <freetype/cache/ftcchunk.h> -#include <freetype/ftlist.h> -#include <freetype/fterrors.h> -#include <freetype/internal/ftobjs.h> -#include <freetype/fterrors.h> +#include <ft2build.h> +#include FT_CACHE_H +#include FT_CACHE_INTERNAL_CHUNK_H +#include FT_LIST_H +#include FT_ERRORS_H +#include FT_INTERNAL_OBJECTS_H /*************************************************************************/ @@ -299,7 +300,7 @@ if ( !error ) { /* good, now set the set index within the set object */ - cset->cset_index = node - lru->nodes; + cset->cset_index = (FT_UInt)( node - lru->nodes ); node->root.data = cset; } diff --git a/xc/extras/freetype2/src/cache/ftcglyph.c b/xc/extras/freetype2/src/cache/ftcglyph.c index b378132ee..40633e6b2 100644 --- a/xc/extras/freetype2/src/cache/ftcglyph.c +++ b/xc/extras/freetype2/src/cache/ftcglyph.c @@ -16,11 +16,13 @@ /***************************************************************************/ -#include <freetype/cache/ftcglyph.h> -#include <freetype/fterrors.h> -#include <freetype/ftlist.h> -#include <freetype/internal/ftobjs.h> -#include <freetype/internal/ftdebug.h> +#include <ft2build.h> +#include FT_CACHE_H +#include FT_CACHE_INTERNAL_GLYPH_H +#include FT_ERRORS_H +#include FT_LIST_H +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DEBUG_H /*************************************************************************/ @@ -325,7 +327,7 @@ if ( !error ) { /* good, now set the gset index within the gset object */ - gset->gset_index = node - lru->nodes; + gset->gset_index = (FT_UInt)( node - lru->nodes ); node->root.data = gset; } diff --git a/xc/extras/freetype2/src/cache/ftcimage.c b/xc/extras/freetype2/src/cache/ftcimage.c index 770338dc3..9d48bbec6 100644 --- a/xc/extras/freetype2/src/cache/ftcimage.c +++ b/xc/extras/freetype2/src/cache/ftcimage.c @@ -16,8 +16,10 @@ /***************************************************************************/ -#include <freetype/cache/ftcimage.h> -#include <freetype/internal/ftmemory.h> +#include <ft2build.h> +#include FT_CACHE_H +#include FT_CACHE_IMAGE_H +#include FT_INTERNAL_MEMORY_H #include <string.h> /* memcmp() */ #include <stdlib.h> /* labs() */ diff --git a/xc/extras/freetype2/src/cache/ftcmanag.c b/xc/extras/freetype2/src/cache/ftcmanag.c index 301aad0f2..a39e7fab9 100644 --- a/xc/extras/freetype2/src/cache/ftcmanag.c +++ b/xc/extras/freetype2/src/cache/ftcmanag.c @@ -16,10 +16,12 @@ /***************************************************************************/ -#include <freetype/cache/ftcmanag.h> -#include <freetype/internal/ftobjs.h> -#include <freetype/internal/ftdebug.h> -#include <freetype/ftlist.h> +#include <ft2build.h> +#include FT_CACHE_H +#include FT_CACHE_MANAGER_H +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DEBUG_H +#include FT_LIST_H #undef FT_COMPONENT @@ -139,6 +141,7 @@ FT_UNUSED( lru ); FT_Done_Size( (FT_Size)node->root.data ); + node->root.data = 0; } @@ -264,8 +267,8 @@ Exit: if ( error && manager ) { - FT_Lru_Done( manager->sizes_lru ); FT_Lru_Done( manager->faces_lru ); + FT_Lru_Done( manager->sizes_lru ); FREE( manager ); } @@ -299,8 +302,11 @@ } /* discard faces and sizes */ - FT_Lru_Done( manager->sizes_lru ); FT_Lru_Done( manager->faces_lru ); + manager->faces_lru = 0; + + FT_Lru_Done( manager->sizes_lru ); + manager->sizes_lru = 0; FREE( manager ); } diff --git a/xc/extras/freetype2/src/cache/ftcsbits.c b/xc/extras/freetype2/src/cache/ftcsbits.c index fcb73fde8..adb295ba3 100644 --- a/xc/extras/freetype2/src/cache/ftcsbits.c +++ b/xc/extras/freetype2/src/cache/ftcsbits.c @@ -16,15 +16,17 @@ /***************************************************************************/ -#include <freetype/cache/ftcsbits.h> -#include <freetype/internal/ftobjs.h> -#include <freetype/internal/ftdebug.h> -#include <freetype/fterrors.h> +#include <ft2build.h> +#include FT_CACHE_H +#include FT_CACHE_SMALL_BITMAPS_H +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DEBUG_H +#include FT_ERRORS_H #include <string.h> /* memcmp() */ -#define FTC_SBITSET_ELEMENT_COUNT 16 +#define FTC_SBITSET_ELEMENT_COUNT 16 typedef struct FTC_SBitSetRec_ diff --git a/xc/extras/freetype2/src/cache/ftlru.c b/xc/extras/freetype2/src/cache/ftlru.c index b2480d863..783ccbece 100644 --- a/xc/extras/freetype2/src/cache/ftlru.c +++ b/xc/extras/freetype2/src/cache/ftlru.c @@ -16,9 +16,11 @@ /***************************************************************************/ -#include <freetype/cache/ftlru.h> -#include <freetype/ftlist.h> -#include <freetype/internal/ftobjs.h> +#include <ft2build.h> +#include FT_CACHE_H +#include FT_CACHE_INTERNAL_LRU_H +#include FT_LIST_H +#include FT_INTERNAL_OBJECTS_H static @@ -126,6 +128,8 @@ memory = lru->memory; FT_Lru_Reset( lru ); + + FREE( lru->nodes ); FREE( lru ); } diff --git a/xc/extras/freetype2/src/cache/rules.mk b/xc/extras/freetype2/src/cache/rules.mk index 086b0995d..a83416a32 100644 --- a/xc/extras/freetype2/src/cache/rules.mk +++ b/xc/extras/freetype2/src/cache/rules.mk @@ -23,7 +23,7 @@ CACHE_H_DIR_ := $(CACHE_H_DIR)$(SEP) # compilation flags for the driver # -Cache_COMPILE := $(FT_COMPILE) +Cache_COMPILE := $(FT_COMPILE) $I$(CACHE_DIR) # Cache driver sources (i.e., C files) diff --git a/xc/extras/freetype2/src/cff/cff.c b/xc/extras/freetype2/src/cff/cff.c index 5a987f1cd..6ac61f767 100644 --- a/xc/extras/freetype2/src/cff/cff.c +++ b/xc/extras/freetype2/src/cff/cff.c @@ -18,23 +18,12 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#ifdef FT_FLAT_COMPILE - -#include "t2driver.c" /* driver interface */ -#include "t2parse.c" /* token parser */ -#include "t2load.c" /* tables loader */ -#include "t2objs.c" /* object management */ -#include "t2gload.c" /* glyph loader */ - -#else - -#include <cff/t2driver.c> /* driver interface */ -#include <cff/t2parse.c> /* token parser */ -#include <cff/t2load.c> /* tables loader */ -#include <cff/t2objs.c> /* object management */ -#include <cff/t2gload.c> /* glyph loader */ - -#endif +#include <ft2build.h> +#include "cffdrivr.c" +#include "cffparse.c" +#include "cffload.c" +#include "cffobjs.c" +#include "cffgload.c" /* END */ diff --git a/xc/extras/freetype2/src/cff/cffdrivr.c b/xc/extras/freetype2/src/cff/cffdrivr.c new file mode 100644 index 000000000..108228024 --- /dev/null +++ b/xc/extras/freetype2/src/cff/cffdrivr.c @@ -0,0 +1,423 @@ +/***************************************************************************/ +/* */ +/* cffdrivr.c */ +/* */ +/* OpenType font driver implementation (body). */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include <ft2build.h> +#include FT_FREETYPE_H +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_SFNT_H +#include FT_TRUETYPE_IDS_H +#include FT_INTERNAL_CFF_ERRORS_H + +#include "cffdrivr.h" +#include "cffgload.h" +#include "cffload.h" + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_cffdriver + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** ****/ + /**** F A C E S ****/ + /**** ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + +#undef PAIR_TAG +#define PAIR_TAG( left, right ) ( ( (FT_ULong)left << 16 ) | \ + (FT_ULong)right ) + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* Get_Kerning */ + /* */ + /* <Description> */ + /* A driver method used to return the kerning vector between two */ + /* glyphs of the same face. */ + /* */ + /* <Input> */ + /* face :: A handle to the source face object. */ + /* */ + /* left_glyph :: The index of the left glyph in the kern pair. */ + /* */ + /* right_glyph :: The index of the right glyph in the kern pair. */ + /* */ + /* <Output> */ + /* kerning :: The kerning vector. This is in font units for */ + /* scalable formats, and in pixels for fixed-sizes */ + /* formats. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + /* <Note> */ + /* Only horizontal layouts (left-to-right & right-to-left) are */ + /* supported by this function. Other layouts, or more sophisticated */ + /* kernings, are out of scope of this method (the basic driver */ + /* interface is meant to be simple). */ + /* */ + /* They can be implemented by format-specific interfaces. */ + /* */ + static + FT_Error Get_Kerning( TT_Face face, + FT_UInt left_glyph, + FT_UInt right_glyph, + FT_Vector* kerning ) + { + TT_Kern_0_Pair* pair; + + + if ( !face ) + return CFF_Err_Invalid_Face_Handle; + + kerning->x = 0; + kerning->y = 0; + + if ( face->kern_pairs ) + { + /* there are some kerning pairs in this font file! */ + FT_ULong search_tag = PAIR_TAG( left_glyph, right_glyph ); + FT_Long left, right; + + + left = 0; + right = face->num_kern_pairs - 1; + + while ( left <= right ) + { + FT_Int middle = left + ( ( right - left ) >> 1 ); + FT_ULong cur_pair; + + + pair = face->kern_pairs + middle; + cur_pair = PAIR_TAG( pair->left, pair->right ); + + if ( cur_pair == search_tag ) + goto Found; + + if ( cur_pair < search_tag ) + left = middle + 1; + else + right = middle - 1; + } + } + + Exit: + return CFF_Err_Ok; + + Found: + kerning->x = pair->value; + goto Exit; + } + + +#undef PAIR_TAG + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* Load_Glyph */ + /* */ + /* <Description> */ + /* A driver method used to load a glyph within a given glyph slot. */ + /* */ + /* <Input> */ + /* slot :: A handle to the target slot object where the glyph */ + /* will be loaded. */ + /* */ + /* size :: A handle to the source face size at which the glyph */ + /* must be scaled, loaded, etc. */ + /* */ + /* glyph_index :: The index of the glyph in the font file. */ + /* */ + /* load_flags :: A flag indicating what to load for this glyph. The */ + /* FTLOAD_??? constants can be used to control the */ + /* glyph loading process (e.g., whether the outline */ + /* should be scaled, whether to load bitmaps or not, */ + /* whether to hint the outline, etc). */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + static + FT_Error Load_Glyph( CFF_GlyphSlot slot, + CFF_Size size, + FT_UShort glyph_index, + FT_UInt load_flags ) + { + FT_Error error; + + + if ( !slot ) + return CFF_Err_Invalid_Glyph_Handle; + + /* check whether we want a scaled outline or bitmap */ + if ( !size ) + load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING; + + if ( load_flags & FT_LOAD_NO_SCALE ) + size = NULL; + + /* reset the size object if necessary */ + if ( size ) + { + /* these two object must have the same parent */ + if ( size->face != slot->root.face ) + return CFF_Err_Invalid_Face_Handle; + } + + /* now load the glyph outline if necessary */ + error = CFF_Load_Glyph( slot, size, glyph_index, load_flags ); + + /* force drop-out mode to 2 - irrelevant now */ + /* slot->outline.dropout_mode = 2; */ + + return error; + } + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** ****/ + /**** C H A R A C T E R M A P P I N G S ****/ + /**** ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + static + FT_Error get_cff_glyph_name( CFF_Face face, + FT_UInt glyph_index, + FT_Pointer buffer, + FT_UInt buffer_max ) + { + CFF_Font* font = (CFF_Font*)face->extra.data; + FT_Memory memory = FT_FACE_MEMORY(face); + FT_String* gname; + FT_UShort sid; + PSNames_Interface* psnames; + FT_Error error; + + psnames = (PSNames_Interface*)FT_Get_Module_Interface( + face->root.driver->root.library, "psnames" ); + + if ( !psnames ) + { + FT_ERROR(( "CFF_Init_Face:" )); + FT_ERROR(( " cannot open CFF & CEF fonts\n" )); + FT_ERROR(( " " )); + FT_ERROR(( " without the `PSNames' module\n" )); + error = FT_Err_Unknown_File_Format; + goto Exit; + } + + /* first, locate the sid in the charset table */ + sid = font->charset.sids[glyph_index]; + + /* now, lookup the name itself */ + gname = CFF_Get_String( &font->string_index, sid, psnames ); + + if ( buffer_max > 0 ) + { + FT_UInt len = strlen( gname ); + + + if ( len >= buffer_max ) + len = buffer_max - 1; + + MEM_Copy( buffer, gname, len ); + ((FT_Byte*)buffer)[len] = 0; + } + + FREE ( gname ); + error = CFF_Err_Ok; + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* Get_Char_Index */ + /* */ + /* <Description> */ + /* Uses a charmap to return a given character code's glyph index. */ + /* */ + /* <Input> */ + /* charmap :: A handle to the source charmap object. */ + /* charcode :: The character code. */ + /* */ + /* <Return> */ + /* Glyph index. 0 means `undefined character code'. */ + /* */ + static + FT_UInt cff_get_char_index( TT_CharMap charmap, + FT_Long charcode ) + { + FT_Error error; + CFF_Face face; + TT_CMapTable* cmap; + + + cmap = &charmap->cmap; + face = (CFF_Face)charmap->root.face; + + /* Load table if needed */ + if ( !cmap->loaded ) + { + SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt; + + + error = sfnt->load_charmap( face, cmap, face->root.stream ); + if ( error ) + return 0; + + cmap->loaded = TRUE; + } + + return ( cmap->get_index ? cmap->get_index( cmap, charcode ) : 0 ); + } + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** ****/ + /**** D R I V E R I N T E R F A C E ****/ + /**** ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + static + FT_Module_Interface cff_get_interface( CFF_Driver driver, + const char* interface ) + { + FT_Module sfnt; + +#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES + if ( strcmp( (const char*)interface, "glyph_name" ) == 0 ) + return (FT_Module_Interface)get_cff_glyph_name; +#endif + + /* we simply pass our request to the `sfnt' module */ + sfnt = FT_Get_Module( driver->root.root.library, "sfnt" ); + + return sfnt ? sfnt->clazz->get_interface( sfnt, interface ) : 0; + } + + + /* The FT_DriverInterface structure is defined in ftdriver.h. */ + + FT_CALLBACK_TABLE_DEF + const FT_Driver_Class cff_driver_class = + { + /* begin with the FT_Module_Class fields */ + { + ft_module_font_driver | ft_module_driver_scalable, + sizeof( CFF_DriverRec ), + "cff", + 0x10000L, + 0x20000L, + + 0, /* module-specific interface */ + + (FT_Module_Constructor)CFF_Init_Driver, + (FT_Module_Destructor) CFF_Done_Driver, + (FT_Module_Requester) cff_get_interface, + }, + + /* now the specific driver fields */ + sizeof( TT_FaceRec ), + sizeof( FT_SizeRec ), + sizeof( CFF_GlyphSlotRec ), + + (FTDriver_initFace) CFF_Init_Face, + (FTDriver_doneFace) CFF_Done_Face, + (FTDriver_initSize) 0, + (FTDriver_doneSize) 0, + (FTDriver_initGlyphSlot)0, + (FTDriver_doneGlyphSlot)0, + + (FTDriver_setCharSizes) 0, + (FTDriver_setPixelSizes)0, + + (FTDriver_loadGlyph) Load_Glyph, + (FTDriver_getCharIndex) cff_get_char_index, + + (FTDriver_getKerning) Get_Kerning, + (FTDriver_attachFile) 0, + (FTDriver_getAdvances) 0 + }; + + +#ifdef FT_CONFIG_OPTION_DYNAMIC_DRIVERS + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* getDriverClass */ + /* */ + /* <Description> */ + /* This function is used when compiling the TrueType driver as a */ + /* shared library (`.DLL' or `.so'). It will be used by the */ + /* high-level library of FreeType to retrieve the address of the */ + /* driver's generic interface. */ + /* */ + /* It shouldn't be implemented in a static build, as each driver must */ + /* have the same function as an exported entry point. */ + /* */ + /* <Return> */ + /* The address of the TrueType's driver generic interface. The */ + /* format-specific interface can then be retrieved through the method */ + /* interface->get_format_interface. */ + /* */ + FT_EXPORT_DEF( const FT_Driver_Class* ) getDriverClass( void ) + { + return &cff_driver_class; + } + + +#endif /* CONFIG_OPTION_DYNAMIC_DRIVERS */ + + +/* END */ diff --git a/xc/extras/freetype2/src/cff/cffdrivr.h b/xc/extras/freetype2/src/cff/cffdrivr.h new file mode 100644 index 000000000..846e0b1b5 --- /dev/null +++ b/xc/extras/freetype2/src/cff/cffdrivr.h @@ -0,0 +1,39 @@ +/***************************************************************************/ +/* */ +/* cffdrivr.h */ +/* */ +/* High-level OpenType driver interface (specification). */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __CFFDRIVER_H__ +#define __CFFDRIVER_H__ + + +#include <ft2build.h> +#include FT_INTERNAL_DRIVER_H + + +FT_BEGIN_HEADER + + + FT_CALLBACK_TABLE + const FT_Driver_Class cff_driver_class; + + +FT_END_HEADER + +#endif /* __CFFDRIVER_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/src/cff/cffgload.c b/xc/extras/freetype2/src/cff/cffgload.c new file mode 100644 index 000000000..4850e3dd0 --- /dev/null +++ b/xc/extras/freetype2/src/cff/cffgload.c @@ -0,0 +1,2293 @@ +/***************************************************************************/ +/* */ +/* cffgload.c */ +/* */ +/* OpenType Glyph Loader (body). */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_CALC_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_SFNT_H +#include FT_OUTLINE_H +#include FT_TRUETYPE_TAGS_H + +#include "cffload.h" +#include "cffgload.h" + +#include FT_INTERNAL_CFF_ERRORS_H + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_cffgload + + + typedef enum CFF_Operator_ + { + cff_op_unknown = 0, + + cff_op_rmoveto, + cff_op_hmoveto, + cff_op_vmoveto, + + cff_op_rlineto, + cff_op_hlineto, + cff_op_vlineto, + + cff_op_rrcurveto, + cff_op_hhcurveto, + cff_op_hvcurveto, + cff_op_rcurveline, + cff_op_rlinecurve, + cff_op_vhcurveto, + cff_op_vvcurveto, + + cff_op_flex, + cff_op_hflex, + cff_op_hflex1, + cff_op_flex1, + + cff_op_endchar, + + cff_op_hstem, + cff_op_vstem, + cff_op_hstemhm, + cff_op_vstemhm, + + cff_op_hintmask, + cff_op_cntrmask, + cff_op_dotsection, /* deprecated, acts as no-op */ + + cff_op_abs, + cff_op_add, + cff_op_sub, + cff_op_div, + cff_op_neg, + cff_op_random, + cff_op_mul, + cff_op_sqrt, + + cff_op_blend, + + cff_op_drop, + cff_op_exch, + cff_op_index, + cff_op_roll, + cff_op_dup, + + cff_op_put, + cff_op_get, + cff_op_store, + cff_op_load, + + cff_op_and, + cff_op_or, + cff_op_not, + cff_op_eq, + cff_op_ifelse, + + cff_op_callsubr, + cff_op_callgsubr, + cff_op_return, + + /* do not remove */ + cff_op_max + + } CFF_Operator; + + +#define CFF_COUNT_CHECK_WIDTH 0x80 +#define CFF_COUNT_EXACT 0x40 +#define CFF_COUNT_CLEAR_STACK 0x20 + + + static const FT_Byte cff_argument_counts[] = + { + 0, /* unknown */ + + 2 | CFF_COUNT_CHECK_WIDTH | CFF_COUNT_EXACT, /* rmoveto */ + 1 | CFF_COUNT_CHECK_WIDTH | CFF_COUNT_EXACT, + 1 | CFF_COUNT_CHECK_WIDTH | CFF_COUNT_EXACT, + + 0 | CFF_COUNT_CLEAR_STACK, /* rlineto */ + 0 | CFF_COUNT_CLEAR_STACK, + 0 | CFF_COUNT_CLEAR_STACK, + + 0 | CFF_COUNT_CLEAR_STACK, /* rrcurveto */ + 0 | CFF_COUNT_CLEAR_STACK, + 0 | CFF_COUNT_CLEAR_STACK, + 0 | CFF_COUNT_CLEAR_STACK, + 0 | CFF_COUNT_CLEAR_STACK, + 0 | CFF_COUNT_CLEAR_STACK, + 0 | CFF_COUNT_CLEAR_STACK, + + 13, /* flex */ + 7, + 9, + 11, + + 0 | CFF_COUNT_CHECK_WIDTH, /* endchar */ + + 2 | CFF_COUNT_CHECK_WIDTH, /* hstem */ + 2 | CFF_COUNT_CHECK_WIDTH, + 2 | CFF_COUNT_CHECK_WIDTH, + 2 | CFF_COUNT_CHECK_WIDTH, + + 0, /* hintmask */ + 0, /* cntrmask */ + 0, /* dotsection */ + + 1, /* abs */ + 2, + 2, + 2, + 1, + 0, + 2, + 1, + + 1, /* blend */ + + 1, /* drop */ + 2, + 1, + 2, + 1, + + 2, /* put */ + 1, + 4, + 3, + + 2, /* and */ + 2, + 1, + 2, + 4, + + 1, /* callsubr */ + 1, + 0 + }; + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /********** *********/ + /********** *********/ + /********** GENERIC CHARSTRING PARSING *********/ + /********** *********/ + /********** *********/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* CFF_Init_Builder */ + /* */ + /* <Description> */ + /* Initializes a given glyph builder. */ + /* */ + /* <InOut> */ + /* builder :: A pointer to the glyph builder to initialize. */ + /* */ + /* <Input> */ + /* face :: The current face object. */ + /* */ + /* size :: The current size object. */ + /* */ + /* glyph :: The current glyph object. */ + /* */ + static + void CFF_Init_Builder( CFF_Builder* builder, + TT_Face face, + CFF_Size size, + CFF_GlyphSlot glyph ) + { + builder->path_begun = 0; + builder->load_points = 1; + + builder->face = face; + builder->glyph = glyph; + builder->memory = face->root.memory; + + if ( glyph ) + { + FT_GlyphLoader* loader = glyph->root.internal->loader; + + + builder->loader = loader; + builder->base = &loader->base.outline; + builder->current = &loader->current.outline; + FT_GlyphLoader_Rewind( loader ); + } + + if ( size ) + { + builder->scale_x = size->metrics.x_scale; + builder->scale_y = size->metrics.y_scale; + } + + builder->pos_x = 0; + builder->pos_y = 0; + + builder->left_bearing.x = 0; + builder->left_bearing.y = 0; + builder->advance.x = 0; + builder->advance.y = 0; + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* CFF_Done_Builder */ + /* */ + /* <Description> */ + /* Finalizes a given glyph builder. Its contents can still be used */ + /* after the call, but the function saves important information */ + /* within the corresponding glyph slot. */ + /* */ + /* <Input> */ + /* builder :: A pointer to the glyph builder to finalize. */ + /* */ + static + void CFF_Done_Builder( CFF_Builder* builder ) + { + CFF_GlyphSlot glyph = builder->glyph; + + + if ( glyph ) + glyph->root.outline = *builder->base; + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* cff_compute_bias */ + /* */ + /* <Description> */ + /* Computes the bias value in dependence of the number of glyph */ + /* subroutines. */ + /* */ + /* <Input> */ + /* num_subrs :: The number of glyph subroutines. */ + /* */ + /* <Return> */ + /* The bias value. */ + static + FT_Int cff_compute_bias( FT_UInt num_subrs ) + { + FT_Int result; + + + if ( num_subrs < 1240 ) + result = 107; + else if ( num_subrs < 33900 ) + result = 1131; + else + result = 32768; + + return result; + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* CFF_Init_Decoder */ + /* */ + /* <Description> */ + /* Initializes a given glyph decoder. */ + /* */ + /* <InOut> */ + /* decoder :: A pointer to the glyph builder to initialize. */ + /* */ + /* <Input> */ + /* face :: The current face object. */ + /* */ + /* size :: The current size object. */ + /* */ + /* slot :: The current glyph object. */ + /* */ + FT_LOCAL_DEF + void CFF_Init_Decoder( CFF_Decoder* decoder, + TT_Face face, + CFF_Size size, + CFF_GlyphSlot slot ) + { + CFF_Font* cff = (CFF_Font*)face->extra.data; + + + /* clear everything */ + MEM_Set( decoder, 0, sizeof ( *decoder ) ); + + /* initialize builder */ + CFF_Init_Builder( &decoder->builder, face, size, slot ); + + /* initialize Type2 decoder */ + decoder->num_globals = cff->num_global_subrs; + decoder->globals = cff->global_subrs; + decoder->globals_bias = cff_compute_bias( decoder->num_globals ); + } + + + /* this function is used to select the locals subrs array */ + FT_LOCAL_DEF + void CFF_Prepare_Decoder( CFF_Decoder* decoder, + FT_UInt glyph_index ) + { + CFF_Font* cff = (CFF_Font*)decoder->builder.face->extra.data; + CFF_SubFont* sub = &cff->top_font; + + + /* manage CID fonts */ + if ( cff->num_subfonts >= 1 ) + { + FT_Byte fd_index = CFF_Get_FD( &cff->fd_select, glyph_index ); + + + sub = cff->subfonts[fd_index]; + } + + decoder->num_locals = sub->num_local_subrs; + decoder->locals = sub->local_subrs; + decoder->locals_bias = cff_compute_bias( decoder->num_locals ); + + decoder->glyph_width = sub->private_dict.default_width; + decoder->nominal_width = sub->private_dict.nominal_width; + } + + + /* check that there is enough room for `count' more points */ + static + FT_Error check_points( CFF_Builder* builder, + FT_Int count ) + { + return FT_GlyphLoader_Check_Points( builder->loader, count, 0 ); + } + + + /* add a new point, do not check space */ + static + void add_point( CFF_Builder* builder, + FT_Pos x, + FT_Pos y, + FT_Byte flag ) + { + FT_Outline* outline = builder->current; + + + if ( builder->load_points ) + { + FT_Vector* point = outline->points + outline->n_points; + FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points; + + + point->x = x >> 16; + point->y = y >> 16; + *control = flag ? FT_Curve_Tag_On : FT_Curve_Tag_Cubic; + + builder->last = *point; + } + outline->n_points++; + } + + + /* check space for a new on-curve point, then add it */ + static + FT_Error add_point1( CFF_Builder* builder, + FT_Pos x, + FT_Pos y ) + { + FT_Error error; + + + error = check_points( builder, 1 ); + if ( !error ) + add_point( builder, x, y, 1 ); + + return error; + } + + + /* check room for a new contour, then add it */ + static + FT_Error add_contour( CFF_Builder* builder ) + { + FT_Outline* outline = builder->current; + FT_Error error; + + + if ( !builder->load_points ) + { + outline->n_contours++; + return CFF_Err_Ok; + } + + error = FT_GlyphLoader_Check_Points( builder->loader, 0, 1 ); + if ( !error ) + { + if ( outline->n_contours > 0 ) + outline->contours[outline->n_contours - 1] = outline->n_points - 1; + + outline->n_contours++; + } + + return error; + } + + + /* if a path was begun, add its first on-curve point */ + static + FT_Error start_point( CFF_Builder* builder, + FT_Pos x, + FT_Pos y ) + { + FT_Error error = 0; + + + /* test whether we are building a new contour */ + if ( !builder->path_begun ) + { + builder->path_begun = 1; + error = add_contour( builder ); + if ( !error ) + error = add_point1( builder, x, y ); + } + return error; + } + + + /* close the current contour */ + static + void close_contour( CFF_Builder* builder ) + { + FT_Outline* outline = builder->current; + + /* XXXX: We must not include the last point in the path if it */ + /* is located on the first point. */ + if ( outline->n_points > 1 ) + { + FT_Int first = 0; + FT_Vector* p1 = outline->points + first; + FT_Vector* p2 = outline->points + outline->n_points - 1; + FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points - 1; + + + if ( outline->n_contours > 1 ) + { + first = outline->contours[outline->n_contours - 2] + 1; + p1 = outline->points + first; + } + + /* `delete' last point only if it coincides with the first */ + /* point and it is not a control point (which can happen). */ + if ( p1->x == p2->x && p1->y == p2->y ) + if ( *control == FT_Curve_Tag_On ) + outline->n_points--; + } + + if ( outline->n_contours > 0 ) + outline->contours[outline->n_contours - 1] = outline->n_points - 1; + } + + + static + FT_Int cff_lookup_glyph_by_stdcharcode( CFF_Font* cff, + FT_Int charcode ) + { + FT_UInt n; + FT_UShort glyph_sid; + + + /* check range of standard char code */ + if ( charcode < 0 || charcode > 255 ) + return -1; + + + /* Get code to SID mapping from `cff_standard_encoding'. */ + glyph_sid = cff_standard_encoding[charcode]; + + for ( n = 0; n < cff->num_glyphs; n++ ) + { + if ( cff->charset.sids[n] == glyph_sid ) + return n; + } + + return -1; + } + + + static + FT_Error cff_operator_seac( CFF_Decoder* decoder, + FT_Pos adx, + FT_Pos ady, + FT_Int bchar, + FT_Int achar ) + { + FT_Error error; + FT_Int bchar_index, achar_index, n_base_points; + FT_Outline* base = decoder->builder.base; + TT_Face face = decoder->builder.face; + CFF_Font* cff = (CFF_Font*)(face->extra.data); + FT_Vector left_bearing, advance; + FT_Byte* charstring; + FT_ULong charstring_len; + + + bchar_index = cff_lookup_glyph_by_stdcharcode( cff, bchar ); + achar_index = cff_lookup_glyph_by_stdcharcode( cff, achar ); + + if ( bchar_index < 0 || achar_index < 0 ) + { + FT_ERROR(( "cff_operator_seac:" )); + FT_ERROR(( " invalid seac character code arguments\n" )); + return CFF_Err_Syntax_Error; + } + + /* If we are trying to load a composite glyph, do not load the */ + /* accent character and return the array of subglyphs. */ + if ( decoder->builder.no_recurse ) + { + FT_GlyphSlot glyph = (FT_GlyphSlot)decoder->builder.glyph; + FT_GlyphLoader* loader = glyph->internal->loader; + FT_SubGlyph* subg; + + + /* reallocate subglyph array if necessary */ + error = FT_GlyphLoader_Check_Subglyphs( loader, 2 ); + if ( error ) + goto Exit; + + subg = loader->current.subglyphs; + + /* subglyph 0 = base character */ + subg->index = bchar_index; + subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES | + FT_SUBGLYPH_FLAG_USE_MY_METRICS; + subg->arg1 = 0; + subg->arg2 = 0; + subg++; + + /* subglyph 1 = accent character */ + subg->index = achar_index; + subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES; + subg->arg1 = adx; + subg->arg2 = ady; + + /* set up remaining glyph fields */ + glyph->num_subglyphs = 2; + glyph->subglyphs = loader->base.subglyphs; + glyph->format = ft_glyph_format_composite; + + loader->current.num_subglyphs = 2; + } + + /* First load `bchar' in builder */ + error = CFF_Access_Element( &cff->charstrings_index, bchar_index, + &charstring, &charstring_len ); + if ( !error ) + { + error = CFF_Parse_CharStrings( decoder, charstring, charstring_len ); + + if ( error ) + goto Exit; + + CFF_Forget_Element( &cff->charstrings_index, &charstring ); + } + + n_base_points = base->n_points; + + /* Save the left bearing and width of the base character */ + /* as they will be erased by the next load. */ + + left_bearing = decoder->builder.left_bearing; + advance = decoder->builder.advance; + + decoder->builder.left_bearing.x = 0; + decoder->builder.left_bearing.y = 0; + + /* Now load `achar' on top of the base outline. */ + error = CFF_Access_Element( &cff->charstrings_index, achar_index, + &charstring, &charstring_len ); + if ( !error ) + { + error = CFF_Parse_CharStrings( decoder, charstring, charstring_len ); + + if ( error ) + goto Exit; + + CFF_Forget_Element( &cff->charstrings_index, &charstring ); + } + + /* Restore the left side bearing and advance width */ + /* of the base character. */ + decoder->builder.left_bearing = left_bearing; + decoder->builder.advance = advance; + + /* Finally, move the accent. */ + if ( decoder->builder.load_points ) + { + FT_Outline dummy; + + + dummy.n_points = base->n_points - n_base_points; + dummy.points = base->points + n_base_points; + + FT_Outline_Translate( &dummy, adx, ady ); + } + + Exit: + return error; + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* CFF_Parse_CharStrings */ + /* */ + /* <Description> */ + /* Parses a given Type 2 charstrings program. */ + /* */ + /* <InOut> */ + /* decoder :: The current Type 1 decoder. */ + /* */ + /* <Input> */ + /* charstring_base :: The base of the charstring stream. */ + /* */ + /* charstring_len :: The length in bytes of the charstring stream. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF + FT_Error CFF_Parse_CharStrings( CFF_Decoder* decoder, + FT_Byte* charstring_base, + FT_Int charstring_len ) + { + FT_Error error; + CFF_Decoder_Zone* zone; + FT_Byte* ip; + FT_Byte* limit; + CFF_Builder* builder = &decoder->builder; + FT_Outline* outline; + FT_Pos x, y; + FT_Fixed seed; + FT_Fixed* stack; + + + /* set default width */ + decoder->num_hints = 0; + decoder->read_width = 1; + + /* compute random seed from stack address of parameter */ + seed = (FT_Fixed)(char*)&seed ^ + (FT_Fixed)(char*)&decoder ^ + (FT_Fixed)(char*)&charstring_base; + seed = ( seed ^ ( seed >> 10 ) ^ ( seed >> 20 ) ) & 0xFFFF; + if ( seed == 0 ) + seed = 0x7384; + + /* initialize the decoder */ + decoder->top = decoder->stack; + decoder->zone = decoder->zones; + zone = decoder->zones; + stack = decoder->top; + + builder->path_begun = 0; + + zone->base = charstring_base; + limit = zone->limit = charstring_base + charstring_len; + ip = zone->cursor = zone->base; + + error = CFF_Err_Ok; + outline = builder->current; + + x = builder->pos_x; + y = builder->pos_y; + + /* now, execute loop */ + while ( ip < limit ) + { + CFF_Operator op; + FT_Byte v; + + + /********************************************************************/ + /* */ + /* Decode operator or operand */ + /* */ + v = *ip++; + if ( v >= 32 || v == 28 ) + { + FT_Int shift = 16; + FT_Int32 val; + + + /* this is an operand, push it on the stack */ + if ( v == 28 ) + { + if ( ip + 1 >= limit ) + goto Syntax_Error; + val = (FT_Short)( ( (FT_Short)ip[0] << 8 ) | ip[1] ); + ip += 2; + } + else if ( v < 247 ) + val = (FT_Long)v - 139; + else if ( v < 251 ) + { + if ( ip >= limit ) + goto Syntax_Error; + val = ( (FT_Long)v - 247 ) * 256 + *ip++ + 108; + } + else if ( v < 255 ) + { + if ( ip >= limit ) + goto Syntax_Error; + val = -( (FT_Long)v - 251 ) * 256 - *ip++ - 108; + } + else + { + if ( ip + 3 >= limit ) + goto Syntax_Error; + val = ( (FT_Int32)ip[0] << 24 ) | + ( (FT_Int32)ip[1] << 16 ) | + ( (FT_Int32)ip[2] << 8 ) | + ip[3]; + ip += 4; + shift = 0; + } + if ( decoder->top - stack >= CFF_MAX_OPERANDS ) + goto Stack_Overflow; + + val <<= shift; + *decoder->top++ = val; + +#ifdef FT_DEBUG_LEVEL_TRACE + if ( !( val & 0xFFFF ) ) + FT_TRACE4(( " %d", (FT_Int32)( val >> 16 ) )); + else + FT_TRACE4(( " %.2f", val / 65536.0 )); +#endif + + } + else + { + FT_Fixed* args = decoder->top; + FT_Int num_args = args - decoder->stack; + FT_Int req_args; + + + /* find operator */ + op = cff_op_unknown; + + switch ( v ) + { + case 1: + op = cff_op_hstem; + break; + case 3: + op = cff_op_vstem; + break; + case 4: + op = cff_op_vmoveto; + break; + case 5: + op = cff_op_rlineto; + break; + case 6: + op = cff_op_hlineto; + break; + case 7: + op = cff_op_vlineto; + break; + case 8: + op = cff_op_rrcurveto; + break; + case 10: + op = cff_op_callsubr; + break; + case 11: + op = cff_op_return; + break; + case 12: + { + if ( ip >= limit ) + goto Syntax_Error; + v = *ip++; + + switch ( v ) + { + case 0: + op = cff_op_dotsection; + break; + case 3: + op = cff_op_and; + break; + case 4: + op = cff_op_or; + break; + case 5: + op = cff_op_not; + break; + case 8: + op = cff_op_store; + break; + case 9: + op = cff_op_abs; + break; + case 10: + op = cff_op_add; + break; + case 11: + op = cff_op_sub; + break; + case 12: + op = cff_op_div; + break; + case 13: + op = cff_op_load; + break; + case 14: + op = cff_op_neg; + break; + case 15: + op = cff_op_eq; + break; + case 18: + op = cff_op_drop; + break; + case 20: + op = cff_op_put; + break; + case 21: + op = cff_op_get; + break; + case 22: + op = cff_op_ifelse; + break; + case 23: + op = cff_op_random; + break; + case 24: + op = cff_op_mul; + break; + case 26: + op = cff_op_sqrt; + break; + case 27: + op = cff_op_dup; + break; + case 28: + op = cff_op_exch; + break; + case 29: + op = cff_op_index; + break; + case 30: + op = cff_op_roll; + break; + case 34: + op = cff_op_hflex; + break; + case 35: + op = cff_op_flex; + break; + case 36: + op = cff_op_hflex1; + break; + case 37: + op = cff_op_flex1; + break; + default: + /* decrement ip for syntax error message */ + ip--; + } + } + break; + case 14: + op = cff_op_endchar; + break; + case 16: + op = cff_op_blend; + break; + case 18: + op = cff_op_hstemhm; + break; + case 19: + op = cff_op_hintmask; + break; + case 20: + op = cff_op_cntrmask; + break; + case 21: + op = cff_op_rmoveto; + break; + case 22: + op = cff_op_hmoveto; + break; + case 23: + op = cff_op_vstemhm; + break; + case 24: + op = cff_op_rcurveline; + break; + case 25: + op = cff_op_rlinecurve; + break; + case 26: + op = cff_op_vvcurveto; + break; + case 27: + op = cff_op_hhcurveto; + break; + case 29: + op = cff_op_callgsubr; + break; + case 30: + op = cff_op_vhcurveto; + break; + case 31: + op = cff_op_hvcurveto; + break; + default: + ; + } + if ( op == cff_op_unknown ) + goto Syntax_Error; + + /* check arguments */ + req_args = cff_argument_counts[op]; + if ( req_args & CFF_COUNT_CHECK_WIDTH ) + { + args = stack; + + if ( num_args > 0 && decoder->read_width ) + { + /* If `nominal_width' is non-zero, the number is really a */ + /* difference against `nominal_width'. Else, the number here */ + /* is truly a width, not a difference against `nominal_width'. */ + /* If the font does not set `nominal_width', then */ + /* `nominal_width' defaults to zero, and so we can set */ + /* `glyph_width' to `nominal_width' plus number on the stack */ + /* -- for either case. */ + + FT_Int set_width_ok; + + + switch ( op ) + { + case cff_op_hmoveto: + case cff_op_vmoveto: + set_width_ok = num_args & 2; + break; + + case cff_op_hstem: + case cff_op_vstem: + case cff_op_hstemhm: + case cff_op_vstemhm: + case cff_op_rmoveto: + set_width_ok = num_args & 1; + break; + + case cff_op_endchar: + /* If there is a width specified for endchar, we either have */ + /* 1 argument or 5 arguments. We like to argue. */ + set_width_ok = ( ( num_args == 5 ) || ( num_args == 1 ) ); + break; + + default: + set_width_ok = 0; + break; + } + + if ( set_width_ok ) + { + decoder->glyph_width = decoder->nominal_width + + ( stack[0] >> 16 ); + + /* Consumed an argument. */ + num_args--; + args++; + } + } + + decoder->read_width = 0; + req_args = 0; + } + + req_args &= 15; + if ( num_args < req_args ) + goto Stack_Underflow; + args -= req_args; + num_args -= req_args; + + switch ( op ) + { + case cff_op_hstem: + case cff_op_vstem: + case cff_op_hstemhm: + case cff_op_vstemhm: + /* if the number of arguments is not even, the first one */ + /* is simply the glyph width, encoded as the difference */ + /* to nominalWidthX */ + FT_TRACE4(( op == cff_op_hstem ? " hstem" : + op == cff_op_vstem ? " vstem" : + op == cff_op_hstemhm ? " hstemhm" : + " vstemhm" )); + decoder->num_hints += num_args / 2; + args = stack; + break; + + case cff_op_hintmask: + case cff_op_cntrmask: + FT_TRACE4(( op == cff_op_hintmask ? " hintmask" + : " cntrmask" )); + + decoder->num_hints += num_args / 2; + +#ifdef FT_DEBUG_LEVEL_TRACE + { + FT_UInt maskbyte; + + FT_TRACE4(( " " )); + + for ( maskbyte = 0; + maskbyte < ( decoder->num_hints + 7 ) >> 3; + maskbyte++, ip++ ) + { + FT_TRACE4(( "%02X", *ip )); + } + + } +#else + ip += ( decoder->num_hints + 7 ) >> 3; +#endif + if ( ip >= limit ) + goto Syntax_Error; + args = stack; + break; + + case cff_op_rmoveto: + FT_TRACE4(( " rmoveto" )); + + close_contour( builder ); + builder->path_begun = 0; + x += args[0]; + y += args[1]; + args = stack; + break; + + case cff_op_vmoveto: + FT_TRACE4(( " vmoveto" )); + + close_contour( builder ); + builder->path_begun = 0; + y += args[0]; + args = stack; + break; + + case cff_op_hmoveto: + FT_TRACE4(( " hmoveto" )); + + close_contour( builder ); + builder->path_begun = 0; + x += args[0]; + args = stack; + break; + + case cff_op_rlineto: + FT_TRACE4(( " rlineto" )); + + if ( start_point ( builder, x, y ) || + check_points( builder, num_args / 2 ) ) + goto Memory_Error; + + if ( num_args < 2 || num_args & 1 ) + goto Stack_Underflow; + + args = stack; + while ( args < decoder->top ) + { + x += args[0]; + y += args[1]; + add_point( builder, x, y, 1 ); + args += 2; + } + args = stack; + break; + + case cff_op_hlineto: + case cff_op_vlineto: + { + FT_Int phase = ( op == cff_op_hlineto ); + + + FT_TRACE4(( op == cff_op_hlineto ? " hlineto" + : " vlineto" )); + + if ( start_point ( builder, x, y ) || + check_points( builder, num_args ) ) + goto Memory_Error; + + args = stack; + while (args < decoder->top ) + { + if ( phase ) + x += args[0]; + else + y += args[0]; + + if ( add_point1( builder, x, y ) ) + goto Memory_Error; + + args++; + phase ^= 1; + } + args = stack; + } + break; + + case cff_op_rrcurveto: + FT_TRACE4(( " rrcurveto" )); + + /* check number of arguments; must be a multiple of 6 */ + if ( num_args % 6 != 0 ) + goto Stack_Underflow; + + if ( start_point ( builder, x, y ) || + check_points( builder, num_args / 2 ) ) + goto Memory_Error; + + args = stack; + while ( args < decoder->top ) + { + x += args[0]; + y += args[1]; + add_point( builder, x, y, 0 ); + x += args[2]; + y += args[3]; + add_point( builder, x, y, 0 ); + x += args[4]; + y += args[5]; + add_point( builder, x, y, 1 ); + args += 6; + } + args = stack; + break; + + case cff_op_vvcurveto: + FT_TRACE4(( " vvcurveto" )); + + if ( start_point ( builder, x, y ) ) + goto Memory_Error; + + args = stack; + if ( num_args & 1 ) + { + x += args[0]; + args++; + num_args--; + } + + if ( num_args % 4 != 0 ) + goto Stack_Underflow; + + if ( check_points( builder, 3 * ( num_args / 4 ) ) ) + goto Memory_Error; + + while ( args < decoder->top ) + { + y += args[0]; + add_point( builder, x, y, 0 ); + x += args[1]; + y += args[2]; + add_point( builder, x, y, 0 ); + y += args[3]; + add_point( builder, x, y, 1 ); + args += 4; + } + args = stack; + break; + + case cff_op_hhcurveto: + FT_TRACE4(( " hhcurveto" )); + + if ( start_point ( builder, x, y ) ) + goto Memory_Error; + + args = stack; + if ( num_args & 1 ) + { + y += args[0]; + args++; + num_args--; + } + + if ( num_args % 4 != 0 ) + goto Stack_Underflow; + + if ( check_points( builder, 3 * ( num_args / 4 ) ) ) + goto Memory_Error; + + while ( args < decoder->top ) + { + x += args[0]; + add_point( builder, x, y, 0 ); + x += args[1]; + y += args[2]; + add_point( builder, x, y, 0 ); + x += args[3]; + add_point( builder, x, y, 1 ); + args += 4; + } + args = stack; + break; + + case cff_op_vhcurveto: + case cff_op_hvcurveto: + { + FT_Int phase; + + + FT_TRACE4(( op == cff_op_vhcurveto ? " vhcurveto" + : " hvcurveto" )); + + if ( start_point ( builder, x, y ) ) + goto Memory_Error; + + args = stack; + if (num_args < 4 || ( num_args % 4 ) > 1 ) + goto Stack_Underflow; + + if ( check_points( builder, ( num_args / 4 ) * 3 ) ) + goto Stack_Underflow; + + phase = ( op == cff_op_hvcurveto ); + + while ( num_args >= 4 ) + { + num_args -= 4; + if ( phase ) + { + x += args[0]; + add_point( builder, x, y, 0 ); + x += args[1]; + y += args[2]; + add_point( builder, x, y, 0 ); + y += args[3]; + if ( num_args == 1 ) + x += args[4]; + add_point( builder, x, y, 1 ); + } + else + { + y += args[0]; + add_point( builder, x, y, 0 ); + x += args[1]; + y += args[2]; + add_point( builder, x, y, 0 ); + x += args[3]; + if ( num_args == 1 ) + y += args[4]; + add_point( builder, x, y, 1 ); + } + args += 4; + phase ^= 1; + } + args = stack; + } + break; + + case cff_op_rlinecurve: + { + FT_Int num_lines = ( num_args - 6 ) / 2; + + + FT_TRACE4(( " rlinecurve" )); + + if ( num_args < 8 || ( num_args - 6 ) & 1 ) + goto Stack_Underflow; + + if ( start_point( builder, x, y ) || + check_points( builder, num_lines + 3 ) ) + goto Memory_Error; + + args = stack; + + /* first, add the line segments */ + while ( num_lines > 0 ) + { + x += args[0]; + y += args[1]; + add_point( builder, x, y, 1 ); + args += 2; + num_lines--; + } + + /* then the curve */ + x += args[0]; + y += args[1]; + add_point( builder, x, y, 0 ); + x += args[2]; + y += args[3]; + add_point( builder, x, y, 0 ); + x += args[4]; + y += args[5]; + add_point( builder, x, y, 1 ); + args = stack; + } + break; + + case cff_op_rcurveline: + { + FT_Int num_curves = ( num_args - 2 ) / 6; + + + FT_TRACE4(( " rcurveline" )); + + if ( num_args < 8 || ( num_args - 2 ) % 6 ) + goto Stack_Underflow; + + if ( start_point ( builder, x, y ) || + check_points( builder, num_curves*3 + 2 ) ) + goto Memory_Error; + + args = stack; + + /* first, add the curves */ + while ( num_curves > 0 ) + { + x += args[0]; + y += args[1]; + add_point( builder, x, y, 0 ); + x += args[2]; + y += args[3]; + add_point( builder, x, y, 0 ); + x += args[4]; + y += args[5]; + add_point( builder, x, y, 1 ); + args += 6; + num_curves--; + } + + /* then the final line */ + x += args[0]; + y += args[1]; + add_point( builder, x, y, 1 ); + args = stack; + } + break; + + case cff_op_hflex1: + { + FT_Pos start_y; + + + FT_TRACE4(( " hflex1" )); + + args = stack; + + /* adding five more points; 4 control points, 1 on-curve point */ + /* make sure we have enough space for the start point if it */ + /* needs to be added.. */ + if ( start_point( builder, x, y ) || + check_points( builder, 6 ) ) + goto Memory_Error; + + /* Record the starting point's y postion for later use */ + start_y = y; + + /* first control point */ + x += args[0]; + y += args[1]; + add_point( builder, x, y, 0 ); + + /* second control point */ + x += args[2]; + y += args[3]; + add_point( builder, x, y, 0 ); + + /* join point; on curve, with y-value the same as the last */ + /* control point's y-value */ + x += args[4]; + add_point( builder, x, y, 1 ); + + /* third control point, with y-value the same as the join */ + /* point's y-value */ + x += args[5]; + add_point( builder, x, y, 0 ); + + /* fourth control point */ + x += args[6]; + y += args[7]; + add_point( builder, x, y, 0 ); + + /* ending point, with y-value the same as the start */ + x += args[8]; + y = start_y; + add_point( builder, x, y, 1 ); + + args = stack; + break; + } + + case cff_op_hflex: + { + FT_Pos start_y; + + + FT_TRACE4(( " hflex" )); + + args = stack; + + /* adding six more points; 4 control points, 2 on-curve points */ + if ( start_point( builder, x, y ) || + check_points ( builder, 6 ) ) + goto Memory_Error; + + /* record the starting point's y-position for later use */ + start_y = y; + + /* first control point */ + x += args[0]; + add_point( builder, x, y, 0 ); + + /* second control point */ + x += args[1]; + y += args[2]; + add_point( builder, x, y, 0 ); + + /* join point; on curve, with y-value the same as the last */ + /* control point's y-value */ + x += args[3]; + add_point( builder, x, y, 1 ); + + /* third control point, with y-value the same as the join */ + /* point's y-value */ + x += args[4]; + add_point( builder, x, y, 0 ); + + /* fourth control point */ + x += args[5]; + y = start_y; + add_point( builder, x, y, 0 ); + + /* ending point, with y-value the same as the start point's */ + /* y-value -- we don't add this point, though */ + x += args[6]; + add_point( builder, x, y, 1 ); + + args = stack; + break; + } + + case cff_op_flex1: + { + FT_Pos start_x, start_y; /* record start x, y values for alter */ + /* use */ + FT_Int dx = 0, dy = 0; /* used in horizontal/vertical */ + /* algorithm below */ + FT_Int horizontal, count; + + + FT_TRACE4(( " flex1" )); + + /* adding six more points; 4 control points, 2 on-curve points */ + if ( start_point( builder, x, y ) || + check_points( builder, 6 ) ) + goto Memory_Error; + + /* record the starting point's x, y postion for later use */ + start_x = x; + start_y = y; + + /* XXX: figure out whether this is supposed to be a horizontal */ + /* or vertical flex; the Type 2 specification is vague... */ + + args = stack; + + /* grab up to the last argument */ + for ( count = 5; count > 0; count-- ) + { + dx += args[0]; + dy += args[1]; + args += 2; + } + + /* rewind */ + args = stack; + + if ( dx < 0 ) dx = -dx; + if ( dy < 0 ) dy = -dy; + + /* strange test, but here it is... */ + horizontal = ( dx > dy ); + + for ( count = 5; count > 0; count-- ) + { + x += args[0]; + y += args[1]; + add_point( builder, x, y, (FT_Bool)( count == 3 ) ); + args += 2; + } + + /* is last operand an x- or y-delta? */ + if ( horizontal ) + { + x += args[0]; + y = start_y; + } + else + { + x = start_x; + y += args[0]; + } + + add_point( builder, x, y, 1 ); + + args = stack; + break; + } + + case cff_op_flex: + { + FT_UInt count; + + + FT_TRACE4(( " flex" )); + + if ( start_point( builder, x, y ) || + check_points( builder, 6 ) ) + goto Memory_Error; + + args = stack; + for ( count = 6; count > 0; count-- ) + { + x += args[0]; + y += args[1]; + add_point( builder, x, y, + (FT_Bool)( count == 3 || count == 0 ) ); + args += 2; + } + + args = stack; + } + break; + + case cff_op_endchar: + FT_TRACE4(( " endchar" )); + + /* We are going to emulate the seac operator. */ + if ( num_args == 4 ) + { + error = cff_operator_seac( decoder, + args[0] >> 16, args[1] >> 16, + args[2] >> 16, args[3] >> 16 ); + args += 4; + } + + if ( !error ) + error = CFF_Err_Ok; + + close_contour( builder ); + + /* add current outline to the glyph slot */ + FT_GlyphLoader_Add( builder->loader ); + + /* return now! */ + FT_TRACE4(( "\n\n" )); + return error; + + case cff_op_abs: + FT_TRACE4(( " abs" )); + + if ( args[0] < 0 ) + args[0] = -args[0]; + args++; + break; + + case cff_op_add: + FT_TRACE4(( " add" )); + + args[0] += args[1]; + args++; + break; + + case cff_op_sub: + FT_TRACE4(( " sub" )); + + args[0] -= args[1]; + args++; + break; + + case cff_op_div: + FT_TRACE4(( " div" )); + + args[0] = FT_DivFix( args[0], args[1] ); + args++; + break; + + case cff_op_neg: + FT_TRACE4(( " neg" )); + + args[0] = -args[0]; + args++; + break; + + case cff_op_random: + { + FT_Fixed rand; + + + FT_TRACE4(( " rand" )); + + rand = seed; + if ( rand >= 0x8000 ) + rand++; + + args[0] = rand; + seed = FT_MulFix( seed, 0x10000L - seed ); + if ( seed == 0 ) + seed += 0x2873; + args++; + } + break; + + case cff_op_mul: + FT_TRACE4(( " mul" )); + + args[0] = FT_MulFix( args[0], args[1] ); + args++; + break; + + case cff_op_sqrt: + FT_TRACE4(( " sqrt" )); + + if ( args[0] > 0 ) + { + FT_Int count = 9; + FT_Fixed root = args[0]; + FT_Fixed new_root; + + + for (;;) + { + new_root = ( root + FT_DivFix( args[0], root ) + 1 ) >> 1; + if ( new_root == root || count <= 0 ) + break; + root = new_root; + } + args[0] = new_root; + } + else + args[0] = 0; + args++; + break; + + case cff_op_drop: + /* nothing */ + FT_TRACE4(( " drop" )); + + break; + + case cff_op_exch: + { + FT_Fixed tmp; + + + FT_TRACE4(( " exch" )); + + tmp = args[0]; + args[0] = args[1]; + args[1] = tmp; + args += 2; + } + break; + + case cff_op_index: + { + FT_Int index = args[0] >> 16; + + + FT_TRACE4(( " index" )); + + if ( index < 0 ) + index = 0; + else if ( index > num_args - 2 ) + index = num_args - 2; + args[0] = args[-( index + 1 )]; + args++; + } + break; + + case cff_op_roll: + { + FT_Int count = (FT_Int)( args[0] >> 16 ); + FT_Int index = (FT_Int)( args[1] >> 16 ); + + + FT_TRACE4(( " roll" )); + + if ( count <= 0 ) + count = 1; + + args -= count; + if ( args < stack ) + goto Stack_Underflow; + + if ( index >= 0 ) + { + while ( index > 0 ) + { + FT_Fixed tmp = args[count - 1]; + FT_Int i; + + + for ( i = count - 2; i >= 0; i-- ) + args[i + 1] = args[i]; + args[0] = tmp; + index--; + } + } + else + { + while ( index < 0 ) + { + FT_Fixed tmp = args[0]; + FT_Int i; + + + for ( i = 0; i < count - 1; i++ ) + args[i] = args[i + 1]; + args[count - 1] = tmp; + index++; + } + } + args += count; + } + break; + + case cff_op_dup: + FT_TRACE4(( " dup" )); + + args[1] = args[0]; + args++; + break; + + case cff_op_put: + { + FT_Fixed val = args[0]; + FT_Int index = (FT_Int)( args[1] >> 16 ); + + + FT_TRACE4(( " put" )); + + if ( index >= 0 && index < decoder->len_buildchar ) + decoder->buildchar[index] = val; + } + break; + + case cff_op_get: + { + FT_Int index = (FT_Int)( args[0] >> 16 ); + FT_Fixed val = 0; + + + FT_TRACE4(( " get" )); + + if ( index >= 0 && index < decoder->len_buildchar ) + val = decoder->buildchar[index]; + + args[0] = val; + args++; + } + break; + + case cff_op_store: + FT_TRACE4(( " store ")); + + goto Unimplemented; + + case cff_op_load: + FT_TRACE4(( " load" )); + + goto Unimplemented; + + case cff_op_dotsection: + /* this operator is deprecated and ignored by the parser */ + FT_TRACE4(( " dotsection" )); + break; + + case cff_op_and: + { + FT_Fixed cond = args[0] && args[1]; + + + FT_TRACE4(( " and" )); + + args[0] = cond ? 0x10000L : 0; + args++; + } + break; + + case cff_op_or: + { + FT_Fixed cond = args[0] || args[1]; + + + FT_TRACE4(( " or" )); + + args[0] = cond ? 0x10000L : 0; + args++; + } + break; + + case cff_op_eq: + { + FT_Fixed cond = !args[0]; + + + FT_TRACE4(( " eq" )); + + args[0] = cond ? 0x10000L : 0; + args++; + } + break; + + case cff_op_ifelse: + { + FT_Fixed cond = (args[2] <= args[3]); + + + FT_TRACE4(( " ifelse" )); + + if ( !cond ) + args[0] = args[1]; + args++; + } + break; + + case cff_op_callsubr: + { + FT_UInt index = (FT_UInt)( ( args[0] >> 16 ) + + decoder->locals_bias ); + + + FT_TRACE4(( " callsubr(%d)", index )); + + if ( index >= decoder->num_locals ) + { + FT_ERROR(( "CFF_Parse_CharStrings:" )); + FT_ERROR(( " invalid local subr index\n" )); + goto Syntax_Error; + } + + if ( zone - decoder->zones >= CFF_MAX_SUBRS_CALLS ) + { + FT_ERROR(( "CFF_Parse_CharStrings: too many nested subrs\n" )); + goto Syntax_Error; + } + + zone->cursor = ip; /* save current instruction pointer */ + + zone++; + zone->base = decoder->locals[index]; + zone->limit = decoder->locals[index + 1]; + zone->cursor = zone->base; + + if ( !zone->base ) + { + FT_ERROR(( "CFF_Parse_CharStrings: invoking empty subrs!\n" )); + goto Syntax_Error; + } + + decoder->zone = zone; + ip = zone->base; + limit = zone->limit; + } + break; + + case cff_op_callgsubr: + { + FT_UInt index = (FT_UInt)( ( args[0] >> 16 ) + + decoder->globals_bias ); + + + FT_TRACE4(( " callgsubr(%d)", index )); + + if ( index >= decoder->num_globals ) + { + FT_ERROR(( "CFF_Parse_CharStrings:" )); + FT_ERROR(( " invalid global subr index\n" )); + goto Syntax_Error; + } + + if ( zone - decoder->zones >= CFF_MAX_SUBRS_CALLS ) + { + FT_ERROR(( "CFF_Parse_CharStrings: too many nested subrs\n" )); + goto Syntax_Error; + } + + zone->cursor = ip; /* save current instruction pointer */ + + zone++; + zone->base = decoder->globals[index]; + zone->limit = decoder->globals[index+1]; + zone->cursor = zone->base; + + if ( !zone->base ) + { + FT_ERROR(( "CFF_Parse_CharStrings: invoking empty subrs!\n" )); + goto Syntax_Error; + } + + decoder->zone = zone; + ip = zone->base; + limit = zone->limit; + } + break; + + case cff_op_return: + FT_TRACE4(( " return" )); + + if ( decoder->zone <= decoder->zones ) + { + FT_ERROR(( "CFF_Parse_CharStrings: unexpected return\n" )); + goto Syntax_Error; + } + + decoder->zone--; + zone = decoder->zone; + ip = zone->cursor; + limit = zone->limit; + break; + + default: + Unimplemented: + FT_ERROR(( "Unimplemented opcode: %d", ip[-1] )); + + if ( ip[-1] == 12 ) + FT_ERROR(( " %d", ip[0] )); + FT_ERROR(( "\n" )); + + return CFF_Err_Unimplemented_Feature; + } + + decoder->top = args; + + } /* general operator processing */ + + } /* while ip < limit */ + + FT_TRACE4(( "..end..\n\n" )); + + return error; + + Syntax_Error: + FT_TRACE4(( "CFF_Parse_CharStrings: syntax error!" )); + return CFF_Err_Invalid_File_Format; + + Stack_Underflow: + FT_TRACE4(( "CFF_Parse_CharStrings: stack underflow!" )); + return CFF_Err_Too_Few_Arguments; + + Stack_Overflow: + FT_TRACE4(( "CFF_Parse_CharStrings: stack overflow!" )); + return CFF_Err_Stack_Overflow; + + Memory_Error: + return builder->error; + } + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /********** *********/ + /********** *********/ + /********** COMPUTE THE MAXIMUM ADVANCE WIDTH *********/ + /********** *********/ + /********** The following code is in charge of computing *********/ + /********** the maximum advance width of the font. It *********/ + /********** quickly processes each glyph charstring to *********/ + /********** extract the value from either a `sbw' or `seac' *********/ + /********** operator. *********/ + /********** *********/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + +#if 0 /* unused until we support pure CFF fonts */ + + + FT_LOCAL_DEF + FT_Error CFF_Compute_Max_Advance( TT_Face face, + FT_Int* max_advance ) + { + FT_Error error = 0; + CFF_Decoder decoder; + FT_Int glyph_index; + CFF_Font* cff = (CFF_Font*)face->other; + + + *max_advance = 0; + + /* Initialize load decoder */ + CFF_Init_Decoder( &decoder, face, 0, 0 ); + + decoder.builder.metrics_only = 1; + decoder.builder.load_points = 0; + + /* For each glyph, parse the glyph charstring and extract */ + /* the advance width. */ + for ( glyph_index = 0; glyph_index < face->root.num_glyphs; + glyph_index++ ) + { + FT_Byte* charstring; + FT_ULong charstring_len; + + + /* now get load the unscaled outline */ + error = CFF_Access_Element( &cff->charstrings_index, glyph_index, + &charstring, &charstring_len ); + if ( !error ) + { + CFF_Prepare_Decoder( &decoder, glyph_index ); + error = CFF_Parse_CharStrings( &decoder, charstring, charstring_len ); + + CFF_Forget_Element( &cff->charstrings_index, &charstring ); + } + + /* ignore the error if one has occurred -- skip to next glyph */ + error = 0; + } + + *max_advance = decoder.builder.advance.x; + + return CFF_Err_Ok; + } + + +#endif /* 0 */ + + + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + /********** *********/ + /********** *********/ + /********** UNHINTED GLYPH LOADER *********/ + /********** *********/ + /********** The following code is in charge of loading a *********/ + /********** single outline. It completely ignores hinting *********/ + /********** and is used when FT_LOAD_NO_HINTING is set. *********/ + /********** *********/ + /*************************************************************************/ + /*************************************************************************/ + /*************************************************************************/ + + + FT_LOCAL_DEF + FT_Error CFF_Load_Glyph( CFF_GlyphSlot glyph, + CFF_Size size, + FT_Int glyph_index, + FT_Int load_flags ) + { + FT_Error error; + CFF_Decoder decoder; + TT_Face face = (TT_Face)glyph->root.face; + FT_Bool hinting; + CFF_Font* cff = (CFF_Font*)face->extra.data; + + FT_Matrix font_matrix; + FT_Vector font_offset; + + + if ( load_flags & FT_LOAD_NO_RECURSE ) + load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING; + + glyph->x_scale = 0x10000L; + glyph->y_scale = 0x10000L; + if ( size ) + { + glyph->x_scale = size->metrics.x_scale; + glyph->y_scale = size->metrics.y_scale; + } + + glyph->root.outline.n_points = 0; + glyph->root.outline.n_contours = 0; + + hinting = ( load_flags & FT_LOAD_NO_SCALE ) == 0 && + ( load_flags & FT_LOAD_NO_HINTING ) == 0; + + glyph->root.format = ft_glyph_format_outline; /* by default */ + + { + FT_Byte* charstring; + FT_ULong charstring_len; + + + CFF_Init_Decoder( &decoder, face, size, glyph ); + + decoder.builder.no_recurse = + (FT_Bool)( ( load_flags & FT_LOAD_NO_RECURSE ) != 0 ); + + /* now load the unscaled outline */ + error = CFF_Access_Element( &cff->charstrings_index, glyph_index, + &charstring, &charstring_len ); + if ( !error ) + { + CFF_Index csindex = cff->charstrings_index; + + + CFF_Prepare_Decoder( &decoder, glyph_index ); + error = CFF_Parse_CharStrings( &decoder, charstring, charstring_len ); + + CFF_Forget_Element( &cff->charstrings_index, &charstring ); + + /* We set control_data and control_len if charstrings is loaded. */ + /* See how charstring loads at CFF_Access_Element() in cffload.c. */ + + glyph->root.control_data = + csindex.bytes + csindex.offsets[glyph_index] - 1; + glyph->root.control_len = + charstring_len; + } + + /* save new glyph tables */ + CFF_Done_Builder( &decoder.builder ); + } + + font_matrix = cff->top_font.font_dict.font_matrix; + font_offset = cff->top_font.font_dict.font_offset; + + /* Now, set the metrics -- this is rather simple, as */ + /* the left side bearing is the xMin, and the top side */ + /* bearing the yMax. */ + if ( !error ) + { + /* For composite glyphs, return only left side bearing and */ + /* advance width. */ + if ( load_flags & FT_LOAD_NO_RECURSE ) + { + FT_Slot_Internal internal = glyph->root.internal; + + + glyph->root.metrics.horiBearingX = decoder.builder.left_bearing.x; + glyph->root.metrics.horiAdvance = decoder.glyph_width; + internal->glyph_matrix = font_matrix; + internal->glyph_delta = font_offset; + internal->glyph_transformed = 1; + } + else + { + FT_BBox cbox; + FT_Glyph_Metrics* metrics = &glyph->root.metrics; + + + /* copy the _unscaled_ advance width */ + metrics->horiAdvance = decoder.glyph_width; + glyph->root.linearHoriAdvance = decoder.glyph_width; + glyph->root.internal->glyph_transformed = 0; + + /* make up vertical metrics */ + metrics->vertBearingX = 0; + metrics->vertBearingY = 0; + metrics->vertAdvance = 0; + + glyph->root.linearVertAdvance = 0; + + glyph->root.format = ft_glyph_format_outline; + + glyph->root.outline.flags = 0; + if ( size && size->metrics.y_ppem < 24 ) + glyph->root.outline.flags |= ft_outline_high_precision; + + glyph->root.outline.flags |= ft_outline_reverse_fill; + + /* apply the font matrix */ + FT_Outline_Transform( &glyph->root.outline, &font_matrix ); + + FT_Outline_Translate( &glyph->root.outline, + font_offset.x, + font_offset.y ); + + if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 ) + { + /* scale the outline and the metrics */ + FT_Int n; + FT_Outline* cur = &glyph->root.outline; + FT_Vector* vec = cur->points; + FT_Fixed x_scale = glyph->x_scale; + FT_Fixed y_scale = glyph->y_scale; + + + /* First of all, scale the points */ + for ( n = cur->n_points; n > 0; n--, vec++ ) + { + vec->x = FT_MulFix( vec->x, x_scale ); + vec->y = FT_MulFix( vec->y, y_scale ); + } + + FT_Outline_Get_CBox( &glyph->root.outline, &cbox ); + + /* Then scale the metrics */ + metrics->horiAdvance = FT_MulFix( metrics->horiAdvance, x_scale ); + metrics->vertAdvance = FT_MulFix( metrics->vertAdvance, y_scale ); + + metrics->vertBearingX = FT_MulFix( metrics->vertBearingX, x_scale ); + metrics->vertBearingY = FT_MulFix( metrics->vertBearingY, y_scale ); + } + + /* compute the other metrics */ + FT_Outline_Get_CBox( &glyph->root.outline, &cbox ); + + /* grid fit the bounding box if necessary */ + if ( hinting ) + { + cbox.xMin &= -64; + cbox.yMin &= -64; + cbox.xMax = ( cbox.xMax + 63 ) & -64; + cbox.yMax = ( cbox.yMax + 63 ) & -64; + } + + metrics->width = cbox.xMax - cbox.xMin; + metrics->height = cbox.yMax - cbox.yMin; + + metrics->horiBearingX = cbox.xMin; + metrics->horiBearingY = cbox.yMax; + } + } + + return error; + } + + +/* END */ diff --git a/xc/extras/freetype2/src/cff/cffgload.h b/xc/extras/freetype2/src/cff/cffgload.h new file mode 100644 index 000000000..988ff4d23 --- /dev/null +++ b/xc/extras/freetype2/src/cff/cffgload.h @@ -0,0 +1,203 @@ +/***************************************************************************/ +/* */ +/* cffgload.h */ +/* */ +/* OpenType Glyph Loader (specification). */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __CFFGLOAD_H__ +#define __CFFGLOAD_H__ + + +#include <ft2build.h> +#include FT_FREETYPE_H +#include "cffobjs.h" + + +FT_BEGIN_HEADER + + +#define CFF_MAX_OPERANDS 48 +#define CFF_MAX_SUBRS_CALLS 32 + + + /*************************************************************************/ + /* */ + /* <Structure> */ + /* CFF_Builder */ + /* */ + /* <Description> */ + /* A structure used during glyph loading to store its outline. */ + /* */ + /* <Fields> */ + /* memory :: The current memory object. */ + /* */ + /* face :: The current face object. */ + /* */ + /* glyph :: The current glyph slot. */ + /* */ + /* current :: The current glyph outline. */ + /* */ + /* base :: The base glyph outline. */ + /* */ + /* max_points :: maximum points in builder outline */ + /* */ + /* max_contours :: Maximal number of contours in builder outline. */ + /* */ + /* last :: The last point position. */ + /* */ + /* scale_x :: The horizontal scale (FUnits to sub-pixels). */ + /* */ + /* scale_y :: The vertical scale (FUnits to sub-pixels). */ + /* */ + /* pos_x :: The horizontal translation (if composite glyph). */ + /* */ + /* pos_y :: The vertical translation (if composite glyph). */ + /* */ + /* left_bearing :: The left side bearing point. */ + /* */ + /* advance :: The horizontal advance vector. */ + /* */ + /* bbox :: Unused. */ + /* */ + /* path_begun :: A flag which indicates that a new path has begun. */ + /* */ + /* load_points :: If this flag is not set, no points are loaded. */ + /* */ + /* no_recurse :: Set but not used. */ + /* */ + /* error :: An error code that is only used to report memory */ + /* allocation problems. */ + /* */ + /* metrics_only :: A boolean indicating that we only want to compute */ + /* the metrics of a given glyph, not load all of its */ + /* points. */ + /* */ + typedef struct CFF_Builder_ + { + FT_Memory memory; + TT_Face face; + CFF_GlyphSlot glyph; + FT_GlyphLoader* loader; + FT_Outline* base; + FT_Outline* current; + + FT_Vector last; + + FT_Fixed scale_x; + FT_Fixed scale_y; + + FT_Pos pos_x; + FT_Pos pos_y; + + FT_Vector left_bearing; + FT_Vector advance; + + FT_BBox bbox; /* bounding box */ + FT_Bool path_begun; + FT_Bool load_points; + FT_Bool no_recurse; + + FT_Error error; /* only used for memory errors */ + FT_Bool metrics_only; + + } CFF_Builder; + + + /* execution context charstring zone */ + + typedef struct CFF_Decoder_Zone_ + { + FT_Byte* base; + FT_Byte* limit; + FT_Byte* cursor; + + } CFF_Decoder_Zone; + + + typedef struct CFF_Decoder_ + { + CFF_Builder builder; + CFF_Font* cff; + + FT_Fixed stack[CFF_MAX_OPERANDS + 1]; + FT_Fixed* top; + + CFF_Decoder_Zone zones[CFF_MAX_SUBRS_CALLS + 1]; + CFF_Decoder_Zone* zone; + + FT_Int flex_state; + FT_Int num_flex_vectors; + FT_Vector flex_vectors[7]; + + FT_Pos glyph_width; + FT_Pos nominal_width; + + FT_Bool read_width; + FT_Int num_hints; + FT_Fixed* buildchar; + FT_Int len_buildchar; + + FT_UInt num_locals; + FT_UInt num_globals; + + FT_Int locals_bias; + FT_Int globals_bias; + + FT_Byte** locals; + FT_Byte** globals; + + FT_Byte** glyph_names; /* for pure CFF fonts only */ + FT_UInt num_glyphs; /* number of glyphs in font */ + + } CFF_Decoder; + + + FT_LOCAL + void CFF_Init_Decoder( CFF_Decoder* decoder, + TT_Face face, + CFF_Size size, + CFF_GlyphSlot slot ); + + FT_LOCAL + void CFF_Prepare_Decoder( CFF_Decoder* decoder, + FT_UInt glyph_index ); + +#if 0 /* unused until we support pure CFF fonts */ + + /* Compute the maximum advance width of a font through quick parsing */ + FT_LOCAL + FT_Error CFF_Compute_Max_Advance( TT_Face face, + FT_Int* max_advance ); + +#endif /* 0 */ + + FT_LOCAL + FT_Error CFF_Parse_CharStrings( CFF_Decoder* decoder, + FT_Byte* charstring_base, + FT_Int charstring_len ); + + FT_LOCAL + FT_Error CFF_Load_Glyph( CFF_GlyphSlot glyph, + CFF_Size size, + FT_Int glyph_index, + FT_Int load_flags ); + + +FT_END_HEADER + +#endif /* __CFFGLOAD_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/src/cff/cffload.c b/xc/extras/freetype2/src/cff/cffload.c new file mode 100644 index 000000000..beb741e7b --- /dev/null +++ b/xc/extras/freetype2/src/cff/cffload.c @@ -0,0 +1,2265 @@ +/***************************************************************************/ +/* */ +/* cffload.c */ +/* */ +/* OpenType and CFF data/program tables loader (body) */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H +#include FT_INTERNAL_CFF_ERRORS_H +#include FT_TRUETYPE_TAGS_H + +#include "cffload.h" +#include "cffparse.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_cffload + + + static + const FT_UShort cff_isoadobe_charset[229] = + { + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139, + 140, + 141, + 142, + 143, + 144, + 145, + 146, + 147, + 148, + 149, + 150, + 151, + 152, + 153, + 154, + 155, + 156, + 157, + 158, + 159, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 174, + 175, + 176, + 177, + 178, + 179, + 180, + 181, + 182, + 183, + 184, + 185, + 186, + 187, + 188, + 189, + 190, + 191, + 192, + 193, + 194, + 195, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 210, + 211, + 212, + 213, + 214, + 215, + 216, + 217, + 218, + 219, + 220, + 221, + 222, + 223, + 224, + 225, + 226, + 227, + 228 + }; + + static + const FT_UShort cff_expert_charset[166] = + { + 0, + 1, + 229, + 230, + 231, + 232, + 233, + 234, + 235, + 236, + 237, + 238, + 13, + 14, + 15, + 99, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 27, + 28, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + 256, + 257, + 258, + 259, + 260, + 261, + 262, + 263, + 264, + 265, + 266, + 109, + 110, + 267, + 268, + 269, + 270, + 271, + 272, + 273, + 274, + 275, + 276, + 277, + 278, + 279, + 280, + 281, + 282, + 283, + 284, + 285, + 286, + 287, + 288, + 289, + 290, + 291, + 292, + 293, + 294, + 295, + 296, + 297, + 298, + 299, + 300, + 301, + 302, + 303, + 304, + 305, + 306, + 307, + 308, + 309, + 310, + 311, + 312, + 313, + 314, + 315, + 316, + 317, + 318, + 158, + 155, + 163, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 150, + 164, + 169, + 327, + 328, + 329, + 330, + 331, + 332, + 333, + 334, + 335, + 336, + 337, + 338, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346, + 347, + 348, + 349, + 350, + 351, + 352, + 353, + 354, + 355, + 356, + 357, + 358, + 359, + 360, + 361, + 362, + 363, + 364, + 365, + 366, + 367, + 368, + 369, + 370, + 371, + 372, + 373, + 374, + 375, + 376, + 377, + 378 + }; + + static + const FT_UShort cff_expertsubset_charset[87] = + { + 0, + 1, + 231, + 232, + 235, + 236, + 237, + 238, + 13, + 14, + 15, + 99, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 27, + 28, + 249, + 250, + 251, + 253, + 254, + 255, + 256, + 257, + 258, + 259, + 260, + 261, + 262, + 263, + 264, + 265, + 266, + 109, + 110, + 267, + 268, + 269, + 270, + 272, + 300, + 301, + 302, + 305, + 314, + 315, + 158, + 155, + 163, + 320, + 321, + 322, + 323, + 324, + 325, + 326, + 150, + 164, + 169, + 327, + 328, + 329, + 330, + 331, + 332, + 333, + 334, + 335, + 336, + 337, + 338, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346 + }; + + static + const FT_UShort cff_standard_encoding[256] = + { + 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, + 0, + 0, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 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, + 0, + 0, + 0, + 0, + 0, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 0, + 111, + 112, + 113, + 114, + 0, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 0, + 123, + 0, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 0, + 132, + 133, + 0, + 134, + 135, + 136, + 137, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 138, + 0, + 139, + 0, + 0, + 0, + 0, + 140, + 141, + 142, + 143, + 0, + 0, + 0, + 0, + 0, + 144, + 0, + 0, + 0, + 145, + 0, + 0, + 146, + 147, + 148, + 149, + 0, + 0, + 0, + 0 + }; + + static + const FT_UShort cff_expert_encoding[256] = + { + 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, + 0, + 0, + 0, + 1, + 229, + 230, + 0, + 231, + 232, + 233, + 234, + 235, + 236, + 237, + 238, + 13, + 14, + 15, + 99, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 27, + 28, + 249, + 250, + 251, + 252, + 0, + 253, + 254, + 255, + 256, + 257, + 0, + 0, + 0, + 258, + 0, + 0, + 259, + 260, + 261, + 262, + 0, + 0, + 263, + 264, + 265, + 0, + 266, + 109, + 110, + 267, + 268, + 269, + 0, + 270, + 271, + 272, + 273, + 274, + 275, + 276, + 277, + 278, + 279, + 280, + 281, + 282, + 283, + 284, + 285, + 286, + 287, + 288, + 289, + 290, + 291, + 292, + 293, + 294, + 295, + 296, + 297, + 298, + 299, + 300, + 301, + 302, + 303, + 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, + 0, + 0, + 0, + 0, + 0, + 304, + 305, + 306, + 0, + 0, + 307, + 308, + 309, + 310, + 311, + 0, + 312, + 0, + 0, + 312, + 0, + 0, + 314, + 315, + 0, + 0, + 316, + 317, + 318, + 0, + 0, + 0, + 158, + 155, + 163, + 319, + 320, + 321, + 322, + 323, + 324, + 325, + 0, + 0, + 326, + 150, + 164, + 169, + 327, + 328, + 329, + 330, + 331, + 332, + 333, + 334, + 335, + 336, + 337, + 338, + 339, + 340, + 341, + 342, + 343, + 344, + 345, + 346, + 347, + 348, + 349, + 350, + 351, + 352, + 353, + 354, + 355, + 356, + 357, + 358, + 359, + 360, + 361, + 362, + 363, + 364, + 365, + 366, + 367, + 368, + 369, + 370, + 371, + 372, + 373, + 374, + 375, + 376, + 377, + 378 + }; + + + /* read a CFF offset from memory */ + static + FT_ULong cff_get_offset( FT_Byte* p, + FT_Byte off_size ) + { + FT_ULong result; + + + for ( result = 0; off_size > 0; off_size-- ) + { + result <<= 8; + result |= *p++; + } + + return result; + } + + + static + FT_Error cff_new_index( CFF_Index* index, + FT_Stream stream, + FT_Bool load ) + { + FT_Error error; + FT_Memory memory = stream->memory; + FT_UShort count; + + + MEM_Set( index, 0, sizeof ( *index ) ); + + index->stream = stream; + if ( !READ_UShort( count ) && + count > 0 ) + { + FT_Byte* p; + FT_Byte offsize; + FT_ULong data_size; + FT_ULong* poff; + + + /* there is at least one element; read the offset size, */ + /* then access the offset table to compute the index's total size */ + if ( READ_Byte( offsize ) ) + goto Exit; + + index->stream = stream; + index->count = count; + index->off_size = offsize; + data_size = (FT_ULong)( count + 1 ) * offsize; + + if ( ALLOC_ARRAY( index->offsets, count + 1, FT_ULong ) || + ACCESS_Frame( data_size ) ) + goto Exit; + + poff = index->offsets; + p = (FT_Byte*)stream->cursor; + + for ( ; (FT_Short)count >= 0; count-- ) + { + poff[0] = cff_get_offset( p, offsize ); + poff++; + p += offsize; + } + + FORGET_Frame(); + + index->data_offset = FILE_Pos(); + data_size = poff[-1] - 1; + + if ( load ) + { + /* load the data */ + if ( EXTRACT_Frame( data_size, index->bytes ) ) + goto Exit; + } + else + { + /* skip the data */ + if ( FILE_Skip( data_size ) ) + goto Exit; + } + } + + Exit: + if ( error ) + FREE( index->offsets ); + + return error; + } + + + static + void cff_done_index( CFF_Index* index ) + { + if ( index->stream ) + { + FT_Stream stream = index->stream; + FT_Memory memory = stream->memory; + + + if ( index->bytes ) + RELEASE_Frame( index->bytes ); + + FREE( index->offsets ); + MEM_Set( index, 0, sizeof ( *index ) ); + } + } + + + static + FT_Error cff_explicit_index( CFF_Index* index, + FT_Byte*** table ) + { + FT_Error error = 0; + FT_Memory memory = index->stream->memory; + FT_UInt n, offset, old_offset; + FT_Byte** t; + + + *table = 0; + + if ( index->count > 0 && !ALLOC_ARRAY( t, index->count + 1, FT_Byte* ) ) + { + old_offset = 1; + for ( n = 0; n <= index->count; n++ ) + { + offset = index->offsets[n]; + if ( !offset ) + offset = old_offset; + + t[n] = index->bytes + offset - 1; + + old_offset = offset; + } + *table = t; + } + + return error; + } + + + FT_LOCAL_DEF + FT_Error CFF_Access_Element( CFF_Index* index, + FT_UInt element, + FT_Byte** pbytes, + FT_ULong* pbyte_len ) + { + FT_Error error = 0; + + + if ( index && index->count > element ) + { + /* compute start and end offsets */ + FT_ULong off1, off2 = 0; + + + off1 = index->offsets[element]; + if ( off1 ) + { + do + { + element++; + off2 = index->offsets[element]; + + } while ( off2 == 0 && element < index->count ); + + if ( !off2 ) + off1 = 0; + } + + /* access element */ + if ( off1 ) + { + *pbyte_len = off2 - off1; + + if ( index->bytes ) + { + /* this index was completely loaded in memory, that's easy */ + *pbytes = index->bytes + off1 - 1; + } + else + { + /* this index is still on disk/file, access it through a frame */ + FT_Stream stream = index->stream; + + + if ( FILE_Seek( index->data_offset + off1 - 1 ) || + EXTRACT_Frame( off2 - off1, *pbytes ) ) + goto Exit; + } + } + else + { + /* empty index element */ + *pbytes = 0; + *pbyte_len = 0; + } + } + else + error = CFF_Err_Invalid_Argument; + + Exit: + return error; + } + + + FT_LOCAL_DEF + void CFF_Forget_Element( CFF_Index* index, + FT_Byte** pbytes ) + { + if ( index->bytes == 0 ) + { + FT_Stream stream = index->stream; + + + RELEASE_Frame( *pbytes ); + } + } + + + FT_LOCAL_DEF + FT_String* CFF_Get_Name( CFF_Index* index, + FT_UInt element ) + { + FT_Memory memory = index->stream->memory; + FT_Byte* bytes; + FT_ULong byte_len; + FT_Error error; + FT_String* name = 0; + + + error = CFF_Access_Element( index, element, &bytes, &byte_len ); + if ( error ) + goto Exit; + + if ( !ALLOC( name, byte_len + 1 ) ) + { + MEM_Copy( name, bytes, byte_len ); + name[byte_len] = 0; + } + CFF_Forget_Element( index, &bytes ); + + Exit: + return name; + } + + + FT_LOCAL_DEF + FT_String* CFF_Get_String( CFF_Index* index, + FT_UInt sid, + PSNames_Interface* interface ) + { + /* if it is not a standard string, return it */ + if ( sid > 390 ) + return CFF_Get_Name( index, sid - 391 ); + + /* that's a standard string, fetch a copy from the PSName module */ + { + FT_String* name = 0; + const char* adobe_name = interface->adobe_std_strings( sid ); + FT_UInt len; + + + if ( adobe_name ) + { + FT_Memory memory = index->stream->memory; + FT_Error error; + + + len = (FT_UInt)strlen( adobe_name ); + if ( !ALLOC( name, len + 1 ) ) + { + MEM_Copy( name, adobe_name, len ); + name[len] = 0; + } + } + + return name; + } + } + + + /*************************************************************************/ + /*************************************************************************/ + /*** ***/ + /*** FD Select table support ***/ + /*** ***/ + /*************************************************************************/ + /*************************************************************************/ + + + static + void CFF_Done_FD_Select( CFF_FD_Select* select, + FT_Stream stream ) + { + if ( select->data ) + RELEASE_Frame( select->data ); + + select->data_size = 0; + select->format = 0; + select->range_count = 0; + } + + + static + FT_Error CFF_Load_FD_Select( CFF_FD_Select* select, + FT_UInt num_glyphs, + FT_Stream stream, + FT_ULong offset ) + { + FT_Error error; + FT_Byte format; + FT_UInt num_ranges; + + + /* read format */ + if ( FILE_Seek( offset ) || READ_Byte( format ) ) + goto Exit; + + select->format = format; + select->cache_count = 0; /* clear cache */ + + switch ( format ) + { + case 0: /* format 0, that's simple */ + select->data_size = num_glyphs; + goto Load_Data; + + case 3: /* format 3, a tad more complex */ + if ( READ_UShort( num_ranges ) ) + goto Exit; + + select->data_size = num_ranges * 3 + 2; + + Load_Data: + if ( EXTRACT_Frame( select->data_size, select->data ) ) + goto Exit; + break; + + default: /* hmm... that's wrong */ + error = CFF_Err_Invalid_File_Format; + } + + Exit: + return error; + } + + + FT_LOCAL_DEF + FT_Byte CFF_Get_FD( CFF_FD_Select* select, + FT_UInt glyph_index ) + { + FT_Byte fd = 0; + + + switch ( select->format ) + { + case 0: + fd = select->data[glyph_index]; + break; + + case 3: + /* first, compare to cache */ + if ( (FT_UInt)(glyph_index-select->cache_first) < select->cache_count ) + { + fd = select->cache_fd; + break; + } + + /* then, lookup the ranges array */ + { + FT_Byte* p = select->data; + FT_Byte* p_limit = p + select->data_size; + FT_Byte fd2; + FT_UInt first, limit; + + + first = NEXT_UShort( p ); + do + { + if ( glyph_index < first ) + break; + + fd2 = *p++; + limit = NEXT_UShort( p ); + + if ( glyph_index < limit ) + { + fd = fd2; + + /* update cache */ + select->cache_first = first; + select->cache_count = limit-first; + select->cache_fd = fd2; + break; + } + first = limit; + + } while ( p < p_limit ); + } + break; + + default: + ; + } + + return fd; + } + + + /*************************************************************************/ + /*************************************************************************/ + /*** ***/ + /*** CFF font support ***/ + /*** ***/ + /*************************************************************************/ + /*************************************************************************/ + + static + void CFF_Done_Encoding( CFF_Encoding* encoding, + FT_Stream stream ) + { + FT_Memory memory = stream->memory; + + + FREE( encoding->codes ); + FREE( encoding->sids ); + encoding->format = 0; + encoding->offset = 0; + encoding->codes = 0; + encoding->sids = 0; + } + + + static + void CFF_Done_Charset( CFF_Charset* charset, + FT_Stream stream ) + { + FT_Memory memory = stream->memory; + + + FREE( charset->sids ); + charset->format = 0; + charset->offset = 0; + charset->sids = 0; + } + + + static + FT_Error CFF_Load_Charset( CFF_Charset* charset, + FT_UInt num_glyphs, + FT_Stream stream, + FT_ULong base_offset, + FT_ULong offset ) + { + FT_Memory memory = stream->memory; + FT_Error error = 0; + FT_UShort glyph_sid; + + + charset->offset = base_offset + offset; + + /* Get the format of the table. */ + if ( FILE_Seek( charset->offset ) || + READ_Byte( charset->format ) ) + goto Exit; + + /* If the the offset is greater than 2, we have to parse the */ + /* charset table. */ + if ( offset > 2 ) + { + FT_UInt j; + + + /* Allocate memory for sids. */ + if ( ALLOC( charset->sids, num_glyphs * sizeof ( FT_UShort ) ) ) + goto Exit; + + /* assign the .notdef glyph */ + charset->sids[0] = 0; + + switch ( charset->format ) + { + case 0: + for ( j = 1; j < num_glyphs; j++ ) + { + if ( READ_UShort( glyph_sid ) ) + goto Exit; + + charset->sids[j] = glyph_sid; + } + break; + + case 1: + case 2: + { + FT_UInt nleft; + FT_UInt i; + + + j = 1; + + while ( j < num_glyphs ) + { + + /* Read the first glyph sid of the range. */ + if ( READ_UShort( glyph_sid ) ) + goto Exit; + + /* Read the number of glyphs in the range. */ + if ( charset->format == 2 ) + { + if ( READ_UShort( nleft ) ) + goto Exit; + } + else + { + if ( READ_Byte( nleft ) ) + goto Exit; + } + + /* Fill in the range of sids -- `nleft + 1' glyphs. */ + for ( i = 0; i <= nleft; i++, j++, glyph_sid++ ) + charset->sids[j] = glyph_sid; + } + } + break; + + default: + FT_ERROR(( "CFF_Load_Charset: invalid table format!\n" )); + error = FT_Err_Invalid_File_Format; + goto Exit; + } + } + else + { + /* Parse default tables corresponding to offset == 0, 1, or 2. */ + /* CFF specification intimates the following: */ + /* */ + /* In order to use a predefined charset, the following must be */ + /* true: The charset constructed for the glyphs in the font's */ + /* charstrings dictionary must match the predefined charset in */ + /* the first num_glyphs, and hence must match the predefined */ + /* charset *exactly*. */ + + switch ( offset ) + { + case 0: + if ( num_glyphs != 229 ) + { + FT_ERROR(("CFF_Load_Charset: implicit charset not equal to\n" + "predefined charset (Adobe ISO-Latin)!\n" )); + error = FT_Err_Invalid_File_Format; + goto Exit; + } + + /* Allocate memory for sids. */ + if ( ALLOC( charset->sids, num_glyphs * sizeof ( FT_UShort ) ) ) + goto Exit; + + /* Copy the predefined charset into the allocated memory. */ + MEM_Copy( charset->sids, cff_isoadobe_charset, + num_glyphs * sizeof ( FT_UShort ) ); + + break; + + case 1: + if ( num_glyphs != 166 ) + { + FT_ERROR(( "CFF_Load_Charset: implicit charset not equal to\n" + "predefined charset (Adobe Expert)!\n" )); + error = FT_Err_Invalid_File_Format; + goto Exit; + } + + /* Allocate memory for sids. */ + if ( ALLOC( charset->sids, num_glyphs * sizeof ( FT_UShort ) ) ) + goto Exit; + + /* Copy the predefined charset into the allocated memory. */ + MEM_Copy( charset->sids, cff_expert_charset, + num_glyphs * sizeof ( FT_UShort ) ); + + break; + + case 2: + if ( num_glyphs != 87 ) + { + FT_ERROR(( "CFF_Load_Charset: implicit charset not equal to\n" + "predefined charset (Adobe Expert Subset)!\n" )); + error = FT_Err_Invalid_File_Format; + goto Exit; + } + + /* Allocate memory for sids. */ + if ( ALLOC( charset->sids, num_glyphs * sizeof ( FT_UShort ) ) ) + goto Exit; + + /* Copy the predefined charset into the allocated memory. */ + MEM_Copy( charset->sids, cff_expertsubset_charset, + num_glyphs * sizeof ( FT_UShort ) ); + + break; + + default: + error = FT_Err_Invalid_File_Format; + goto Exit; + } + } + + Exit: + + /* Clean up if there was an error. */ + if ( error ) + if ( charset->sids ) + { + if ( charset->sids ) + FREE( charset->sids ); + charset->format = 0; + charset->offset = 0; + charset->sids = 0; + } + + return error; + } + + + static + FT_Error CFF_Load_Encoding( CFF_Encoding* encoding, + CFF_Charset* charset, + FT_UInt num_glyphs, + FT_Stream stream, + FT_ULong base_offset, + FT_ULong offset ) + { + FT_Memory memory = stream->memory; + FT_Error error = 0; + FT_UInt count; + FT_UInt j; + FT_UShort glyph_sid; + FT_Byte glyph_code; + + + /* Check for charset->sids. If we do not have this, we fail. */ + if ( !charset->sids ) + { + error = FT_Err_Invalid_File_Format; + goto Exit; + } + + /* Allocate memory for sids/codes -- there are at most 256 sids/codes */ + /* for an encoding. */ + if ( ALLOC( encoding->sids, 256 * sizeof ( FT_UShort ) ) || + ALLOC( encoding->codes, 256 * sizeof ( FT_UShort ) ) ) + goto Exit; + + /* Zero out the code to gid/sid mappings. */ + for ( j = 0; j < 255; j++ ) + { + encoding->sids [j] = 0; + encoding->codes[j] = 0; + } + + /* Note: The encoding table in a CFF font is indexed by glyph index, */ + /* where the first encoded glyph index is 1. Hence, we read the char */ + /* code (`glyph_code') at index j and make the assignment: */ + /* */ + /* encoding->codes[glyph_code] = j + 1 */ + /* */ + /* We also make the assignment: */ + /* */ + /* encoding->sids[glyph_code] = charset->sids[j + 1] */ + /* */ + /* This gives us both a code to GID and a code to SID mapping. */ + + if ( offset > 1 ) + { + + encoding->offset = base_offset + offset; + + /* we need to parse the table to determine its size */ + if ( FILE_Seek( encoding->offset ) || + READ_Byte( encoding->format ) || + READ_Byte( count ) ) + goto Exit; + + switch ( encoding->format & 0x7F ) + { + case 0: + for ( j = 1; j <= count; j++ ) + { + if ( READ_Byte( glyph_code ) ) + goto Exit; + + /* Make sure j is not too big. */ + if ( j > num_glyphs ) + goto Exit; + + /* Assign code to GID mapping. */ + encoding->codes[glyph_code] = j; + + /* Assign code to SID mapping. */ + encoding->sids[glyph_code] = charset->sids[j]; + } + + break; + + case 1: + { + FT_Byte nleft; + FT_Byte i = 1; + FT_Byte k; + + + /* Parse the Format1 ranges. */ + for ( j = 0; j < count; j++, i += nleft ) + { + /* Read the first glyph code of the range. */ + if ( READ_Byte( glyph_code ) ) + goto Exit; + + /* Read the number of codes in the range. */ + if ( READ_Byte( nleft ) ) + goto Exit; + + /* Increment nleft, so we read `nleft + 1' codes/sids. */ + nleft++; + + /* Fill in the range of codes/sids. */ + for ( k = i; k < nleft + i; k++, glyph_code++ ) + { + /* Make sure k is not too big. */ + if ( (FT_UInt)k > num_glyphs ) + goto Exit; + + /* Assign code to GID mapping. */ + encoding->codes[glyph_code] = k; + + /* Assign code to SID mapping. */ + encoding->sids[glyph_code] = charset->sids[k]; + } + } + } + break; + + default: + FT_ERROR(( "CFF_Load_Encoding: invalid table format!\n" )); + error = FT_Err_Invalid_File_Format; + goto Exit; + } + + /* Parse supplemental encodings, if any. */ + if ( encoding->format & 0x80 ) + { + FT_UInt glyph_id; + + + /* count supplements */ + if ( READ_Byte( count ) ) + goto Exit; + + for ( j = 0; j < count; j++ ) + { + /* Read supplemental glyph code. */ + if ( READ_Byte( glyph_code ) ) + goto Exit; + + /* Read the SID associated with this glyph code. */ + if ( READ_UShort( glyph_sid ) ) + goto Exit; + + /* Assign code to SID mapping. */ + encoding->sids[glyph_code] = glyph_sid; + + /* First, lookup GID which has been assigned to */ + /* SID glyph_sid. */ + for ( glyph_id = 0; glyph_id < num_glyphs; glyph_id++ ) + { + if ( charset->sids[glyph_id] == glyph_sid ) + break; + } + + /* Now, make the assignment. */ + encoding->codes[glyph_code] = glyph_id; + } + } + } + else + { + FT_UInt i; + + + /* We take into account the fact a CFF font can use a predefined */ + /* encoding without containing all of the glyphs encoded by this */ + /* encoding (see the note at the end of section 12 in the CFF */ + /* specification). */ + + switch ( offset ) + { + case 0: + /* First, copy the code to SID mapping. */ + MEM_Copy( encoding->sids, cff_standard_encoding, + 256 * sizeof ( FT_UShort ) ); + + /* Construct code to GID mapping from code */ + /* to SID mapping and charset. */ + for ( j = 0; j < 256; j++ ) + { + /* If j is encoded, find the GID for it. */ + if ( encoding->sids[j] ) + { + for ( i = 1; i < num_glyphs; i++ ) + /* We matched, so break. */ + if ( charset->sids[i] == encoding->sids[j] ) + break; + + /* i will be equal to num_glyphs if we exited the above */ + /* loop without a match. In this case, we also have to */ + /* fix the code to SID mapping. */ + if ( i == num_glyphs ) + { + encoding->codes[j] = 0; + encoding->sids [j] = 0; + } + else + encoding->codes[j] = i; + } + } + break; + + case 1: + /* First, copy the code to SID mapping. */ + MEM_Copy( encoding->sids, cff_expert_encoding, + 256 * sizeof ( FT_UShort ) ); + + /* Construct code to GID mapping from code to SID mapping */ + /* and charset. */ + for ( j = 0; j < 256; j++ ) + { + /* If j is encoded, find the GID for it. */ + if ( encoding->sids[j] ) + { + for ( i = 1; i < num_glyphs; i++ ) + /* We matched, so break. */ + if ( charset->sids[i] == encoding->sids[j] ) + break; + + /* i will be equal to num_glyphs if we exited the above */ + /* loop without a match. In this case, we also have to */ + /* fix the code to SID mapping. */ + if ( i == num_glyphs ) + { + encoding->codes[j] = 0; + encoding->sids [j] = 0; + } + else + encoding->codes[j] = i; + } + } + break; + + default: + FT_ERROR(( "CFF_Load_Encoding: invalid table format!\n" )); + error = FT_Err_Invalid_File_Format; + goto Exit; + break; + } + } + + Exit: + + /* Clean up if there was an error. */ + if ( error ) + { + if ( encoding->sids || encoding->codes ) + { + if ( encoding->sids ) + FREE( encoding->sids ); + + if ( encoding->codes ) + FREE( encoding->codes ); + + charset->format = 0; + charset->offset = 0; + charset->sids = 0; + } + } + + return error; + } + + + static + FT_Error CFF_Load_SubFont( CFF_SubFont* font, + CFF_Index* index, + FT_UInt font_index, + FT_Stream stream, + FT_ULong base_offset ) + { + FT_Error error; + CFF_Parser parser; + FT_Byte* dict; + FT_ULong dict_len; + CFF_Font_Dict* top = &font->font_dict; + CFF_Private* priv = &font->private_dict; + + + CFF_Parser_Init( &parser, CFF_CODE_TOPDICT, &font->font_dict ); + + /* set defaults */ + MEM_Set( top, 0, sizeof ( *top ) ); + + top->underline_position = -100; + top->underline_thickness = 50; + top->charstring_type = 2; + top->font_matrix.xx = 0x10000L; + top->font_matrix.yy = 0x10000L; + top->cid_count = 8720; + + error = CFF_Access_Element( index, font_index, &dict, &dict_len ) || + CFF_Parser_Run( &parser, dict, dict + dict_len ); + + CFF_Forget_Element( index, &dict ); + + if ( error ) + goto Exit; + + /* if it is a CID font, we stop there */ + if ( top->cid_registry ) + goto Exit; + + /* parse the private dictionary, if any */ + if ( top->private_offset && top->private_size ) + { + /* set defaults */ + MEM_Set( priv, 0, sizeof ( *priv ) ); + + priv->blue_shift = 7; + priv->blue_fuzz = 1; + priv->lenIV = -1; + priv->expansion_factor = (FT_Fixed)0.06 * 0x10000L; + priv->blue_scale = (FT_Fixed)0.039625 * 0x10000L; + + CFF_Parser_Init( &parser, CFF_CODE_PRIVATE, priv ); + + if ( FILE_Seek( base_offset + font->font_dict.private_offset ) || + ACCESS_Frame( font->font_dict.private_size ) ) + goto Exit; + + error = CFF_Parser_Run( &parser, + (FT_Byte*)stream->cursor, + (FT_Byte*)stream->limit ); + FORGET_Frame(); + if ( error ) + goto Exit; + } + + /* read the local subrs, if any */ + if ( priv->local_subrs_offset ) + { + if ( FILE_Seek( base_offset + top->private_offset + + priv->local_subrs_offset ) ) + goto Exit; + + error = cff_new_index( &font->local_subrs_index, stream, 1 ); + if ( error ) + goto Exit; + + font->num_local_subrs = font->local_subrs_index.count; + error = cff_explicit_index( &font->local_subrs_index, + &font->local_subrs ); + if ( error ) + goto Exit; + } + + Exit: + return error; + } + + + static + void CFF_Done_SubFont( FT_Memory memory, + CFF_SubFont* subfont ) + { + if ( subfont ) + { + cff_done_index( &subfont->local_subrs_index ); + FREE( subfont->local_subrs ); + } + } + + + FT_LOCAL_DEF + FT_Error CFF_Load_Font( FT_Stream stream, + FT_Int face_index, + CFF_Font* font ) + { + static const FT_Frame_Field cff_header_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE CFF_Font + + FT_FRAME_START( 4 ), + FT_FRAME_BYTE( version_major ), + FT_FRAME_BYTE( version_minor ), + FT_FRAME_BYTE( header_size ), + FT_FRAME_BYTE( absolute_offsize ), + FT_FRAME_END + }; + + FT_Error error; + FT_Memory memory = stream->memory; + FT_ULong base_offset; + CFF_Font_Dict* dict; + + + MEM_Set( font, 0, sizeof ( *font ) ); + + font->stream = stream; + font->memory = memory; + dict = &font->top_font.font_dict; + base_offset = FILE_Pos(); + + /* read CFF font header */ + if ( READ_Fields( cff_header_fields, font ) ) + goto Exit; + + /* check format */ + if ( font->version_major != 1 || + font->header_size < 4 || + font->absolute_offsize > 4 ) + { + FT_TRACE2(( "[not a CFF font header!]\n" )); + error = FT_Err_Unknown_File_Format; + goto Exit; + } + + /* skip the rest of the header */ + if ( FILE_Skip( font->header_size - 4 ) ) + goto Exit; + + /* read the name, top dict, string and global subrs index */ + if ( FT_SET_ERROR( cff_new_index( &font->name_index, stream, 0 )) || + FT_SET_ERROR( cff_new_index( &font->font_dict_index, stream, 0 )) || + FT_SET_ERROR( cff_new_index( &font->string_index, stream, 0 )) || + FT_SET_ERROR( cff_new_index( &font->global_subrs_index, stream, 1 )) ) + goto Exit; + + /* well, we don't really forget the `disabled' fonts... */ + font->num_faces = font->name_index.count; + if ( face_index >= (FT_Int)font->num_faces ) + { + FT_ERROR(( "CFF_Load_Font: incorrect face index = %d\n", + face_index )); + error = CFF_Err_Invalid_Argument; + } + + /* in case of a font format check, simply exit now */ + if ( face_index < 0 ) + goto Exit; + + /* now, parse the top-level font dictionary */ + error = CFF_Load_SubFont( &font->top_font, + &font->font_dict_index, + face_index, + stream, + base_offset ); + if ( error ) + goto Exit; + + /* now, check for a CID font */ + if ( dict->cid_registry ) + { + CFF_Index fd_index; + CFF_SubFont* sub; + FT_UInt index; + + + /* this is a CID-keyed font, we must now allocate a table of */ + /* sub-fonts, then load each of them separately */ + if ( FILE_Seek( base_offset + dict->cid_fd_array_offset ) ) + goto Exit; + + error = cff_new_index( &fd_index, stream, 0 ); + if ( error ) + goto Exit; + + if ( fd_index.count > CFF_MAX_CID_FONTS ) + { + FT_ERROR(( "CFF_Load_Font: FD array too large in CID font\n" )); + goto Fail_CID; + } + + /* allocate & read each font dict independently */ + font->num_subfonts = fd_index.count; + if ( ALLOC_ARRAY( sub, fd_index.count, CFF_SubFont ) ) + goto Fail_CID; + + /* setup pointer table */ + for ( index = 0; index < fd_index.count; index++ ) + font->subfonts[index] = sub + index; + + /* now load each sub font independently */ + for ( index = 0; index < fd_index.count; index++ ) + { + sub = font->subfonts[index]; + error = CFF_Load_SubFont( sub, &fd_index, index, + stream, base_offset ); + if ( error ) + goto Fail_CID; + } + + /* now load the FD Select array */ + error = CFF_Load_FD_Select( &font->fd_select, + dict->cid_count, + stream, + base_offset + dict->cid_fd_select_offset ); + + Fail_CID: + cff_done_index( &fd_index ); + + if ( error ) + goto Exit; + } + else + font->num_subfonts = 0; + + /* read the charstrings index now */ + if ( dict->charstrings_offset == 0 ) + { + FT_ERROR(( "CFF_Load_Font: no charstrings offset!\n" )); + error = FT_Err_Unknown_File_Format; + goto Exit; + } + + if ( FILE_Seek( base_offset + dict->charstrings_offset ) ) + goto Exit; + + error = cff_new_index( &font->charstrings_index, stream, 0 ); + if ( error ) + goto Exit; + + /* explicit the global subrs */ + font->num_global_subrs = font->global_subrs_index.count; + font->num_glyphs = font->charstrings_index.count; + + error = cff_explicit_index( &font->global_subrs_index, + &font->global_subrs ) ; + + if ( error ) + goto Exit; + + /* read the Charset and Encoding tables when available */ + error = CFF_Load_Charset( &font->charset, font->num_glyphs, stream, + base_offset, dict->charset_offset ); + if ( error ) + goto Exit; + + error = CFF_Load_Encoding( &font->encoding, + &font->charset, + font->num_glyphs, + stream, + base_offset, + dict->encoding_offset ); + if ( error ) + goto Exit; + + /* get the font name */ + font->font_name = CFF_Get_Name( &font->name_index, face_index ); + + Exit: + return error; + } + + + FT_LOCAL_DEF + void CFF_Done_Font( CFF_Font* font ) + { + FT_Memory memory = font->memory; + FT_UInt index; + + + cff_done_index( &font->global_subrs_index ); + cff_done_index( &font->string_index ); + cff_done_index( &font->font_dict_index ); + cff_done_index( &font->name_index ); + cff_done_index( &font->charstrings_index ); + + /* release font dictionaries */ + for ( index = 0; index < font->num_subfonts; index++ ) + CFF_Done_SubFont( memory, font->subfonts[index] ); + + CFF_Done_Encoding( &font->encoding, font->stream ); + CFF_Done_Charset( &font->charset, font->stream ); + + CFF_Done_SubFont( memory, &font->top_font ); + + CFF_Done_FD_Select( &font->fd_select, font->stream ); + + FREE( font->global_subrs ); + FREE( font->font_name ); + } + + +/* END */ diff --git a/xc/extras/freetype2/src/cff/cffload.h b/xc/extras/freetype2/src/cff/cffload.h new file mode 100644 index 000000000..46a06d92c --- /dev/null +++ b/xc/extras/freetype2/src/cff/cffload.h @@ -0,0 +1,70 @@ +/***************************************************************************/ +/* */ +/* cffload.h */ +/* */ +/* OpenType & CFF data/program tables loader (specification). */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __CFFLOAD_H__ +#define __CFFLOAD_H__ + + +#include <ft2build.h> +#include FT_INTERNAL_CFF_TYPES_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H + + +FT_BEGIN_HEADER + + FT_LOCAL + FT_String* CFF_Get_Name( CFF_Index* index, + FT_UInt element ); + + FT_LOCAL + FT_String* CFF_Get_String( CFF_Index* index, + FT_UInt sid, + PSNames_Interface* interface ); + + + FT_LOCAL + FT_Error CFF_Access_Element( CFF_Index* index, + FT_UInt element, + FT_Byte** pbytes, + FT_ULong* pbyte_len ); + + FT_LOCAL + void CFF_Forget_Element( CFF_Index* index, + FT_Byte** pbytes ); + + + FT_LOCAL + FT_Error CFF_Load_Font( FT_Stream stream, + FT_Int face_index, + CFF_Font* font ); + + FT_LOCAL + void CFF_Done_Font( CFF_Font* font ); + + + FT_LOCAL + FT_Byte CFF_Get_FD( CFF_FD_Select* select, + FT_UInt glyph_index ); + + +FT_END_HEADER + +#endif /* __CFFLOAD_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/src/cff/cffobjs.c b/xc/extras/freetype2/src/cff/cffobjs.c new file mode 100644 index 000000000..80a831681 --- /dev/null +++ b/xc/extras/freetype2/src/cff/cffobjs.c @@ -0,0 +1,599 @@ +/***************************************************************************/ +/* */ +/* cffobjs.c */ +/* */ +/* OpenType objects manager (body). */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_CALC_H +#include FT_INTERNAL_STREAM_H +#include FT_ERRORS_H +#include FT_TRUETYPE_IDS_H +#include FT_TRUETYPE_TAGS_H +#include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H +#include "cffobjs.h" +#include "cffload.h" +#include FT_INTERNAL_CFF_ERRORS_H + +#include <string.h> /* for strlen() */ + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_cffobjs + + + /*************************************************************************/ + /* */ + /* FACE FUNCTIONS */ + /* */ + /*************************************************************************/ + + static + FT_String* CFF_StrCopy( FT_Memory memory, + const FT_String* source ) + { + FT_Error error; + FT_String* result = 0; + FT_Int len = (FT_Int)strlen( source ); + + + if ( !ALLOC( result, len + 1 ) ) + { + MEM_Copy( result, source, len ); + result[len] = 0; + } + return result; + } + + +#if 0 + + /* this function is used to build a Unicode charmap from the glyph names */ + /* in a file */ + static + FT_Error CFF_Build_Unicode_Charmap( CFF_Face face, + FT_ULong base_offset, + PSNames_Interface* psnames ) + { + CFF_Font* font = (CFF_Font*)face->extra.data; + FT_Memory memory = FT_FACE_MEMORY(face); + FT_UInt n, num_glyphs = face->root.num_glyphs; + const char** glyph_names; + FT_Error error; + CFF_Font_Dict* dict = &font->top_font.font_dict; + FT_ULong charset_offset; + FT_Byte format; + FT_Stream stream = face->root.stream; + + + charset_offset = dict->charset_offset; + if ( !charset_offset ) + { + FT_ERROR(( "CFF_Build_Unicode_Charmap: charset table is missing\n" )); + error = CFF_Err_Invalid_File_Format; + goto Exit; + } + + /* allocate the charmap */ + if ( ALLOC( face->charmap, ... + + /* seek to charset table and allocate glyph names table */ + if ( FILE_Seek( base_offset + charset_offset ) || + ALLOC_ARRAY( glyph_names, num_glyphs, const char* ) ) + goto Exit; + + /* now, read each glyph name and store it in the glyph name table */ + if ( READ_Byte( format ) ) + goto Fail; + + switch ( format ) + { + case 0: /* format 0 - one SID per glyph */ + { + const char** gname = glyph_names; + const char** limit = gname + num_glyphs; + + + if ( ACCESS_Frame( num_glyphs * 2 ) ) + goto Fail; + + for ( ; gname < limit; gname++ ) + gname[0] = CFF_Get_String( &font->string_index, + GET_UShort(), + psnames ); + FORGET_Frame(); + break; + } + + case 1: /* format 1 - sequential ranges */ + case 2: /* format 2 - sequential ranges with 16-bit counts */ + { + const char** gname = glyph_names; + const char** limit = gname + num_glyphs; + FT_UInt len = 3; + + + if ( format == 2 ) + len++; + + while ( gname < limit ) + { + FT_UInt first; + FT_UInt count; + + + if ( ACCESS_Frame( len ) ) + goto Fail; + + first = GET_UShort(); + if ( format == 3 ) + count = GET_UShort(); + else + count = GET_Byte(); + + FORGET_Frame(); + + for ( ; count > 0; count-- ) + { + gname[0] = CFF_Get_String( &font->string_index, + first, + psnames ); + gname++; + first++; + } + } + break; + } + + default: /* unknown charset format! */ + FT_ERROR(( "CFF_Build_Unicode_Charmap: unknown charset format!\n" )); + error = CFF_Err_Invalid_File_Format; + goto Fail; + } + + /* all right, the glyph names were loaded; we now need to create */ + /* the corresponding unicode charmap */ + + Fail: + for ( n = 0; n < num_glyphs; n++ ) + FREE( glyph_names[n] ); + + FREE( glyph_names ); + + Exit: + return error; + } + +#endif /* 0 */ + + + static + FT_Encoding find_encoding( int platform_id, + int encoding_id ) + { + typedef struct TEncoding + { + int platform_id; + int encoding_id; + FT_Encoding encoding; + + } TEncoding; + + static + const TEncoding tt_encodings[] = + { + { TT_PLATFORM_ISO, -1, ft_encoding_unicode }, + + { TT_PLATFORM_APPLE_UNICODE, -1, ft_encoding_unicode }, + + { TT_PLATFORM_MACINTOSH, TT_MAC_ID_ROMAN, ft_encoding_apple_roman }, + + { TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS, ft_encoding_unicode }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_SJIS, ft_encoding_sjis }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_GB2312, ft_encoding_gb2312 }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_BIG_5, ft_encoding_big5 }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_WANSUNG, ft_encoding_wansung }, + { TT_PLATFORM_MICROSOFT, TT_MS_ID_JOHAB, ft_encoding_johab } + }; + + const TEncoding *cur, *limit; + + + cur = tt_encodings; + limit = cur + sizeof ( tt_encodings ) / sizeof ( tt_encodings[0] ); + + for ( ; cur < limit; cur++ ) + { + if ( cur->platform_id == platform_id ) + { + if ( cur->encoding_id == encoding_id || + cur->encoding_id == -1 ) + return cur->encoding; + } + } + + return ft_encoding_none; + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* CFF_Init_Face */ + /* */ + /* <Description> */ + /* Initializes a given OpenType face object. */ + /* */ + /* <Input> */ + /* stream :: The source font stream. */ + /* */ + /* face_index :: The index of the font face in the resource. */ + /* */ + /* num_params :: Number of additional generic parameters. Ignored. */ + /* */ + /* params :: Additional generic parameters. Ignored. */ + /* */ + /* <InOut> */ + /* face :: The newly built face object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL + FT_Error CFF_Init_Face( FT_Stream stream, + CFF_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ) + { + FT_Error error; + SFNT_Interface* sfnt; + PSNames_Interface* psnames; + FT_Bool pure_cff = 1; + FT_Bool sfnt_format = 0; + + + sfnt = (SFNT_Interface*)FT_Get_Module_Interface( + face->root.driver->root.library, "sfnt" ); + if ( !sfnt ) + goto Bad_Format; + + psnames = (PSNames_Interface*)FT_Get_Module_Interface( + face->root.driver->root.library, "psnames" ); + + /* create input stream from resource */ + if ( FILE_Seek( 0 ) ) + goto Exit; + + /* check that we have a valid OpenType file */ + error = sfnt->init_face( stream, face, face_index, num_params, params ); + if ( !error ) + { + if ( face->format_tag != 0x4F54544FL ) /* `OTTO'; OpenType/CFF font */ + { + FT_TRACE2(( "[not a valid OpenType/CFF font]\n" )); + goto Bad_Format; + } + + /* if we are performing a simple font format check, exit immediately */ + if ( face_index < 0 ) + return CFF_Err_Ok; + + sfnt_format = 1; + + /* now, the font can be either an OpenType/CFF font, or an SVG CEF */ + /* font in the later case; it doesn't have a `head' table */ + error = face->goto_table( face, TTAG_head, stream, 0 ); + if ( !error ) + { + pure_cff = 0; + + /* load font directory */ + error = sfnt->load_face( stream, face, + face_index, num_params, params ); + if ( error ) + goto Exit; + } + else + { + /* load the `cmap' table by hand */ + error = sfnt->load_charmaps( face, stream ); + if ( error ) + goto Exit; + + /* XXX: we don't load the GPOS table, as OpenType Layout */ + /* support will be added later to a layout library on top of */ + /* FreeType 2 */ + } + + /* now, load the CFF part of the file */ + error = face->goto_table( face, TTAG_CFF, stream, 0 ); + if ( error ) + goto Exit; + } + else + { + /* rewind to start of file; we are going to load a pure-CFF font */ + if ( FILE_Seek( 0 ) ) + goto Exit; + error = FT_Err_Ok; + } + + /* now load and parse the CFF table in the file */ + { + CFF_Font* cff; + FT_Memory memory = face->root.memory; + FT_Face root; + FT_UInt flags; + FT_ULong base_offset; + + + if ( ALLOC( cff, sizeof ( *cff ) ) ) + goto Exit; + + base_offset = FILE_Pos(); + + face->extra.data = cff; + error = CFF_Load_Font( stream, face_index, cff ); + if ( error ) + goto Exit; + + /* Complement the root flags with some interesting information. */ + /* Note that this is only necessary for pure CFF and CEF fonts. */ + + root = &face->root; + if ( pure_cff ) + { + CFF_Font_Dict* dict = &cff->top_font.font_dict; + + + /* we need the `PSNames' module for pure-CFF and CEF formats */ + if ( !psnames ) + { + FT_ERROR(( "CFF_Init_Face:" )); + FT_ERROR(( " cannot open CFF & CEF fonts\n" )); + FT_ERROR(( " " )); + FT_ERROR(( " without the `PSNames' module\n" )); + goto Bad_Format; + } + + /* Set up num_faces. */ + root->num_faces = cff->num_faces; + + /* compute number of glyphs */ + if ( dict->cid_registry ) + root->num_glyphs = dict->cid_count; + else + root->num_glyphs = cff->charstrings_index.count; + + /* set global bbox, as well as EM size */ + root->bbox = dict->font_bbox; + root->ascender = (FT_Short)( root->bbox.yMax >> 16 ); + root->descender = (FT_Short)( root->bbox.yMin >> 16 ); + root->height = ( ( root->ascender - root->descender ) * 12 ) / 10; + + if ( dict->units_per_em ) + root->units_per_EM = dict->units_per_em; + else + root->units_per_EM = 1000; + + /* retrieve font family & style name */ + root->family_name = CFF_Get_Name( &cff->name_index, face_index ); + if ( dict->cid_registry ) + root->style_name = CFF_StrCopy( memory, "Regular" ); /* XXXX */ + else + root->style_name = CFF_Get_String( &cff->string_index, + dict->weight, + psnames ); + + /*******************************************************************/ + /* */ + /* Compute face flags. */ + /* */ + flags = FT_FACE_FLAG_SCALABLE | /* scalable outlines */ + FT_FACE_FLAG_HORIZONTAL; /* horizontal data */ + + if ( sfnt_format ) + flags |= FT_FACE_FLAG_SFNT; + + /* fixed width font? */ + if ( dict->is_fixed_pitch ) + flags |= FT_FACE_FLAG_FIXED_WIDTH; + + /* XXX: WE DO NOT SUPPORT KERNING METRICS IN THE GPOS TABLE FOR NOW */ +#if 0 + /* kerning available? */ + if ( face->kern_pairs ) + flags |= FT_FACE_FLAG_KERNING; +#endif + +#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES + flags |= FT_FACE_FLAG_GLYPH_NAMES; +#endif + + root->face_flags = flags; + + /*******************************************************************/ + /* */ + /* Compute style flags. */ + /* */ + flags = 0; + + if ( dict->italic_angle ) + flags |= FT_STYLE_FLAG_ITALIC; + + /* XXX: may not be correct */ + if ( cff->top_font.private_dict.force_bold ) + flags |= FT_STYLE_FLAG_BOLD; + + root->style_flags = flags; + + /* set the charmaps if any */ + if ( sfnt_format ) + { + /*****************************************************************/ + /* */ + /* Polish the charmaps. */ + /* */ + /* Try to set the charmap encoding according to the platform & */ + /* encoding ID of each charmap. */ + /* */ + TT_CharMap charmap; + FT_Int n; + + + charmap = face->charmaps; + root->num_charmaps = face->num_charmaps; + + /* allocate table of pointers */ + if ( ALLOC_ARRAY( root->charmaps, root->num_charmaps, FT_CharMap ) ) + goto Exit; + + for ( n = 0; n < root->num_charmaps; n++, charmap++ ) + { + FT_Int platform = charmap->cmap.platformID; + FT_Int encoding = charmap->cmap.platformEncodingID; + + + charmap->root.face = (FT_Face)face; + charmap->root.platform_id = platform; + charmap->root.encoding_id = encoding; + charmap->root.encoding = find_encoding( platform, encoding ); + + /* now, set root->charmap with a unicode charmap */ + /* wherever available */ + if ( !root->charmap && + charmap->root.encoding == ft_encoding_unicode ) + root->charmap = (FT_CharMap)charmap; + + root->charmaps[n] = (FT_CharMap)charmap; + } + } + } + } + + Exit: + return error; + + Bad_Format: + error = FT_Err_Unknown_File_Format; + goto Exit; + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* CFF_Done_Face */ + /* */ + /* <Description> */ + /* Finalizes a given face object. */ + /* */ + /* <Input> */ + /* face :: A pointer to the face object to destroy. */ + /* */ + FT_LOCAL + void CFF_Done_Face( CFF_Face face ) + { + FT_Memory memory = face->root.memory; + SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt; + + + if ( sfnt ) + sfnt->done_face( face ); + + { + CFF_Font* cff = (CFF_Font*)face->extra.data; + + + if ( cff ) + { + CFF_Done_Font( cff ); + FREE( face->extra.data ); + } + } + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* CFF_Init_Driver */ + /* */ + /* <Description> */ + /* Initializes a given OpenType driver object. */ + /* */ + /* <Input> */ + /* driver :: A handle to the target driver object. */ + /* */ + /* <Return> */ + /* FreeType error code. 0 means success. */ + /* */ + FT_LOCAL_DEF + FT_Error CFF_Init_Driver( CFF_Driver driver ) + { + /* init extension registry if needed */ + +#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE + + return TT_Init_Extensions( driver ); + +#else + + FT_UNUSED( driver ); + + return CFF_Err_Ok; + +#endif + } + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* CFF_Done_Driver */ + /* */ + /* <Description> */ + /* Finalizes a given OpenType driver. */ + /* */ + /* <Input> */ + /* driver :: A handle to the target OpenType driver. */ + /* */ + FT_LOCAL_DEF + void CFF_Done_Driver( CFF_Driver driver ) + { + /* destroy extensions registry if needed */ + +#ifdef TT_CONFIG_OPTION_EXTEND_ENGINE + + TT_Done_Extensions( driver ); + +#else + + FT_UNUSED( driver ); + +#endif + } + + +/* END */ diff --git a/xc/extras/freetype2/src/cff/cffobjs.h b/xc/extras/freetype2/src/cff/cffobjs.h new file mode 100644 index 000000000..fef2b79a3 --- /dev/null +++ b/xc/extras/freetype2/src/cff/cffobjs.h @@ -0,0 +1,144 @@ +/***************************************************************************/ +/* */ +/* cffobjs.h */ +/* */ +/* OpenType objects manager (specification). */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __CFFOBJS_H__ +#define __CFFOBJS_H__ + + +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_CFF_TYPES_H +#include FT_INTERNAL_CFF_ERRORS_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H + + +FT_BEGIN_HEADER + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* CFF_Driver */ + /* */ + /* <Description> */ + /* A handle to an OpenType driver object. */ + /* */ + typedef struct CFF_DriverRec_* CFF_Driver; + + typedef TT_Face CFF_Face; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* CFF_Size */ + /* */ + /* <Description> */ + /* A handle to an OpenType size object. */ + /* */ + typedef FT_Size CFF_Size; + + + /*************************************************************************/ + /* */ + /* <Type> */ + /* CFF_GlyphSlot */ + /* */ + /* <Description> */ + /* A handle to an OpenType glyph slot object. */ + /* */ + typedef struct CFF_GlyphSlotRec_ + { + FT_GlyphSlotRec root; + + FT_Bool hint; + FT_Bool scaled; + + FT_Fixed x_scale; + FT_Fixed y_scale; + + } CFF_GlyphSlotRec, *CFF_GlyphSlot; + + + + /*************************************************************************/ + /* */ + /* Subglyph transformation record. */ + /* */ + typedef struct CFF_Transform_ + { + FT_Fixed xx, xy; /* transformation matrix coefficients */ + FT_Fixed yx, yy; + FT_F26Dot6 ox, oy; /* offsets */ + + } CFF_Transform; + + + /* this is only used in the case of a pure CFF font with no charmap */ + typedef struct CFF_CharMapRec_ + { + TT_CharMapRec root; + PS_Unicodes unicodes; + + } CFF_CharMapRec, *CFF_CharMap; + + + /***********************************************************************/ + /* */ + /* TrueType driver class. */ + /* */ + typedef struct CFF_DriverRec_ + { + FT_DriverRec root; + void* extension_component; + + } CFF_DriverRec; + + + /*************************************************************************/ + /* */ + /* Face functions */ + /* */ + FT_LOCAL + FT_Error CFF_Init_Face( FT_Stream stream, + CFF_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ); + + FT_LOCAL + void CFF_Done_Face( CFF_Face face ); + + + /*************************************************************************/ + /* */ + /* Driver functions */ + /* */ + FT_LOCAL + FT_Error CFF_Init_Driver( CFF_Driver driver ); + + FT_LOCAL + void CFF_Done_Driver( CFF_Driver driver ); + + +FT_END_HEADER + +#endif /* __CFFOBJS_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/src/cff/cffparse.c b/xc/extras/freetype2/src/cff/cffparse.c new file mode 100644 index 000000000..94f2b82fc --- /dev/null +++ b/xc/extras/freetype2/src/cff/cffparse.c @@ -0,0 +1,681 @@ +/***************************************************************************/ +/* */ +/* cffparse.c */ +/* */ +/* CFF token stream parser (body) */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include <ft2build.h> +#include "cffparse.h" +#include FT_INTERNAL_CFF_ERRORS_H +#include FT_INTERNAL_STREAM_H + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_cffparse + + +#define CFF_Err_Stack_Underflow FT_Err_Invalid_Argument +#define CFF_Err_Syntax_Error FT_Err_Invalid_Argument + + + enum + { + cff_kind_none = 0, + cff_kind_num, + cff_kind_fixed, + cff_kind_string, + cff_kind_bool, + cff_kind_delta, + cff_kind_callback, + + cff_kind_max /* do not remove */ + }; + + + /* now generate handlers for the most simple fields */ + typedef FT_Error (*CFF_Field_Reader)( CFF_Parser* parser ); + + typedef struct CFF_Field_Handler_ + { + int kind; + int code; + FT_UInt offset; + FT_Byte size; + CFF_Field_Reader reader; + FT_UInt array_max; + FT_UInt count_offset; + + } CFF_Field_Handler; + + + FT_LOCAL_DEF + void CFF_Parser_Init( CFF_Parser* parser, + FT_UInt code, + void* object ) + { + MEM_Set( parser, 0, sizeof ( *parser ) ); + + parser->top = parser->stack; + parser->object_code = code; + parser->object = object; + } + + + /* read an integer */ + static + FT_Long cff_parse_integer( FT_Byte* start, + FT_Byte* limit ) + { + FT_Byte* p = start; + FT_Int v = *p++; + FT_Long val = 0; + + + if ( v == 28 ) + { + if ( p + 2 > limit ) + goto Bad; + + val = (FT_Short)( ( (FT_Int)p[0] << 8 ) | p[1] ); + p += 2; + } + else if ( v == 29 ) + { + if ( p + 4 > limit ) + goto Bad; + + val = ( (FT_Long)p[0] << 24 ) | + ( (FT_Long)p[1] << 16 ) | + ( (FT_Long)p[2] << 8 ) | + p[3]; + p += 4; + } + else if ( v < 247 ) + { + val = v - 139; + } + else if ( v < 251 ) + { + if ( p + 1 > limit ) + goto Bad; + + val = ( v - 247 ) * 256 + p[0] + 108; + p++; + } + else + { + if ( p + 1 > limit ) + goto Bad; + + val = -( v - 251 ) * 256 - p[0] - 108; + p++; + } + + Exit: + return val; + + Bad: + val = 0; + goto Exit; + } + + + /* read a real */ + static + FT_Fixed cff_parse_real( FT_Byte* start, + FT_Byte* limit, + FT_Int power_ten ) + { + FT_Byte* p = start; + FT_Long num, divider, result, exp; + FT_Int sign = 0, exp_sign = 0; + FT_Byte nib; + FT_Byte phase; + + + result = 0; + num = 0; + divider = 1; + + /* first of all, read the integer part */ + phase = 4; + + for (;;) + { + /* If we entered this iteration with phase == 4, we need to */ + /* read a new byte. This also skips past the intial 0x1E. */ + if ( phase ) + { + p++; + + /* Make sure we don't read past the end. */ + if ( p >= limit ) + goto Bad; + } + + /* Get the nibble. */ + nib = ( p[0] >> phase ) & 0xF; + phase = 4 - phase; + + if ( nib == 0xE ) + sign = 1; + else if ( nib > 9 ) + break; + else + result = result * 10 + nib; + } + + /* read decimal part, if any */ + if ( nib == 0xa ) + for (;;) + { + /* If we entered this iteration with phase == 4, we need */ + /* to read a new byte. */ + if ( phase ) + { + p++; + + /* Make sure we don't read past the end. */ + if ( p >= limit ) + goto Bad; + } + + /* Get the nibble. */ + nib = ( p[0] >> phase ) & 0xF; + phase = 4 - phase; + if ( nib >= 10 ) + break; + + if ( divider < 10000000L ) + { + num = num * 10 + nib; + divider *= 10; + } + } + + /* read exponent, if any */ + if ( nib == 12 ) + { + exp_sign = 1; + nib = 11; + } + + if ( nib == 11 ) + { + exp = 0; + + for (;;) + { + /* If we entered this iteration with phase == 4, we need */ + /* to read a new byte. */ + if ( phase ) + { + p++; + + /* Make sure we don't read past the end. */ + if ( p >= limit ) + goto Bad; + } + + /* Get the nibble. */ + nib = ( p[0] >> phase ) & 0xF; + phase = 4 - phase; + if ( nib >= 10 ) + break; + + exp = exp * 10 + nib; + } + + if ( exp_sign ) + exp = -exp; + + power_ten += exp; + } + + /* raise to power of ten if needed */ + while ( power_ten > 0 ) + { + result = result * 10; + num = num * 10; + + power_ten--; + } + + while ( power_ten < 0 ) + { + result = result / 10; + divider = divider * 10; + + power_ten++; + } + + /* Move the integer part into the high 16 bits. */ + result <<= 16; + + /* Place the decimal part into the low 16 bits. */ + if ( num ) + result |= FT_DivFix( num, divider ); + + if ( sign ) + result = -result; + + Exit: + return result; + + Bad: + result = 0; + goto Exit; + } + + + /* read a number, either integer or real */ + static + FT_Long cff_parse_num( FT_Byte** d ) + { + return ( **d == 30 ? ( cff_parse_real ( d[0], d[1], 0 ) >> 16 ) + : cff_parse_integer( d[0], d[1] ) ); + } + + + /* read a floating point number, either integer or real */ + static + FT_Fixed cff_parse_fixed( FT_Byte** d ) + { + return ( **d == 30 ? cff_parse_real ( d[0], d[1], 0 ) + : cff_parse_integer( d[0], d[1] ) << 16 ); + } + + /* read a floating point number, either integer or real, */ + /* but return 1000 times the number read in. */ + static + FT_Fixed cff_parse_fixed_thousand( FT_Byte** d ) + { + return **d == + 30 ? cff_parse_real ( d[0], d[1], 3 ) + : (FT_Fixed)FT_MulFix( cff_parse_integer( d[0], d[1] ) << 16, 1000 ); + } + + static + FT_Error cff_parse_font_matrix( CFF_Parser* parser ) + { + CFF_Font_Dict* dict = (CFF_Font_Dict*)parser->object; + FT_Matrix* matrix = &dict->font_matrix; + FT_Vector* offset = &dict->font_offset; + FT_UShort* upm = &dict->units_per_em; + FT_Byte** data = parser->stack; + FT_Error error; + FT_Fixed temp; + + + error = CFF_Err_Stack_Underflow; + + if ( parser->top >= parser->stack + 6 ) + { + matrix->xx = cff_parse_fixed_thousand( data++ ); + matrix->yx = cff_parse_fixed_thousand( data++ ); + matrix->xy = cff_parse_fixed_thousand( data++ ); + matrix->yy = cff_parse_fixed_thousand( data++ ); + offset->x = cff_parse_fixed_thousand( data++ ); + offset->y = cff_parse_fixed_thousand( data ); + + temp = ABS( matrix->yy ); + + *upm = (FT_UShort)( FT_DivFix( 0x10000L, + FT_DivFix( temp, 1000 ) ) >> 16 ); + + if ( temp != 0x10000L ) + { + matrix->xx = FT_DivFix( matrix->xx, temp ); + matrix->yx = FT_DivFix( matrix->yx, temp ); + matrix->xy = FT_DivFix( matrix->xy, temp ); + matrix->yy = FT_DivFix( matrix->yy, temp ); + offset->x = FT_DivFix( offset->x, temp ); + offset->y = FT_DivFix( offset->y, temp ); + } + + /* note that the offsets must be expressed in integer font units */ + offset->x >>= 16; + offset->y >>= 16; + + error = CFF_Err_Ok; + } + + return error; + } + + + static + FT_Error cff_parse_font_bbox( CFF_Parser* parser ) + { + CFF_Font_Dict* dict = (CFF_Font_Dict*)parser->object; + FT_BBox* bbox = &dict->font_bbox; + FT_Byte** data = parser->stack; + FT_Error error; + + + error = CFF_Err_Stack_Underflow; + + if ( parser->top >= parser->stack + 4 ) + { + bbox->xMin = FT_RoundFix( cff_parse_fixed( data++ ) ); + bbox->yMin = FT_RoundFix( cff_parse_fixed( data++ ) ); + bbox->xMax = FT_RoundFix( cff_parse_fixed( data++ ) ); + bbox->yMax = FT_RoundFix( cff_parse_fixed( data ) ); + error = CFF_Err_Ok; + } + + return error; + } + + + static + FT_Error cff_parse_private_dict( CFF_Parser* parser ) + { + CFF_Font_Dict* dict = (CFF_Font_Dict*)parser->object; + FT_Byte** data = parser->stack; + FT_Error error; + + + error = CFF_Err_Stack_Underflow; + + if ( parser->top >= parser->stack + 2 ) + { + dict->private_size = cff_parse_num( data++ ); + dict->private_offset = cff_parse_num( data ); + error = CFF_Err_Ok; + } + + return error; + } + + + static + FT_Error cff_parse_cid_ros( CFF_Parser* parser ) + { + CFF_Font_Dict* dict = (CFF_Font_Dict*)parser->object; + FT_Byte** data = parser->stack; + FT_Error error; + + + error = CFF_Err_Stack_Underflow; + + if ( parser->top >= parser->stack + 3 ) + { + dict->cid_registry = (FT_UInt)cff_parse_num ( data++ ); + dict->cid_ordering = (FT_UInt)cff_parse_num ( data++ ); + dict->cid_supplement = (FT_ULong)cff_parse_num( data ); + error = CFF_Err_Ok; + } + + return error; + } + + +#define CFF_FIELD_NUM( code, name ) \ + CFF_FIELD( code, name, cff_kind_num ) +#define CFF_FIELD_FIXED( code, name ) \ + CFF_FIELD( code, name, cff_kind_fixed ) +#define CFF_FIELD_STRING( code, name ) \ + CFF_FIELD( code, name, cff_kind_string ) +#define CFF_FIELD_BOOL( code, name ) \ + CFF_FIELD( code, name, cff_kind_bool ) +#define CFF_FIELD_DELTA( code, name, max ) \ + CFF_FIELD( code, name, cff_kind_delta ) + +#define CFF_FIELD_CALLBACK( code, name ) \ + { \ + cff_kind_callback, \ + code | CFFCODE, \ + 0, 0, \ + cff_parse_ ## name, \ + 0, 0 \ + }, + +#undef CFF_FIELD +#define CFF_FIELD( code, name, kind ) \ + { \ + kind, \ + code | CFFCODE, \ + FT_FIELD_OFFSET( name ), \ + FT_FIELD_SIZE( name ), \ + 0, 0, 0 \ + }, + +#undef CFF_FIELD_DELTA +#define CFF_FIELD_DELTA( code, name, max ) \ + { \ + cff_kind_delta, \ + code | CFFCODE, \ + FT_FIELD_OFFSET( name ), \ + FT_FIELD_SIZE_DELTA( name ), \ + 0, \ + max, \ + FT_FIELD_OFFSET( num_ ## name ) \ + }, + +#define CFFCODE_TOPDICT 0x1000 +#define CFFCODE_PRIVATE 0x2000 + + static const CFF_Field_Handler cff_field_handlers[] = + { + +#include "cfftoken.h" + + { 0, 0, 0, 0, 0, 0, 0 } + }; + + + FT_LOCAL_DEF + FT_Error CFF_Parser_Run( CFF_Parser* parser, + FT_Byte* start, + FT_Byte* limit ) + { + FT_Byte* p = start; + FT_Error error = CFF_Err_Ok; + + + parser->top = parser->stack; + parser->start = start; + parser->limit = limit; + parser->cursor = start; + + while ( p < limit ) + { + FT_Byte v = *p; + + + if ( v >= 27 && v != 31 ) + { + /* it's a number; we will push its position on the stack */ + if ( parser->top - parser->stack >= CFF_MAX_STACK_DEPTH ) + goto Stack_Overflow; + + *parser->top ++ = p; + + /* now, skip it */ + if ( v == 30 ) + { + /* skip real number */ + p++; + for (;;) + { + if ( p >= limit ) + goto Syntax_Error; + v = p[0] >> 4; + if ( v == 15 ) + break; + v = p[0] & 0xF; + if ( v == 15 ) + break; + p++; + } + } + else if ( v == 28 ) + p += 2; + else if ( v == 29 ) + p += 4; + else if ( v > 246 ) + p += 1; + } + else + { + /* This is not a number, hence it's an operator. Compute its code */ + /* and look for it in our current list. */ + + FT_UInt code; + FT_UInt num_args = (FT_UInt) + ( parser->top - parser->stack ); + const CFF_Field_Handler* field; + + + /* first of all, a trivial check */ + if ( num_args < 1 ) + goto Stack_Underflow; + + *parser->top = p; + code = v; + if ( v == 12 ) + { + /* two byte operator */ + p++; + code = 0x100 | p[0]; + } + code = code | parser->object_code; + + for ( field = cff_field_handlers; field->kind; field++ ) + { + if ( field->code == (FT_Int)code ) + { + /* we found our field's handler; read it */ + FT_Long val; + FT_Byte* q = (FT_Byte*)parser->object + field->offset; + + + switch ( field->kind ) + { + case cff_kind_bool: + case cff_kind_string: + case cff_kind_num: + val = cff_parse_num( parser->stack ); + goto Store_Number; + + case cff_kind_fixed: + val = cff_parse_fixed( parser->stack ); + + Store_Number: + switch ( field->size ) + { + case 1: + *(FT_Byte*)q = (FT_Byte)val; + break; + + case 2: + *(FT_Short*)q = (FT_Short)val; + break; + + case 4: + *(FT_Int32*)q = (FT_Int)val; + break; + + default: /* for 64-bit systems where long is 8 bytes */ + *(FT_Long*)q = val; + } + break; + + case cff_kind_delta: + { + FT_Byte* qcount = (FT_Byte*)parser->object + + field->count_offset; + + FT_Byte** data = parser->stack; + + + if ( num_args > field->array_max ) + num_args = field->array_max; + + /* store count */ + *qcount = (FT_Byte)num_args; + + val = 0; + while ( num_args > 0 ) + { + val += cff_parse_num( data++ ); + switch ( field->size ) + { + case 1: + *(FT_Byte*)q = (FT_Byte)val; + break; + + case 2: + *(FT_Short*)q = (FT_Short)val; + break; + + case 4: + *(FT_Int32*)q = (FT_Int)val; + break; + + default: /* for 64-bit systems */ + *(FT_Long*)q = val; + } + + q += field->size; + num_args--; + } + } + break; + + default: /* callback */ + error = field->reader( parser ); + if ( error ) + goto Exit; + } + goto Found; + } + } + + /* this is an unknown operator, or it is unsupported; */ + /* we will ignore it for now. */ + + Found: + /* clear stack */ + parser->top = parser->stack; + } + p++; + } + + Exit: + return error; + + Stack_Overflow: + error = CFF_Err_Invalid_Argument; + goto Exit; + + Stack_Underflow: + error = CFF_Err_Invalid_Argument; + goto Exit; + + Syntax_Error: + error = CFF_Err_Invalid_Argument; + goto Exit; + } + + +/* END */ diff --git a/xc/extras/freetype2/src/cff/cffparse.h b/xc/extras/freetype2/src/cff/cffparse.h new file mode 100644 index 000000000..aa78a9d9f --- /dev/null +++ b/xc/extras/freetype2/src/cff/cffparse.h @@ -0,0 +1,69 @@ +/***************************************************************************/ +/* */ +/* cffparse.h */ +/* */ +/* CFF token stream parser (specification) */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __CFF_PARSE_H__ +#define __CFF_PARSE_H__ + + +#include <ft2build.h> +#include FT_INTERNAL_CFF_TYPES_H +#include FT_INTERNAL_OBJECTS_H + + +FT_BEGIN_HEADER + + +#define CFF_MAX_STACK_DEPTH 96 + +#define CFF_CODE_TOPDICT 0x1000 +#define CFF_CODE_PRIVATE 0x2000 + + + typedef struct CFF_Parser_ + { + FT_Byte* start; + FT_Byte* limit; + FT_Byte* cursor; + + FT_Byte* stack[CFF_MAX_STACK_DEPTH + 1]; + FT_Byte** top; + + FT_UInt object_code; + void* object; + + } CFF_Parser; + + + FT_LOCAL + void CFF_Parser_Init( CFF_Parser* parser, + FT_UInt code, + void* object ); + + FT_LOCAL + FT_Error CFF_Parser_Run( CFF_Parser* parser, + FT_Byte* start, + FT_Byte* limit ); + + +FT_END_HEADER + + +#endif /* __CFF_PARSE_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/src/cff/cfftoken.h b/xc/extras/freetype2/src/cff/cfftoken.h new file mode 100644 index 000000000..ab4fd8ee2 --- /dev/null +++ b/xc/extras/freetype2/src/cff/cfftoken.h @@ -0,0 +1,97 @@ +/***************************************************************************/ +/* */ +/* cfftoken.h */ +/* */ +/* CFF token definitions */ +/* */ +/* Copyright 1996-2000 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#undef FT_STRUCTURE +#define FT_STRUCTURE CFF_Font_Dict + +#undef CFFCODE +#define CFFCODE CFFCODE_TOPDICT + + CFF_FIELD_STRING ( 0, version ) + CFF_FIELD_STRING ( 1, notice ) + CFF_FIELD_STRING ( 0x100, copyright ) + CFF_FIELD_STRING ( 2, full_name ) + CFF_FIELD_STRING ( 3, family_name ) + CFF_FIELD_STRING ( 4, weight ) + CFF_FIELD_BOOL ( 0x101, is_fixed_pitch ) + CFF_FIELD_FIXED ( 0x102, italic_angle ) + CFF_FIELD_NUM ( 0x103, underline_position ) + CFF_FIELD_NUM ( 0x104, underline_thickness ) + CFF_FIELD_NUM ( 0x105, paint_type ) + CFF_FIELD_NUM ( 0x106, charstring_type ) + CFF_FIELD_CALLBACK( 0x107, font_matrix ) + CFF_FIELD_NUM ( 13, unique_id ) + CFF_FIELD_CALLBACK( 5, font_bbox ) + CFF_FIELD_NUM ( 0x108, stroke_width ) + CFF_FIELD_NUM ( 15, charset_offset ) + CFF_FIELD_NUM ( 16, encoding_offset ) + CFF_FIELD_NUM ( 17, charstrings_offset ) + CFF_FIELD_CALLBACK( 18, private_dict ) + CFF_FIELD_NUM ( 0x114, synthetic_base ) + CFF_FIELD_STRING ( 0x115, postscript ) + CFF_FIELD_STRING ( 0x116, base_font_name ) + +#if 0 + CFF_FIELD_DELTA ( 0x117, base_font_blend, 16 ) + CFF_FIELD_CALLBACK( 0x118, multiple_master ) + CFF_FIELD_CALLBACK( 0x119, blend_axit_types ) +#endif + + CFF_FIELD_CALLBACK( 0x11E, cid_ros ) + CFF_FIELD_NUM ( 0x11F, cid_font_version ) + CFF_FIELD_NUM ( 0x120, cid_font_revision ) + CFF_FIELD_NUM ( 0x121, cid_font_type ) + CFF_FIELD_NUM ( 0x122, cid_count ) + CFF_FIELD_NUM ( 0x123, cid_uid_base ) + CFF_FIELD_NUM ( 0x124, cid_fd_array_offset ) + CFF_FIELD_NUM ( 0x125, cid_fd_select_offset ) + CFF_FIELD_STRING ( 0x126, cid_font_name ) + +#if 0 + CFF_FIELD_NUM ( 0x127, chameleon ) +#endif + + +#undef FT_STRUCTURE +#define FT_STRUCTURE CFF_Private +#undef CFFCODE +#define CFFCODE CFFCODE_PRIVATE + + CFF_FIELD_DELTA( 6, blue_values, 14 ) + CFF_FIELD_DELTA( 7, other_blues, 10 ) + CFF_FIELD_DELTA( 8, family_blues, 14 ) + CFF_FIELD_DELTA( 9, family_other_blues, 10 ) + CFF_FIELD_FIXED( 0x109, blue_scale ) + CFF_FIELD_NUM ( 0x10A, blue_shift ) + CFF_FIELD_NUM ( 0x10B, blue_fuzz ) + CFF_FIELD_NUM ( 10, standard_width ) + CFF_FIELD_NUM ( 11, standard_height ) + CFF_FIELD_DELTA( 0x10C, snap_widths, 13 ) + CFF_FIELD_DELTA( 0x10D, snap_heights, 13 ) + CFF_FIELD_BOOL ( 0x10E, force_bold ) + CFF_FIELD_FIXED( 0x10F, force_bold_threshold ) + CFF_FIELD_NUM ( 0x110, lenIV ) + CFF_FIELD_NUM ( 0x111, language_group ) + CFF_FIELD_FIXED( 0x112, expansion_factor ) + CFF_FIELD_NUM ( 0x113, initial_random_seed ) + CFF_FIELD_NUM ( 19, local_subrs_offset ) + CFF_FIELD_NUM ( 20, default_width ) + CFF_FIELD_NUM ( 21, nominal_width ) + + +/* END */ diff --git a/xc/extras/freetype2/src/cff/descrip.mms b/xc/extras/freetype2/src/cff/descrip.mms new file mode 100644 index 000000000..b4a99d196 --- /dev/null +++ b/xc/extras/freetype2/src/cff/descrip.mms @@ -0,0 +1,23 @@ +# +# FreeType 2 OpenType/CFF driver compilation rules for VMS +# + + +# Copyright 2001 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.cff]) + +OBJS=cff.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/cff/rules.mk b/xc/extras/freetype2/src/cff/rules.mk index ba87af5f1..f87634f62 100644 --- a/xc/extras/freetype2/src/cff/rules.mk +++ b/xc/extras/freetype2/src/cff/rules.mk @@ -15,55 +15,55 @@ # OpenType driver directory # -T2_DIR := $(SRC_)cff -T2_DIR_ := $(T2_DIR)$(SEP) +CFF_DIR := $(SRC_)cff +CFF_DIR_ := $(CFF_DIR)$(SEP) -T2_COMPILE := $(FT_COMPILE) +CFF_COMPILE := $(FT_COMPILE) $I$(CFF_DIR) -# T2 driver sources (i.e., C files) +# CFF driver sources (i.e., C files) # -T2_DRV_SRC := $(T2_DIR_)t2objs.c \ - $(T2_DIR_)t2load.c \ - $(T2_DIR_)t2gload.c \ - $(T2_DIR_)t2parse.c \ - $(T2_DIR_)t2driver.c +CFF_DRV_SRC := $(CFF_DIR_)cffobjs.c \ + $(CFF_DIR_)cffload.c \ + $(CFF_DIR_)cffgload.c \ + $(CFF_DIR_)cffparse.c \ + $(CFF_DIR_)cffdrivr.c -# T2 driver headers +# CFF driver headers # -T2_DRV_H := $(T2_DRV_SRC:%.c=%.h) \ - $(T2_DIR_)t2tokens.h +CFF_DRV_H := $(CFF_DRV_SRC:%.c=%.h) \ + $(CFF_DIR_)cfftoken.h -# T2 driver object(s) +# CFF driver object(s) # -# T2_DRV_OBJ_M is used during `multi' builds -# T2_DRV_OBJ_S is used during `single' builds +# CFF_DRV_OBJ_M is used during `multi' builds +# CFF_DRV_OBJ_S is used during `single' builds # -T2_DRV_OBJ_M := $(T2_DRV_SRC:$(T2_DIR_)%.c=$(OBJ_)%.$O) -T2_DRV_OBJ_S := $(OBJ_)cff.$O +CFF_DRV_OBJ_M := $(CFF_DRV_SRC:$(CFF_DIR_)%.c=$(OBJ_)%.$O) +CFF_DRV_OBJ_S := $(OBJ_)cff.$O -# T2 driver source file for single build +# CFF driver source file for single build # -T2_DRV_SRC_S := $(T2_DIR_)cff.c +CFF_DRV_SRC_S := $(CFF_DIR_)cff.c -# T2 driver - single object +# CFF driver - single object # -$(T2_DRV_OBJ_S): $(T2_DRV_SRC_S) $(T2_DRV_SRC) $(FREETYPE_H) $(T2_DRV_H) - $(T2_COMPILE) $T$@ $(T2_DRV_SRC_S) +$(CFF_DRV_OBJ_S): $(CFF_DRV_SRC_S) $(CFF_DRV_SRC) $(FREETYPE_H) $(CFF_DRV_H) + $(CFF_COMPILE) $T$@ $(CFF_DRV_SRC_S) -# T2 driver - multiple objects +# CFF driver - multiple objects # -$(OBJ_)%.$O: $(T2_DIR_)%.c $(FREETYPE_H) $(T2_DRV_H) - $(T2_COMPILE) $T$@ $< +$(OBJ_)%.$O: $(CFF_DIR_)%.c $(FREETYPE_H) $(CFF_DRV_H) + $(CFF_COMPILE) $T$@ $< # update main driver object lists # -DRV_OBJS_S += $(T2_DRV_OBJ_S) -DRV_OBJS_M += $(T2_DRV_OBJ_M) +DRV_OBJS_S += $(CFF_DRV_OBJ_S) +DRV_OBJS_M += $(CFF_DRV_OBJ_M) # EOF diff --git a/xc/extras/freetype2/src/cid/cidgload.c b/xc/extras/freetype2/src/cid/cidgload.c index a86519bb9..27327840e 100644 --- a/xc/extras/freetype2/src/cid/cidgload.c +++ b/xc/extras/freetype2/src/cid/cidgload.c @@ -16,22 +16,12 @@ /***************************************************************************/ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "cidload.h" #include "cidgload.h" - -#else - -#include <cid/cidload.h> -#include <cid/cidgload.h> - -#endif - - -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftstream.h> -#include <freetype/ftoutln.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_OUTLINE_H /*************************************************************************/ @@ -79,7 +69,6 @@ CID_FontDict* dict; CID_Subrs* cid_subrs = face->subrs + fd_select; FT_Byte* charstring; - FT_UInt lenIV; FT_Memory memory = face->root.memory; @@ -90,10 +79,10 @@ /* setup font matrix */ dict = cid->font_dicts + fd_select; - lenIV = dict->private_dict.lenIV; decoder->font_matrix = dict->font_matrix; decoder->font_offset = dict->font_offset; + decoder->lenIV = dict->private_dict.lenIV; /* the charstrings are encoded (stupid!) */ /* load the charstrings, then execute it */ @@ -103,10 +92,19 @@ if ( !FILE_Read_At( cid->data_offset + off1, charstring, glyph_len ) ) { - cid_decrypt( charstring, glyph_len, 4330 ); + FT_Int cs_offset; + + + /* Adjustment for seed bytes. */ + cs_offset = ( decoder->lenIV >= 0 ? decoder->lenIV : 0 ); + + /* Decrypt only if lenIV >= 0. */ + if ( decoder->lenIV >= 0 ) + cid_decrypt( charstring, glyph_len, 4330 ); + error = decoder->funcs.parse_charstrings( decoder, - charstring + lenIV, - glyph_len - lenIV ); + charstring + cs_offset, + glyph_len - cs_offset ); } FREE( charstring ); diff --git a/xc/extras/freetype2/src/cid/cidgload.h b/xc/extras/freetype2/src/cid/cidgload.h index 5fadc8fbc..44aed0f66 100644 --- a/xc/extras/freetype2/src/cid/cidgload.h +++ b/xc/extras/freetype2/src/cid/cidgload.h @@ -16,24 +16,15 @@ /***************************************************************************/ -#ifndef CIDGLOAD_H -#define CIDGLOAD_H +#ifndef __CIDGLOAD_H__ +#define __CIDGLOAD_H__ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "cidobjs.h" -#else - -#include <cid/cidobjs.h> - -#endif - -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER #if 0 @@ -52,12 +43,9 @@ FT_Int load_flags ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* CIDGLOAD_H */ +#endif /* __CIDGLOAD_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/cid/cidload.c b/xc/extras/freetype2/src/cid/cidload.c index 4c01d4e15..06bdffe50 100644 --- a/xc/extras/freetype2/src/cid/cidload.c +++ b/xc/extras/freetype2/src/cid/cidload.c @@ -16,25 +16,14 @@ /***************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/config/ftconfig.h> -#include <freetype/ftmm.h> - -#include <freetype/internal/t1types.h> -#include <freetype/internal/t1errors.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_CONFIG_CONFIG_H +#include FT_MULTIPLE_MASTERS_H +#include FT_INTERNAL_TYPE1_TYPES_H +#include FT_INTERNAL_TYPE1_ERRORS_H #include "cidload.h" -#else - -#include <cid/cidload.h> - -#endif - - #include <stdio.h> #include <ctype.h> /* for isspace(), isalnum() */ @@ -171,15 +160,15 @@ FT_Error parse_font_bbox( CID_Face face, CID_Parser* parser ) { - FT_Short temp[4]; + FT_Fixed temp[4]; FT_BBox* bbox = &face->cid.font_bbox; - (void)CID_ToCoordArray( parser, 4, temp ); - bbox->xMin = temp[0]; - bbox->yMin = temp[1]; - bbox->xMax = temp[2]; - bbox->yMax = temp[3]; + (void)CID_ToFixedArray( parser, 4, temp, 0 ); + bbox->xMin = FT_RoundFix( temp[0] ); + bbox->yMin = FT_RoundFix( temp[1] ); + bbox->xMax = FT_RoundFix( temp[2] ); + bbox->yMax = FT_RoundFix( temp[3] ); return T1_Err_Ok; /* this is a callback function; */ /* we must return an error code */ @@ -193,7 +182,9 @@ FT_Matrix* matrix; FT_Vector* offset; CID_FontDict* dict; + FT_Face root = (FT_Face)&face->root; FT_Fixed temp[6]; + FT_Fixed temp_scale; if ( parser->num_dict >= 0 ) @@ -204,14 +195,22 @@ (void)CID_ToFixedArray( parser, 6, temp, 3 ); + temp_scale = ABS( temp[3] ); + + /* Set Units per EM based on FontMatrix values. We set the value to */ + /* `1000/temp_scale', because temp_scale was already multiplied by */ + /* 1000 (in t1_tofixed(), from psobjs.c). */ + root->units_per_EM = (FT_UShort)( FT_DivFix( 0x10000L, + FT_DivFix( temp_scale, 1000 ) ) >> 16 ); + /* we need to scale the values by 1.0/temp[3] */ - if ( temp[3] != 0x10000L ) + if ( temp_scale != 0x10000L ) { - temp[0] = FT_DivFix( temp[0], temp[3] ); - temp[1] = FT_DivFix( temp[1], temp[3] ); - temp[2] = FT_DivFix( temp[2], temp[3] ); - temp[4] = FT_DivFix( temp[4], temp[3] ); - temp[5] = FT_DivFix( temp[5], temp[3] ); + temp[0] = FT_DivFix( temp[0], temp_scale ); + temp[1] = FT_DivFix( temp[1], temp_scale ); + temp[2] = FT_DivFix( temp[2], temp_scale ); + temp[4] = FT_DivFix( temp[4], temp_scale ); + temp[5] = FT_DivFix( temp[5], temp_scale ); temp[3] = 0x10000L; } @@ -272,16 +271,8 @@ const T1_Field cid_field_records[] = { -#ifdef FT_FLAT_COMPILE - #include "cidtokens.h" -#else - -#include <cid/cidtokens.h> - -#endif - T1_FIELD_CALLBACK( "FontBBox", parse_font_bbox ) T1_FIELD_CALLBACK( "FDArray", parse_fd_array ) T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix ) @@ -343,7 +334,7 @@ while ( cur2 < limit && is_alpha( *cur2 ) ) cur2++; - len = cur2 - cur; + len = (FT_Int)( cur2 - cur ); if ( len > 0 && len < 22 ) { /* now compare the immediate name to the keyword table */ @@ -414,7 +405,8 @@ subr = face->subrs; for ( n = 0; n < cid->num_dicts; n++, subr++ ) { - CID_FontDict* dict = cid->font_dicts + n; + CID_FontDict* dict = cid->font_dicts + n; + FT_Int lenIV = dict->private_dict.lenIV; FT_UInt count, num_subrs = dict->num_subrs; FT_ULong data_len; FT_Byte* p; @@ -465,14 +457,17 @@ subr->code[count] = subr->code[count - 1] + len; } - /* decrypt subroutines */ - for ( count = 0; count < num_subrs; count++ ) + /* decrypt subroutines, but only if lenIV >= 0 */ + if ( lenIV >= 0 ) { - FT_UInt len; + for ( count = 0; count < num_subrs; count++ ) + { + FT_UInt len; - len = offsets[count + 1] - offsets[count]; - cid_decrypt( subr->code[count], len, 4330 ); + len = offsets[count + 1] - offsets[count]; + cid_decrypt( subr->code[count], len, 4330 ); + } } subr->num_subrs = num_subrs; diff --git a/xc/extras/freetype2/src/cid/cidload.h b/xc/extras/freetype2/src/cid/cidload.h index 2f089d1f6..cbd223536 100644 --- a/xc/extras/freetype2/src/cid/cidload.h +++ b/xc/extras/freetype2/src/cid/cidload.h @@ -16,25 +16,16 @@ /***************************************************************************/ -#ifndef CIDLOAD_H -#define CIDLOAD_H +#ifndef __CIDLOAD_H__ +#define __CIDLOAD_H__ -#include <freetype/internal/ftstream.h> - -#ifdef FT_FLAT_COMPILE +#include <ft2build.h> +#include FT_INTERNAL_STREAM_H #include "cidparse.h" -#else - -#include <cid/cidparse.h> - -#endif - -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER typedef struct CID_Loader_ @@ -58,12 +49,9 @@ FT_Error CID_Open_Face( CID_Face face ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* CIDLOAD_H */ +#endif /* __CIDLOAD_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/cid/cidobjs.c b/xc/extras/freetype2/src/cid/cidobjs.c index 9966c8afa..a191ceca9 100644 --- a/xc/extras/freetype2/src/cid/cidobjs.c +++ b/xc/extras/freetype2/src/cid/cidobjs.c @@ -16,25 +16,13 @@ /***************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftstream.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H #include "cidgload.h" #include "cidload.h" - -#else - -#include <cid/cidgload.h> -#include <cid/cidload.h> - -#endif - - -#include <freetype/internal/psnames.h> -#include <freetype/internal/psaux.h> +#include FT_INTERNAL_POSTSCRIPT_NAMES_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H /*************************************************************************/ @@ -43,8 +31,8 @@ /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ /* messages during execution. */ /* */ -#undef FT_COMPONENT -#define FT_COMPONENT trace_cidobjs +#undef FT_COMPONENT +#define FT_COMPONENT trace_cidobjs /*************************************************************************/ @@ -234,9 +222,11 @@ root->available_sizes = 0; root->bbox = face->cid.font_bbox; - root->units_per_EM = 1000; - root->ascender = (FT_Short)face->cid.font_bbox.yMax; - root->descender = (FT_Short)face->cid.font_bbox.yMin; + if ( !root->units_per_EM ) + root->units_per_EM = 1000; + + root->ascender = (FT_Short)( face->cid.font_bbox.yMax >> 16 ); + root->descender = (FT_Short)( face->cid.font_bbox.yMin >> 16 ); root->height = ( ( root->ascender + root->descender ) * 12 ) / 10; diff --git a/xc/extras/freetype2/src/cid/cidobjs.h b/xc/extras/freetype2/src/cid/cidobjs.h index 5566b1f27..4b4baaf95 100644 --- a/xc/extras/freetype2/src/cid/cidobjs.h +++ b/xc/extras/freetype2/src/cid/cidobjs.h @@ -16,18 +16,18 @@ /***************************************************************************/ -#ifndef CIDOBJS_H -#define CIDOBJS_H +#ifndef __CIDOBJS_H__ +#define __CIDOBJS_H__ -#include <freetype/internal/ftobjs.h> -#include <freetype/config/ftconfig.h> -#include <freetype/internal/t1errors.h> -#include <freetype/internal/t1types.h> +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H +#include FT_CONFIG_CONFIG_H +#include FT_INTERNAL_TYPE1_ERRORS_H +#include FT_INTERNAL_TYPE1_TYPES_H -#ifdef __cplusplus - extern "C" { -#endif + +FT_BEGIN_HEADER /* The following structures must be defined by the hinter */ @@ -130,12 +130,9 @@ void CID_Done_Driver( CID_Driver driver ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* CIDOBJS_H */ +#endif /* __CIDOBJS_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/cid/cidparse.c b/xc/extras/freetype2/src/cid/cidparse.c index 4a4b5aa0b..6f0b2ca06 100644 --- a/xc/extras/freetype2/src/cid/cidparse.c +++ b/xc/extras/freetype2/src/cid/cidparse.c @@ -16,24 +16,14 @@ /***************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftcalc.h> -#include <freetype/internal/ftobjs.h> -#include <freetype/internal/ftstream.h> -#include <freetype/internal/t1errors.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_CALC_H +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_TYPE1_ERRORS_H #include "cidparse.h" -#else - -#include <cid/cidparse.h> - -#endif - - #include <string.h> /* for strncmp() */ @@ -119,7 +109,7 @@ if ( p[0] == 'S' && strncmp( (char*)p, "StartData", 9 ) == 0 ) { /* save offset of binary data after `StartData' */ - offset = top_position - ( limit - p ) + 10; + offset = (FT_ULong)( top_position - ( limit - p ) + 10 ); goto Found; } } diff --git a/xc/extras/freetype2/src/cid/cidparse.h b/xc/extras/freetype2/src/cid/cidparse.h index d6c06ab50..c6aaa3ed7 100644 --- a/xc/extras/freetype2/src/cid/cidparse.h +++ b/xc/extras/freetype2/src/cid/cidparse.h @@ -16,16 +16,17 @@ /***************************************************************************/ -#ifndef CIDPARSE_H -#define CIDPARSE_H +#ifndef __CIDPARSE_H__ +#define __CIDPARSE_H__ -#include <freetype/internal/t1types.h> -#include <freetype/internal/ftstream.h> -#include <freetype/internal/psaux.h> -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> +#include FT_INTERNAL_TYPE1_TYPES_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H + + +FT_BEGIN_HEADER /*************************************************************************/ @@ -107,12 +108,9 @@ (p)->root.funcs.load_field_table( &(p)->root, f, o, 0, 0 ) -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* CIDPARSE_H */ +#endif /* __CIDPARSE_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/cid/cidriver.c b/xc/extras/freetype2/src/cid/cidriver.c index 8641bf76d..c86f0a2e6 100644 --- a/xc/extras/freetype2/src/cid/cidriver.c +++ b/xc/extras/freetype2/src/cid/cidriver.c @@ -16,22 +16,12 @@ /***************************************************************************/ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "cidriver.h" #include "cidgload.h" - -#else - -#include <cid/cidriver.h> -#include <cid/cidgload.h> - -#endif - - -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftstream.h> -#include <freetype/internal/psnames.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include <string.h> /* for strcmp() */ diff --git a/xc/extras/freetype2/src/cid/cidriver.h b/xc/extras/freetype2/src/cid/cidriver.h index 2dec2f317..134cbb59b 100644 --- a/xc/extras/freetype2/src/cid/cidriver.h +++ b/xc/extras/freetype2/src/cid/cidriver.h @@ -16,25 +16,24 @@ /***************************************************************************/ -#ifndef CIDRIVER_H -#define CIDRIVER_H +#ifndef __CIDRIVER_H__ +#define __CIDRIVER_H__ -#include <freetype/internal/ftdriver.h> -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> +#include FT_INTERNAL_DRIVER_H + + +FT_BEGIN_HEADER FT_CALLBACK_TABLE const FT_Driver_Class t1cid_driver_class; -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* CIDRIVER_H */ +#endif /* __CIDRIVER_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/cid/descrip.mms b/xc/extras/freetype2/src/cid/descrip.mms new file mode 100644 index 000000000..1502e422a --- /dev/null +++ b/xc/extras/freetype2/src/cid/descrip.mms @@ -0,0 +1,23 @@ +# +# FreeType 2 CID driver compilation rules for VMS +# + + +# Copyright 2001 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.cid]) + +OBJS=type1cid.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/cid/rules.mk b/xc/extras/freetype2/src/cid/rules.mk index cbaaec768..d7ab02660 100644 --- a/xc/extras/freetype2/src/cid/rules.mk +++ b/xc/extras/freetype2/src/cid/rules.mk @@ -19,7 +19,7 @@ CID_DIR := $(SRC_)cid CID_DIR_ := $(CID_DIR)$(SEP) -CID_COMPILE := $(FT_COMPILE) +CID_COMPILE := $(FT_COMPILE) $I$(CID_DIR) # CID driver sources (i.e., C files) diff --git a/xc/extras/freetype2/src/cid/type1cid.c b/xc/extras/freetype2/src/cid/type1cid.c index d26aee26f..852eca18c 100644 --- a/xc/extras/freetype2/src/cid/type1cid.c +++ b/xc/extras/freetype2/src/cid/type1cid.c @@ -1,6 +1,6 @@ /***************************************************************************/ /* */ -/* cff.c */ +/* type1cid.c */ /* */ /* FreeType OpenType driver component (body only). */ /* */ @@ -18,23 +18,12 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "cidparse.c" #include "cidload.c" #include "cidobjs.c" #include "cidriver.c" #include "cidgload.c" -#else - -#include <cid/cidparse.c> -#include <cid/cidload.c> -#include <cid/cidobjs.c> -#include <cid/cidriver.c> -#include <cid/cidgload.c> - -#endif - /* END */ diff --git a/xc/extras/freetype2/src/pcf/descrip.mms b/xc/extras/freetype2/src/pcf/descrip.mms new file mode 100644 index 000000000..c9dd63864 --- /dev/null +++ b/xc/extras/freetype2/src/pcf/descrip.mms @@ -0,0 +1,35 @@ +# +# FreeType 2 pcf driver compilation rules for VMS +# + + +# Copyright (C) 2001 by +# Francesco Zappa Nardelli +# +# 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 THE +# AUTHORS OR COPYRIGHT HOLDERS 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. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.pcf]) + +OBJS=pcf.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/pcf/module.mk b/xc/extras/freetype2/src/pcf/module.mk new file mode 100644 index 000000000..614c31920 --- /dev/null +++ b/xc/extras/freetype2/src/pcf/module.mk @@ -0,0 +1,32 @@ +# +# FreeType 2 PCF module definition +# + +# Copyright 2000 by +# Francesco Zappa Nardelli +# +# 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 THE +# AUTHORS OR COPYRIGHT HOLDERS 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. + +make_module_list: add_pcf_driver + +add_pcf_driver: + $(OPEN_DRIVER)pcf_driver_class$(CLOSE_DRIVER) + $(ECHO_DRIVER)pcf $(ECHO_DRIVER_DESC)pcf bitmap fonts$(ECHO_DRIVER_DONE) + +# EOF diff --git a/xc/extras/freetype2/src/pcf/pcf.c b/xc/extras/freetype2/src/pcf/pcf.c new file mode 100644 index 000000000..ccd1ead9c --- /dev/null +++ b/xc/extras/freetype2/src/pcf/pcf.c @@ -0,0 +1,36 @@ +/* pcf.c + + FreeType font driver for pcf fonts + + Copyright 2000 by + Francesco Zappa Nardelli + +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 THE +AUTHORS OR COPYRIGHT HOLDERS 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. +*/ + + +#define FT_MAKE_OPTION_SINGLE_OBJECT + + +#include <ft2build.h> +#include "pcfutil.c" +#include "pcfread.c" +#include "pcfdriver.c" + +/* END */ diff --git a/xc/extras/freetype2/src/pcf/pcf.h b/xc/extras/freetype2/src/pcf/pcf.h new file mode 100644 index 000000000..af1d8fe0c --- /dev/null +++ b/xc/extras/freetype2/src/pcf/pcf.h @@ -0,0 +1,239 @@ +/* pcf.h + + FreeType font driver for pcf fonts + + Copyright (C) 2000 by + Francesco Zappa Nardelli + +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 THE +AUTHORS OR COPYRIGHT HOLDERS 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. +*/ + + +#ifndef __PCF_H__ +#define __PCF_H__ + + +#include <ft2build.h> +#include FT_INTERNAL_DRIVER_H + + +FT_BEGIN_HEADER + + typedef struct PCF_TableRec_ + { + FT_ULong type; + FT_ULong format; + FT_ULong size; + FT_ULong offset; + + } PCF_TableRec, *PCF_Table; + + + typedef struct PCF_TocRec_ + { + FT_ULong version; + FT_ULong count; + PCF_Table tables; + + } PCF_TocRec, *PCF_Toc; + + + typedef struct PCF_ParseProperty_ + { + FT_Long name; + FT_Byte isString; + FT_Long value; + + } PCF_ParsePropertyRec, *PCF_ParseProperty; + + + typedef struct PCF_Property_ + { + FT_String* name; + FT_Byte isString; + + union + { + FT_String* atom; + FT_Long integer; + FT_ULong cardinal; + + } value; + + } PCF_PropertyRec, *PCF_Property; + + + typedef struct PCF_Compressed_Metric_ + { + FT_Byte leftSideBearing; + FT_Byte rightSideBearing; + FT_Byte characterWidth; + FT_Byte ascent; + FT_Byte descent; + + } PCF_Compressed_MetricRec, *PCF_Compressed_Metric; + + + typedef struct PCF_Metric_ + { + FT_Short leftSideBearing; + FT_Short rightSideBearing; + FT_Short characterWidth; + FT_Short ascent; + FT_Short descent; + FT_Short attributes; + FT_ULong bits; + + } PCF_MetricRec, *PCF_Metric; + + + typedef struct PCF_AccelRec_ + { + FT_Byte noOverlap; + FT_Byte constantMetrics; + FT_Byte terminalFont; + FT_Byte constantWidth; + FT_Byte inkInside; + FT_Byte inkMetrics; + FT_Byte drawDirection; + FT_Long fontAscent; + FT_Long fontDescent; + FT_Long maxOverlap; + PCF_MetricRec minbounds; + PCF_MetricRec maxbounds; + PCF_MetricRec ink_minbounds; + PCF_MetricRec ink_maxbounds; + + } PCF_AccelRec, *PCF_Accel; + + + typedef struct PCD_Encoding_ + { + FT_Long enc; + FT_Short glyph; + + } PCF_EncodingRec, *PCF_Encoding; + + + typedef struct PCF_FaceRec_ + { + FT_FaceRec root; + + char* charset_encoding; + char* charset_registry; + + PCF_TocRec toc; + PCF_AccelRec accel; + + int nprops; + PCF_Property properties; + + FT_Long nmetrics; + PCF_Metric metrics; + FT_Long nencodings; + PCF_Encoding encodings; + + FT_Short defaultChar; + + FT_ULong bitmapsFormat; + + FT_CharMap charmap_handle; + FT_CharMapRec charmap; /* a single charmap per face */ + + } PCF_FaceRec, *PCF_Face; + + + /* XXX hack */ + static + FT_Error PCF_Done_Face( PCF_Face face ); + + + /* macros for pcf font format */ + +#define LSBFirst 0 +#define MSBFirst 1 + +#define PCF_FILE_VERSION ( ( 'p' << 24 ) | \ + ( 'c' << 16 ) | \ + ( 'f' << 8 ) | 1 ) +#define PCF_FORMAT_MASK 0xFFFFFF00L + +#define PCF_DEFAULT_FORMAT 0x00000000L +#define PCF_INKBOUNDS 0x00000200L +#define PCF_ACCEL_W_INKBOUNDS 0x00000100L +#define PCF_COMPRESSED_METRICS 0x00000100L + +#define PCF_FORMAT_MATCH( a, b ) \ + ( ( (a) & PCF_FORMAT_MASK ) == ( (b) & PCF_FORMAT_MASK ) ) + +#define PCF_GLYPH_PAD_MASK ( 3 << 0 ) +#define PCF_BYTE_MASK ( 1 << 2 ) +#define PCF_BIT_MASK ( 1 << 3 ) +#define PCF_SCAN_UNIT_MASK ( 3 << 4 ) + +#define PCF_BYTE_ORDER( f ) \ + ( ( (f) & PCF_BYTE_MASK ) ? MSBFirst : LSBFirst ) +#define PCF_BIT_ORDER( f ) \ + ( ( (f) & PCF_BIT_MASK ) ? MSBFirst : LSBFirst ) +#define PCF_GLYPH_PAD_INDEX( f ) \ + ( (f) & PCF_GLYPH_PAD_MASK ) +#define PCF_GLYPH_PAD( f ) \ + ( 1 << PCF_GLYPH_PAD_INDEX( f ) ) +#define PCF_SCAN_UNIT_INDEX( f ) \ + ( ( (f) & PCF_SCAN_UNIT_MASK ) >> 4 ) +#define PCF_SCAN_UNIT( f ) \ + ( 1 << PCF_SCAN_UNIT_INDEX( f ) ) +#define PCF_FORMAT_BITS( f ) \ + ( (f) & ( PCF_GLYPH_PAD_MASK | \ + PCF_BYTE_MASK | \ + PCF_BIT_MASK | \ + PCF_SCAN_UNIT_MASK ) ) + +#define PCF_SIZE_TO_INDEX( s ) ( (s) == 4 ? 2 : (s) == 2 ? 1 : 0 ) +#define PCF_INDEX_TO_SIZE( b ) ( 1 << b ) + +#define PCF_FORMAT( bit, byte, glyph, scan ) \ + ( ( PCF_SIZE_TO_INDEX( scan ) << 4 ) | \ + ( ( (bit) == MSBFirst ? 1 : 0 ) << 3 ) | \ + ( ( (byte) == MSBFirst ? 1 : 0 ) << 2 ) | \ + ( PCF_SIZE_TO_INDEX( glyph ) << 0 ) ) + +#define PCF_PROPERTIES ( 1 << 0 ) +#define PCF_ACCELERATORS ( 1 << 1 ) +#define PCF_METRICS ( 1 << 2 ) +#define PCF_BITMAPS ( 1 << 3 ) +#define PCF_INK_METRICS ( 1 << 4 ) +#define PCF_BDF_ENCODINGS ( 1 << 5 ) +#define PCF_SWIDTHS ( 1 << 6 ) +#define PCF_GLYPH_NAMES ( 1 << 7 ) +#define PCF_BDF_ACCELERATORS ( 1 << 8 ) + +#define GLYPHPADOPTIONS 4 /* I'm not sure about this */ + + FT_LOCAL + FT_Error pcf_load_font( FT_Stream, + PCF_Face ); + + +FT_END_HEADER + +#endif /* __PCF_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/src/pcf/pcfdriver.c b/xc/extras/freetype2/src/pcf/pcfdriver.c new file mode 100644 index 000000000..59e7dc3b2 --- /dev/null +++ b/xc/extras/freetype2/src/pcf/pcfdriver.c @@ -0,0 +1,343 @@ +/* pcfdriver.c + + FreeType font driver for pcf files + + Copyright (C) 2000 by + Francesco Zappa Nardelli + +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 THE +AUTHORS OR COPYRIGHT HOLDERS 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. +*/ + + +#include <ft2build.h> + +#include FT_ERRORS_H +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_OBJECTS_H + +#include "pcf.h" +#include "pcfdriver.h" +#include "pcfutil.h" + + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_pcfdriver + + + static + FT_Error PCF_Done_Face( PCF_Face face ) + { + FT_Memory memory = FT_FACE_MEMORY( face ); + PCF_Property tmp = face->properties; + int i; + + + FREE( face->encodings ); + FREE( face->metrics ); + + for ( i = 0; i < face->nprops; i++ ) + { + FREE( tmp->name ); + if ( tmp->isString ) + FREE( tmp->value ); + } + FREE( face->properties ); + + FT_TRACE4(( "DONE_FACE!!!\n" )); + + return FT_Err_Ok; + } + + + static + FT_Error PCF_Init_Face( FT_Stream stream, + PCF_Face face, + FT_Int face_index, + FT_Int num_params, + FT_Parameter* params ) + { + FT_Error error = FT_Err_Ok; + + FT_UNUSED( num_params ); + FT_UNUSED( params ); + FT_UNUSED( face_index ); + + + error = pcf_load_font( stream, face ); + if ( error ) + goto Fail; + + return FT_Err_Ok; + + Fail: + FT_TRACE2(( "[not a valid PCF file]\n" )); + PCF_Done_Face( face ); + + return FT_Err_Unknown_File_Format; /* error */ + } + + + static + FT_Error PCF_Set_Pixel_Size( FT_Size size ) + { + PCF_Face face = (PCF_Face)FT_SIZE_FACE( size ); + + + FT_TRACE4(( "rec %d - pres %d\n", size->metrics.y_ppem, + face->root.available_sizes->height )); + + if ( size->metrics.y_ppem == face->root.available_sizes->height ) + { + size->metrics.ascender = face->accel.fontAscent << 6; + size->metrics.descender = face->accel.fontDescent * (-64); +#if 0 + size->metrics.height = face->accel.maxbounds.ascent << 6; +#endif + size->metrics.height = size->metrics.ascender - + size->metrics.descender; + + return FT_Err_Ok; + } + else + { + FT_TRACE4(( "size WRONG\n" )); + return FT_Err_Invalid_Pixel_Size; + } + } + + + static + FT_Error PCF_Load_Glyph( FT_GlyphSlot slot, + FT_Size size, + FT_UInt glyph_index, + FT_Int load_flags ) + { + PCF_Face face = (PCF_Face)FT_SIZE_FACE( size ); + FT_Error error = FT_Err_Ok; + FT_Memory memory = FT_FACE(face)->memory; + FT_Bitmap* bitmap = &slot->bitmap; + PCF_Metric metric; + int bytes; + + FT_Stream stream = face->root.stream; + + FT_UNUSED( load_flags ); + + + FT_TRACE4(( "load_glyph %d ---", glyph_index )); + + if ( !face ) + { + error = FT_Err_Invalid_Argument; + goto Exit; + } + + metric = face->metrics + glyph_index; + + bitmap->rows = metric->ascent + metric->descent; + bitmap->width = metric->characterWidth; + bitmap->num_grays = 1; + bitmap->pixel_mode = ft_pixel_mode_mono; + + FT_TRACE6(( "BIT_ORDER %d ; BYTE_ORDER %d ; GLYPH_PAD %d\n", + PCF_BIT_ORDER( face->bitmapsFormat ), + PCF_BYTE_ORDER( face->bitmapsFormat ), + PCF_GLYPH_PAD( face->bitmapsFormat ) )); + + switch ( PCF_GLYPH_PAD( face->bitmapsFormat ) ) + { + case 1: + bitmap->pitch = ( bitmap->width + 7 ) >> 3; + break; + + case 2: + bitmap->pitch = ( ( bitmap->width + 15 ) >> 4 ) << 1; + break; + + case 4: + bitmap->pitch = ( ( bitmap->width + 31 ) >> 5 ) << 2; + break; + + case 8: + bitmap->pitch = ( ( bitmap->width + 63 ) >> 6 ) << 3; + break; + + default: + return FT_Err_Invalid_File_Format; + } + + /* XXX: to do: are there cases that need repadding the bitmap? */ + bytes = bitmap->pitch * bitmap->rows; + + if ( ALLOC( bitmap->buffer, bytes ) ) + goto Exit; + + if ( FILE_Seek( metric->bits ) || + FILE_Read( bitmap->buffer, bytes ) ) + goto Exit; + + if ( PCF_BIT_ORDER( face->bitmapsFormat ) != MSBFirst ) + BitOrderInvert( bitmap->buffer,bytes ); + + if ( ( PCF_BYTE_ORDER( face->bitmapsFormat ) != + PCF_BIT_ORDER( face->bitmapsFormat ) ) ) + { + switch ( PCF_SCAN_UNIT( face->bitmapsFormat ) ) + { + case 1: + break; + + case 2: + TwoByteSwap( bitmap->buffer, bytes ); + break; + + case 4: + FourByteSwap( bitmap->buffer, bytes ); + break; + } + } + + slot->bitmap_left = 0; + slot->bitmap_top = metric->ascent; + + slot->metrics.horiAdvance = metric->characterWidth << 6 ; + slot->metrics.horiBearingX = metric->rightSideBearing << 6 ; + slot->metrics.horiBearingY = metric->ascent << 6 ; + slot->metrics.width = metric->characterWidth << 6 ; + slot->metrics.height = bitmap->rows << 6; + + slot->linearHoriAdvance = (FT_Fixed)bitmap->width << 16; + slot->format = ft_glyph_format_bitmap; + slot->flags = ft_glyph_own_bitmap; + + FT_TRACE4(( " --- ok\n" )); + + Exit: + return error; + } + + + static + FT_UInt PCF_Get_Char_Index( FT_CharMap charmap, + FT_Long char_code ) + { + PCF_Face face = (PCF_Face)charmap->face; + PCF_Encoding en_table = face->encodings; + int low, high, mid; + + + FT_TRACE4(( "get_char_index %ld\n", char_code )); + + low = 0; + high = face->nencodings - 1; + while ( low <= high ) + { + mid = ( low + high ) / 2; + if ( char_code < en_table[mid].enc ) + high = mid - 1; + else if ( char_code > en_table[mid].enc ) + low = mid + 1; + else + return en_table[mid].glyph; + } + + return face->defaultChar; + } + + + FT_CALLBACK_TABLE_DEF + const FT_Driver_Class pcf_driver_class = + { + { + ft_module_font_driver, + sizeof ( FT_DriverRec ), + + "pcf", + 0x10000L, + 0x20000L, + + 0, + + (FT_Module_Constructor)0, + (FT_Module_Destructor) 0, + (FT_Module_Requester) 0 + }, + + sizeof( PCF_FaceRec ), + sizeof( FT_SizeRec ), + sizeof( FT_GlyphSlotRec ), + + (FTDriver_initFace) PCF_Init_Face, + (FTDriver_doneFace) PCF_Done_Face, + (FTDriver_initSize) 0, + (FTDriver_doneSize) 0, + (FTDriver_initGlyphSlot)0, + (FTDriver_doneGlyphSlot)0, + + (FTDriver_setCharSizes) PCF_Set_Pixel_Size, + (FTDriver_setPixelSizes)PCF_Set_Pixel_Size, + + (FTDriver_loadGlyph) PCF_Load_Glyph, + (FTDriver_getCharIndex) PCF_Get_Char_Index, + + (FTDriver_getKerning) 0, + (FTDriver_attachFile) 0, + (FTDriver_getAdvances) 0 + }; + + +#ifdef FT_CONFIG_OPTION_DYNAMIC_DRIVERS + + + /*************************************************************************/ + /* */ + /* <Function> */ + /* getDriverClass */ + /* */ + /* <Description> */ + /* This function is used when compiling the TrueType driver as a */ + /* shared library (`.DLL' or `.so'). It will be used by the */ + /* high-level library of FreeType to retrieve the address of the */ + /* driver's generic interface. */ + /* */ + /* It shouldn't be implemented in a static build, as each driver must */ + /* have the same function as an exported entry point. */ + /* */ + /* <Return> */ + /* The address of the TrueType's driver generic interface. The */ + /* format-specific interface can then be retrieved through the method */ + /* interface->get_format_interface. */ + /* */ + FT_EXPORT_DEF( const FT_Driver_Class* ) getDriverClass( void ) + { + return &pcf_driver_class; + } + + +#endif /* FT_CONFIG_OPTION_DYNAMIC_DRIVERS */ + + +/* END */ diff --git a/xc/extras/freetype2/src/pcf/pcfdriver.h b/xc/extras/freetype2/src/pcf/pcfdriver.h new file mode 100644 index 000000000..676a9c467 --- /dev/null +++ b/xc/extras/freetype2/src/pcf/pcfdriver.h @@ -0,0 +1,44 @@ +/* pcfdriver.h + + FreeType font driver for pcf fonts + + Copyright 2000 by + Francesco Zappa Nardelli + +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 THE +AUTHORS OR COPYRIGHT HOLDERS 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. +*/ + + +#ifndef __PCFDRIVER_H__ +#define __PCFDRIVER_H__ + +#include <ft2build.h> +#include FT_INTERNAL_DRIVER_H + +FT_BEGIN_HEADER + + FT_EXPORT_VAR( const FT_Driver_Class ) pcf_driver_class; + +FT_END_HEADER + + +#endif /* __PCFDRIVER_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/src/pcf/pcfread.c b/xc/extras/freetype2/src/pcf/pcfread.c new file mode 100644 index 000000000..ca38ca731 --- /dev/null +++ b/xc/extras/freetype2/src/pcf/pcfread.c @@ -0,0 +1,1058 @@ +/* pcfread.c + + FreeType font driver for pcf fonts + + Copyright 2000 by + Francesco Zappa Nardelli + +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 THE +AUTHORS OR COPYRIGHT HOLDERS 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. +*/ + + +#include <ft2build.h> + +#include FT_ERRORS_H +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_OBJECTS_H + +#include "pcf.h" +#include "pcfdriver.h" + +#include <string.h> /* strlen(), strcpy() */ + + /*************************************************************************/ + /* */ + /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ + /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ + /* messages during execution. */ + /* */ +#undef FT_COMPONENT +#define FT_COMPONENT trace_pcfread + + +#if defined( FT_DEBUG_LEVEL_TRACE ) + static char* tableNames[] = + { + "prop", "accl", "mtrcs", "bmps", "imtrcs", + "enc", "swidth", "names", "accel" + }; +#endif + + + static + const FT_Frame_Field pcf_toc_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_TocRec + + FT_FRAME_START( 8 ), + FT_FRAME_ULONG_LE( version ), + FT_FRAME_ULONG_LE( count ), + FT_FRAME_END + }; + + + static + const FT_Frame_Field pcf_table_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_TableRec + + FT_FRAME_START( 16 ), + FT_FRAME_ULONG_LE( type ), + FT_FRAME_ULONG_LE( format ), + FT_FRAME_ULONG_LE( size ), + FT_FRAME_ULONG_LE( offset ), + FT_FRAME_END + }; + + + static + FT_Error pcf_read_TOC( FT_Stream stream, + PCF_Face face ) + { + FT_Error error; + PCF_Toc toc = &face->toc; + PCF_Table tables; + + FT_Memory memory = FT_FACE(face)->memory; + unsigned int i; + + + if ( FILE_Seek ( 0 ) || + READ_Fields ( pcf_toc_header, toc ) ) + return FT_Err_Cannot_Open_Resource; + + if ( toc->version != PCF_FILE_VERSION ) + return FT_Err_Invalid_File_Format; + + if ( ALLOC( face->toc.tables, toc->count * sizeof ( PCF_TableRec ) ) ) + return FT_Err_Out_Of_Memory; + + tables = face->toc.tables; + for ( i = 0; i < toc->count; i++ ) + { + if ( READ_Fields( pcf_table_header, tables ) ) + goto Exit; + tables++; + } + +#if defined( FT_DEBUG_LEVEL_TRACE ) + + { + unsigned int i,j; + char* name = "?"; + + + FT_TRACE4(( "Tables count: %ld\n", face->toc.count )); + tables = face->toc.tables; + for ( i = 0; i < toc->count; i++ ) + { + for( j = 0; j < sizeof ( tableNames ) / sizeof ( tableNames[0] ); j++ ) + if ( tables[i].type == (unsigned int)( 1 << j ) ) + name=tableNames[j]; + FT_TRACE4(( "Table %d: type=%-6s format=0x%04lX " + "size=0x%06lX (%8ld) offset=0x%04lX\n", + i, name, + tables[i].format, + tables[i].size, tables[i].size, + tables[i].offset )); + } + } + +#endif + + return FT_Err_Ok; + + Exit: + FREE( face->toc.tables ); + return error; + } + + + static + const FT_Frame_Field pcf_metric_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_MetricRec + + FT_FRAME_START( 12 ), + FT_FRAME_SHORT_LE( leftSideBearing ), + FT_FRAME_SHORT_LE( rightSideBearing ), + FT_FRAME_SHORT_LE( characterWidth ), + FT_FRAME_SHORT_LE( ascent ), + FT_FRAME_SHORT_LE( descent ), + FT_FRAME_SHORT_LE( attributes ), + FT_FRAME_END + }; + + + static + const FT_Frame_Field pcf_metric_msb_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_MetricRec + + FT_FRAME_START( 12 ), + FT_FRAME_SHORT( leftSideBearing ), + FT_FRAME_SHORT( rightSideBearing ), + FT_FRAME_SHORT( characterWidth ), + FT_FRAME_SHORT( ascent ), + FT_FRAME_SHORT( descent ), + FT_FRAME_SHORT( attributes ), + FT_FRAME_END + }; + + + static + const FT_Frame_Field pcf_compressed_metric_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_Compressed_MetricRec + + FT_FRAME_START( 5 ), + FT_FRAME_BYTE( leftSideBearing ), + FT_FRAME_BYTE( rightSideBearing ), + FT_FRAME_BYTE( characterWidth ), + FT_FRAME_BYTE( ascent ), + FT_FRAME_BYTE( descent ), + FT_FRAME_END + }; + + + static + FT_Error pcf_parse_metric( FT_Stream stream, + const FT_Frame_Field* header, + PCF_Metric metric ) + { + FT_Error error = FT_Err_Ok; + + + if ( READ_Fields( header, metric ) ) + return error; + + return FT_Err_Ok; + } + + + static + FT_Error pcf_parse_compressed_metric( FT_Stream stream, + PCF_Metric metric ) + { + PCF_Compressed_MetricRec compr_metric; + FT_Error error = FT_Err_Ok; + + + if ( READ_Fields( pcf_compressed_metric_header, &compr_metric ) ) + return error; + + metric->leftSideBearing = (FT_Short)compr_metric.leftSideBearing - 0x80; + metric->rightSideBearing = (FT_Short)compr_metric.rightSideBearing - 0x80; + metric->characterWidth = (FT_Short)compr_metric.characterWidth - 0x80; + metric->ascent = (FT_Short)compr_metric.ascent - 0x80; + metric->descent = (FT_Short)compr_metric.descent - 0x80; + metric->attributes = 0; + + return FT_Err_Ok; + } + + + static + FT_Error pcf_get_metric( FT_Stream stream, + FT_ULong format, + PCF_Metric metric ) + { + FT_Error error = FT_Err_Ok; + + + if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) + { + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + error = pcf_parse_metric( stream, pcf_metric_msb_header, metric ); + else + error = pcf_parse_metric( stream, pcf_metric_header, metric ); + } + else + error = pcf_parse_compressed_metric( stream, metric ); + + return error; + } + + + static + FT_Error pcfSeekToType( FT_Stream stream, + PCF_Table tables, + int ntables, + FT_ULong type, + FT_ULong* formatp, + FT_ULong* sizep ) + { + FT_Error error; + int i; + + + for ( i = 0; i < ntables; i++ ) + if ( tables[i].type == type ) + { + if ( stream->pos > tables[i].offset ) + return FT_Err_Invalid_Stream_Skip; + if ( FILE_Skip( tables[i].offset - stream->pos ) ) + return FT_Err_Invalid_Stream_Skip; + *sizep = tables[i].size; /* unused - to be removed */ + *formatp = tables[i].format; + return FT_Err_Ok; + } + + return FT_Err_Invalid_File_Format; + } + + + static + FT_Bool pcfHasType( PCF_Table tables, + int ntables, + FT_ULong type ) + { + int i; + + + for ( i = 0; i < ntables; i++ ) + if ( tables[i].type == type ) + return TRUE; + + return FALSE; + } + + + static + const FT_Frame_Field pcf_property_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_ParsePropertyRec + + FT_FRAME_START( 9 ), + FT_FRAME_LONG_LE( name ), + FT_FRAME_BYTE ( isString ), + FT_FRAME_LONG_LE( value ), + FT_FRAME_END + }; + + + static + const FT_Frame_Field pcf_property_msb_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_ParsePropertyRec + + FT_FRAME_START( 9 ), + FT_FRAME_LONG( name ), + FT_FRAME_BYTE( isString ), + FT_FRAME_LONG( value ), + FT_FRAME_END + }; + + + static + PCF_Property find_property( PCF_Face face, + const FT_String* prop ) + { + PCF_Property properties = face->properties; + FT_Bool found = 0; + int i; + + + for ( i = 0 ; i < face->nprops && !found; i++ ) + { + if ( !strcmp( properties[i].name, prop ) ) + found = 1; + } + + if ( found ) + return properties + i - 1; + else + return NULL; + } + + + static + FT_Error pcf_get_properties( FT_Stream stream, + PCF_Face face ) + { + PCF_ParseProperty props = 0; + PCF_Property properties = 0; + int nprops, i; + FT_ULong format, size; + FT_Error error; + FT_Memory memory = FT_FACE(face)->memory; + FT_ULong string_size; + FT_String* strings = 0; + + + error = pcfSeekToType( stream, + face->toc.tables, + face->toc.count, + PCF_PROPERTIES, + &format, + &size ); + if ( error ) + goto Bail; + + if ( READ_ULongLE( format ) ) + goto Bail; + + FT_TRACE4(( "get_prop: format = %ld\n", format )); + + if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) + goto Bail; + + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + (void)READ_ULong( nprops ); + else + (void)READ_ULongLE( nprops ); + if ( error ) + goto Bail; + + FT_TRACE4(( "get_prop: nprop = %d\n", nprops )); + + if ( ALLOC( props, nprops * sizeof ( PCF_ParsePropertyRec ) ) ) + goto Bail; + + for ( i = 0; i < nprops; i++ ) + { + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + { + if ( READ_Fields( pcf_property_msb_header, props + i ) ) + goto Bail; + } + else + { + if ( READ_Fields( pcf_property_header, props + i ) ) + goto Bail; + } + } + + /* pad the property array */ + /* */ + /* clever here - nprops is the same as the number of odd-units read, */ + /* as only isStringProp are odd length (Keith Packard) */ + /* */ + if ( nprops & 3 ) + { + i = 4 - ( nprops & 3 ); + FT_Skip_Stream( stream, i ); + } + + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + (void)READ_ULong( string_size ); + else + (void)READ_ULongLE( string_size ); + if ( error ) + goto Bail; + + FT_TRACE4(( "get_prop: string_size = %ld\n", string_size )); + + if ( ALLOC( strings, string_size * sizeof ( char ) ) ) + goto Bail; + + error = FT_Read_Stream( stream, (FT_Byte*)strings, string_size ); + if ( error ) + goto Bail; + + if ( ALLOC( properties, nprops * sizeof ( PCF_PropertyRec ) ) ) + goto Bail; + + for ( i = 0; i < nprops; i++ ) + { + /* XXX: make atom */ + if ( ALLOC( properties[i].name, + ( strlen( strings + props[i].name ) + 1 ) * + sizeof ( char ) ) ) + goto Bail; + strcpy( properties[i].name,strings + props[i].name ); + + properties[i].isString = props[i].isString; + + if ( props[i].isString ) + { + if ( ALLOC( properties[i].value.atom, + ( strlen( strings + props[i].value ) + 1 ) * + sizeof ( char ) ) ) + goto Bail; + strcpy( properties[i].value.atom, strings + props[i].value ); + } + else + properties[i].value.integer = props[i].value; + } + + face->properties = properties; + face->nprops = nprops; + + FREE( props ); + FREE( strings ); + + return FT_Err_Ok; + + Bail: + FREE( props ); + FREE( strings ); + + return error; + } + + + static + FT_Error pcf_get_metrics( FT_Stream stream, + PCF_Face face ) + { + FT_Error error = FT_Err_Ok; + FT_Memory memory = FT_FACE(face)->memory; + FT_ULong format = 0; + FT_ULong size = 0; + PCF_Metric metrics = 0; + int i; + int nmetrics = -1; + + + error = pcfSeekToType( stream, + face->toc.tables, + face->toc.count, + PCF_METRICS, + &format, + &size ); + if ( error ) + return error; + + error = READ_ULongLE( format ); + + if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) && + !PCF_FORMAT_MATCH( format, PCF_COMPRESSED_METRICS ) ) + return FT_Err_Invalid_File_Format; + + if ( PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) + { + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + (void)READ_ULong( nmetrics ); + else + (void)READ_ULongLE( nmetrics ); + } + else + { + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + (void)READ_UShort( nmetrics ); + else + (void)READ_UShortLE( nmetrics ); + } + if ( error || nmetrics == -1 ) + return FT_Err_Invalid_File_Format; + + face->nmetrics = nmetrics; + + if ( ALLOC( face->metrics, nmetrics * sizeof ( PCF_MetricRec ) ) ) + return FT_Err_Out_Of_Memory; + + metrics = face->metrics; + for ( i = 0; i < nmetrics; i++ ) + { + pcf_get_metric( stream, format, metrics + i ); + + metrics[i].bits = 0; + + FT_TRACE4(( "%d : width=%d, " + "lsb=%d, rsb=%d, ascent=%d, descent=%d, swidth=%d\n", + i, + ( metrics + i )->characterWidth, + ( metrics + i )->leftSideBearing, + ( metrics + i )->rightSideBearing, + ( metrics + i )->ascent, + ( metrics + i )->descent, + ( metrics + i )->attributes )); + + if ( error ) + break; + } + + if ( error ) + FREE( face->metrics ); + return error; + } + + + static + FT_Error pcf_get_bitmaps( FT_Stream stream, + PCF_Face face ) + { + FT_Error error = FT_Err_Ok; + FT_Memory memory = FT_FACE(face)->memory; + FT_Long* offsets; + FT_Long bitmapSizes[GLYPHPADOPTIONS]; + FT_ULong format, size; + int nbitmaps, i, sizebitmaps; + char* bitmaps; + + + error = pcfSeekToType( stream, + face->toc.tables, + face->toc.count, + PCF_BITMAPS, + &format, + &size ); + if ( error ) + return error; + + error = FT_Access_Frame( stream, 8 ); + if ( error ) + return error; + format = GET_ULongLE(); + if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) + return FT_Err_Invalid_File_Format; + + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + nbitmaps = GET_ULong(); + else + nbitmaps = GET_ULongLE(); + FT_Forget_Frame( stream ); + if ( nbitmaps != face->nmetrics ) + return FT_Err_Invalid_File_Format; + + if ( ALLOC( offsets, nbitmaps * sizeof ( FT_ULong ) ) ) + return error; + + if ( error ) + goto Bail; + for ( i = 0; i < nbitmaps; i++ ) + { + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + (void)READ_Long( offsets[i] ); + else + (void)READ_LongLE( offsets[i] ); + + FT_TRACE4(( "bitmap %d is at offset %ld\n", i, offsets[i] )); + } + if ( error ) + goto Bail; + + if ( error ) + goto Bail; + for ( i = 0; i < GLYPHPADOPTIONS; i++ ) + { + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + (void)READ_Long( bitmapSizes[i] ); + else + (void)READ_LongLE( bitmapSizes[i] ); + if ( error ) + goto Bail; + + sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX( format )]; + + FT_TRACE4(( "padding %d implies a size of %ld\n", i, bitmapSizes[i] )); + } + + FT_TRACE4(( " %d bitmaps, padding index %ld\n", + nbitmaps, + PCF_GLYPH_PAD_INDEX( format ) )); + FT_TRACE4(( "bitmap size = %d\n", sizebitmaps )); + + for ( i = 0; i < nbitmaps; i++ ) + face->metrics[i].bits = stream->pos + offsets[i]; + + face->bitmapsFormat = format; + + FREE ( offsets ); + return error; + + Bail: + FREE ( offsets ); + FREE ( bitmaps ); + return error; + } + + + static + FT_Error pcf_get_encodings( FT_Stream stream, + PCF_Face face ) + { + FT_Error error = FT_Err_Ok; + FT_Memory memory = FT_FACE(face)->memory; + FT_ULong format, size; + int firstCol, lastCol; + int firstRow, lastRow; + int nencoding, encodingOffset; + int i, j; + PCF_Encoding tmpEncoding, encoding = 0; + + + error = pcfSeekToType( stream, + face->toc.tables, + face->toc.count, + PCF_BDF_ENCODINGS, + &format, + &size ); + if ( error ) + return error; + + error = FT_Access_Frame( stream, 14 ); + if ( error ) + return error; + format = GET_ULongLE(); + if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) + return FT_Err_Invalid_File_Format; + + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + { + firstCol = GET_Short(); + lastCol = GET_Short(); + firstRow = GET_Short(); + lastRow = GET_Short(); + face->defaultChar = GET_Short(); + } + else + { + firstCol = GET_ShortLE(); + lastCol = GET_ShortLE(); + firstRow = GET_ShortLE(); + lastRow = GET_ShortLE(); + face->defaultChar = GET_ShortLE(); + } + + FT_Forget_Frame( stream ); + + FT_TRACE4(( "enc: firstCol %d, lastCol %d, firstRow %d, lastRow %d\n", + firstCol, lastCol, firstRow, lastRow )); + + nencoding = ( lastCol - firstCol + 1 ) * ( lastRow - firstRow + 1 ); + + if ( ALLOC( tmpEncoding, nencoding * sizeof ( PCF_EncodingRec ) ) ) + return FT_Err_Out_Of_Memory; + + error = FT_Access_Frame( stream, 2 * nencoding ); + if ( error ) + goto Bail; + + for ( i = 0, j = 0 ; i < nencoding; i++ ) + { + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + encodingOffset = GET_Short(); + else + encodingOffset = GET_ShortLE(); + + if ( encodingOffset != 0xFFFF ) + { + tmpEncoding[j].enc = ( ( ( i / ( lastCol - firstCol + 1 ) ) + + firstRow ) * 256 ) + + ( ( i % ( lastCol - firstCol + 1 ) ) + + firstCol ); + + tmpEncoding[j].glyph = encodingOffset; + j++; + } + + FT_TRACE4(( "enc n. %d ; Uni %ld ; Glyph %d\n", + i, tmpEncoding[j - 1].enc, encodingOffset )); + } + FT_Forget_Frame( stream ); + + if ( ALLOC( encoding, (--j) * sizeof ( PCF_EncodingRec ) ) ) + goto Bail; + + for ( i = 0; i < j; i++ ) + { + encoding[i].enc = tmpEncoding[i].enc; + encoding[i].glyph = tmpEncoding[i].glyph; + } + + face->nencodings = j; + face->encodings = encoding; + FREE( tmpEncoding ); + + return error; + + Bail: + FREE( encoding ); + FREE( tmpEncoding ); + return error; + } + + + static + const FT_Frame_Field pcf_accel_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_AccelRec + + FT_FRAME_START( 20 ), + FT_FRAME_BYTE ( noOverlap ), + FT_FRAME_BYTE ( constantMetrics ), + FT_FRAME_BYTE ( terminalFont ), + FT_FRAME_BYTE ( constantWidth ), + FT_FRAME_BYTE ( inkInside ), + FT_FRAME_BYTE ( inkMetrics ), + FT_FRAME_BYTE ( drawDirection ), + FT_FRAME_SKIP_BYTES( 1 ), + FT_FRAME_LONG_LE ( fontAscent ), + FT_FRAME_LONG_LE ( fontDescent ), + FT_FRAME_LONG_LE ( maxOverlap ), + FT_FRAME_END + }; + + + static + const FT_Frame_Field pcf_accel_msb_header[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE PCF_AccelRec + + FT_FRAME_START( 20 ), + FT_FRAME_BYTE ( noOverlap ), + FT_FRAME_BYTE ( constantMetrics ), + FT_FRAME_BYTE ( terminalFont ), + FT_FRAME_BYTE ( constantWidth ), + FT_FRAME_BYTE ( inkInside ), + FT_FRAME_BYTE ( inkMetrics ), + FT_FRAME_BYTE ( drawDirection ), + FT_FRAME_SKIP_BYTES( 1 ), + FT_FRAME_LONG ( fontAscent ), + FT_FRAME_LONG ( fontDescent ), + FT_FRAME_LONG ( maxOverlap ), + FT_FRAME_END + }; + + + static + FT_Error pcf_get_accel( FT_Stream stream, + PCF_Face face, + FT_ULong type ) + { + FT_ULong format, size; + FT_Error error = FT_Err_Ok; + PCF_Accel accel = &face->accel; + + + error = pcfSeekToType( stream, + face->toc.tables, + face->toc.count, + type, + &format, + &size ); + if ( error ) + goto Bail; + + error = READ_ULongLE( format ); + if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) && + !PCF_FORMAT_MATCH( format, PCF_ACCEL_W_INKBOUNDS ) ) + goto Bail; + + if ( PCF_BYTE_ORDER( format ) == MSBFirst ) + { + if ( READ_Fields( pcf_accel_msb_header, accel ) ) + goto Bail; + } + else + { + if ( READ_Fields( pcf_accel_header, accel ) ) + goto Bail; + } + + error = pcf_get_metric( stream, format, &(accel->minbounds) ); + if ( error ) + goto Bail; + error = pcf_get_metric( stream, format, &(accel->maxbounds) ); + if ( error ) + goto Bail; + + if ( PCF_FORMAT_MATCH( format, PCF_ACCEL_W_INKBOUNDS ) ) + { + error = pcf_get_metric( stream, format, &(accel->ink_minbounds) ); + if ( error ) + goto Bail; + error = pcf_get_metric( stream, format, &(accel->ink_maxbounds) ); + if ( error ) + goto Bail; + } + else + { + accel->ink_minbounds = accel->minbounds; /* I'm not sure about this */ + accel->ink_maxbounds = accel->maxbounds; + } + return error; + + Bail: + return error; + } + + + FT_LOCAL_DEF + FT_Error pcf_load_font( FT_Stream stream, + PCF_Face face ) + { + FT_Error error = FT_Err_Ok; + FT_Memory memory = FT_FACE(face)->memory; + FT_Bool hasBDFAccelerators; + + + error = pcf_read_TOC( stream, face ); + if ( error ) + return error; + + error = pcf_get_properties( stream, face ); + if ( error ) + return error;; + + /* Use the old accelerators if no BDF accelerators are in the file. */ + hasBDFAccelerators = pcfHasType( face->toc.tables, + face->toc.count, + PCF_BDF_ACCELERATORS ); + if ( !hasBDFAccelerators ) + { + error = pcf_get_accel( stream, face, PCF_ACCELERATORS ); + if ( error ) + goto Bail; + } + + /* metrics */ + error = pcf_get_metrics( stream, face ); + if ( error ) + goto Bail; + + /* bitmaps */ + error = pcf_get_bitmaps( stream, face ); + if ( error ) + goto Bail; + + /* encodings */ + error = pcf_get_encodings( stream, face ); + if ( error ) + goto Bail; + + /* BDF style accelerators (i.e. bounds based on encoded glyphs) */ + if ( hasBDFAccelerators ) + { + error = pcf_get_accel( stream, face, PCF_BDF_ACCELERATORS ); + if ( error ) + goto Bail; + } + + /* XXX: TO DO: inkmetrics and glyph_names are missing */ + + /* now construct the face object */ + { + FT_Face root = FT_FACE( face ); + PCF_Property prop; + + + root->num_faces = 1; + root->face_index = 0; + root->face_flags = FT_FACE_FLAG_FIXED_SIZES | + FT_FACE_FLAG_HORIZONTAL | + FT_FACE_FLAG_FAST_GLYPHS; + + if ( face->accel.constantWidth ) + root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH; + + root->style_flags = 0; + prop = find_property( face, "SLANT" ); + if ( prop != NULL ) + if ( prop->isString ) + if ( ( *(prop->value.atom) == 'O' ) || + ( *(prop->value.atom) == 'I' ) ) + root->style_flags |= FT_STYLE_FLAG_ITALIC; + + prop = find_property( face, "WEIGHT_NAME" ); + if ( prop != NULL ) + if ( prop->isString ) + if ( *(prop->value.atom) == 'B' ) + root->style_flags |= FT_STYLE_FLAG_BOLD; + + root->style_name = (char *)"Regular"; + + if ( root->style_flags & FT_STYLE_FLAG_BOLD ) { + if ( root->style_flags & FT_STYLE_FLAG_ITALIC ) + root->style_name = (char *)"Bold Italic"; + else + root->style_name = (char *)"Bold"; + } + else if ( root->style_flags & FT_STYLE_FLAG_ITALIC ) + root->style_name = (char *)"Italic"; + + prop = find_property( face, "FAMILY_NAME" ); + if ( prop != NULL ) + { + if ( prop->isString ) + { + int l = strlen( prop->value.atom ) + 1; + + + if ( ALLOC( root->family_name, l * sizeof ( char ) ) ) + goto Bail; + strcpy( root->family_name, prop->value.atom ); + } + } + else + root->family_name = 0; + + root->num_glyphs = face->nmetrics; + + root->num_fixed_sizes = 1; + if ( ALLOC_ARRAY( root->available_sizes, 1, FT_Bitmap_Size ) ) + goto Bail; + + prop = find_property( face, "PIXEL_SIZE" ); + if ( prop != NULL ) + { + PCF_Property xres = 0, yres = 0; + + + xres = find_property( face, "RESOLUTION_X" ); + yres = find_property( face, "RESOLUTION_Y" ); + if ( ( xres != NULL ) && ( yres != NULL ) ) + { + root->available_sizes->width = + (FT_Short)( prop->value.integer * 75 / xres->value.integer ); + root->available_sizes->height = + (FT_Short)( prop->value.integer * 75 / yres->value.integer ); + } + } + else + { /* XXX */ +#if 0 + printf( "PCF Warning: Pixel Size undefined, assuming 12\n"); +#endif + root->available_sizes->width = 12; + root->available_sizes->height = 12; + } + + /* XXX: charmaps */ + root->charmaps = &face->charmap_handle; + root->num_charmaps = 1; + + { + PCF_Property charset_registry = 0, charset_encoding = 0; + + + charset_registry = find_property( face, "CHARSET_REGISTRY" ); + charset_encoding = find_property( face, "CHARSET_ENCODING" ); + + if ( ( charset_registry != NULL ) && + ( charset_encoding != NULL ) ) + { + if ( ( charset_registry->isString ) && + ( charset_encoding->isString ) ) + { + if ( ALLOC( face->charset_encoding, + ( strlen( charset_encoding->value.atom ) + 1 ) * + sizeof ( char ) ) ) + goto Bail; + if ( ALLOC( face->charset_registry, + ( strlen( charset_registry->value.atom ) + 1 ) * + sizeof ( char ) ) ) + goto Bail; + strcpy( face->charset_registry, charset_registry->value.atom ); + strcpy( face->charset_encoding, charset_encoding->value.atom ); + +#if 0 + if ( !strcmp( charset_registry, "ISO10646" ) ) + { + face->charmap.encoding = ft_encoding_unicode; + face->charmap.platform_id = 3; + face->charmap.encoding_id = 1; + face->charmap.face = root; + face->charmap_handle + + return FT_Err_Ok; + } +#endif + } + } + } + + face->charmap.encoding = ft_encoding_none; + face->charmap.platform_id = 0; + face->charmap.encoding_id = 0; + face->charmap.face = root; + face->charmap_handle = &face->charmap; + root->charmap = face->charmap_handle; + } + return FT_Err_Ok; + + Bail: + PCF_Done_Face( face ); + return FT_Err_Invalid_File_Format; + } + + +/* END */ diff --git a/xc/extras/freetype2/src/pcf/pcfutil.c b/xc/extras/freetype2/src/pcf/pcfutil.c new file mode 100644 index 000000000..466237237 --- /dev/null +++ b/xc/extras/freetype2/src/pcf/pcfutil.c @@ -0,0 +1,211 @@ +/* + +Copyright 1990, 1994, 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/extras/freetype2/src/pcf/pcfutil.c,v 1.1.1.1 2001/05/16 03:45:34 keithp Exp $ */ + +/* + * Author: Keith Packard, MIT X Consortium + */ + + +#include <ft2build.h> +#include "pcfutil.h" + + + /* Utility functions for reformatting font bitmaps */ + + static const unsigned char _reverse_byte[0x100] = + { + 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, + 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, + 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, + 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, + 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, + 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, + 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, + 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, + 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, + 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, + 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, + 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, + 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, + 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, + 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, + 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, + 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, + 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, + 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, + 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, + 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, + 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, + 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, + 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, + 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, + 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, + 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, + 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, + 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, + 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, + 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, + 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff + }; + + /* + * Invert bit order within each BYTE of an array. + */ + + void BitOrderInvert( unsigned char* buf, + int nbytes ) + { + const unsigned char* rev = _reverse_byte; + + + for ( ; --nbytes >= 0; buf++ ) + *buf = rev[*buf]; + } + + + /* + * Invert byte order within each 16-bits of an array. + */ + + void TwoByteSwap( unsigned char* buf, + int nbytes ) + { + unsigned char c; + + + for ( ; nbytes > 0; nbytes -= 2, buf += 2 ) + { + c = buf[0]; + buf[0] = buf[1]; + buf[1] = c; + } + } + + /* + * Invert byte order within each 32-bits of an array. + */ + + void FourByteSwap( unsigned char* buf, + int nbytes ) + { + unsigned char c; + + + for ( ; nbytes > 0; nbytes -= 4, buf += 4 ) + { + c = buf[0]; + buf[0] = buf[3]; + buf[3] = c; + + c = buf[1]; + buf[1] = buf[2]; + buf[2] = c; + } + } + + + /* + * Repad a bitmap. + */ + + int RepadBitmap( char* pSrc, + char* pDst, + unsigned int srcPad, + unsigned int dstPad, + int width, + int height ) + { + int srcWidthBytes, dstWidthBytes; + int row, col; + char *pTmpSrc, *pTmpDst; + + + switch ( srcPad ) + { + case 1: + srcWidthBytes = ( width + 7 ) >> 3; + break; + + case 2: + srcWidthBytes = ( ( width + 15 ) >> 4 ) << 1; + break; + + case 4: + srcWidthBytes = ( ( width + 31 ) >> 5 ) << 2; + break; + + case 8: + srcWidthBytes = ( ( width + 63 ) >> 6 ) << 3; + break; + + default: + return 0; + } + + switch ( dstPad ) + { + case 1: + dstWidthBytes = ( width + 7 ) >> 3; + break; + + case 2: + dstWidthBytes = ( ( width + 15 ) >> 4 ) << 1; + break; + + case 4: + dstWidthBytes = ( ( width + 31 ) >> 5 ) << 2; + break; + + case 8: + dstWidthBytes = ( ( width + 63 ) >> 6 ) << 3; + break; + + default: + return 0; + } + + width = srcWidthBytes; + if ( width > dstWidthBytes ) + width = dstWidthBytes; + + pTmpSrc= pSrc; + pTmpDst= pDst; + + for ( row = 0; row < height; row++ ) + { + for ( col = 0; col < width; col++ ) + *pTmpDst++ = *pTmpSrc++; + + while ( col < dstWidthBytes ) + { + *pTmpDst++ = '\0'; + col++; + } + pTmpSrc += srcWidthBytes - width; + } + + return dstWidthBytes * height; + } + + +/* END */ diff --git a/xc/extras/freetype2/src/pcf/pcfutil.h b/xc/extras/freetype2/src/pcf/pcfutil.h new file mode 100644 index 000000000..3ec33968a --- /dev/null +++ b/xc/extras/freetype2/src/pcf/pcfutil.h @@ -0,0 +1,54 @@ +/* pcfutil.h + + FreeType font driver for pcf fonts + + Copyright 2000 by + Francesco Zappa Nardelli + +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 THE +AUTHORS OR COPYRIGHT HOLDERS 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. +*/ + + +#ifndef __PCFUTIL_H__ +#define __PCFUTIL_H__ + + +#include <ft2build.h> + + + void BitOrderInvert( unsigned char* buf, + int nbytes); + + void TwoByteSwap ( unsigned char* buf, + int nbytes); + + void FourByteSwap ( unsigned char* buf, + int nbytes); + + int RepadBitmap ( char* pSrc, + char* pDst, + unsigned int srcPad, + unsigned int dstPad, + int width, + int height); + +#endif /* __PCFUTIL_H__ */ + + +/* END */ diff --git a/xc/extras/freetype2/src/pcf/readme b/xc/extras/freetype2/src/pcf/readme new file mode 100644 index 000000000..75f49e142 --- /dev/null +++ b/xc/extras/freetype2/src/pcf/readme @@ -0,0 +1,114 @@ + FreeType font driver for PCF fonts + + Francesco Zappa Nardelli + <francesco.zappa.nardelli@ens.fr> + + +Introduction +************ + +PCF (Portable Compiled Format) is a binary bitmap font format, largely used +in X world. This code implements a PCF driver for the FreeType library. +Glyph images are loaded into memory only on demand, thus leading to a small +memory footprint. + +Informations on the PCF font format can only be worked out from +``pcfread.c'', and ``pcfwrite.c'', to be found, for instance, in the XFree86 +(www.xfree86.org) source tree (xc/lib/font/bitmap/). + +Many good bitmap fonts in bdf format come with XFree86: they can be +compiled into the pcf format using the ``bdftopcf'' utility. + + +Supported hardware +****************** + +The driver has been tested on linux/x86 and sunos5.5/sparc. In both +cases the compiler was gcc. When back in Paris, I will test it also +on linux/alpha. + + +Encodings +********* + +The variety of encodings that accompanies pcf fonts appears to encompass the +small set defined in freetype.h. On the other hand, each pcf font defines +two properties that specify encoding and registry. + +I decided to make these two properties directly accessible, leaving to the +client application the work of interpreting them. For instance: + + #include "pcftypes.h" /* include/freetype/internal/pcftypes.h */ + + FT_Face face; + PCF_Public_Face pcfface; + + FT_New_Face( library,..., &face ); + + pcfface = (PCF_Public_Face)face; + + if ((pcfface->charset_registry == "ISO10646") && + (pcfface->charset_encoding) == "1")) [..] + +Thus the driver always export ``ft_encoding_none'' as +face->charmap.encoding. FT_Get_Char_Index() behavior is unmodified, that +is, it converts the ULong value given as argument into the corresponding +glyph number. + + +Known problems +************** + +- dealing explicitly with encodings breaks the uniformity of freetype2 + api. + +- except for encodings properties, client applications have no + visibility of the PCF_Face object. This means that applications + cannot directly access font tables and are obliged to trust + FreeType. + +- currently, glyph names and ink_metrics are ignored. + +I plan to give full visibility of the PCF_Face object in the next +release of the driver, thus implementing also glyph names and +ink_metrics. + +- height is defined as (ascent - descent). Is this correct? + +- if unable to read size informations from the font, PCF_Init_Face + sets available_size->width and available_size->height to 12. + +- too many english grammar errors in the readme file :-( + + +License +******* + +Copyright (C) 2000 by Francesco Zappa Nardelli + +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 THE AUTHORS OR COPYRIGHT HOLDERS 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. + + +Credits +******* + +Keith Packard wrote the pcf driver found in XFree86. His work is at +the same time the specification and the sample implementation of the +PCF format. Undoubtedly, this driver is inspired from his work. diff --git a/xc/extras/freetype2/src/pcf/rules.mk b/xc/extras/freetype2/src/pcf/rules.mk new file mode 100644 index 000000000..67a0dce2e --- /dev/null +++ b/xc/extras/freetype2/src/pcf/rules.mk @@ -0,0 +1,79 @@ +# +# FreeType 2 pcf driver configuration rules +# + + +# Copyright (C) 2000 by +# Francesco Zappa Nardelli +# +# 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 THE +# AUTHORS OR COPYRIGHT HOLDERS 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. + + +# pcf driver directory +# +PCF_DIR := $(SRC_)pcf +PCF_DIR_ := $(PCF_DIR)$(SEP) + + +PCF_COMPILE := $(FT_COMPILE) $I$(PCF_DIR) + + +# pcf driver sources (i.e., C files) +# +PCF_DRV_SRC := $(PCF_DIR_)pcfread.c \ + $(PCF_DIR_)pcfdriver.c \ + $(PCF_DIR_)pcfutil.c + +# pcf driver headers +# +PCF_DRV_H := $(PCF_DIR_)pcf.h \ + $(PCF_DIR_)pcfdriver.h \ + $(PCF_DIR_)pcfutil.h + +# pcf driver object(s) +# +# PCF_DRV_OBJ_M is used during `multi' builds +# PCF_DRV_OBJ_S is used during `single' builds +# +PCF_DRV_OBJ_M := $(PCF_DRV_SRC:$(PCF_DIR_)%.c=$(OBJ_)%.$O) +PCF_DRV_OBJ_S := $(OBJ_)pcf.$O + +# Windows driver source file for single build +# +PCF_DRV_SRC_S := $(PCF_DIR_)pcf.c + + +# pcf driver - single object +# +$(PCF_DRV_OBJ_S): $(PCF_DRV_SRC_S) $(PCF_DRV_SRC) $(FREETYPE_H) $(PCF_DRV_H) + $(PCF_COMPILE) $T$@ $(PCF_DRV_SRC_S) + + +# pcf driver - multiple objects +# +$(OBJ_)%.$O: $(PCF_DIR_)%.c $(FREETYPE_H) $(PCF_DRV_H) + $(PCF_COMPILE) $T$@ $< + + +# update main driver object lists +# +DRV_OBJS_S += $(PCF_DRV_OBJ_S) +DRV_OBJS_M += $(PCF_DRV_OBJ_M) + +# EOF diff --git a/xc/extras/freetype2/src/psaux/descrip.mms b/xc/extras/freetype2/src/psaux/descrip.mms new file mode 100644 index 000000000..d3ed754b0 --- /dev/null +++ b/xc/extras/freetype2/src/psaux/descrip.mms @@ -0,0 +1,23 @@ +# +# FreeType 2 PSaux driver compilation rules for VMS +# + + +# Copyright 2001 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.psaux]) + +OBJS=psaux.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/psaux/psaux.c b/xc/extras/freetype2/src/psaux/psaux.c index 74d895e64..9275e0213 100644 --- a/xc/extras/freetype2/src/psaux/psaux.c +++ b/xc/extras/freetype2/src/psaux/psaux.c @@ -18,19 +18,10 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "psobjs.c" #include "psauxmod.c" #include "t1decode.c" -#else - -#include <psaux/psobjs.c> -#include <psaux/psauxmod.c> -#include <psaux/t1decode.c> - -#endif - /* END */ diff --git a/xc/extras/freetype2/src/psaux/psauxmod.c b/xc/extras/freetype2/src/psaux/psauxmod.c index 6063f0602..f752372c2 100644 --- a/xc/extras/freetype2/src/psaux/psauxmod.c +++ b/xc/extras/freetype2/src/psaux/psauxmod.c @@ -16,9 +16,10 @@ /***************************************************************************/ -#include <psaux/psauxmod.h> -#include <psaux/psobjs.h> -#include <psaux/t1decode.h> +#include <ft2build.h> +#include "psauxmod.h" +#include "psobjs.h" +#include "t1decode.h" FT_CALLBACK_TABLE_DEF diff --git a/xc/extras/freetype2/src/psaux/psauxmod.h b/xc/extras/freetype2/src/psaux/psauxmod.h index 3c348cfc3..f71d548ca 100644 --- a/xc/extras/freetype2/src/psaux/psauxmod.h +++ b/xc/extras/freetype2/src/psaux/psauxmod.h @@ -16,22 +16,23 @@ /***************************************************************************/ -#ifndef PSAUXMOD_H -#define PSAUXMOD_H +#ifndef __PSAUXMOD_H__ +#define __PSAUXMOD_H__ -#include <freetype/ftmodule.h> -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> +#include FT_MODULE_H + + +FT_BEGIN_HEADER + FT_EXPORT_VAR( const FT_Module_Class ) psaux_driver_class; -#ifdef __cplusplus - } -#endif -#endif /* PSAUXMOD_H */ +FT_END_HEADER + +#endif /* __PSAUXMOD_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/psaux/psobjs.c b/xc/extras/freetype2/src/psaux/psobjs.c index 589cd68b8..abca45a30 100644 --- a/xc/extras/freetype2/src/psaux/psobjs.c +++ b/xc/extras/freetype2/src/psaux/psobjs.c @@ -4,7 +4,7 @@ /* */ /* Auxiliary functions for PostScript fonts (body). */ /* */ -/* Copyright 1996-2000 by */ +/* Copyright 1996-2001 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -16,20 +16,12 @@ /***************************************************************************/ -#include <freetype/internal/psaux.h> -#include <freetype/fterrors.h> -#include <freetype/internal/ftdebug.h> - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include FT_INTERNAL_DEBUG_H +#include FT_ERRORS_H #include "psobjs.h" -#else - -#include <psaux/psobjs.h> - -#endif - /*************************************************************************/ /*************************************************************************/ @@ -92,17 +84,16 @@ void shift_elements( PS_Table* table, FT_Byte* old_base ) { - FT_Long delta = table->block - old_base; + FT_Long delta = (FT_Long)( table->block - old_base ); FT_Byte** offset = table->elements; FT_Byte** limit = offset + table->max_elems; - if ( delta ) - for ( ; offset < limit; offset++ ) - { - if ( offset[0] ) - offset[0] += delta; - } + for ( ; offset < limit; offset++ ) + { + if ( offset[0] ) + offset[0] += delta; + } } @@ -115,15 +106,19 @@ FT_Error error; - /* reallocate the base block */ - if ( REALLOC( table->block, table->capacity, new_size ) ) + /* allocate new base block */ + if ( ALLOC( table->block, new_size ) ) return error; - table->capacity = new_size; - - /* shift all offsets if necessary */ - if ( old_base ) + /* copy elements and shift offsets */ + if (old_base ) + { + MEM_Copy( table->block, old_base, table->capacity ); shift_elements( table, old_base ); + FREE( old_base ); + } + + table->capacity = new_size; return FT_Err_Ok; } @@ -208,20 +203,20 @@ { FT_Memory memory = table->memory; FT_Error error; - FT_Byte* old_base; + FT_Byte* old_base = table->block; /* should never fail, because rec.cursor <= rec.size */ - old_base = table->block; if ( !old_base ) return; - if ( REALLOC( table->block, table->capacity, table->cursor ) ) + if ( ALLOC( table->block, table->cursor ) ) return; - table->capacity = table->cursor; + MEM_Copy( table->block, old_base, table->cursor ); + shift_elements( table, old_base ); - if ( old_base != table->block ) - shift_elements( table, old_base ); + table->capacity = table->cursor; + FREE( old_base ); } @@ -417,7 +412,7 @@ cur++; } - *pnum_tokens = cur - tokens; + *pnum_tokens = (FT_Int)( cur - tokens ); parser->cursor = old_cursor; parser->limit = old_limit; @@ -852,7 +847,7 @@ case t1_field_string: { FT_Memory memory = parser->memory; - FT_UInt len = limit-cur; + FT_UInt len = (FT_UInt)( limit - cur ); if ( *(FT_String**)q ) diff --git a/xc/extras/freetype2/src/psaux/psobjs.h b/xc/extras/freetype2/src/psaux/psobjs.h index 8537aecbb..c0e482a20 100644 --- a/xc/extras/freetype2/src/psaux/psobjs.h +++ b/xc/extras/freetype2/src/psaux/psobjs.h @@ -16,15 +16,15 @@ /***************************************************************************/ -#ifndef PSOBJS_H -#define PSOBJS_H +#ifndef __PSOBJS_H__ +#define __PSOBJS_H__ -#include <freetype/internal/psaux.h> +#include <ft2build.h> +#include FT_INTERNAL_POSTSCRIPT_AUX_H -#ifdef __cplusplus - extern "C" { -#endif + +FT_BEGIN_HEADER /*************************************************************************/ @@ -195,12 +195,9 @@ FT_UShort seed ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* PSOBJS_H */ +#endif /* __PSOBJS_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/psaux/rules.mk b/xc/extras/freetype2/src/psaux/rules.mk index ae182e243..dd5c8a6eb 100644 --- a/xc/extras/freetype2/src/psaux/rules.mk +++ b/xc/extras/freetype2/src/psaux/rules.mk @@ -21,7 +21,7 @@ PSAUX_DIR_ := $(PSAUX_DIR)$(SEP) # compilation flags for the driver # -PSAUX_COMPILE := $(FT_COMPILE) +PSAUX_COMPILE := $(FT_COMPILE) $I$(PSAUX_DIR) # PSAUX driver sources (i.e., C files) diff --git a/xc/extras/freetype2/src/psaux/t1decode.c b/xc/extras/freetype2/src/psaux/t1decode.c index 40e4f4e29..a19807e7a 100644 --- a/xc/extras/freetype2/src/psaux/t1decode.c +++ b/xc/extras/freetype2/src/psaux/t1decode.c @@ -16,24 +16,13 @@ /***************************************************************************/ -#include <freetype/internal/ftdebug.h> /* for FT_ERROR() */ -#include <freetype/internal/t1errors.h> -#include <freetype/ftoutln.h> -#include <freetype/internal/ftdebug.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_TYPE1_ERRORS_H +#include FT_OUTLINE_H #include "t1decode.h" #include "psobjs.h" -#else - -#include <psaux/t1decode.h> -#include <psaux/psobjs.h> - -#endif - /*************************************************************************/ /* */ @@ -434,7 +423,8 @@ case 12: if ( ip > limit ) { - FT_ERROR(( "T1_Parse_CharStrings: invalid escape (12+EOF)\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " + "invalid escape (12+EOF)\n" )); goto Syntax_Error; } @@ -469,7 +459,8 @@ break; default: - FT_ERROR(( "T1_Parse_CharStrings: invalid escape (12+%d)\n", + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " + "invalid escape (12+%d)\n", ip[-1] )); goto Syntax_Error; } @@ -478,7 +469,8 @@ case 255: /* four bytes integer */ if ( ip + 4 > limit ) { - FT_ERROR(( "T1_Parse_CharStrings: unexpected EOF in integer\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " + "unexpected EOF in integer\n" )); goto Syntax_Error; } @@ -498,21 +490,21 @@ { if ( ++ip > limit ) { - FT_ERROR(( "T1_Parse_CharStrings:" )); - FT_ERROR(( " unexpected EOF in integer\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " )); + FT_ERROR(( "unexpected EOF in integer\n" )); goto Syntax_Error; } - if ( ip[-2] < 251 ) - value = ( ( (FT_Long)ip[-2] - 247 ) << 8 ) + ip[-1] + 108; - else - value = -( ( ( (FT_Long)ip[-2] - 251 ) << 8 ) + ip[-1] + 108 ); + if ( ip[-2] < 251 ) + value = ( ( (FT_Long)ip[-2] - 247 ) << 8 ) + ip[-1] + 108; + else + value = -( ( ( (FT_Long)ip[-2] - 251 ) << 8 ) + ip[-1] + 108 ); } } else { - FT_ERROR(( "T1_Parse_CharStrings: invalid byte (%d)\n", - ip[-1] )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " + "invalid byte (%d)\n", ip[-1] )); goto Syntax_Error; } } @@ -526,7 +518,7 @@ { if ( top - decoder->stack >= T1_MAX_CHARSTRINGS_OPERANDS ) { - FT_ERROR(( "T1_Parse_CharStrings: stack overflow!\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: stack overflow!\n" )); goto Syntax_Error; } @@ -582,7 +574,8 @@ if ( decoder->flex_state == 0 || decoder->num_flex_vectors != 7 ) { - FT_ERROR(( "T1_Parse_CharStrings: unexpected flex end\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " + "unexpected flex end\n" )); goto Syntax_Error; } @@ -592,7 +585,8 @@ ip[2] != 12 || ip[3] != 17 || /* pop */ ip[4] != 12 || ip[5] != 33 ) /* setcurpoint */ { - FT_ERROR(( "T1_Parse_CharStrings: invalid flex charstring\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " + "invalid flex charstring\n" )); goto Syntax_Error; } @@ -607,16 +601,15 @@ /* eat the following `pop' */ if ( ip + 2 > limit ) { - FT_ERROR(( "T1_Parse_CharStrings: invalid escape (12+%d)\n", - ip[-1] )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " + "invalid escape (12+%d)\n", ip[-1] )); goto Syntax_Error; } if ( ip[0] != 12 || ip[1] != 17 ) { - FT_ERROR(( "T1_Parse_CharStrings:" )); - FT_ERROR(( " `pop' expected, found (%d %d)\n", - ip[0], ip[1] )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " )); + FT_ERROR(( "`pop' expected, found (%d %d)\n", ip[0], ip[1] )); goto Syntax_Error; } ip += 2; @@ -642,16 +635,16 @@ if ( !blend ) { - FT_ERROR(( "T1_Parse_CharStrings:" )); - FT_ERROR(( " unexpected multiple masters operator!\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " )); + FT_ERROR(( "unexpected multiple masters operator!\n" )); goto Syntax_Error; } num_points = top[1] - 13 + ( top[1] == 18 ); if ( top[0] != (FT_Int)( num_points * blend->num_designs ) ) { - FT_ERROR(( "T1_Parse_CharStrings:" )); - FT_ERROR(( " incorrect number of mm arguments\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " )); + FT_ERROR(( "incorrect number of mm arguments\n" )); goto Syntax_Error; } @@ -692,8 +685,8 @@ default: Unexpected_OtherSubr: - FT_ERROR(( "T1_Parse_CharStrings: invalid othersubr [%d %d]!\n", - top[0], top[1] )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " + "invalid othersubr [%d %d]!\n", top[0], top[1] )); goto Syntax_Error; } decoder->top = top; @@ -890,7 +883,7 @@ } else { - FT_ERROR(( "T1_Parse_CharStrings: division by 0\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: division by 0\n" )); goto Syntax_Error; } break; @@ -905,31 +898,43 @@ index = top[0]; if ( index < 0 || index >= (FT_Int)decoder->num_subrs ) { - FT_ERROR(( "T1_Parse_CharStrings: invalid subrs index\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " + "invalid subrs index\n" )); goto Syntax_Error; } if ( zone - decoder->zones >= T1_MAX_SUBRS_CALLS ) { - FT_ERROR(( "T1_Parse_CharStrings: too many nested subrs\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " + "too many nested subrs\n" )); goto Syntax_Error; } zone->cursor = ip; /* save current instruction pointer */ zone++; - zone->base = decoder->subrs[index] + decoder->lenIV; - if (decoder->subrs_len) - zone->limit = zone->base + decoder->subrs_len[index]; + /* The Type 1 driver stores subroutines without the seed bytes. */ + /* The CID driver stores subroutines with seed bytes. This */ + /* case is taken care of when decoder->subrs_len == 0. */ + zone->base = decoder->subrs[index]; + + if ( decoder->subrs_len ) + zone->limit = zone->base + decoder->subrs_len[index]; else - zone->limit = decoder->subrs[index+1]; + { + /* We are using subroutines from a CID font. We must adjust */ + /* for the seed bytes. */ + zone->base += ( decoder->lenIV >= 0 ? decoder->lenIV : 0 ); + zone->limit = decoder->subrs[index + 1]; + } zone->cursor = zone->base; if ( !zone->base ) { - FT_ERROR(( "T1_Parse_CharStrings: invoking empty subrs!\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " + "invoking empty subrs!\n" )); goto Syntax_Error; } @@ -951,7 +956,7 @@ if ( zone <= decoder->zones ) { - FT_ERROR(( "T1_Parse_CharStrings: unexpected return\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: unexpected return\n" )); goto Syntax_Error; } @@ -989,12 +994,13 @@ case op_setcurrentpoint: FT_TRACE4(( " setcurrentpoint" )); - FT_ERROR(( "T1_Parse_CharStrings:" )); - FT_ERROR(( " unexpected `setcurrentpoint'\n" )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " )); + FT_ERROR(( "unexpected `setcurrentpoint'\n" )); goto Syntax_Error; default: - FT_ERROR(( "T1_Parse_CharStrings: unhandled opcode %d\n", op )); + FT_ERROR(( "T1_Decoder_Parse_CharStrings: " + "unhandled opcode %d\n", op )); goto Syntax_Error; } diff --git a/xc/extras/freetype2/src/psaux/t1decode.h b/xc/extras/freetype2/src/psaux/t1decode.h index b5f0f5d86..7b24ee3b1 100644 --- a/xc/extras/freetype2/src/psaux/t1decode.h +++ b/xc/extras/freetype2/src/psaux/t1decode.h @@ -16,17 +16,17 @@ /***************************************************************************/ -#ifndef T1DECODE_H -#define T1DECODE_H +#ifndef __T1DECODE_H__ +#define __T1DECODE_H__ -#include <freetype/internal/psaux.h> -#include <freetype/internal/psnames.h> -#include <freetype/internal/t1types.h> +#include <ft2build.h> +#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H +#include FT_INTERNAL_TYPE1_TYPES_H -#ifdef __cplusplus - extern "C" { -#endif + +FT_BEGIN_HEADER FT_CALLBACK_TABLE @@ -55,12 +55,9 @@ void T1_Decoder_Done( T1_Decoder* decoder ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* T1DECODE_H */ +#endif /* __T1DECODE_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/psnames/descrip.mms b/xc/extras/freetype2/src/psnames/descrip.mms new file mode 100644 index 000000000..bb86c547e --- /dev/null +++ b/xc/extras/freetype2/src/psnames/descrip.mms @@ -0,0 +1,23 @@ +# +# FreeType 2 PSNames driver compilation rules for VMS +# + + +# Copyright 2001 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.psnames]) + +OBJS=psnames.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/psnames/psmodule.c b/xc/extras/freetype2/src/psnames/psmodule.c index 85dee1064..389e1a0ef 100644 --- a/xc/extras/freetype2/src/psnames/psmodule.c +++ b/xc/extras/freetype2/src/psnames/psmodule.c @@ -16,23 +16,12 @@ /***************************************************************************/ -#include <freetype/internal/psnames.h> -#include <freetype/internal/ftobjs.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_POSTSCRIPT_NAMES_H +#include FT_INTERNAL_OBJECTS_H #include "psmodule.h" #include "pstables.h" -#else - -#include <psnames/psmodule.h> -#include <psnames/pstables.h> - -#endif - - #include <stdlib.h> /* for qsort() */ #include <string.h> /* for strcmp(), strncpy() */ @@ -40,8 +29,6 @@ #ifndef FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES - - #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST @@ -113,7 +100,7 @@ while ( *p && *p != '.' ) p++; - len = p - glyph_name; + len = (int)( p - glyph_name ); if ( *p && len < 64 ) { @@ -194,7 +181,7 @@ } /* now, compress the table a bit */ - count = map - table->maps; + count = (FT_UInt)( map - table->maps ); if ( count > 0 && REALLOC( table->maps, num_glyphs * sizeof ( PS_UniMap ), diff --git a/xc/extras/freetype2/src/psnames/psmodule.h b/xc/extras/freetype2/src/psnames/psmodule.h index 513c99eb1..8694ca8b5 100644 --- a/xc/extras/freetype2/src/psnames/psmodule.h +++ b/xc/extras/freetype2/src/psnames/psmodule.h @@ -16,25 +16,23 @@ /***************************************************************************/ -#ifndef PSDRIVER_H -#define PSDRIVER_H +#ifndef __PSMODULE_H__ +#define __PSMODULE_H__ -#include <freetype/ftmodule.h> +#include <ft2build.h> +#include FT_MODULE_H -#ifdef __cplusplus - extern "C" { -#endif + +FT_BEGIN_HEADER FT_EXPORT_VAR( const FT_Module_Class ) psnames_module_class; -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* PSDRIVER_H */ +#endif /* __PSMODULE_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/psnames/psnames.c b/xc/extras/freetype2/src/psnames/psnames.c index cb62304d6..6e482ff2e 100644 --- a/xc/extras/freetype2/src/psnames/psnames.c +++ b/xc/extras/freetype2/src/psnames/psnames.c @@ -18,16 +18,8 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "psmodule.c" -#else - -#include <psnames/psmodule.c> - -#endif - /* END */ diff --git a/xc/extras/freetype2/src/psnames/pstables.h b/xc/extras/freetype2/src/psnames/pstables.h index 7355afc96..9fbe50b05 100644 --- a/xc/extras/freetype2/src/psnames/pstables.h +++ b/xc/extras/freetype2/src/psnames/pstables.h @@ -19,7 +19,7 @@ /* this file has been generated automatically -- do not edit! */ - static const char* standard_glyph_names[] = + static const char* const standard_glyph_names[] = { ".null", "CR", @@ -1094,7 +1094,8 @@ }; - static const char** t1_standard_glyphs = standard_glyph_names + 31; + static const char* const * const t1_standard_glyphs = + standard_glyph_names + 31; #define NUM_STD_GLYPHS 391 diff --git a/xc/extras/freetype2/src/psnames/rules.mk b/xc/extras/freetype2/src/psnames/rules.mk index 25552b266..7612e8286 100644 --- a/xc/extras/freetype2/src/psnames/rules.mk +++ b/xc/extras/freetype2/src/psnames/rules.mk @@ -21,7 +21,7 @@ PSNAMES_DIR_ := $(PSNAMES_DIR)$(SEP) # compilation flags for the driver # -PSNAMES_COMPILE := $(FT_COMPILE) +PSNAMES_COMPILE := $(FT_COMPILE) $I$(PSNAMES_DIR) # PSNames driver sources (i.e., C files) diff --git a/xc/extras/freetype2/src/raster/descrip.mms b/xc/extras/freetype2/src/raster/descrip.mms new file mode 100644 index 000000000..ea42a4bbd --- /dev/null +++ b/xc/extras/freetype2/src/raster/descrip.mms @@ -0,0 +1,23 @@ +# +# FreeType 2 renderer module compilation rules for VMS +# + + +# Copyright 2001 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.raster]) + +OBJS=raster.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/raster/ftraster.c b/xc/extras/freetype2/src/raster/ftraster.c index ee01cb508..ef35b8072 100644 --- a/xc/extras/freetype2/src/raster/ftraster.c +++ b/xc/extras/freetype2/src/raster/ftraster.c @@ -22,12 +22,9 @@ /*************************************************************************/ -#ifdef FT_FLAT_COMPILE -# include "ftraster.h" -#else -# include <raster/ftraster.h> -#endif -#include <freetype/internal/ftcalc.h> /* for FT_MulDiv() only */ +#include <ft2build.h> +#include "ftraster.h" +#include FT_INTERNAL_CALC_H /* for FT_MulDiv only */ /*************************************************************************/ @@ -623,7 +620,7 @@ PProfile oldProfile; - h = ras.top - ras.cProfile->offset; + h = (Long)( ras.top - ras.cProfile->offset ); if ( h < 0 ) { @@ -1105,7 +1102,7 @@ else { e = CEILING( y1 ); - f1 = FRAC( y1 ); + f1 = (Short)( FRAC( y1 ) ); e0 = e; if ( f1 == 0 ) @@ -2192,7 +2189,7 @@ e1 = TRUNC( e1 ); c1 = (Short)( e1 >> 3 ); - f1 = e1 & 7; + f1 = (Short)( e1 & 7 ); if ( e1 >= 0 && e1 < ras.bWidth && ras.bTarget[ras.traceOfs + c1] & ( 0x80 >> f1 ) ) @@ -2218,7 +2215,7 @@ if ( e1 >= 0 && e1 < ras.bWidth ) { c1 = (Short)( e1 >> 3 ); - f1 = e1 & 7; + f1 = (Short)( e1 & 7 ); if ( ras.gray_min_x > c1 ) ras.gray_min_x = c1; if ( ras.gray_max_x < c1 ) ras.gray_max_x = c1; @@ -2680,7 +2677,7 @@ Q = P->link; bottom = (Short)P->start; - top = (Short)P->start + P->height - 1; + top = (Short)( P->start + P->height - 1 ); if ( min_Y > bottom ) min_Y = bottom; if ( max_Y < top ) max_Y = top; @@ -2708,7 +2705,7 @@ while ( P ) { - P->countL = P->start - min_Y; + P->countL = (UShort)( P->start - min_Y ); P = P->link; } @@ -3263,13 +3260,13 @@ if ( outline->n_points != outline->contours[outline->n_contours - 1] + 1 ) return Raster_Err_Invalid; - if ( !target_map || !target_map->buffer ) - return Raster_Err_Invalid; - /* this version of the raster does not support direct rendering, sorry */ if ( params->flags & ft_raster_flag_direct ) return Raster_Err_Unsupported; + if ( !target_map || !target_map->buffer ) + return Raster_Err_Invalid; + ras.outline = *outline; ras.target = *target_map; diff --git a/xc/extras/freetype2/src/raster/ftraster.h b/xc/extras/freetype2/src/raster/ftraster.h index 36fa51cd8..46985e6c3 100644 --- a/xc/extras/freetype2/src/raster/ftraster.h +++ b/xc/extras/freetype2/src/raster/ftraster.h @@ -16,14 +16,16 @@ /***************************************************************************/ -#ifndef FTRASTER_H -#define FTRASTER_H +#ifndef __FTRASTER_H__ +#define __FTRASTER_H__ -#ifdef __cplusplus - extern "C" { -#endif -#include <freetype/ftimage.h> +#include <ft2build.h> +#include FT_CONFIG_CONFIG_H +#include FT_IMAGE_H + + +FT_BEGIN_HEADER /*************************************************************************/ @@ -33,18 +35,12 @@ /* */ /* #define _STANDALONE_ */ -#ifndef FT_EXPORT_VAR -#define FT_EXPORT_VAR( x ) extern x -#endif - FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_standard_raster; -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* FTRASTER_H */ +#endif /* __FTRASTER_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/raster/ftrend1.c b/xc/extras/freetype2/src/raster/ftrend1.c index 8be7e2f9f..19c741c93 100644 --- a/xc/extras/freetype2/src/raster/ftrend1.c +++ b/xc/extras/freetype2/src/raster/ftrend1.c @@ -16,22 +16,12 @@ /***************************************************************************/ -#include <freetype/internal/ftobjs.h> -#include <freetype/ftoutln.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H +#include FT_OUTLINE_H #include "ftrend1.h" #include "ftraster.h" -#else - -#include <raster/ftrend1.h> -#include <raster/ftraster.h> - -#endif - /* initialize renderer -- init its raster */ static diff --git a/xc/extras/freetype2/src/raster/ftrend1.h b/xc/extras/freetype2/src/raster/ftrend1.h index 76926ae34..c22779e0c 100644 --- a/xc/extras/freetype2/src/raster/ftrend1.h +++ b/xc/extras/freetype2/src/raster/ftrend1.h @@ -16,16 +16,15 @@ /***************************************************************************/ -#ifndef FTREND1_H -#define FTREND1_H +#ifndef __FTREND1_H__ +#define __FTREND1_H__ -#include <freetype/ftrender.h> +#include <ft2build.h> +#include FT_RENDER_H -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER FT_EXPORT_VAR( const FT_Renderer_Class ) ft_raster1_renderer_class; @@ -37,12 +36,9 @@ FT_EXPORT_VAR( const FT_Renderer_Class ) ft_raster5_renderer_class; -#ifdef __cplusplus - } -#endif +FT_END_HEADER - -#endif /* FTREND1_H */ +#endif /* __FTREND1_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/raster/raster.c b/xc/extras/freetype2/src/raster/raster.c index ea1080433..9dc2a86fb 100644 --- a/xc/extras/freetype2/src/raster/raster.c +++ b/xc/extras/freetype2/src/raster/raster.c @@ -1,6 +1,6 @@ /***************************************************************************/ /* */ -/* raster1.c */ +/* raster.c */ /* */ /* FreeType monochrome rasterer module component (body only). */ /* */ @@ -18,18 +18,9 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ftraster.c" #include "ftrend1.c" -#else - -#include <raster/ftraster.c> -#include <raster/ftrend1.c> - -#endif - /* END */ diff --git a/xc/extras/freetype2/src/raster/rules.mk b/xc/extras/freetype2/src/raster/rules.mk index 32dbf699f..2dba01396 100644 --- a/xc/extras/freetype2/src/raster/rules.mk +++ b/xc/extras/freetype2/src/raster/rules.mk @@ -20,7 +20,7 @@ RAS1_DIR_ := $(RAS1_DIR)$(SEP) # compilation flags for the driver # -RAS1_COMPILE := $(FT_COMPILE) +RAS1_COMPILE := $(FT_COMPILE) $I$(RAS1_DIR) # raster1 driver sources (i.e., C files) diff --git a/xc/extras/freetype2/src/sfnt/descrip.mms b/xc/extras/freetype2/src/sfnt/descrip.mms new file mode 100644 index 000000000..8eeb2a6aa --- /dev/null +++ b/xc/extras/freetype2/src/sfnt/descrip.mms @@ -0,0 +1,23 @@ +# +# FreeType 2 SFNT driver compilation rules for VMS +# + + +# Copyright 2001 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.sfnt]) + +OBJS=sfnt.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/sfnt/rules.mk b/xc/extras/freetype2/src/sfnt/rules.mk index 2255e6a08..4502b5cde 100644 --- a/xc/extras/freetype2/src/sfnt/rules.mk +++ b/xc/extras/freetype2/src/sfnt/rules.mk @@ -21,7 +21,7 @@ SFNT_DIR_ := $(SFNT_DIR)$(SEP) # compilation flags for the driver # -SFNT_COMPILE := $(FT_COMPILE) +SFNT_COMPILE := $(FT_COMPILE) $I$(SFNT_DIR) # SFNT driver sources (i.e., C files) diff --git a/xc/extras/freetype2/src/sfnt/sfdriver.c b/xc/extras/freetype2/src/sfnt/sfdriver.c index 4df3c6963..15411455d 100644 --- a/xc/extras/freetype2/src/sfnt/sfdriver.c +++ b/xc/extras/freetype2/src/sfnt/sfdriver.c @@ -16,11 +16,9 @@ /***************************************************************************/ -#include <freetype/internal/sfnt.h> -#include <freetype/internal/ftobjs.h> - - -#ifdef FT_FLAT_COMPILE +#include <ft2build.h> +#include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_OBJECTS_H #include "sfdriver.h" #include "ttload.h" @@ -35,24 +33,6 @@ #include "ttpost.h" #endif -#else - -#include <sfnt/sfdriver.h> -#include <sfnt/ttload.h> -#include <sfnt/ttcmap.h> -#include <sfnt/sfobjs.h> - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS -#include <sfnt/ttsbit.h> -#endif - -#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES -#include <sfnt/ttpost.h> -#endif - -#endif - - #include <string.h> /* for strcmp() */ @@ -117,7 +97,7 @@ error = TT_Get_PS_Name( face, glyph_index, &gname ); if ( !error && buffer_max > 0 ) { - FT_UInt len = strlen( gname ); + FT_UInt len = (FT_UInt)( strlen( gname ) ); if ( len >= buffer_max ) diff --git a/xc/extras/freetype2/src/sfnt/sfdriver.h b/xc/extras/freetype2/src/sfnt/sfdriver.h index 72e3e6590..c2b9a9d53 100644 --- a/xc/extras/freetype2/src/sfnt/sfdriver.h +++ b/xc/extras/freetype2/src/sfnt/sfdriver.h @@ -16,25 +16,23 @@ /***************************************************************************/ -#ifndef SFDRIVER_H -#define SFDRIVER_H +#ifndef __SFDRIVER_H__ +#define __SFDRIVER_H__ -#include <freetype/ftmodule.h> -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> +#include FT_MODULE_H - FT_EXPORT_VAR( const FT_Module_Class ) sfnt_module_class; +FT_BEGIN_HEADER + + FT_EXPORT_VAR( const FT_Module_Class ) sfnt_module_class; -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* SFDRIVER_H */ +#endif /* __SFDRIVER_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/sfnt/sfnt.c b/xc/extras/freetype2/src/sfnt/sfnt.c index cca73425c..bab7b57c4 100644 --- a/xc/extras/freetype2/src/sfnt/sfnt.c +++ b/xc/extras/freetype2/src/sfnt/sfnt.c @@ -18,12 +18,11 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ttload.c" #include "ttcmap.c" #include "sfobjs.c" +#include "sfdriver.c" #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS #include "ttsbit.c" @@ -33,25 +32,5 @@ #include "ttpost.c" #endif -#include "sfdriver.c" - -#else /* FT_FLAT_COMPILE */ - -#include <sfnt/ttload.c> -#include <sfnt/ttcmap.c> -#include <sfnt/sfobjs.c> - -#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS -#include <sfnt/ttsbit.c> -#endif - -#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES -#include <sfnt/ttpost.c> -#endif - -#include <sfnt/sfdriver.c> - -#endif /* FT_FLAT_COMPILE */ - /* END */ diff --git a/xc/extras/freetype2/src/sfnt/sfobjs.c b/xc/extras/freetype2/src/sfnt/sfobjs.c index f3e0f689d..30f199103 100644 --- a/xc/extras/freetype2/src/sfnt/sfobjs.c +++ b/xc/extras/freetype2/src/sfnt/sfobjs.c @@ -16,24 +16,14 @@ /***************************************************************************/ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "sfobjs.h" #include "ttload.h" - -#else - -#include <sfnt/sfobjs.h> -#include <sfnt/ttload.h> - -#endif - - -#include <freetype/internal/sfnt.h> -#include <freetype/internal/psnames.h> -#include <freetype/ttnameid.h> -#include <freetype/tttags.h> -#include <freetype/internal/tterrors.h> +#include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H +#include FT_TRUETYPE_IDS_H +#include FT_TRUETYPE_TAGS_H +#include FT_INTERNAL_TRUETYPE_ERRORS_H /*************************************************************************/ diff --git a/xc/extras/freetype2/src/sfnt/sfobjs.h b/xc/extras/freetype2/src/sfnt/sfobjs.h index a334978e1..9c428a682 100644 --- a/xc/extras/freetype2/src/sfnt/sfobjs.h +++ b/xc/extras/freetype2/src/sfnt/sfobjs.h @@ -16,16 +16,16 @@ /***************************************************************************/ -#ifndef SFOBJS_H -#define SFOBJS_H +#ifndef __SFOBJS_H__ +#define __SFOBJS_H__ -#include <freetype/internal/sfnt.h> -#include <freetype/internal/ftobjs.h> +#include <ft2build.h> +#include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_OBJECTS_H -#ifdef __cplusplus - extern "C" { -#endif + +FT_BEGIN_HEADER FT_LOCAL @@ -46,12 +46,9 @@ void SFNT_Done_Face( TT_Face face ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* SFDRIVER_H */ +#endif /* __SFDRIVER_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/sfnt/ttcmap.c b/xc/extras/freetype2/src/sfnt/ttcmap.c index b62ec2c93..c9eb94694 100644 --- a/xc/extras/freetype2/src/sfnt/ttcmap.c +++ b/xc/extras/freetype2/src/sfnt/ttcmap.c @@ -16,22 +16,12 @@ /***************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/tterrors.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_TRUETYPE_ERRORS_H #include "ttload.h" #include "ttcmap.h" -#else - -#include <sfnt/ttload.h> -#include <sfnt/ttcmap.h> - -#endif - /*************************************************************************/ /* */ @@ -503,10 +493,10 @@ else { /* otherwise, we must use the glyphIdArray to do it */ - index1 = seg4->idRangeOffset / 2 - + ( charCode - seg4->startCount ) - + ( seg4 - cmap4->segments ) - - segCount; + index1 = (FT_UInt)( seg4->idRangeOffset / 2 + + ( charCode - seg4->startCount ) + + ( seg4 - cmap4->segments ) + - segCount ); if ( index1 < (FT_UInt)cmap4->numGlyphId && cmap4->glyphIdArray[index1] != 0 ) diff --git a/xc/extras/freetype2/src/sfnt/ttcmap.h b/xc/extras/freetype2/src/sfnt/ttcmap.h index aab2dcd35..e2c6ab59d 100644 --- a/xc/extras/freetype2/src/sfnt/ttcmap.h +++ b/xc/extras/freetype2/src/sfnt/ttcmap.h @@ -16,14 +16,15 @@ /***************************************************************************/ -#ifndef TTCMAP_H -#define TTCMAP_H +#ifndef __TTCMAP_H__ +#define __TTCMAP_H__ -#include <freetype/internal/tttypes.h> -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> +#include FT_INTERNAL_TRUETYPE_TYPES_H + + +FT_BEGIN_HEADER FT_LOCAL @@ -35,11 +36,10 @@ FT_Error TT_CharMap_Free( TT_Face face, TT_CMapTable* cmap ); -#ifdef __cplusplus - } -#endif -#endif /* TTCMAP_H */ +FT_END_HEADER + +#endif /* __TTCMAP_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/sfnt/ttload.c b/xc/extras/freetype2/src/sfnt/ttload.c index 686629ab7..254fc8e51 100644 --- a/xc/extras/freetype2/src/sfnt/ttload.c +++ b/xc/extras/freetype2/src/sfnt/ttload.c @@ -17,24 +17,14 @@ /***************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/tterrors.h> -#include <freetype/internal/ftstream.h> -#include <freetype/tttags.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_TRUETYPE_ERRORS_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_TAGS_H #include "ttload.h" #include "ttcmap.h" -#else - -#include <sfnt/ttload.h> -#include <sfnt/ttcmap.h> - -#endif - /*************************************************************************/ /* */ @@ -1024,7 +1014,7 @@ /* I know that M$ encoded strings are Unicode, */ /* but this works reasonable well for debugging purposes. */ if ( cur->string ) - for ( j = 0; j < cur->stringLength; j++ ) + for ( j = 0; j < (FT_UInt)cur->stringLength; j++ ) { FT_Char c = *( cur->string + j ); diff --git a/xc/extras/freetype2/src/sfnt/ttload.h b/xc/extras/freetype2/src/sfnt/ttload.h index 181119189..152f65baf 100644 --- a/xc/extras/freetype2/src/sfnt/ttload.h +++ b/xc/extras/freetype2/src/sfnt/ttload.h @@ -17,17 +17,16 @@ /***************************************************************************/ -#ifndef TTLOAD_H -#define TTLOAD_H +#ifndef __TTLOAD_H__ +#define __TTLOAD_H__ -#include <freetype/internal/ftstream.h> -#include <freetype/internal/tttypes.h> +#include <ft2build.h> +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_TRUETYPE_TYPES_H -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER FT_LOCAL @@ -129,12 +128,9 @@ #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ -#ifdef __cplusplus - } -#endif +FT_END_HEADER - -#endif /* TTLOAD_H */ +#endif /* __TTLOAD_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/sfnt/ttpost.c b/xc/extras/freetype2/src/sfnt/ttpost.c index 6fe7e2b21..3f85170ad 100644 --- a/xc/extras/freetype2/src/sfnt/ttpost.c +++ b/xc/extras/freetype2/src/sfnt/ttpost.c @@ -25,23 +25,13 @@ /*************************************************************************/ -#include <freetype/internal/ftstream.h> -#include <freetype/internal/tterrors.h> -#include <freetype/tttags.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_TRUETYPE_ERRORS_H +#include FT_TRUETYPE_TAGS_H #include "ttpost.h" #include "ttload.h" -#else - -#include <sfnt/ttpost.h> -#include <sfnt/ttload.h> - -#endif - /*************************************************************************/ /* */ @@ -71,7 +61,7 @@ /* table of Mac names. Thus, it is possible to build a version of */ /* FreeType without the Type 1 driver & PSNames module. */ -#define MAC_NAME( x ) TT_Post_Default_Names[x] +#define MAC_NAME( x ) TT_Post_Default_Names[x] /* the 258 default Mac PS glyph names */ diff --git a/xc/extras/freetype2/src/sfnt/ttpost.h b/xc/extras/freetype2/src/sfnt/ttpost.h index c7a8e94f0..094f239ea 100644 --- a/xc/extras/freetype2/src/sfnt/ttpost.h +++ b/xc/extras/freetype2/src/sfnt/ttpost.h @@ -17,15 +17,16 @@ /***************************************************************************/ -#ifndef TTPOST_H -#define TTPOST_H +#ifndef __TTPOST_H__ +#define __TTPOST_H__ -#include <freetype/config/ftconfig.h> -#include <freetype/internal/tttypes.h> -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> +#include FT_CONFIG_CONFIG_H +#include FT_INTERNAL_TRUETYPE_TYPES_H + + +FT_BEGIN_HEADER #define TT_Err_Invalid_Post_Table_Format 0x0B00 @@ -41,12 +42,9 @@ void TT_Free_Post_Names( TT_Face face ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* TTPOST_H */ +#endif /* __TTPOST_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/sfnt/ttsbit.c b/xc/extras/freetype2/src/sfnt/ttsbit.c index a31f6ed63..ff5fd930f 100644 --- a/xc/extras/freetype2/src/sfnt/ttsbit.c +++ b/xc/extras/freetype2/src/sfnt/ttsbit.c @@ -16,22 +16,13 @@ /***************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/tterrors.h> -#include <freetype/internal/ftstream.h> -#include <freetype/tttags.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_TRUETYPE_ERRORS_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_TAGS_H #include "ttsbit.h" -#else - -#include <sfnt/ttsbit.h> - -#endif - /*************************************************************************/ /* */ diff --git a/xc/extras/freetype2/src/sfnt/ttsbit.h b/xc/extras/freetype2/src/sfnt/ttsbit.h index ce941b886..679a1c5d3 100644 --- a/xc/extras/freetype2/src/sfnt/ttsbit.h +++ b/xc/extras/freetype2/src/sfnt/ttsbit.h @@ -16,24 +16,15 @@ /***************************************************************************/ -#ifndef TTSBIT_H -#define TTSBIT_H +#ifndef __TTSBIT_H__ +#define __TTSBIT_H__ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ttload.h" -#else - -#include <sfnt/ttload.h> - -#endif - -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER FT_LOCAL @@ -60,12 +51,9 @@ TT_SBit_Metrics *metrics ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* TTSBIT_H */ +#endif /* __TTSBIT_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/smooth/descrip.mms b/xc/extras/freetype2/src/smooth/descrip.mms new file mode 100644 index 000000000..67d62ecd5 --- /dev/null +++ b/xc/extras/freetype2/src/smooth/descrip.mms @@ -0,0 +1,23 @@ +# +# FreeType 2 smooth renderer module compilation rules for VMS +# + + +# Copyright 2001 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.smooth]) + +OBJS=smooth.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/smooth/ftgrays.c b/xc/extras/freetype2/src/smooth/ftgrays.c index 6b67705fb..6ac2608f7 100644 --- a/xc/extras/freetype2/src/smooth/ftgrays.c +++ b/xc/extras/freetype2/src/smooth/ftgrays.c @@ -122,21 +122,11 @@ #else /* _STANDALONE_ */ - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ftgrays.h" - -#else - -#include <smooth/ftgrays.h> - -#endif - - -#include <freetype/internal/ftobjs.h> /* for FT_UNUSED() */ -#include <freetype/internal/ftdebug.h> /* for FT_TRACE() and FT_ERROR() */ -#include <freetype/ftoutln.h> /* for FT_Outline_Decompose() */ +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_DEBUG_H +#include FT_OUTLINE_H #define ErrRaster_Invalid_Mode FT_Err_Cannot_Render_Glyph #define ErrRaster_Invalid_Outline FT_Err_Invalid_Outline @@ -262,6 +252,7 @@ FT_Outline outline; FT_Bitmap target; + FT_BBox clip_box; FT_Span gray_spans[FT_MAX_GRAY_SPANS]; int num_gray_spans; @@ -1046,7 +1037,7 @@ for (;;) { - int len = limit - base; + int len = (int)( limit - base ); PCell i, j, pivot; @@ -1368,7 +1359,9 @@ FT_UNUSED( target ); - + if ( ras.num_cells == 0 ) + return; + cur = ras.cells; limit = cur + ras.num_cells; @@ -1709,24 +1702,27 @@ 0 }; - TBand bands[40], *band; - int n, num_bands; - TPos min, max, max_y; + TBand bands[40], *band; + int n, num_bands; + TPos min, max, max_y; + FT_BBox* clip; /* Set up state in the raster object */ compute_cbox( RAS_VAR_ outline ); /* clip to target bitmap, exit if nothing to do */ - if ( ras.max_ex <= 0 || ras.min_ex >= ras.target.width || - ras.max_ey <= 0 || ras.min_ey >= ras.target.rows ) + clip = &ras.clip_box; + + if ( ras.max_ex <= clip->xMin || ras.min_ex >= clip->xMax || + ras.max_ey <= clip->yMin || ras.min_ey >= clip->yMax ) return 0; - if ( ras.min_ex < 0 ) ras.min_ex = 0; - if ( ras.min_ey < 0 ) ras.min_ey = 0; + if ( ras.min_ex < clip->xMin ) ras.min_ex = clip->xMin; + if ( ras.min_ey < clip->yMin ) ras.min_ey = clip->yMin; - if ( ras.max_ex > ras.target.width ) ras.max_ex = ras.target.width; - if ( ras.max_ey > ras.target.rows ) ras.max_ey = ras.target.rows; + if ( ras.max_ex > clip->xMax ) ras.max_ex = clip->xMax; + if ( ras.max_ey > clip->yMax ) ras.max_ey = clip->yMax; /* simple heuristic used to speed-up the bezier decomposition -- see */ /* the code in render_conic() and render_cubic() for more details */ @@ -1862,6 +1858,27 @@ if ( !( params->flags & ft_raster_flag_aa ) ) return ErrRaster_Invalid_Mode; + /* compute clipping box */ + if ( ( params->flags & ft_raster_flag_direct ) == 0 ) + { + /* compute clip box from target pixmap */ + ras.clip_box.xMin = 0; + ras.clip_box.yMin = 0; + ras.clip_box.xMax = target_map->width; + ras.clip_box.yMax = target_map->rows; + } + else if ( params->flags & ft_raster_flag_clip ) + { + ras.clip_box = params->clip_box; + } + else + { + ras.clip_box.xMin = -32768; + ras.clip_box.yMin = -32768; + ras.clip_box.xMax = 32767; + ras.clip_box.yMax = 32767; + } + ras.outline = *outline; ras.num_cells = 0; ras.invalid = 1; diff --git a/xc/extras/freetype2/src/smooth/ftgrays.h b/xc/extras/freetype2/src/smooth/ftgrays.h index 5055f6d26..82492b59a 100644 --- a/xc/extras/freetype2/src/smooth/ftgrays.h +++ b/xc/extras/freetype2/src/smooth/ftgrays.h @@ -15,19 +15,23 @@ /* */ /***************************************************************************/ -#ifndef FTGRAYS_H -#define FTGRAYS_H + +#ifndef __FTGRAYS_H__ +#define __FTGRAYS_H__ #ifdef __cplusplus extern "C" { #endif + #ifdef _STANDALONE_ #include "ftimage.h" #else -#include <freetype/ftimage.h> +#include <ft2build.h> +#include FT_IMAGE_H #endif + /*************************************************************************/ /* */ /* To make ftgrays.h independent from configuration files we check */ @@ -42,11 +46,12 @@ FT_EXPORT_VAR( const FT_Raster_Funcs ) ft_grays_raster; + #ifdef __cplusplus } #endif -#endif /* FTGRAYS_H */ +#endif /* __FTGRAYS_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/smooth/ftsmooth.c b/xc/extras/freetype2/src/smooth/ftsmooth.c index 09e1ce7fa..cc2985d68 100644 --- a/xc/extras/freetype2/src/smooth/ftsmooth.c +++ b/xc/extras/freetype2/src/smooth/ftsmooth.c @@ -16,22 +16,12 @@ /***************************************************************************/ -#include <freetype/internal/ftobjs.h> -#include <freetype/ftoutln.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H +#include FT_OUTLINE_H #include "ftsmooth.h" #include "ftgrays.h" -#else - -#include <smooth/ftsmooth.h> -#include <smooth/ftgrays.h> - -#endif - /* initialize renderer -- init its raster */ static diff --git a/xc/extras/freetype2/src/smooth/ftsmooth.h b/xc/extras/freetype2/src/smooth/ftsmooth.h index 723b4141b..64b24d00c 100644 --- a/xc/extras/freetype2/src/smooth/ftsmooth.h +++ b/xc/extras/freetype2/src/smooth/ftsmooth.h @@ -16,15 +16,15 @@ /***************************************************************************/ -#ifndef FTSMOOTH_H -#define FTSMOOTH_H +#ifndef __FTSMOOTH_H__ +#define __FTSMOOTH_H__ -#include <freetype/ftrender.h> +#include <ft2build.h> +#include FT_RENDER_H -#ifdef __cplusplus - extern "C" { -#endif + +FT_BEGIN_HEADER #ifndef FT_CONFIG_OPTION_NO_STD_RASTER @@ -35,12 +35,10 @@ FT_EXPORT_VAR( const FT_Renderer_Class ) ft_smooth_renderer_class; #endif -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* FTSMOOTH_H */ +#endif /* __FTSMOOTH_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/smooth/rules.mk b/xc/extras/freetype2/src/smooth/rules.mk index 62febfadd..cf751f592 100644 --- a/xc/extras/freetype2/src/smooth/rules.mk +++ b/xc/extras/freetype2/src/smooth/rules.mk @@ -20,7 +20,7 @@ SMOOTH_DIR_ := $(SMOOTH_DIR)$(SEP) # compilation flags for the driver # -SMOOTH_COMPILE := $(FT_COMPILE) +SMOOTH_COMPILE := $(FT_COMPILE) $I$(SMOOTH_DIR) # smooth driver sources (i.e., C files) diff --git a/xc/extras/freetype2/src/smooth/smooth.c b/xc/extras/freetype2/src/smooth/smooth.c index 41cc4aea5..40639cb0e 100644 --- a/xc/extras/freetype2/src/smooth/smooth.c +++ b/xc/extras/freetype2/src/smooth/smooth.c @@ -18,18 +18,9 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ftgrays.c" #include "ftsmooth.c" -#else - -#include <smooth/ftgrays.c> -#include <smooth/ftsmooth.c> - -#endif - /* END */ diff --git a/xc/extras/freetype2/src/truetype/descrip.mms b/xc/extras/freetype2/src/truetype/descrip.mms new file mode 100644 index 000000000..92ea89a71 --- /dev/null +++ b/xc/extras/freetype2/src/truetype/descrip.mms @@ -0,0 +1,23 @@ +# +# FreeType 2 TrueType driver compilation rules for VMS +# + + +# Copyright 2001 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.truetype]) + +OBJS=truetype.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/truetype/rules.mk b/xc/extras/freetype2/src/truetype/rules.mk index 9289378cb..a9f6c3683 100644 --- a/xc/extras/freetype2/src/truetype/rules.mk +++ b/xc/extras/freetype2/src/truetype/rules.mk @@ -21,7 +21,7 @@ TT_DIR_ := $(TT_DIR)$(SEP) # compilation flags for the driver # -TT_COMPILE := $(FT_COMPILE) +TT_COMPILE := $(FT_COMPILE) $I$(TT_DIR) # TrueType driver sources (i.e., C files) diff --git a/xc/extras/freetype2/src/truetype/truetype.c b/xc/extras/freetype2/src/truetype/truetype.c index 55ba0c9d4..59833e5e3 100644 --- a/xc/extras/freetype2/src/truetype/truetype.c +++ b/xc/extras/freetype2/src/truetype/truetype.c @@ -18,30 +18,15 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT - -#ifdef FT_FLAT_COMPILE - -#include "ttdriver.c" /* driver interface */ -#include "ttpload.c" /* tables loader */ -#include "ttgload.c" /* glyph loader */ -#include "ttobjs.c" /* object manager */ - -#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER -#include "ttinterp.c" /* bytecode interpreter */ -#endif - -#else /* FT_FLAT_COMPILE */ - -#include <truetype/ttdriver.c> /* driver interface */ -#include <truetype/ttpload.c> /* tables loader */ -#include <truetype/ttgload.c> /* glyph loader */ -#include <truetype/ttobjs.c> /* object manager */ +#include <ft2build.h> +#include "ttdriver.c" /* driver interface */ +#include "ttpload.c" /* tables loader */ +#include "ttgload.c" /* glyph loader */ +#include "ttobjs.c" /* object manager */ #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER -#include <truetype/ttinterp.c> /* bytecode interpreter */ +#include "ttinterp.c" #endif -#endif /* FT_FLAT_COMPILE */ - /* END */ diff --git a/xc/extras/freetype2/src/truetype/ttdriver.c b/xc/extras/freetype2/src/truetype/ttdriver.c index cddd40794..d21d02fee 100644 --- a/xc/extras/freetype2/src/truetype/ttdriver.c +++ b/xc/extras/freetype2/src/truetype/ttdriver.c @@ -16,24 +16,14 @@ /***************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftstream.h> -#include <freetype/internal/sfnt.h> -#include <freetype/ttnameid.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_SFNT_H +#include FT_TRUETYPE_IDS_H #include "ttdriver.h" #include "ttgload.h" -#else - -#include <truetype/ttdriver.h> -#include <truetype/ttgload.h> - -#endif - /*************************************************************************/ /* */ diff --git a/xc/extras/freetype2/src/truetype/ttdriver.h b/xc/extras/freetype2/src/truetype/ttdriver.h index a0a275e6e..c33ff7697 100644 --- a/xc/extras/freetype2/src/truetype/ttdriver.h +++ b/xc/extras/freetype2/src/truetype/ttdriver.h @@ -16,26 +16,23 @@ /***************************************************************************/ -#ifndef TTDRIVER_H -#define TTDRIVER_H +#ifndef __TTDRIVER_H__ +#define __TTDRIVER_H__ -#include <freetype/internal/ftdriver.h> +#include <ft2build.h> +#include FT_INTERNAL_DRIVER_H -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER - FT_EXPORT_VAR( const FT_Driver_Class ) tt_driver_class; + FT_EXPORT_VAR( const FT_Driver_Class ) tt_driver_class; -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* TTDRIVER_H */ +#endif /* __TTDRIVER_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/truetype/ttgload.c b/xc/extras/freetype2/src/truetype/ttgload.c index 9bb313f87..59424bae1 100644 --- a/xc/extras/freetype2/src/truetype/ttgload.c +++ b/xc/extras/freetype2/src/truetype/ttgload.c @@ -16,24 +16,16 @@ /***************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftcalc.h> -#include <freetype/internal/ftstream.h> -#include <freetype/internal/sfnt.h> -#include <freetype/tttags.h> -#include <freetype/ftoutln.h> - - -#ifdef FT_FLAT_COMPILE +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_CALC_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_SFNT_H +#include FT_TRUETYPE_TAGS_H +#include FT_OUTLINE_H #include "ttgload.h" -#else - -#include <truetype/ttgload.h> - -#endif - /*************************************************************************/ /* */ @@ -259,7 +251,7 @@ FT_TRACE5(( " yMin: %4d yMax: %4d\n", loader->bbox.yMin, loader->bbox.yMax )); - return FT_Err_Ok; + return TT_Err_Ok; } @@ -502,7 +494,8 @@ /* composite instructions, if we find some. */ /* we will process them later... */ /* */ - loader->ins_pos = FILE_Pos() + stream->cursor - stream->limit; + loader->ins_pos = (FT_ULong)( FILE_Pos() + + stream->cursor - stream->limit ); } #endif @@ -541,7 +534,7 @@ FT_UInt n_points = outline->n_points; FT_UInt n_ins; TT_GlyphZone* zone = &load->zone; - FT_Error error = FT_Err_Ok; + FT_Error error = TT_Err_Ok; FT_UNUSED( debug ); /* used by truetype interpreter only */ @@ -632,7 +625,7 @@ if ( error && load->exec->pedantic_hinting ) goto Exit; - error = FT_Err_Ok; /* ignore bytecode errors in non-pedantic mode */ + error = TT_Err_Ok; /* ignore bytecode errors in non-pedantic mode */ } #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ @@ -747,7 +740,7 @@ #endif - error = FT_Err_Ok; + error = TT_Err_Ok; goto Exit; } @@ -898,6 +891,7 @@ if ( error ) goto Fail; + /* restore subglyph pointer */ subglyph = gloader->base.subglyphs + num_base_subgs + n; if ( subglyph->flags & USE_MY_METRICS ) @@ -978,8 +972,16 @@ } } - translate_array( num_new_points, loader->zone.cur, x, y ); - cur_to_org( num_new_points, &loader->zone ); + if ( x | y ) + { + translate_array( num_new_points, + gloader->base.outline.points + num_base_points, + x, y ); + + translate_array( num_new_points, + gloader->base.extra_points + num_base_points, + x, y ); + } } /*******************************************************************/ @@ -1490,3 +1492,4 @@ /* END */ + diff --git a/xc/extras/freetype2/src/truetype/ttgload.h b/xc/extras/freetype2/src/truetype/ttgload.h index 990337e6a..1b45f51aa 100644 --- a/xc/extras/freetype2/src/truetype/ttgload.h +++ b/xc/extras/freetype2/src/truetype/ttgload.h @@ -16,32 +16,19 @@ /***************************************************************************/ -#ifndef TTGLOAD_H -#define TTGLOAD_H +#ifndef __TTGLOAD_H__ +#define __TTGLOAD_H__ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ttobjs.h" #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER #include "ttinterp.h" #endif -#else /* FT_FLAT_COMPILE */ - -#include <truetype/ttobjs.h> - -#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER -#include <truetype/ttinterp.h> -#endif - -#endif /* FT_FLAT_COMPILE */ - -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER FT_LOCAL @@ -59,11 +46,10 @@ FT_UShort glyph_index, FT_UInt load_flags ); -#ifdef __cplusplus - } -#endif -#endif /* TTGLOAD_H */ +FT_END_HEADER + +#endif /* __TTGLOAD_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/truetype/ttinterp.c b/xc/extras/freetype2/src/truetype/ttinterp.c index e9dd074b1..320c78338 100644 --- a/xc/extras/freetype2/src/truetype/ttinterp.c +++ b/xc/extras/freetype2/src/truetype/ttinterp.c @@ -16,32 +16,21 @@ /***************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftcalc.h> -#include <freetype/ftsystem.h> - - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_CALC_H +#include FT_SYSTEM_H #include "ttinterp.h" - -#else - -#include <truetype/ttinterp.h> - -#endif - - -#include <freetype/internal/tterrors.h> +#include FT_INTERNAL_TRUETYPE_ERRORS_H #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER -#define TT_MULFIX FT_MulFix -#define TT_MULDIV FT_MulDiv +#define TT_MULFIX FT_MulFix +#define TT_MULDIV FT_MulDiv -#define TT_INT64 FT_Int64 +#define TT_INT64 FT_Int64 /*************************************************************************/ @@ -202,9 +191,6 @@ #define CUR_Ppem() \ Cur_PPEM( EXEC_ARG ) -#define CALC_Length() \ - Calc_Length( EXEC_ARG ) - #define INS_SxVTL( a, b, c, d ) \ Ins_SxVTL( EXEC_ARG_ a, b, c, d ) @@ -6855,8 +6841,8 @@ FT_Byte opcode = CUR.opcode; -#undef ARRAY_BOUND_ERROR -#define ARRAY_BOUND_ERROR goto Set_Invalid_Ref +#undef ARRAY_BOUND_ERROR +#define ARRAY_BOUND_ERROR goto Set_Invalid_Ref switch ( opcode ) diff --git a/xc/extras/freetype2/src/truetype/ttinterp.h b/xc/extras/freetype2/src/truetype/ttinterp.h index 1094aedac..c8a71f999 100644 --- a/xc/extras/freetype2/src/truetype/ttinterp.h +++ b/xc/extras/freetype2/src/truetype/ttinterp.h @@ -16,24 +16,15 @@ /***************************************************************************/ -#ifndef TTINTERP_H -#define TTINTERP_H +#ifndef __TTINTERP_H__ +#define __TTINTERP_H__ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "ttobjs.h" -#else - -#include <truetype/ttobjs.h> -#endif - - -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER #ifndef TT_CONFIG_OPTION_STATIC_INTEPRETER /* indirect implementation */ @@ -311,11 +302,9 @@ FT_EXPORT( FT_Error ) TT_RunIns( TT_ExecContext exec ); -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* TTINTERP_H */ +#endif /* __TTINTERP_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/truetype/ttobjs.c b/xc/extras/freetype2/src/truetype/ttobjs.c index 0df6a9560..0b1855e30 100644 --- a/xc/extras/freetype2/src/truetype/ttobjs.c +++ b/xc/extras/freetype2/src/truetype/ttobjs.c @@ -16,17 +16,15 @@ /***************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftcalc.h> -#include <freetype/internal/ftstream.h> -#include <freetype/ttnameid.h> -#include <freetype/tttags.h> - -#include <freetype/internal/sfnt.h> -#include <freetype/internal/psnames.h> - - -#ifdef FT_FLAT_COMPILE +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_CALC_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_IDS_H +#include FT_TRUETYPE_TAGS_H +#include FT_INTERNAL_SFNT_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H +#include FT_INTERNAL_TRUETYPE_ERRORS_H #include "ttgload.h" #include "ttpload.h" @@ -35,21 +33,6 @@ #include "ttinterp.h" #endif -#else /* FT_FLAT_COMPILE */ - -#include <truetype/ttgload.h> -#include <truetype/ttpload.h> - -#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER -#include <truetype/ttinterp.h> -#endif - -#endif /* FT_FLAT_COMPILE */ - - -#include <freetype/internal/tterrors.h> - - /*************************************************************************/ /* */ diff --git a/xc/extras/freetype2/src/truetype/ttobjs.h b/xc/extras/freetype2/src/truetype/ttobjs.h index 9fa331e38..67d294011 100644 --- a/xc/extras/freetype2/src/truetype/ttobjs.h +++ b/xc/extras/freetype2/src/truetype/ttobjs.h @@ -16,18 +16,17 @@ /***************************************************************************/ -#ifndef TTOBJS_H -#define TTOBJS_H +#ifndef __TTOBJS_H__ +#define __TTOBJS_H__ -#include <freetype/internal/ftobjs.h> -#include <freetype/internal/tttypes.h> -#include <freetype/internal/tterrors.h> +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_TRUETYPE_TYPES_H +#include FT_INTERNAL_TRUETYPE_ERRORS_H -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER /*************************************************************************/ @@ -416,11 +415,9 @@ void TT_Done_Driver( TT_Driver driver ); -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* TTOBJS_H */ +#endif /* __TTOBJS_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/truetype/ttpload.c b/xc/extras/freetype2/src/truetype/ttpload.c index f7b812cbb..aecd3c266 100644 --- a/xc/extras/freetype2/src/truetype/ttpload.c +++ b/xc/extras/freetype2/src/truetype/ttpload.c @@ -1,6 +1,6 @@ /***************************************************************************/ /* */ -/* ttpload.h */ +/* ttpload.c */ /* */ /* TrueType glyph data/program tables loader (body). */ /* */ @@ -16,18 +16,13 @@ /***************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftobjs.h> -#include <freetype/internal/ftstream.h> -#include <freetype/tttags.h> - -#ifdef FT_FLAT_COMPILE +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_STREAM_H +#include FT_TRUETYPE_TAGS_H #include "ttpload.h" -#else -#include <truetype/ttpload.h> -#endif - -#include <freetype/internal/tterrors.h> +#include FT_INTERNAL_TRUETYPE_ERRORS_H /*************************************************************************/ diff --git a/xc/extras/freetype2/src/truetype/ttpload.h b/xc/extras/freetype2/src/truetype/ttpload.h index 7d8b8d927..d6fb5249c 100644 --- a/xc/extras/freetype2/src/truetype/ttpload.h +++ b/xc/extras/freetype2/src/truetype/ttpload.h @@ -16,15 +16,15 @@ /***************************************************************************/ -#ifndef TTPLOAD_H -#define TTPLOAD_H +#ifndef __TTPLOAD_H__ +#define __TTPLOAD_H__ -#include <freetype/internal/tttypes.h> +#include <ft2build.h> +#include FT_INTERNAL_TRUETYPE_TYPES_H -#ifdef __cplusplus - extern "C" { -#endif + +FT_BEGIN_HEADER FT_LOCAL @@ -40,12 +40,9 @@ FT_Stream stream ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* TTPLOAD_H */ +#endif /* __TTPLOAD_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/type1/descrip.mms b/xc/extras/freetype2/src/type1/descrip.mms new file mode 100644 index 000000000..da50ab158 --- /dev/null +++ b/xc/extras/freetype2/src/type1/descrip.mms @@ -0,0 +1,23 @@ +# +# FreeType 2 Type1 driver compilation rules for VMS +# + + +# Copyright 1996-2000 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.type1]) + +OBJS=type1.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/type1/rules.mk b/xc/extras/freetype2/src/type1/rules.mk index c00b5941c..aff446f9a 100644 --- a/xc/extras/freetype2/src/type1/rules.mk +++ b/xc/extras/freetype2/src/type1/rules.mk @@ -21,7 +21,7 @@ T1_DIR_ := $(T1_DIR)$(SEP) # compilation flags for the driver # -T1_COMPILE := $(FT_COMPILE) +T1_COMPILE := $(FT_COMPILE) $I$(T1_DIR) # Type1 driver sources (i.e., C files) diff --git a/xc/extras/freetype2/src/type1/t1afm.c b/xc/extras/freetype2/src/type1/t1afm.c index d168f82c1..53c6a4b0f 100644 --- a/xc/extras/freetype2/src/type1/t1afm.c +++ b/xc/extras/freetype2/src/type1/t1afm.c @@ -16,20 +16,10 @@ /***************************************************************************/ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "t1afm.h" - -#else - -#include <type1/t1afm.h> - -#endif - - -#include <freetype/internal/ftstream.h> -#include <freetype/internal/t1types.h> - +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_TYPE1_TYPES_H #include <stdlib.h> /* for qsort() */ #include <string.h> /* for strcmp() */ #include <ctype.h> /* for isalnum() */ @@ -84,7 +74,7 @@ while ( IS_ALPHANUM( *p ) && p < limit ) p++; - len = p - *start; + len = (FT_Int)( p - *start ); if ( len > 0 && len < 64 ) { diff --git a/xc/extras/freetype2/src/type1/t1afm.h b/xc/extras/freetype2/src/type1/t1afm.h index 397af573a..e2d5e3fd6 100644 --- a/xc/extras/freetype2/src/type1/t1afm.h +++ b/xc/extras/freetype2/src/type1/t1afm.h @@ -16,24 +16,14 @@ /***************************************************************************/ -#ifndef T1AFM_H -#define T1AFM_H - - -#ifdef FT_FLAT_COMPILE +#ifndef __T1AFM_H__ +#define __T1AFM_H__ +#include <ft2build.h> #include "t1objs.h" -#else - -#include <type1/t1objs.h> -#endif - - -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER typedef struct T1_Kern_Pair_ @@ -68,12 +58,9 @@ FT_Vector* kerning ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* T1AFM_H */ +#endif /* __T1AFM_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/type1/t1driver.c b/xc/extras/freetype2/src/type1/t1driver.c index ea8ab911c..5146192f2 100644 --- a/xc/extras/freetype2/src/type1/t1driver.c +++ b/xc/extras/freetype2/src/type1/t1driver.c @@ -16,8 +16,7 @@ /***************************************************************************/ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "t1driver.h" #include "t1gload.h" #include "t1load.h" @@ -26,22 +25,9 @@ #include "t1afm.h" #endif -#else - -#include <type1/t1driver.h> -#include <type1/t1gload.h> -#include <type1/t1load.h> - -#ifndef T1_CONFIG_OPTION_NO_AFM -#include <type1/t1afm.h> -#endif - -#endif - - -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftstream.h> -#include <freetype/internal/psnames.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_POSTSCRIPT_NAMES_H #include <string.h> /* for strcmp() */ @@ -69,7 +55,7 @@ if ( buffer_max > 0 ) { - FT_UInt len = strlen( gname ); + FT_UInt len = (FT_UInt)( strlen( gname ) ); if (len >= buffer_max) diff --git a/xc/extras/freetype2/src/type1/t1driver.h b/xc/extras/freetype2/src/type1/t1driver.h index 5354a4fa6..e33c068c7 100644 --- a/xc/extras/freetype2/src/type1/t1driver.h +++ b/xc/extras/freetype2/src/type1/t1driver.h @@ -16,24 +16,23 @@ /***************************************************************************/ -#ifndef T1DRIVER_H -#define T1DRIVER_H +#ifndef __T1DRIVER_H__ +#define __T1DRIVER_H__ -#include <freetype/internal/ftdriver.h> -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> +#include FT_INTERNAL_DRIVER_H + + +FT_BEGIN_HEADER FT_EXPORT_VAR( const FT_Driver_Class ) t1_driver_class; -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* T1DRIVER_H */ +#endif /* __T1DRIVER_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/type1/t1gload.c b/xc/extras/freetype2/src/type1/t1gload.c index ef258e15b..071c29db8 100644 --- a/xc/extras/freetype2/src/type1/t1gload.c +++ b/xc/extras/freetype2/src/type1/t1gload.c @@ -16,22 +16,12 @@ /***************************************************************************/ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "t1gload.h" - -#else - -#include <type1/t1gload.h> - -#endif - - -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftstream.h> -#include <freetype/ftoutln.h> -#include <freetype/internal/psaux.h> - +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_OUTLINE_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H #include <string.h> /* for strcmp() */ @@ -306,6 +296,11 @@ metrics->horiBearingX = cbox.xMin; metrics->horiBearingY = cbox.yMax; } + + /* Set control data to the glyph charstrings. Note that this is */ + /* _not_ zero-terminated. */ + glyph->root.control_data = type1->charstrings [glyph_index]; + glyph->root.control_len = type1->charstrings_len[glyph_index]; } Exit: diff --git a/xc/extras/freetype2/src/type1/t1gload.h b/xc/extras/freetype2/src/type1/t1gload.h index a0d954294..99ca3a225 100644 --- a/xc/extras/freetype2/src/type1/t1gload.h +++ b/xc/extras/freetype2/src/type1/t1gload.h @@ -16,24 +16,15 @@ /***************************************************************************/ -#ifndef T1GLOAD_H -#define T1GLOAD_H +#ifndef __T1GLOAD_H__ +#define __T1GLOAD_H__ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "t1objs.h" -#else - -#include <type1/t1objs.h> - -#endif - -#ifdef __cplusplus - extern "C" { -#endif +FT_BEGIN_HEADER FT_LOCAL @@ -47,12 +38,9 @@ FT_Int load_flags ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* T1GLOAD_H */ +#endif /* __T1GLOAD_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/type1/t1load.c b/xc/extras/freetype2/src/type1/t1load.c index 6e5a47a2c..39922262c 100644 --- a/xc/extras/freetype2/src/type1/t1load.c +++ b/xc/extras/freetype2/src/type1/t1load.c @@ -61,25 +61,15 @@ /*************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/config/ftconfig.h> -#include <freetype/ftmm.h> - -#include <freetype/internal/t1types.h> -#include <freetype/internal/t1errors.h> - - -#ifdef FT_FLAT_COMPILE +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_CONFIG_CONFIG_H +#include FT_MULTIPLE_MASTERS_H +#include FT_INTERNAL_TYPE1_TYPES_H +#include FT_INTERNAL_TYPE1_ERRORS_H #include "t1load.h" -#else - -#include <type1/t1load.h> - -#endif - - #include <string.h> /* for strncmp(), strcmp() */ #include <ctype.h> /* for isalnum() */ @@ -430,7 +420,7 @@ if (token->start[0] == '/') token->start++; - len = token->limit - token->start; + len = (FT_Int)( token->limit - token->start ); if ( len <= 0 ) { error = T1_Err_Invalid_File_Format; @@ -775,7 +765,7 @@ static int is_alpha( FT_Byte c ) { - return ( isalnum( c ) || c == '.' || c == '_' ); + return ( isalnum( c ) || c == '.' || c == '_' || c == '-' ); } @@ -848,7 +838,7 @@ while ( cur2 < limit && is_alpha( *cur2 ) ) cur2++; - len = cur2 - cur; + len = (FT_Int)( cur2 - cur ); if ( len > 0 ) { if ( ALLOC( face->type1.font_name, len + 1 ) ) @@ -869,15 +859,15 @@ T1_Loader* loader ) { T1_ParserRec* parser = &loader->parser; - FT_Short temp[4]; + FT_Fixed temp[4]; FT_BBox* bbox = &face->type1.font_bbox; - (void)T1_ToCoordArray( parser, 4, temp ); - bbox->xMin = temp[0]; - bbox->yMin = temp[1]; - bbox->xMax = temp[2]; - bbox->yMax = temp[3]; + (void)T1_ToFixedArray( parser, 4, temp, 0 ); + bbox->xMin = FT_RoundFix( temp[0] ); + bbox->yMin = FT_RoundFix( temp[1] ); + bbox->xMax = FT_RoundFix( temp[2] ); + bbox->yMax = FT_RoundFix( temp[3] ); } @@ -888,7 +878,9 @@ T1_ParserRec* parser = &loader->parser; FT_Matrix* matrix = &face->type1.font_matrix; FT_Vector* offset = &face->type1.font_offset; + FT_Face root = (FT_Face)&face->root; FT_Fixed temp[6]; + FT_Fixed temp_scale; if ( matrix->xx || matrix->yx ) @@ -897,14 +889,23 @@ (void)T1_ToFixedArray( parser, 6, temp, 3 ); - /* we need to scale the values by 1.0/temp[3] */ - if ( temp[3] != 0x10000L ) + temp_scale = ABS( temp[3] ); + + /* Set Units per EM based on FontMatrix values. We set the value to */ + /* 1000 / temp_scale, because temp_scale was already multiplied by */ + /* 1000 (in t1_tofixed, from psobjs.c). */ + + root->units_per_EM = (FT_UShort)( FT_DivFix( 0x10000L, + FT_DivFix( temp_scale, 1000 ) ) >> 16 ); + + /* we need to scale the values by 1.0/temp_scale */ + if ( temp_scale != 0x10000L ) { - temp[0] = FT_DivFix( temp[0], temp[3] ); - temp[1] = FT_DivFix( temp[1], temp[3] ); - temp[2] = FT_DivFix( temp[2], temp[3] ); - temp[4] = FT_DivFix( temp[4], temp[3] ); - temp[5] = FT_DivFix( temp[5], temp[3] ); + temp[0] = FT_DivFix( temp[0], temp_scale ); + temp[1] = FT_DivFix( temp[1], temp_scale ); + temp[2] = FT_DivFix( temp[2], temp_scale ); + temp[4] = FT_DivFix( temp[4], temp_scale ); + temp[5] = FT_DivFix( temp[5], temp_scale ); temp[3] = 0x10000L; } @@ -1040,7 +1041,7 @@ while ( cur2 < limit && is_alpha( *cur2 ) ) cur2++; - len = cur2 - cur - 1; + len = (FT_Int)( cur2 - cur - 1 ); parser->root.error = T1_Add_Table( char_table, charcode, cur + 1, len + 1 ); @@ -1245,7 +1246,7 @@ while ( cur2 < limit && is_alpha( *cur2 ) ) cur2++; - len = cur2 - cur - 1; + len = (FT_Int)( cur2 - cur - 1 ); error = T1_Add_Table( name_table, n, cur + 1, len + 1 ); if ( error ) @@ -1382,16 +1383,8 @@ const T1_Field t1_keywords[] = { -#ifdef FT_FLAT_COMPILE - #include "t1tokens.h" -#else - -#include <type1/t1tokens.h> - -#endif - /* now add the special functions... */ T1_FIELD_CALLBACK( "FontName", parse_font_name ) T1_FIELD_CALLBACK( "FontBBox", parse_font_bbox ) @@ -1476,15 +1469,9 @@ while ( cur2 < limit && is_alpha( *cur2 ) ) cur2++; - len = cur2 - cur; + len = (FT_Int)( cur2 - cur ); if ( len > 0 && len < 22 ) { - if ( !loader->fontdata ) - { - if ( strncmp( (char*)cur, "FontInfo", 8 ) == 0 ) - loader->fontdata = 1; - } - else { /* now, compare the immediate name to the keyword table */ T1_Field* keyword = (T1_Field*)t1_keywords; @@ -1612,10 +1599,13 @@ /* to the Type1 data */ type1->num_glyphs = loader.num_glyphs; - if ( !loader.subrs.init ) + if ( loader.subrs.init ) { - FT_ERROR(( "T1_Open_Face: no subrs array in face!\n" )); - error = T1_Err_Invalid_File_Format; + loader.subrs.init = 0; + type1->num_subrs = loader.num_subrs; + type1->subrs_block = loader.subrs.block; + type1->subrs = loader.subrs.elements; + type1->subrs_len = loader.subrs.lengths; } if ( !loader.charstrings.init ) @@ -1624,12 +1614,6 @@ error = T1_Err_Invalid_File_Format; } - loader.subrs.init = 0; - type1->num_subrs = loader.num_subrs; - type1->subrs_block = loader.subrs.block; - type1->subrs = loader.subrs.elements; - type1->subrs_len = loader.subrs.lengths; - loader.charstrings.init = 0; type1->charstrings_block = loader.charstrings.block; type1->charstrings = loader.charstrings.elements; diff --git a/xc/extras/freetype2/src/type1/t1load.h b/xc/extras/freetype2/src/type1/t1load.h index 4d2f4b9e4..fb117f035 100644 --- a/xc/extras/freetype2/src/type1/t1load.h +++ b/xc/extras/freetype2/src/type1/t1load.h @@ -16,28 +16,20 @@ /***************************************************************************/ -#ifndef T1LOAD_H -#define T1LOAD_H +#ifndef __T1LOAD_H__ +#define __T1LOAD_H__ -#include <freetype/internal/ftstream.h> -#include <freetype/internal/psaux.h> -#include <freetype/ftmm.h> - -#ifdef FT_FLAT_COMPILE +#include <ft2build.h> +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H +#include FT_MULTIPLE_MASTERS_H #include "t1parse.h" -#else - -#include <type1/t1parse.h> - -#endif +FT_BEGIN_HEADER -#ifdef __cplusplus - extern "C" { -#endif typedef struct T1_Loader_ { @@ -83,11 +75,9 @@ #endif /* !T1_CONFIG_OPTION_NO_MM_SUPPORT */ -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* T1LOAD_H */ +#endif /* __T1LOAD_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/type1/t1objs.c b/xc/extras/freetype2/src/type1/t1objs.c index 9f5851ffe..fedd93ed6 100644 --- a/xc/extras/freetype2/src/type1/t1objs.c +++ b/xc/extras/freetype2/src/type1/t1objs.c @@ -16,14 +16,12 @@ /***************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftstream.h> +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H #include <string.h> /* strcmp() */ - -#ifdef FT_FLAT_COMPILE - #include "t1gload.h" #include "t1load.h" @@ -31,20 +29,8 @@ #include "t1afm.h" #endif -#else - -#include <type1/t1gload.h> -#include <type1/t1load.h> - -#ifndef T1_CONFIG_OPTION_NO_AFM -#include <type1/t1afm.h> -#endif - -#endif - - -#include <freetype/internal/psnames.h> -#include <freetype/internal/psaux.h> +#include FT_INTERNAL_POSTSCRIPT_NAMES_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H /*************************************************************************/ @@ -117,6 +103,7 @@ FREE( type1->glyph_names_block ); FREE( type1->encoding.char_index ); + FREE( type1->encoding.char_name ); FREE( type1->font_name ); #ifndef T1_CONFIG_OPTION_NO_AFM @@ -281,16 +268,19 @@ root->num_fixed_sizes = 0; root->available_sizes = 0; - root->bbox = face->type1.font_bbox; - root->units_per_EM = 1000; - root->ascender = (FT_Short)face->type1.font_bbox.yMax; - root->descender = (FT_Short)face->type1.font_bbox.yMin; - root->height = ( ( root->ascender - root->descender ) * 12 ) / 10; + root->bbox = face->type1.font_bbox; - /* now compute the maximum advance width */ + /* Set units_per_EM if we didn't set it in parse_font_matrix. */ + if ( !root->units_per_EM ) + root->units_per_EM = 1000; + root->ascender = (FT_Short)( face->type1.font_bbox.yMax >> 16 ); + root->descender = (FT_Short)( face->type1.font_bbox.yMin >> 16 ); + root->height = ( ( root->ascender - root->descender ) * 12 ) / 10; - root->max_advance_width = (FT_Short)face->type1.font_bbox.xMax; + /* now compute the maximum advance width */ + root->max_advance_width = + (FT_Short)( face->type1.font_bbox.xMax >> 16 ); { FT_Int max_advance; diff --git a/xc/extras/freetype2/src/type1/t1objs.h b/xc/extras/freetype2/src/type1/t1objs.h index 3081b3f7f..8c83fa7a3 100644 --- a/xc/extras/freetype2/src/type1/t1objs.h +++ b/xc/extras/freetype2/src/type1/t1objs.h @@ -16,17 +16,19 @@ /***************************************************************************/ -#ifndef T1OBJS_H -#define T1OBJS_H +#ifndef __T1OBJS_H__ +#define __T1OBJS_H__ -#include <freetype/internal/ftobjs.h> -#include <freetype/config/ftconfig.h> -#include <freetype/internal/t1errors.h> -#include <freetype/internal/t1types.h> -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> +#include FT_INTERNAL_OBJECTS_H +#include FT_CONFIG_CONFIG_H +#include FT_INTERNAL_TYPE1_ERRORS_H +#include FT_INTERNAL_TYPE1_TYPES_H + + +FT_BEGIN_HEADER + /* The following structures must be defined by the hinter */ typedef struct T1_Size_Hints_ T1_Size_Hints; @@ -151,11 +153,9 @@ void T1_Done_Driver( T1_Driver driver ); -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* T1OBJS_H */ +#endif /* __T1OBJS_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/type1/t1parse.c b/xc/extras/freetype2/src/type1/t1parse.c index 97a14ab2e..eede8bb09 100644 --- a/xc/extras/freetype2/src/type1/t1parse.c +++ b/xc/extras/freetype2/src/type1/t1parse.c @@ -33,24 +33,14 @@ /*************************************************************************/ -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftcalc.h> -#include <freetype/internal/ftobjs.h> -#include <freetype/internal/ftstream.h> -#include <freetype/internal/t1errors.h> -#include <freetype/internal/psaux.h> - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_CALC_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_TYPE1_ERRORS_H +#include FT_INTERNAL_POSTSCRIPT_AUX_H #include "t1parse.h" -#else - -#include <type1/t1parse.h> - -#endif - - #include <string.h> /* for strncmp() */ @@ -387,7 +377,7 @@ /* dictionary. We overwrite the base dictionary for disk-based */ /* resources and allocate a new block otherwise */ - size = parser->base_len - ( cur - parser->base_dict); + size = (FT_Long)( parser->base_len - ( cur - parser->base_dict ) ); if ( parser->in_memory ) { @@ -450,7 +440,7 @@ } /* put a safeguard */ - parser->private_len = write - parser->private_dict; + parser->private_len = (FT_Int)( write - parser->private_dict ); *write++ = 0; } } diff --git a/xc/extras/freetype2/src/type1/t1parse.h b/xc/extras/freetype2/src/type1/t1parse.h index f114e7790..8b91b3ccf 100644 --- a/xc/extras/freetype2/src/type1/t1parse.h +++ b/xc/extras/freetype2/src/type1/t1parse.h @@ -16,15 +16,16 @@ /***************************************************************************/ -#ifndef T1PARSE_H -#define T1PARSE_H +#ifndef __T1PARSE_H__ +#define __T1PARSE_H__ -#include <freetype/internal/t1types.h> -#include <freetype/internal/ftstream.h> -#ifdef __cplusplus - extern "C" { -#endif +#include <ft2build.h> +#include FT_INTERNAL_TYPE1_TYPES_H +#include FT_INTERNAL_STREAM_H + + +FT_BEGIN_HEADER /*************************************************************************/ @@ -125,12 +126,9 @@ void T1_Finalize_Parser( T1_ParserRec* parser ); -#ifdef __cplusplus - } -#endif - +FT_END_HEADER -#endif /* T1PARSE_H */ +#endif /* __T1PARSE_H__ */ /* END */ diff --git a/xc/extras/freetype2/src/type1/type1.c b/xc/extras/freetype2/src/type1/type1.c index d01c1cbde..365126510 100644 --- a/xc/extras/freetype2/src/type1/type1.c +++ b/xc/extras/freetype2/src/type1/type1.c @@ -18,9 +18,7 @@ #define FT_MAKE_OPTION_SINGLE_OBJECT - -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> #include "t1parse.c" #include "t1load.c" #include "t1objs.c" @@ -31,19 +29,5 @@ #include "t1afm.c" #endif -#else /* FT_FLAT_COMPILE */ - -#include <type1/t1parse.c> -#include <type1/t1load.c> -#include <type1/t1objs.c> -#include <type1/t1driver.c> -#include <type1/t1gload.c> - -#ifndef T1_CONFIG_OPTION_NO_AFM -#include <type1/t1afm.c> -#endif - -#endif /* FT_FLAT_COMPILE */ - /* END */ diff --git a/xc/extras/freetype2/src/winfonts/descrip.mms b/xc/extras/freetype2/src/winfonts/descrip.mms new file mode 100644 index 000000000..1f431e410 --- /dev/null +++ b/xc/extras/freetype2/src/winfonts/descrip.mms @@ -0,0 +1,23 @@ +# +# FreeType 2 Windows FNT/FON driver compilation rules for VMS +# + + +# Copyright 2001 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, modified, +# and distributed under the terms of the FreeType project license, +# LICENSE.TXT. By continuing to use, modify, or distribute this file you +# indicate that you have read the license and understand and accept it +# fully. + + +CFLAGS=$(COMP_FLAGS)$(DEBUG)/include=([--.include],[--.src.winfonts]) + +OBJS=winfnt.obj + +all : $(OBJS) + library [--.lib]freetype.olb $(OBJS) + +# EOF diff --git a/xc/extras/freetype2/src/winfonts/rules.mk b/xc/extras/freetype2/src/winfonts/rules.mk index 8396894d9..aa015f4c8 100644 --- a/xc/extras/freetype2/src/winfonts/rules.mk +++ b/xc/extras/freetype2/src/winfonts/rules.mk @@ -19,7 +19,7 @@ FNT_DIR := $(SRC_)winfonts FNT_DIR_ := $(FNT_DIR)$(SEP) -FNT_COMPILE := $(FT_COMPILE) +FNT_COMPILE := $(FT_COMPILE) $I$(FNT_DIR) # Windows driver sources (i.e., C files) diff --git a/xc/extras/freetype2/src/winfonts/winfnt.c b/xc/extras/freetype2/src/winfonts/winfnt.c index 5c759d7e3..d83496096 100644 --- a/xc/extras/freetype2/src/winfonts/winfnt.c +++ b/xc/extras/freetype2/src/winfonts/winfnt.c @@ -16,23 +16,14 @@ /***************************************************************************/ -#ifdef FT_FLAT_COMPILE - +#include <ft2build.h> +#include FT_ERRORS_H +#include FT_INTERNAL_DEBUG_H +#include FT_INTERNAL_STREAM_H +#include FT_INTERNAL_OBJECTS_H +#include FT_INTERNAL_FNT_TYPES_H #include "winfnt.h" -#else - -#include <winfonts/winfnt.h> - -#endif - - -#include <freetype/fterrors.h> -#include <freetype/internal/ftstream.h> -#include <freetype/internal/ftdebug.h> -#include <freetype/internal/ftobjs.h> -#include <freetype/internal/fnttypes.h> - /*************************************************************************/ /* */ @@ -251,7 +242,8 @@ if ( type_id == 0x8008 ) { font_count = count; - font_offset = FILE_Pos() + 4 + ( stream->cursor - stream->limit ); + font_offset = (FT_ULong)( FILE_Pos() + 4 + + ( stream->cursor - stream->limit ) ); break; } @@ -478,16 +470,16 @@ static FT_UInt FNT_Get_Char_Index( FT_CharMap charmap, - FT_ULong char_code ) + FT_Long char_code ) { - FT_UInt result = char_code; + FT_Long result = char_code; if ( charmap ) { FNT_Font* font = ((FNT_Face)charmap->face)->fonts; - FT_UInt first = font->header.first_char; - FT_UInt count = font->header.last_char - first + 1; + FT_Long first = font->header.first_char; + FT_Long count = font->header.last_char - first + 1; char_code -= first; @@ -584,6 +576,7 @@ slot->metrics.horiBearingY = slot->bitmap_top << 6; slot->linearHoriAdvance = (FT_Fixed)bitmap->width << 16; + slot->format = ft_glyph_format_bitmap; Exit: return error; diff --git a/xc/extras/freetype2/src/winfonts/winfnt.h b/xc/extras/freetype2/src/winfonts/winfnt.h index ba215b761..85defc7c4 100644 --- a/xc/extras/freetype2/src/winfonts/winfnt.h +++ b/xc/extras/freetype2/src/winfonts/winfnt.h @@ -16,26 +16,24 @@ /***************************************************************************/ -#ifndef WINFNT_H -#define WINFNT_H +#ifndef __WINFNT_H__ +#define __WINFNT_H__ -#include <freetype/internal/ftdriver.h> +#include <ft2build.h> +#include FT_INTERNAL_DRIVER_H -#ifdef __cplusplus - extern "C" { -#endif + +FT_BEGIN_HEADER FT_EXPORT_VAR( const FT_Driver_Class ) winfnt_driver_class; -#ifdef __cplusplus - } -#endif +FT_END_HEADER -#endif /* WINFNT_H */ +#endif /* __WINFNT_H__ */ /* END */ diff --git a/xc/extras/ogl-sample/README.XF86 b/xc/extras/ogl-sample/README.XF86 index efba42be1..bbcaa019f 100644 --- a/xc/extras/ogl-sample/README.XF86 +++ b/xc/extras/ogl-sample/README.XF86 @@ -1,12 +1,17 @@ This is an import of selected parts of SGI's ogl-sample distribution, -which is available from their CVS repository at :pserver:cvs@oss.sgi.com/cvs. +which is available from their CVS repository at :pserver:cvs@oss.sgi.com/cvs +(password 'cvs', check out "projects/ogl-sample/main). Currently only the GLw and GLU components have been imported: + main/doc/man/macros + main/doc/man/mandefs + main/doc/man/manglu main/doc/man/manglw + main/doc/man/manrules + main/doc/man/tools main/gfx/lib/glw - main/doc/man/manglu main/gfx/lib/glu Others may be imported at a later date. @@ -17,4 +22,4 @@ CVS repository. -$XFree86: xc/extras/ogl-sample/README.XF86,v 1.3 2001/01/15 22:17:45 dawes Exp $ +$XFree86: xc/extras/ogl-sample/README.XF86,v 1.4 2001/05/04 18:47:27 dawes Exp $ diff --git a/xc/extras/ogl-sample/main/doc/man/manglu/standard/beginpolygon.gl b/xc/extras/ogl-sample/main/doc/man/manglu/standard/beginpolygon.gl index 9d2288826..74c7ac6c2 100755 --- a/xc/extras/ogl-sample/main/doc/man/manglu/standard/beginpolygon.gl +++ b/xc/extras/ogl-sample/main/doc/man/manglu/standard/beginpolygon.gl @@ -30,7 +30,6 @@ _C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation _C_ published by SGI, but has not been independently verified as being _C_ compliant with the OpenGL(R) version 1.2.1 Specification. _C_ -_C_ $Date: 2001/03/19 17:45:27 $ $Revision: 1.1.1.1 $ _C_ The first character in this file must be an '_'! _C_ Anything on a line after _C_ is ignored _define(_filters,eqn)_C_ diff --git a/xc/extras/ogl-sample/main/doc/man/manglw/Distfile b/xc/extras/ogl-sample/main/doc/man/manglw/Distfile index 8a5002e2d..6bf42c0e1 100755 --- a/xc/extras/ogl-sample/main/doc/man/manglw/Distfile +++ b/xc/extras/ogl-sample/main/doc/man/manglw/Distfile @@ -1,6 +1,4 @@ # -# $Date: 2000/11/08 02:53:56 $ $Revision: 1.1.1.1 $ -# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/manglw/Attic/Distfile,v 1.1.1.1 2000/11/08 02:53:56 dawes Exp $ # DISTDIR_SI = /xc/doc/man/GL/glw diff --git a/xc/extras/ogl-sample/main/doc/man/manglw/GNUmakefile b/xc/extras/ogl-sample/main/doc/man/manglw/GNUmakefile index 39baa7fb4..d87aa5187 100755 --- a/xc/extras/ogl-sample/main/doc/man/manglw/GNUmakefile +++ b/xc/extras/ogl-sample/main/doc/man/manglw/GNUmakefile @@ -32,8 +32,6 @@ # published by SGI, but has not been independently verified as being # compliant with the OpenGL(R) version 1.2.1 Specification. # -# $Date: 2000/11/08 02:53:56 $ $Revision: 1.1.1.1 $ -# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/doc/man/manglw/Attic/GNUmakefile,v 1.1.1.1 2000/11/08 02:53:56 dawes Exp $ COMMONPREF = standard include $(ROOT)/usr/include/make/commondefs diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/Distfile b/xc/extras/ogl-sample/main/gfx/lib/glw/Distfile index 926d3f6f2..3270654bf 100755 --- a/xc/extras/ogl-sample/main/gfx/lib/glw/Distfile +++ b/xc/extras/ogl-sample/main/gfx/lib/glw/Distfile @@ -1,6 +1,4 @@ # -# $Date: 2000/11/08 02:53:56 $ $Revision: 1.1.1.1 $ -# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glw/Attic/Distfile,v 1.1.1.1 2000/11/08 02:53:56 dawes Exp $ # DISTFILES_SI = \ diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c index e506f7926..ba4ce5bd5 100755 --- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c +++ b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c @@ -31,16 +31,14 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2000/11/08 02:53:56 $ $Revision: 1.1.1.1 $ */ /* utility routines for GLX. * Since these routines are used both in the Motif and X versions of * the widget, they cannot peek directly into the structure * - * $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glw/Attic/GLwDAUtil.c,v 1.1.1.1 2000/11/08 02:53:56 dawes Exp $ */ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c,v 1.2 2000/11/02 20:39:06 dawes Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwDAUtil.c,v 1.3 2001/05/02 13:37:45 dawes Exp $ */ #include <X11/IntrinsicP.h> #include <X11/StringDefs.h> diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.c b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.c index 4e917b7e4..8eee9fc23 100755 --- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.c +++ b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.c @@ -31,10 +31,6 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2000/11/08 02:53:56 $ $Revision: 1.1.1.1 $ -*/ -/* -** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glw/Attic/GLwDrawA.c,v 1.1.1.1 2000/11/08 02:53:56 dawes Exp $ */ #include <stdio.h> diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.h b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.h index b2052beb5..5789b8e39 100755 --- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.h +++ b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.h @@ -31,10 +31,6 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2000/11/08 02:53:56 $ $Revision: 1.1.1.1 $ -*/ -/* -** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glw/Attic/GLwDrawA.h,v 1.1.1.1 2000/11/08 02:53:56 dawes Exp $ */ /* @@ -43,7 +39,7 @@ ** tree and for generating both Motif(TM) 1.2 and 2.x versions of the widgets ** in the same library. */ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.h,v 1.2 2000/11/02 20:39:07 dawes Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawA.h,v 1.3 2001/05/02 13:37:45 dawes Exp $ */ #ifndef _GLwDrawA_h #define _GLwDrawA_h diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawAP.h b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawAP.h index 91189a345..6ee9d45ec 100755 --- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawAP.h +++ b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawAP.h @@ -31,10 +31,6 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2000/11/08 02:53:56 $ $Revision: 1.1.1.1 $ -*/ -/* -** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glw/Attic/GLwDrawAP.h,v 1.1.1.1 2000/11/08 02:53:56 dawes Exp $ */ /* @@ -43,7 +39,7 @@ ** tree and for generating both Motif(TM) 1.2 and 2.x versions of the widgets ** in the same library. */ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawAP.h,v 1.2 2000/11/02 20:39:07 dawes Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwDrawAP.h,v 1.3 2001/05/02 13:37:45 dawes Exp $ */ #ifndef _GLwDrawAP_h #define _GLwDrawAP_h diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.c b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.c index 7cd5c1a23..35c34aabb 100755 --- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.c +++ b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.c @@ -31,10 +31,6 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2000/11/08 02:53:56 $ $Revision: 1.1.1.1 $ -*/ -/* -** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glw/Attic/GLwMDrawA.c,v 1.1.1.1 2000/11/08 02:53:56 dawes Exp $ */ #ifndef __GLX_MOTIF diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.h b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.h index a275aec47..d51abc8f6 100755 --- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.h +++ b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.h @@ -31,10 +31,6 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2000/11/08 02:53:56 $ $Revision: 1.1.1.1 $ -*/ -/* -** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glw/Attic/GLwMDrawA.h,v 1.1.1.1 2000/11/08 02:53:56 dawes Exp $ */ /* @@ -43,7 +39,7 @@ ** tree and for generating both Motif(TM) 1.2 and 2.x versions of the widgets ** in the same library. */ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.h,v 1.2 2000/11/02 20:39:07 dawes Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawA.h,v 1.3 2001/05/02 13:37:45 dawes Exp $ */ #ifndef __GLX_MOTIF #define __GLX_MOTIF 1 diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawAP.h b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawAP.h index b36bb7b93..4289c7bce 100755 --- a/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawAP.h +++ b/xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawAP.h @@ -31,10 +31,6 @@ ** published by SGI, but has not been independently verified as being ** compliant with the OpenGL(R) version 1.2.1 Specification. ** -** $Date: 2000/11/08 02:53:56 $ $Revision: 1.1.1.1 $ -*/ -/* -** $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glw/Attic/GLwMDrawAP.h,v 1.1.1.1 2000/11/08 02:53:56 dawes Exp $ */ /* @@ -43,7 +39,7 @@ ** tree and for generating both Motif(TM) 1.2 and 2.x versions of the widgets ** in the same library. */ -/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawAP.h,v 1.2 2000/11/02 20:39:07 dawes Exp $ */ +/* $XFree86: xc/extras/ogl-sample/main/gfx/lib/glw/GLwMDrawAP.h,v 1.3 2001/05/02 13:37:45 dawes Exp $ */ #ifndef __GLX_MOTIF #define __GLX_MOTIF 1 diff --git a/xc/extras/ogl-sample/main/gfx/lib/glw/GNUmakefile b/xc/extras/ogl-sample/main/gfx/lib/glw/GNUmakefile index 4dc3eb204..ba2a99ee1 100755 --- a/xc/extras/ogl-sample/main/gfx/lib/glw/GNUmakefile +++ b/xc/extras/ogl-sample/main/gfx/lib/glw/GNUmakefile @@ -32,8 +32,6 @@ # published by SGI, but has not been independently verified as being # compliant with the OpenGL(R) version 1.2.1 Specification. # -# $Date: 2000/11/08 02:53:56 $ $Revision: 1.1.1.1 $ -# $Header: /home/ajax/dri-backup/xc/xc/extras/ogl-sample/main/gfx/lib/glw/Attic/GNUmakefile,v 1.1.1.1 2000/11/08 02:53:56 dawes Exp $ include $(ROOT)/usr/include/make/commondefs diff --git a/xc/include/GL/Imakefile b/xc/include/GL/Imakefile index fc6458972..186f2cba5 100644 --- a/xc/include/GL/Imakefile +++ b/xc/include/GL/Imakefile @@ -1,14 +1,11 @@ - -XCOMM $XFree86: xc/include/GL/Imakefile,v 1.12 2001/03/22 21:48:52 dawes Exp $ +XCOMM $XFree86: xc/include/GL/Imakefile,v 1.13 2001/04/30 14:58:48 dawes Exp $ LinkSourceFile(gl.h, ../../extras/Mesa/include/GL) LinkSourceFile(glext.h, ../../extras/Mesa/include/GL) LinkSourceFile(osmesa.h, ../../extras/Mesa/include/GL) -#if BuildGLXLibrary GLXHEADERS = gl.h glext.h glu.h glx.h glxint.h glxmd.h glxproto.h \ glxtokens.h osmesa.h -#endif HEADERS = $(GLXHEADERS) @@ -19,3 +16,4 @@ InstallMultipleFlags($(HEADERS),$(INCDIR)/GL,$(INSTINCFLAGS)) InstallDriverSDKNonExecFile(glxint.h,$(DRIVERSDKINCLUDEDIR)/GL) InstallDriverSDKNonExecFile(glxtokens.h,$(DRIVERSDKINCLUDEDIR)/GL) + diff --git a/xc/include/Imakefile b/xc/include/Imakefile index af2d84d88..89c6ed9a0 100644 --- a/xc/include/Imakefile +++ b/xc/include/Imakefile @@ -3,11 +3,11 @@ XCOMM $Xorg: Imakefile,v 1.3 2000/08/18 04:05:43 coskrey Exp $ -XCOMM $XFree86: xc/include/Imakefile,v 3.27 2001/01/21 21:19:08 tsi Exp $ +XCOMM $XFree86: xc/include/Imakefile,v 3.28 2001/04/28 23:52:31 dawes Exp $ #define IHaveSubdirs #define PassCDebugFlags /**/ -#if BuildGLXLibrary +#if BuildGlxExt || BuildGLXLibrary GLXDIR = GL #endif diff --git a/xc/include/Xmd.h b/xc/include/Xmd.h index c464ddc63..39d647814 100644 --- a/xc/include/Xmd.h +++ b/xc/include/Xmd.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/Xmd.h,v 3.9 2001/01/17 17:53:11 dawes Exp $ */ +/* $XFree86: xc/include/Xmd.h,v 3.9.2.1 2001/05/30 14:29:30 alanh Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -146,26 +146,17 @@ typedef unsigned char CARD8; typedef CARD32 BITS32; typedef CARD16 BITS16; -#ifndef __CYGWIN__ #ifndef __EMX__ typedef CARD8 BYTE; typedef CARD8 BOOL; -#else +#else /* __EMX__ */ /* * This is bad style, but the central include file <os2.h> declares them * as well */ #define BYTE CARD8 #define BOOL CARD8 -#endif -#endif - -#ifdef __CYGWIN__ -#undef BYTE -#undef BOOL -#define BYTE CARD8 -#define BOOL CARD8 -#endif +#endif /* __EMX__ */ /* * definitions for sign-extending bitfields on 64-bit architectures diff --git a/xc/include/extensions/Imakefile b/xc/include/extensions/Imakefile index b99dc739b..51e20dcee 100644 --- a/xc/include/extensions/Imakefile +++ b/xc/include/extensions/Imakefile @@ -3,38 +3,38 @@ XCOMM $Xorg: Imakefile,v 1.3 2000/08/18 04:05:44 coskrey Exp $ -XCOMM $XFree86: xc/include/extensions/Imakefile,v 3.40 2001/04/23 16:17:06 tsi Exp $ +XCOMM $XFree86: xc/include/extensions/Imakefile,v 3.41 2001/04/28 23:52:32 dawes Exp $ -#if BuildScreenSaverExt +#if BuildScreenSaverExt || BuildScreenSaveLibrary SCREENSAVERHEADERS = saver.h saverproto.h scrnsaver.h #endif -#if BuildXF86MiscExt +#if BuildXF86MiscExt || BuildXF86MiscLibrary XF86MISCHEADERS = xf86misc.h xf86mscstr.h #endif #if BuildXF86BigfontExt XF86BIGFONTHEADERS = xf86bigfont.h xf86bigfstr.h #endif -#if BuildXF86VidModeExt +#if BuildXF86VidModeExt || BuildXF86VidModeLibrary XF86VIDMODEHEADERS = xf86vmode.h xf86vmstr.h #endif -#if BuildXF86DGA +#if BuildXF86DGA || BuildXF86DGALibrary XF86DGAHEADERS = xf86dga.h xf86dgastr.h xf86dga1.h xf86dga1str.h #endif #if BuildLBX LBXHEADERS = lbxbuf.h lbxbufstr.h lbxdeltastr.h lbximage.h lbxopts.h lbxstr.h lbxzlib.h #endif -#if BuildXvExt +#if BuildXvExt || BuildXvLibrary XVHEADERS = Xv.h Xvlib.h Xvproto.h XVMCHEADERS = XvMC.h XvMClib.h XvMCproto.h #endif -#if BuildXF86RushExt +#if BuildXF86RushExt || BuildXF86RushLibrary XF86RUSHHEADERS = xf86rush.h xf86rushstr.h #endif #if BuildFontCache FONTCACHEHEADERS = fontcache.h fontcacheP.h fontcachstr.h #endif -#if BuildXinerama +#if BuildXinerama || BuildXineramaLibrary XINERAMAHEADERS = panoramiXext.h panoramiXproto.h Xinerama.h #endif #if BuildRender || BuildXftLibrary diff --git a/xc/include/extensions/Xvproto.h b/xc/include/extensions/Xvproto.h index 0b44154d8..b4d8f22cd 100644 --- a/xc/include/extensions/Xvproto.h +++ b/xc/include/extensions/Xvproto.h @@ -21,7 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/include/extensions/Xvproto.h,v 1.5 2000/01/25 00:08:07 mvojkovi Exp $ */ +/* $XFree86: xc/include/extensions/Xvproto.h,v 1.6 2001/05/07 21:37:12 tsi Exp $ */ #ifndef XVPROTO_H #define XVPROTO_H @@ -49,6 +49,7 @@ SOFTWARE. ** */ +#include <X11/Xmd.h> /* Symbols: These are undefined at the end of this file to restore the values they have in Xv.h */ diff --git a/xc/include/extensions/shape.h b/xc/include/extensions/shape.h index 699712a57..6c01d4cb6 100644 --- a/xc/include/extensions/shape.h +++ b/xc/include/extensions/shape.h @@ -1,3 +1,4 @@ +/* $XFree86: xc/include/extensions/shape.h,v 1.1.1.3.2.1 2001/05/25 18:50:07 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -52,6 +53,9 @@ in this Software without prior written authorization from The Open Group. #define ShapeNumberEvents (ShapeNotify + 1) #ifndef _SHAPE_SERVER_ + +#include <X11/Xutil.h> + typedef struct { int type; /* of event */ unsigned long serial; /* # of last request processed by server */ diff --git a/xc/include/extensions/xf86vmode.h b/xc/include/extensions/xf86vmode.h index adc0b319a..facb1abc3 100644 --- a/xc/include/extensions/xf86vmode.h +++ b/xc/include/extensions/xf86vmode.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/extensions/xf86vmode.h,v 3.28 2001/01/17 17:53:23 dawes Exp $ */ +/* $XFree86: xc/include/extensions/xf86vmode.h,v 3.30 2001/05/07 20:09:50 mvojkovi Exp $ */ /* Copyright 1995 Kaleb S. KEITHLEY @@ -56,6 +56,9 @@ from Kaleb S. KEITHLEY #define X_XF86VidModeSetClientVersion 14 #define X_XF86VidModeSetGamma 15 #define X_XF86VidModeGetGamma 16 +#define X_XF86VidModeGetGammaRamp 17 +#define X_XF86VidModeSetGammaRamp 18 +#define X_XF86VidModeGetGammaRampSize 19 #define CLKFLAG_PROGRAMABLE 1 @@ -278,6 +281,31 @@ Bool XF86VidModeSetGamma( XF86VidModeGamma* /* Gamma */ ); +Bool XF86VidModeSetGammaRamp( + Display* /* dpy */, + int /* screen */, + int /* size */, + unsigned short* /* red array */, + unsigned short* /* green array */, + unsigned short* /* blue array */ +); + +Bool XF86VidModeGetGammaRamp( + Display* /* dpy */, + int /* screen */, + int /* size */, + unsigned short* /* red array */, + unsigned short* /* green array */, + unsigned short* /* blue array */ +); + +Bool XF86VidModeGetGammaRampSize( + Display* /* dpy */, + int /* screen */, + int* /* size */ +); + + _XFUNCPROTOEND #endif diff --git a/xc/include/extensions/xf86vmstr.h b/xc/include/extensions/xf86vmstr.h index 462c441fa..df9e31563 100644 --- a/xc/include/extensions/xf86vmstr.h +++ b/xc/include/extensions/xf86vmstr.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/include/extensions/xf86vmstr.h,v 3.24 2001/01/17 17:53:23 dawes Exp $ */ +/* $XFree86: xc/include/extensions/xf86vmstr.h,v 3.26 2001/05/06 21:59:47 mvojkovi Exp $ */ /* Copyright 1995 Kaleb S. KEITHLEY @@ -40,7 +40,7 @@ from Kaleb S. KEITHLEY #define XF86VIDMODENAME "XFree86-VidModeExtension" #define XF86VIDMODE_MAJOR_VERSION 2 /* current version numbers */ -#define XF86VIDMODE_MINOR_VERSION 0 +#define XF86VIDMODE_MINOR_VERSION 1 /* * major version 0 == uses parameter-to-wire functions in XFree86 libXxf86vm. * major version 1 == uses parameter-to-wire functions hard-coded in xvidtune @@ -483,5 +483,64 @@ typedef struct _XF86VidModeSetGamma { } xXF86VidModeSetGammaReq; #define sz_xXF86VidModeSetGammaReq 32 + +typedef struct _XF86VidModeSetGammaRamp { + CARD8 reqType; /* always XF86VidModeReqCode */ + CARD8 xf86vidmodeReqType; + CARD16 length B16; + CARD16 screen B16; + CARD16 size B16; +} xXF86VidModeSetGammaRampReq; +#define sz_xXF86VidModeSetGammaRampReq 8 + +typedef struct _XF86VidModeGetGammaRamp { + CARD8 reqType; /* always XF86VidModeReqCode */ + CARD8 xf86vidmodeReqType; + CARD16 length B16; + CARD16 screen B16; + CARD16 size B16; +} xXF86VidModeGetGammaRampReq; +#define sz_xXF86VidModeGetGammaRampReq 8 + +typedef struct { + BYTE type; + BOOL pad; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD16 size B16; + CARD16 pad0 B16; + CARD32 pad1 B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; +} xXF86VidModeGetGammaRampReply; +#define sz_xXF86VidModeGetGammaRampReply 32 + +typedef struct _XF86VidModeGetGammaRampSize { + CARD8 reqType; /* always XF86VidModeReqCode */ + CARD8 xf86vidmodeReqType; + CARD16 length B16; + CARD16 screen B16; + CARD16 pad B16; +} xXF86VidModeGetGammaRampSizeReq; +#define sz_xXF86VidModeGetGammaRampSizeReq 8 + +typedef struct { + BYTE type; + BOOL pad; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD16 size B16; + CARD16 pad0 B16; + CARD32 pad1 B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; +} xXF86VidModeGetGammaRampSizeReply; +#define sz_xXF86VidModeGetGammaRampSizeReply 32 + + #endif /* _XF86VIDMODESTR_H_ */ diff --git a/xc/lib/GL/glx/xfont.c b/xc/lib/GL/glx/xfont.c index f07dee8db..142aa386f 100644 --- a/xc/lib/GL/glx/xfont.c +++ b/xc/lib/GL/glx/xfont.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/glx/xfont.c,v 1.5 2001/03/21 16:04:39 dawes Exp $ */ +/* $XFree86: xc/lib/GL/glx/xfont.c,v 1.6 2001/05/02 15:06:02 dawes Exp $ */ /* * Mesa 3-D graphics library * Version: 3.1 @@ -249,7 +249,7 @@ void DRI_glXUseXFont( Font font, int first, int count, int listbase ) bm = (GLubyte *) Xmalloc((max_bm_width * max_bm_height) * sizeof (GLubyte)); if (!bm) { - XFreeFontInfo( NULL, fs, 0 ); + XFreeFontInfo( NULL, fs, 1 ); __glXSetError(CC, GL_OUT_OF_MEMORY); return; } @@ -362,7 +362,7 @@ bm_height); } Xfree(bm); - XFreeFontInfo( NULL, fs, 0 ); + XFreeFontInfo( NULL, fs, 1 ); XFreeGC (dpy, gc); /* Restore saved packing modes. */ diff --git a/xc/lib/GL/mesa/src/Imakefile b/xc/lib/GL/mesa/src/Imakefile index be3456e67..203651d9a 100644 --- a/xc/lib/GL/mesa/src/Imakefile +++ b/xc/lib/GL/mesa/src/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile,v 1.25 2001/04/03 02:29:33 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/Imakefile,v 1.26 2001/05/02 15:06:02 dawes Exp $ #include <Threads.tmpl> @@ -27,7 +27,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL #endif #if GlxBuiltInTdfx - TDFX_DEFS = -DFX + TDFX_DEFINES = -DFX #endif #ifdef i386Architecture @@ -39,11 +39,11 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL #include "Imakefile.inc" #ifdef UseCompaqMathLibrary - MATHDEF = -DCCPML + MATH_DEFINES = -DCCPML #endif - DEFINES = $(ALLOC_DEFINES) GlxDefines $(TDFX_DEFS) \ - $(MESA_ASM_DEFS) $(MATHDEF) + DEFINES = $(ALLOC_DEFINES) GlxDefines $(TDFX_DEFINES) \ + $(MESA_ASM_DEFINES) $(MATH_DEFINES) INCLUDES = -I$(INCLUDESRC) -I$(XINCLUDESRC) -I$(EXTINCSRC) \ -I$(MESASRCDIR)/src -I$(GLXLIBSRC)/dri SRCS = $(COREMESASRCS) diff --git a/xc/lib/GL/mesa/src/X86/Imakefile b/xc/lib/GL/mesa/src/X86/Imakefile index 9c28d6b26..3ca61bd0d 100644 --- a/xc/lib/GL/mesa/src/X86/Imakefile +++ b/xc/lib/GL/mesa/src/X86/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/X86/Imakefile,v 1.17 2001/04/03 02:29:34 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/X86/Imakefile,v 1.18 2001/05/02 15:06:03 dawes Exp $ /* * Only need SharedLib build unless OSMesa lib is built, or driver is built @@ -28,7 +28,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL #define NeedToLinkMesaSrc #include "Imakefile.inc" - DEFINES = $(ALLOC_DEFINES) GlxDefines /*-DFX*/ $(MESA_ASM_DEFS) + DEFINES = $(ALLOC_DEFINES) GlxDefines $(MESA_ASM_DEFINES) INCLUDES = -I$(INCLUDESRC) -I$(EXTINCSRC) -I$(MESASRCDIR)/src \ -I$(MESASRCDIR)/src/X86 @@ -86,4 +86,3 @@ ObjectFromAsmSource(katmai_xform_raw4, NullParameter) #endif DependTarget() - diff --git a/xc/lib/GL/mesa/src/X86/Imakefile.inc b/xc/lib/GL/mesa/src/X86/Imakefile.inc index 7f505e745..01d6348b1 100644 --- a/xc/lib/GL/mesa/src/X86/Imakefile.inc +++ b/xc/lib/GL/mesa/src/X86/Imakefile.inc @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/X86/Imakefile.inc,v 1.1 2001/03/23 19:18:37 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/X86/Imakefile.inc,v 1.2 2001/05/02 15:06:03 dawes Exp $ #ifndef MesaX86BuildDir #define MesaX86BuildDir $(GLXLIBSRC)/mesa/src/X86/ @@ -283,6 +283,5 @@ MESA_ASM_DOBJS = $(MESA_X86_DOBJS) $(MESA_MMX_DOBJS) $(MESA_3DNOW_DOBJS) \ MESA_ASM_POBJS = $(MESA_X86_POBJS) $(MESA_MMX_POBJS) $(MESA_3DNOW_POBJS) \ $(MESA_KATMAI_POBJS) -MESA_ASM_DEFS = -DUSE_X86_ASM $(MESA_MMX_DEFS) $(MESA_3DNOW_DEFS) \ - $(MESA_KATMAI_DEFS) +MESA_ASM_DEFINES = -DUSE_X86_ASM $(MESA_MMX_DEFS) $(MESA_3DNOW_DEFS) $(MESA_KATMAI_DEFS) diff --git a/xc/lib/GL/mesa/src/drv/common/Imakefile.inc b/xc/lib/GL/mesa/src/drv/common/Imakefile.inc index 7fff046d8..24b614c96 100644 --- a/xc/lib/GL/mesa/src/drv/common/Imakefile.inc +++ b/xc/lib/GL/mesa/src/drv/common/Imakefile.inc @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/common/Imakefile.inc,v 1.1 2001/03/23 19:18:38 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/common/Imakefile.inc,v 1.2 2001/05/02 15:06:03 dawes Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DDRIVERTS + DRI_DEFINES = GlxDefines DRI_INCLUDES = #endif diff --git a/xc/lib/GL/mesa/src/drv/ffb/Imakefile b/xc/lib/GL/mesa/src/drv/ffb/Imakefile index 60f89bb43..9722ff123 100644 --- a/xc/lib/GL/mesa/src/drv/ffb/Imakefile +++ b/xc/lib/GL/mesa/src/drv/ffb/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/ffb/Imakefile,v 1.11 2001/04/03 02:29:34 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/ffb/Imakefile,v 1.12 2001/05/10 16:56:10 dawes Exp $ #include <Threads.tmpl> @@ -47,7 +47,7 @@ NormalLintTarget($(SRCS)) #if !GlxUseBuiltInDRIDriver LIBNAME = ffb_dri.so -SharedDriModuleTarget($(LIBNAME),DONE,$(OBJS)) +SharedDriModuleTarget($(LIBNAME),DONE $(OBJS),$(OBJS)) InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri) #endif diff --git a/xc/lib/GL/mesa/src/drv/ffb/Imakefile.inc b/xc/lib/GL/mesa/src/drv/ffb/Imakefile.inc index c7608f765..72db80797 100644 --- a/xc/lib/GL/mesa/src/drv/ffb/Imakefile.inc +++ b/xc/lib/GL/mesa/src/drv/ffb/Imakefile.inc @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/ffb/Imakefile.inc,v 1.1 2001/03/23 19:18:39 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/ffb/Imakefile.inc,v 1.2 2001/05/02 15:06:03 dawes Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DDRIVERTS + DRI_DEFINES = GlxDefines DRI_INCLUDES = -I$(GLXLIBSRC)/dri -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) -I$(INCLUDESRC)/GL \ -I$(GLXLIBSRC)/mesa/dri \ diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_state.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_state.c index b083533e3..93865574d 100644 --- a/xc/lib/GL/mesa/src/drv/ffb/ffb_state.c +++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_state.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_state.c,v 1.1 2000/06/20 05:08:39 dawes Exp $ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_state.c,v 1.1.4.1 2001/05/24 16:35:38 dawes Exp $ * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000 David S. Miller @@ -548,6 +548,7 @@ static void ffbDDReducedPrimitiveChange(GLcontext *ctx, GLenum prim) "ffbDDReducedPrimitiveChange: prim(%d) ", prim); #endif switch(prim) { + case GL_POINT: case GL_POINTS: #ifdef STATE_TRACE fprintf(stderr, "GL_POINTS "); @@ -571,6 +572,7 @@ static void ffbDDReducedPrimitiveChange(GLcontext *ctx, GLenum prim) } break; + case GL_LINE: case GL_LINES: #ifdef STATE_TRACE fprintf(stderr, "GL_LINES "); diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c index 89c6a1c5c..f93a837b6 100644 --- a/xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c +++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c,v 1.2 2000/12/07 20:26:05 dawes Exp $ +/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c,v 1.2.4.1 2001/05/29 22:28:17 dawes Exp $ * * GLX Hardware Device Driver for Sun Creator/Creator3D * Copyright (C) 2000 David S. Miller @@ -339,6 +339,8 @@ void XMesaSwapBuffers(__DRIdrawablePrivate *driDrawPriv) ffbCtx->glCtx->Visual->DBflag == 0) return; + FLUSH_VB(ffbCtx->glCtx, "swap buffers"); + ffb = ffbCtx->regs; dac = ffbCtx->ffbScreen->dac; diff --git a/xc/lib/GL/mesa/src/drv/gamma/Imakefile b/xc/lib/GL/mesa/src/drv/gamma/Imakefile index c9a2fb6bf..bb19ea55e 100644 --- a/xc/lib/GL/mesa/src/drv/gamma/Imakefile +++ b/xc/lib/GL/mesa/src/drv/gamma/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/gamma/Imakefile,v 1.22 2001/04/03 02:29:35 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/gamma/Imakefile,v 1.23 2001/05/10 16:56:11 dawes Exp $ #include <Threads.tmpl> @@ -57,12 +57,12 @@ NormalLintTarget($(SRCS)) #if !GlxUseBuiltInDRIDriver LIBNAME = gamma_dri.so -SharedDriModuleTarget($(LIBNAME),DONE,$(OBJS)) +SharedDriModuleTarget($(LIBNAME),DONE $(OBJS),$(OBJS)) InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri) #ifdef GlxSoProf SOPROF_LIBNAME = _gamma_dri_p -NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE,$(OBJS)) +NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE $(OBJS),$(OBJS)) InstallLibrary($(SOPROF_LIBNAME),$(MODULEDIR)/dri) #endif #endif diff --git a/xc/lib/GL/mesa/src/drv/gamma/Imakefile.inc b/xc/lib/GL/mesa/src/drv/gamma/Imakefile.inc index a20bc7b55..69fb17703 100644 --- a/xc/lib/GL/mesa/src/drv/gamma/Imakefile.inc +++ b/xc/lib/GL/mesa/src/drv/gamma/Imakefile.inc @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/gamma/Imakefile.inc,v 1.1 2001/03/23 19:18:39 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/gamma/Imakefile.inc,v 1.2 2001/05/02 15:06:03 dawes Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DDRIVERTS + DRI_DEFINES = GlxDefines DRI_INCLUDES = -I$(GLXLIBSRC)/dri -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) -I$(INCLUDESRC)/GL \ -I$(GLXLIBSRC)/mesa/dri \ diff --git a/xc/lib/GL/mesa/src/drv/i810/Imakefile b/xc/lib/GL/mesa/src/drv/i810/Imakefile index e5220dce8..21d6e65a4 100644 --- a/xc/lib/GL/mesa/src/drv/i810/Imakefile +++ b/xc/lib/GL/mesa/src/drv/i810/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/i810/Imakefile,v 1.18 2001/04/03 02:29:35 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/i810/Imakefile,v 1.19 2001/05/10 16:56:11 dawes Exp $ #include <Threads.tmpl> @@ -57,12 +57,12 @@ NormalLintTarget($(SRCS)) #if !GlxUseBuiltInDRIDriver LIBNAME = i810_dri.so -SharedDriModuleTarget($(LIBNAME),DONE,$(OBJS)) +SharedDriModuleTarget($(LIBNAME),DONE $(OBJS),$(OBJS)) InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri) #ifdef GlxSoProf SOPROF_LIBNAME = _i810_dri_p -NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE,$(ALL_OBJS)) +NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE $(OBJS),$(ALL_OBJS)) InstallLibrary($(SOPROF_LIBNAME),$(MODULEDIR)/dri) #endif #endif diff --git a/xc/lib/GL/mesa/src/drv/i810/Imakefile.inc b/xc/lib/GL/mesa/src/drv/i810/Imakefile.inc index b6b0aa65b..4069af00c 100644 --- a/xc/lib/GL/mesa/src/drv/i810/Imakefile.inc +++ b/xc/lib/GL/mesa/src/drv/i810/Imakefile.inc @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/i810/Imakefile.inc,v 1.1 2001/03/23 19:18:40 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/i810/Imakefile.inc,v 1.2 2001/05/02 15:06:03 dawes Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DDRIVERTS + DRI_DEFINES = GlxDefines DRI_INCLUDES = -I$(GLXLIBSRC)/dri -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) -I$(INCLUDESRC)/GL \ -I$(GLXLIBSRC)/mesa/dri \ diff --git a/xc/lib/GL/mesa/src/drv/mga/Imakefile b/xc/lib/GL/mesa/src/drv/mga/Imakefile index 961fd205e..b1e1923f8 100644 --- a/xc/lib/GL/mesa/src/drv/mga/Imakefile +++ b/xc/lib/GL/mesa/src/drv/mga/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/mga/Imakefile,v 1.19 2001/04/03 02:29:35 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/mga/Imakefile,v 1.20 2001/05/10 16:56:11 dawes Exp $ #include <Threads.tmpl> @@ -58,12 +58,12 @@ NormalLintTarget($(SRCS)) #if !GlxUseBuiltInDRIDriver LIBNAME = mga_dri.so -SharedDriModuleTarget($(LIBNAME),DONE,$(OBJS)) +SharedDriModuleTarget($(LIBNAME),DONE $(OBJS),$(OBJS)) InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri) #ifdef GlxSoProf SOPROF_LIBNAME = _mga_dri_p -NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE,$(OBJS)) +NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE $(OBJS),$(OBJS)) InstallLibrary($(SOPROF_LIBNAME),$(MODULEDIR)/dri) #endif #endif diff --git a/xc/lib/GL/mesa/src/drv/mga/Imakefile.inc b/xc/lib/GL/mesa/src/drv/mga/Imakefile.inc index e923fc041..5d4ac8b63 100644 --- a/xc/lib/GL/mesa/src/drv/mga/Imakefile.inc +++ b/xc/lib/GL/mesa/src/drv/mga/Imakefile.inc @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/mga/Imakefile.inc,v 1.1 2001/03/23 19:18:41 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/mga/Imakefile.inc,v 1.2 2001/05/02 15:06:03 dawes Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DDRIVERTS + DRI_DEFINES = GlxDefines DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) \ diff --git a/xc/lib/GL/mesa/src/drv/mga/mgastate.c b/xc/lib/GL/mesa/src/drv/mga/mgastate.c index 203a92f27..926548a7d 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgastate.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgastate.c @@ -24,7 +24,7 @@ * Authors: * Keith Whitwell <keithw@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.9 2001/04/10 16:07:51 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgastate.c,v 1.10.2.1 2001/05/31 08:31:23 alanh Exp $ */ #include <stdio.h> @@ -391,20 +391,34 @@ static void mgaUpdateAlphaMode(GLcontext *ctx) int a = 0; /* determine source of alpha for blending and testing */ - if ( !ctx->Texture.ReallyEnabled ) + if ( !ctx->Texture.ReallyEnabled ) { a |= AC_alphasel_diffused; + } else { - switch (ctx->Texture.Unit[0].EnvMode) { - case GL_DECAL: - case GL_REPLACE: - a |= AC_alphasel_fromtex; - break; - case GL_BLEND: - case GL_MODULATE: - a |= AC_alphasel_modulated; - break; - default: - break; + /* G400: Regardless of texture env mode, we use the alpha from the + * texture unit (AC_alphasel_fromtex) since it will have already + * been modulated by the incoming fragment color, if needed. + * We don't want (AC_alphasel_modulate) since that'll effectively + * do the modulation twice. + */ + if (MGA_IS_G400(mmesa)) { + a |= AC_alphasel_fromtex; + } + else { + /* G200 */ + switch (ctx->Texture.Unit[0].EnvMode) { + case GL_DECAL: + a |= AC_alphasel_diffused; + case GL_REPLACE: + a |= AC_alphasel_fromtex; + break; + case GL_BLEND: + case GL_MODULATE: + a |= AC_alphasel_modulated; + break; + default: + break; + } } } diff --git a/xc/lib/GL/mesa/src/drv/mga/mgatex.c b/xc/lib/GL/mesa/src/drv/mga/mgatex.c index d99313c81..0f8d0349a 100644 --- a/xc/lib/GL/mesa/src/drv/mga/mgatex.c +++ b/xc/lib/GL/mesa/src/drv/mga/mgatex.c @@ -24,7 +24,7 @@ * Authors: * Keith Whitwell <keithw@valinux.com> */ -/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.c,v 1.10 2001/04/10 16:07:51 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.c,v 1.10.2.1 2001/05/31 08:31:23 alanh Exp $ */ #include <stdlib.h> #include <stdio.h> @@ -427,6 +427,8 @@ static void mgaUpdateTextureEnvG200( GLcontext *ctx ) t = (mgaTextureObjectPtr)tObj->DriverData; + t->setup.texctl2 &= ~TMC_decalblend_enable; + switch (ctx->Texture.Unit[0].EnvMode) { case GL_REPLACE: t->setup.texctl &= ~TMC_tmodulate_enable; @@ -436,6 +438,7 @@ static void mgaUpdateTextureEnvG200( GLcontext *ctx ) break; case GL_DECAL: t->setup.texctl &= ~TMC_tmodulate_enable; + t->setup.texctl2 |= TMC_decalblend_enable; break; case GL_BLEND: t->ctx->Fallback |= MGA_FALLBACK_TEXTURE; diff --git a/xc/lib/GL/mesa/src/drv/r128/Imakefile b/xc/lib/GL/mesa/src/drv/r128/Imakefile index aaa972958..e85916629 100644 --- a/xc/lib/GL/mesa/src/drv/r128/Imakefile +++ b/xc/lib/GL/mesa/src/drv/r128/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r128/Imakefile,v 1.16 2001/04/03 02:29:35 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r128/Imakefile,v 1.17 2001/05/10 16:56:11 dawes Exp $ #include <Threads.tmpl> @@ -58,12 +58,12 @@ NormalLintTarget($(SRCS)) #if !GlxUseBuiltInDRIDriver LIBNAME = r128_dri.so -SharedDriModuleTarget($(LIBNAME),DONE,$(OBJS)) +SharedDriModuleTarget($(LIBNAME),DONE $(OBJS),$(OBJS)) InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri) #ifdef GlxSoProf SOPROF_LIBNAME = _r128_dri_p -NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE,$(ALL_OBJS)) +NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE $(OBJS),$(ALL_OBJS)) InstallLibrary($(SOPROF_LIBNAME),$(MODULEDIR)/dri) #endif #endif diff --git a/xc/lib/GL/mesa/src/drv/r128/Imakefile.inc b/xc/lib/GL/mesa/src/drv/r128/Imakefile.inc index ebf4fc39f..daa6a4c09 100644 --- a/xc/lib/GL/mesa/src/drv/r128/Imakefile.inc +++ b/xc/lib/GL/mesa/src/drv/r128/Imakefile.inc @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r128/Imakefile.inc,v 1.2 2001/04/10 17:53:07 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/r128/Imakefile.inc,v 1.3 2001/05/02 15:06:04 dawes Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DDRIVERTS -DX_BYTE_ORDER=ByteOrder + DRI_DEFINES = GlxDefines -DX_BYTE_ORDER=ByteOrder DRI_INCLUDES = -I$(GLXLIBSRC)/dri -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) -I$(INCLUDESRC)/GL \ -I$(GLXLIBSRC)/mesa/dri \ diff --git a/xc/lib/GL/mesa/src/drv/radeon/Imakefile b/xc/lib/GL/mesa/src/drv/radeon/Imakefile index d22567f14..fa896fc93 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/Imakefile +++ b/xc/lib/GL/mesa/src/drv/radeon/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/radeon/Imakefile,v 1.5 2001/04/03 02:29:36 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/radeon/Imakefile,v 1.6 2001/05/10 16:56:11 dawes Exp $ #include <Threads.tmpl> @@ -58,12 +58,12 @@ NormalLintTarget($(SRCS)) #if !GlxUseBuiltInDRIDriver LIBNAME = radeon_dri.so -SharedDepModuleTarget($(LIBNAME),DONE,$(OBJS)) +SharedDepModuleTarget($(LIBNAME),DONE $(OBJS),$(OBJS)) InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri) #ifdef GlxSoProf SOPROF_LIBNAME = _radeon_dri_p -NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE,$(OBJS)) +NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE $(OBJS),$(OBJS)) InstallLibrary($(SOPROF_LIBNAME),$(MODULEDIR)/dri) #endif #endif diff --git a/xc/lib/GL/mesa/src/drv/radeon/Imakefile.inc b/xc/lib/GL/mesa/src/drv/radeon/Imakefile.inc index 22559bead..87dae79ba 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/Imakefile.inc +++ b/xc/lib/GL/mesa/src/drv/radeon/Imakefile.inc @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/radeon/Imakefile.inc,v 1.1 2001/03/23 19:18:42 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/radeon/Imakefile.inc,v 1.2 2001/05/02 15:06:04 dawes Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DDRIVERTS + DRI_DEFINES = GlxDefines DRI_INCLUDES = -I$(GLXLIBSRC)/dri \ -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) \ diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c index 7e901d9c7..6854b62e5 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c,v 1.2 2001/03/21 16:14:25 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_screen.c,v 1.3 2001/05/02 15:06:04 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -51,6 +51,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define PCI_CHIP_RADEON_QE 0x5145 #define PCI_CHIP_RADEON_QF 0x5146 #define PCI_CHIP_RADEON_QG 0x5147 +#define PCI_CHIP_RADEON_VE 0x5159 #endif @@ -122,6 +123,7 @@ radeonScreenPtr radeonCreateScreen( __DRIscreenPrivate *sPriv ) case PCI_CHIP_RADEON_QE: case PCI_CHIP_RADEON_QF: case PCI_CHIP_RADEON_QG: + case PCI_CHIP_RADEON_VE: radeonScreen->chipset = RADEON_CARD_TYPE_RADEON; break; default: diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c index 802bb3ab1..8985361b7 100644 --- a/xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c +++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c,v 1.3 2001/03/21 16:14:25 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/radeon/radeon_tex.c,v 1.3.2.1 2001/05/22 21:25:41 dawes Exp $ */ /************************************************************************** Copyright 2000, 2001 ATI Technologies Inc., Ontario, Canada, and @@ -90,10 +90,10 @@ static void radeonSetTexFilter( radeonTexObjPtr t, GLenum minf, GLenum magf ) case GL_NEAREST_MIPMAP_NEAREST: t->pp_txfilter |= RADEON_MIN_FILTER_NEAREST_MIP_NEAREST; break; - case GL_LINEAR_MIPMAP_NEAREST: + case GL_NEAREST_MIPMAP_LINEAR: t->pp_txfilter |= RADEON_MIN_FILTER_LINEAR_MIP_NEAREST; break; - case GL_NEAREST_MIPMAP_LINEAR: + case GL_LINEAR_MIPMAP_NEAREST: t->pp_txfilter |= RADEON_MIN_FILTER_NEAREST_MIP_LINEAR; break; case GL_LINEAR_MIPMAP_LINEAR: diff --git a/xc/lib/GL/mesa/src/drv/sis/Imakefile b/xc/lib/GL/mesa/src/drv/sis/Imakefile index 11d0966b3..d58ed4a30 100644 --- a/xc/lib/GL/mesa/src/drv/sis/Imakefile +++ b/xc/lib/GL/mesa/src/drv/sis/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/sis/Imakefile,v 1.16 2001/04/03 02:29:36 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/sis/Imakefile,v 1.17 2001/05/10 16:56:12 dawes Exp $ #include <Threads.tmpl> @@ -64,12 +64,12 @@ NormalLintTarget($(SRCS)) #if !GlxUseBuiltInDRIDriver LIBNAME = sis_dri.so -SharedDepModuleTarget($(LIBNAME),DONE,$(OBJS)) +SharedDepModuleTarget($(LIBNAME),DONE $(OBJS),$(OBJS)) InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri) #ifdef GlxSoProf SOPROF_LIBNAME = _sis_dri_p -NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE,$(OBJS)) +NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE $(OBJS),$(OBJS)) InstallLibrary($(SOPROF_LIBNAME),$(MODULEDIR)/dri) #endif #endif diff --git a/xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c b/xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c index 9e1eb105c..b1d87f599 100644 --- a/xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c +++ b/xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c @@ -24,7 +24,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/lib/GL/mesa/src/drv/sis/sis_xmesa.c,v 1.9 2000/12/22 09:20:04 alanh Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/sis/sis_xmesa.c,v 1.9.2.1 2001/05/22 21:25:41 dawes Exp $ */ /* * Authors: @@ -80,9 +80,9 @@ GLboolean XMesaInitDriver (__DRIscreenPrivate * driScrnPriv) { int major, minor, patch; if (XF86DRIQueryVersion(driScrnPriv->display, &major, &minor, &patch)) { - if (major != 3 || minor != 1 || patch < 0) { + if (major != 4 || minor < 0) { char msg[1000]; - sprintf(msg, "sis DRI driver expected DRI version 3.1.x but got version %d.%d.%d", major, minor, patch); + sprintf(msg, "sis DRI driver expected DRI version 4.0.x but got version %d.%d.%d", major, minor, patch); __driMesaMessage(msg); return GL_FALSE; } @@ -90,11 +90,11 @@ GLboolean XMesaInitDriver (__DRIscreenPrivate * driScrnPriv) } /* Check that the DDX driver version is compatible */ - if (driScrnPriv->ddxMajor != 1 || - driScrnPriv->ddxMinor != 0 || + if (driScrnPriv->ddxMajor != 0 || + driScrnPriv->ddxMinor != 1 || driScrnPriv->ddxPatch < 0) { char msg[1000]; - sprintf(msg, "sis DRI driver expected DDX driver version 1.0.x but got version %d.%d.%d", driScrnPriv->ddxMajor, driScrnPriv->ddxMinor, driScrnPriv->ddxPatch); + sprintf(msg, "sis DRI driver expected DDX driver version 0.1.x but got version %d.%d.%d", driScrnPriv->ddxMajor, driScrnPriv->ddxMinor, driScrnPriv->ddxPatch); __driMesaMessage(msg); return GL_FALSE; } diff --git a/xc/lib/GL/mesa/src/drv/tdfx/Imakefile b/xc/lib/GL/mesa/src/drv/tdfx/Imakefile index 7a17ca558..1017e80ee 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/Imakefile +++ b/xc/lib/GL/mesa/src/drv/tdfx/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/tdfx/Imakefile,v 1.24 2001/04/03 02:29:36 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/tdfx/Imakefile,v 1.25.2.1 2001/06/01 07:42:23 alanh Exp $ #include <Threads.tmpl> @@ -23,6 +23,8 @@ XCOMM $XFree86: xc/lib/GL/mesa/src/drv/tdfx/Imakefile,v 1.24 2001/04/03 02:29:36 #include "../../X86/Imakefile.inc" #endif + DEPEND_DEFINES = -D__linux__ + DEFINES = $(ALLOC_DEFINES) $(DRI_DEFINES) $(MESA_ASM_DEFINES) INCLUDES = $(X_INCLUDES) $(MESA_INCLUDES) $(DRI_INCLUDES) \ -I$(GLIDE3INCDIR) @@ -58,12 +60,12 @@ NormalLintTarget($(SRCS)) #if !GlxUseBuiltInDRIDriver LIBNAME = tdfx_dri.so -SharedDriModuleTarget($(LIBNAME),DONE,$(OBJS)) +SharedDriModuleTarget($(LIBNAME),DONE $(OBJS),$(OBJS)) InstallDynamicModule($(LIBNAME),$(MODULEDIR),dri) #ifdef GlxSoProf SOPROF_LIBNAME = _tdfx_dri_p -NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE,$(OBJS)) +NormalDepLibraryTarget($(SOPROF_LIBNAME),DONE $(OBJS),$(OBJS)) InstallLibrary($(SOPROF_LIBNAME),$(MODULEDIR)/dri) #endif #endif diff --git a/xc/lib/GL/mesa/src/drv/tdfx/Imakefile.inc b/xc/lib/GL/mesa/src/drv/tdfx/Imakefile.inc index 273eed852..79653b8eb 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/Imakefile.inc +++ b/xc/lib/GL/mesa/src/drv/tdfx/Imakefile.inc @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/GL/mesa/src/drv/tdfx/Imakefile.inc,v 1.1 2001/03/23 19:18:44 dawes Exp $ +XCOMM $XFree86: xc/lib/GL/mesa/src/drv/tdfx/Imakefile.inc,v 1.2 2001/05/02 15:06:04 dawes Exp $ #ifndef MesaDrvSrcDir #define MesaDrvSrcDir $(GLXLIBSRC)/mesa/src/drv @@ -16,7 +16,7 @@ ALLOC_DEFINES = -DMALLOC_0_RETURNS_NULL #endif #if BuildXF86DRI - DRI_DEFINES = GlxDefines -DFX_GLIDE3 -DDRIVERTS + DRI_DEFINES = GlxDefines -DFX_GLIDE3 DRI_INCLUDES = -I$(GLXLIBSRC)/dri -I$(GLXLIBSRC)/glx \ -I$(INCLUDESRC) -I$(INCLUDESRC)/GL \ -I$(GLXLIBSRC)/mesa/dri \ diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c index c38e10f19..76e6eabbd 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c +++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c,v 1.1 2001/03/21 16:14:27 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_context.c,v 1.1.2.1 2001/05/22 21:25:41 dawes Exp $ */ /* * Original rewrite: @@ -457,7 +457,7 @@ void tdfxDestroyContext( tdfxContextPtr fxMesa ) GLcontext *ctx = fxMesa->glCtx; struct gl_texture_object *tObj; - if ( ctx->Shared->RefCount == 1 ) { + if ( ctx->Shared->RefCount == 1 && fxMesa->driDrawable ) { /* This share group is about to go away, free our private * texture object data. */ diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c index aab9ad73d..955f25e3e 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c +++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c,v 1.3 2001/04/10 16:07:54 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_dd.c,v 1.4 2001/05/02 15:06:04 dawes Exp $ */ /* * Original rewrite: @@ -47,7 +47,7 @@ #include "X86/common_x86_asm.h" #endif -#define TDFX_DATE "20010321" +#define TDFX_DATE "20010501" /* These are used in calls to FX_grColorMaskv() */ diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c index 289ecde4d..bb8f6e8e9 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c +++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c,v 1.1 2001/03/21 16:14:28 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_state.c,v 1.2 2001/05/02 15:06:04 dawes Exp $ */ /* * Original rewrite: @@ -60,6 +60,7 @@ static void tdfxUpdateAlphaMode( GLcontext *ctx ) GrCmpFnc_t func; GrAlphaBlendFnc_t srcRGB, dstRGB, srcA, dstA; GrAlpha_t ref = ctx->Color.AlphaRef; + const int hasAlpha = ctx->Visual->AlphaBits > 0; if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) { fprintf( stderr, "%s()\n", __FUNCTION__ ); @@ -119,13 +120,13 @@ static void tdfxUpdateAlphaMode( GLcontext *ctx ) srcRGB = GR_BLEND_ONE_MINUS_SRC_ALPHA; break; case GL_DST_ALPHA: - srcRGB = GR_BLEND_DST_ALPHA; + srcRGB = hasAlpha ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE; break; case GL_ONE_MINUS_DST_ALPHA: - srcRGB = GR_BLEND_ONE_MINUS_DST_ALPHA; + srcRGB = hasAlpha ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO; break; case GL_SRC_ALPHA_SATURATE: - srcRGB = GR_BLEND_ALPHA_SATURATE; + srcRGB = hasAlpha ? GR_BLEND_ALPHA_SATURATE : GR_BLEND_ZERO; break; default: srcRGB = GR_BLEND_ONE; @@ -138,23 +139,23 @@ static void tdfxUpdateAlphaMode( GLcontext *ctx ) case GL_ONE: srcA = GR_BLEND_ONE; break; - case GL_DST_COLOR: - srcA = GR_BLEND_DST_ALPHA; /* Napalm only */ + case GL_DST_COLOR: /* Napalm only */ + srcA = hasAlpha ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE; break; - case GL_ONE_MINUS_DST_COLOR: - srcA = GR_BLEND_ONE_MINUS_DST_ALPHA; /* Napalm only */ + case GL_ONE_MINUS_DST_COLOR: /* Napalm only */ + srcA = hasAlpha ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO; break; - case GL_SRC_ALPHA: - srcA = GR_BLEND_SRC_ALPHA; /* Napalm only */ + case GL_SRC_ALPHA: /* Napalm only */ + srcA = GR_BLEND_SRC_ALPHA; break; - case GL_ONE_MINUS_SRC_ALPHA: - srcA = GR_BLEND_ONE_MINUS_SRC_ALPHA; /* Napalm only */ + case GL_ONE_MINUS_SRC_ALPHA: /* Napalm only */ + srcA = GR_BLEND_ONE_MINUS_SRC_ALPHA; break; - case GL_DST_ALPHA: - srcA = GR_BLEND_DST_ALPHA; /* Napalm only */ + case GL_DST_ALPHA: /* Napalm only */ + srcA = hasAlpha ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE; break; - case GL_ONE_MINUS_DST_ALPHA: - srcA = GR_BLEND_ONE_MINUS_DST_ALPHA; /* Napalm only */ + case GL_ONE_MINUS_DST_ALPHA: /* Napalm only */ + srcA = hasAlpha ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO; break; case GL_SRC_ALPHA_SATURATE: srcA = GR_BLEND_ONE; @@ -183,10 +184,10 @@ static void tdfxUpdateAlphaMode( GLcontext *ctx ) dstRGB = GR_BLEND_ONE_MINUS_SRC_ALPHA; break; case GL_DST_ALPHA: - dstRGB = GR_BLEND_DST_ALPHA; + dstRGB = hasAlpha ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE; break; case GL_ONE_MINUS_DST_ALPHA: - dstRGB = GR_BLEND_ONE_MINUS_DST_ALPHA; + dstRGB = hasAlpha ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO; break; default: dstRGB = GR_BLEND_ZERO; @@ -199,23 +200,23 @@ static void tdfxUpdateAlphaMode( GLcontext *ctx ) case GL_ONE: dstA = GR_BLEND_ONE; break; - case GL_SRC_COLOR: - dstA = GR_BLEND_SRC_ALPHA; /* Napalm only */ + case GL_SRC_COLOR: /* Napalm only */ + dstA = GR_BLEND_SRC_ALPHA; break; - case GL_ONE_MINUS_SRC_COLOR: - dstA = GR_BLEND_ONE_MINUS_SRC_ALPHA; /* Napalm only */ + case GL_ONE_MINUS_SRC_COLOR: /* Napalm only */ + dstA = GR_BLEND_ONE_MINUS_SRC_ALPHA; break; - case GL_SRC_ALPHA: - dstA = GR_BLEND_SRC_ALPHA; /* Napalm only */ + case GL_SRC_ALPHA: /* Napalm only */ + dstA = GR_BLEND_SRC_ALPHA; break; - case GL_ONE_MINUS_SRC_ALPHA: - dstA = GR_BLEND_ONE_MINUS_SRC_ALPHA; /* Napalm only */ + case GL_ONE_MINUS_SRC_ALPHA: /* Napalm only */ + dstA = GR_BLEND_ONE_MINUS_SRC_ALPHA; break; - case GL_DST_ALPHA: - dstA = GR_BLEND_DST_ALPHA; /* Napalm only */ + case GL_DST_ALPHA: /* Napalm only */ + dstA = hasAlpha ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE; break; - case GL_ONE_MINUS_DST_ALPHA: - dstA = GR_BLEND_ONE_MINUS_DST_ALPHA; /* Napalm only */ + case GL_ONE_MINUS_DST_ALPHA: /* Napalm only */ + dstA = hasAlpha ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO; break; default: dstA = GR_BLEND_ZERO; diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.c index ea0206ea7..4bf027560 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.c +++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.c @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.c,v 1.1 2001/03/21 16:14:28 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.c,v 1.1.2.1 2001/05/22 21:25:41 dawes Exp $ */ /* * Original rewrite: @@ -795,9 +795,11 @@ static void tdfxDDDeleteTexture( GLcontext *ctx, { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); - LOCK_HARDWARE( fxMesa ); - tdfxTMFreeTextureLocked( fxMesa, tObj ); - UNLOCK_HARDWARE( fxMesa ); + if ( fxMesa->driDrawable ) { + LOCK_HARDWARE( fxMesa ); + tdfxTMFreeTextureLocked( fxMesa, tObj ); + UNLOCK_HARDWARE( fxMesa ); + } fxMesa->new_state |= TDFX_NEW_TEXTURE; } diff --git a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c index 02c574bc5..16e1fb10a 100644 --- a/xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c +++ b/xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c @@ -23,7 +23,7 @@ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c,v 1.2 2001/04/10 16:07:54 dawes Exp $ */ +/* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_texman.c,v 1.2.2.1 2001/05/22 21:25:41 dawes Exp $ */ /* * Original rewrite: @@ -317,7 +317,7 @@ void tdfxTMClose( tdfxContextPtr fxMesa ) { GLcontext *ctx = fxMesa->glCtx; - if ( ctx->Shared->RefCount == 1 ) { + if ( ctx->Shared->RefCount == 1 && fxMesa->driDrawable ) { /* RefCount will soon go to zero, free our 3dfx stuff */ tdfxSharedStatePtr tss = (tdfxSharedStatePtr)ctx->Shared->DriverData; int unit; diff --git a/xc/lib/X11/Font.c b/xc/lib/X11/Font.c index 29d98a9d9..7fa5922e7 100644 --- a/xc/lib/X11/Font.c +++ b/xc/lib/X11/Font.c @@ -28,7 +28,7 @@ sale, use or other dealings in this Software without prior written authorization from the X Consortium and the XFree86 Project. */ -/* $XFree86: xc/lib/X11/Font.c,v 1.12 2001/01/17 19:41:35 dawes Exp $ */ +/* $XFree86: xc/lib/X11/Font.c,v 1.13 2001/05/01 07:53:46 alanh Exp $ */ #define NEED_REPLIES #include "Xlibint.h" @@ -39,11 +39,7 @@ authorization from the X Consortium and the XFree86 Project. #ifdef USE_XF86BIGFONT #include <sys/types.h> #ifdef HAS_SHM -#ifndef __CYGWIN__ #include <sys/ipc.h> -#else -#include <sys/cygipc.h> -#endif #include <sys/shm.h> #endif diff --git a/xc/lib/X11/Imakefile b/xc/lib/X11/Imakefile index 25d6abd7c..75b2da1f5 100644 --- a/xc/lib/X11/Imakefile +++ b/xc/lib/X11/Imakefile @@ -3,7 +3,7 @@ XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:44:38 cpqbld Exp $ -XCOMM $XFree86: xc/lib/X11/Imakefile,v 3.37 2001/04/23 16:17:07 tsi Exp $ +XCOMM $XFree86: xc/lib/X11/Imakefile,v 3.38 2001/05/01 10:35:05 alanh Exp $ #define DoNormalLib NormalLibX11 #define DoSharedLib SharedLibX11 @@ -901,6 +901,10 @@ MISCOBJS = os2Stubs.o OBJS = $(OBJS1) $(OBJS2) $(OBJS3) +#if UseCygIPC +REQUIREDLIBS = -lcygipc +#endif + #if !BuildServersOnly || XnestServer || BuildGLXLibrary || BuildClients #include <Library.tmpl> diff --git a/xc/lib/X11/XErrorDB b/xc/lib/X11/XErrorDB index 37c66d53e..d24eb59d2 100644 --- a/xc/lib/X11/XErrorDB +++ b/xc/lib/X11/XErrorDB @@ -19,7 +19,7 @@ ! other dealings in this Software without prior written authorization ! from The Open Group. ! -! $XFree86: xc/lib/X11/XErrorDB,v 3.34 2001/01/17 19:41:47 dawes Exp $ +! $XFree86: xc/lib/X11/XErrorDB,v 3.35 2001/05/18 23:35:28 dawes Exp $ ! ! these are used in XGetErrorMessage. XlibMessage.XError: X Error of failed request @@ -581,6 +581,9 @@ XRequest.XFree86-VidModeExtension.13: XF86VidModeGetDotClocks XRequest.XFree86-VidModeExtension.14: XF86VidModeSetClientVersion XRequest.XFree86-VidModeExtension.15: XF86VidModeSetGamma XRequest.XFree86-VidModeExtension.16: XF86VidModeGetGamma +XRequest.XFree86-VidModeExtension.17: XF86VidModeGetGammaRamp +XRequest.XFree86-VidModeExtension.18: XF86VidModeSetGammaRamp +XRequest.XFree86-VidModeExtension.19: XF86VidModeGetGammaRampSize XProtoError.XFree86-VidModeExtension.0: XF86VidModeBadClock XProtoError.XFree86-VidModeExtension.1: XF86VidModeBadHTimings XProtoError.XFree86-VidModeExtension.2: XF86VidModeBadVTimings diff --git a/xc/lib/X11/lcFile.c b/xc/lib/X11/lcFile.c index 6de7c6d51..20d173760 100644 --- a/xc/lib/X11/lcFile.c +++ b/xc/lib/X11/lcFile.c @@ -23,7 +23,7 @@ * SOFTWARE. * */ -/* $XFree86: xc/lib/X11/lcFile.c,v 3.21 2001/02/16 13:24:04 eich Exp $ */ +/* $XFree86: xc/lib/X11/lcFile.c,v 3.23 2001/05/18 23:35:28 dawes Exp $ */ #include <stdlib.h> #include <stdio.h> @@ -97,11 +97,7 @@ parse_line( break; } argv[argc++] = p; -#if 0 - while (!isspace(*p) && *p != ':' && *p != '\0') { -#else while (*p != ':' && *p != '\n' && *p != '\0') { -#endif ++p; } if (*p == '\0') { diff --git a/xc/lib/Xaw/Text.c b/xc/lib/Xaw/Text.c index dc5b1819a..568de0191 100644 --- a/xc/lib/Xaw/Text.c +++ b/xc/lib/Xaw/Text.c @@ -70,7 +70,7 @@ SOFTWARE. * XFree86 Project. */ -/* $XFree86: xc/lib/Xaw/Text.c,v 3.42 2001/01/30 21:54:33 paulo Exp $ */ +/* $XFree86: xc/lib/Xaw/Text.c,v 3.42.2.1 2001/05/25 21:44:59 paulo Exp $ */ #include <stdio.h> #include <X11/IntrinsicP.h> @@ -2498,12 +2498,14 @@ _XawTextSourceChanged(Widget w, XawTextPosition left, XawTextPosition right, int delta, line, line_from; if (left < ctx->text.old_insert) { + XawTextPosition old_insert = ctx->text.old_insert; + if (right < ctx->text.old_insert) - ctx->text.old_insert -= right - left; + old_insert -= right - left; else - ctx->text.old_insert = left; + old_insert = left; - ctx->text.insertPos = ctx->text.old_insert + block->length; + ctx->text.insertPos = old_insert + block->length; } #ifndef OLDXAW if (left <= ctx->text.lt.top) { diff --git a/xc/lib/Xext/Xext-def.cpp b/xc/lib/Xext/Xext-def.cpp index dfb724224..6d82ea1ba 100644 --- a/xc/lib/Xext/Xext-def.cpp +++ b/xc/lib/Xext/Xext-def.cpp @@ -102,8 +102,6 @@ EXPORTS XSecurityFreeXauth XSecurityGenerateAuthorization XSecurityRevokeAuthorization - XLbxQueryExtension - XLbxQueryVersion XagQueryVersion XagCreateAssociation XagCreateEmbeddedApplicationGroup @@ -139,4 +137,4 @@ EXPORTS XeviQueryVersion XeviGetVisualInfo /* $Xorg: Xext-def.cpp,v 1.3 2000/08/17 19:45:53 cpqbld Exp $ */ -/* $XFree86: xc/lib/Xext/Xext-def.cpp,v 1.7 2001/01/17 19:42:46 dawes Exp $ */ +/* $XFree86: xc/lib/Xext/Xext-def.cpp,v 1.8 2001/05/06 10:35:51 alanh Exp $ */ diff --git a/xc/lib/Xft/Xft.h b/xc/lib/Xft/Xft.h index 3e900de90..7746a7507 100644 --- a/xc/lib/Xft/Xft.h +++ b/xc/lib/Xft/Xft.h @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/Xft/Xft.h,v 1.18 2001/03/30 18:50:18 keithp Exp $ + * $XFree86: xc/lib/Xft/Xft.h,v 1.19 2001/04/29 03:21:17 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -58,6 +58,7 @@ typedef unsigned int XftChar32; #define XFT_SCALE "scale" /* double */ #define XFT_RENDER "render" /* Bool */ #define XFT_MINSPACE "minspace" /* Bool use minimum line spacing */ +#define XFT_DPI "dpi" /* double */ /* specific to FreeType rasterizer */ #define XFT_CHAR_WIDTH "charwidth" /* Int */ diff --git a/xc/lib/Xft/xftcolor.c b/xc/lib/Xft/xftcolor.c index 6443e00ec..b2f80bc2f 100644 --- a/xc/lib/Xft/xftcolor.c +++ b/xc/lib/Xft/xftcolor.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/Xft/xftcolor.c,v 1.1 2000/12/01 03:27:57 keithp Exp $ + * $XFree86: xc/lib/Xft/xftcolor.c,v 1.2 2001/05/16 17:20:06 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -110,7 +110,7 @@ XftColorAllocValue (Display *dpy, result->color.red = color->red; result->color.green = color->green; result->color.blue = color->blue; - result->color.alpha = 0xffff; + result->color.alpha = color->alpha; return True; } diff --git a/xc/lib/Xft/xftdir.c b/xc/lib/Xft/xftdir.c index 5fc684a01..36c3af2eb 100644 --- a/xc/lib/Xft/xftdir.c +++ b/xc/lib/Xft/xftdir.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/Xft/xftdir.c,v 1.2 2001/01/02 02:46:51 keithp Exp $ + * $XFree86: xc/lib/Xft/xftdir.c,v 1.3 2001/05/16 10:32:54 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -99,7 +99,11 @@ XftDirScan (XftFontSet *set, const char *dir, Bool force) if (font) { if (!XftFontSetAdd (set, font)) + { + XftPatternDestroy (font); + font = 0; ret = False; + } } id++; } while (font && ret && id < count); diff --git a/xc/lib/Xft/xftdpy.c b/xc/lib/Xft/xftdpy.c index 94d7928c1..2b4472a9a 100644 --- a/xc/lib/Xft/xftdpy.c +++ b/xc/lib/Xft/xftdpy.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/Xft/xftdpy.c,v 1.6 2001/01/26 20:51:15 keithp Exp $ + * $XFree86: xc/lib/Xft/xftdpy.c,v 1.7 2001/04/29 03:21:17 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -236,6 +236,8 @@ _XftDefaultInit (Display *dpy) goto bail1; if (!_XftDefaultInitDouble (dpy, pat, XFT_SCALE)) goto bail1; + if (!_XftDefaultInitDouble (dpy, pat, XFT_DPI)) + goto bail1; if (!_XftDefaultInitBool (dpy, pat, XFT_RENDER)) goto bail1; if (!_XftDefaultInitInteger (dpy, pat, XFT_RGBA)) @@ -388,6 +390,7 @@ XftDefaultSubstitute (Display *dpy, int screen, XftPattern *pattern) if (XftPatternGet (pattern, XFT_PIXEL_SIZE, 0, &v) == XftResultNoMatch) { int pixels, mm; + double dpi; if (XftPatternGet (pattern, XFT_SIZE, 0, &v) != XftResultMatch) { @@ -412,9 +415,10 @@ XftDefaultSubstitute (Display *dpy, int screen, XftPattern *pattern) size *= scale; pixels = DisplayHeight (dpy, screen); mm = DisplayHeightMM (dpy, screen); - size = size / 72.0; - size = size * 25.4; - size = size * pixels / mm; + dpi = (((double) DisplayHeight (dpy, screen) * 25.4) / + (double) DisplayHeightMM (dpy, screen)); + dpi = XftDefaultGetDouble (dpy, XFT_DPI, screen, dpi); + size = size * dpi / 72.0; XftPatternAddDouble (pattern, XFT_PIXEL_SIZE, size); } } diff --git a/xc/lib/Xft/xftdraw.c b/xc/lib/Xft/xftdraw.c index 409a5c947..49ca016ed 100644 --- a/xc/lib/Xft/xftdraw.c +++ b/xc/lib/Xft/xftdraw.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/Xft/xftdraw.c,v 1.14 2001/04/01 14:00:01 tsi Exp $ + * $XFree86: xc/lib/Xft/xftdraw.c,v 1.15 2001/05/16 19:20:43 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -414,7 +414,7 @@ XftDrawRect (XftDraw *draw, { if (XftDrawRenderPrepare (draw, color, 0, XFT_DRAW_SRC_RECT)) { - XRenderFillRectangle (draw->dpy, PictOpSrc, draw->render.pict, + XRenderFillRectangle (draw->dpy, PictOpOver, draw->render.pict, &color->color, x, y, width, height); } else diff --git a/xc/lib/Xft/xftfreetype.c b/xc/lib/Xft/xftfreetype.c index a750c10d0..62096da0b 100644 --- a/xc/lib/Xft/xftfreetype.c +++ b/xc/lib/Xft/xftfreetype.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/Xft/xftfreetype.c,v 1.12 2001/04/01 14:00:01 tsi Exp $ + * $XFree86: xc/lib/Xft/xftfreetype.c,v 1.13 2001/05/16 10:32:54 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -106,9 +106,11 @@ XftFreeTypeQuery (const char *file, int id, int *count) if (!XftPatternAddInteger (pat, XFT_INDEX, id)) goto bail1; +#if 0 if ((face->face_flags & FT_FACE_FLAG_FIXED_WIDTH) != 0) if (!XftPatternAddInteger (pat, XFT_SPACING, XFT_MONO)) goto bail1; +#endif if (!(face->face_flags & FT_FACE_FLAG_SCALABLE)) { diff --git a/xc/lib/Xft/xftglyphs.c b/xc/lib/Xft/xftglyphs.c index b06431131..5d6460a5e 100644 --- a/xc/lib/Xft/xftglyphs.c +++ b/xc/lib/Xft/xftglyphs.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/Xft/xftglyphs.c,v 1.12 2001/04/01 14:00:01 tsi Exp $ + * $XFree86: xc/lib/Xft/xftglyphs.c,v 1.13 2001/05/16 10:32:54 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -112,6 +112,7 @@ XftGlyphLoad (Display *dpy, if (font->charmap != -1) { glyphindex = FT_Get_Char_Index (font->face, charcode); +#if 0 if (!glyphindex) { if (_XftFontDebug() & XFT_DBG_GLYPH) @@ -119,6 +120,7 @@ XftGlyphLoad (Display *dpy, (int) charcode, (int) charcode); continue; } +#endif } else glyphindex = (FT_UInt) charcode; @@ -415,6 +417,23 @@ XftGlyphLoad (Display *dpy, #define STEP 256 +/* + * Return whether the given glyph generates any image on the screen, + * this means it exists or a default glyph exists + */ +static Bool +XftGlyphDrawable (Display *dpy, + XftFontStruct *font, + XftChar32 glyph) +{ + if (font->charmap != -1) + { + FT_Set_Charmap (font->face, font->face->charmaps[font->charmap]); + glyph = (XftChar32) FT_Get_Char_Index (font->face, (FT_ULong) glyph); + } + return glyph <= font->face->num_glyphs; +} + void XftGlyphCheck (Display *dpy, XftFontStruct *font, @@ -445,7 +464,7 @@ XftGlyphCheck (Display *dpy, } if (font->realized[glyph] == _UntestedGlyph) { - if (XftFreeTypeGlyphExists (dpy, font, glyph)) + if (XftGlyphDrawable (dpy, font, glyph)) { font->realized[glyph] = (XGlyphInfo *) malloc (sizeof (XGlyphInfo)); n = *nmissing; diff --git a/xc/lib/Xft/xftgram.y b/xc/lib/Xft/xftgram.y index b58dcddbf..e9dad4d2b 100644 --- a/xc/lib/Xft/xftgram.y +++ b/xc/lib/Xft/xftgram.y @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/Xft/xftgram.y,v 1.4 2001/03/31 01:57:20 keithp Exp $ + * $XFree86: xc/lib/Xft/xftgram.y,v 1.5 2001/05/16 10:32:54 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -258,7 +258,7 @@ XftTestCreate (XftQual qual, const char *field, XftOp compare, XftValue value) { test->next = 0; test->qual = qual; - test->field = _XftSaveString (field); + test->field = field; /* already saved in grammar */ test->op = compare; if (value.type == XftTypeString) value.u.s = _XftSaveString (value.u.s); @@ -428,7 +428,7 @@ XftEditCreate (const char *field, XftOp op, XftExpr *expr) if (e) { e->next = 0; - e->field = _XftSaveString (field); + e->field = field; /* already saved in grammar */ e->op = op; e->expr = expr; } diff --git a/xc/lib/Xft/xftint.h b/xc/lib/Xft/xftint.h index 37b8e8d81..f92dd4876 100644 --- a/xc/lib/Xft/xftint.h +++ b/xc/lib/Xft/xftint.h @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/Xft/xftint.h,v 1.24 2001/03/31 01:57:20 keithp Exp $ + * $XFree86: xc/lib/Xft/xftint.h,v 1.25 2001/05/18 16:03:06 tsi Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -135,7 +135,7 @@ typedef enum _XftQual { typedef struct _XftTest { struct _XftTest *next; XftQual qual; - char *field; + const char *field; XftOp op; XftValue value; } XftTest; diff --git a/xc/lib/Xft/xftlex.l b/xc/lib/Xft/xftlex.l index c426fa315..3eff3f429 100644 --- a/xc/lib/Xft/xftlex.l +++ b/xc/lib/Xft/xftlex.l @@ -1,6 +1,6 @@ %{ /* - * $XFree86: xc/lib/Xft/xftlex.l,v 1.5 2001/03/31 01:57:20 keithp Exp $ + * $XFree86: xc/lib/Xft/xftlex.l,v 1.7 2001/05/18 16:03:06 tsi Exp $ * * Copyright (c) 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -76,16 +76,20 @@ int XftConfigFiledeep = 0; static int input (void) { char buf[1]; - int r; + static int r = EOF; - YY_INPUT(buf, r, 1); if (r == 0) return 0; + YY_INPUT(buf, r, 1); + if (r == 0) + return EOF; return buf[0]; } static void unput (char c) { + if (!c || c == EOF) + return; if (c == '\n') XftConfigLineno--; ungetc (c, XftConfigInput); @@ -173,6 +177,7 @@ _XftConfigSkipLine (void) do { c = input(); } while (c != EOF && c != '\n'); + if (c == '\n') unput('\n'); } Bool @@ -250,6 +255,7 @@ _XftConfigPopInput (void) if (c >= 0) return c; fclose (XftConfigInput); + XftConfigInput = 0; if (XftConfigInpt == XftConfigInStack + XFT_CONFIG_IN_DEEP) return EOF; XftConfigInput = *XftConfigInpt++; @@ -259,3 +265,11 @@ _XftConfigPopInput (void) --XftConfigFiledeep; } } + +void +XftConfigLexDone (void) +{ +#ifdef FLEX_SCANNER + XftConfig_delete_buffer (XftConfig_current_buffer); +#endif +} diff --git a/xc/lib/Xmuu/Imakefile b/xc/lib/Xmuu/Imakefile index 32a564b0d..b8f0b1d6d 100644 --- a/xc/lib/Xmuu/Imakefile +++ b/xc/lib/Xmuu/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/Xmuu/Imakefile,v 1.1 2001/03/30 02:18:41 keithp Exp $ +XCOMM $XFree86: xc/lib/Xmuu/Imakefile,v 1.2 2001/05/11 08:16:54 alanh Exp $ XCOMM Mini Xmu library: pull out just those things that are used by apps XCOMM that do not use Xt and Xaw in the core applications XCOMM @@ -47,7 +47,10 @@ OBJS = ClientWin.o\ GetHost.o\ Lower.o -INCLUDES = -I$(XMUSRC) +### Commented out following line... +### INCLUDES = -I$(XMUSRC) +### ... it breaks Lower.c (which needs -I../../lib/misc to find snprintf.c) +### #include <Library.tmpl> diff --git a/xc/lib/Xrender/Xrender.c b/xc/lib/Xrender/Xrender.c index 94e63f01d..10a601573 100644 --- a/xc/lib/Xrender/Xrender.c +++ b/xc/lib/Xrender/Xrender.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/Xrender/Xrender.c,v 1.3 2000/12/01 21:32:00 keithp Exp $ + * $XFree86: xc/lib/Xrender/Xrender.c,v 1.4 2001/05/16 10:33:16 keithp Exp $ * * Copyright © 2000 SuSE, Inc. * @@ -160,6 +160,7 @@ XRenderQueryFormats (Display *dpy) xPictScreen *xScreen; xPictDepth *xDepth; xPictVisual *xVisual; + void *xData; int nf, ns, nd, nv; int rlength; @@ -190,19 +191,20 @@ XRenderQueryFormats (Display *dpy) rep.numScreens * sizeof (xPictScreen) + rep.numDepths * sizeof (xPictDepth) + rep.numVisuals * sizeof (xPictVisual)); - xFormat = (xPictFormInfo *) Xmalloc (rlength); + xData = (void *) Xmalloc (rlength); if (!xri || !xFormat) { if (xri) Xfree (xri); - if (xFormat) Xfree (xFormat); + if (xData) Xfree (xData); _XEatData (dpy, rlength); UnlockDisplay (dpy); SyncHandle (); return 0; } - _XRead (dpy, (char *) xFormat, rlength); + _XRead (dpy, (char *) xData, rlength); format = xri->format; + xFormat = (xPictFormInfo *) xData; for (nf = 0; nf < rep.numFormats; nf++) { format->id = xFormat->id; @@ -248,6 +250,7 @@ XRenderQueryFormats (Display *dpy) } xScreen = (xPictScreen *) xDepth; } + Xfree (xData); info->data = (XPointer) xri; return 1; } diff --git a/xc/lib/Xv/Xv.c b/xc/lib/Xv/Xv.c index 65f005e4f..a364351f3 100644 --- a/xc/lib/Xv/Xv.c +++ b/xc/lib/Xv/Xv.c @@ -21,7 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/lib/Xv/Xv.c,v 1.14 2000/05/25 20:47:39 mvojkovi Exp $ */ +/* $XFree86: xc/lib/Xv/Xv.c,v 1.15 2001/05/11 08:23:22 alanh Exp $ */ /* ** File: ** @@ -189,12 +189,16 @@ XvQueryAdaptors( /* GET INPUT ADAPTORS */ - size = rep.num_adaptors*sizeof(XvAdaptorInfo); - if ((pas=(XvAdaptorInfo *)Xmalloc(size))==NULL) { - Xfree(buffer); - UnlockDisplay(dpy); - SyncHandle(); - return(XvBadAlloc); + if (rep.num_adaptors == 0) { + pas = NULL; + } else { + size = rep.num_adaptors*sizeof(XvAdaptorInfo); + if ((pas=(XvAdaptorInfo *)Xmalloc(size))==NULL) { + Xfree(buffer); + UnlockDisplay(dpy); + SyncHandle(); + return(XvBadAlloc); + } } /* INIT ADAPTOR FIELDS */ @@ -204,6 +208,7 @@ XvQueryAdaptors( pa->num_adaptors = 0; pa->name = (char *)NULL; pa->formats = (XvFormat *)NULL; + pa++; } pa = pas; diff --git a/xc/lib/Xxf86vm/XF86VMode.c b/xc/lib/Xxf86vm/XF86VMode.c index d8d5ee9e4..b6ef6cf64 100644 --- a/xc/lib/Xxf86vm/XF86VMode.c +++ b/xc/lib/Xxf86vm/XF86VMode.c @@ -1,5 +1,5 @@ /* $XConsortium: XF86VMode.c /main/2 1995/11/14 18:17:58 kaleb $ */ -/* $XFree86: xc/lib/Xxf86vm/XF86VMode.c,v 3.29 2000/08/22 16:14:47 alanh Exp $ */ +/* $XFree86: xc/lib/Xxf86vm/XF86VMode.c,v 3.31 2001/05/07 20:11:13 mvojkovi Exp $ */ /* Copyright (c) 1995 Kaleb S. KEITHLEY @@ -1109,3 +1109,102 @@ XF86VidModeGetDotClocks(dpy, screen, return True; } +Bool +XF86VidModeSetGammaRamp ( + Display *dpy, + int screen, + int size, + unsigned short *red, + unsigned short *green, + unsigned short *blue +) +{ + int length = (size + 1) & ~1; + XExtDisplayInfo *info = find_display (dpy); + xXF86VidModeSetGammaRampReq *req; + + XF86VidModeCheckExtension (dpy, info, False); + LockDisplay(dpy); + GetReq(XF86VidModeSetGammaRamp, req); + req->reqType = info->codes->major_opcode; + req->xf86vidmodeReqType = X_XF86VidModeSetGammaRamp; + req->screen = screen; + req->length += (length >> 1) * 3; + req->size = size; + _XSend(dpy, (char*)red, size * 2); + _XSend(dpy, (char*)green, size * 2); + _XSend(dpy, (char*)blue, size * 2); + UnlockDisplay(dpy); + SyncHandle(); + return True; +} + + +Bool +XF86VidModeGetGammaRamp ( + Display *dpy, + int screen, + int size, + unsigned short *red, + unsigned short *green, + unsigned short *blue +) +{ + XExtDisplayInfo *info = find_display (dpy); + xXF86VidModeGetGammaRampReq *req; + xXF86VidModeGetGammaRampReply rep; + + XF86VidModeCheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86VidModeGetGammaRamp, req); + req->reqType = info->codes->major_opcode; + req->xf86vidmodeReqType = X_XF86VidModeGetGammaRamp; + req->screen = screen; + req->size = size; + if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) { + UnlockDisplay (dpy); + SyncHandle (); + return False; + } + if(rep.size) { + _XRead(dpy, (char*)red, rep.size << 1); + _XRead(dpy, (char*)green, rep.size << 1); + _XRead(dpy, (char*)blue, rep.size << 1); + } + + UnlockDisplay(dpy); + SyncHandle(); + return True; +} + +Bool XF86VidModeGetGammaRampSize( + Display *dpy, + int screen, + int *size +) +{ + XExtDisplayInfo *info = find_display (dpy); + xXF86VidModeGetGammaRampSizeReq *req; + xXF86VidModeGetGammaRampSizeReply rep; + + *size = 0; + + XF86VidModeCheckExtension (dpy, info, False); + + LockDisplay(dpy); + GetReq(XF86VidModeGetGammaRampSize, req); + req->reqType = info->codes->major_opcode; + req->xf86vidmodeReqType = X_XF86VidModeGetGammaRampSize; + req->screen = screen; + if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) { + UnlockDisplay (dpy); + SyncHandle (); + return False; + } + *size = rep.size; + UnlockDisplay(dpy); + SyncHandle(); + return True; +} + diff --git a/xc/lib/font/FreeType/ftfuncs.c b/xc/lib/font/FreeType/ftfuncs.c index 10e320b38..941df8bee 100644 --- a/xc/lib/font/FreeType/ftfuncs.c +++ b/xc/lib/font/FreeType/ftfuncs.c @@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/lib/font/FreeType/ftfuncs.c,v 1.17 2001/02/13 21:15:15 dawes Exp $ */ +/* $XFree86: xc/lib/font/FreeType/ftfuncs.c,v 1.18 2001/05/16 08:32:33 alanh Exp $ */ #ifndef FONT_MODULE #include <string.h> @@ -739,7 +739,7 @@ FreeTypeAddProperties(TTFFont *font, FontScalablePtr vals, FontInfoPtr info, int rawAverageWidth) { int i, j, maxprops; - char *sp, *ep, val[256]; + char *sp, *ep, val[MAXFONTNAMELEN]; TT_Instance_Metrics imetrics; int upm; /* units per em */ TTFFace *face; diff --git a/xc/lib/font/fontfile/fontdir.c b/xc/lib/font/fontfile/fontdir.c index faad6e110..6c9883563 100644 --- a/xc/lib/font/fontfile/fontdir.c +++ b/xc/lib/font/fontfile/fontdir.c @@ -21,7 +21,7 @@ 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/lib/font/fontfile/fontdir.c,v 3.14 2001/02/16 13:24:05 eich Exp $ */ +/* $XFree86: xc/lib/font/fontfile/fontdir.c,v 3.17 2001/05/15 00:05:32 keithp Exp $ */ /* * Author: Keith Packard, MIT X Consortium @@ -202,13 +202,52 @@ FontFileAddEntry(FontTablePtr table, FontEntryPtr prototype) return entry; } +/* + * Compare two strings just like strcmp, but preserve decimal integer + * sorting order, i.e. "2" < "10" or "iso8859-2" < "iso8859-10" < + * "iso10646-1". Strings are sorted as if sequences of digits were + * prefixed by a length indicator (i.e., does not ignore leading zeroes). + * + * Markus Kuhn <Markus.Kuhn@cl.cam.ac.uk> + */ +#define Xisdigit(c) ('\060' <= (c) && (c) <= '\071') + +static int strcmpn(const char *s1, const char *s2) +{ + int digits, predigits = 0; + const char *ss1, *ss2; + + while (1) { + if (*s1 == 0 && *s2 == 0) + return 0; + digits = Xisdigit(*s1) && Xisdigit(*s2); + if (digits && !predigits) { + ss1 = s1; + ss2 = s2; + while (Xisdigit(*ss1) && Xisdigit(*ss2)) + ss1++, ss2++; + if (!Xisdigit(*ss1) && Xisdigit(*ss2)) + return -1; + if (Xisdigit(*ss1) && !Xisdigit(*ss2)) + return 1; + } + if ((unsigned char)*s1 < (unsigned char)*s2) + return -1; + if ((unsigned char)*s1 > (unsigned char)*s2) + return 1; + predigits = digits; + s1++, s2++; + } +} + + static int FontFileNameCompare(const void* a, const void* b) { FontEntryPtr a_name = (FontEntryPtr) a, b_name = (FontEntryPtr) b; - return strcmp(a_name->name.name, b_name->name.name); + return strcmpn(a_name->name.name, b_name->name.name); } void @@ -244,6 +283,7 @@ FontFileSortDir(FontDirectoryPtr dir) */ #define isWild(c) ((c) == XK_asterisk || (c) == XK_question) +#define isDigit(c) (XK_0 <= (c) && (c) <= XK_9) static int SetupWildMatch(FontTablePtr table, FontNamePtr pat, @@ -253,6 +293,7 @@ SetupWildMatch(FontTablePtr table, FontNamePtr pat, char c; char *t; char *firstWild; + char *firstDigit; int first; int center, left, @@ -263,12 +304,17 @@ SetupWildMatch(FontTablePtr table, FontNamePtr pat, name = pat->name; nDashes = pat->ndashes; firstWild = 0; + firstDigit = 0; t = name; while ((c = *t++)) { if (isWild(c)) { if (!firstWild) firstWild = t - 1; } + if (isDigit(c)) { + if (!firstDigit) + firstDigit = t - 1; + } } left = 0; right = table->used; @@ -281,7 +327,10 @@ SetupWildMatch(FontTablePtr table, FontNamePtr pat, *rightp = right; return -1; } else if (firstWild) { - first = firstWild - name; + if (firstDigit && firstDigit < firstWild) + first = firstDigit - name; + else + first = firstWild - name; while (left < right) { center = (left + right) / 2; result = strncmp(name, table->entries[center].name.name, first); @@ -298,7 +347,7 @@ SetupWildMatch(FontTablePtr table, FontNamePtr pat, } else { while (left < right) { center = (left + right) / 2; - result = strcmp(name, table->entries[center].name.name); + result = strcmpn(name, table->entries[center].name.name); if (result == 0) return center; if (result < 0) @@ -574,7 +623,7 @@ FontFileAddFontFile (FontDirectoryPtr dir, char *fontName, char *fileName) FontRendererPtr renderer; FontEntryPtr existing; FontScalableExtraPtr extra; - FontEntryPtr bitmap, scalable; + FontEntryPtr bitmap = 0, scalable; Bool isscale; renderer = FontFileMatchRenderer (fileName); diff --git a/xc/lib/freetype2/Imakefile b/xc/lib/freetype2/Imakefile index a015d09fd..953afc269 100644 --- a/xc/lib/freetype2/Imakefile +++ b/xc/lib/freetype2/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/freetype2/Imakefile,v 1.2 2001/02/08 00:55:40 keithp Exp $ +XCOMM $XFree86: xc/lib/freetype2/Imakefile,v 1.4 2001/05/16 03:57:27 keithp Exp $ #define IHaveSubdirs #define PassCDebugFlags @@ -19,14 +19,45 @@ FREETYPETOP = $(TOP)/extras/freetype2 FREETYPESRC = $(FREETYPETOP)/src FREETYPEINC = $(FREETYPETOP)/include/freetype -INCLUDES = $(FREETYPE2INCLUDES) -I$(FREETYPETOP)/src +INCLUDES = -I. $(FREETYPE2INCLUDES)\ + -I$(FREETYPESRC)\ + -I$(FREETYPESRC)/base\ + -I$(FREETYPESRC)/autohint\ + -I$(FREETYPESRC)/sfnt\ + -I$(FREETYPESRC)/cff\ + -I$(FREETYPESRC)/psnames\ + -I$(FREETYPESRC)/psaux\ + -I$(FREETYPESRC)/truetype\ + -I$(FREETYPESRC)/type1\ + -I$(FREETYPESRC)/cid\ + -I$(FREETYPESRC)/raster\ + -I$(FREETYPESRC)/smooth\ + -I$(FREETYPESRC)/winfonts\ + -I$(FREETYPESRC)/pcf SUBDIRS=freetype - - -SRCS_BASE = ftsystem.c ftinit.c ftdebug.c ftbase.c ftglyph.c ftbbox.c ftmm.c -OBJS_BASE = ftsystem.o ftinit.o ftdebug.o ftbase.o ftglyph.o ftbbox.o ftmm.o +HEADERS=ft2build.h + +SRCS_BASE = ftbase.c \ + ftbbox.c \ + ftdebug.c \ + ftextend.c \ + ftglyph.c \ + ftinit.c \ + ftmm.c \ + ftsynth.c \ + ftsystem.c + +OBJS_BASE = ftbase.o \ + ftbbox.o \ + ftdebug.o \ + ftextend.o \ + ftglyph.o \ + ftinit.o \ + ftmm.o \ + ftsynth.o \ + ftsystem.o SRCS_AUTOHINT = autohint.c OBJS_AUTOHINT = autohint.o @@ -61,14 +92,18 @@ OBJS_SMOOTH = smooth.o SRCS_WINFONTS = winfnt.c OBJS_WINFONTS = winfnt.o +SRCS_PCF = pcf.c +OBJS_PCF = pcf.o SRCS = $(SRCS_BASE) $(SRCS_AUTOHINT) $(SRCS_SFNT) $(SRCS_CFF) \ $(SRCS_PSNAMES) $(SRCS_PSAUX) $(SRCS_TRUETYPE) $(SRCS_TYPE1) \ - $(SRCS_CID) $(SRCS_RASTER) $(SRCS_SMOOTH) $(SRCS_WINFONTS) + $(SRCS_CID) $(SRCS_RASTER) $(SRCS_SMOOTH) $(SRCS_WINFONTS) \ + $(SRCS_PCF) OBJS = $(OBJS_BASE) $(OBJS_AUTOHINT) $(OBJS_SFNT) $(OBJS_CFF) \ $(OBJS_PSNAMES) $(OBJS_PSAUX) $(OBJS_TRUETYPE) $(OBJS_TYPE1) \ - $(OBJS_CID) $(OBJS_RASTER) $(OBJS_SMOOTH) $(OBJS_WINFONTS) + $(OBJS_CID) $(OBJS_RASTER) $(OBJS_SMOOTH) $(OBJS_WINFONTS) \ + $(OBJS_PCF) #include <Library.tmpl> @@ -81,14 +116,22 @@ MANSUFFIX = $(LIBMANSUFFIX) InstallManPage(Freetype,$(LIBMANDIR)) #endif +BuildIncludes($(HEADERS),freetype2,..) +InstallMultipleFlags($(HEADERS),$(INCDIR)/freetype2,$(INSTINCFLAGS)) + +LinkSourceFile(ft2build.h,$(FREETYPETOP)/include) -LinkSourceFile(ftsystem.c,$(FREETYPESRC)/base) -LinkSourceFile(ftinit.c,$(FREETYPESRC)/base) -LinkSourceFile(ftdebug.c,$(FREETYPESRC)/base) LinkSourceFile(ftbase.c,$(FREETYPESRC)/base) -LinkSourceFile(ftglyph.c,$(FREETYPESRC)/base) LinkSourceFile(ftbbox.c,$(FREETYPESRC)/base) +LinkSourceFile(ftdebug.c,$(FREETYPESRC)/base) +LinkSourceFile(ftextend.c,$(FREETYPESRC)/base) +LinkSourceFile(ftglyph.c,$(FREETYPESRC)/base) +LinkSourceFile(ftinit.c,$(FREETYPESRC)/base) +LinkSourceFile(ftlist.c,$(FREETYPESRC)/base) LinkSourceFile(ftmm.c,$(FREETYPESRC)/base) +LinkSourceFile(ftsynth.c,$(FREETYPESRC)/base) +LinkSourceFile(ftsystem.c,$(FREETYPESRC)/base) + LinkSourceFile(autohint.c,$(FREETYPESRC)/autohint) LinkSourceFile(sfnt.c,$(FREETYPESRC)/sfnt) LinkSourceFile(cff.c,$(FREETYPESRC)/cff) @@ -100,6 +143,8 @@ LinkSourceFile(type1cid.c,$(FREETYPESRC)/cid) LinkSourceFile(raster.c,$(FREETYPESRC)/raster) LinkSourceFile(smooth.c,$(FREETYPESRC)/smooth) LinkSourceFile(winfnt.c,$(FREETYPESRC)/winfonts) - +LinkSourceFile(pcf.c,$(FREETYPESRC)/pcf) DependTarget() + +DependSubdirs($(SUBDIRS)) diff --git a/xc/lib/freetype2/freetype/Imakefile b/xc/lib/freetype2/freetype/Imakefile index beb44b31e..57bd20c28 100644 --- a/xc/lib/freetype2/freetype/Imakefile +++ b/xc/lib/freetype2/freetype/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/freetype2/freetype/Imakefile,v 1.2 2001/02/09 00:35:03 keithp Exp $ +XCOMM $XFree86: xc/lib/freetype2/freetype/Imakefile,v 1.4 2001/05/16 03:57:27 keithp Exp $ #define IHaveSubdirs #define PassCDebugFlags @@ -20,9 +20,9 @@ HEADERS= \ ftmac.h \ ftmm.h \ ftmodule.h \ - ftnames.h \ ftoutln.h \ ftrender.h \ + ftsnames.h \ ftsynth.h \ ftsystem.h \ fttypes.h \ @@ -44,9 +44,9 @@ LinkSourceFile(ftlist.h,$(FREETYPEINC)) LinkSourceFile(ftmac.h,$(FREETYPEINC)) LinkSourceFile(ftmm.h,$(FREETYPEINC)) LinkSourceFile(ftmodule.h,$(FREETYPEINC)) -LinkSourceFile(ftnames.h,$(FREETYPEINC)) LinkSourceFile(ftoutln.h,$(FREETYPEINC)) LinkSourceFile(ftrender.h,$(FREETYPEINC)) +LinkSourceFile(ftsnames.h,$(FREETYPEINC)) LinkSourceFile(ftsynth.h,$(FREETYPEINC)) LinkSourceFile(ftsystem.h,$(FREETYPEINC)) LinkSourceFile(fttypes.h,$(FREETYPEINC)) @@ -54,3 +54,5 @@ LinkSourceFile(t1tables.h,$(FREETYPEINC)) LinkSourceFile(ttnameid.h,$(FREETYPEINC)) LinkSourceFile(tttables.h,$(FREETYPEINC)) LinkSourceFile(tttags.h,$(FREETYPEINC)) + +DependSubdirs($(SUBDIRS)) diff --git a/xc/lib/freetype2/freetype/config/Imakefile b/xc/lib/freetype2/freetype/config/Imakefile index 2e0a7583e..2bf44b187 100644 --- a/xc/lib/freetype2/freetype/config/Imakefile +++ b/xc/lib/freetype2/freetype/config/Imakefile @@ -1,19 +1,19 @@ -XCOMM $XFree86: xc/lib/freetype2/freetype/config/Imakefile,v 1.1 2001/02/08 00:55:41 keithp Exp $ +XCOMM $XFree86: xc/lib/freetype2/freetype/config/Imakefile,v 1.2 2001/05/16 03:57:28 keithp Exp $ FREETYPETOP = $(TOP)/extras/freetype2 FREETYPESRC = $(FREETYPETOP)/src FREETYPEINC = $(FREETYPETOP)/include/freetype HEADERS= \ - ftbuild.h \ ftconfig.h \ + ftheader.h \ ftmodule.h \ ftoption.h BuildIncludes($(HEADERS),freetype2/freetype/config,../../..) InstallMultipleFlags($(HEADERS),$(INCDIR)/freetype2/freetype/config,$(INSTINCFLAGS)) -LinkSourceFile(ftbuild.h,$(FREETYPEINC)/config) LinkSourceFile(ftconfig.h,$(FREETYPEINC)/config) +LinkSourceFile(ftheader.h,$(FREETYPEINC)/config) LinkSourceFile(ftmodule.h,$(FREETYPEINC)/config) LinkSourceFile(ftoption.h,$(FREETYPEINC)/config) diff --git a/xc/lib/freetype2/freetype/internal/Imakefile b/xc/lib/freetype2/freetype/internal/Imakefile index 7814a43de..1399554b4 100644 --- a/xc/lib/freetype2/freetype/internal/Imakefile +++ b/xc/lib/freetype2/freetype/internal/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/lib/freetype2/freetype/internal/Imakefile,v 1.1 2001/02/09 00:35:03 keithp Exp $ +XCOMM $XFree86: xc/lib/freetype2/freetype/internal/Imakefile,v 1.2 2001/05/16 03:57:28 keithp Exp $ FREETYPETOP = $(TOP)/extras/freetype2 FREETYPESRC = $(FREETYPETOP)/src @@ -6,6 +6,8 @@ FREETYPEINC = $(FREETYPETOP)/include/freetype HEADERS= \ autohint.h \ + cfferrs.h \ + cfftypes.h \ fnttypes.h \ ftcalc.h \ ftdebug.h \ @@ -15,13 +17,12 @@ HEADERS= \ ftobjs.h \ ftstream.h \ internal.h \ + pcftypes.h \ psaux.h \ psnames.h \ sfnt.h \ t1errors.h \ t1types.h \ - t2errors.h \ - t2types.h \ tterrors.h \ tttypes.h @@ -29,6 +30,8 @@ BuildIncludes($(HEADERS),freetype2/freetype/internal,../../..) InstallMultipleFlags($(HEADERS),$(INCDIR)/freetype2/freetype/internal,$(INSTINCFLAGS)) LinkSourceFile(autohint.h,$(FREETYPEINC)/internal) +LinkSourceFile(cfferrs.h,$(FREETYPEINC)/internal) +LinkSourceFile(cfftypes.h,$(FREETYPEINC)/internal) LinkSourceFile(fnttypes.h,$(FREETYPEINC)/internal) LinkSourceFile(ftcalc.h,$(FREETYPEINC)/internal) LinkSourceFile(ftdebug.h,$(FREETYPEINC)/internal) @@ -38,12 +41,11 @@ LinkSourceFile(ftmemory.h,$(FREETYPEINC)/internal) LinkSourceFile(ftobjs.h,$(FREETYPEINC)/internal) LinkSourceFile(ftstream.h,$(FREETYPEINC)/internal) LinkSourceFile(internal.h,$(FREETYPEINC)/internal) +LinkSourceFile(pcftypes.h,$(FREETYPEINC)/internal) LinkSourceFile(psaux.h,$(FREETYPEINC)/internal) LinkSourceFile(psnames.h,$(FREETYPEINC)/internal) LinkSourceFile(sfnt.h,$(FREETYPEINC)/internal) LinkSourceFile(t1errors.h,$(FREETYPEINC)/internal) LinkSourceFile(t1types.h,$(FREETYPEINC)/internal) -LinkSourceFile(t2errors.h,$(FREETYPEINC)/internal) -LinkSourceFile(t2types.h,$(FREETYPEINC)/internal) LinkSourceFile(tterrors.h,$(FREETYPEINC)/internal) LinkSourceFile(tttypes.h,$(FREETYPEINC)/internal) diff --git a/xc/nls/Compose/iso8859-2 b/xc/nls/Compose/iso8859-2 index 85e4fe706..5d8507176 100644 --- a/xc/nls/Compose/iso8859-2 +++ b/xc/nls/Compose/iso8859-2 @@ -2,7 +2,7 @@ XCOMM $Xorg: iso8859-2,v 1.3 2000/08/17 19:46:59 cpqbld Exp $ XCOMM XCOMM ISO 8859-2 (Latin2) Compose Sequence XCOMM -XCOMM $XFree86: xc/nls/Compose/iso8859-2,v 1.5 2001/04/26 21:09:40 dawes Exp $ +XCOMM $XFree86: xc/nls/Compose/iso8859-2,v 1.6 2001/05/18 23:35:29 dawes Exp $ XCOMM XCOMM Sequence Definition XCOMM @@ -454,4 +454,115 @@ XCOMM those are for ease of use <dead_abovedot> <u> : "\371" uring <dead_caron> <U> : "\331" Uring <dead_caron> <u> : "\371" uring +XCOMM traditional sequences +<Multi_key> <O> <E> : "\274" OE +<Multi_key> <o> <e> : "\275" oe +<dead_abovering> <A> : "\305" Aring +<dead_abovering> <a> : "\345" aring +<dead_abovering> <dead_abovering> : "\260" degree +<dead_abovering> <degree> : "\260" degree +<dead_abovering> <space> : "\260" degree +<dead_abovering> <nobreakspace> : "\260" degree +<dead_tilde> <I> : "\245" Itilde +<dead_tilde> <i> : "\265" itilde +<dead_tilde> <A> : "\303" Atilde +<dead_tilde> <O> : "\325" Otilde +<dead_tilde> <U> : "\335" Utilde +<dead_tilde> <a> : "\343" atilde +<dead_tilde> <o> : "\365" otilde +<dead_tilde> <u> : "\375" utilde +<dead_tilde> <N> : "\321" Ntilde +<dead_tilde> <n> : "\361" ntilde +<dead_tilde> <dead_tilde> : "~" asciitilde +<dead_tilde> <asciitilde> : "~" asciitilde +<dead_tilde> <space> : "~" asciitilde +<dead_tilde> <nobreakspace> : "~" asciitilde +<dead_caron> <caron> : "\267" caron +<dead_caron> <dead_caron> : "\267" caron +<dead_caron> <space> : "\267" caron +<dead_caron> <nobreakspace> : "\267" caron +<dead_circumflex> <A> : "\302" Acircumflex +<dead_circumflex> <I> : "\316" Icircumflex +<dead_circumflex> <O> : "\324" Ocircumflex +<dead_circumflex> <U> : "\333" Ucircumflex +<dead_circumflex> <a> : "\342" acircumflex +<dead_circumflex> <i> : "\356" icircumflex +<dead_circumflex> <o> : "\364" ocircumflex +<dead_circumflex> <u> : "\373" ucircumflex +<dead_circumflex> <u> : "\373" ucircumflex +<dead_circumflex> <dead_circumflex> : "\136" asciicircum +<dead_circumflex> <asciicircum> : "\136" asciicircum +<dead_circumflex> <space> : "\136" asciicircum +<dead_circumflex> <nobreakspace> : "\136" asciicircum +<dead_breve> <G> : "\253" Gbreve +<dead_breve> <g> : "\273" gbreve +<dead_breve> <U> : "\335" Ubreve +<dead_breve> <u> : "\375" ubreve +<dead_breve> <dead_breve> : "\242" breve +<dead_breve> <breve> : "\242" breve +<dead_breve> <space> : "\242" breve +<dead_breve> <nobreakspace> : "\242" breve +<dead_ogonek> <A> : "\241" Aogonek +<dead_ogonek> <a> : "\261" aogonek +<dead_ogonek> <ogonek> : "\262" ogonek +<dead_ogonek> <dead_ogonek> : "\262" ogonek +<dead_ogonek> <I> : "\307" Iogonek +<dead_ogonek> <E> : "\312" Eogonek +<dead_ogonek> <U> : "\331" Uogonek +<dead_ogonek> <i> : "\347" iogonek +<dead_ogonek> <e> : "\352" eogonek +<dead_ogonek> <u> : "\371" uogonek +<dead_ogonek> <dead_ogonek> : "\662" ogonek +<dead_ogonek> <ogonek> : "\662" ogonek +<dead_ogonek> <space> : "\662" ogonek +<dead_ogonek> <nobreakspace> : "\662" ogonek +<dead_grave> <A> : "\300" Agrave +<dead_grave> <a> : "\340" agrave +<dead_grave> <E> : "\310" Egrave +<dead_grave> <e> : "\350" egrave +<dead_grave> <I> : "\314" Igrave +<dead_grave> <i> : "\354" igrave +<dead_grave> <O> : "\322" Ograve +<dead_grave> <o> : "\362" ograve +<dead_grave> <U> : "\331" Ugrave +<dead_grave> <u> : "\371" ugrave +<dead_grave> <dead_grave> : "`" grave +<dead_grave> <grave> : "`" grave +<dead_grave> <space> : "`" grave +<dead_grave> <nobreakspace> : "`" grave +<dead_abovedot> <C> : "\305" Cabovedot +<dead_abovedot> <c> : "\345" cabovedot +<dead_abovedot> <I> : "\251" Iabovedot +<dead_abovedot> <i> : "\271" idotless +<dead_abovedot> <Z> : "\257" Zabovedot +<dead_abovedot> <z> : "\277" zabovedot +<dead_abovedot> <E> : "\314" Eabovedot +<dead_abovedot> <e> : "\354" eabovedot +<dead_abovedot> <dead_abovedot> : "\377" abovedot +<dead_abovedot> <abovedot> : "\377" abovedot +<dead_abovedot> <space> : "\377" abovedot +<dead_abovedot> <nobreakspace> : "\377" abovedot +<dead_acute> <dead_acute> : "\264" acute +<dead_acute> <acute> : "\264" acute +<dead_acute> <space> : "\264" acute +<dead_acute> <nobreakspace> : "\264" acute +<dead_doubleacute> <dead_doubleacute> : "\675" doubleacute +<dead_doubleacute> <doubleacute> : "\675" doubleacute +<dead_doubleacute> <space> : "\675" doubleacute +<dead_doubleacute> <nobreakspace> : "\675" doubleacute +<dead_diaeresis> <I> : "\317" Idiaeresis +<dead_diaeresis> <i> : "\357" idiaeresis +<dead_diaeresis> <y> : "\377" ydiaeresis +<dead_diaeresis> <dead_diaeresis> : "\250" diaeresis +<dead_diaeresis> <diaeresis> : "\250" diaeresis +<dead_diaeresis> <space> : "\250" diaeresis +<dead_diaeresis> <nobreakspace> : "\250" diaeresis +<dead_cedilla> <dead_cedilla> : "\270" cedilla +<dead_cedilla> <cedilla> : "\270" cedilla +<dead_cedilla> <space> : "\270" cedilla +<dead_cedilla> <nobreakspace> : "\270" cedilla +<dead_macron> <dead_macron> : "\257" macron +<dead_macron> <macron> : "\257" macron +<dead_macron> <space> : "\257" macron +<dead_macron> <nobreakspace> : "\257" macron XCOMM End of Sequence Definition diff --git a/xc/nls/locale.alias b/xc/nls/locale.alias index f77c57b0a..0e118e6ac 100644 --- a/xc/nls/locale.alias +++ b/xc/nls/locale.alias @@ -5,7 +5,7 @@ XCOMM Each alias name is described within one line. XCOMM The first word is the alias name (simplified locale name) XCOMM the second word is full locale name. XCOMM -XCOMM $XFree86: xc/nls/locale.alias,v 1.37 2001/03/06 18:03:16 dawes Exp $ +XCOMM $XFree86: xc/nls/locale.alias,v 1.38.2.1 2001/05/23 18:32:14 dawes Exp $ XCOMM #ifdef R63_COMPAT XCOMM These entries are in the old format (no ':') @@ -35,10 +35,12 @@ br_FR br_FR.ISO8859-1 br_FR.iso88591 br_FR.ISO8859-1 br_FR.iso885914 br_FR.ISO8859-14 br_FR.iso885915 br_FR.ISO8859-15 +br_FR@euro br_FR.ISO8859-15 ca ca_ES.ISO8859-1 ca_ES ca_ES.ISO8859-1 ca_ES.iso88591 ca_ES.ISO8859-1 ca_ES.iso885915 ca_ES.ISO8859-15 +ca_ES@euro ca_ES.ISO8859-15 cs cs_CZ.ISO8859-2 cs_CS cs_CZ.ISO8859-2 cs_CS.ISO8859-2 cs_CZ.ISO8859-2 @@ -65,6 +67,12 @@ de_AT de_AT.ISO8859-1 de_AT.iso88591 de_AT.ISO8859-1 de_AT.ISO_8859-1 de_AT.ISO8859-1 de_AT.iso885915 de_AT.ISO8859-15 +de_AT@euro de_AT.ISO8859-15 +de_BE de_BE.ISO8859-1 +de_BE.iso88591 de_BE.ISO8859-1 +de_BE.ISO_8859-1 de_BE.ISO8859-1 +de_BE.iso885915 de_BE.ISO8859-15 +de_BE@euro de_BE.ISO8859-15 de_CH de_CH.ISO8859-1 de_CH.iso88591 de_CH.ISO8859-1 de_CH.ISO_8859-1 de_CH.ISO8859-1 @@ -75,6 +83,12 @@ de_DE.88591.en de_DE.ISO8859-1 de_DE.iso88591 de_DE.ISO8859-1 de_DE.ISO_8859-1 de_DE.ISO8859-1 de_DE.iso885915 de_DE.ISO8859-15 +de_DE@euro de_DE.ISO8859-15 +de_LU de_LU.ISO8859-1 +de_LU.iso88591 de_LU.ISO8859-1 +de_LU.ISO_8859-1 de_LU.ISO8859-1 +de_LU.iso885915 de_LU.ISO8859-15 +de_LU@euro de_LU.ISO8859-15 GER_DE.8859 de_DE.ISO8859-1 GER_DE.8859.in de_DE.ISO8859-1 ee ee_EE.ISO8859-4 @@ -83,6 +97,7 @@ ee_EE.iso88594 ee_EE.ISO8859-4 el el_GR.ISO8859-7 el_GR el_GR.ISO8859-7 el_GR.iso88597 el_GR.ISO8859-7 +el_GR@euro el_GR.ISO8859-15 en en_US.ISO8859-1 en_AU en_AU.ISO8859-1 en_AU.iso88591 en_AU.ISO8859-1 @@ -100,6 +115,7 @@ ENG_GB.8859 en_GB.ISO8859-1 ENG_GB.8859.in en_GB.ISO8859-1 en_IE en_IE.ISO8859-1 en_IE.iso88591 en_IE.ISO8859-1 +en_IE@euro en_IE.ISO8859-15 en_NZ en_NZ.ISO8859-1 en_NZ.iso88591 en_NZ.ISO8859-1 en_US en_US.ISO8859-1 @@ -133,6 +149,7 @@ es_ES.88591.en es_ES.ISO8859-1 es_ES.iso88591 es_ES.ISO8859-1 es_ES.ISO_8859-1 es_ES.ISO8859-1 es_ES.iso885915 es_ES.ISO8859-15 +es_ES@euro es_ES.ISO8859-15 es_GT es_GT.ISO8859-1 es_GT.iso88591 es_GT.ISO8859-1 es_MX es_MX.ISO8859-1 @@ -171,6 +188,7 @@ eu eu_ES.ISO8859-1 eu_ES eu_ES.ISO8859-1 eu_ES.iso88591 eu_ES.ISO8859-1 eu_ES.iso885915 eu_ES.ISO8859-15 +eu_ES@euro eu_ES.ISO8859-15 fi fi_FI.ISO8859-1 fi_FI fi_FI.ISO8859-1 fi_FI.88591 fi_FI.ISO8859-1 @@ -178,6 +196,7 @@ fi_FI.88591.en fi_FI.ISO8859-1 fi_FI.iso88591 fi_FI.ISO8859-1 fi_FI.ISO_8859-1 fi_FI.ISO8859-1 fi_FI.iso885915 fi_FI.ISO8859-15 +fi_FI@euro fi_FI.ISO8859-15 fo fo_FO.ISO8859-1 fo_FO fo_FO.ISO8859-1 fo_FO.iso88591 fo_FO.ISO8859-1 @@ -188,6 +207,7 @@ fr_BE.88591 fr_BE.ISO8859-1 fr_BE.88591.en fr_BE.ISO8859-1 fr_BE.ISO_8859-1 fr_BE.ISO8859-1 fr_BE.iso885915 fr_BE.ISO8859-15 +fr_BE@euro fr_BE.ISO8859-15 fr_CA fr_CA.ISO8859-1 fr_CA.88591 fr_CA.ISO8859-1 fr_CA.88591.en fr_CA.ISO8859-1 @@ -205,6 +225,14 @@ fr_FR.88591.en fr_FR.ISO8859-1 fr_FR.iso88591 fr_FR.ISO8859-1 fr_FR.ISO_8859-1 fr_FR.ISO8859-1 fr_FR.iso885915 fr_FR.ISO8859-15 +fr_FR@euro fr_FR.ISO8859-15 +fr_LU fr_LU.ISO8859-1 +fr_LU.88591 fr_LU.ISO8859-1 +fr_LU.88591.en fr_LU.ISO8859-1 +fr_LU.iso88591 fr_LU.ISO8859-1 +fr_LU.ISO_8859-1 fr_LU.ISO8859-1 +fr_LU.iso885915 fr_LU.ISO8859-15 +fr_LU@euro fr_LU.ISO8859-15 FRE_FR.8859 fr_FR.ISO8859-1 FRE_FR.8859.in fr_FR.ISO8859-1 ga ga_IE.ISO8859-1 @@ -212,6 +240,7 @@ ga_IE ga_IE.ISO8859-1 ga_IE.iso88591 ga_IE.ISO8859-1 ga_IE.iso885914 ga_IE.ISO8859-14 ga_IE.iso885915 ga_IE.ISO8859-15 +ga_IE@euro ga_IE.ISO8859-15 gd gd_GB.ISO8859-1 gd_GB gd_GB.ISO8859-1 gd_GB.iso88591 gd_GB.ISO8859-1 @@ -221,6 +250,7 @@ gl gl_ES.ISO8859-1 gl_ES gl_ES.ISO8859-1 gl_ES.iso88591 gl_ES.ISO8859-1 gl_ES.iso885915 gl_ES.ISO8859-15 +gl_ES@euro gl_ES.ISO8859-15 gv gv_GB.ISO8859-1 gv_GB gv_GB.ISO8859-1 gv_GB.iso88591 gv_GB.ISO8859-1 @@ -262,6 +292,7 @@ it_IT.88591.en it_IT.ISO8859-1 it_IT.iso88591 it_IT.ISO8859-1 it_IT.ISO_8859-1 it_IT.ISO8859-1 it_IT.iso885915 it_IT.ISO8859-15 +it_IT@euro it_IT.ISO8859-15 iu iu_CA.NUNACOM-8 iu_CA iu_CA.NUNACOM-8 iu_CA.nunacom8 iu_CA.NUNACOM-8 @@ -344,24 +375,38 @@ nl_BE.88591.en nl_BE.ISO8859-1 nl_BE.iso88591 nl_BE.ISO8859-1 nl_BE.ISO_8859-1 nl_BE.ISO8859-1 nl_BE.iso885915 nl_BE.ISO8859-15 +nl_BE@euro nl_BE.ISO8859-15 nl_NL nl_NL.ISO8859-1 nl_NL.88591 nl_NL.ISO8859-1 nl_NL.88591.en nl_NL.ISO8859-1 nl_NL.iso88591 nl_NL.ISO8859-1 nl_NL.ISO_8859-1 nl_NL.ISO8859-1 nl_NL.iso885915 nl_NL.ISO8859-15 +nl_NL@euro nl_NL.ISO8859-15 no no_NO.ISO8859-1 +nb nb_NO.ISO8859-1 +ny ny_NO.ISO8859-1 no_NO no_NO.ISO8859-1 +nb_NO nb_NO.ISO8859-1 +ny_NO ny_NO.ISO8859-1 no_NO.88591 no_NO.ISO8859-1 +nb_NO.88591 nb_NO.ISO8859-1 +ny_NO.88591 ny_NO.ISO8859-1 no_NO.88591.en no_NO.ISO8859-1 no_NO.iso88591 no_NO.ISO8859-1 -no_NO.ISO_8859-1 no_NO.ISO8859-1 +no_NO.ISO-8859-1 no_NO.ISO8859-1 +nb_NO.ISO-8859-1 nb_NO.ISO8859-1 +ny_NO.ISO_8859-1 ny_NO.ISO8859-1 no_NO.iso885915 no_NO.ISO8859-15 -no@nynorsk no_NO.ISO8859-1 +nb_NO.iso885915 nb_NO.ISO8859-15 +ny_NO.iso885915 ny_NO.ISO8859-15 +no@nynorsk nn_NO.ISO8859-1 +nynorsk nn_NO.ISO8859-1 oc oc_FR.ISO8859-1 oc_FR oc_FR.ISO8859-1 oc_FR.iso88591 oc_FR.ISO8859-1 oc_FR.iso885915 oc_FR.ISO8859-15 +oc_FR@euro oc_FR.ISO8859-15 pl pl_PL.ISO8859-2 pl_PL pl_PL.ISO8859-2 pl_PL.iso88592 pl_PL.ISO8859-2 @@ -375,6 +420,7 @@ pt_PT.88591.en pt_PT.ISO8859-1 pt_PT.iso88591 pt_PT.ISO8859-1 pt_PT.ISO_8859-1 pt_PT.ISO8859-1 pt_PT.iso885915 pt_PT.ISO8859-1 +pt_PT@euro pt_PT.ISO8859-1 ro ro_RO.ISO8859-2 ro_RO ro_RO.ISO8859-2 ro_RO.iso88592 ro_RO.ISO8859-2 @@ -398,7 +444,6 @@ sk sk_SK.ISO8859-2 sk_SK sk_SK.ISO8859-2 sk_SK.iso88592 sk_SK.ISO8859-2 sl sl_SI.ISO8859-2 -sl_CS sl_CS.ISO8859-2 sl_SI sl_SI.ISO8859-2 sl_SI.iso88592 sl_SI.ISO8859-2 sp sp_YU.ISO8859-5 @@ -415,12 +460,14 @@ sv sv_SE.ISO8859-1 sv_FI sv_FI.ISO8859-1 sv_FI.iso88591 sv_FI.ISO8859-1 sv_FI.iso885915 sv_FI.ISO8859-15 +sv_FI@euro sv_FI.ISO8859-15 sv_SE sv_SE.ISO8859-1 sv_SE.88591 sv_SE.ISO8859-1 sv_SE.88591.en sv_SE.ISO8859-1 sv_SE.iso88591 sv_SE.ISO8859-1 sv_SE.ISO_8859-1 sv_SE.ISO8859-1 sv_SE.iso885915 sv_SE.ISO8859-15 +sv_SE@euro sv_SE.ISO8859-15 th th_TH.TIS620 th_TH th_TH.TIS620 th_TH.tis620 th_TH.TIS620 @@ -442,6 +489,7 @@ wa wa_BE.ISO8859-1 wa_BE wa_BE.ISO8859-1 wa_BE.iso88591 wa_BE.ISO8859-1 wa_BE.iso885915 wa_BE.ISO8859-15 +wa_BE@euro wa_BE.ISO8859-15 zh zh_CN.eucCN zh_CN zh_CN.eucCN zh_CN.big5 zh_TW.big5 @@ -465,22 +513,42 @@ spanish_spain.8859 es_ES.ISO8859-1 XCOMM The following locale names are used in HPUX 9.x american.iso88591 en_US.ISO8859-1 arabic.iso88596 ar_AA.ISO8859-6 +bokmal nb_NO.ISO8859-1 +bokmål nb_NO.ISO8859-1 bulgarian bg_BG.ISO8859-5 c-french.iso88591 fr_CA.ISO8859-1 +catalan ca_ES.ISO8859-1 chinese-s zh_CN.eucCN chinese-t zh_TW.eucTW croatian hr_HR.ISO8859-2 czech cs_CZ.ISO8859-2 +danish da_DK.ISO8859-1 +dansk da_DK.ISO8859-1 danish.iso88591 da_DK.ISO8859-1 +deutsch de_DE.ISO8859-1 +dutch nl_NL.ISO8859-1 dutch.iso88591 nl_BE.ISO8859-1 +eesti et_EE.ISO8859-1 english.iso88591 en_EN.ISO8859-1 +estonian et_EE.ISO8859-1 +finnish fi_FI.ISO8859-1 finnish.iso88591 fi_FI.ISO8859-1 +français fr_FR.ISO8859-1 +french fr_FR.ISO8859-1 french.iso88591 fr_CH.ISO8859-1 +galego gl_ES.ISO8859-1 +galician gl_ES.ISO8859-1 +german de_DE.ISO8859-1 german.iso88591 de_CH.ISO8859-1 +greek el_GR.ISO8859-7 greek.iso88597 el_GR.ISO8859-7 +hebrew iw_IL.ISO8859-8 hebrew.iso88598 iw_IL.ISO8859-8 +hrvatski hr_HR.ISO8859-2 hungarian hu_HU.ISO8859-2 icelandic.iso88591 is_IS.ISO8859-1 +icelandic is_IS.ISO8859-1 +italian it_IT.ISO8859-1 italian.iso88591 it_IT.ISO8859-1 #if ! (defined(SVR4) && defined(sun)) japanese ja_JP.SJIS @@ -488,18 +556,29 @@ japanese ja_JP.SJIS japanese ja_JP.eucJP #endif japanese.euc ja_JP.eucJP +japanese.sjis ja_JP.SJIS korean ko_KR.eucKR +korean.euc ko_KR.eucKR +lithuanian lt_LT.ISO8859-13 +norwegian no_NO.ISO8859-1 norwegian.iso88591 no_NO.ISO8859-1 polish pl_PL.ISO8859-2 +portuguese pt_PT.ISO8859-1 portuguese.iso88591 pt_PT.ISO8859-1 +romanian ro_RO.ISO8859-2 rumanian ro_RO.ISO8859-2 russian ru_RU.ISO8859-5 serbocroatian sh_YU.ISO8859-2 slovak sk_SK.ISO8859-2 -slovene sl_CS.ISO8859-2 +slovenian sl_SI.ISO8859-2 +slovene sl_SI.ISO8859-2 +spanish es_ES.ISO8859-1 spanish.iso88591 es_ES.ISO8859-1 +swedish sv_SE.ISO8859-1 swedish.iso88591 sv_SE.ISO8859-1 +turkish tr_TR.ISO8859-9 turkish.iso88599 tr_TR.ISO8859-9 +thai th_TH.tis620 univ.utf8 en_US.UTF-8 XCOMM Digital Unix utf universal.utf8@ucs4 en_US.UTF-8 @@ -558,15 +637,19 @@ br_FR: br_FR.ISO8859-1 br_FR.iso88591: br_FR.ISO8859-1 br_FR.iso885914: br_FR.ISO8859-14 br_FR.iso885915: br_FR.ISO8859-15 +br_FR@euro: br_FR.ISO8859-15 ca: ca_ES.ISO8859-1 ca_ES: ca_ES.ISO8859-1 ca_ES.iso88591: ca_ES.ISO8859-1 +ca_ES.ISO-8859-1: ca_ES.ISO8859-1 ca_ES.iso885915: ca_ES.ISO8859-15 +ca_ES@euro: ca_ES.ISO8859-15 cs: cs_CZ.ISO8859-2 cs_CS: cs_CZ.ISO8859-2 cs_CS.ISO8859-2: cs_CZ.ISO8859-2 cs_CZ: cs_CZ.ISO8859-2 cs_CZ.iso88592: cs_CZ.ISO8859-2 +cs_CZ.ISO-8859-2: cs_CZ.ISO8859-2 cs_CZ.ISO_8859-2: cs_CZ.ISO8859-2 XCOMM cz is old name for cs, should be deleted in the future: cz: cs_CZ.ISO8859-2 @@ -581,13 +664,20 @@ da_DK: da_DK.ISO8859-1 da_DK.88591: da_DK.ISO8859-1 da_DK.88591.en: da_DK.ISO8859-1 da_DK.iso88591: da_DK.ISO8859-1 -da_DK.ISO_8859-1: da_DK.ISO8859-1 da_DK.iso885915: da_DK.ISO8859-15 +da_DK.ISO-8859-1: da_DK.ISO8859-1 +da_DK.ISO_8859-1: da_DK.ISO8859-1 de: de_DE.ISO8859-1 de_AT: de_AT.ISO8859-1 de_AT.iso88591: de_AT.ISO8859-1 de_AT.ISO_8859-1: de_AT.ISO8859-1 de_AT.iso885915: de_AT.ISO8859-15 +de_AT@euro: de_AT.ISO8859-15 +de_BE: de_BE.ISO8859-1 +de_BE.iso88591: de_BE.ISO8859-1 +de_BE.ISO_8859-1: de_BE.ISO8859-1 +de_BE.iso885915: de_BE.ISO8859-15 +de_BE@euro: de_BE.ISO8859-15 de_CH: de_CH.ISO8859-1 de_CH.iso88591: de_CH.ISO8859-1 de_CH.ISO_8859-1: de_CH.ISO8859-1 @@ -596,8 +686,15 @@ de_DE: de_DE.ISO8859-1 de_DE.88591: de_DE.ISO8859-1 de_DE.88591.en: de_DE.ISO8859-1 de_DE.iso88591: de_DE.ISO8859-1 +de_DE.ISO-8859-1: de_DE.ISO8859-1 de_DE.ISO_8859-1: de_DE.ISO8859-1 de_DE.iso885915: de_DE.ISO8859-15 +de_DE@euro: de_DE.ISO8859-15 +de_LU: de_LU.ISO8859-1 +de_LU.iso88591: de_LU.ISO8859-1 +de_LU.ISO_8859-1: de_LU.ISO8859-1 +de_LU.iso885915: de_LU.ISO8859-15 +de_LU@euro: de_LU.ISO8859-15 GER_DE.8859: de_DE.ISO8859-1 GER_DE.8859.in: de_DE.ISO8859-1 ee: ee_EE.ISO8859-4 @@ -606,6 +703,8 @@ ee_EE.iso88594: ee_EE.ISO8859-4 el: el_GR.ISO8859-7 el_GR: el_GR.ISO8859-7 el_GR.iso88597: el_GR.ISO8859-7 +el_GR.ISO-8859-7: el_GR.ISO8859-7 +el_GR@euro: el_GR.ISO8859-15 en: en_US.ISO8859-1 en_AU: en_AU.ISO8859-1 en_AU.iso88591: en_AU.ISO8859-1 @@ -623,6 +722,7 @@ ENG_GB.8859: en_GB.ISO8859-1 ENG_GB.8859.in: en_GB.ISO8859-1 en_IE: en_IE.ISO8859-1 en_IE.iso88591: en_IE.ISO8859-1 +en_IE@euro: en_IE.ISO8859-15 en_NZ: en_NZ.ISO8859-1 en_NZ.iso88591: en_NZ.ISO8859-1 en_US: en_US.ISO8859-1 @@ -653,7 +753,9 @@ es_ES: es_ES.ISO8859-1 es_ES.88591: es_ES.ISO8859-1 es_ES.88591.en: es_ES.ISO8859-1 es_ES.iso88591: es_ES.ISO8859-1 +es_ES.ISO-8859-1: es_ES.ISO8859-1 es_ES.ISO_8859-1: es_ES.ISO8859-1 +es_ES@euro: es_ES.ISO8859-15 es_GT: es_GT.ISO8859-1 es_GT.iso88591: es_GT.ISO8859-1 es_MX: es_MX.ISO8859-1 @@ -687,6 +789,7 @@ XCOMM charset. EVS8:2000 specifies ISO8859-15 as base charset. et: et_EE.ISO8859-15 et_EE: et_EE.ISO8859-15 et_EE.iso88591: et_EE.ISO8859-1 +et_EE.ISO-8859-1: et_EE.ISO8859-1 et_EE.iso88594: et_EE.ISO8859-4 et_EE.iso885913: et_EE.ISO8859-13 et_EE.iso885915: et_EE.ISO8859-15 @@ -694,6 +797,7 @@ eu: eu_ES.ISO8859-1 eu_ES: eu_ES.ISO8859-1 eu_ES.iso88591: eu_ES.ISO8859-1 eu_ES.iso885915: eu_ES.ISO8859-15 +eu_ES@euro: eu_ES.ISO8859-15 fa: fa_IR.ISIRI-3342 fa_IR: fa_IR.ISIRI-3342 fa_IR.isiri3342: fa_IR.ISIRI-3342 @@ -702,8 +806,10 @@ fi_FI: fi_FI.ISO8859-15 fi_FI.88591: fi_FI.ISO8859-1 fi_FI.88591.en: fi_FI.ISO8859-1 fi_FI.iso88591: fi_FI.ISO8859-1 +fi_FI.ISO-8859-1: fi_FI.ISO8859-1 fi_FI.ISO_8859-1: fi_FI.ISO8859-1 fi_FI.iso885915: fi_FI.ISO8859-15 +fi_FI@euro: fi_FI.ISO8859-15 fo: fo_FO.ISO8859-1 fo_FO: fo_FO.ISO8859-1 fo_FO.iso88591: fo_FO.ISO8859-1 @@ -714,6 +820,7 @@ fr_BE.88591: fr_BE.ISO8859-1 fr_BE.88591.en: fr_BE.ISO8859-1 fr_BE.ISO_8859-1: fr_BE.ISO8859-1 fr_BE.iso885915: fr_BE.ISO8859-15 +fr_BE@euro: fr_BE.ISO8859-15 fr_CA: fr_CA.ISO8859-1 fr_CA.88591: fr_CA.ISO8859-1 fr_CA.88591.en: fr_CA.ISO8859-1 @@ -729,8 +836,18 @@ fr_FR: fr_FR.ISO8859-1 fr_FR.88591: fr_FR.ISO8859-1 fr_FR.88591.en: fr_FR.ISO8859-1 fr_FR.iso88591: fr_FR.ISO8859-1 +fr_FR.ISO-8859-1: fr_FR.ISO8859-1 fr_FR.ISO_8859-1: fr_FR.ISO8859-1 fr_FR.iso885915: fr_FR.ISO8859-15 +fr_FR@euro: fr_FR.ISO8859-15 +fr_LU: fr_LU.ISO8859-1 +fr_LU.88591: fr_LU.ISO8859-1 +fr_LU.88591.en: fr_LU.ISO8859-1 +fr_LU.iso88591: fr_LU.ISO8859-1 +fr_LU.ISO-8859-1: fr_LU.ISO8859-1 +fr_LU.ISO_8859-1: fr_LU.ISO8859-1 +fr_LU.iso885915: fr_LU.ISO8859-15 +fr_LU@euro: fr_LU.ISO8859-15 FRE_FR.8859: fr_FR.ISO8859-1 FRE_FR.8859.in: fr_FR.ISO8859-1 ga: ga_IE.ISO8859-1 @@ -738,6 +855,7 @@ ga_IE: ga_IE.ISO8859-1 ga_IE.iso88591: ga_IE.ISO8859-1 ga_IE.iso885914: ga_IE.ISO8859-14 ga_IE.iso885915: ga_IE.ISO8859-15 +ga_IE@euro: ga_IE.ISO8859-15 gd: gd_GB.ISO8859-1 gd_GB: gd_GB.ISO8859-1 gd_GB.iso88591: gd_GB.ISO8859-1 @@ -746,7 +864,9 @@ gd_GB.iso885915: gd_GB.ISO8859-15 gl: gl_ES.ISO8859-1 gl_ES: gl_ES.ISO8859-1 gl_ES.iso88591: gl_ES.ISO8859-1 +gl_ES.ISO-8859-1: gl_ES.ISO8859-1 gl_ES.iso885915: gl_ES.ISO8859-15 +gl_ES@euro: gl_ES.ISO8859-15 he: he_IL.ISO8859-8 he_IL: he_IL.ISO8859-8 he_IL.iso88598: he_IL.ISO8859-8 @@ -760,10 +880,12 @@ hi_IN.isciidev: hi_IN.ISCII-DEV hr: hr_HR.ISO8859-2 hr_HR: hr_HR.ISO8859-2 hr_HR.iso88592: hr_HR.ISO8859-2 +hr_HR.ISO-8859-2: hr_HR.ISO8859-2 hr_HR.ISO_8859-2: hr_HR.ISO8859-2 hu: hu_HU.ISO8859-2 hu_HU: hu_HU.ISO8859-2 hu_HU.iso88592: hu_HU.ISO8859-2 +hu_HU.ISO-8859-2: hu_HU.ISO8859-2 hy: hy_AM.ARMSCII-8 hy_AM: hy_AM.ARMSCII-8 hy_AM.armscii8: hy_AM.ARMSCII-8 @@ -777,6 +899,7 @@ in_ID: id_ID.ISO8859-1 is: is_IS.ISO8859-1 is_IS: is_IS.ISO8859-1 is_IS.iso88591: is_IS.ISO8859-1 +is_IS.ISO-8859-1: is_IS.ISO8859-1 is_IS.ISO_8859-1: is_IS.ISO8859-1 is_IS.iso885915: is_IS.ISO8859-15 it: it_IT.ISO8859-1 @@ -788,8 +911,10 @@ it_IT: it_IT.ISO8859-1 it_IT.88591: it_IT.ISO8859-1 it_IT.88591.en: it_IT.ISO8859-1 it_IT.iso88591: it_IT.ISO8859-1 +it_IT.ISO-8859-1: it_IT.ISO8859-1 it_IT.ISO_8859-1: it_IT.ISO8859-1 it_IT.iso885915: it_IT.ISO8859-15 +it_IT@euro: it_IT.ISO8859-15 iu: iu_CA.NUNACOM-8 iu_CA: iu_CA.NUNACOM-8 iu_CA.nunacom8: iu_CA.NUNACOM-8 @@ -798,6 +923,7 @@ XCOMM those lines should be deleted in a near future iw: he_IL.ISO8859-8 iw_IL: he_IL.ISO8859-8 iw_IL.iso88598: he_IL.ISO8859-8 +iw_IL.ISO-8859-8: iw_IL.ISO8859-8 #ifndef __uxp__ ja_JP: ja_JP.eucJP #else /* __uxp__ */ @@ -852,6 +978,7 @@ lt_LT: lt_LT.ISO8859-13 lt_LT.iso88594: lt_LT.ISO8859-4 lt_LT.ISO_8859-4: lt_LT.ISO8859-4 lt_LT.iso885913: lt_LT.ISO8859-13 +lt_LT.ISO-8859-13: lt_LT.ISO8859-13 lt_LT.ISO_8859-13: lt_LT.ISO8859-13 lv: lv_LV.ISO8859-13 lv_LV: lv_LV.ISO8859-13 @@ -878,12 +1005,15 @@ nl_BE.88591.en: nl_BE.ISO8859-1 nl_BE.iso88591: nl_BE.ISO8859-1 nl_BE.ISO_8859-1: nl_BE.ISO8859-1 nl_BE.iso885915: nl_BE.ISO8859-15 +nl_BE@euro: nl_BE.ISO8859-15 nl_NL: nl_NL.ISO8859-1 nl_NL.88591: nl_NL.ISO8859-1 nl_NL.88591.en: nl_NL.ISO8859-1 nl_NL.iso88591: nl_NL.ISO8859-1 +nl_NL.ISO-8859-1: nl_NL.ISO8859-1 nl_NL.ISO_8859-1: nl_NL.ISO8859-1 nl_NL.iso885915: nl_NL.ISO8859-15 +nl_NL@euro: nl_NL.ISO8859-15 no: no_NO.ISO8859-1 nb: nb_NO.ISO8859-1 ny: ny_NO.ISO8859-1 @@ -895,15 +1025,19 @@ nb_NO.88591: nb_NO.ISO8859-1 ny_NO.88591: ny_NO.ISO8859-1 no_NO.88591.en: no_NO.ISO8859-1 no_NO.iso88591: no_NO.ISO8859-1 -no_NO.ISO_8859-1: no_NO.ISO8859-1 +no_NO.ISO-8859-1: no_NO.ISO8859-1 +nb_NO.ISO-8859-1: nb_NO.ISO8859-1 +ny_NO.ISO_8859-1: ny_NO.ISO8859-1 no_NO.iso885915: no_NO.ISO8859-15 nb_NO.iso885915: nb_NO.ISO8859-15 ny_NO.iso885915: ny_NO.ISO8859-15 no@nynorsk: ny_NO.ISO8859-1 +nynorsk: nn_NO.ISO8859-1 oc: oc_FR.ISO8859-1 oc_FR: oc_FR.ISO8859-1 oc_FR.iso88591: oc_FR.ISO8859-1 oc_FR.iso885915: oc_FR.ISO8859-15 +oc_FR@euro: oc_FR.ISO8859-15 pd: pd_US.ISO8859-1 pd_DE: pd_DE.ISO8859-1 pd_US: pd_US.ISO8859-1 @@ -917,6 +1051,7 @@ ph_PH.iso88591: ph_PH.ISO8859-1 pl: pl_PL.ISO8859-2 pl_PL: pl_PL.ISO8859-2 pl_PL.iso88592: pl_PL.ISO8859-2 +pl_PL.ISO-8859-2: pl_PL.ISO8859-2 pp: pp_AN.ISO8859-1 pp_AN: pp_AN.ISO8859-1 pp_AN.iso88591: pp_AN.ISO8859-1 @@ -928,14 +1063,18 @@ pt_PT: pt_PT.ISO8859-1 pt_PT.88591: pt_PT.ISO8859-1 pt_PT.88591.en: pt_PT.ISO8859-1 pt_PT.iso88591: pt_PT.ISO8859-1 +pt_PT.ISO-8859-1: pt_PT.ISO8859-1 pt_PT.ISO_8859-1: pt_PT.ISO8859-1 -pt_PT.iso885915: pt_PT.ISO8859-1 +pt_PT.iso885915: pt_PT.ISO8859-15 +pt_PT@euro: pt_PT.ISO8859-15 ro: ro_RO.ISO8859-2 ro_RO: ro_RO.ISO8859-2 ro_RO.iso88592: ro_RO.ISO8859-2 +ro_RO.ISO-8859-2: ro_RO.ISO8859-2 ru: ru_RU.KOI8-R ru_RU: ru_RU.KOI8-R ru_RU.iso88595: ru_RU.ISO8859-5 +ru_RU.ISO-8859-5: ru_RU.ISO8859-5 ru_RU.koi8r: ru_RU.KOI8-R ru_RU.cp1251: ru_RU.CP1251 ru_RU.microsoftcp1251: ru_RU.CP1251 @@ -960,10 +1099,11 @@ sh_SP: sh_YU.ISO8859-2 sk: sk_SK.ISO8859-2 sk_SK: sk_SK.ISO8859-2 sk_SK.iso88592: sk_SK.ISO8859-2 +sk_SK.ISO-8859-2: sk_SK.ISO8859-2 sl: sl_SI.ISO8859-2 -sl_CS: sl_CS.ISO8859-2 sl_SI: sl_SI.ISO8859-2 sl_SI.iso88592: sl_SI.ISO8859-2 +sl_SI.ISO-8859-2: sl_SI.ISO8859-2 sp: sp_YU.ISO8859-5 sp_YU: sp_YU.ISO8859-5 sq: sq_AL.ISO8859-2 @@ -978,12 +1118,15 @@ sv: sv_SE.ISO8859-1 sv_FI: sv_FI.ISO8859-1 sv_FI.iso88591: sv_FI.ISO8859-1 sv_FI.iso885915: sv_FI.ISO8859-15 +sv_FI@euro: sv_FI.ISO8859-15 sv_SE: sv_SE.ISO8859-1 sv_SE.88591: sv_SE.ISO8859-1 sv_SE.88591.en: sv_SE.ISO8859-1 sv_SE.iso88591: sv_SE.ISO8859-1 +sv_SE.ISO-8859-1: sv_SE.ISO8859-1 sv_SE.ISO_8859-1: sv_SE.ISO8859-1 sv_SE.iso885915: sv_SE.ISO8859-15 +sv_SE@euro: sv_SE.ISO8859-15 ta: ta_IN.TSCII-0 ta_IN: ta_IN.TSCII-0 ta_IN.tscii: ta_IN.TSCII-0 @@ -1001,6 +1144,7 @@ tl_PH.iso88591: tl_PH.ISO8859-1 tr: tr_TR.ISO8859-9 tr_TR: tr_TR.ISO8859-9 tr_TR.iso88599: tr_TR.ISO8859-9 +tr_TR.ISO-8859-9: tr_TR.ISO8859-9 tt: tt_RU.TATAR-CYR tt_RU: tt_RU.TATAR-CYR tt_RU.tatarcyr: tt_RU.TATAR-CYR @@ -1029,6 +1173,7 @@ wa: wa_BE.ISO8859-1 wa_BE: wa_BE.ISO8859-1 wa_BE.iso88591: wa_BE.ISO8859-1 wa_BE.iso885915: wa_BE.ISO8859-15 +wa_BE@euro: wa_BE.ISO8859-15 yi: yi_US.CP1255 yi_US: yi_US.CP1255 yi_US.cp1255: yi_US.CP1255 @@ -1059,22 +1204,42 @@ spanish_spain.8859: es_ES.ISO8859-1 XCOMM The following locale names are used in HPUX 9.x american.iso88591: en_US.ISO8859-1 arabic.iso88596: ar_AA.ISO8859-6 +bokmal: nb_NO.ISO8859-1 +bokmål: nb_NO.ISO8859-1 bulgarian: bg_BG.ISO8859-5 c-french.iso88591: fr_CA.ISO8859-1 +catalan: ca_ES.ISO8859-1 chinese-s: zh_CN.eucCN chinese-t: zh_TW.eucTW croatian: hr_HR.ISO8859-2 czech: cs_CZ.ISO8859-2 +danish: da_DK.ISO8859-1 +dansk: da_DK.ISO8859-1 danish.iso88591: da_DK.ISO8859-1 +deutsch: de_DE.ISO8859-1 +dutch: nl_NL.ISO8859-1 dutch.iso88591: nl_BE.ISO8859-1 +eesti: et_EE.ISO8859-1 english.iso88591: en_EN.ISO8859-1 +estonian: et_EE.ISO8859-1 +finnish: fi_FI.ISO8859-1 finnish.iso88591: fi_FI.ISO8859-1 +français: fr_FR.ISO8859-1 +french: fr_FR.ISO8859-1 french.iso88591: fr_CH.ISO8859-1 +galego: gl_ES.ISO8859-1 +galician: gl_ES.ISO8859-1 +german: de_DE.ISO8859-1 german.iso88591: de_CH.ISO8859-1 +greek: el_GR.ISO8859-7 greek.iso88597: el_GR.ISO8859-7 +hebrew: iw_IL.ISO8859-8 hebrew.iso88598: iw_IL.ISO8859-8 +hrvatski: hr_HR.ISO8859-2 hungarian: hu_HU.ISO8859-2 icelandic.iso88591: is_IS.ISO8859-1 +icelandic: is_IS.ISO8859-1 +italian: it_IT.ISO8859-1 italian.iso88591: it_IT.ISO8859-1 #if ! (defined(SVR4) && defined(sun)) japanese: ja_JP.SJIS @@ -1082,18 +1247,28 @@ japanese: ja_JP.SJIS japanese: ja_JP.eucJP #endif japanese.euc: ja_JP.eucJP +japanese.sjis: ja_JP.SJIS korean: ko_KR.eucKR +korean.euc: ko_KR.eucKR +lithuanian: lt_LT.ISO8859-13 +norwegian: no_NO.ISO8859-1 norwegian.iso88591: no_NO.ISO8859-1 polish: pl_PL.ISO8859-2 +portuguese: pt_PT.ISO8859-1 portuguese.iso88591: pt_PT.ISO8859-1 +romanian: ro_RO.ISO8859-2 rumanian: ro_RO.ISO8859-2 russian: ru_RU.ISO8859-5 serbocroatian: sh_YU.ISO8859-2 slovak: sk_SK.ISO8859-2 -slovene: sl_CS.ISO8859-2 +slovene: sl_SI.ISO8859-2 +slovenian: sl_SI.ISO8859-2 +spanish: es_ES.ISO8859-1 spanish.iso88591: es_ES.ISO8859-1 swedish.iso88591: sv_SE.ISO8859-1 +turkish: tr_TR.ISO8859-9 turkish.iso88599: tr_TR.ISO8859-9 +thai: th_TH.tis620 univ.utf8: en_US.UTF-8 XCOMM Digital Unix utf universal.utf8@ucs4: en_US.UTF-8 diff --git a/xc/nls/locale.dir b/xc/nls/locale.dir index fb7e981c5..1a23b8be4 100644 --- a/xc/nls/locale.dir +++ b/xc/nls/locale.dir @@ -4,7 +4,7 @@ XCOMM This file contains locale database file name XCOMM The first word is the locale database file name and XCOMM the second word is full locale name. XCOMM -XCOMM $XFree86: xc/nls/locale.dir,v 1.24 2001/04/26 21:09:39 dawes Exp $ +XCOMM $XFree86: xc/nls/locale.dir,v 1.25.2.1 2001/05/23 18:32:14 dawes Exp $ XCOMM #ifdef R63_COMPAT XCOMM These entries are in the old format (no ':') @@ -49,13 +49,16 @@ iso8859-1/XLC_LOCALE de_DE.ISO8859-1 iso8859-15/XLC_LOCALE de_DE.ISO8859-15 iso8859-1/XLC_LOCALE de_LI.ISO8859-1 iso8859-1/XLC_LOCALE de_LU.ISO8859-1 -iso8859-7/XLC_LOCALE el_GR.ISO8859-7 +iso8859-15/XLC_LOCALE de_LU.ISO8859-15 +iso8859-7/XLC_LOCALE el_GR.ISO8859-7 +iso8859-15/XLC_LOCALE el_GR.ISO8859-15 iso8859-1/XLC_LOCALE en_AU.ISO8859-1 iso8859-1/XLC_LOCALE en_BZ.ISO8859-1 iso8859-1/XLC_LOCALE en_CA.ISO8859-1 iso8859-1/XLC_LOCALE en_GB.ISO8859-1 iso8859-15/XLC_LOCALE en_GB.ISO8859-15 iso8859-1/XLC_LOCALE en_IE.ISO8859-1 +iso8859-15/XLC_LOCALE en_IE.ISO8859-15 iso8859-1/XLC_LOCALE en_JM.ISO8859-1 iso8859-1/XLC_LOCALE en_NZ.ISO8859-1 iso8859-1/XLC_LOCALE en_TT.ISO8859-1 @@ -126,6 +129,7 @@ iso8859-1/XLC_LOCALE is_IS.ISO8859-1 iso8859-15/XLC_LOCALE is_IS.ISO8859-15 iso8859-1/XLC_LOCALE it_CH.ISO8859-1 iso8859-1/XLC_LOCALE it_IT.ISO8859-1 +iso8859-15/XLC_LOCALE it_IT.ISO8859-15 ja/XLC_LOCALE ja_JP.eucJP ja.SJIS/XLC_LOCALE ja_JP.SJIS ja.JIS/XLC_LOCALE ja_JP.JIS7 @@ -148,7 +152,9 @@ iso8859-5/XLC_LOCALE mk_MK.ISO8859-5 microsoft-cp1251/XLC_LOCALE mk_MK.CP1251 iso8859-1/XLC_LOCALE ms_MY.ISO8859-1 iso8859-1/XLC_LOCALE nl_BE.ISO8859-1 +iso8859-15/XLC_LOCALE nl_BE.ISO8859-15 iso8859-1/XLC_LOCALE nl_NL.ISO8859-1 +iso8859-15/XLC_LOCALE nl_NL.ISO8859-15 iso8859-1/XLC_LOCALE no_NO.ISO8859-1 iso8859-1/XLC_LOCALE no_NO.ISO8859-15 iso8859-1/XLC_LOCALE nb_NO.ISO8859-1 @@ -172,7 +178,6 @@ koi8-r/XLC_LOCALE ru_RU.KOI8-R koi8-u/XLC_LOCALE ru_UA.KOI8-U iso8859-2/XLC_LOCALE sh_YU.ISO8859-2 iso8859-2/XLC_LOCALE sk_SK.ISO8859-2 -iso8859-2/XLC_LOCALE sl_CS.ISO8859-2 iso8859-2/XLC_LOCALE sl_SI.ISO8859-2 iso8859-5/XLC_LOCALE sp_YU.ISO8859-5 iso8859-2/XLC_LOCALE sq_AL.ISO8859-2 @@ -383,19 +388,24 @@ iso8859-1/XLC_LOCALE: da_DK.ISO8859-1 iso8859-15/XLC_LOCALE: da_DK.ISO8859-15 iso8859-1/XLC_LOCALE: de_AT.ISO8859-1 iso8859-15/XLC_LOCALE: de_AT.ISO8859-15 +iso8859-1/XLC_LOCALE: de_BE.ISO8859-1 +iso8859-15/XLC_LOCALE: de_BE.ISO8859-15 iso8859-1/XLC_LOCALE: de_CH.ISO8859-1 iso8859-15/XLC_LOCALE: de_CH.ISO8859-15 iso8859-1/XLC_LOCALE: de_DE.ISO8859-1 iso8859-15/XLC_LOCALE: de_DE.ISO8859-15 iso8859-1/XLC_LOCALE: de_LI.ISO8859-1 iso8859-1/XLC_LOCALE: de_LU.ISO8859-1 +iso8859-15/XLC_LOCALE: de_LU.ISO8859-15 iso8859-7/XLC_LOCALE: el_GR.ISO8859-7 +iso8859-15/XLC_LOCALE: el_GR.ISO8859-15 iso8859-1/XLC_LOCALE: en_AU.ISO8859-1 iso8859-1/XLC_LOCALE: en_BZ.ISO8859-1 iso8859-1/XLC_LOCALE: en_CA.ISO8859-1 iso8859-1/XLC_LOCALE: en_GB.ISO8859-1 iso8859-15/XLC_LOCALE: en_GB.ISO8859-15 iso8859-1/XLC_LOCALE: en_IE.ISO8859-1 +iso8859-15/XLC_LOCALE: en_IE.ISO8859-15 iso8859-1/XLC_LOCALE: en_JM.ISO8859-1 iso8859-1/XLC_LOCALE: en_NZ.ISO8859-1 iso8859-1/XLC_LOCALE: en_TT.ISO8859-1 @@ -466,6 +476,7 @@ iso8859-1/XLC_LOCALE: is_IS.ISO8859-1 iso8859-15/XLC_LOCALE: is_IS.ISO8859-15 iso8859-1/XLC_LOCALE: it_CH.ISO8859-1 iso8859-1/XLC_LOCALE: it_IT.ISO8859-1 +iso8859-15/XLC_LOCALE: it_IT.ISO8859-15 ja/XLC_LOCALE: ja_JP.eucJP ja.SJIS/XLC_LOCALE: ja_JP.SJIS ja.JIS/XLC_LOCALE: ja_JP.JIS7 @@ -487,7 +498,9 @@ iso8859-5/XLC_LOCALE: mk_MK.ISO8859-5 miscrosoft-cp1251/XLC_LOCALE: mk_MK.CP1251 iso8859-1/XLC_LOCALE: ms_MY.ISO8859-1 iso8859-1/XLC_LOCALE: nl_BE.ISO8859-1 +iso8859-15/XLC_LOCALE: nl_BE.ISO8859-15 iso8859-1/XLC_LOCALE: nl_NL.ISO8859-1 +iso8859-15/XLC_LOCALE: nl_NL.ISO8859-15 iso8859-1/XLC_LOCALE: no_NO.ISO8859-1 iso8859-1/XLC_LOCALE: no_NO.ISO8859-15 iso8859-1/XLC_LOCALE: nb_NO.ISO8859-1 @@ -511,7 +524,6 @@ koi8-r/XLC_LOCALE: ru_RU.KOI8-R koi8-u/XLC_LOCALE: ru_UA.KOI8-U iso8859-2/XLC_LOCALE: sh_YU.ISO8859-2 iso8859-2/XLC_LOCALE: sk_SK.ISO8859-2 -iso8859-2/XLC_LOCALE: sl_CS.ISO8859-2 iso8859-2/XLC_LOCALE: sl_SI.ISO8859-2 iso8859-5/XLC_LOCALE: sp_YU.ISO8859-5 iso8859-2/XLC_LOCALE: sq_AL.ISO8859-2 diff --git a/xc/programs/Imakefile b/xc/programs/Imakefile index ac12fd324..927d1dbc1 100644 --- a/xc/programs/Imakefile +++ b/xc/programs/Imakefile @@ -2,7 +2,7 @@ XCOMM $Xorg: Imakefile,v 1.4 2000/08/17 19:47:01 cpqbld Exp $ -XCOMM $XFree86: xc/programs/Imakefile,v 3.44 2001/04/26 21:27:49 dawes Exp $ +XCOMM $XFree86: xc/programs/Imakefile,v 3.45 2001/05/01 17:23:26 alanh Exp $ #define IHaveSubdirs #define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)" @@ -91,6 +91,10 @@ XINPUTCLIENTDIRS = xsetmode xsetpointer GLXCLIENTDIRS = glxinfo glxgears #endif +#ifndef cygwinArchitecture + XLOADDIR = xload +#endif + #if BuildServersOnly || !BuildClients SUBDIRS = $(XSSRCDIR) #else @@ -107,7 +111,7 @@ SUBDIRS = \ xcmsdb $(XCONSOLESRCDIR) xditview $(XDMSRCDIR) xdpyinfo \ $(XF86DGASRCDIR) xedit xev xeyes xfd xfontsel $(XFSSRCDIR) xfsinfo \ $(XFINDPROXYSRCDIR) $(XFWPSRCDIR) $(XGAMMASRCDIR) xgc $(XHOSTSRCDIR) \ - $(XIECLIENTDIRS) $(XINITSRCDIR) $(XKBSRCDIRS) xkill xload xlogo \ + $(XIECLIENTDIRS) $(XINITSRCDIR) $(XKBSRCDIRS) xkill $(XLOADDIR) xlogo \ xlsatoms \ xlsclients xlsfonts xmag xman xmessage xmh xmodmap xprop xrdb \ xrefresh $(XRXSRCDIR) xset \ diff --git a/xc/programs/Xserver/GL/dri/Imakefile b/xc/programs/Xserver/GL/dri/Imakefile index 0bda344d3..f5331716d 100644 --- a/xc/programs/Xserver/GL/dri/Imakefile +++ b/xc/programs/Xserver/GL/dri/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/dri/Imakefile,v 1.5 2000/02/23 04:46:52 martin Exp $ +XCOMM $XFree86: xc/programs/Xserver/GL/dri/Imakefile,v 1.6 2001/04/28 13:55:36 dawes Exp $ #define IHaveModules #include <Server.tmpl> @@ -11,7 +11,8 @@ MOBJ = drimodule.o SRCS = xf86dri.c dri.c $(MSRC) OBJS = xf86dri.o dri.o $(MOBJ) - INCLUDES = -I$(SERVERSRC)/include -I$(XTOP)/include -I$(EXTINCSRC) \ + INCLUDES = -I$(SERVERSRC)/include -I$(INCLUDESRC) -I $(XINCLUDESRC) \ + -I$(EXTINCSRC) \ -I$(XF86OSSRC) -I$(XF86COMSRC) \ -I../include -I../glx -I$(LIBSRC)/GL/include \ -I$(SERVERSRC)/mi -I$(FONTINCSRC) diff --git a/xc/programs/Xserver/GL/glx/Imakefile b/xc/programs/Xserver/GL/glx/Imakefile index 1fd28347a..2a5f17d17 100644 --- a/xc/programs/Xserver/GL/glx/Imakefile +++ b/xc/programs/Xserver/GL/glx/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/GL/glx/Imakefile,v 1.8 2000/08/24 22:20:09 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/GL/glx/Imakefile,v 1.9 2001/04/28 13:55:36 dawes Exp $ #define IHaveModules #include <Server.tmpl> @@ -21,17 +21,11 @@ XCOMM $XFree86: xc/programs/Xserver/GL/glx/Imakefile,v 1.8 2000/08/24 22:20:09 t g_render.o g_renderswap.o g_single.o g_singleswap.o \ $(MOBJS) -#if GlxUseSGISI - INCLUDES = -I. -I../include -I$(SERVERSRC)/include -I$(XTOP)/include \ - -I$(SERVERSRC)/mi \ + INCLUDES = -I. -I../include -I$(SERVERSRC)/include -I$(INCLUDESRC) \ + -I$(XINCLUDESRC) -I$(SERVERSRC)/mi \ -I$(EXTINCSRC) -I$(FONTINCSRC) -I$(LIBSRC)/GL/include \ - -I$(XF86SRC) -I$(XF86COMSRC) -I$(XF86OSSRC) -#else - INCLUDES = -I. -I../include -I$(SERVERSRC)/include -I$(XTOP)/include \ - -I$(SERVERSRC)/mi \ - -I$(EXTINCSRC) -I$(FONTINCSRC) -I$(LIBSRC)/GL/include \ - -I$(XF86SRC) -I../mesa/include -I../mesa/src -I../mesa/src/X -#endif + -I$(XF86SRC) + XCOMM If you add "-DDEBUG" in DEFINES, then make sure you also XCOMM add DEBUG to the define in ../mesa/src/X/xf86glx.c DEFINES = $(GLX_DEFINES) diff --git a/xc/programs/Xserver/GL/glx/glxcmds.c b/xc/programs/Xserver/GL/glx/glxcmds.c index d495fc8eb..476ff0e60 100644 --- a/xc/programs/Xserver/GL/glx/glxcmds.c +++ b/xc/programs/Xserver/GL/glx/glxcmds.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/GL/glx/glxcmds.c,v 1.7 2001/03/25 05:32:01 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/GL/glx/glxcmds.c,v 1.8 2001/05/02 15:06:05 dawes Exp $ */ /* ** License Applicability. Except to the extent portions of this file are ** made subject to an alternative license as permitted in the SGI Free @@ -1014,9 +1014,18 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc) if (pDraw) { __GLXdrawablePrivate *glxPriv; - glxPriv = __glXGetDrawablePrivate(pDraw, drawId, glxc->modes); - if (glxPriv == NULL) { - return __glXBadDrawable; + if (glxc) { + glxPriv = __glXGetDrawablePrivate(pDraw, drawId, glxc->modes); + if (glxPriv == NULL) { + return __glXBadDrawable; + } + } + else { + glxPriv = __glXFindDrawablePrivate(drawId); + if (glxPriv == NULL) { + /* This is a window we've never seen before, do nothing */ + return Success; + } } if ((*glxPriv->swapBuffers)(glxPriv) == GL_FALSE) { diff --git a/xc/programs/Xserver/Imakefile b/xc/programs/Xserver/Imakefile index 3c656e191..566010127 100644 --- a/xc/programs/Xserver/Imakefile +++ b/xc/programs/Xserver/Imakefile @@ -2,7 +2,7 @@ XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:01 cpqbld Exp $ /* * Server Master Makefile */ -XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.226 2001/04/26 21:27:49 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/Imakefile,v 3.229 2001/05/18 17:48:30 torrey Exp $ #ifndef InstallXserverSetUID #define InstallXserverSetUID NO @@ -1121,21 +1121,21 @@ ServerTarget(Xvfb,$(XVFBDIRS),$(XVFBOBJS), \ #if XWinServer XCOMM -XCOMM server with DirectX framebuffer for Windows +XCOMM X Server for MS Windows XCOMM -XWINDDXDIR = hw/xwin -XWIN = $(XWINDDXDIR)/LibraryTargetName(XWin) +FBDIR = fb +SHADOWDIR = miext/shadow +XWINDIR = hw/xwin +XWIN = $(XWINDIR)/LibraryTargetName(Xwin) XWINGDI32 = -lgdi32 XWINDDRAW = -lddraw -/* XWINOLE32 = -lole32 */ -SHADOWDIR = miext/shadow -DDXDIR1 = $(XWINDDXDIR) -XWINDIRS = $(STDDIRS) $(FB) $(SHADOW) $(XWINDDXDIR) $(DEPDIRS) +DDXDIR1 = $(XWINDIR) +XWINDIRS = $(STDDIRS) $(FBDIR) $(SHADOWDIR) $(XWINDIR) $(DEPDIRS) -XWINOBJSA = $(XWINDDXDIR)/stubs.o dix/main.o +XWINOBJSA = $(XWINDIR)/stubs.o #if BuildDPMS -XWINOBJSB = $(XWINDDXDIR)/dpmsstubs.o +XWINOBJSB = $(XWINDIR)/dpmsstubs.o #endif XWINOBJS = $(XWINOBJSA) $(XWINOBJSB) @@ -1160,24 +1160,20 @@ ServerTarget(XWin,$(XWINDIRS),$(XWINOBJS), \ #ifndef ServerToInstall #define ServerToInstall XWin #endif + #endif /* XWinServer */ + #if XDarwinServer XCOMM XCOMM X Darwin server for Mac OS X / Darwin XCOMM -MFBDIR = mfb -CFB8DIR = cfb -CFB16DIR = cfb16 -CFB32DIR = cfb32 +FBDIR = fb DDXDIR1 = hw/darwin DDXDIR2 = hw/darwin/bundle -DARWINDIRS = $(STDDIRS) $(MFBDIR) \ - $(CFB8DIR) $(CFB16DIR) $(CFB32DIR) \ - $(DDXDIR1) $(DEPDIRS) +DARWINDIRS = $(STDDIRS) $(FBDIR) $(DDXDIR1) $(DEPDIRS) DARWINOBJS = $(DDXDIR1)/xfIOKitStartup.o -DARWINLIBS = PreFbLibs $(DDXDIR1)/LibraryTargetName(darwin) \ - $(CFB16) $(CFB32) $(CFB8) PostFbLibs +DARWINLIBS = PreFbLibs $(DDXDIR1)/LibraryTargetName(darwin) FbPostFbLibs DARWINSYSLIBS = $(FONTLIBS) $(SYSLIBS) -framework IOKit /* @@ -1197,7 +1193,7 @@ QUARTZSYSLIBS = -framework ApplicationServices -framework Cocoa \ -framework CoreAudio -framework Carbon -ObjC QUARTZOBJS = $(DDXDIR2)/quartzStartup.o #if NothingOutsideProjectRoot -XDARWINAPPDIR = $(DESTDIR)$(BINDIR)/XDarwin.app/Contents/MacOS +XDARWINAPPDIR = $(BINDIR)/XDarwin.app/Contents/MacOS #else XDARWINAPPDIR = /Applications/XDarwin.app/Contents/MacOS #endif @@ -1210,8 +1206,8 @@ SetUIDServerTarget(XDarwinApp,$(DARWINDIRS),$(QUARTZOBJS), \ $(DARWINSYSLIBS) $(QUARTZSYSLIBS)) install:: - mkdir -p $(XDARWINAPPDIR) - mv $(DESTDIR)$(BINDIR)/XDarwinApp $(XDARWINAPPDIR)/XDarwin + mkdir -p $(DESTDIR)$(XDARWINAPPDIR) + mv $(DESTDIR)$(BINDIR)/XDarwinApp $(DESTDIR)$(XDARWINAPPDIR)/XDarwin -(cd $(DESTDIR)$(BINDIR); $(RM) XDarwinQuartz; \ $(LN) $(XDARWINAPPDIR)/XDarwin XDarwinQuartz) diff --git a/xc/programs/Xserver/Xext/shape.c b/xc/programs/Xserver/Xext/shape.c index 4f7a969ee..25485a121 100644 --- a/xc/programs/Xserver/Xext/shape.c +++ b/xc/programs/Xserver/Xext/shape.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/shape.c,v 3.13 2001/01/17 22:13:16 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/shape.c,v 3.13.2.1 2001/05/31 16:33:38 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -206,7 +206,31 @@ RegionOperate (client, pWin, kind, destRgnp, srcRgn, op, xoff, yoff, create) REGION_DESTROY(pScreen, srcRgn); return Success; } - switch (op) { + + /* May/30/2001: + * The shape.PS specs say if src is None, existing shape is to be + * removed (and so the op-code has no meaning in such removal); + * see shape.PS, page 3, ShapeMask. + */ + if (srcRgn == NULL) { + if (*destRgnp != NULL) { + REGION_DESTROY (pScreen, *destRgnp); + *destRgnp = 0; + /* go on to remove shape and generate ShapeNotify */ + } + else { + /* May/30/2001: + * The target currently has no shape in effect, so nothing to + * do here. The specs say that ShapeNotify is generated whenever + * the client region is "modified"; since no modification is done + * here, we do not generate that event. The specs does not say + * "it is an error to request removal when there is no shape in + * effect", so we return good status. + */ + return Success; + } + } + else switch (op) { case ShapeSet: if (*destRgnp) REGION_DESTROY(pScreen, *destRgnp); diff --git a/xc/programs/Xserver/Xext/shm.c b/xc/programs/Xserver/Xext/shm.c index cfc344611..5dbf87ba3 100644 --- a/xc/programs/Xserver/Xext/shm.c +++ b/xc/programs/Xserver/Xext/shm.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.28 2001/01/17 22:13:18 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.29 2001/05/01 17:03:35 alanh Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -27,11 +27,7 @@ in this Software without prior written authorization from The Open Group. #include <sys/types.h> #ifndef Lynx -#ifndef __CYGWIN__ #include <sys/ipc.h> -#else -#include <sys/cygipc.h> -#endif #include <sys/shm.h> #else #include <ipc.h> diff --git a/xc/programs/Xserver/Xext/vidmodeproc.h b/xc/programs/Xserver/Xext/vidmodeproc.h index 7f6720204..57a7872f0 100644 --- a/xc/programs/Xserver/Xext/vidmodeproc.h +++ b/xc/programs/Xserver/Xext/vidmodeproc.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/vidmodeproc.h,v 1.4 1999/12/13 01:39:40 robin Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/vidmodeproc.h,v 1.5 2001/05/06 00:51:19 mvojkovi Exp $ */ /* Prototypes for DGA functions that the DDX must provide */ @@ -65,6 +65,9 @@ void VidModeCopyMode(pointer modefrom, pointer modeto); int VidModeGetModeValue(pointer mode, int valtyp); void VidModeSetModeValue(pointer mode, int valtyp, int val); vidMonitorValue VidModeGetMonitorValue(pointer monitor, int valtyp, int indx); +Bool VidModeSetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *); +Bool VidModeGetGammaRamp(int, int, CARD16 *, CARD16 *, CARD16 *); +int VidModeGetGammaRampSize(int scrnIndex); #endif diff --git a/xc/programs/Xserver/Xext/xf86bigfont.c b/xc/programs/Xserver/Xext/xf86bigfont.c index 779f510c1..318cab2db 100644 --- a/xc/programs/Xserver/Xext/xf86bigfont.c +++ b/xc/programs/Xserver/Xext/xf86bigfont.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/xf86bigfont.c,v 1.11 2001/04/06 02:16:22 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xf86bigfont.c,v 1.12 2001/05/01 17:29:59 alanh Exp $ */ /* * BIGFONT extension for sharing font metrics between clients (if possible) * and for transmitting font metrics to clients in a compressed form. @@ -164,7 +164,7 @@ XFree86BigfontExtensionInit() FontShmdescIndex = AllocateFontPrivateIndex(); -#if !defined(CSRG_BASED) +#if !defined(CSRG_BASED) && !defined(__CYGWIN__) pagesize = SHMLBA; #else # ifdef _SC_PAGESIZE diff --git a/xc/programs/Xserver/Xext/xf86vmode.c b/xc/programs/Xserver/Xext/xf86vmode.c index a769400c3..e7bcb3446 100644 --- a/xc/programs/Xserver/Xext/xf86vmode.c +++ b/xc/programs/Xserver/Xext/xf86vmode.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/Xext/xf86vmode.c,v 3.51 2001/01/17 22:13:19 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xf86vmode.c,v 3.52 2001/05/06 00:51:19 mvojkovi Exp $ */ /* @@ -87,6 +87,9 @@ static DISPATCH_PROC(ProcXF86VidModeGetDotClocks); static DISPATCH_PROC(ProcXF86VidModeSetGamma); static DISPATCH_PROC(ProcXF86VidModeGetGamma); static DISPATCH_PROC(ProcXF86VidModeSetClientVersion); +static DISPATCH_PROC(ProcXF86VidModeGetGammaRamp); +static DISPATCH_PROC(ProcXF86VidModeSetGammaRamp); +static DISPATCH_PROC(ProcXF86VidModeGetGammaRampSize); static DISPATCH_PROC(SProcXF86VidModeDispatch); static DISPATCH_PROC(SProcXF86VidModeGetAllModeLines); static DISPATCH_PROC(SProcXF86VidModeGetModeLine); @@ -105,6 +108,9 @@ static DISPATCH_PROC(SProcXF86VidModeGetDotClocks); static DISPATCH_PROC(SProcXF86VidModeSetGamma); static DISPATCH_PROC(SProcXF86VidModeGetGamma); static DISPATCH_PROC(SProcXF86VidModeSetClientVersion); +static DISPATCH_PROC(SProcXF86VidModeGetGammaRamp); +static DISPATCH_PROC(SProcXF86VidModeSetGammaRamp); +static DISPATCH_PROC(SProcXF86VidModeGetGammaRampSize); static unsigned char XF86VidModeReqCode = 0; @@ -442,6 +448,9 @@ ProcXF86VidModeGetModeLine(ClientPtr client) } rep.sequenceNumber = client->sequence; + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock)) return BadValue; @@ -529,6 +538,11 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client) DEBUG_P("XF86VidModeGetAllModelines"); + REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq); + + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + ver = ClientMajorVersion(client); modecount = VidModeGetNumOfModes(stuff->screen); @@ -538,7 +552,6 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client) if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock)) return BadValue; - REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq); rep.type = X_Reply; rep.length = SIZEOF(xXF86VidModeGetAllModeLinesReply) - SIZEOF(xGenericReply); @@ -690,6 +703,9 @@ ProcXF86VidModeAddModeLine(ClientPtr client) if (len != stuff->privsize) return BadLength; + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + if (stuff->hsyncstart < stuff->hdisplay || stuff->hsyncend < stuff->hsyncstart || stuff->htotal < stuff->hsyncend || @@ -830,6 +846,9 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client) return BadLength; } + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock)) return BadValue; @@ -941,6 +960,9 @@ ProcXF86VidModeModModeLine(ClientPtr client) stuff->vtotal < stuff->vsyncend) return BadValue; + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock)) return BadValue; @@ -1054,6 +1076,9 @@ ProcXF86VidModeValidateModeLine(ClientPtr client) if (len != stuff->privsize) return BadLength; + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + status = MODE_OK; if (stuff->hsyncstart < stuff->hdisplay || @@ -1118,10 +1143,13 @@ ProcXF86VidModeSwitchMode(ClientPtr client) DEBUG_P("XF86VidModeSwitchMode"); - VidModeZoomViewport(stuff->screen, (short)stuff->zoom); - REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq); + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + + VidModeZoomViewport(stuff->screen, (short)stuff->zoom); + return (client->noClientException); } @@ -1178,6 +1206,9 @@ ProcXF86VidModeSwitchToMode(ClientPtr client) if (len != stuff->privsize) return BadLength; + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock)) return BadValue; @@ -1228,6 +1259,9 @@ ProcXF86VidModeLockModeSwitch(ClientPtr client) DEBUG_P("XF86VidModeLockModeSwitch"); + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + if (!VidModeLockZoom(stuff->screen, (short)stuff->lock)) return VidModeErrorBase + XF86VidModeZoomLocked; @@ -1246,11 +1280,13 @@ ProcXF86VidModeGetMonitor(ClientPtr client) DEBUG_P("XF86VidModeGetMonitor"); - if (!VidModeGetMonitor(stuff->screen, &monitor)) - return BadValue; + REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq); + if(stuff->screen >= screenInfo.numScreens) + return BadValue; - REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq); + if (!VidModeGetMonitor(stuff->screen, &monitor)) + return BadValue; nHsync = VidModeGetMonitorValue(monitor, VIDMODE_MON_NHSYNC, 0).i; nVrefresh = VidModeGetMonitorValue(monitor, VIDMODE_MON_NVREFRESH, 0).i; @@ -1329,6 +1365,10 @@ ProcXF86VidModeGetViewPort(ClientPtr client) DEBUG_P("XF86VidModeGetViewPort"); REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq); + + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -1356,6 +1396,9 @@ ProcXF86VidModeSetViewPort(ClientPtr client) REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq); + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + if (!VidModeSetViewPort(stuff->screen, stuff->x, stuff->y)) return BadValue; @@ -1375,9 +1418,13 @@ ProcXF86VidModeGetDotClocks(ClientPtr client) DEBUG_P("XF86VidModeGetDotClocks"); + REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq); + + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + numClocks = VidModeGetNumOfClocks(stuff->screen, &ClockProg); - REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq); rep.type = X_Reply; rep.length = (SIZEOF(xXF86VidModeGetDotClocksReply) - SIZEOF(xGenericReply) + numClocks) >> 2; @@ -1429,12 +1476,15 @@ ProcXF86VidModeSetGamma(ClientPtr client) DEBUG_P("XF86VidModeSetGamma"); + REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq); + + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + if (!VidModeSetGamma(stuff->screen, ((float)stuff->red)/10000., ((float)stuff->green)/10000., ((float)stuff->blue)/10000.)) return BadValue; - REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq); - return (client->noClientException); } @@ -1449,6 +1499,10 @@ ProcXF86VidModeGetGamma(ClientPtr client) DEBUG_P("XF86VidModeGetGamma"); REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq); + + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; @@ -1469,6 +1523,108 @@ ProcXF86VidModeGetGamma(ClientPtr client) } static int +ProcXF86VidModeSetGammaRamp(ClientPtr client) +{ + CARD16 *r, *g, *b; + int length; + REQUEST(xXF86VidModeSetGammaRampReq); + + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + + if(stuff->size != VidModeGetGammaRampSize(stuff->screen)) + return BadValue; + + length = (stuff->size + 1) & ~1; + + REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length * 6); + + r = (CARD16*)&stuff[1]; + g = r + length; + b = g + length; + + if (!VidModeSetGammaRamp(stuff->screen, stuff->size, r, g, b)) + return BadValue; + + return (client->noClientException); +} + +static int +ProcXF86VidModeGetGammaRamp(ClientPtr client) +{ + CARD16 *ramp = NULL; + int n, length, i; + xXF86VidModeGetGammaRampReply rep; + REQUEST(xXF86VidModeGetGammaRampReq); + + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + + if(stuff->size != VidModeGetGammaRampSize(stuff->screen)) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq); + + length = (stuff->size + 1) & ~1; + + if(stuff->size) { + if(!(ramp = xalloc(length * 3 * sizeof(CARD16)))) + return BadAlloc; + + if (!VidModeGetGammaRamp(stuff->screen, stuff->size, + ramp, ramp + length, ramp + (length * 2))) + return BadValue; + } + + rep.type = X_Reply; + rep.length = (length >> 1) * 3; + rep.sequenceNumber = client->sequence; + rep.size = stuff->size; + if(client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swaps(&rep.size, n); + for(i = 0; i < length * 3; i++) + swaps(&ramp[i],n); + } + WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), (char *)&rep); + + if(stuff->size) { + WriteToClient(client, rep.length << 2, (char*)ramp); + xfree(ramp); + } + + return (client->noClientException); +} + + +static int +ProcXF86VidModeGetGammaRampSize(ClientPtr client) +{ + xXF86VidModeGetGammaRampSizeReply rep; + int n; + REQUEST(xXF86VidModeGetGammaRampSizeReq); + + if(stuff->screen >= screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq); + + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.size = VidModeGetGammaRampSize(stuff->screen); + if(client->swapped) { + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swaps(&rep.size, n); + } + WriteToClient(client,sizeof(xXF86VidModeGetGammaRampSizeReply),(char*)&rep); + + return (client->noClientException); +} + +static int ProcXF86VidModeSetClientVersion(ClientPtr client) { REQUEST(xXF86VidModeSetClientVersionReq); @@ -1536,6 +1692,12 @@ ProcXF86VidModeDispatch(ClientPtr client) return ProcXF86VidModeGetGamma(client); case X_XF86VidModeSetClientVersion: return ProcXF86VidModeSetClientVersion(client); + case X_XF86VidModeGetGammaRamp: + return ProcXF86VidModeGetGammaRamp(client); + case X_XF86VidModeSetGammaRamp: + return ProcXF86VidModeSetGammaRamp(client); + case X_XF86VidModeGetGammaRampSize: + return ProcXF86VidModeGetGammaRampSize(client); default: return BadRequest; } @@ -1874,6 +2036,52 @@ SProcXF86VidModeGetGamma(ClientPtr client) } static int +SProcXF86VidModeSetGammaRamp(ClientPtr client) +{ + CARD16 *ramp; + int length, n; + REQUEST(xXF86VidModeSetGammaRampReq); + swaps(&stuff->length, n); + REQUEST_AT_LEAST_SIZE(xXF86VidModeSetGammaRampReq); + swaps(&stuff->size, n); + swaps(&stuff->screen, n); + length = ((stuff->size + 1) & ~1) * 6; + REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length); + ramp = (CARD16*)&stuff[1]; + while(length--) { + swaps(ramp, n); + ramp++; + } + return ProcXF86VidModeSetGammaRamp(client); +} + +static int +SProcXF86VidModeGetGammaRamp(ClientPtr client) +{ + int n; + REQUEST(xXF86VidModeGetGammaRampReq); + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq); + swaps(&stuff->size, n); + swaps(&stuff->screen, n); + return ProcXF86VidModeGetGammaRamp(client); +} + +static int +SProcXF86VidModeGetGammaRampSize(ClientPtr client) +{ + int n; + REQUEST(xXF86VidModeGetGammaRampSizeReq); + swaps(&stuff->length, n); + REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq); + swaps(&stuff->screen, n); + return ProcXF86VidModeGetGammaRampSize(client); +} + + + + +static int SProcXF86VidModeDispatch(ClientPtr client) { REQUEST(xReq); @@ -1918,6 +2126,12 @@ SProcXF86VidModeDispatch(ClientPtr client) return SProcXF86VidModeGetGamma(client); case X_XF86VidModeSetClientVersion: return SProcXF86VidModeSetClientVersion(client); + case X_XF86VidModeGetGammaRamp: + return SProcXF86VidModeGetGammaRamp(client); + case X_XF86VidModeSetGammaRamp: + return SProcXF86VidModeSetGammaRamp(client); + case X_XF86VidModeGetGammaRampSize: + return SProcXF86VidModeGetGammaRampSize(client); default: return BadRequest; } diff --git a/xc/programs/Xserver/Xext/xvdix.h b/xc/programs/Xserver/Xext/xvdix.h index d1bd6e20f..c7bdeef9c 100644 --- a/xc/programs/Xserver/Xext/xvdix.h +++ b/xc/programs/Xserver/Xext/xvdix.h @@ -21,7 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/Xext/xvdix.h,v 1.6 2000/01/18 16:35:39 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/Xext/xvdix.h,v 1.7 2001/05/07 21:37:51 tsi Exp $ */ #ifndef XVDIX_H #define XVDIX_H @@ -53,7 +53,7 @@ SOFTWARE. ** */ -#include "pixmap.h" +#include "scrnintstr.h" #include "Xvproto.h" extern int XvScreenIndex; diff --git a/xc/programs/Xserver/dix/main.c b/xc/programs/Xserver/dix/main.c index 80d977c71..f38a86182 100644 --- a/xc/programs/Xserver/dix/main.c +++ b/xc/programs/Xserver/dix/main.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.34 2001/03/04 17:40:04 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/dix/main.c,v 3.35 2001/04/28 20:42:17 torrey Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -261,6 +261,8 @@ main(argc, argv, envp) char *xauthfile; HWEventQueueType alwaysCheckForInput[2]; + display = "0"; + /* Quartz support on Mac OS X requires that the Cocoa event loop be in * the main thread. This allows the X server main to be called again * from another thread. */ @@ -290,7 +292,6 @@ main(argc, argv, envp) * can't be passed argc, argv as parameters */ argcGlobal = argc; argvGlobal = argv; - display = "0"; /* prep X authority file from environment; this can be overriden by a * command line option */ xauthfile = getenv("XAUTHORITY"); diff --git a/xc/programs/Xserver/hw/darwin/Imakefile b/xc/programs/Xserver/hw/darwin/Imakefile index b5fb675b0..a64fea603 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.10 2001/03/24 23:08:53 torrey Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.11 2001/05/18 17:48:32 torrey Exp $ #include <Server.tmpl> #define IHaveSubdirs @@ -13,9 +13,9 @@ OBJS = darwin.o \ xfIOKit.o \ xfIOKitCursor.o -INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/mfb -I$(SERVERSRC)/cfb \ - -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(SERVERSRC)/os \ - -I$(INCLUDESRC) -I$(FONTINCSRC) +INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb -I$(EXTINCSRC) \ + -I$(SERVERSRC)/render -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ + -I$(SERVERSRC)/os -I$(INCLUDESRC) -I$(FONTINCSRC) #if defined(XFree86CustomVersion) CUSTOMVERSION = XFree86CustomVersion diff --git a/xc/programs/Xserver/hw/darwin/XDarwin.man b/xc/programs/Xserver/hw/darwin/XDarwin.man index f72aee3c8..e5979cc75 100644 --- a/xc/programs/Xserver/hw/darwin/XDarwin.man +++ b/xc/programs/Xserver/hw/darwin/XDarwin.man @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/darwin/XDarwin.man,v 1.1 2001/03/28 08:28:55 torrey Exp $ +.\" $XFree86: xc/programs/Xserver/hw/darwin/XDarwin.man,v 1.1.2.1 2001/05/21 04:56:06 torrey Exp $ .\" .TH XDARWIN 1 __vendorversion__ .SH NAME @@ -13,7 +13,7 @@ is the window server for Version 11 of the X window system on the Darwin operating system. .I XDarwin can be started from the Darwin text console, or while running the Mac OS X -Quartz window server. +Aqua GUI. .PP When running from the console, .I XDarwin @@ -23,20 +23,20 @@ mouse and keyboard and to provide a layer of hardware abstraction. In console mo will normally be started by the \fIxdm(1)\fP display manager or by a script that runs the program \fIxinit(1)\fP. .PP -When running with the Mac OS X Quartz window server, +When running with the Mac OS X Aqua GUI, .I XDarwin -will normally be started with the Xmaster application. This application acts an -agent for +will normally be started by launching it from the Finder, but it may also be started from the command line with the \fB\-quartz\fP option. The .I XDarwin -to receive events and allows easy switching between the Mac OS X and X window -desktops. In this mode, CoreGraphics is used to capture and draw to the screen. +application allows easy switching between the Mac OS X and X window +desktops. CoreGraphics is used to capture and draw to the screen. Note that the defaults for various command line options are set by the application preferences in this mode. #else .I XDarwin is the window server for Version 11 of the X window system on the Darwin operating system. This version of .I XDarwin -can only be started from the Darwin text console. The Mac OS X Quartz window -server, if present, must be shut down. It uses IOKit services to accesss the display +can only be started from the Darwin text console. The Mac OS X Aqua GUI, if present, must be shut down. +.I XDarwin +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 @@ -54,6 +54,9 @@ 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 "\-keymap \fIfile\fP" +On startup \fIXDarwin\fP translates a Darwin keymapping into an X keymap. With this option the keymapping is read from a file instead of the kernel. If the file's path is not specified, it will be searched for in Library/Keyboards/ underneath the following directories (in order): ~, /, /Network, /System. #ifdef DARWIN_WITH_QUARTZ .TP 8 .B "\-size \fIwidth\fP \fIheight\fP" @@ -69,8 +72,11 @@ This option is ignored if \fB\-quartz\fP is specified. Gives the refresh rate to use in Hz. For LCD displays this should be 0. This option is ignored if \fB\-quartz\fP is specified. .TP 8 +.B "\-screen \fIscreenum\fP" +Specifies which screen number the X server should run on. Screen number 0 is the default. This option is ignored if \fB\-quartz\fP is specified. +.TP 8 .B \-quartz -Run in parallel with the Mac OS X Quartz window server. +Run in parallel with the Mac OS X Aqua GUI. #else .TP 8 .B "\-size \fIwidth\fP \fIheight\fP" @@ -82,6 +88,9 @@ 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 "\-screen \fIscreenum\fP" +Specifies which screen number the X server should run on. Screen number 0 is the default. #endif .TP 8 .B \-showconfig @@ -97,18 +106,27 @@ X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1) and this man page still have many limitations. Some of the more obvious ones are: .br +- There is no rootless mode with Aqua. +.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 key repeat rate can not be changed. .PP .SH AUTHORS -Original Port to Mac OS X Server - John Carmack +XFree86 was originally ported to Mac OS X Server by John Carmack. Dave Zarzycki used this as the basis of his port of XFree86 4.0 to Darwin 1.0. Torrey T. Lyons improved and integrated this code into the XFree86 Project's mainline for the 4.0.2 release. +.PP +The following members of the XonX Team contributed to the XFree86 4.1 release: +.PP +Rob Braun - Darwin x86 support +.br +Torrey T. Lyons - Project Lead +.br +Andreas Monitzer - Cocoa version of XDarwin front end +.br +Gregory Robert Parker - Original Quartz implementation .br -Port to Darwin 1.0 - Dave Zarzycki +Christoph Pfisterer - Dynamic shared X libraries .br -Improvements and bug fixes - Torrey T. Lyons - +Toshimitsu Tanaka - Japanese localization diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf index a823101ac..d93cfaef1 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf +++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Credits.rtf @@ -1,10 +1,62 @@ -{\rtf1\mac\ansicpg10000{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\rtf1\mac\ansicpg10000\cocoartf100 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; +} {\colortbl;\red255\green255\blue255;} -\paperw9240\paperh9000 +\vieww5160\viewh4480\viewkind0 +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc + +\f0\b\fs24 \cf0 XonX Team Members\ +Contributing to XFree86 4.1: +\f1\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 Rob Braun\ + +\f2\i Darwin x86 support +\f1\i0 \ +Torrey T. Lyons\ + +\f2\i Project Lead +\f1\i0 \ +Andreas Monitzer\ + +\f2\i Cocoa version of XDarwin front end +\f1\i0 \ +Gregory Robert Parker\ + +\f2\i Original Quartz implementation +\f1\i0 \ +Christoph Pfisterer\ + +\f2\i Dynamic shared libraries +\f1\i0 \ +Toshimitsu Tanaka\ + +\f2\i Japanese localization +\f1\i0 \ +\ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc + +\f0\b \cf0 Special Thanks: +\f1\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 Tiago Ribeiro\ + +\f2\i XDarwin icon +\f1\i0 \ +\ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\fs24 \cf0 John Carmack - Original XFree86 port to Mac OS X Server\ -Dave Zarzycki - XFree86 4.0 port to Darwin 1.0\ -Torrey T. Lyons - Improvements and bug fixes\ -Gregory Robert Parker - Original Quartz implementation\ -Andreas Monitzer - Cocoa version of Xmaster} +\f0\b \cf0 History: +\f1\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 John Carmack\ + +\f2\i Original XFree86 port to Mac OS X Server +\f1\i0 \ +Dave Zarzycki\ + +\f2\i XFree86 4.0 port to Darwin 1.0 +\f1\i0 \ +Torrey T. Lyons\ + +\f2\i Integration into XFree86 Project for 4.0.2} diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile new file mode 100644 index 000000000..267e0a3d6 --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile @@ -0,0 +1,19 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Imakefile,v 1.1.2.1 2001/05/21 04:56:07 torrey Exp $ + +#include <Server.tmpl> + +INCLUDES = -I$(SERVERSRC)/include + +VERS = XFree86VersionString +DATE = XFree86DateString +XF86_DEFS = $(INCLUDES) -DXF86_VERSION=$(VERS) -DXF86_REL_DATE=$(DATE) \ + -DXF86_COPYRIGHT='"XFree86 $(VERS)\nCopyright 2001 XFree86 Project, Inc."' + +AllTarget(XDarwinHelp.html) +CppFileTarget(XDarwinHelp.html,XDarwinHelp.html.cpp,$(XF86_DEFS), \ + NullParameter) + +AllTarget(InfoPlist.strings) +CppFileTarget(InfoPlist.strings,InfoPlist.strings.cpp,$(XF86_DEFS), \ + NullParameter) + diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp new file mode 100644 index 000000000..2fd4b6aec --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp @@ -0,0 +1,5 @@ +/* English localized versions of Info.plist keys. */ +/* Most of these are set in the target application settings. */ +/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/InfoPlist.strings.cpp,v 1.1.2.1 2001/05/21 04:56:07 torrey Exp $ */ + +NSHumanReadableCopyright = XF86_COPYRIGHT diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib index b5583719f..51353d155 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib +++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib @@ -12,6 +12,7 @@ LANGUAGE = ObjC; OUTLETS = { displayNumber = id; + dockSwitchButton = id; fakeButton = id; keyField = id; keymapFileField = id; @@ -31,10 +32,10 @@ SUPERCLASS = NSApplication; }, { - ACTIONS = {applicationWillResignActive = id; closeHelpAndShow = id; }; + ACTIONS = {applicationWillResignActive = id; closeHelpAndShow = id; showAction = id; }; CLASS = Xserver; LANGUAGE = ObjC; - OUTLETS = {helpWindow = id; startupHelpButton = id; }; + OUTLETS = {helpWindow = id; startupHelpButton = id; switchWindow = id; }; SUPERCLASS = NSObject; } ); diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/info.nib b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/info.nib index 21d75f060..773a28359 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/info.nib +++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/info.nib @@ -3,19 +3,26 @@ <plist version="0.9"> <dict> <key>IBDocumentLocation</key> - <string>20 4 367 304 0 4 800 574 </string> + <string>20 11 367 304 0 4 800 574 </string> <key>IBMainMenuLocation</key> - <string>19 268 220 44 0 4 800 574 </string> + <string>20 320 285 44 0 4 800 574 </string> <key>IBUserGuides</key> <dict> - <key>HelpPanel</key> + <key>Help Window</key> <dict> <key>guideLocations</key> <array/> <key>guidesLocked</key> <string>NO</string> </dict> - <key>PrefPanel</key> + <key>Pref Window</key> + <dict> + <key>guideLocations</key> + <array/> + <key>guidesLocked</key> + <string>NO</string> + </dict> + <key>X Panel</key> <dict> <key>guideLocations</key> <array/> diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib Binary files differindex 39fec4b7a..ecda1a0cf 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib +++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib diff --git a/xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp new file mode 100644 index 000000000..d5ebf697d --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp @@ -0,0 +1,90 @@ +<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/XDarwinHelp.html.cpp,v 1.1.2.1 2001/05/21 04:56:07 torrey Exp $ --> + +#include "xf86Version.h" +#ifndef PRE_RELEASE +#define PRE_RELEASE XF86_VERSION_SNAP +#endif + +<html> +<head> +<title>XFree86 for Mac OS X</title> +</head> +<body> +<center> + <h1>XFree86 on Darwin and Mac OS X</h1> + XFree86 XF86_VERSION<br> + Release Date: XF86_REL_DATE +</center> +<h2>Contents</h2> +<ol> + <li><A HREF="#notice">Important Notice</A></li> + <li><A HREF="#usage">Usage</A></li> + <li><A HREF="#path">Setting Your Path</A></li> + <li><A HREF="#prefs">User Preferences</A></li> + <li><A HREF="#license">License</A></li> +</ol> +<center> + <h2><a NAME="notice">Important Notice</a></h2> +</center> +<blockquote> +#if PRE_RELEASE +This is a pre-release version of XFree86, and is not supported in any way. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. Before reporting bugs in pre-release versions, please check the latest version from <A HREF="http://sourceforge.net/projects/xonx/">XonX</A> or in the <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS repository</A>. +#else +If the server is older than 6-12 months, or if your hardware is newer than the above date, look for a newer version before reporting problems. Bugs may be reported and patches may be submitted to the <A HREF="http://sourceforge.net/projects/xonx/">XonX project page</A> at SourceForge. +#endif +</blockquote> +<blockquote> +This software is distributed under the terms of the <A HREF="#license">MIT X11 / X Consortium License</A> and is provided AS IS, with no warranty. Please read the <A HREF="#license">License</A> before using.</blockquote> +<h2><a NAME="usage">Usage</a></h2> +<p>XFree86 is a freely redistributable open-source implementation of the <a HREF +="http://www.x.org/">X Window System</a> produced by the <a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a> XFree86 runs on Mac OS X in full screen mode. When the X window system is active, it takes over the entire screen. You can switch back to the Mac OS X desktop by holding down Command-Option-A. This key combination can be changed in the user preferences. From the Mac OS X desktop, just click on the XDarwin icon in the floating switch window to switch back to the X window system. You can change this behavior in the user preferences so that clicking on the XDarwin icon in the Dock switches as well.</p> +<h3>Multi-Button Mouse Emulation</h3> +<p>Many X11 applications rely on the use of a 3-button mouse. To emulate a 3-button mouse with a single button, select "Enable emulation of multiple mouse buttons" in the Preferences. When emulating a 3-button mouse, holding down the left command key and clicking the mouse button will simulate clicking the second mouse button. Holding down the left option key and clicking will simulate the third button.</p> +<p>Notes:</p> +<ul> + <li>With most keyboards the left and right command and option keys are not differentiated so either will work. + <li>Even with command and/or option keys mapped to some other key with xmodmap, you still must use the original command and option keys for multibutton mouse emulation. + <li>The only way to simulate holding down the left command key and clicking the second mouse button is to map some other key to be the left command key. The same is true for simulating holding down the left option key and clicking the third mouse button. +</ul> +<h2><a NAME="path">Setting Your Path</a></h2> +<p>The X11 binaries are located in /usr/X11R6/bin, which you may need to add to your path. Your path is the list of directories to be searched for executable commands. The way to do this depends on the shell you are using. The following directions are for tcsh, which is the default shell on Darwin and Mac OS X.</p> +<p>You can check your path by typing "printenv PATH". You should see /usr/X11R6/bin listed as one of the directories. If not, you should add it to your default path. To do so, you can add the following line to the file ~/Library/init/tcsh/path: (You may need to create this file and directory path if it does not exist already.)</p> +<blockquote>setenv PATH "${PATH}:/usr/X11R6/bin"</blockquote> +<p>Note that if you have created a .cshrc or .tcshrc file, these files will override your settings in ~/Library/init/tcsh/ and you will need to change one of these files instead. These changes will not take effect until you open a new Terminal window. You may also want to add the man pages from XFree86 to the list of pages to be searched when you are looking for documentation. The X11 man pages are located in /usr/X11R6/man and the MANPATH environment variable contains the list of directories to search.</p> +<h2><a NAME="prefs">User Preferences</a></h2> +<p>A number of options may be set from the user preferences, accessible from the "Preferences..." menu item in the "XDarwin" menu. The options listed under Startup Options will not take effect until you have restarted XDarwin. All other options take effect immediately. The various options are described below:</p> +<ul> + <li>Key combination button: Click this button and then press any number of modifiers followed by a standard key to change the key combination to switch between Aqua and X11.</li> + <li>Use System beep for X11: When enabled the standard Mac OS X alert sound is used as X11 bell. When disabled (default) a simple tone is used.</li> + <li>Click on icon in Dock switches to X11: Enable this to activate switching to X11 by clicking on the XDarwin icon in the Dock. On some versions of Mac OS X, switching by clicking in the Dock can cause the cursor to disappear on returning to Aqua.</li> + <li>Show help on startup: This will show the introductory splash screen when XDarwin is launched.</li> + <li>Display number: This sets what X display number XDarwin should assign to the display. Note that XDarwin always takes over the main display when showing X11.</li> + <li>Keymapping: By default, XDarwin loads the keymapping from the Darwin kernel on startup. On portables, this keymapping is sometimes empty so that the keyboard will appear to be dead in X11. If "Load from file" is selected, XDarwin will load the keymapping from the specified file instead.</li> +</ul> +<h2><a NAME="license">License</a></h2> +The XFree86 Project is committed to providing freely redistributable binary and source releases. The main license we use is one based on the traditional MIT X11 / X Consortium License, which doesn't impose any conditions on modification or redistribution of source code or binaries other than requiring that copyright/license notices are left intact. For more information and additional copyright/licensing notices covering some sections of the code, please see the <A HREF="http://www.xfree86.org/legal/licence.html">XFree86 +License page</A>. +<H3><A NAME="3"></A>X Consortium License</H3> +<p>Copyright (C) 1996 X Consortium</p> +<p>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:</p> +<p>The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software.</p> +<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE.</p> +<p>Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization from +the X Consortium.</p> +<p>X Window System is a trademark of X Consortium, Inc.</p> +</body> +</html> diff --git a/xc/programs/Xserver/hw/darwin/bundle/Imakefile b/xc/programs/Xserver/hw/darwin/bundle/Imakefile index aaeed48a7..42dd7b6e2 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/Imakefile +++ b/xc/programs/Xserver/hw/darwin/bundle/Imakefile @@ -1,6 +1,7 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/Imakefile,v 1.9 2001/04/18 20:28:52 torrey Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/Imakefile,v 1.10.2.1 2001/05/21 04:56:06 torrey Exp $ #include <Server.tmpl> +#define IHaveSubdirs SRCS = Preferences.m \ XApplication.m \ @@ -28,13 +29,24 @@ CUSTOMVERSION = XFree86CustomVersion CUSTOMVERDEF = -DXF86_CUSTOM_VERSION='$(CUSTOMVERSION)' #endif -DEFINES = $(CUSTOMVERDEF) -DXBINDIR=$(DESTDIR)$(BINDIR) -DXINITDIR=$(XINITDIR) +DEFINES = $(CUSTOMVERDEF) -DXBINDIR=$(BINDIR) -DXINITDIR=$(XINITDIR) #if NothingOutsideProjectRoot -XDARWINROOT = $(DESTDIR)$(BINDIR) +XDARWINROOT = $(BINDIR) #else XDARWINROOT = /Applications #endif +#if XFree86Devel +PBXBUILDSTYLE = -buildstyle Development +#else +PBXBUILDSTYLE = -buildstyle Deployment +#endif + +SUBDIRS = English.lproj Japanese.lproj + +MakeSubdirs($(SUBDIRS)) +DependSubdirs($(SUBDIRS)) + NormalLibraryObjectRule() NormalLibraryTarget(XQuartz,$(OBJS)) @@ -43,19 +55,20 @@ AllTarget(quartzStartup.o) AllTarget(XDarwinStartup) NormalProgramTarget(XDarwinStartup,XDarwinStartup.o,NullParameter, \ NullParameter,NullParameter) -InstallProgram(XDarwinStartup,$(DESTDIR)$(BINDIR)) +InstallProgram(XDarwinStartup,$(BINDIR)) install:: -(cd $(DESTDIR)$(BINDIR); $(RM) X; $(LN) XDarwinStartup X) AllTarget(XDarwin) XDarwin: - pbxbuild -target XDarwin + pbxbuild -target XDarwin $(PBXBUILDSTYLE) install:: - pbxbuild install -target XDarwin DSTROOT=$(XDARWINROOT) + pbxbuild install -target XDarwin $(PBXBUILDSTYLE) \ + DSTROOT=$(DESTDIR)$(XDARWINROOT) clean:: - pbxbuild "clean" -target XDarwin + pbxbuild "clean" -target XDarwin $(PBXBUILDSTYLE) DependTarget() diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf index 452a4a044..d93cfaef1 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf +++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Credits.rtf @@ -1,10 +1,62 @@ -{\rtf1\mac\ansicpg10000{\fonttbl\f0\fswiss\fcharset77 Helvetica;} +{\rtf1\mac\ansicpg10000\cocoartf100 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; +} {\colortbl;\red255\green255\blue255;} +\vieww5160\viewh4480\viewkind0 +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc + +\f0\b\fs24 \cf0 XonX Team Members\ +Contributing to XFree86 4.1: +\f1\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 Rob Braun\ + +\f2\i Darwin x86 support +\f1\i0 \ +Torrey T. Lyons\ + +\f2\i Project Lead +\f1\i0 \ +Andreas Monitzer\ + +\f2\i Cocoa version of XDarwin front end +\f1\i0 \ +Gregory Robert Parker\ + +\f2\i Original Quartz implementation +\f1\i0 \ +Christoph Pfisterer\ + +\f2\i Dynamic shared libraries +\f1\i0 \ +Toshimitsu Tanaka\ + +\f2\i Japanese localization +\f1\i0 \ +\ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc + +\f0\b \cf0 Special Thanks: +\f1\b0 \ \pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 Tiago Ribeiro\ + +\f2\i XDarwin icon +\f1\i0 \ +\ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\qc -\f0\fs24 \cf0 John Carmack - Original XFree86 port to Mac OS X Server\ -Dave Zarzycki - XFree86 4.0 port to Darwin 1.0\ -Torrey T. Lyons - Improvements and bug fixes\ -Gregory Robert Parker - Original Quartz implementation\ -Andreas Monitzer - Cocoa version of Xmaster\ -Toshimitsu Tanaka - Japanese translation} +\f0\b \cf0 History: +\f1\b0 \ +\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural +\cf0 John Carmack\ + +\f2\i Original XFree86 port to Mac OS X Server +\f1\i0 \ +Dave Zarzycki\ + +\f2\i XFree86 4.0 port to Darwin 1.0 +\f1\i0 \ +Torrey T. Lyons\ + +\f2\i Integration into XFree86 Project for 4.0.2} diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Imakefile b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Imakefile new file mode 100644 index 000000000..df873408d --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Imakefile @@ -0,0 +1,19 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/Imakefile,v 1.1.2.1 2001/05/21 04:56:07 torrey Exp $ + +#include <Server.tmpl> + +INCLUDES = -I$(SERVERSRC)/include + +VERS = XFree86VersionString +DATE = XFree86DateString +XF86_DEFS = $(INCLUDES) -DXF86_VERSION=$(VERS) -DXF86_REL_DATE=$(DATE) \ + -DXF86_COPYRIGHT='"XFree86 $(VERS)\nCopyright 2001 XFree86 Project, Inc."' + +AllTarget(XDarwinHelp.html) +CppFileTarget(XDarwinHelp.html,XDarwinHelp.html.cpp,$(XF86_DEFS), \ + NullParameter) + +AllTarget(InfoPlist.strings) +CppFileTarget(InfoPlist.strings,InfoPlist.strings.cpp,$(XF86_DEFS), \ + NullParameter) + diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp new file mode 100644 index 000000000..6a2e760d8 --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp @@ -0,0 +1,5 @@ +/* Japanese localized versions of Info.plist keys. */ +/* Most of these are set in the target application settings. */ +/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/InfoPlist.strings.cpp,v 1.1.2.1 2001/05/21 04:56:07 torrey Exp $ */ + +NSHumanReadableCopyright = XF86_COPYRIGHT diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib index b5583719f..51353d155 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib +++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/classes.nib @@ -12,6 +12,7 @@ LANGUAGE = ObjC; OUTLETS = { displayNumber = id; + dockSwitchButton = id; fakeButton = id; keyField = id; keymapFileField = id; @@ -31,10 +32,10 @@ SUPERCLASS = NSApplication; }, { - ACTIONS = {applicationWillResignActive = id; closeHelpAndShow = id; }; + ACTIONS = {applicationWillResignActive = id; closeHelpAndShow = id; showAction = id; }; CLASS = Xserver; LANGUAGE = ObjC; - OUTLETS = {helpWindow = id; startupHelpButton = id; }; + OUTLETS = {helpWindow = id; startupHelpButton = id; switchWindow = id; }; SUPERCLASS = NSObject; } ); diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/info.nib b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/info.nib index babc232fe..e73a41b09 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/info.nib +++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/info.nib @@ -3,19 +3,26 @@ <plist version="0.9"> <dict> <key>IBDocumentLocation</key> - <string>451 75 367 304 0 67 1024 679 </string> + <string>29 444 369 278 0 64 1024 682 </string> <key>IBMainMenuLocation</key> - <string>78 473 262 44 0 4 800 574 </string> + <string>44 386 343 44 0 71 1024 675 </string> <key>IBUserGuides</key> <dict> - <key>HelpPanel</key> + <key>Help Window</key> <dict> <key>guideLocations</key> <array/> <key>guidesLocked</key> <string>NO</string> </dict> - <key>PrefPanel</key> + <key>Pref Window</key> + <dict> + <key>guideLocations</key> + <array/> + <key>guidesLocked</key> + <string>NO</string> + </dict> + <key>X Panel</key> <dict> <key>guideLocations</key> <array/> diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib Binary files differindex 0c990727b..b8574b1c5 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib +++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/MainMenu.nib/objects.nib diff --git a/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp new file mode 100644 index 000000000..e2139645e --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp @@ -0,0 +1,144 @@ +<!-- $XFree86: xc/programs/Xserver/hw/darwin/bundle/Japanese.lproj/XDarwinHelp.html.cpp,v 1.1.2.2 2001/05/22 03:36:53 torrey Exp $ --> + +#include "xf86Version.h" +#ifndef PRE_RELEASE +#define PRE_RELEASE XF86_VERSION_SNAP +#endif + +<html> +<head> +<META http-equiv="Content-Type" content="text/html; charset=EUC-JP"> +<title> +XFree86 for Mac OS X</title></head> +<body> +<center> + <h1>XFree86 on Darwin and Mac OS X</h1> + XFree86 XF86_VERSION<br> + Release Date: XF86_REL_DATE +</center> +<h2>Ìܼ¡</h2> +<ol> + <li><A HREF="#notice">Ãí°Õ»ö¹à</A></li> + <li><A HREF="#usage">»ÈÍÑË¡</A></li> + <li><A HREF="#path">¥Ñ¥¹¤ÎÀßÄê</A></li> + <li><A HREF="#prefs">´Ä¶ÀßÄê</A></li> + <li><A HREF="#license">¥é¥¤¥»¥ó¥¹</A></li> +</ol> +<center> + <h2><a NAME="notice">Ãí°Õ»ö¹à</a></h2> +</center> +<blockquote> +#if PRE_RELEASE +¤³¤ì¤Ï¡¤XFree86 ¤Î¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ê¡¤¤¤¤«¤Ê¤ë¾ì¹ç¤Ë¤ª¤¤¤Æ¤â¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤»¤ó¡£ +¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î <A HREF="http://sourceforge.net/projects/xonx/">XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸</A>¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£ +¥×¥ì¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Î¥Ð¥°¤òÊó¹ð¤¹¤ëÁ°¤Ë¡¤<A HREF="http://sourceforge.net/projects/xonx/">XonX</A> ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸¤Þ¤¿¤Ï <A HREF="http://www.XFree86.Org/cvs">XFree86 CVS ¥ê¥Ý¥¸¥È¥ê</A>¤ÇºÇ¿·ÈǤΥÁ¥§¥Ã¥¯¤ò¤·¤Æ²¼¤µ¤¤¡£ +</blockquote> +#else +¤â¤·¡¤¥µ¡¼¥Ð¡¼¤¬ 6 -12 ¥ö·î°Ê¾åÁ°¤Î¤â¤Î¤«¡¤¤Þ¤¿¤Ï¤¢¤Ê¤¿¤Î¥Ï¡¼¥É¥¦¥§¥¢¤¬¾åµ¤ÎÆüÉÕ¤è¤ê¤â¿·¤·¤¤¤â¤Î¤Ê¤é¤Ð¡¤ÌäÂê¤òÊó¹ð¤¹¤ëÁ°¤Ë¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤òõ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£ +¥Ð¥°¤ÎÊó¹ð¤ä¥Ñ¥Ã¥Á¤¬ SourceForge ¤Î <A HREF="http://sourceforge.net/projects/xonx/">XonX ¥×¥í¥¸¥§¥¯¥È¥Ú¡¼¥¸</A>¤ËÄó½Ð¤µ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£ +#endif +</blockquote> +<blockquote> +ËÜ¥½¥Õ¥È¥¦¥§¥¢¤Ï¡¤<A HREF="#license">MIT X11/X Consortium License</A> ¤Î¾ò·ï¤Ë´ð¤Å¤¡¤ÌµÊݾڤǡ¤¡Ö¤½¤Î¤Þ¤Þ¡×¤Î·Á¤Ç¶¡µë¤µ¤ì¤Þ¤¹¡£ +¤´»ÈÍѤˤʤëÁ°¤Ë¡¤<A HREF="#license">¥é¥¤¥»¥ó¥¹¾ò·ï</A>¤ò¤ªÆɤ߲¼¤µ¤¤¡£ +</blockquote> + +<h2><a NAME="usage">»ÈÍÑË¡</a></h2> +<p> +XFree86 ¤Ï¡¤<a HREF="http://www.XFree86.Org/">XFree86 Project, Inc.</a>¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¡¤ºÆÇÛÉÛ²Äǽ¤Ê¥ª¡¼¥×¥ó¥½¡¼¥¹¤Î <a HREF="http://www.x.org/">X Window System</a> ¤Î¼ÂÁõ¤Ç¤¹¡£ +Mac OS X ¾å¤Ç¡¤XFree86 ¤Ï¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤ÇÆ°ºî¤·¤Þ¤¹¡£X Window System ¤¬¥¢¥¯¥Æ¥£¥Ö¤Ê»þ¡¤¤½¤ì¤ÏÁ´²èÌ̤òÀêͤ·¤Þ¤¹¡£ +¤¢¤Ê¤¿¤Ï¡¤Command-Option-A ¥¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤ØÀÚ¤êÂؤ¨¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¤³¤Î¥¡¼¤ÎÁȤ߹ç¤ï¤»¤Ï¡¤´Ä¶ÀßÄê¤ÇÊѹ¹²Äǽ¤Ç¤¹¡£ +Mac OS X ¥Ç¥¹¥¯¥È¥Ã¥×¤«¤éX Window System ¤ØÀÚ¤êÂؤ¨¤ë¾ì¹ç¤Ï¡¤¥Õ¥í¡¼¥Æ¥£¥ó¥°¡¦¥¦¥£¥ó¥É¥¦¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£ +¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X Window System ¤ØÀÚ¤êÂؤï¤ë¤è¤¦¤Ë¡¤´Ä¶ÀßÄê¤ÇÆ°ºî¤òÊѹ¹¤¹¤ë¤³¤È¤â¤Ç¤¤Þ¤¹¡£ +</p> + +<h3>Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó</h3> +<p> +¿¤¯¤Î X11 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¤3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤òɬÍפȤ·¤Þ¤¹¡£ +1 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤Ç 3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤ò¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤¹¤ë¤Ë¤Ï¡¤´Ä¶ÀßÄê¤Ç¡ÖÊ£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤ò͸ú¤Ë¤¹¤ë¡×¤òÁªÂò¤·¤Þ¤¹¡£ +¤³¤ì¤Ï¡¤¼¡²ó¤Î X ¥µ¡¼¥Ð¡¼¤Îµ¯Æ°»þ¤è¤ê͸ú¤È¤Ê¤ê¤Þ¤¹¡£ + +3 ¥Ü¥¿¥ó¥Þ¥¦¥¹¤ò¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤¹¤ë»þ¡¤º¸¤Î¥³¥Þ¥ó¥É¥¡¼¤ò²¡¤·¤Ê¤¬¤é¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 2 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£º¸¤Î¥ª¥×¥·¥ç¥ó¥¡¼¤ò²¡¤·¤Ê¤¬¤é¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ÏÂè 3 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤Î¥¯¥ê¥Ã¥¯¤ËÁêÅö¤·¤Þ¤¹¡£ +</p> +<p>Ãí¡§</p> +<ul> + <li>¿¤¯¤Î¥¡¼¥Ü¡¼¥É¤Ç¤Ï¡¤º¸±¦¤Î¥³¥Þ¥ó¥É¥¡¼¤È¥ª¥×¥·¥ç¥ó¥¡¼¤Ï¶èÊ̤µ¤ì¤º¡¤Æ±¤¸Æ°ºî¤ò¤·¤Þ¤¹¡£ + <li>xmodmap ¤Ç¥³¥Þ¥ó¥É¥¡¼¤ä¥ª¥×¥·¥ç¥ó¥¡¼¤ò¾¤Î¥¡¼¤Ë³ä¤êÅö¤Æ¤Æ¤¤¤ë¾ì¹ç¤Ç¤â¡¤Ê£¿ô¥Ü¥¿¥ó¥Þ¥¦¥¹¤Î¥¨¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ç¤ÏËÜÍè¤Î¥³¥Þ¥ó¥É¥¡¼¤ä¥ª¥×¥·¥ç¥ó¥¡¼¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ + <li>º¸¤Î¥³¥Þ¥ó¥É¥¡¼¤ò²¡¤·¤Ê¤¬¤éÂè 2 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤³¤È¤ò¼Â¸½¤¹¤ë¤Ë¤Ï¡¤º¸¤Î¥³¥Þ¥ó¥É¥¡¼¤ò¾¤Î¥¡¼¤Ë³ä¤êÅö¤Æ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£º¸¤Î¥ª¥×¥·¥ç¥ó¥¡¼¤ò²¡¤·¤Ê¤¬¤éÂè 3 ¥Þ¥¦¥¹¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¾ì¹ç¤âƱÍͤǤ¹¡£ +</ul> +<h2> +<a NAME="path">¥Ñ¥¹¤ÎÀßÄê</a> +</h2> +<p> +X11 ¥Ð¥¤¥Ê¥ê¤Ï¡¤/usr/X11R6/bin ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤¢¤Ê¤¿¤Ï¤½¤ì¤ò¥Ñ¥¹¤Ë²Ã¤¨¤ëɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£ +¥Ñ¥¹¤Ï¡¤ ¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¤ò¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤Ç¤¹¡£ +¤³¤ì¤ò³Îǧ¤¹¤ëÊýË¡¤Ï¡¤»ÈÍѤ·¤Æ¤¤¤ë¥·¥§¥ë¤Ë°Í¸¤·¤Þ¤¹¡£ +tcsh ¤Ç¤Ï¡¤¡Öprintenv PATH¡×¤È¥¿¥¤¥×¤¹¤ë¤³¤È¤Ç¥Ñ¥¹¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ +¥Ñ¥¹¤ò¥Á¥§¥Ã¥¯¤·¤¿»þ¡¤/usr/X11R6/bin ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î¤Ò¤È¤Ä¤È¤·¤Æɽ¼¨¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ +¤â¤·¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¤¤¢¤Ê¤¿¤Ï¤½¤ì¤ò¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¤ËÄɲ乤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ +¤½¤Î¤¿¤á¤Ë¡¤~/Library/init/tcsh/path ¥Õ¥¡¥¤¥ë¤Ë¼¡¤Î¹Ô¤òÄɲ䷤Ʋ¼¤µ¤¤¡£ +¡Ê¤â¤·¤³¤Î¥Õ¥¡¥¤¥ë¤¬Ìµ¤±¤ì¤ÐºîÀ®¤·¤Æ²¼¤µ¤¤¡Ë +</p> +<blockquote> +setenv PATH "${PATH}:/usr/X11R6/bin" +</blockquote> +<p> +¤â¤·¡¤¤¢¤Ê¤¿¤¬ .cshrc ¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï .tcshrc ¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¤Ê¤é¤Ð¡¤¤½¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Ï ~/Library/init/tcsh/path ¥Õ¥¡¥¤¥ë¤ÎÀßÄêÃͤò¾å½ñ¤¤·¤Þ¤¹¡£ +¤½¤·¤Æ¡¤¤¢¤Ê¤¿¤Ï¤½¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤Î¤¦¤Á¤Î°ì¤Ä¤À¤±¤òÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£ +¤³¤ì¤é¤ÎÊѹ¹¤Ï¡¤¤¢¤Ê¤¿¤¬¿·¤¿¤Ê Terminal ¥¦¥£¥ó¥É¥¦¤ò³«»Ï¤¹¤ë¤Þ¤Ç͸ú¤È¤Ê¤ê¤Þ¤»¤ó¡£ +¤Þ¤¿¡¤¤¢¤Ê¤¿¤Ï¥É¥¥å¥á¥ó¥È¤òõ¤·¤Æ¤¤¤ë»þ¡¤XFree86 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸¡º÷¤µ¤ì¤ë¥Ú¡¼¥¸¤Î¥ê¥¹¥È¤ËÄɲä·¤¿¤¤¤È»×¤¦¤«¤â¤·¤ì¤Þ¤»¤ó¡£ +X11 ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï /usr/X11R6/man ¤ËÃÖ¤«¤ì¤Þ¤¹¡£¤½¤·¤Æ MANPATH ´Ä¶ÊÑ¿ô¤Ï¸¡º÷¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ê¥¹¥È¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£ +</p> + +<h2><a NAME="prefs">´Ä¶ÀßÄê</a></h2> +<p>¡ÖXDarwin¡×¥á¥Ë¥å¡¼¤Î¡Ö´Ä¶ÀßÄê...¡×¥á¥Ë¥å¡¼¹àÌܤ«¤é¡¤¤¤¤¯¤Ä¤«¤ÎÀßÄê¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ +¡Öµ¯Æ°¥ª¥×¥·¥ç¥ó¡×¤ÎÆâÍƤϡ¤XDarwin ¤òºÆµ¯Æ°¤¹¤ë¤Þ¤Ç͸ú¤È¤Ê¤ê¤Þ¤»¤ó¡£ +¾¤ÎÁ´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤ÎÆâÍƤϡ¤Ä¾¤Á¤Ë͸ú¤È¤Ê¤ê¤Þ¤¹¡£ +°Ê²¼¡¤¤½¤ì¤¾¤ì¤Î¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹:</p> +<ul> + <li>¥¡¼ÀßÄê¥Ü¥¿¥ó: X11 ¤È Aqua ¤òÀÚ¤êÂؤ¨¤ë¤¿¤á¤Î¥¡¼¤ÎÁȤ߹ç¤ï¤»¤òÊѹ¹¤¹¤ë¤¿¤á¤Ë¡¤¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¡¤¤¤¤¯¤Ä¤«¤Î½¤¾þ¥¡¼¤Ë³¤¤¤ÆÄ̾ï¤Î¥¡¼¤ò²¡¤·¤Þ¤¹¡£</li> + <li>X11 ¤Ç¥·¥¹¥Æ¥à¤Î¥Ó¡¼¥×²»¤ò»ÈÍѤ¹¤ë: ¥ª¥ó¤Î¾ì¹ç¡¤Mac OS X ¤Î¥Ó¡¼¥×²»¤¬ X11 ¤Î¥Ù¥ë¤È¤·¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£¥ª¥Õ¤Î¾ì¹ç¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë¡¤¥·¥ó¥×¥ë ¥È¡¼¥ó¤¬»È¤ï¤ì¤Þ¤¹¡£</li> + <li>¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤ËÌá¤ë: ¥ª¥ó¤Î¾ì¹ç¡¤¥É¥Ã¥¯¤Ëɽ¼¨¤µ¤ì¤¿ XDarwin ¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç X11 ¤Ø¤ÎÀÚ¤êÂؤ¨¤¬²Äǽ¤È¤Ê¤ê¤Þ¤¹¡£ + Mac OS X ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï¡¤¥É¥Ã¥¯¤Î¥¢¥¤¥³¥ó¤Î¥¯¥ê¥Ã¥¯¤Ç²èÌ̤òÀÚ¤êÂؤ¨¤ë¤È¡¤Aqua ¤ËÌá¤Ã¤¿»þ¤Ë¥«¡¼¥½¥ë¤¬¾Ã¼º¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£</li> + <li>µ¯Æ°»þ¤Ë¥Ø¥ë¥×¤òɽ¼¨¤¹¤ë: XDarwin ¤Îµ¯Æ°»þ¤Ë¡¤¥¹¥×¥é¥Ã¥·¥å ¥¹¥¯¥ê¡¼¥ó¤òɽ¼¨¤·¤Þ¤¹¡£</li> + <li>¥Ç¥£¥¹¥×¥ì¥¤ÈÖ¹æ: XDarwin ¤¬¥Ç¥£¥¹¥×¥ì¥¤¤Ë³ä¤êÅö¤Æ¤ë X ¤Î Display Number ¤ò»ØÄꤷ¤Þ¤¹¡£ + X11 ¤òɽ¼¨¤¹¤ë¤È¤¡¤XDarwin ¤Ï¾ï¤Ë¥á¥¤¥ó¥Ç¥£¥¹¥×¥ì¥¤¤ò°ú¤·Ñ¤°¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£</li> + <li>¥¡¼¥Þ¥Ã¥Ô¥ó¥°: ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤XDarwin ¤Ï Darwin ¥«¡¼¥Í¥ë¤«¤é¥¡¼¥Þ¥Ã¥Ô¥ó¥°¤ò¥í¡¼¥É¤·¤Þ¤¹¡£ + ¥Ý¡¼¥¿¥Ö¥ëµ¡¼ï¤Ç¤Ï¡¤»þ¡¹¥¡¼¥Þ¥Ã¥Ô¥ó¥°¤¬¶õ¤È¤Ê¤ê¡¤X11 ¤Ç¥¡¼¥Ü¡¼¥É¤¬Æ°ºî¤·¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£ + ¡Ö¥Õ¥¡¥¤¥ë¤«¤é¥í¡¼¥É¤¹¤ë¡×¤òÁªÂò¤¹¤ë¤È¡¤XDarwin ¤Ï»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤«¤é¥¡¼¥Þ¥Ã¥Ô¥ó¥°¤ò¥í¡¼¥É¤·¤Þ¤¹¡£<br> + ¡ÊÌõÃí¡§¥¡¼¥Þ¥Ã¥Ô¥ó¥°¤Ç Japanese ¤òÁªÂò¤¹¤ë¤È¡¤ÉÔ¶ñ¹ç¤¬À¸¤¸¤Þ¤¹¡£USA ¤òÁªÂò¤·¤¿¾å¤Ç ~/.Xmodmap ¤òŬÍѤ·¤Æ²¼¤µ¤¤¡£¡Ë</li> +</ul> + +<h2> +<a NAME="license">¥é¥¤¥»¥ó¥¹</a> +</h2> +XFree86 Project ¤Ï¡¤¼«Í³¤ËºÆÇÛÉÛ²Äǽ¤Ê¥Ð¥¤¥Ê¥ê¤È¥½¡¼¥¹¥³¡¼¥É¤òÄ󶡤¹¤ë¤³¤È¤Ë¥³¥ß¥Ã¥È¤·¤Æ¤¤¤Þ¤¹¡£ +»ä¤¿¤Á¤¬»ÈÍѤ¹¤ë¼ç¤Ê¥é¥¤¥»¥ó¥¹¤Ï¡¤ÅÁÅýŪ¤Ê MIT X11/X Consortium License ¤Ë´ð¤Å¤¯¤â¤Î¤Ç¤¹¡£ +¤½¤·¤Æ¡¤¤½¤ì¤Ï½¤Àµ¤Þ¤¿¤ÏºÆÇÛÉÛ¤µ¤ì¤ë¥½¡¼¥¹¥³¡¼¥É¤Þ¤¿¤Ï¥Ð¥¤¥Ê¥ê¤Ë¡¤¤½¤Î Copyright/¥é¥¤¥»¥ó¥¹¹ð¼¨¤¬¤½¤Î¤Þ¤Þ»Ä¤µ¤ì¤ë¤³¤È¤òÍ׵᤹¤ë°Ê³°¤Î¾ò·ï¤ò¶¯À©¤·¤Þ¤»¤ó¡£ +¤è¤ê¿¤¯¤Î¾ðÊó¤È¡¤¥³¡¼¥É¤Î°ìÉô¤ò¥«¥Ð¡¼¤¹¤ëÄɲäΠCopyright/¥é¥¤¥»¥ó¥¹¹ð¼¨¤Î¤¿¤á¤Ë¡¤<A HREF="http://www.xfree86.org/legal/licence.html">XFree86 ¤Î License ¥Ú¡¼¥¸</A>¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£ +<H3> +<A NAME="3"></A> +X Consortium License</H3> +<p>Copyright (C) 1996 X Consortium</p> +<p>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:</p> +<p>The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software.</p> +<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE.</p> +<p>Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization from +the X Consortium.</p> +<p>X Window System is a trademark of X Consortium, Inc.</p> +</body> +</html> diff --git a/xc/programs/Xserver/hw/darwin/bundle/Preferences.h b/xc/programs/Xserver/hw/darwin/bundle/Preferences.h index dd89f82aa..469b758b6 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/Preferences.h +++ b/xc/programs/Xserver/hw/darwin/bundle/Preferences.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Preferences.h,v 1.4 2001/04/25 02:23:47 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Preferences.h,v 1.5 2001/05/09 07:16:19 torrey Exp $ */ #import <Cocoa/Cocoa.h> @@ -6,6 +6,7 @@ { IBOutlet NSPanel *window; IBOutlet id displayNumber; + IBOutlet id dockSwitchButton; IBOutlet id fakeButton; IBOutlet id keyField; IBOutlet id keymapFileField; @@ -35,6 +36,7 @@ + (void)setKeyCode:(int)newKeyCode; + (void)setModifiers:(int)newModifiers; + (void)setDisplay:(int)newDisplay; ++ (void)setDockSwitch:(BOOL)newDockSwitch; + (void)setFakeButtons:(BOOL)newFakeButtons; + (void)setStartupHelp:(BOOL)newStartupHelp; + (void)setSystemBeep:(BOOL)newSystemBeep; @@ -46,6 +48,7 @@ + (unsigned int)keyCode; + (unsigned int)modifiers; + (int)display; ++ (BOOL)dockSwitch; + (BOOL)fakeButtons; + (BOOL)startupHelp; + (BOOL)systemBeep; diff --git a/xc/programs/Xserver/hw/darwin/bundle/Preferences.m b/xc/programs/Xserver/hw/darwin/bundle/Preferences.m index f923b2224..4e9f1c8c2 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/Preferences.m +++ b/xc/programs/Xserver/hw/darwin/bundle/Preferences.m @@ -3,13 +3,31 @@ // // This class keeps track of the user preferences. // -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Preferences.m,v 1.4 2001/04/25 02:23:47 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Preferences.m,v 1.6 2001/05/09 07:16:19 torrey Exp $ */ #import "Preferences.h" #import "quartzShared.h" @implementation Preferences ++ (void)initialize { + // Provide user defaults if needed + NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithInt:0], @"Display", + @"YES", @"FakeButtons", + @"/System/Library/Keyboards/USA.keymapping", @"KeymappingFile", + @"NO", @"UseKeymappingFile", + @"Cmd-Opt-a", @"SwitchString", + @"YES", @"ShowStartupHelp", + [NSNumber numberWithInt:0], @"SwitchKeyCode", + [NSNumber numberWithInt:(NSCommandKeyMask | NSAlternateKeyMask)], + @"SwitchModifiers", @"NO", @"UseSystemBeep", + @"NO", @"DockSwitch", nil]; + + [super initialize]; + [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; +} + // Initialize internal state info of switch key button - (void)initSwitchKey { keyCode = [Preferences keyCode]; @@ -18,26 +36,10 @@ } - (id)init { - self=[super init]; + self = [super init]; isGettingKeyCode=NO; switchString=[[NSMutableString alloc] init]; - - // Provide user defaults if needed - if ([[NSUserDefaults standardUserDefaults] stringForKey:@"SwitchKeyCode"] == nil) { - [Preferences setKeyCode:0]; - [Preferences setModifiers:(NSCommandKeyMask | NSAlternateKeyMask)]; - [Preferences setSwitchString:@"Cmd-Opt-a"]; - [Preferences setDisplay:0]; - [Preferences setFakeButtons:YES]; - [Preferences setStartupHelp:YES]; - [Preferences setSystemBeep:NO]; - } - if ([[NSUserDefaults standardUserDefaults] stringForKey:@"UseKeymappingFile"] == nil) { - [Preferences setUseKeymapFile:NO]; - [Preferences setKeymapFile:@"/System/Library/Keyboards/USA.keymapping"]; - } - [self initSwitchKey]; return self; @@ -58,6 +60,7 @@ [keyField setTitle:[Preferences switchString]]; [displayNumber setIntValue:[Preferences display]]; + [dockSwitchButton setIntValue:[Preferences dockSwitch]]; [fakeButton setIntValue:[Preferences fakeButtons]]; [startupHelpButton setIntValue:[Preferences startupHelp]]; [systemBeepButton setIntValue:[Preferences systemBeep]]; @@ -99,6 +102,7 @@ [Preferences setKeymapFile:[keymapFileField stringValue]]; [Preferences setUseKeymapFile:[loadKeymapFileButton intValue]]; [Preferences setDisplay:[displayNumber intValue]]; + [Preferences setDockSwitch:[dockSwitchButton intValue]]; [Preferences setFakeButtons:[fakeButton intValue]]; [Preferences setStartupHelp:[startupHelpButton intValue]]; [Preferences setSystemBeep:[systemBeepButton intValue]]; @@ -170,6 +174,10 @@ [[NSUserDefaults standardUserDefaults] setInteger:newDisplay forKey:@"Display"]; } ++ (void)setDockSwitch:(BOOL)newDockSwitch { + [[NSUserDefaults standardUserDefaults] setBool:newDockSwitch forKey:@"DockSwitch"]; +} + + (void)setFakeButtons:(BOOL)newFakeButtons { [[NSUserDefaults standardUserDefaults] setBool:newFakeButtons forKey:@"FakeButtons"]; // Update the setting used by the X server thread @@ -214,6 +222,10 @@ return [[NSUserDefaults standardUserDefaults] integerForKey:@"Display"]; } ++ (BOOL)dockSwitch { + return [[NSUserDefaults standardUserDefaults] boolForKey:@"DockSwitch"]; +} + + (BOOL)fakeButtons { return [[NSUserDefaults standardUserDefaults] boolForKey:@"FakeButtons"]; } diff --git a/xc/programs/Xserver/hw/darwin/bundle/XDarwin.pbproj/project.pbxproj b/xc/programs/Xserver/hw/darwin/bundle/XDarwin.pbproj/project.pbxproj index 4848d9c01..43707155d 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/XDarwin.pbproj/project.pbxproj +++ b/xc/programs/Xserver/hw/darwin/bundle/XDarwin.pbproj/project.pbxproj @@ -341,7 +341,7 @@ <key>CFBundleExecutable</key> <string>XDarwin</string> <key>CFBundleGetInfoString</key> - <string>XFree86 Version 4.1</string> + <string>XDarwin 1.0, ©2001 XFree86 Project, Inc.</string> <key>CFBundleIconFile</key> <string>XDarwin.icns</string> <key>CFBundleIdentifier</key> @@ -353,11 +353,11 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>XDarwin (v0.5)</string> + <string>XDarwin 1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> - <string>0.5</string> + <string></string> <key>NSHelpFile</key> <string>XDarwinHelp.html</string> <key>NSMainNibFile</key> @@ -518,6 +518,50 @@ name = Products; refType = 4; }; + 1BD8DE4200B8A3567F000001 = { + children = ( + 1BD8DE4300B8A3567F000001, + 1BD8DE4700B8A3C77F000001, + ); + isa = PBXVariantGroup; + name = InfoPlist.strings.cpp; + path = ""; + refType = 4; + }; + 1BD8DE4300B8A3567F000001 = { + isa = PBXFileReference; + name = English; + path = English.lproj/InfoPlist.strings.cpp; + refType = 4; + }; + 1BD8DE4400B8A38E7F000001 = { + children = ( + 1BD8DE4500B8A38E7F000001, + 1BD8DE4800B8A4167F000001, + ); + isa = PBXVariantGroup; + name = XDarwinHelp.html.cpp; + path = ""; + refType = 4; + }; + 1BD8DE4500B8A38E7F000001 = { + isa = PBXFileReference; + name = English; + path = English.lproj/XDarwinHelp.html.cpp; + refType = 4; + }; + 1BD8DE4700B8A3C77F000001 = { + isa = PBXFileReference; + name = Japanese; + path = Japanese.lproj/InfoPlist.strings.cpp; + refType = 4; + }; + 1BD8DE4800B8A4167F000001 = { + isa = PBXFileReference; + name = Japanese; + path = Japanese.lproj/XDarwinHelp.html.cpp; + refType = 4; + }; 1BE4F84D0006C9890A000002 = { isa = PBXFrameworkReference; name = Carbon.framework; @@ -598,9 +642,11 @@ children = ( 29B97318FDCFA39411CA2CEA, 089C165CFE840E0CC02AAC07, + 1BD8DE4200B8A3567F000001, 1220774300712D2D416877C2, 0157A37D002CF6D7CE6F79C2, 02E03CA000348209CE6F79C2, + 1BD8DE4400B8A38E7F000001, 015698ED003DF345CE6F79C2, ); isa = PBXGroup; diff --git a/xc/programs/Xserver/hw/darwin/bundle/Xserver.h b/xc/programs/Xserver/hw/darwin/bundle/Xserver.h index 0e0ce6961..6a5442293 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/Xserver.h +++ b/xc/programs/Xserver/hw/darwin/bundle/Xserver.h @@ -3,7 +3,7 @@ // // Created by Andreas Monitzer on January 6, 2001. // -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Xserver.h,v 1.6 2001/04/25 02:23:47 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Xserver.h,v 1.8 2001/05/16 06:10:08 torrey Exp $ */ #import <Cocoa/Cocoa.h> @@ -17,7 +17,6 @@ NSLock *serverLock; NSTask *clientTask; NSPort *signalPort; - NSPortMessage *signalMessage; BOOL serverVisible; BOOL appQuitting; UInt32 mouseState; @@ -28,6 +27,7 @@ // Aqua interface IBOutlet NSPanel *helpWindow; IBOutlet id startupHelpButton; + IBOutlet NSPanel *switchWindow; } - (id)init; @@ -48,7 +48,9 @@ - (void)sendNXEvent:(NXEvent*)ev; - (void)sendShowHide:(BOOL)show; +// Aqua interface actions - (IBAction)closeHelpAndShow:(id)sender; +- (IBAction)showAction:(id)sender; // NSApplication delegate - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; diff --git a/xc/programs/Xserver/hw/darwin/bundle/Xserver.m b/xc/programs/Xserver/hw/darwin/bundle/Xserver.m index d047b53dd..405e91250 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/Xserver.m +++ b/xc/programs/Xserver/hw/darwin/bundle/Xserver.m @@ -6,7 +6,7 @@ // // Created by Andreas Monitzer on January 6, 2001. // -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Xserver.m,v 1.14 2001/04/25 02:23:47 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/Xserver.m,v 1.18 2001/05/16 06:10:08 torrey Exp $ */ #import "Xserver.h" #import "Preferences.h" @@ -27,6 +27,8 @@ extern int main(int argc, char *argv[], char *envp[]); extern void HideMenuBar(void); extern void ShowMenuBar(void); +static NSPortMessage *signalMessage; + @implementation Xserver - (id)init { @@ -105,13 +107,15 @@ extern void ShowMenuBar(void); break; case NSLeftMouseDragged: case NSRightMouseDragged: - case 27: // undocumented high button MouseDragged event + case 27: // undocumented high button MouseDragged event ev.type=NSMouseMoved; break; case NSSystemDefined: - if(([anEvent subtype]==7) && ([anEvent data1] & 1)) + if (![anEvent subtype]==7) + return NO; // we only use multibutton mouse events + if ([anEvent data1] & 1) return NO; // skip mouse button 1 events - if(mouseState==[anEvent data2]) + if (mouseState==[anEvent data2]) return NO; // ignore double events ev.data.compound.subType=[anEvent subtype]; ev.data.compound.misc.L[0]=[anEvent data1]; @@ -128,6 +132,10 @@ extern void ShowMenuBar(void); case NSFlagsChanged: ev.data.key.keyCode = [anEvent keyCode]; break; + case 25: // undocumented MouseDown + case 26: // undocumented MouseUp + // Hide these from AppKit to avoid its log messages + return YES; default: return NO; } @@ -164,7 +172,7 @@ extern void ShowMenuBar(void); char xinitrcbuf[PATH_MAX]; NSString *path = [NSString stringWithCString:XPATH(xinit)]; NSString *server = [NSString stringWithCString:XPATH(XDarwinStartup)]; - NSString *client; + NSString *client, *displayName; BOOL hasClient = YES; NSArray *args; @@ -185,6 +193,9 @@ extern void ShowMenuBar(void); [Xserver append:@":" toEnv:@"PATH"]; [Xserver append:@XSTRPATH(XBINDIR) toEnv:@"PATH"]; + displayName = [NSString localizedStringWithFormat:@":%d", + [Preferences display]]; + // Find the client init file to use snprintf(xinitrcbuf, PATH_MAX, "%s/.xinitrc", home); if (access(xinitrcbuf, F_OK)) { @@ -195,9 +206,11 @@ extern void ShowMenuBar(void); } if (hasClient) { client = [NSString stringWithCString:xinitrcbuf]; - args = [NSArray arrayWithObjects:client, @"--", server, @"-idle", nil]; + args = [NSArray arrayWithObjects:client, @"--", server, + displayName, @"-idle", nil]; } else { - args = [NSArray arrayWithObjects:@"--", server, @"-idle", nil]; + args = [NSArray arrayWithObjects:@"--", server, displayName, + @"-idle", nil]; } // Launch a new task to run start X clients @@ -207,12 +220,16 @@ extern void ShowMenuBar(void); // Make sure the menu bar gets drawn [NSApp setWindowsNeedUpdate:YES]; + // Show the X switch window if not using dock icon switching + if (![Preferences dockSwitch]) + [switchWindow orderFront:nil]; + // Display the help splash screen or show the X server if ([Preferences startupHelp]) { - [helpWindow makeKeyAndOrderFront:self]; + [helpWindow makeKeyAndOrderFront:nil]; } else { ShowMenuBar(); - [self closeHelpAndShow:self]; + [self closeHelpAndShow:nil]; } } @@ -225,7 +242,7 @@ extern void ShowMenuBar(void); serverVisible = NO; [serverLock unlock]; [pool release]; - [signalMessage sendBeforeDate:[NSDate distantPast]]; + QuartzMessageMainThread(kQuartzServerDied); } // Close the help splash screen and show the X server @@ -243,6 +260,11 @@ extern void ShowMenuBar(void); [NSApp activateIgnoringOtherApps:YES]; } +// Show the X server when sent message from GUI +- (IBAction)showAction:(id)sender { + [self sendShowHide:YES]; +} + // Show or hide the X server - (void)toggle { if (serverVisible) @@ -286,9 +308,10 @@ extern void ShowMenuBar(void); ev.type = NX_APPDEFINED; if (show) { + QuartzCapture(); + HideMenuBar(); ev.data.compound.subType = kXDarwinShow; [self sendNXEvent:&ev]; - HideMenuBar(); // inform the X server of the current modifier state ev.flags = [[NSApp currentEvent] modifierFlags]; @@ -336,16 +359,29 @@ extern void ShowMenuBar(void); // FIXME: handle bad writes better? } -// Handle message that X server thread is finished +// Handle messages from the X server thread - (void)handlePortMessage:(NSPortMessage *)portMessage { - if (appQuitting) { - // If we quit before the clients start, they may sit and wait - // for the X server to start. Kill them instead. - if ([clientTask isRunning]) - [clientTask terminate]; - [NSApp replyToApplicationShouldTerminate:YES]; - } else { - [NSApp terminate:nil]; // quit if we aren't already + unsigned msg = [portMessage msgid]; + + switch(msg) { + case kQuartzServerHidden: + // FIXME: This hack is necessary (but not completely effective) + // since Mac OS X 10.0.2 + [NSCursor unhide]; + break; + case kQuartzServerDied: + if (appQuitting) { + // If we quit before the clients start, they may sit and wait + // for the X server to start. Kill them instead. + if ([clientTask isRunning]) + [clientTask terminate]; + [NSApp replyToApplicationShouldTerminate:YES]; + } else { + [NSApp terminate:nil]; // quit if we aren't already + } + break; + default: + NSLog(@"Unknown message from server thread."); } } @@ -365,7 +401,9 @@ extern void ShowMenuBar(void); // Called when the user clicks the application icon, but not when Cmd-Tab is used - (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag { - [self show]; + if ([Preferences dockSwitch]) { + [self show]; + } return NO; } @@ -378,3 +416,11 @@ extern void ShowMenuBar(void); } @end + +// Send a message to the main thread, which calls handlePortMessage in +// response. Must only be called from the X server thread because +// NSPort is not thread safe. +void QuartzMessageMainThread(unsigned msg) { + [signalMessage setMsgid:msg]; + [signalMessage sendBeforeDate:[NSDate distantPast]]; +} diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartz.c b/xc/programs/Xserver/hw/darwin/bundle/quartz.c index 080937288..3aacf6e69 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/quartz.c +++ b/xc/programs/Xserver/hw/darwin/bundle/quartz.c @@ -5,7 +5,7 @@ * By Gregory Robert Parker * **************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartz.c,v 1.7 2001/04/16 06:51:48 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartz.c,v 1.9 2001/05/16 06:10:08 torrey Exp $ */ // X headers #include "scrnintstr.h" @@ -115,7 +115,7 @@ Bool QuartzAddScreen(ScreenPtr pScreen) * QuartzCapture * Capture the screen so we can draw. */ -static void QuartzCapture(void) +void QuartzCapture(void) { if (! CGDisplayIsCaptured(kCGDirectMainDisplay)) { CGDisplayCapture(kCGDirectMainDisplay); @@ -132,6 +132,7 @@ static void QuartzRelease(void) if (CGDisplayIsCaptured(kCGDirectMainDisplay)) { CGDisplayRelease(kCGDirectMainDisplay); } + QuartzMessageMainThread(kQuartzServerHidden); } @@ -182,8 +183,7 @@ void QuartzOsVendorInit(void) /* * QuartzShow * Show the X server on screen. Does nothing if already shown. - * Recapture the screen, restore the X clip regions, and restore - * the X server cursor state. + * Restore the X clip regions the X server cursor state. */ void QuartzShow( int x, // cursor location @@ -191,7 +191,6 @@ void QuartzShow( { int i; - QuartzCapture(); if (xhidden) { for (i = 0; i < darwinNumScreens; i++) { if (darwinScreens[i]) { @@ -230,10 +229,17 @@ void QuartzHide(void) /* * QuartzGiveUp * Cleanup before X server shutdown - * Release the screen + * Release the screen and restore the Aqua cursor. */ void QuartzGiveUp(void) { + int i; + + for (i = 0; i < darwinNumScreens; i++) { + if (darwinScreens[i]) { + QuartzSuspendXCursor(darwinScreens[i]); + } + } QuartzRelease(); } diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m b/xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m index c7b108646..d19f25ecc 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m +++ b/xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m @@ -7,7 +7,7 @@ * that use X include files to avoid symbol collisions. * **************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m,v 1.4 2001/04/25 02:23:47 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCocoa.m,v 1.5 2001/04/28 20:42:19 torrey Exp $ */ #include <Cocoa/Cocoa.h> @@ -15,6 +15,7 @@ #include "quartzShared.h" extern void FatalError(const char *, ...); +extern char *display; // Read the user preferences from the Cocoa front end void QuartzReadPreferences(void) @@ -23,13 +24,19 @@ void QuartzReadPreferences(void) darwinFakeButtons = [Preferences fakeButtons]; quartzUseSysBeep = [Preferences systemBeep]; + if ([Preferences useKeymapFile]) { - fileString = [[Preferences keymapFile] lossyCString]; + fileString = (char *) [[Preferences keymapFile] lossyCString]; darwinKeymapFile = (char *) malloc(strlen(fileString)+1); if (! darwinKeymapFile) FatalError("malloc failed in QuartzReadPreferences()!\n"); strcpy(darwinKeymapFile, fileString); } + + display = (char *) malloc(8); + if (! display) + FatalError("malloc failed in QuartzReadPreferences()!\n"); + snprintf(display, 8, "%i", [Preferences display]); } // Write text to the Mac OS X pasteboard. @@ -70,7 +77,7 @@ char *QuartzReadCocoaPasteboard(void) char *buffer; if (! string) return NULL; - buffer = [string lossyCString]; + buffer = (char *) [string lossyCString]; text = (char *) malloc(strlen(buffer)+1); if (text) strcpy(text, buffer); diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c b/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c index d53cea982..a7d59a5db 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c +++ b/xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c @@ -3,7 +3,7 @@ * Support for using the Quartz Window Manager cursor * **************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c,v 1.3 2001/04/13 20:55:26 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzCursor.c,v 1.4 2001/05/09 07:16:19 torrey Exp $ */ #include "mi.h" #include "scrnintstr.h" @@ -39,7 +39,7 @@ static QD_Cursor gQDArrow; // QuickDraw arrow cursor #define HIDE_QD_CURSOR(display, visible) \ if (visible) { CGDisplayHideCursor(display); visible = FALSE; } #define SHOW_QD_CURSOR(display, visible) \ - if (! visible) { CGDisplayShowCursor(display); visible = TRUE; } + CGDisplayShowCursor(display); visible = TRUE; /* diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c b/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c index d387d8a73..bde35ef6e 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c +++ b/xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c @@ -4,53 +4,122 @@ * Aqua pasteboard <-> X cut buffer * Greg Parker gparker@cs.stanford.edu March 8, 2001 **************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c,v 1.1 2001/03/15 22:24:27 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzPasteboard.c,v 1.2 2001/05/02 01:03:40 torrey Exp $ */ #include "quartzPasteboard.h" #include "Xatom.h" #include "windowstr.h" #include "propertyst.h" +#include "scrnintstr.h" +#include "selection.h" -// fixme is there a GetRootWindow() anywhere? -// fixme wrong for multiple screens extern WindowPtr *WindowTable; +extern Selection *CurrentSelections; +extern int NumCurrentSelections; -// Write X cut buffer to Mac OS X pasteboard -// Called by ProcessInputEvents() in response to request from X server thread. -void QuartzWritePasteboard(void) + +// Helper function to read the X11 cut buffer +// FIXME: What about multiple screens? Currently, this reads the first +// CUT_BUFFER0 from the first screen where the buffer content is a string. +// Returns a string on the heap that the caller must free. +// Returns NULL if there is no cut text or there is not enough memory. +static char * QuartzReadCutBuffer(void) { - PropertyPtr pProp; + int i; char *text = NULL; - pProp = wUserProps (WindowTable[0]); - while (pProp) { - if (pProp->propertyName == XA_CUT_BUFFER0) - break; - pProp = pProp->next; + for (i = 0; i < screenInfo.numScreens; i++) { + ScreenPtr pScreen = screenInfo.screens[i]; + PropertyPtr pProp; + + pProp = wUserProps (WindowTable[pScreen->myNum]); + while (pProp && pProp->propertyName != XA_CUT_BUFFER0) { + pProp = pProp->next; + } + if (! pProp) continue; + if (pProp->type != XA_STRING) continue; + if (pProp->format != 8) continue; + + text = xalloc(1 + pProp->size); + if (! text) continue; + memcpy(text, pProp->data, pProp->size); + text[pProp->size] = '\0'; + return text; } - if (! pProp) return; - if (pProp->type != XA_STRING) return; - if (pProp->format != 8) return; - - text = xalloc(1 + pProp->size); - if (! text) return; - memcpy(text, pProp->data, pProp->size); - text[pProp->size] = '\0'; - QuartzWriteCocoaPasteboard(text); - free(text); + + // didn't find any text + return NULL; } +// Write X cut buffer to Mac OS X pasteboard +// Called by ProcessInputEvents() in response to request from X server thread. +void QuartzWritePasteboard(void) +{ + char *text; + text = QuartzReadCutBuffer(); + if (text) { + QuartzWriteCocoaPasteboard(text); + free(text); + } +} + +#define strequal(a, b) (0 == strcmp((a), (b))) // Read Mac OS X pasteboard into X cut buffer // Called by ProcessInputEvents() in response to request from X server thread. -void QuartzReadPasteboard(void) +void QuartzReadPasteboard(void) { + char *oldText = QuartzReadCutBuffer(); char *text = QuartzReadCocoaPasteboard(); - if (text) { - ChangeWindowProperty(WindowTable[0], XA_CUT_BUFFER0, XA_STRING, 8, - PropModeReplace, strlen(text), (pointer)text,TRUE); - free(text); - // fixme erase any current X selections + + // Compare text with current cut buffer contents. + // Change the buffer if both exist and are different + // OR if there is new text but no old text. + // Otherwise, don't clear the selection unnecessarily. + + if ((text && oldText && !strequal(text, oldText)) || + (text && !oldText)) { + int scrn, sel; + + for (scrn = 0; scrn < screenInfo.numScreens; scrn++) { + ScreenPtr pScreen = screenInfo.screens[scrn]; + // Set the cut buffers on each screen + // fixme really on each screen? + ChangeWindowProperty(WindowTable[pScreen->myNum], XA_CUT_BUFFER0, + XA_STRING, 8, PropModeReplace, + strlen(text), (pointer)text, TRUE); + } + + // Undo any current X selection (similar to code in dispatch.c) + // FIXME: what about secondary selection? + // FIXME: only touch first XA_PRIMARY selection? + sel = 0; + while ((sel < NumCurrentSelections) && + CurrentSelections[sel].selection != XA_PRIMARY) + sel++; + if (sel < NumCurrentSelections) { + // Notify client if necessary + if (CurrentSelections[sel].client) { + xEvent event; + + event.u.u.type = SelectionClear; + event.u.selectionClear.time = GetTimeInMillis(); + event.u.selectionClear.window = CurrentSelections[sel].window; + event.u.selectionClear.atom = CurrentSelections[sel].selection; + TryClientEvents(CurrentSelections[sel].client, &event, 1, + NoEventMask, NoEventMask /*CantBeFiltered*/, + NullGrab); + } + + // Erase it + // FIXME: need to erase .selection too? dispatch.c doesn't + CurrentSelections[sel].pWin = NullWindow; + CurrentSelections[sel].window = None; + CurrentSelections[sel].client = NullClient; + } } + + if (text) free(text); + if (oldText) free(oldText); } diff --git a/xc/programs/Xserver/hw/darwin/bundle/quartzShared.h b/xc/programs/Xserver/hw/darwin/bundle/quartzShared.h index 3813f4f17..4a64b6430 100644 --- a/xc/programs/Xserver/hw/darwin/bundle/quartzShared.h +++ b/xc/programs/Xserver/hw/darwin/bundle/quartzShared.h @@ -2,7 +2,7 @@ * Shared definitions between the Darwin X Server * and the Cocoa front end. */ -/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzShared.h,v 1.4 2001/04/25 02:23:47 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/quartzShared.h,v 1.5 2001/05/16 06:10:08 torrey Exp $ */ #ifndef _QUARTZSHARED_H #define _QUARTZSHARED_H @@ -16,7 +16,9 @@ extern int quartzUseSysBeep; extern int darwinFakeButtons; extern char *darwinKeymapFile; +void QuartzCapture(void); void QuartzReadPreferences(void); +void QuartzMessageMainThread(unsigned msg); // NX_APPDEFINED event subtypes for special commands to the X server // update modifiers: update all modifier keys @@ -35,5 +37,11 @@ enum { kXDarwinWritePasteboard }; +// Messages that can be sent to the main thread. +enum { + kQuartzServerHidden, + kQuartzServerDied +}; + #endif /* _QUARTZSHARED_H */ diff --git a/xc/programs/Xserver/hw/darwin/darwin.c b/xc/programs/Xserver/hw/darwin/darwin.c index 10def7319..80299c505 100644 --- a/xc/programs/Xserver/hw/darwin/darwin.c +++ b/xc/programs/Xserver/hw/darwin/darwin.c @@ -4,7 +4,7 @@ * running with Quartz or the IOKit * **************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.21 2001/04/25 02:23:47 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.23.2.2 2001/06/01 06:36:12 torrey Exp $ */ #include "X.h" #include "Xproto.h" @@ -12,10 +12,10 @@ #include "servermd.h" #include "inputstr.h" #include "scrnintstr.h" -#include "mi.h" -#include "mibstore.h" -#include "mipointer.h" -#include "micmap.h" +#include "mibstore.h" // mi backing store implementation +#include "mipointer.h" // mi software cursor +#include "micmap.h" // mi colormap code +#include "fb.h" // fb framebuffer code #include "site.h" #include "globals.h" #include "xf86Version.h" @@ -69,7 +69,8 @@ static PixmapFormatRec formats[] = { { 8, 8, BITMAP_SCANLINE_PAD }, { 15, 16, BITMAP_SCANLINE_PAD }, { 16, 16, BITMAP_SCANLINE_PAD }, - { 24, 32, BITMAP_SCANLINE_PAD } + { 24, 32, BITMAP_SCANLINE_PAD }, + { 32, 32, BITMAP_SCANLINE_PAD } }; const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]); @@ -171,37 +172,23 @@ static Bool DarwinAddScreen( return FALSE; } + miSetPixmapDepths(); + // machine independent screen init // setup _Screen structure in pScreen if (monitorResolution) dpi = monitorResolution; else dpi = 75; - if ( dfb.bitsPerPixel == 32 ) { - if (!cfb32ScreenInit(pScreen, - dfb.framebuffer, - dfb.width, dfb.height, - dpi, dpi, - dfb.pitch / (dfb.bitsPerPixel/8))) { - return FALSE; - } - } else if ( dfb.bitsPerPixel == 16 ) { - if (!cfb16ScreenInit(pScreen, - dfb.framebuffer, - dfb.width, dfb.height, - dpi, dpi, - dfb.pitch / (dfb.bitsPerPixel/8))) { - return FALSE; - } - } else if ( dfb.bitsPerPixel == 8 ) { - if (!cfbScreenInit(pScreen, - dfb.framebuffer, - dfb.width, dfb.height, - dpi, dpi, - dfb.pitch / (dfb.bitsPerPixel/8))) { - return FALSE; - } - } else { + + // initialize fb + if (! fbScreenInit(pScreen, + dfb.framebuffer, // pointer to screen bitmap + dfb.width, dfb.height, // screen size in pixels + dpi, dpi, // dots per inch + dfb.pitch/(dfb.bitsPerPixel/8), // pixel width of framebuffer + dfb.bitsPerPixel)) // bits per pixel for screen + { return FALSE; } @@ -226,6 +213,10 @@ static Bool DarwinAddScreen( } } +#ifdef RENDER + fbPictureInit(pScreen, 0, 0); +#endif + #ifdef MITSHM ShmRegisterFbFuncs(pScreen); #endif @@ -305,17 +296,16 @@ static int DarwinMouseProc( int what ) { char map[6]; - + switch (what) { - + case DEVICE_INIT: pPointer->public.on = FALSE; - // Set button map. Darwin uses 2 for right and 3 for center. - // Reverse these to correspond to typical X usage. + // Set button map. map[1] = 1; - map[2] = 3; - map[3] = 2; + map[2] = 2; + map[3] = 3; map[4] = 4; map[5] = 5; InitPointerDeviceStruct( (DevicePtr)pPointer, @@ -530,11 +520,12 @@ void ProcessInputEvents(void) int r; struct timeval tv; struct timezone tz; - static int startsec = 0; - static Bool gotread = false; static int old_state = 0; -#if defined(DARWIN_WITH_QUARTZ) && defined(QUARTZ_SAFETY_DELAY) +#if defined(DARWIN_WITH_QUARTZ) && defined(QUARTZ_SAFETY_DELAY) + static Bool gotread = false; + static int startsec = 0; + // Quartz safety quit. Bail if we don't get any events from the event pipe. // If the event writer fails to find us, we will have captured the screen // but not be seeing any events and be unkillable from the console. @@ -567,8 +558,10 @@ void ProcessInputEvents(void) ErrorF( "Only read %i bytes from event pipe!\n", r ); break; } - + +#if defined(DARWIN_WITH_QUARTZ) && defined(QUARTZ_SAFETY_DELAY) gotread = true; +#endif gettimeofday(&tv, &tz); // translate it to an X event and post it @@ -719,9 +712,17 @@ void ProcessInputEvents(void) long hwButtons = ev.data.compound.misc.L[1]; int i; - for (i = 1; i < 4; i++) { + for (i = 1; i < 5; i++) { if (hwDelta & (1 << i)) { - xe.u.u.detail = i + 1; + // IOKit and X have different numbering for the + // middle and right mouse buttons. + if (i == 1) { + xe.u.u.detail = 3; + } else if (i == 2) { + xe.u.u.detail = 2; + } else { + xe.u.u.detail = i + 1; + } if (hwButtons & (1 << i)) { #ifdef __i386__ xe.u.u.type = ButtonRelease; @@ -1045,8 +1046,7 @@ void ddxUseMsg( void ) */ void ddxGiveUp( void ) { - ErrorF( " ddxGiveUp\n" ); - close(darwinEventFD); + ErrorF( "Quitting XDarwin...\n" ); if (quartz) { QuartzGiveUp(); @@ -1102,8 +1102,8 @@ xf86SetRootClip (ScreenPtr pScreen, BOOL enable) WindowPtr pWin = WindowTable[pScreen->myNum]; WindowPtr pChild; Bool WasViewable = (Bool)(pWin->viewable); - Bool anyMarked; - RegionPtr pOldClip, bsExposed; + Bool anyMarked = TRUE; + RegionPtr pOldClip = NULL, bsExposed; #ifdef DO_SAVE_UNDERS Bool dosave = FALSE; #endif diff --git a/xc/programs/Xserver/hw/darwin/xfIOKit.c b/xc/programs/Xserver/hw/darwin/xfIOKit.c index 121c40ba3..10c0043ec 100644 --- a/xc/programs/Xserver/hw/darwin/xfIOKit.c +++ b/xc/programs/Xserver/hw/darwin/xfIOKit.c @@ -8,7 +8,7 @@ * Significantly rewritten for XFree86 4.0.1 by Torrey Lyons * **************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/darwin/xfIOKit.c,v 1.7 2001/04/16 06:51:48 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/darwin/xfIOKit.c,v 1.8 2001/04/30 16:26:01 torrey Exp $ */ #define NDEBUG 1 @@ -215,6 +215,7 @@ static void SetupFBandHID(void) // find the requested screen assert(service = IOIteratorNext(iter)); for (i = 0; i < darwinScreenNumber; i++) { + IOObjectRelease( service ); service = IOIteratorNext(iter); if (service == 0) FatalError("Could not find the requested screen number %i.\n", diff --git a/xc/programs/Xserver/hw/kdrive/kinput.c b/xc/programs/Xserver/hw/kdrive/kinput.c index 4582b5ca7..887efcbc9 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.13 2001/03/30 02:15:20 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.13.2.1 2001/05/25 18:50:08 dawes Exp $ */ #include "kdrive.h" #include "inputstr.h" @@ -1452,7 +1452,7 @@ miPointerScreenFuncRec kdPointerScreenFuncs = void ProcessInputEvents () { - (void)mieqProcessInputEvents(); + mieqProcessInputEvents(); miPointerUpdate(); if (kdSwitchPending) KdProcessSwitch (); diff --git a/xc/programs/Xserver/hw/sun/sunIo.c b/xc/programs/Xserver/hw/sun/sunIo.c index 4821902b4..e3abdb336 100644 --- a/xc/programs/Xserver/hw/sun/sunIo.c +++ b/xc/programs/Xserver/hw/sun/sunIo.c @@ -15,7 +15,7 @@ * * */ -/* $XFree86: xc/programs/Xserver/hw/sun/sunIo.c,v 3.5 2001/01/17 22:36:50 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sun/sunIo.c,v 3.5.2.1 2001/05/25 18:50:08 dawes Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -67,7 +67,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. void ProcessInputEvents () { - (void) mieqProcessInputEvents (); + mieqProcessInputEvents (); miPointerUpdate (); } diff --git a/xc/programs/Xserver/hw/sunLynx/sunLyIo.c b/xc/programs/Xserver/hw/sunLynx/sunLyIo.c index c5c7b7e76..e2dc496ae 100644 --- a/xc/programs/Xserver/hw/sunLynx/sunLyIo.c +++ b/xc/programs/Xserver/hw/sunLynx/sunLyIo.c @@ -22,7 +22,7 @@ * PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyIo.c,v 3.4 2001/01/17 22:36:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/sunLynx/sunLyIo.c,v 3.4.2.1 2001/05/25 18:50:08 dawes Exp $ */ /* * @@ -90,7 +90,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. void ProcessInputEvents () { - (void) mieqProcessInputEvents (); + mieqProcessInputEvents (); miPointerUpdate (); } diff --git a/xc/programs/Xserver/hw/vfb/Imakefile b/xc/programs/Xserver/hw/vfb/Imakefile index 6e689896e..d868c86a7 100644 --- a/xc/programs/Xserver/hw/vfb/Imakefile +++ b/xc/programs/Xserver/hw/vfb/Imakefile @@ -3,7 +3,7 @@ XCOMM $Xorg: Imakefile,v 1.5 2000/08/17 19:48:38 cpqbld Exp $ -XCOMM $XFree86: xc/programs/Xserver/hw/vfb/Imakefile,v 3.28 2001/04/25 19:44:01 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/vfb/Imakefile,v 3.29.2.1 2001/05/31 16:14:18 dawes Exp $ #include <Server.tmpl> @@ -27,11 +27,6 @@ SRCS1 = os2_stubs.c OBJS1 = os2_stubs.o #endif -#ifdef cygwinArchitecture -SRCS2 = ntux_xf.c -OBJS2 = ntux_xf.o -#endif - SRCSA = InitInput.c InitOutput.c stubs.c $(SRCS1) miinitext.c $(SRCS2) OBJSA = InitInput.o InitOutput.o stubs.o $(OBJS1) miinitext.o $(OBJS2) @@ -63,7 +58,7 @@ LinkSourceFile(stubs.c,../../Xi) SpecialCObjectRule(InitInput,$(ICONFIGFILES),$(EXT_DEFINES)) LinkSourceFile(miinitext.c,$(SERVERSRC)/mi) -SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES) $(PAN_DEFINES) -DNO_HW_ONLY_EXTS -DNO_MODULE_EXTS $(EXT_MODULE_DEFINES) -UXFree86LOADER) +SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(EXT_DEFINES) $(PAN_DEFINES) -DNO_HW_ONLY_EXTS -DNO_MODULE_EXTS $(EXT_MODULE_DEFINES) -UXFree86LOADER -UXF86DRI) #if BuildDPMS LinkSourceFile(dpmsstubs.c,$(SERVERSRC)/Xext) diff --git a/xc/programs/Xserver/hw/vfb/InitInput.c b/xc/programs/Xserver/hw/vfb/InitInput.c index c76f70c07..592facc09 100644 --- a/xc/programs/Xserver/hw/vfb/InitInput.c +++ b/xc/programs/Xserver/hw/vfb/InitInput.c @@ -22,10 +22,11 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.6 2001/01/17 22:36:54 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.7 2001/05/16 08:01:09 alanh Exp $ */ #include "X11/X.h" #define NEED_EVENTS +#include "mi.h" #include "X11/Xproto.h" #include "scrnintstr.h" #include "inputstr.h" @@ -43,30 +44,6 @@ from The Open Group. */ int xf86bpp = 8; #endif - -#ifdef __CYGWIN__ -extern void init_mouse( ); -extern void init_keyboard( ); -extern void term_mouse( ); -extern void term_keyboard( ); -extern void get_WinMappings( char *pKeySyms, unsigned char *p_modMap ); - - -CARD32 lastEventTime = 0; - -int TimeSinceLastInputEvent() -{ - if (lastEventTime == 0) - lastEventTime = GetTimeInMillis(); - return GetTimeInMillis() - lastEventTime; -} - -void SetTimeSinceLastInputEvent() -{ - lastEventTime = GetTimeInMillis(); -} -#endif - Bool LegalModifier(key, pDev) @@ -284,74 +261,6 @@ GetLK201Mappings(pKeySyms, pModMap) #undef INDEX } -#ifdef __CYGWIN__ -static int -winKeybdProc(pDevice, onoff) - DeviceIntPtr pDevice; - int onoff; -{ - KeySymsRec keySyms; - CARD8 modMap[MAP_LENGTH]; - int i; - DevicePtr pDev = (DevicePtr)pDevice; - - switch (onoff) - { - case DEVICE_INIT: - get_WinMappings(&keySyms, modMap); - InitKeyboardDeviceStruct(pDev, &keySyms, modMap, - (BellProcPtr)NoopDDA, (KbdCtrlProcPtr)NoopDDA); - init_keyboard(); - break; - case DEVICE_ON: - pDev->on = TRUE; - break; - case DEVICE_OFF: - pDev->on = FALSE; - break; - case DEVICE_CLOSE: - term_keyboard(); - break; - } - return Success; -} - -static int -winMouseProc(pDevice, onoff) - DeviceIntPtr pDevice; - int onoff; -{ - BYTE map[4]; - DevicePtr pDev = (DevicePtr)pDevice; - - switch (onoff) - { - case DEVICE_INIT: - map[1] = 1; - map[2] = 2; - map[3] = 3; - InitPointerDeviceStruct(pDev, map, 3, miPointerGetMotionEvents, - (PtrCtrlProcPtr)NoopDDA, miPointerGetMotionBufferSize()); - init_mouse(); - break; - - case DEVICE_ON: - pDev->on = TRUE; - break; - - case DEVICE_OFF: - pDev->on = FALSE; - break; - - case DEVICE_CLOSE: - term_mouse(); - break; - } - return Success; -} -#endif /* __CYGWIN__ */ - - static int vfbKeybdProc(pDevice, onoff) DeviceIntPtr pDevice; @@ -359,7 +268,6 @@ vfbKeybdProc(pDevice, onoff) { KeySymsRec keySyms; CARD8 modMap[MAP_LENGTH]; - int i; DevicePtr pDev = (DevicePtr)pDevice; switch (onoff) @@ -424,7 +332,7 @@ InitInput(argc, argv) RegisterPointerDevice(p); RegisterKeyboardDevice(k); miRegisterPointerDevice(screenInfo.screens[0], p); - (void)mieqInit (k, p); + (void)mieqInit ((DevicePtr) k, (DevicePtr) p); } #ifdef XTESTEXT1 diff --git a/xc/programs/Xserver/hw/vfb/InitOutput.c b/xc/programs/Xserver/hw/vfb/InitOutput.c index f42d86587..3cd93b6db 100644 --- a/xc/programs/Xserver/hw/vfb/InitOutput.c +++ b/xc/programs/Xserver/hw/vfb/InitOutput.c @@ -22,9 +22,9 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/hw/vfb/InitOutput.c,v 3.16 2001/03/04 17:40:10 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/vfb/InitOutput.c,v 3.19 2001/05/16 14:06:28 alanh Exp $ */ -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(WIN32) #include <X11/Xwinsock.h> #endif #include <stdio.h> @@ -55,28 +55,12 @@ from The Open Group. #endif #include <X11/XWDFile.h> #ifdef HAS_SHM -#ifndef __CYGWIN__ #include <sys/ipc.h> -#else -#include <sys/cygipc.h> -#endif #include <sys/shm.h> #endif /* HAS_SHM */ #include "dix.h" #include "miline.h" - -#ifdef __CYGWIN__ -/* - * NT UX defines/includes - */ -#include <sys/mman.h> - -#define HAS_MMAP 1 - -extern char *get_surf( unsigned long size ); -extern char *get_framebuf( unsigned long size ); -extern int enable_ntux_xf( ); -#endif /* __CYGWIN__ */ +#include "mfb.h" extern char *display; @@ -118,16 +102,14 @@ typedef struct static int vfbNumScreens; static vfbScreenInfo vfbScreens[MAXSCREENS]; static Bool vfbPixmapDepths[33]; +#ifdef HAS_MMAP static char *pfbdir = NULL; +#endif typedef enum { NORMAL_MEMORY_FB, SHARED_MEMORY_FB, MMAPPED_FILE_FB } fbMemType; static fbMemType fbmemtype = NORMAL_MEMORY_FB; static char needswap = 0; static int lastScreen = -1; -#ifdef __CYGWIN__ -static int b_video_memory = 0; -#endif - #define swapcopy16(_dst, _src) \ if (needswap) { CARD16 _s = _src; cpswaps(_s, _dst); } \ else _dst = _src; @@ -196,6 +178,9 @@ ddxGiveUp() } } break; +#else /* HAS_MMAP */ + case MMAPPED_FILE_FB: + break; #endif /* HAS_MMAP */ #ifdef HAS_SHM @@ -209,14 +194,14 @@ ddxGiveUp() } } break; +#else /* HAS_SHM */ + case SHARED_MEMORY_FB: + break; #endif /* HAS_SHM */ case NORMAL_MEMORY_FB: for (i = 0; i < vfbNumScreens; i++) { -#ifdef __CYGWIN__ - if (!b_video_memory) -#endif Xfree(vfbScreens[i].pXWDHeader); } break; @@ -571,21 +556,32 @@ vfbStoreColors(pmap, ndef, pdefs) XWDColor *pXWDCmap; int i; - if (pmap != InstalledMaps[pmap->pScreen->myNum]) return; + if (pmap != InstalledMaps[pmap->pScreen->myNum]) + { + return; + } pXWDCmap = vfbScreens[pmap->pScreen->myNum].pXWDCmap; if ((pmap->pVisual->class | DynamicClass) == DirectColor) + { return; + } for (i = 0; i < ndef; i++) { if (pdefs[i].flags & DoRed) + { swapcopy16(pXWDCmap[pdefs[i].pixel].red, pdefs[i].red); + } if (pdefs[i].flags & DoGreen) + { swapcopy16(pXWDCmap[pdefs[i].pixel].green, pdefs[i].green); + } if (pdefs[i].flags & DoBlue) + { swapcopy16(pXWDCmap[pdefs[i].pixel].blue, pdefs[i].blue); + } } } @@ -760,10 +756,14 @@ vfbAllocateFramebufferMemory(pvfb) { #ifdef HAS_MMAP case MMAPPED_FILE_FB: vfbAllocateMmappedFramebuffer(pvfb); break; +#else + case MMAPPED_FILE_FB: break; #endif #ifdef HAS_SHM case SHARED_MEMORY_FB: vfbAllocateSharedMemoryFramebuffer(pvfb); break; +#else + case SHARED_MEMORY_FB: break; #endif case NORMAL_MEMORY_FB: @@ -775,17 +775,8 @@ vfbAllocateFramebufferMemory(pvfb) { pvfb->pXWDCmap = (XWDColor *)((char *)pvfb->pXWDHeader + SIZEOF(XWDheader) + XWD_WINDOW_NAME_LEN); -#ifndef __CYGWIN__ pvfb->pfbMemory = (char *)(pvfb->pXWDCmap + pvfb->ncolors); -#else - pvfb->pfbMemory = - (char *)get_framebuf((unsigned long) - pvfb->paddedWidth * pvfb->height); - if (pvfb->pfbMemory) - b_video_memory = 1; - else - pvfb->pfbMemory = (char *)(pvfb->pXWDCmap + pvfb->ncolors); -#endif + return pvfb->pfbMemory; } else @@ -800,7 +791,6 @@ vfbWriteXWDFileHeader(pScreen) vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; XWDFileHeader *pXWDHeader = pvfb->pXWDHeader; char hostname[XWD_WINDOW_NAME_LEN]; - VisualPtr pVisual; unsigned long swaptest = 1; int i; @@ -974,12 +964,6 @@ InitOutput(screenInfo, argc, argv) { int i; int NumFormats = 0; - FILE *pf = stderr; - - -#ifdef __CYGWIN__ - enable_ntux_xf(); -#endif /* initialize pixmap formats */ diff --git a/xc/programs/Xserver/hw/xfree86/CHANGELOG b/xc/programs/Xserver/hw/xfree86/CHANGELOG index fd4d0babe..313871a9f 100644 --- a/xc/programs/Xserver/hw/xfree86/CHANGELOG +++ b/xc/programs/Xserver/hw/xfree86/CHANGELOG @@ -1,4 +1,317 @@ +XFree86 4.1.0 (2 June 2001) + 619. Disable PCI resource conflict checking for Linux/Alpha (Jay Estabrook). + +XFree86 4.0.99.902 (1 June 2001) + 618. Fix Linux xf86GetPciSizeFromOS() parsing when the kernel is 64 bit + and any base or size is larger than 32 bits in magnitude (#4732, + David S. Miller). + 617. Make XDarwin ddx pass up proper right and middle mouse button numbers + and fix mouse button 5 (Christoph Pfisterer and Torrey T. Lyons). + 616. Restore backwards compatibility from 4.0.[2,3] to 4.1.0 for + the i810, r128 and radeon DRI drivers (Gareth Hughes). + 615. Fix a problem when using patterns of horizontal lines with the mga + video overlay (#A.442, Ewald Snel). + 614. Xinstall.sh updates and bug fixes (David Dawes). + 613. Remove duplicate XineramaLibrary section in X11.tmpl (#4731, + Mike Harris). + 612. Enable building DRI for Linux/ppc, and fix a drm-related bug + for Linux/ppc (#4728, 4730, Michel Dänzer). + 611. Document Options for the r128 and fbdev drivers (#4727, 4729, + Michel Dänzer). + 610. Add a BuildBindist switch which causes a file containing the XFree86 + version number to be installed in ProjectRoot, include this in + the Xbin bindist tarballs, and turn on this switch in the bindist + host.def files. The purpose is to allow the installer script to + easily identify which version the bindist tarballs are (David Dawes). + 609. Resync bindist and Xinstall.sh with changes made for 4.0.3 (David Dawes). + 608. Fix the Shape extension's XShapeCombineMask to handle cases where + src_mask is None according to the spec. This reportedly fixes an + X server crash (#4715, Huver). + 607. Make sure -UXF86DRI is after -DXF86DRI when compiling vfb/miinitext.c + (#4714, Frederic Lepied). + 606. Fix ATI Radeon driver on Alpha. Seems as though the BIOS doesn't + like Re-POSTing and memory setup gets confused. (Jay Estabrook, Jeff + Weidemeier) + 605. Fix build for Cygwin/XFree86 (#4711,#4713 Harold Hunt). + 604. Fix problem with Xinstall.sh on Darwin 1.3.x (#A.431, Stefan Pantos). + 603. Update Xinstall.sh and Darwin bindist directories to optionally + install Quartz support and to add an x86 distribution (Torrey T. Lyons). + +XFree86 4.0.99.901 (29 May 2001) + 602. Add missing return value for miSetPixmapDepths() (#4708, + ISHIKAWA Mutsumi). + 601. Fill in the v4l man page template with some useful information (#4707, + Gerd Knorr). + 600. Fix FFB OpenGL SwapBuffers (#4705, David S. Miller). + 599. Work around a problem building the rstart specs doc with a symlinked + build tree (David Dawes). + 598. Remove SPARC-specific byte-swapping code that would not work on older + SPARC CPUs (part of #4653, David S. Miller). + 597. NULLify mapVidMem() and remove DEV_MEM #define for Linux/SPARC + (#4651, David S. Miller). + 596. Fix Glint 300SX+Delta support. Add faster 500TX text acceleration + based on other code (Alan Hourihane). + 595. Fixing MTRR split code (hopefully) (Egbert Eich). + 594. Fixing coredump when doing vbeFree() twice: S3 Virge and C&T + (Egbert Eich). + 593. Fixing HWCursor for mga driver in fbdev mode (Egbert Eich). + 592. Fix xmh's use of XtNewString() with getenv (#4694, Tim Waugh). + 591. Xdm/PAM fixes: leave it to PAM to observe whether or not an account + is locked, and reinitialize credentials after calling initgroups(), + because sometimes the credentials pam_setcred() gives are in the + form of group membership (#4693, Mike Harris). + 590. Add an encodings file for standard box drawing characters for + VT100-compatible terminals (#4691, Juliusz Chroboczek). + 589. Fix warnings when building mieq.c (#4689, Adam Sulmicki). + 588. Fix some bugs in the cz and sk entried in XKB's keymap/xfree86 file + (#4692, Ivan Pascal). + 587. Add 'hr' entries to XKB's keymap/xfree86 and rules/xfree86.lst files + (#4687, Nerijus Baliunas). + 586. Include <X11/Xutil.h> in shape.h to get Region typedef (#4686, + Adam Sulmicki). + 585. Acceleration fixes for GLINT Permedia1 (Alan Hourihane). + 584. Ensure glint driver chips don't exceed the specified virtual sizes. + (Alan Hourihane). + 583. Remove all VGA'isms from the glint driver, it doesn't need them + (Alan Hourihane). + 582. Support the Delta in the glint driver, needed for boards that have + the Delta connected to the rasterizer, as it acts as an arbiter for + the bus. Resolves acceleration troubles. (Alan Hourihane). + 581. Add an lv entry to XKB's keymap/xfree86 file (#4685, Nerijus Baliunas). + 580. Fix some typos in XKB's xfree86.lst file (#4684, Nerijus Baliunas). + 579. Add DDXOSVERRORF ifdefs to the XFree86 ddx code that make use of the + OsVendorVErrorFProc feature (#4678, Michel Dänzer). + 578. Convert the r128 driver's "UseBIOSDisplay" option into a more general + "Display" option (#4678, Michel Dänzer). + 577. Treat GL_POINT like GL_POINTS and GL_LINE like GL_LINES in the sunffb + DRI driver (#4677, David S. Miller) + 576. Fix bsdLib.rules and bsdLib.tmpl problems that show up when + X11ProjectRoot is defined (#4676, Johnny C. Lam). + 575. Fix Trident XVideo colorkey at depth 15, 24 (Alan Hourihane). + 574. Fix a typo in the lv XKB description, and fix things so that it gets + installed (#4675, 4679, Andris Pavenis). + 573. Fix some apm driver bugs, including one that prevented acceleration + from working (#4674, Loïc Grenié). + 572. Fix 555 (depth 15) palette handling in the i810 driver (#4673, + Andrew C. Aitchison). + 571. [SECURITY] Fix authentication issues with mmap() on drm devices + (Jeff Hartmann). + 570. Add euro locales and some other missing locales to locale.alias and + locale.dir (#4662, 4665, 4667, Mike Harris). + 569. Fix Romanian XKB map (#4664, Mike Harris). + 568. Spell Portuguese correctly in XKB lst files (#4663, Mike Harris). + 567. Fix new ioperm calls in lnx_video.c for Alpha that are not needed + (Jay Estabrook). + 566. Fix problems with assembler file dependencies when using gccmakedep + with the build (Frederic Lepied). + 565. Finish DRI resync, including tdfx driver updates for textured video + support (VA Linux Systems). + 564. Fix formatting of max clock reported by DDC (Marc La France). + 563. Update Japanese localization of XDarwin help file (Toshimitsu Tanaka). + 562. Update XDarwin man pages, help files, and version info. Add option to + build XDarwin.app bundle for deployment (Torrey Lyons). + +XFree86 4.0.99.900 (18 May 2001) + 561. Add an XKB description for Latvian (lv) keyboards (#A.411, Ilya Ketris). + 560. Resync with DRI CVS trunk (VA Linux Systems). + 559. Savage driver updates, including compiler warning fixes, document + the "ShadowStatus" option in the man page, and fix an argument + mismatch between ShadowWait and SavageWaitQueue (#4661, Tim Roberts). + 558. Update the wacom driver to add a "ScreenNo" option to allow a tablet + to be attached to a screen in a multi-head setup, and to add auto- + detection of USB line and max parameters of USB tablets (#4640, + Frederic Lepied). + 557. Add a README file that has information about enabling the extra buttons + on the IBM Rapid Access keyboard (#4639, Dennis Bjorklund). + 556. Fix some Slovene/Slovak confusion in locale.dir/locale.alias files + (#4638, Kamil Toman). + 555. New XKB keymaps for cz and sk (#4634, 4637, Kamil Toman). + 554. Updates for the iso8859-2 Compose file (#4634, Kamil Toman). + 553. Check V_CSYNC in the r128 driver, and fix building with R128_DEBUG + enabled (#4631, Michel Dänzer). + 552. Mesa 3.4.2 (and later) import. + 551. More build & warning fixes (Marc La France). + 550. Fix bug that caused hardware cursors to be temporarily moved during mode + switches (Marc La France). + 549. Optimise HARDWARE_CURSOR_AND_SOURCE_WITH_MASK case (Marc La France). + 548. Move xf86CursorScreenRec definition into xf86CursorPriv.h + (Marc La France). + 547. Fix BIOS retrievals in MGA driver (Marc La France). + 546. Fix ATIProbe() for newer Rage128 and Radeon chips (Marc La France). + 545. Add temporary workaround in ATI driver for interrupts that occur on + PowerPC's upon PCI master-aborts (Marc La France). + 544. Update XDarwin to use fb and support Render (Torrey Lyons). + 543. Back out sunleo conversion to fb. This driver is too heavily dependent + on cfb32 for a simple fb conversion (Marc La France). + 542. Miscellaneous build/warning fixes (Marc La France). + 541. More prep work for SunOS (Marc La France). + 540. Fix libXft build on SunOS (Marc La France). + 539. Another makedepend bug fix (Marc La France). + 538. Fix use of xftcache utility during !UseInstalled builds (Marc La France). + 537. Adds #XFree86LOADER define to wrap ModuleInfo related functions + (#4654, Harold Hunt). + 536. Add an option to the SiS driver to turn off Xvideo support + (Ademar de Souza Reis Jr.) + 535. Fix FreeType bug, use MAXFONTNAMELEN (#4652, Janusz Gorycki, + Juliusz Chroboczek). + 534. Fix hw/vfb for compilation on Cygwin/XFree86 (#4655, Harold Hunt). + 533. Fix some Sparc platform issues with Pci resources and the glint + driver (#4641-4641,4644-4648 David S. Miller). + 532. Update glide, imstt, newport, rendition, suncg14, suncg3, suncg6, + sunleo, suntcx, vga and vmware to use fb and support Render + (Keith Packard). + 531. XDarwin fixes: + - Turn off building non-functional RENDER support. + - Reduce disappearing cursor problems when switching with Dock. + - Top of X display is no longer occasionally drawn black when + switching from Aqua. + (Torrey Lyons). + 530. Update freetype2 bits to 2.0.2 version (Keith Packard). + 529. Re-fix the Trident Video scaler support for Blade series chips + (Alan Hourihane). + 528. Fixed lbx to handle endian swapping without core dump (Egbert Eich). + 527. Fixed MTRR region splitting (Egbert Eich). + 526. Cleaned up option handling in int10 code (Egbert Eich). + 525. Added options to specify the Video BIOS to use for POSTing a + chipset (Egbert Eich). + 524. Trident driver: added call to BIOS to enable unstretched mode when + display is stretched. This should make the option "CyberShadow" + obsolete. (Egbert Eich). + 523. Attempt to fix video Support on Trident driver (Egbert Eich). + 522. Added VBE DDC support to SiS driver (Egbert Eich). + 521. Fixed Silicon Motion to unblank the display when driver fails + in PreInit() (Egbert Eich). + 520. Cleaned up handling of 'shadow status' in Savage driver + (Egbert Eich). + 519. Savage driver: fixed lockups for Savage4 when loading colormap, + manipulating the HW cursor, doing certain blit operations + 518. Cleanded up DDC code in mga driver (Egbert Eich). + 517. Fixed KGA handling in i740 driver (Egbert Eich). + 516. Converted i740 and Silicon Motion drivers to fb (Egbert Eich). + 515. Added calls to vbeFree() or xf86FreeInt10() to C&T, glint, + mga, neomagic, nv, s3v, tdfx and trident drivers to clean up + shared memory segments (Egbert Eich). + 514. Reworked video support in C&T driver, cleaned up block handler + (Egbert Eich). + 513. C&T driver: introduced a delay when setting the cursor image for + the first time after a mode change (Egbert Eich). + 512. Fixed R128CCE_RESET in r128 driver to do a reset only when dri + is enabled (Egbert Eich). + 511. Rewrote readPciBIOS() and getValidBIOSBase() (Egbert Eich). + 510. Fixed xf86Info structure in xf86Globals.c to match prototype + (Egbert Eich). + 509. - + 508. Fix XDarwin install problems with DESTDIR handling and with soft links + to the XtAppAddTimeOut manpage (Christoph Pfisterer). + 507. Add Error message output in Cygwin/XFree86 (#4632, Harold Hunt). + 506. Fix xdm when HasPam defined, and enable Pam support on Solaris 2.6 and + later (#A.401, #A.402, #A.403, Rainer Orth). + 505. Add Croatian keyboard for xkbcomp from Slovenian keyboard layout + (#A.405, Vlatko Kosturjak). + 504. Fix XvQueryAdaptors when there is no adaptors found + (#A.394, Jamie Strachan). + 503. Remove a stray INCLUDES in Xmuu/Imakefile when snprintf isn't used. + Set the Permedia2 DAC Mask to 0xFF. + PCI ROM space address access patch for LynxOS PPC. + Change limit of motoppcBusAddrToHostAddr for LynxOS PPC. + Include <sys/wait.h> for LynxOS in os/osinit.c. + Define CBAUD, when it's missing in xterm, on LynxOS. + (#A.387, Stuart Lissaman). + 502. Add SiS 86C204 to xf86PciInfo.h (#A.382, Carlos Manuel Duclos Vergara). + 501. Fix mga font corruption problems introduced with the recent addition + of big-endian support (#4629, Andrew C. Aitchison). + 500. Update for the mga driver's man page (#4628, Andy Isaacson). + 499. Add more drivers to the default build on Linux/mips (#4623, + Guido Guenther). + 498. Move the vgahw module load/init after the PROBD_DETECT handling + in the i810 driver's PreInit(), which fixes a segv when using + the X server's -configure option (#A.378, Leandro Martelli). + 497. Fix a problem with Radeon VE cards failing to enable its video output + (#A.376, Paul Stewart). + 496. Fix some DRI-related build dependency problems (David Dawes). + 495. Fix some drivers (including tdfx, r128, radeon, ark, imstt) that weren't + respecting the Virtual resolution requested in the config file + (David Dawes). + 494. Fix some offscreen memory calculation/allocation problems in the + tdfx driver (David Dawes). + 493. Fix a bug in localResizeOffscreenLinear when checking widths + (Alan Hourihane). + 492. Update Japanese localization for XDarwin Dock related fixes + (Toshimitsu Tanaka). + 491. Fix restoring of text mode fonts on Permedia3 (Alan Hourihane). + 490. Provide workaround for an apparent bug in Mac OS X 10.0.2 that causes + XDarwin to lose the cursor when switching to X using the Dock icon. + Fix "Application not responding" message in XDarwin's popup Dock menu + (Torrey Lyons). + 489. Hardware cursor documentation update (Marc La France). + 488. XVideo extension support in ATI driver for generic (e.g. v4l) adapters + (based on a patch by Ignacio Garcia Etxebarria). + 487. Fix ATI driver bug that caused the hardware cursor to move after mode + switches (Marc La France). + 486. Fix off-by-one error in screen positioning after a mode switch + (Marc La France). + 485. Backout part of 479 and implement a proper fix in the ATI driver + (Marc La France). + 484. Fix palette problem on NVIDIA Riva128 in DGA mode (Mark Vojkovich). + 483. setxkbmap patch that: + - fixes bug in comand line parser + - makes debug output more comprehensive + - prevent to use 'variant' from previous call if 'layout' name changed. + (#4627, Ivan Pascal) + 482. Documents Xaa specific options in the XF86Config manual page + (#4616, Branden Robinson) + 481. Add Mouse 3 Button emulation to Cygwin/XFree86 (#4626, Harold Hunt, + Alexander Gottwald). + 480. V4L documentation fix (Marc La France). + 479. Fix bug in generic hardware cursor RealizeCursor entry + (Marc La France). + 478. Extend the XFree86-VidModeExtension to accept gamma ramps from the + client rather than just rgb gamma values (Mark Vojkovich). + 477. More Xv updates for the Permedia3 (#4625, Sven Luther). + 476. Build Cygwin/XFree86 with -ansi -pedantic (Alan Hourihane). + 475. Limit the number of PCI buses to 128 on ix86 (Marc La France). + 474. More fixes for the handling of unassigned PCI bases (Marc La France). + 473. Fix option handling in most drivers so that per-screen options work + correctly (David Dawes). + 472. Resync with DRI CVS trunk (VA Linux Systems). + 471. Import latest Mesa 3.4.x branch. + 470. Add a PIOOffset value plus readEnable and writeEnable function pointers + to the vgahw rec. The former allows vgahw to be used for VGA registers + that are shadowed in I/O space. The latter allow the VGA_ENABLE + register to be accessed in similar way to most other VGA registers. + Add vgaHWEnable() and vgaHWDisable() functions (David Dawes). + 469. Disable HWcursor for CyberBladeXP chips (Alan Hourihane). + 468. Fix a Trident Cyber9388 setup issue (Alan Hourihane). + 467. Fix man page building and installing on Darwin. To be safe we assume + the Darwin file system is case insensitive since one common variety is, + ie. HFS+ (Torrey Lyons). + 466. Improve interoperability between Aqua pasteboard and X cut buffer with + XDarwin (Gregory Parker). + 465. Updates for Cygwin/XFree86 (Harold Hunt). + 464. Provide more robust default preferences for XDarwin (Torrey Lyons). + 463. Remove map84 keyboard map from Cygwin/XFree86 build (#4621, Harold Hunt). + 462. Disable xload on Cygwin/XFree86 (Alan Hourihane). + 461. Remove an errorneous i++ from os/xdmcp.c with -class (Alexander Gottwald). + 460. Allow Cygwin/XFree86 to build with cygipc support (Alan Hourihane). + 459. Small XDarwin fixes: + - Don't leak IOService objects when searching for desired screen. + - Eliminate chance of SIGPIPE while shutting down. + - Revert to Aqua cursor when quit by exiting main client. + - Stop console error messages when using mouse button 3. + (Torrey Lyons and Christoph Pfisterer). + 458. At Linus' request, make linux/int10 module deal with shmat() errors + (Marc La France). + 457. Fix makedepend's integer value parsing and make it understand GCC's + #include_next directive as found in glibc & libc5 (Marc La France). + 456. Xterm patch #156 (Thomas Dickey): change preference of types for + selection-target between UTF8_STRING and STRING (Juliusz Chroboczek), + fixes for configure script and documentation (report by Adam + <adam@cfar.umd.edu>). + 455. Fix XDarwin so display number preference is followed (Torrey Lyons). + 454. Fix Xserver/Imakefile for Cygwin/XFree86 (Harold Hunt, Alan Hourihane). + XFree86 4.0.99.3 (26 April 2001) + 453. Loader fixups for Sparc's (Marc La France). 452. Fix dependencies for libGLU on Cygwin/XFree86 (Alan Hourihane). 451. Make xdm & xfs compile on Cygwin/XFree86 (Alan Hourihane). 450. Update Japanese localization of XDarwin.app's Preferences window @@ -13104,4 +13417,4 @@ XFree86 3.0a (28 April 1994) XFree86 3.0 (26 April 1994) -$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.1724 2001/04/27 11:47:10 alanh Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.1785.2.32 2001/06/02 15:27:50 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/Imakefile b/xc/programs/Xserver/hw/xfree86/Imakefile index dbf721499..8d9b504ec 100644 --- a/xc/programs/Xserver/hw/xfree86/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/Imakefile @@ -3,7 +3,7 @@ XCOMM $XConsortium: Imakefile /main/12 1996/12/16 12:31:46 rws $ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/Imakefile,v 3.75 2001/04/20 16:00:47 alanh Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/Imakefile,v 3.76 2001/05/15 18:22:20 paulo Exp $ #include <Server.tmpl> #define IHaveSubdirs @@ -200,6 +200,7 @@ InstallGenManPage(XF86Config,$(FILEMANDIR),$(FILEMANSUFFIX)) InstallNamedNonExec($(XF86CONFIG),XF86Config.eg,$(LIBDIR)) InstallNamedNonExec($(XF98CONFIG),XF86Config.98,$(LIBDIR)) +InstallNamedNonExec(Options,Options,$(LIBDIR)) InstallDriverSDKNamedNonExec($(XF86CONFIG),XF86Config.eg,$(DRIVERSDKDIR)) diff --git a/xc/programs/Xserver/hw/xfree86/Options b/xc/programs/Xserver/hw/xfree86/Options new file mode 100644 index 000000000..c1b360b59 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/Options @@ -0,0 +1,208 @@ +!! +!! Copyright (c) 2001 by The XFree86 Project, Inc. +!! +!! 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 +!! THE XFREE86 PROJECT 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 XFree86 Project 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. +!! +!! $XFree86: xc/programs/Xserver/hw/xfree86/Options,v 1.1.2.2 2001/06/01 02:24:16 dawes Exp $ + +!! XAA options +xaa.XaaNoCPUToScreenColorExpandFill:\ +Disables accelerated rectangular expansion blits from source patterns \ +stored in system memory (using a memory-mapped aperture). + +xaa.XaaNoColor8x8PatternFillRect:\ +Disables accelerated fills of a rectangular region with a full-color pattern. + +xaa.XaaNoColor8x8PatternFillTrap:\ +Disables accelerated fills of a trapezoidal region with a full-color pattern. + +xaa.XaaNoDashedBresenhamLine:\ +Disables accelerated dashed Bresenham line draws. + +xaa.XaaNoDashedTwoPointLine:\ +Disables accelerated dashed line draws between two arbitrary points. + +xaa.XaaNoImageWriteRect:\ +Disables acclerated transfers of full-color rectangular patterns from \ +system memory to video memory (using a memory-mapped aperture). + +xaa.XaaNoMono8x8PatternFillRect:\ +Disables accelerated fills of a rectangular region with a monochrome pattern. + +xaa.XaaNoMono8x8PatternFillTrap:\ +Disables accelerated fills of a trapezoidal region with a monochrome pattern. + +xaa.XaaNoOffscreenPixmaps:\ +Disables accelerated draws into pixmaps stored in offscreen video memory. + +xaa.XaaNoPixmapCache:\ +Disables caching of patterns in offscreen video memory. + +xaa.XaaNoScanlineCPUToScreenColorExpandFill:\ +Disables accelerated rectangular expansion blits from source patterns \ +stored in system memory (one scan line at a time). + +xaa.XaaNoScanlineImageWriteRect:\ +Disables acclerated transfers of full-color rectangular patterns from \ +system memory to video memory (one scan line at a time). + +xaa.XaaNoScreenToScreenColorExpandFill:\ +Disables accelerated rectangular expansion blits from source patterns \ +stored in offscreen video memory. + +xaa.XaaNoScreenToScreenCopy:\ +Disables accelerated copies of rectangular regions from one part of video \ +memory to another part of video memory. + +xaa.XaaNoSolidBresenhamLine:\ +Disables accelerated solid Bresenham line draws. + +xaa.XaaNoSolidFillRect:\ +Disables accelerated solid-color fills of rectangles. + +xaa.XaaNoSolidFillTrap:\ +Disables accelerated solid-color fills of Bresenham trapezoids. + +xaa.XaaNoSolidHorVertLine:\ +Disables accelerated solid horizontal and vertical line draws. + +xaa.XaaNoSolidTwoPointLine:\ +Disables accelerated solid line draws between two arbitrary points. + + +!! FBDev options +fbdev.fbdev:\ +The framebuffer device to use. \ +Default: /dev/fb0. + +fbdev.ShadowFB:\ +Enable or disable use of the shadow framebuffer layer. \ +Default: on. + + +!! MGA options +mga.ColorKey:\ +Set the colormap index used for the transparency key for the depth 8 plane \ +when operating in 8+24 overlay mode. The value must be in the range 2-255. \ +Default: 255. + +mga.HWcursor:\ +Enable or disable the HW cursor. Default: on. + +mga.MGASDRAM:\ +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 presence of of SDRAM on secondary heads in multihead \ +configurations so this option will often need to be specified in multihead \ +configurations. Default: autodetected. + +mga.NoAccel:\ +Disable or enable acceleration. Default: acceleration is enabled. + +mga.OverclockMem:\ +Set clocks to values used by some commercial X-Servers (G100, G200 and \ +G400 only). Default: off. + +mga.Overlay:\ +Enable 8+24 overlay mode. Only appropriate for depth 24. (Note: the G100 is \ +unaccelerated in the 8+24 overlay mode due to a missing hardware feature). \ +Default: off. + +mga.PciRetry:\ +Enable or disable PCI retries. Default: off. + +mga.Rotate:\ +Rotate the display clockwise or counterclockwise. This mode is unaccelerated. \ +Default: no rotation. + +mga.ShadowFB:\ +Enable or disable use of the shadow framebuffer layer. See shadowfb(4) for \ +further information. Default: off. + +mga.SyncOnGreen:\ +Enable or disable combining the sync signals with the green signal. \ +Default: off. + +mga.UseFBDev:\ +Enable or disable use of on OS-specific fb interface (and is not supported \ +on all OSs). See fbdevhw(4) for further information. Default: off. + +mga.VideoKey:\ +This sets the default pixel value for the YUV video overlay key. \ +Default: undefined. + +mga.TexturedVideo:\ +This has XvImage support use the texture engine rather than the video \ +overlay. This option is only supported by the G200 and G400, and only in \ +16 and 32 bits per pixel. Default: off. + + +!! R128 options + +r128.SWcursor: \ +Selects software cursor. \ +Default: off. + +r128.NoAccel:\ +Enables or disables all hardware acceleration. \ +Default: on. + +r128.Dac6Bit:\ +Enables or disables the use of 6 bits per color component when in 8 bpp \ +mode (emulates VGA mode). \ +Default: off. + +r128.VideoKey:\ +This overrides the default pixel value for the YUV video overlay key. \ +Default: undefined. + +r128.Display:\ +Select display mode for devices which support flat panels. Supported\ +modes are "FP", "CRT", "Mirror", "BIOS". \ +Default: "FP". + +r128.ProgramFPRegs:\ +Enable or disable programming of the flat panel registers.\ +Beware that this may damage your panel, so use at your own risk. \ +Default: device dependant. + +r128.PanelWidth:\ +Override flat panel width in pixels. \ +Default: determined using BIOS. + +r128.PanelHeight:\ +Override flat panel height in pixels. \ +Default: determined using BIOS. + +r128.UseFBDev:\ +Enable or disable use of on OS-specific fb interface (and is not supported \ +on all OSs). See fbdevhw(4) for further information. Default: off. + + +!! Vesa options +vesa.ShadowFB:\ +Enable or disable use of the shadow framebuffer layer. See shadowfb(4)\ +for further information. Default: on. + diff --git a/xc/programs/Xserver/hw/xfree86/XF86Config.man b/xc/programs/Xserver/hw/xfree86/XF86Config.man index b37bece20..8bfc1c64f 100644 --- a/xc/programs/Xserver/hw/xfree86/XF86Config.man +++ b/xc/programs/Xserver/hw/xfree86/XF86Config.man @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/XF86Config.man,v 1.4 2001/04/05 19:29:41 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/XF86Config.man,v 1.5 2001/05/08 21:53:08 paulo Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH XF86Config __filemansuffix__ __vendorversion__ @@ -1214,6 +1214,82 @@ flags may be specified in the section. Some are driver-specific and are described in the driver documentation. Others are driver-independent, and will eventually be described here. +.TP 7 +.BI "Option \*qAccel\*q" +Enables XAA (X Acceleration Architecture), a mechanism that makes video +cards' 2D hardware acceleration available to the X server. This option is +on by default, but it may be necessary to turn it off if there are bugs in +the driver. There are many options to disable specific acclerated +operations, listed below. Note that disabling an operation will have no +effect if the operation is not accelerated (whether due to lack of support +in the hardware or in the driver). +.TP 7 +.BI "Option \*qXaaNoCPUToScreenColorExpandFill\*q" +Disables accelerated rectangular expansion blits from source patterns +stored in system memory (using a memory-mapped aperture). +.TP 7 +.BI "Option \*qXaaNoColor8x8PatternFillRect\*q" +Disables accelerated fills of a rectangular region with a full-color +pattern. +.TP 7 +.BI "Option \*qXaaNoColor8x8PatternFillTrap\*q" +Disables accelerated fills of a trapezoidal region with a full-color +pattern. +.TP 7 +.BI "Option \*qXaaNoDashedBresenhamLine\*q" +Disables accelerated dashed Bresenham line draws. +.TP 7 +.BI "Option \*qXaaNoDashedTwoPointLine\*q" +Disables accelerated dashed line draws between two arbitrary points. +.TP 7 +.BI "Option \*qXaaNoImageWriteRect\*q" +Disables acclerated transfers of full-color rectangular patterns from +system memory to video memory (using a memory-mapped aperture). +.TP 7 +.BI "Option \*qXaaNoMono8x8PatternFillRect\*q" +Disables accelerated fills of a rectangular region with a monochrome +pattern. +.TP 7 +.BI "Option \*qXaaNoMono8x8PatternFillTrap\*q" +Disables accelerated fills of a trapezoidal region with a monochrome +pattern. +.TP 7 +.BI "Option \*qXaaNoOffscreenPixmaps\*q" +Disables accelerated draws into pixmaps stored in offscreen video memory. +.TP 7 +.BI "Option \*qXaaNoPixmapCache\*q" +Disables caching of patterns in offscreen video memory. +.TP 7 +.BI "Option \*qXaaNoScanlineCPUToScreenColorExpandFill\*q" +Disables accelerated rectangular expansion blits from source patterns +stored in system memory (one scan line at a time). +.TP 7 +.BI "Option \*qXaaNoScanlineImageWriteRect\*q" +Disables acclerated transfers of full-color rectangular patterns from +system memory to video memory (one scan line at a time). +.TP 7 +.BI "Option \*qXaaNoScreenToScreenColorExpandFill\*q" +Disables accelerated rectangular expansion blits from source patterns +stored in offscreen video memory. +.TP 7 +.BI "Option \*qXaaNoScreenToScreenCopy\*q" +Disables accelerated copies of rectangular regions from one part of video +memory to another part of video memory. +.TP 7 +.BI "Option \*qXaaNoSolidBresenhamLine\*q" +Disables accelerated solid Bresenham line draws. +.TP 7 +.BI "Option \*qXaaNoSolidFillRect\*q" +Disables accelerated solid-color fills of rectangles. +.TP 7 +.BI "Option \*qXaaNoSolidFillTrap\*q" +Disables accelerated solid-color fills of Bresenham trapezoids. +.TP 7 +.BI "Option \*qXaaNoSolidHorVertLine\*q" +Disables accelerated solid horizontal and vertical line draws. +.TP 7 +.BI "Option \*qXaaNoSolidTwoPointLine\*q" +Disables accelerated solid line draws between two arbitrary points. .PP Each .B Screen diff --git a/xc/programs/Xserver/hw/xfree86/common/Imakefile b/xc/programs/Xserver/hw/xfree86/common/Imakefile index 13fd279ee..f35a8de43 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.133 2001/04/21 20:08:06 herrb Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/common/Imakefile,v 3.134 2001/05/07 21:42:31 tsi Exp $ @@ -256,3 +256,4 @@ InstallDriverSDKNonExecFile(xf86cmap.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(xf86fbman.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(xf86str.h,$(DRIVERSDKINCLUDEDIR)) InstallDriverSDKNonExecFile(xf86xv.h,$(DRIVERSDKINCLUDEDIR)) +InstallDriverSDKNonExecFile(xf86xvmc.h,$(DRIVERSDKINCLUDEDIR)) diff --git a/xc/programs/Xserver/hw/xfree86/common/atKeynames.h b/xc/programs/Xserver/hw/xfree86/common/atKeynames.h index bfaa57499..a1a703795 100644 --- a/xc/programs/Xserver/hw/xfree86/common/atKeynames.h +++ b/xc/programs/Xserver/hw/xfree86/common/atKeynames.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/atKeynames.h,v 3.16 2001/03/07 19:53:16 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/atKeynames.h,v 3.17 2001/05/18 16:03:10 tsi Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -198,7 +198,7 @@ #define KEY_NFER /* No Kanji Transfer 0x7b */ 123 #define KEY_Yen /* Yen 0x7d */ 125 -/* These are for "notused" and "uknown" entries in translation maps. */ +/* These are for "notused" and "unknown" entries in translation maps. */ #define KEY_NOTUSED 0 #define KEY_UNKNOWN 255 diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86.h b/xc/programs/Xserver/hw/xfree86/common/xf86.h index 0835d874c..484433741 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.150 2001/04/05 17:42:31 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.152 2001/05/16 20:08:35 paulo Exp $ */ /* * Copyright (c) 1997 by The XFree86 Project, Inc. @@ -312,6 +312,11 @@ int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, pointer value); Bool xf86IsUnblank(int mode); +#ifdef XFree86LOADER +void xf86AddModuleInfo(ModuleInfoPtr info, pointer module); +void xf86DeleteModuleInfo(int idx); +#endif + /* xf86Debug.c */ #ifdef BUILDDEBUG void xf86Break1(void); diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c b/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c index 3533bb7d4..c747e9216 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.61 2001/04/01 14:00:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.61.2.2 2001/06/02 15:27:54 dawes Exp $ */ /* * Copyright (c) 1997-1999 by The XFree86 Project, Inc. */ @@ -53,16 +53,16 @@ resPtr osRes = NULL; resPtr ResRange = NULL; /* predefined special resources */ -resRange resVgaExclusive[] = {_VGA_EXCLUSIVE, _END}; -resRange resVgaShared[] = {_VGA_SHARED, _END}; -resRange resVgaMemShared[] = {_VGA_SHARED_MEM,_END}; -resRange resVgaIoShared[] = {_VGA_SHARED_IO,_END}; -resRange resVgaUnusedExclusive[] = {_VGA_EXCLUSIVE_UNUSED, _END}; -resRange resVgaUnusedShared[] = {_VGA_SHARED_UNUSED, _END}; -resRange resVgaSparseExclusive[] = {_VGA_EXCLUSIVE_SPARSE, _END}; -resRange resVgaSparseShared[] = {_VGA_SHARED_SPARSE, _END}; -resRange res8514Exclusive[] = {_8514_EXCLUSIVE, _END}; -resRange res8514Shared[] = {_8514_SHARED, _END}; +const resRange resVgaExclusive[] = {_VGA_EXCLUSIVE, _END}; +const resRange resVgaShared[] = {_VGA_SHARED, _END}; +const resRange resVgaMemShared[] = {_VGA_SHARED_MEM,_END}; +const resRange resVgaIoShared[] = {_VGA_SHARED_IO,_END}; +const resRange resVgaUnusedExclusive[] = {_VGA_EXCLUSIVE_UNUSED, _END}; +const resRange resVgaUnusedShared[] = {_VGA_SHARED_UNUSED, _END}; +const resRange resVgaSparseExclusive[] = {_VGA_EXCLUSIVE_SPARSE, _END}; +const resRange resVgaSparseShared[] = {_VGA_SHARED_SPARSE, _END}; +const resRange res8514Exclusive[] = {_8514_EXCLUSIVE, _END}; +const resRange res8514Shared[] = {_8514_SHARED, _END}; /* Flag: do we need RAC ? */ static Bool needRAC = FALSE; @@ -1731,9 +1731,13 @@ xf86RegisterResources(int entityIndex, resList list, int access) range.type = (range.type & ~ResAccMask) | (access & ResAccMask); } range.type &= ~ResEstimated; /* Not allowed for drivers */ +#if !(defined(__alpha__) && defined(linux)) + /* On Alpha Linux, do not check for conflicts, trust the kernel. */ if (checkConflict(&range, Acc, entityIndex, SETUP,TRUE)) res = xf86AddResToList(res,&range,entityIndex); - else { + else +#endif + { Acc = xf86AddResToList(Acc,&range,entityIndex); } list++; @@ -2481,7 +2485,10 @@ xf86PostProbe(void) } xf86FreeResList(acc); +#if !(defined(__alpha__) && defined(linux)) + /* No need to validate on Alpha Linux, trust the kernel. */ ValidatePci(); +#endif xf86MsgVerb(X_INFO, 3, "resource ranges after probing:\n"); xf86PrintResList(3, Acc); diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Config.c b/xc/programs/Xserver/hw/xfree86/common/xf86Config.c index 4f524be61..8a488eac8 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.241 2001/03/28 17:58:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.242 2001/05/16 20:08:35 paulo Exp $ */ /* @@ -454,6 +454,7 @@ GenerateDriverlist(char * dirname, char * drivernames) const char *subdirs[] = {NULL, NULL}; static const char *patlist[] = {"(.*)_drv\\.so", "(.*)_drv\\.o", NULL}; char **dlist, **clist, **dcp, **ccp; + int size; subdirs[0] = dirname; @@ -468,13 +469,16 @@ GenerateDriverlist(char * dirname, char * drivernames) /* The resulting list cannot be longer than the module list */ for (dcp = dlist, count = 0; *dcp++; count++); - driverlist = (char **)xnfalloc((count + 1) * sizeof(char *)); + driverlist = (char **)xnfalloc((size = count + 1) * sizeof(char *)); /* First, add modules not in compiled-in list */ for (count = 0, dcp = dlist; *dcp; dcp++) { for (ccp = clist; ; ccp++) { if (!*ccp) { driverlist[count++] = *dcp; + if (count >= size) + driverlist = (char**) + xnfrealloc(driverlist, ++size * sizeof(char*)); break; } if (!strcmp(*ccp, *dcp)) @@ -487,6 +491,9 @@ GenerateDriverlist(char * dirname, char * drivernames) for (dcp = dlist; *dcp; dcp++) { if (!strcmp(*ccp, *dcp)) { driverlist[count++] = *ccp; + if (count >= size) + driverlist = (char**) + xnfrealloc(driverlist, ++size * sizeof(char*)); break; } } diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c b/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c index 3a7369d66..3ce0592ff 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.54 2001/04/10 16:07:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.55 2001/05/07 21:38:51 tsi Exp $ */ /* * Copyright 2000 by Alan Hourihane, Sychdyn, North Wales. * @@ -246,7 +246,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int /* Get driver's available options */ if (xf86DriverList[CurrentDriver]->AvailableOptions) - NewDevice.GDev.options = + NewDevice.GDev.options = (OptionInfoPtr) (*xf86DriverList[CurrentDriver]->AvailableOptions)(chipset, bus); diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c b/xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c index cb43b9418..b727d9c12 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c,v 3.28 2000/06/24 00:33:54 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c,v 3.29 2001/05/09 03:12:01 tsi Exp $ */ /* $XConsortium: xf86Cursor.c /main/10 1996/10/19 17:58:23 kaleb $ */ #define NEED_EVENTS @@ -201,7 +201,7 @@ xf86ZoomViewport (ScreenPtr pScreen, int zoom) /* * adjust new frame for the displaysize */ - pScr->frameX0 = (pScr->frameX1 + pScr->frameX0 - + pScr->frameX0 = (pScr->frameX1 + pScr->frameX0 + 1 - pScr->currentMode->HDisplay) / 2; pScr->frameX1 = pScr->frameX0 + pScr->currentMode->HDisplay - 1; @@ -213,7 +213,7 @@ xf86ZoomViewport (ScreenPtr pScreen, int zoom) pScr->frameX1 = pScr->frameX0 + pScr->currentMode->HDisplay - 1; } - pScr->frameY0 = (pScr->frameY1 + pScr->frameY0 - + pScr->frameY0 = (pScr->frameY1 + pScr->frameY0 + 1 - pScr->currentMode->VDisplay) / 2; pScr->frameY1 = pScr->frameY0 + pScr->currentMode->VDisplay - 1; diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c b/xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c index 6072ed15f..82a4dc8f7 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.5 2000/09/19 12:46:13 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.6 2001/05/10 10:17:39 alanh Exp $ */ /* * Copyright (c) 1997-1998 by The XFree86 Project, Inc. @@ -49,9 +49,9 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags) pDPMS->Flags = flags; DPMSOpt = xf86FindOption(xf86Screens[pScreen->myNum]->options, "dpms"); if (DPMSOpt) { - if (pDPMS->Enabled + if ((pDPMS->Enabled = xf86SetBoolOption(xf86Screens[pScreen->myNum]->options, - "dpms",FALSE) + "dpms",FALSE)) && !DPMSDisabledSwitch) DPMSEnabled = TRUE; xf86MarkOptionUsed(DPMSOpt); diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Events.c b/xc/programs/Xserver/hw/xfree86/common/xf86Events.c index 2c68e4bc3..948dcda91 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.108 2001/04/20 16:32:30 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.109 2001/05/18 16:03:10 tsi Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -299,7 +299,10 @@ ProcessInputEvents () extern u_char SpecialServerMap[]; #endif -#if !defined(__EMX__) && !defined(__SOL8__) && !defined(__CYGWIN__) +#if !defined(__EMX__) && \ + !defined(__SOL8__) && \ + (!defined(sun) || defined(i386)) && \ + !defined(__CYGWIN__) void xf86PostKbdEvent(unsigned key) { diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Globals.c b/xc/programs/Xserver/hw/xfree86/common/xf86Globals.c index 19a8bc4a0..3bf520503 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Globals.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Globals.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.29 2001/03/05 20:18:19 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.32 2001/05/18 16:03:11 tsi Exp $ */ /* * Copyright (c) 1997 by The XFree86 Project, Inc. @@ -137,9 +137,9 @@ xf86InfoRec xf86Info = { #if defined(i386) || defined(__i386__) FALSE, /* pc98 */ #endif - FALSE, /* kbdCustomKeycodes */ TRUE, /* pmFlag */ - 0 /* estimateSizesAggressively */ + 0, /* estimateSizesAggressively */ + FALSE /* kbdCustomKeycodes */ }; const char *xf86ConfigFile = NULL; const char *xf86ModulePath = DEFAULT_MODULE_PATH; @@ -159,6 +159,8 @@ DriverPtr *xf86DriverList = NULL; int xf86NumDrivers = 0; InputDriverPtr *xf86InputDriverList = NULL; int xf86NumInputDrivers = 0; +ModuleInfoPtr *xf86ModuleInfoList = NULL; +int xf86NumModuleInfos = 0; #endif int xf86NumScreens = 0; diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c b/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c index fd7ce942f..abaae4a0b 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.109 2001/01/06 20:19:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.111.2.1 2001/05/24 19:43:39 dawes Exp $ */ /* * Copyright (c) 1997-1998 by The XFree86 Project, Inc. @@ -69,6 +69,7 @@ xf86DeleteDriver(int drvIndex) && (!xf86DriverHasEntities(xf86DriverList[drvIndex]))) { if (xf86DriverList[drvIndex]->module) UnloadModule(xf86DriverList[drvIndex]->module); + xfree(xf86DriverList[drvIndex]); xf86DriverList[drvIndex] = NULL; } } @@ -100,8 +101,39 @@ xf86DeleteInputDriver(int drvIndex) { if (xf86InputDriverList[drvIndex] && xf86InputDriverList[drvIndex]->module) UnloadModule(xf86InputDriverList[drvIndex]->module); + xfree(xf86InputDriverList[drvIndex]); xf86InputDriverList[drvIndex] = NULL; } + +void +xf86AddModuleInfo(ModuleInfoPtr info, pointer module) +{ + /* Don't add null entries */ + if (!module) + return; + + if (xf86ModuleInfoList == NULL) + xf86NumModuleInfos = 0; + + xf86NumModuleInfos++; + xf86ModuleInfoList = xnfrealloc(xf86ModuleInfoList, + xf86NumModuleInfos * sizeof(ModuleInfoPtr)); + xf86ModuleInfoList[xf86NumModuleInfos - 1] = xnfalloc(sizeof(ModuleInfoRec)); + *xf86ModuleInfoList[xf86NumModuleInfos - 1] = *info; + xf86ModuleInfoList[xf86NumModuleInfos - 1]->module = module; + xf86ModuleInfoList[xf86NumModuleInfos - 1]->refCount = 0; +} + +void +xf86DeleteModuleInfo(int idx) +{ + if (xf86ModuleInfoList[idx]) { + if (xf86ModuleInfoList[idx]->module) + UnloadModule(xf86ModuleInfoList[idx]->module); + xfree(xf86ModuleInfoList[idx]); + xf86ModuleInfoList[idx] = NULL; + } +} #endif @@ -947,8 +979,8 @@ xf86SetRootClip (ScreenPtr pScreen, BOOL enable) WindowPtr pWin = WindowTable[pScreen->myNum]; WindowPtr pChild; Bool WasViewable = (Bool)(pWin->viewable); - Bool anyMarked; - RegionPtr pOldClip, bsExposed; + Bool anyMarked = FALSE; + RegionPtr pOldClip = NULL, bsExposed; #ifdef DO_SAVE_UNDERS Bool dosave = FALSE; #endif @@ -1336,8 +1368,10 @@ xf86LogInit() if ((logfile = fopen(xf86LogFile, "w")) == NULL) FatalError("Cannot open log file \"%s\"\n", xf86LogFile); setvbuf(logfile, NULL, _IONBF, 0); +#ifdef DDXOSVERRORF if (!OsVendorVErrorFProc) OsVendorVErrorFProc = OsVendorVErrorF; +#endif /* Flush saved log information */ if (saveBuffer && size > 0) { @@ -2000,7 +2034,6 @@ xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int), { register int status = vertsyncreg; unsigned long i, cnt, rcnt, sync; - int saved_nice; /* First save registers that get written on */ (*ClockFunc)(pScrn, CLK_REG_SAVE); @@ -2389,21 +2422,20 @@ typedef enum { OPTION_BACKING_STORE } BSOpts; -static OptionInfoRec BSOptions[] = { +static const OptionInfoRec BSOptions[] = { { OPTION_BACKING_STORE, "BackingStore", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; -#define nBSOptions (sizeof(BSOptions) / sizeof(BSOptions[0])) - void xf86SetBackingStore(ScreenPtr pScreen) { Bool useBS = FALSE; MessageType from = X_DEFAULT; ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - OptionInfoRec options[nBSOptions]; + OptionInfoPtr options; + options = xnfalloc(sizeof(BSOptions)); (void)memcpy(options, BSOptions, sizeof(BSOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); @@ -2418,6 +2450,7 @@ xf86SetBackingStore(ScreenPtr pScreen) if (xf86GetOptValBool(options, OPTION_BACKING_STORE, &useBS)) from = X_CONFIG; } + xfree(options); pScreen->backingStoreSupport = useBS ? Always : NotUseful; if (serverGeneration == 1) xf86DrvMsg(pScreen->myNum, from, "Backing store %s\n", @@ -2429,21 +2462,20 @@ typedef enum { OPTION_SILKEN_MOUSE } SMOpts; -static OptionInfoRec SMOptions[] = { +static const OptionInfoRec SMOptions[] = { { OPTION_SILKEN_MOUSE, "SilkenMouse", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; -#define nSMOptions (sizeof(SMOptions) / sizeof(SMOptions[0])) - void xf86SetSilkenMouse (ScreenPtr pScreen) { Bool useSM = TRUE; MessageType from = X_DEFAULT; ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - OptionInfoRec options[nSMOptions]; + OptionInfoPtr options; + options = xnfalloc(sizeof(SMOptions)); (void)memcpy(options, SMOptions, sizeof(SMOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); @@ -2462,6 +2494,7 @@ xf86SetSilkenMouse (ScreenPtr pScreen) if (xf86GetOptValBool(options, OPTION_SILKEN_MOUSE, &useSM)) from = X_CONFIG; } + xfree(options); /* * XXX quick hack to report correctly for OSs that can't do SilkenMouse * yet. Should handle this differently so that alternate async methods diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Init.c b/xc/programs/Xserver/hw/xfree86/common/xf86Init.c index 687366e66..857c2d59a 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Init.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Init.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.175 2001/02/08 23:36:26 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.176.2.1 2001/05/24 19:43:39 dawes Exp $ */ /* * Copyright 1991-1999 by The XFree86 Project, Inc. @@ -1146,6 +1146,7 @@ ddxProcessArgument(int argc, char **argv, int i) * yet. Use malloc/free instead. */ +#ifdef DDXOSVERRORF static Bool beenHere = FALSE; if (!beenHere) { @@ -1156,6 +1157,7 @@ ddxProcessArgument(int argc, char **argv, int i) OsVendorVErrorFProc = OsVendorVErrorF; beenHere = TRUE; } +#endif /* First the options that are only allowed for root */ if (getuid() == 0) @@ -1574,6 +1576,11 @@ xf86PrintBanner() ErrorF(".%d", XF86_VERSION_SNAP); #endif +#if XF86_VERSION_SNAP >= 900 + ErrorF(" (%d.%d.0 RC %d)", XF86_VERSION_MAJOR, XF86_VERSION_MINOR + 1, + XF86_VERSION_SNAP - 900); +#endif + #ifdef XF86_CUSTOM_VERSION ErrorF(" (%s)", XF86_CUSTOM_VERSION); #endif @@ -1584,7 +1591,7 @@ xf86PrintBanner() ErrorF("\tIf the server is older than 6-12 months, or if your card is\n" "\tnewer than the above date, look for a newer version before\n" "\treporting problems. (See http://www.XFree86.Org/FAQ)\n"); - ErrorF("Operating System:%s%s\n", OSNAME, OSVENDOR); + ErrorF("Build Operating System:%s%s\n", OSNAME, OSVENDOR); #if defined(BUILDERSTRING) ErrorF("%s \n",BUILDERSTRING); #endif diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h b/xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h index 71883403b..11a750494 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h,v 3.14 2001/03/08 23:23:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h,v 3.15 2001/05/01 22:31:30 alanh Exp $ */ /* * * For Scancodes see notes in atKeynames.h !!!! @@ -138,7 +138,7 @@ static KeySym map[NUM_KEYCODES * GLYPHS_PER_KEY] = { /* 0x7f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, }; -#if !defined(Lynx) && !defined(AMOEBA) && !defined(MINIX) && !defined(__OSF__) && !defined(__EMX__) && !defined(__mips__) && !defined(linux) && !defined(CSRG_BASED) +#if !defined(Lynx) && !defined(AMOEBA) && !defined(MINIX) && !defined(__OSF__) && !defined(__EMX__) && !defined(__mips__) && !defined(linux) && !defined(CSRG_BASED) && !defined(__CYGWIN__) static KeySym map84[NUM_KEYCODES * GLYPHS_PER_KEY] = { /* 0x00 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol, /* 0x01 */ XK_Escape, NoSymbol, NoSymbol, NoSymbol, diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c b/xc/programs/Xserver/hw/xfree86/common/xf86Mode.c index a16bed340..c431e6b06 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.39 2001/03/22 03:51:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.40 2001/05/10 10:17:39 alanh Exp $ */ /* * Copyright (c) 1997,1998 by The XFree86 Project, Inc. @@ -1718,7 +1718,7 @@ void xf86PrintModes(ScrnInfoPtr scrp) { DisplayModePtr p; - float hsync, refresh; + float hsync, refresh = 0; char *desc, *desc2, *prefix; if (scrp == NULL) diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Opt.h b/xc/programs/Xserver/hw/xfree86/common/xf86Opt.h index 85c47b5ba..dc5c2ca67 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Opt.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Opt.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.11 2001/03/13 16:03:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.12 2001/05/04 19:05:30 dawes Exp $ */ /* Option handling things that ModuleSetup procs can use */ @@ -63,17 +63,17 @@ Bool xf86CheckIfOptionUsed(pointer option); Bool xf86CheckIfOptionUsedByName(pointer options, const char *name); void xf86ShowUnusedOptions(int scrnIndex, pointer options); void xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo); -OptionInfoPtr xf86TokenToOptinfo(OptionInfoPtr table, int token); -const char *xf86TokenToOptName(OptionInfoPtr table, int token); -Bool xf86IsOptionSet(OptionInfoPtr table, int token); -char *xf86GetOptValString(OptionInfoPtr table, int token); -Bool xf86GetOptValInteger(OptionInfoPtr table, int token, int *value); -Bool xf86GetOptValULong(OptionInfoPtr table, int token, unsigned long *value); -Bool xf86GetOptValReal(OptionInfoPtr table, int token, double *value); -Bool xf86GetOptValFreq(OptionInfoPtr table, int token, +OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int token); +const char *xf86TokenToOptName(const OptionInfoRec *table, int token); +Bool xf86IsOptionSet(const OptionInfoRec *table, int token); +char *xf86GetOptValString(const OptionInfoRec *table, int token); +Bool xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value); +Bool xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value); +Bool xf86GetOptValReal(const OptionInfoRec *table, int token, double *value); +Bool xf86GetOptValFreq(const OptionInfoRec *table, int token, OptFreqUnits expectedUnits, double *value); -Bool xf86GetOptValBool(OptionInfoPtr table, int token, Bool *value); -Bool xf86ReturnOptValBool(OptionInfoPtr table, int token, Bool def); +Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value); +Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def); int xf86NameCmp(const char *s1, const char *s2); char *xf86NormalizeName(const char *s); pointer xf86ReplaceIntOption(pointer optlist, char *name, int val); diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Option.c b/xc/programs/Xserver/hw/xfree86/common/xf86Option.c index 4944d8062..aa30b70ae 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Option.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Option.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.22 2001/03/13 16:03:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.23 2001/05/04 19:05:30 dawes Exp $ */ /* * Copyright (c) 1998 by The XFree86 Project, Inc. @@ -573,9 +573,9 @@ xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo) OptionInfoPtr -xf86TokenToOptinfo(OptionInfoPtr table, int token) +xf86TokenToOptinfo(const OptionInfoRec *table, int token) { - OptionInfoPtr p; + const OptionInfoRec *p; for (p = table; p->token >= 0 && p->token != token; p++) ; @@ -583,14 +583,14 @@ xf86TokenToOptinfo(OptionInfoPtr table, int token) if (p->token < 0) return NULL; else - return p; + return (OptionInfoPtr)p; } const char * -xf86TokenToOptName(OptionInfoPtr table, int token) +xf86TokenToOptName(const OptionInfoRec *table, int token) { - OptionInfoPtr p; + const OptionInfoRec *p; p = xf86TokenToOptinfo(table, token); return p->name; @@ -598,7 +598,7 @@ xf86TokenToOptName(OptionInfoPtr table, int token) Bool -xf86IsOptionSet(OptionInfoPtr table, int token) +xf86IsOptionSet(const OptionInfoRec *table, int token) { OptionInfoPtr p; @@ -608,7 +608,7 @@ xf86IsOptionSet(OptionInfoPtr table, int token) char * -xf86GetOptValString(OptionInfoPtr table, int token) +xf86GetOptValString(const OptionInfoRec *table, int token) { OptionInfoPtr p; @@ -621,7 +621,7 @@ xf86GetOptValString(OptionInfoPtr table, int token) Bool -xf86GetOptValInteger(OptionInfoPtr table, int token, int *value) +xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value) { OptionInfoPtr p; @@ -635,7 +635,7 @@ xf86GetOptValInteger(OptionInfoPtr table, int token, int *value) Bool -xf86GetOptValULong(OptionInfoPtr table, int token, unsigned long *value) +xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value) { OptionInfoPtr p; @@ -649,7 +649,7 @@ xf86GetOptValULong(OptionInfoPtr table, int token, unsigned long *value) Bool -xf86GetOptValReal(OptionInfoPtr table, int token, double *value) +xf86GetOptValReal(const OptionInfoRec *table, int token, double *value) { OptionInfoPtr p; @@ -663,8 +663,8 @@ xf86GetOptValReal(OptionInfoPtr table, int token, double *value) Bool -xf86GetOptValFreq(OptionInfoPtr table, int token, OptFreqUnits expectedUnits, - double *value) +xf86GetOptValFreq(const OptionInfoRec *table, int token, + OptFreqUnits expectedUnits, double *value) { OptionInfoPtr p; @@ -711,7 +711,7 @@ xf86GetOptValFreq(OptionInfoPtr table, int token, OptFreqUnits expectedUnits, Bool -xf86GetOptValBool(OptionInfoPtr table, int token, Bool *value) +xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value) { OptionInfoPtr p; @@ -725,7 +725,7 @@ xf86GetOptValBool(OptionInfoPtr table, int token, Bool *value) Bool -xf86ReturnOptValBool(OptionInfoPtr table, int token, Bool def) +xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def) { OptionInfoPtr p; diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h b/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h index fce49fa81..6cd064971 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.95 2001/04/17 20:46:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.98 2001/05/11 07:56:10 alanh Exp $ */ /* * PCI Probe * @@ -239,6 +239,7 @@ #define PCI_CHIP_RADEON_QE 0x5145 #define PCI_CHIP_RADEON_QF 0x5146 #define PCI_CHIP_RADEON_QG 0x5147 +#define PCI_CHIP_RADEON_VE 0x5159 #define PCI_CHIP_RAGE128RE 0x5245 #define PCI_CHIP_RAGE128RF 0x5246 #define PCI_CHIP_RAGE128RG 0x5247 @@ -408,7 +409,8 @@ #define PCI_CHIP_SIS300 0x0300 #define PCI_CHIP_SIS630 0x6300 #define PCI_CHIP_SIS540 0x5300 - +/* Agregado por Carlos Duclos & Manuel Jander */ +#define PCI_CHIP_SIS82C204 0x0204 /* HP */ #define PCI_CHIP_J2585A 0x1030 #define PCI_CHIP_J2585B 0x1031 @@ -830,6 +832,7 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = { {PCI_CHIP_RADEON_QE, "Radeon QE",0}, {PCI_CHIP_RADEON_QF, "Radeon QF",0}, {PCI_CHIP_RADEON_QG, "Radeon QG",0}, + {PCI_CHIP_RADEON_VE, "Radeon VE",0}, {PCI_CHIP_RAGE128RE, "Rage 128 RE",0}, {PCI_CHIP_RAGE128RF, "Rage 128 RF",0}, {PCI_CHIP_RAGE128RK, "Rage 128 RK",0}, @@ -997,6 +1000,7 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = { {PCI_CHIP_SIS300, "300",0}, {PCI_CHIP_SIS630, "630",0}, {PCI_CHIP_SIS540, "540",0}, + {PCI_CHIP_SIS82C204, "82C204",0}, {0x0000, NULL,0}}}, #ifdef VENDOR_INCLUDE_NONVIDEO {PCI_VENDOR_HP, { diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h b/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h index 8a8d22ea2..eb1639617 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.70 2001/04/05 17:42:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.72 2001/05/15 18:22:21 paulo Exp $ */ /* * Copyright (c) 1997 by The XFree86 Project, Inc. @@ -70,6 +70,8 @@ extern int xf86NumMouseTypes; #ifdef XFree86LOADER extern DriverPtr *xf86DriverList; +extern ModuleInfoPtr *xf86ModuleInfoList; +extern int xf86NumModuleInfos; #else extern DriverPtr xf86DriverList[]; #endif @@ -125,7 +127,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/xf86Privstr.h b/xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h index 578ec9ce7..6e3f63388 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.24 2001/04/20 16:32:30 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.25 2001/05/18 16:03:11 tsi Exp $ */ /* * Copyright (c) 1997,1998 by The XFree86 Project, Inc. @@ -12,8 +12,8 @@ #ifndef _XF86PRIVSTR_H #define _XF86PRIVSTR_H -#include "Xproto.h" #include "xf86Pci.h" +#include "xf86str.h" /* PCI probe flags */ diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Resources.h b/xc/programs/Xserver/hw/xfree86/common/xf86Resources.h index ebc288393..9d37f2c26 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Resources.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Resources.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.11 2000/07/11 16:14:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.11.4.1 2001/05/28 14:23:37 eich Exp $ */ #ifndef _XF86_RESOURCES_H @@ -80,16 +80,16 @@ {ResShrIoSparse | ResBios | ResBus, 0x02E8, 0x03F8} /* predefined resources */ -extern resRange resVgaExclusive[]; -extern resRange resVgaShared[]; -extern resRange resVgaIoShared[]; -extern resRange resVgaMemShared[]; -extern resRange resVgaUnusedExclusive[]; -extern resRange resVgaUnusedShared[]; -extern resRange resVgaSparseExclusive[]; -extern resRange resVgaSparseShared[]; -extern resRange res8514Exclusive[]; -extern resRange res8514Shared[]; +extern const resRange resVgaExclusive[]; +extern const resRange resVgaShared[]; +extern const resRange resVgaIoShared[]; +extern const resRange resVgaMemShared[]; +extern const resRange resVgaUnusedExclusive[]; +extern const resRange resVgaUnusedShared[]; +extern const resRange resVgaSparseExclusive[]; +extern const resRange resVgaSparseShared[]; +extern const resRange res8514Exclusive[]; +extern const resRange res8514Shared[]; /* Less misleading aliases for xf86SetOpratingState() */ #define resVgaMem resVgaMemShared diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c b/xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c index fc5f79c4b..71cb0052f 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.10 2001/02/15 20:31:52 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.12 2001/05/06 21:59:07 mvojkovi Exp $ */ /* * This file contains the VidMode functions required by the extension. @@ -544,6 +544,41 @@ VidModeGetGamma(int scrnIndex, float *red, float *green, float *blue) return TRUE; } +Bool +VidModeSetGammaRamp(int scrnIndex, int size, CARD16 *r, CARD16 *g, CARD16 *b) +{ + ScrnInfoPtr pScrn; + + if (!VidModeAvailable(scrnIndex)) + return FALSE; + + pScrn = xf86Screens[scrnIndex]; + xf86ChangeGammaRamp(pScrn->pScreen, size, r, g, b); + return TRUE; +} + +Bool +VidModeGetGammaRamp(int scrnIndex, int size, CARD16 *r, CARD16 *g, CARD16 *b) +{ + ScrnInfoPtr pScrn; + + if (!VidModeAvailable(scrnIndex)) + return FALSE; + + pScrn = xf86Screens[scrnIndex]; + xf86GetGammaRamp(pScrn->pScreen, size, r, g, b); + return TRUE; +} + +int +VidModeGetGammaRampSize(int scrnIndex) +{ + if (!VidModeAvailable(scrnIndex)) + return 0; + + return xf86GetGammaRampSize(xf86Screens[scrnIndex]->pScreen); +} + pointer VidModeCreateMode(void) { diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86cmap.c b/xc/programs/Xserver/hw/xfree86/common/xf86cmap.c index 46b54e697..3b9596982 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86cmap.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86cmap.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.20 2001/02/15 20:31:53 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.22 2001/05/06 21:59:07 mvojkovi Exp $ */ #ifdef _XOPEN_SOURCE #include <math.h> @@ -925,6 +925,148 @@ CMapChangeGamma( } +static void +ComputeGammaRamp ( + CMapScreenPtr priv, + unsigned short *red, + unsigned short *green, + unsigned short *blue +){ + int elements = priv->gammaElements; + LOCO *entry = priv->gamma; + int shift = 16 - priv->sigRGBbits; + + while(elements--) { + entry->red = *(red++) >> shift; + entry->green = *(green++) >> shift; + entry->blue = *(blue++) >> shift; + entry++; + } +} + +int +xf86ChangeGammaRamp( + ScreenPtr pScreen, + int size, + unsigned short *red, + unsigned short *green, + unsigned short *blue +){ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + CMapColormapPtr pColPriv; + CMapScreenPtr pScreenPriv; + CMapLinkPtr pLink; + + if(CMapScreenIndex == -1) + return BadImplementation; + + pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr; + if(!pScreenPriv) + return BadImplementation; + + if(pScreenPriv->gammaElements != size) + return BadValue; + + ComputeGammaRamp(pScreenPriv, red, green, blue); + + /* mark all colormaps on this screen */ + pLink = pScreenPriv->maps; + while(pLink) { + pColPriv = + (CMapColormapPtr) pLink->cmap->devPrivates[CMapColormapIndex].ptr; + pColPriv->recalculate = TRUE; + pLink = pLink->next; + } + + if(miInstalledMaps[pScreen->myNum] && + ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) || + pScrn->vtSema || pScreenPriv->isDGAmode)) { + ColormapPtr pMap = miInstalledMaps[pScreen->myNum]; + + if(!(pScreenPriv->flags & CMAP_PALETTED_TRUECOLOR) && + (pMap->pVisual->class == TrueColor) && + ((1 << pMap->pVisual->nplanes) > pScreenPriv->maxColors)) { + + /* if the current map doesn't have a palette look + for another map to change the gamma on. */ + + pLink = pScreenPriv->maps; + while(pLink) { + if(pLink->cmap->pVisual->class == PseudoColor) + break; + pLink = pLink->next; + } + + if(pLink) { + /* need to trick CMapRefreshColors() into thinking + this is the currently installed map */ + miInstalledMaps[pScreen->myNum] = pLink->cmap; + CMapReinstallMap(pLink->cmap); + miInstalledMaps[pScreen->myNum] = pMap; + } + } else + CMapReinstallMap(pMap); + } + + return Success; +} + +int +xf86GetGammaRampSize(ScreenPtr pScreen) +{ + CMapScreenPtr pScreenPriv; + + if(CMapScreenIndex == -1) return 0; + + pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr; + if(!pScreenPriv) return 0; + + return pScreenPriv->gammaElements; +} + +int +xf86GetGammaRamp( + ScreenPtr pScreen, + int size, + unsigned short *red, + unsigned short *green, + unsigned short *blue +){ + CMapScreenPtr pScreenPriv; + LOCO *entry; + int shift, sigbits; + + if(CMapScreenIndex == -1) + return BadImplementation; + + pScreenPriv = (CMapScreenPtr)pScreen->devPrivates[CMapScreenIndex].ptr; + if(!pScreenPriv) + return BadImplementation; + + if(size > pScreenPriv->gammaElements) + return BadValue; + + entry = pScreenPriv->gamma; + sigbits = pScreenPriv->sigRGBbits; + + while(size--) { + *red = entry->red << (16 - sigbits); + *green = entry->green << (16 - sigbits); + *blue = entry->blue << (16 - sigbits); + shift = sigbits; + while(shift < 16) { + *red |= *red >> shift; + *green |= *green >> shift; + *blue |= *blue >> shift; + shift += sigbits; + } + red++; green++; blue++; + entry++; + } + + return Success; +} + int xf86ChangeGamma( ScreenPtr pScreen, diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86cmap.h b/xc/programs/Xserver/hw/xfree86/common/xf86cmap.h index 8dd5986e2..b871d6762 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86cmap.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86cmap.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.h,v 1.6 2000/05/11 18:14:28 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.h,v 1.7 2001/05/06 00:49:12 mvojkovi Exp $ */ #ifndef _XF86CMAP_H #define _XF86CMAP_H @@ -38,5 +38,25 @@ xf86ChangeGamma( Gamma newGamma ); +int +xf86ChangeGammaRamp( + ScreenPtr pScreen, + int size, + unsigned short *red, + unsigned short *green, + unsigned short *blue +); + +int xf86GetGammaRampSize(ScreenPtr pScreen); + +int +xf86GetGammaRamp( + ScreenPtr pScreen, + int size, + unsigned short *red, + unsigned short *green, + unsigned short *blue +); + #endif /* _XF86CMAP_H */ diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86fbman.c b/xc/programs/Xserver/hw/xfree86/common/xf86fbman.c index ab039b51b..253c9aba9 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86fbman.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86fbman.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.21 2001/02/15 20:31:53 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.22 2001/05/10 10:17:39 alanh Exp $ */ #include "misc.h" #include "xf86.h" @@ -917,7 +917,7 @@ localResizeOffscreenLinear(FBLinearPtr resize, int length) extents = REGION_EXTENTS(pScreen, offman->InitialBoxes); pitch = extents->x2 - extents->x1; - if(length < w) { /* special case */ + if(length < pitch) { /* special case */ w = length; h = 1; } else { diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c b/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c index f74d0d8b3..9b1e3f000 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.39 2001/04/01 14:00:08 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.42 2001/05/16 07:56:06 alanh Exp $ */ /* * Copyright (c) 1997-1999 by The XFree86 Project, Inc. @@ -406,7 +406,8 @@ FindPCIVideoInfo(void) xf86ErrorF("unknown chipset (0x%04x) ", info->chipType); xf86ErrorF("rev %d", info->chipRev); for (i = 0; i < 6; i++) { - if (info->memBase[i]) { + if (info->memBase[i] && + (info->memBase[i] < (memType)(-1 << info->size[i]))) { if (!memdone) { xf86ErrorF(", Mem @ "); memdone = TRUE; @@ -416,7 +417,8 @@ FindPCIVideoInfo(void) } } for (i = 0; i < 6; i++) { - if (info->ioBase[i]) { + if (info->ioBase[i] && + (info->ioBase[i] < (memType)(-1 << info->size[i]))) { if (!iodone) { xf86ErrorF(", I/O @ "); iodone = TRUE; @@ -425,6 +427,10 @@ FindPCIVideoInfo(void) xf86ErrorF("0x%04x/%d", info->ioBase[i], info->size[i]); } } + if (info->biosBase && + (info->biosBase < (memType)(-1 << info->biosSize))) + xf86ErrorF(", BIOS @ 0x%08x/%d", + info->biosBase, info->biosSize); xf86ErrorF("\n"); } } @@ -819,12 +825,14 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes) resMisc |= ResEstimated; for (i = 0; i < 6; i++) { - if (pvp->ioBase[i]) { + if (pvp->ioBase[i] && + (pvp->ioBase[i] < (memType)(-1 << pvp->size[i]))) { PV_I_RANGE(range,pvp,i,ResExcIoBlock | resMisc); tmp = xf86AddResToList(NULL, &range, -1); removeOverlapsWithBridges(pvp->bus,tmp); *res = xf86JoinResLists(tmp,*res); - } else if (pvp->memBase[i]) { + } else if (pvp->memBase[i] && + (pvp->memBase[i] < (memType)(-1 << pvp->size[i]))) { PV_M_RANGE(range, pvp,i, ResExcMemBlock | resMisc); tmp = xf86AddResToList(NULL, &range, -1); removeOverlapsWithBridges(pvp->bus,tmp); @@ -834,7 +842,8 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes) /* FIXME!!!: Don't use BIOS resources for overlap * checking but reserve them! */ - if (pvp->biosBase) { + if (pvp->biosBase && + (pvp->biosBase < (memType)(-1 << pvp->biosSize))) { PV_B_RANGE(range, pvp, ResExcMemBlock | resMisc); tmp = xf86AddResToList(NULL, &range, -1); removeOverlapsWithBridges(pvp->bus,tmp); @@ -1185,13 +1194,12 @@ fixPciResource(int prt, memType alignment, pciVideoPtr pvp, long type) xf86FreeResList(w_2nd); xf86FreeResList(avoid); return TRUE; - } else { + } #ifdef DEBUG - ErrorF("removing old resource\n"); + ErrorF("removing old resource\n"); #endif - orgAcc = Acc; - Acc = AccTmp; - } + orgAcc = Acc; + Acc = AccTmp; #else orgAcc = xf86DupResList(Acc); pAcc = &Acc; @@ -1374,7 +1382,127 @@ xf86ReallocatePciResources(int entityIndex, resPtr pRes) /* * BIOS releated */ +memType +getValidBIOSBase(PCITAG tag, int num) +{ + pciVideoPtr pvp = NULL; + PciBusPtr pbp, pbp1; + resPtr m = NULL; + resPtr tmp, avoid; + resRange range; + memType ret; + int n = 0; + CARD32 biosSize, alignment; + + if (!xf86PciVideoInfo) return 0; + + while ((pvp = xf86PciVideoInfo[n++])) { + if (pciTag(pvp->bus,pvp->device,pvp->func) == tag) + break; + } + if (!pvp) return 0; + + biosSize = pvp->biosSize; + alignment = (1 << biosSize) - 1; + if (biosSize > 24) + biosSize = 24; + + switch ((romBaseSource)num) { + case ROM_BASE_PRESET: + return 0; /* This should not happen */ + case ROM_BASE_BIOS: + /* In some cases the BIOS base register contains the size mask */ + if ((memType)(-1 << biosSize) == PCIGETROM(pvp->biosBase)) + return 0; + P_M_RANGE(range, TAG(pvp),pvp->biosBase,biosSize,ResExcMemBlock); + ret = pvp->biosBase; + break; + case ROM_BASE_MEM0: + case ROM_BASE_MEM1: + case ROM_BASE_MEM2: + case ROM_BASE_MEM3: + case ROM_BASE_MEM4: + case ROM_BASE_MEM5: + if (!pvp->memBase[num] || (pvp->size[n] < biosSize)) + return 0; + P_M_RANGE(range, TAG(pvp),pvp->memBase[num],biosSize, + ResExcMemBlock); + ret = pvp->memBase[num]; + break; + case ROM_BASE_FIND: + ret = 0; + break; + default: + return 0; /* This should not happen */ + } + + /* Now find the ranges for validation */ + avoid = xf86DupResList(pciAvoidRes); + pbp = pbp1 = xf86PciBus; + while (pbp) { + if (pbp->secondary == pvp->bus) { + if (pbp->preferred_pmem) + tmp = xf86DupResList(pbp->preferred_pmem); + else + tmp = xf86DupResList(pbp->pmem); + m = xf86JoinResLists(m,tmp); + if (pbp->preferred_mem) + tmp = xf86DupResList(pbp->preferred_mem); + else + tmp = xf86DupResList(pbp->mem); + m = xf86JoinResLists(m,tmp); + tmp = m; + while (tmp) { + tmp->block_end = MIN(tmp->block_end,PCI_MEM32_LENGTH_MAX); + tmp = tmp->next; + } + } + while (pbp1) { + if (pbp1->primary == pvp->bus) { + tmp = xf86DupResList(pbp1->preferred_pmem); + avoid = xf86JoinResLists(avoid,tmp); + tmp = xf86DupResList(pbp1->pmem); + avoid = xf86JoinResLists(avoid,tmp); + tmp = xf86DupResList(pbp1->preferred_mem); + avoid = xf86JoinResLists(avoid,tmp); + tmp = xf86DupResList(pbp1->mem); + avoid = xf86JoinResLists(avoid,tmp); + } + pbp1 = pbp1->next; + } + pbp = pbp->next; + } + pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid); + + if (!ret) { + /* + * Return a possible window. Note that this doesn't deal with + * host bridges yet. But the fix for that belongs elsewhere. + */ + while (m) { + range = xf86GetBlock(ResExcMemBlock, + PCI_SIZE(ResMem, TAG(pvp), 1 << biosSize), + m->block_begin, m->block_end, + PCI_SIZE(ResMem, TAG(pvp), alignment), + avoid); + if (range.type != ResEnd) { + ret = M2B(TAG(pvp), range.rBase); + break; + } + m = m->next; + } + } else { + if (!xf86IsSubsetOf(range, m) || + ChkConflict(&range, avoid, SETUP)) + ret = 0; + } + + xf86FreeResList(avoid); + xf86FreeResList(m); + return ret; +} +#if 0 memType getValidBIOSBase(PCITAG tag, int *num) { @@ -1436,7 +1564,9 @@ getValidBIOSBase(PCITAG tag, int *num) } pciConvertListToHost(pvp->bus,pvp->device,pvp->func, avoid); - if (pvp->biosBase) { /* try biosBase first */ + if (pvp->biosBase && + (pvp->biosBase < (memType)(-1 << pvp->biosSize))) { + /* try biosBase first */ P_M_RANGE(range, TAG(pvp),pvp->biosBase,biosSize,ResExcMemBlock); if (xf86IsSubsetOf(range,m) && ! ChkConflict(&range,avoid,SETUP)) { xf86FreeResList(avoid); @@ -1498,6 +1628,7 @@ getValidBIOSBase(PCITAG tag, int *num) return 0; } +#endif /* * xf86Bus.c interface @@ -1566,24 +1697,24 @@ get_sun_apb_ranges(PciBusPtr PciBus, pciConfigPtr pcrp) iomap = pciReadByte(pcrp->tag, APB_IO_ADDRESS_MAP); memmap = pciReadByte(pcrp->tag, APB_MEM_ADDRESS_MAP); - /* if (pcrp->pci_command & PCI_CMD_IO_ENABLE) */ { /* ??? */ + if (pcrp->pci_command & PCI_CMD_IO_ENABLE) { for (i = 0; i < 8; i++) { if ((iomap & (1 << i)) != 0) { PCI_I_RANGE(range, pcrp->tag, (i << 21), (i << 21) + ((1 << 21) - 1), ResIo | ResBlock | ResExclusive); - PciBus->io = xf86AddResToList(PciBus->io, &range, -1); + PciBus->preferred_io = xf86AddResToList(PciBus->preferred_io, &range, -1); } } } - /* if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) */ { /* ??? */ + if (pcrp->pci_command & PCI_CMD_MEM_ENABLE) { for (i = 0; i < 8; i++) { if ((memmap & (1 << i)) != 0) { PCI_M_RANGE(range, pcrp->tag, (i << 29), (i << 29) + ((1 << 29) - 1), ResMem | ResBlock | ResExclusive); - PciBus->mem = xf86AddResToList(PciBus->mem, &range, -1); + PciBus->preferred_mem = xf86AddResToList(PciBus->preferred_mem, &range, -1); } } } @@ -1923,6 +2054,10 @@ ValidatePci(void) Sys = xf86AddResToList(Sys, &range, -1); } } +#ifdef DEBUG + xf86MsgVerb(X_INFO, 3,"Sys:\n"); + xf86PrintResList(3,Sys); +#endif /* * The order the video devices are listed in is diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86str.h b/xc/programs/Xserver/hw/xfree86/common/xf86str.h index b5739aa60..23c873391 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.76 2001/04/10 16:07:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.79 2001/05/18 23:35:31 dawes Exp $ */ /* * Copyright (c) 1997-2000 by The XFree86 Project, Inc. @@ -218,11 +218,27 @@ typedef struct _DriverRec { char * driverName; void (*Identify)(int flags); Bool (*Probe)(struct _DriverRec *drv, int flags); - OptionInfoPtr (*AvailableOptions)(int chipid, int bustype); + const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype); pointer module; int refCount; } DriverRec, *DriverPtr; +#ifdef XFree86LOADER +/* + * The optional module list struct. This allows modules exporting helping + * functions to configuration tools, the Xserver, or any other + * application/module interested in such information. + */ +typedef struct _ModuleInfoRec { + int moduleVersion; + char * moduleName; + pointer module; + int refCount; + const OptionInfoRec * (*AvailableOptions)(void *unused); + pointer unused[8]; /* leave some space for more fields */ +} ModuleInfoRec, *ModuleInfoPtr; +#endif + /* * These are the private bus types. New types can be added here. Types * required for the public interface should be added to xf86str.h, with diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86xv.c b/xc/programs/Xserver/hw/xfree86/common/xf86xv.c index 70d5aa482..d029c872c 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86xv.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86xv.c @@ -6,7 +6,7 @@ */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.c,v 1.28 2000/08/05 03:32:37 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.c,v 1.29 2001/05/07 21:59:05 tsi Exp $ */ #include "misc.h" #include "xf86.h" @@ -176,10 +176,14 @@ xf86XVScreenInit( XF86VideoAdaptorPtr *adaptors, int num ){ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn; XF86XVScreenPtr ScreenPriv; XvScreenPtr pxvs; + if(num <= 0 || + !XvGetScreenIndexProc || !XvGetRTPortProc || !XvScreenInitProc) + return FALSE; + if(XF86XVGeneration != serverGeneration) { if((XF86XVWindowIndex = AllocateWindowPrivateIndex()) < 0) return FALSE; @@ -189,9 +193,6 @@ xf86XVScreenInit( if(!AllocateWindowPrivate(pScreen,XF86XVWindowIndex,sizeof(XF86XVWindowRec))) return FALSE; - if(!XvGetScreenIndexProc || !XvGetRTPortProc || !XvScreenInitProc) - return FALSE; - if(Success != (*XvScreenInitProc)(pScreen)) return FALSE; XF86XvScreenIndex = (*XvGetScreenIndexProc)(); @@ -199,7 +200,6 @@ xf86XVScreenInit( pxvs = GET_XV_SCREEN(pScreen); - /* Anyone initializing the Xv layer must provide these two. The Xv di layer calls them without even checking if they exist! */ @@ -216,6 +216,7 @@ xf86XVScreenInit( if(!ScreenPriv) return FALSE; + pScrn = xf86Screens[pScreen->myNum]; ScreenPriv->CreateWindow = pScreen->CreateWindow; ScreenPriv->DestroyWindow = pScreen->DestroyWindow; @@ -225,7 +226,6 @@ xf86XVScreenInit( ScreenPriv->LeaveVT = pScrn->LeaveVT; ScreenPriv->AdjustFrame = pScrn->AdjustFrame; - pScreen->CreateWindow = xf86XVCreateWindow; pScreen->DestroyWindow = xf86XVDestroyWindow; pScreen->WindowExposures = xf86XVWindowExposures; diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86xv.h b/xc/programs/Xserver/hw/xfree86/common/xf86xv.h index 45fd72540..3756ea91d 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86xv.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86xv.h @@ -1,7 +1,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.20 2001/03/05 04:48:22 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.21 2001/05/07 21:59:06 tsi Exp $ */ -#ifndef _XVDIX_H_ -#define _XVDIX_H_ +#ifndef _XF86XV_H_ +#define _XF86XV_H_ #include "xvdix.h" #include "xf86str.h" @@ -254,5 +254,4 @@ typedef struct _XF86XVWindowRec{ struct _XF86XVWindowRec *next; } XF86XVWindowRec, *XF86XVWindowPtr; -#endif /* _XVDIX_H_ */ - +#endif /* _XF86XV_H_ */ diff --git a/xc/programs/Xserver/hw/xfree86/ddc/print_edid.c b/xc/programs/Xserver/hw/xfree86/ddc/print_edid.c index 02309aeb8..e5e5a22b8 100644 --- a/xc/programs/Xserver/hw/xfree86/ddc/print_edid.c +++ b/xc/programs/Xserver/hw/xfree86/ddc/print_edid.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.14 2000/07/13 21:31:38 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.14.4.1 2001/05/22 17:02:36 tsi Exp $ */ /* print_edid.c: print out all information retrieved from display device * @@ -232,7 +232,7 @@ print_detailed_monitor_section(int scrnIndex, m[i].section.ranges.min_v, m[i].section.ranges.max_v, m[i].section.ranges.min_h, m[i].section.ranges.max_h); if (m[i].section.ranges.max_clock != 0) - xf86ErrorF(" PixClock max %i kHz\n",m[i].section.ranges.max_clock); + xf86ErrorF(" PixClock max %i MHz\n",m[i].section.ranges.max_clock); else xf86DrvMsg(scrnIndex,X_INFO,"\n"); break; diff --git a/xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c b/xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c index 816a3cb56..fd4e98579 100644 --- a/xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c +++ b/xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.19 2000/11/16 19:44:55 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.20.2.1 2001/05/25 21:45:00 paulo Exp $ */ /* xf86DDC.c * @@ -10,6 +10,8 @@ #include "xf86_OSproc.h" #include "xf86DDC.h" +static const OptionInfoRec *DDCAvailableOptions(void *unused); + const char *i2cSymbols[] = { "xf86CreateI2CDevRec", "xf86I2CDevInit", @@ -38,6 +40,14 @@ static XF86ModuleVersionInfo ddcVersRec = XF86ModuleData ddcModuleData = { &ddcVersRec, ddcSetup, NULL }; +ModuleInfoRec DDC = { + 1, + "DDC", + NULL, + 0, + DDCAvailableOptions, +}; + static pointer ddcSetup(pointer module, pointer opts, int *errmaj, int *errmin) { @@ -45,6 +55,10 @@ ddcSetup(pointer module, pointer opts, int *errmaj, int *errmin) if (!setupDone) { setupDone = TRUE; +#ifndef REMOVE_LOADER_CHECK_MODULE_INFO + if (xf86LoaderCheckSymbol("xf86AddModuleInfo")) +#endif + xf86AddModuleInfo(&DDC, module); /* * Tell the loader about symbols from other modules that this module * might refer to. @@ -112,14 +126,19 @@ typedef enum { DDCOPT_NODDC } DDCOpts; -static OptionInfoRec DDCOptions[] = { +static const OptionInfoRec DDCOptions[] = { { DDCOPT_NODDC1, "NoDDC1", OPTV_BOOLEAN, {0}, FALSE }, { DDCOPT_NODDC2, "NoDDC2", OPTV_BOOLEAN, {0}, FALSE }, { DDCOPT_NODDC, "NoDDC", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE }, }; -#define nDDCOptions (sizeof(DDCOptions) / sizeof(DDCOptions[0])) +/*ARGSUSED*/ +static const OptionInfoRec * +DDCAvailableOptions(void *unused) +{ + return (DDCOptions); +} xf86MonPtr xf86DoEDID_DDC1( @@ -133,13 +152,15 @@ xf86DoEDID_DDC1( int sigio; /* Default DDC and DDC1 to enabled. */ Bool noddc = FALSE, noddc1 = FALSE; - OptionInfoRec options[nDDCOptions]; + OptionInfoPtr options; + options = xnfalloc(sizeof(DDCOptions)); (void)memcpy(options, DDCOptions, sizeof(DDCOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); xf86GetOptValBool(options, DDCOPT_NODDC, &noddc); xf86GetOptValBool(options, DDCOPT_NODDC1, &noddc1); + xfree(options); if (noddc || noddc1) return NULL; @@ -168,13 +189,15 @@ xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus) xf86MonPtr tmp = NULL; /* Default DDC and DDC2 to enabled. */ Bool noddc = FALSE, noddc2 = FALSE; - OptionInfoRec options[nDDCOptions]; + OptionInfoPtr options; + options = xnfalloc(sizeof(DDCOptions)); (void)memcpy(options, DDCOptions, sizeof(DDCOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); xf86GetOptValBool(options, DDCOPT_NODDC, &noddc); xf86GetOptValBool(options, DDCOPT_NODDC2, &noddc2); + xfree(options); if (noddc || noddc2) return NULL; diff --git a/xc/programs/Xserver/hw/xfree86/doc/DESIGN b/xc/programs/Xserver/hw/xfree86/doc/DESIGN index 9bd7e9cee..72f4c8755 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/DESIGN +++ b/xc/programs/Xserver/hw/xfree86/doc/DESIGN @@ -2,7 +2,7 @@ The XFree86 Project, Inc - Last modified 2 December 2000 + Last modified 1 May 2001 NOTE: This is a DRAFT document, and the interfaces described here are subject to change without notice. @@ -2100,13 +2100,14 @@ Next, the higher level functions that most drivers would use. ScreenInit() function, but only when serverGeneration == 1. - OptionInfoPtr xf86TokenToOptinfo(OptionInfoPtr table, int token) + OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int + token) Returns a pointer to the OptionInfoRec in table with a token field matching token. Returns NULL if no match is found. - Bool xf86IsOptionSet(OptionInfoPtr table, int token) + Bool xf86IsOptionSet(const OptionInfoRec *table, int token) Returns the found field of the OptionInfoRec in table with a token field matching token. This can be used for @@ -2115,13 +2116,13 @@ Next, the higher level functions that most drivers would use. mine the value of the option. Returns FALSE if no match is found. - char *xf86GetOptValString(OptionInfoPtr table, int token) + char *xf86GetOptValString(const OptionInfoRec *table, int token) Returns the value.str field of the OptionInfoRec in table with a token field matching token. Returns NULL if no match is found. - Bool xf86GetOptValInteger(OptionInfoPtr table, int token, + Bool xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value) @@ -2132,21 +2133,21 @@ Next, the higher level functions that most drivers would use. tion. The function return value is as for xf86IsOption- Set(). - Bool xf86GetOptValULong(OptionInfoPtr table, int token, + Bool xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value) Like xf86GetOptValInteger(), except the value is treated as an unsigned long. - Bool xf86GetOptValReal(OptionInfoPtr table, int token, + Bool xf86GetOptValReal(const OptionInfoRec *table, int token, double *value) Like xf86GetOptValInteger(), except that value.realnum is used. - Bool xf86GetOptValFreq(OptionInfoPtr table, int token, + Bool xf86GetOptValFreq(const OptionInfoRec *table, int token, OptFreqUnits expectedUnits, double *value) @@ -2161,7 +2162,8 @@ Next, the higher level functions that most drivers would use. "10000" and expectedUnits is OPTUNITS_MHZ, the value returned is 10. - Bool xf86GetOptValBool(OptionInfoPtr table, int token, Bool *value) + Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool + *value) This function is used to check boolean options (OPTV_BOOLEAN). If the function return value is FALSE, @@ -2176,7 +2178,8 @@ Next, the higher level functions that most drivers would use. present. It should normally be set to a default value before calling this function. - Bool xf86ReturnOptValBool(OptionInfoPtr table, int token, Bool def) + Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, + Bool def) This function is used to check boolean options (OPTV_BOOLEAN). If the option is set, its value is @@ -4905,7 +4908,15 @@ WRec. They are defined in vgaHW.h. fields of hwp with the standard VGA set of functions. This is called by vgaHWGetHWRec(), so there is usually no need to call this explicitly. The register access func- - tions are described below. + tions are described below. If the registers are shadowed + in some other port I/O space (for example a PCI I/O + region), these functions can be used to access the shad- + owed registers if hwp->PIOOffset is initialised with off- + set, calculated in such a way that when the standard VGA + I/O port value is added to it the correct offset into the + PIO area results. This value is initialised to zero in + vgaHWGetHWRec(). (Note: the PIOOffset functionality is + present in XFree86 4.1.0 and later.) void vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset) @@ -4977,6 +4988,16 @@ WRec. They are defined in vgaHW.h. vgahw module is not loaded (for example, in the Chip- Probe() function). + void vgaHWEnable(vgaHWPtr hwp) + + This function enables the VGA subsystem. (Note, this + function is present in XFree86 4.1.0 and later.). + + void vgaHWDisable(vgaHWPtr hwp) + + This function disables the VGA subsystem. (Note, this + function is present in XFree86 4.1.0 and later.). + void vgaHWSave(ScrnInfoPtr pScrn, vgaRegPtr save, int flags) This function saves the VGA state. The state is written @@ -5236,6 +5257,17 @@ VGA access. The access functions are described here. Return the value read from the DAC Data register. + CARD8 readEnable(vgaHWptr hwp) + + Return the value read from the VGA Enable register. + (Note: This function is present in XFree86 4.1.0 and + later.) + + void writeEnable(vgaHWPtr hwp, CARD8 value) + + Write value to the VGA Enable register. (Note: This + function is present in XFree86 4.1.0 and later.) + 20. Some notes about writing a driver NOTE: some parts of this are not up to date @@ -5433,6 +5465,7 @@ Drivers must NOT include the following: Bool noAccel; Bool hwCursor; CloseScreenProcPtr CloseScreen; + OptionInfoPtr Options; ... } ZZZRec, *ZZZPtr; @@ -5447,7 +5480,7 @@ Drivers must NOT include the following: OPTION_NOACCEL } ZZZOpts; - static OptionInfoRec ZZZOptions[] = { + static const OptionInfoRec ZZZOptions[] = { { OPTION_FOO_HACK, "FooHack", OPTV_INTEGER, {0}, FALSE }, { OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, @@ -5455,8 +5488,6 @@ Drivers must NOT include the following: { -1, NULL, OPTV_NONE, {0}, FALSE } }; - #define nZZZOptions (sizeof(ZZZOptions) / sizeof(ZZZOptions[0])) - 20.3 Functions 20.3.1 SetupProc @@ -5704,8 +5735,6 @@ NOTES: static Bool ZZZPreInit(ScrnInfoPtr pScrn, int flags) { - OptionInfoRec options[nZZZOptions]; - /* Fill in the monitor field */ pScrn->monitor = pScrn->confScreen->monitor; @@ -5784,10 +5813,14 @@ NOTES: /* * Process the options based on the information in ZZZOptions. - * The results are written to options. + * The results are written to pZzz->Options. If all of the options + * processing is done within this function a local variable "options" + * can be used instead of pZzz->Options. */ - (void)memcpy(options, ZZZOptions, sizeof(ZZZOptions)); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); + if (!(pZzz->Options = xalloc(sizeof(ZZZOptions)))) + return FALSE; + (void)memcpy(pZzz->Options, ZZZOptions, sizeof(ZZZOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pZzz->Options); /* * Set various fields of ScrnInfoRec and/or ZZZRec based on @@ -5795,25 +5828,25 @@ NOTES: */ from = X_DEFAULT; pZzz->hwCursor = FALSE; - if (xf86IsOptionSet(options, OPTION_HW_CURSOR)) { + if (xf86IsOptionSet(pZzz->Options, OPTION_HW_CURSOR)) { from = X_CONFIG; pZzz->hwCursor = TRUE; } xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pZzz->hwCursor ? "HW" : "SW"); - if (xf86IsOptionSet(options, OPTION_NOACCEL)) { + if (xf86IsOptionSet(pZzz->Options, OPTION_NOACCEL)) { pZzz->noAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } else { pZzz->noAccel = FALSE; } - if (xf86IsOptionSet(options, OPTION_PCI_RETRY)) { + if (xf86IsOptionSet(pZzz->Options, OPTION_PCI_RETRY)) { pZzz->UsePCIRetry = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n"); } pZzz->fooHack = 0; - if (xf86GetOptValInteger(options, OPTION_FOO_HACK, + if (xf86GetOptValInteger(pZzz->Options, OPTION_FOO_HACK, &pZzz->fooHack)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Foo Hack set to %d\n", pZzz->fooHack); @@ -6302,7 +6335,7 @@ eScreen() function. ZZZFreeRec(xf86Screens[scrnIndex]); } - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.40 2000/12/27 04:57:08 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.44 2001/05/19 00:40:30 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/DESIGN,v 1.35 2001/01/21 21:53:25 tsi Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/DESIGN,v 1.36.2.1 2001/06/01 18:26:42 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/Imakefile b/xc/programs/Xserver/hw/xfree86/doc/Imakefile index a0ffbbf17..8c0b4350f 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.75 2001/03/02 02:45:37 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/Imakefile,v 3.76.2.1 2001/06/01 18:09:46 dawes Exp $ #include <Server.tmpl> #include <lnxdoc.rules> @@ -76,7 +76,7 @@ HWREADME = \ /*ReadmeFile(WstDig)*/ \ $(_NULLENTRY_) -MAINDOCS = LICENSE README /*ReadmeFile(Config)*/ /*BUILD*/ RELNOTES \ +MAINDOCS = LICENSE README /*ReadmeFile(Config)*/ /*BUILD*/ /*RELNOTES*/ \ Install Status DESIGN Versions OTHERDOCS = /*VideoModes.doc*/ /*QuickStart.doc*/ /*xinput*/ \ @@ -85,7 +85,7 @@ OTHERDOCS = /*VideoModes.doc*/ /*QuickStart.doc*/ /*xinput*/ \ #endif MISCDOCS = ServersOnly /*LbxproxyOnly*/ $(REPORTFORM) ReadmeFile(DGA) \ - VideoBoard98 + VideoBoard98 ReadmeFile(rapidaccess) DATABASE = /* modeDB.txt */ /* AccelCards Monitors Devices */ diff --git a/xc/programs/Xserver/hw/xfree86/doc/Install b/xc/programs/Xserver/hw/xfree86/doc/Install index 7846ad0f2..fc1a90ca9 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/Install +++ b/xc/programs/Xserver/hw/xfree86/doc/Install @@ -1,8 +1,8 @@ - Installation Details for XFree86[tm] 4.0.2 + Installation Details for XFree86[tm] 4.1.0 The XFree86 Project, Inc - 15 December 2000 + 1 June 2001 Abstract @@ -20,10 +20,10 @@ 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 +2. Downloading the XFree86 4.1.0 binaries -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 +We provide XFree86 4.1.0 binaries for a range of operating systems at our ftp +site <URL:ftp://ftp.xfree86.org/pub/XFree86/4.1.0/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 @@ -43,31 +43,46 @@ 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 -you try to run it, then it is most likely because the script wasn't down- -loaded in binary mode. Some web browsers won't do this for files of that -name, so we also have a copy of it called "Xinstall.bin", and most browsers -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". +NOTES: + + o 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 you try to run it, then it is most likely because the script wasn't + downloaded in binary mode. Some web browsers won't do this for files of + that name, so we also have a copy of it called "Xinstall.bin", and most + browsers 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". + + o The Xinstall.sh script requires some system commands and utilities to + function correctly. While most systems will have these, some Linux + installations may not. If you find that the script is failing because + of some missing system command, you will need to install it before you + can continue. If you don't know how to do this, then we recommend that + you obtain this version of XFree86 from your Operating System distribu- + tor. + + o Always use the version of the Xinstall.sh script that's provided with + the release you're installing. Older versions of the script may not + install newer releases correctly. 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) mandatory files for all installations are listed below. If you have not downloaded all of the files, the installer script will complain. - 1. Xinstall.sh The installer script - 2. extract The utility for extracting tarballs - 3. Xbin.tgz X clients/utilities and run-time libraries - 4. Xlib.tgz Some data files required at run-time - 5. Xman.tgz Manual pages - 6. Xdoc.tgz XFree86 documentation - 7. Xfnts.tgz Base set of fonts - 8. Xfenc.tgz Base set of font encoding data - 9. Xetc.tgz Run-time configuration files - 10. Xvar.tgz Run-time data - 11. Xxserv.tgz XFree86 X server - 12. Xmod.tgz XFree86 X server modules + 1. Xinstall.sh The installer script + 2. extract The utility for extracting tarballs + 3. Xbin.tgz X clients/utilities and run-time libraries + 4. Xlib.tgz Some data files required at run-time + 5. Xman.tgz Manual pages + 6. Xdoc.tgz XFree86 documentation + 7. Xfnts.tgz Base set of fonts + 8. Xfenc.tgz Base set of font encoding data + 9. Xetc.tgz Run-time configuration files + 10. Xvar.tgz Run-time data + 11. Xxserv.tgz XFree86 X server + 12. Xmod.tgz XFree86 X server modules NOTES: @@ -86,22 +101,20 @@ NOTES: o Some distributions may have additional mandatory tarballs. While rare, the installer script will tell you if any are missing. -The following thirteen (13) tarballs are optional. You should download the +The following eleven (11) tarballs are optional. You should download the ones you want to install. - 1. Xfsrv.tgz Font server - 2. Xnest.tgz Nested X server - 3. Xprog.tgz X header files, config files and compile-time libs - 4. Xprt.tgz X Print server - 5. Xvfb.tgz Virtual framebuffer X server - 6. Xf100.tgz 100dpi fonts - 7. Xfcyr.tgz Cyrillic fonts - 8. Xflat2.tgz Latin-2 fonts - 9. Xfnon.tgz Some large bitmap fonts - 10. Xfscl.tgz Scalable fonts (Speedo and Type1) - 11. Xhtml.tgz HTML version of the documentation - 12. Xps.tgz PostScript version of the documentation - 13. Xjdoc.tgz Documentation in Japanese + 1. Xfsrv.tgz Font server + 2. Xnest.tgz Nested X server + 3. Xprog.tgz X header files, config files and compile-time libs + 4. Xprt.tgz X Print server + 5. Xvfb.tgz Virtual framebuffer X server + 6. Xf100.tgz 100dpi fonts + 7. Xfcyr.tgz Cyrillic fonts + 8. Xfscl.tgz Scalable fonts (Speedo and Type1) + 9. Xhtml.tgz HTML version of the documentation + 10. Xps.tgz PostScript version of the documentation + 11. Xjdoc.tgz Documentation in Japanese NOTES: @@ -110,9 +123,9 @@ NOTES: If you miss some and want to install them later, go to the Manual Installa- tion (section 4., page 1) section. -3. Installing XFree86 4.0.2 using the Xinstall.sh script +3. Installing XFree86 4.1.0 using the Xinstall.sh script -We strongly recommend that our XFree86 4.0.2 binaries be installed using the +We strongly recommend that our XFree86 4.1.0 binaries be installed using the Xinstall.sh script that we provide. There are a lot of steps in the manual installation process, and those steps can vary according to the platform and hardware setup. There is a description of the manual installation process @@ -229,7 +242,7 @@ later that you need it, you can create it easily by running: 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 three ways to cre- -ate a basic X server configuration file for XFree86 4.0.2. One is to run the +ate a basic X server configuration file for XFree86 4.1.0. 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: @@ -248,9 +261,9 @@ old XF86_* and/or XF98_* X server binaries from /usr/X11R6/bin. After the X server configuration is done, it may be advisable to reboot, especially if you run xdm (or equivalent) or the font server (xfs). -4. Installing XFree86 4.0.2 manually +4. Installing XFree86 4.1.0 manually -This section describes how to manually install the XFree86 4.0.2 binary dis- +This section describes how to manually install the XFree86 4.1.0 binary dis- tributions. You should only use this method if you know what you're doing. The information here covers some common cases, but not every possible case. @@ -288,6 +301,7 @@ tion procedure for this case is as follows: ln -s /etc/X11/xinit /usr/X11R6/lib/X11 ln -s /etc/X11/xsm /usr/X11R6/lib/X11 ln -s /etc/X11/xserver /usr/X11R6/lib/X11 + chmod ug-w /usr/X11R6/lib # Make sure the permissions are OK /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 @@ -347,11 +361,12 @@ Once that's done, the main part of the installation can be done: ./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 + chmod ug-w /usr/X11R6/lib # Make sure the permissions are OK /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.11 2001/03/02 17:40:48 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml,v 1.11.2.2 2001/06/01 18:09:48 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/Install,v 1.11 2001/03/02 17:47:52 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/Install,v 1.11.2.1 2001/06/01 18:26:43 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/LICENSE b/xc/programs/Xserver/hw/xfree86/doc/LICENSE index c6890edc3..993d4d700 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/LICENSE +++ b/xc/programs/Xserver/hw/xfree86/doc/LICENSE @@ -595,4 +595,4 @@ For further information, contact: Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/LICENSE.sgml,v 1.8 2001/03/16 22:13:19 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/LICENSE,v 1.12 2001/03/25 05:42:43 tsi Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/LICENSE,v 1.12.2.1 2001/06/01 18:26:43 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/OS2.Notes b/xc/programs/Xserver/hw/xfree86/doc/OS2.Notes index b39511bee..d28e99232 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/OS2.Notes +++ b/xc/programs/Xserver/hw/xfree86/doc/OS2.Notes @@ -226,4 +226,4 @@ Well, you see, this was quite easy :-) $XConsortium: OS2note.sgml /main/1 1996/02/24 10:08:59 kaleb $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/OS2.Notes,v 3.17 2000/12/01 19:47:45 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/OS2.Notes,v 3.17.4.1 2001/06/01 18:26:43 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README b/xc/programs/Xserver/hw/xfree86/doc/README index ffc669ceb..76ac496f1 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README +++ b/xc/programs/Xserver/hw/xfree86/doc/README @@ -1,8 +1,8 @@ - README for XFree86[tm] 4.0.2 + README for XFree86[tm] 4.1.0 The XFree86 Project, Inc - 15 December 2000 + 2 June 2001 Abstract @@ -10,9 +10,9 @@ supports several UNIX(R) and UNIX-like (such as Linux, the BSDs and Solaris x86) operating systems on Intel and other platforms. -1. What is XFree86 4.0.2? +1. What is XFree86 4.1.0? -XFree86 4.0.2 is the third full release in the new XFree86 4 series. +XFree86 4.1.0 is the fourth full release in the 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. @@ -25,7 +25,7 @@ installing the new driver module and updating the configuration file. 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 +base release. The 4.1.0 version is an upgrade to 4.0.3, which include more hardware ports, code enhancements and bug fixes. Release 4 also included the long-awaited integration of the DRI (Direct Ren- @@ -38,8 +38,6 @@ 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. - The XFree86 version numbering system has had some changes as of the 4.0.2 release. Information about this can be found in the Versions Document. @@ -116,38 +114,47 @@ Once your work is finished (coded, debugged and documented) please send your fix to <fixes@XFree86.org>. This will ensure that they are included in future releases. And thanks! You make this truly an Open group. -4. How to get XFree86 4.0.2 +4. How to get XFree86 4.1.0 -XFree86 4.0.2 can be found at the XFree86 ftp server -<URL:ftp://ftp.xfree86.org/pub/XFree86/4.0.2/>, and at mirrors of this +XFree86 4.1.0 can be found at the XFree86 ftp server +<URL:ftp://ftp.xfree86.org/pub/XFree86/4.1.0/>, and at mirrors of this server. Information about obtaining and installing binary distributions of this release can be found in the Installation Document. Information about obtaining the release in source form is given below. -The source for version 4.0.2 is split into three tarballs: X402src-1.tgz, -X402src-2.tgz, X402src-3.tgz. The first contains everything except the fonts -and general X11 documentation. It is sufficient for building XFree86 is you +The source for version 4.1.0 is split into three tarballs: X410src-1.tgz, +X410src-2.tgz, X410src-3.tgz. The first contains everything except the fonts +and general X11 documentation. It is sufficient for building XFree86 if you already have a set of fonts. The second contains the fonts and the source 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 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 +A source patch relative to version 4.0.2 is also available. Because of its +size, it is split into four parts. The patch files are 4.0.2-4.1.0.diff1.gz, +4.0.2-4.1.0.diff2.gz, 4.0.2-4.1.0.diff3.gz and 4.0.2-4.1.0.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- +included in a diff. It is 4.1.0.tgz. These patches should be applied to a +clean 4.0.2 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 + gzip -d < 4.0.2-4.1.0.diff1.gz | patch -p0 -E + gzip -d < 4.0.2-4.1.0.diff2.gz | patch -p0 -E + gzip -d < 4.0.2-4.1.0.diff3.gz | patch -p0 -E + gzip -d < 4.0.2-4.1.0.diff4.gz | patch -p0 -E + + rm -f xc/programs/xieperf/images/image.012 + rm -fr xc/fonts/bdf/latin2 + rm -fr xc/fonts/bdf/100dpi + rm -fr xc/fonts/bdf/75dpi + + gzip -d < 4.1.0.tgz | tar vxf - - gzip -d < 4.0.2.tgz | tar vxf - +Patches might also be available relative to 4.0.3. If so, the instructions +for applying them are the same, except that you should start with a clean +4.0.3 source tree. -The contrib part of the distribution has been folded into the main source -tree, so a separate contrib tarball is no longer required. +The contrib part of the distribution was folded into the main source tree a +while ago, so a separate contrib tarball is not required. To format the XFree86 documentation use the latest version of our doctools package available as doctools-1.2.tgz. @@ -161,7 +168,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.113 2001/03/16 22:13:19 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.113.2.3 2001/06/02 16:17:40 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README,v 3.111 2001/03/25 05:42:43 tsi Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README,v 3.111.2.3 2001/06/02 16:21:49 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.DECtga b/xc/programs/Xserver/hw/xfree86/doc/README.DECtga index b48be24d2..d734dfcda 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.DECtga +++ b/xc/programs/Xserver/hw/xfree86/doc/README.DECtga @@ -6,7 +6,7 @@ 1. DEC 21030 - o The DEC 21030 is supported by XFree86 4.0.2. The driver is now par- + o The DEC 21030 is supported by XFree86 4.1.0. The driver is now par- tially accelerated. The built-in graphics on the Multia is supported in 8-plane mode, and PCI cards with 8 or 16 MB framebuffers are supported in 24-plane mode. TGA2 (aka PowerStorm 3D30/4D20) cards are not cur- @@ -65,4 +65,4 @@ Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DECtga.sgml,v 3.9 2000/03/06 22:59:23 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DECtga,v 3.17 2000/12/01 19:47:46 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DECtga,v 3.17.4.1 2001/06/01 18:26:43 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.DRI b/xc/programs/Xserver/hw/xfree86/doc/README.DRI index 5509f502b..0d3f897f4 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.DRI +++ b/xc/programs/Xserver/hw/xfree86/doc/README.DRI @@ -2,7 +2,7 @@ VA Linux Systems, Inc. Professional Services - Graphics. - 15 March 2001 + 3 May 2001 1. Preamble @@ -114,21 +114,20 @@ graphics hardware: o ATI Rage 128, supported on Intel x86 and AMD: - o Rage Fury AGP + o Rage Fury - o Rage Magnum AGP + o Rage Magnum - o XPERT 2000 AGP + o XPERT 2000 - o XPERT 128 AGP + o XPERT 128 - o XPERT 99 AGP + o XPERT 99 - o All-in-Wonder 128 AGP + o All-in-Wonder 128 - The PCI versions of these cards also have minimal support. Note that - there are Rage 128 Pro boards on the market but they're not yet sup- - ported. + Note that both PCI and AGP versions of Rage 128 based cards are sup- + ported at this time. o ATI Radeon, supported on Intel x86 and AMD: @@ -563,7 +562,7 @@ bleshooting. 10.1 3dfx Banshee, Voodoo3, Voodoo4 and Voodoo5 Series -10.1.1 Dependencies +10.1.1 Requirements The 3dfx DRI driver requires special versions of the 3dfx Glide library. Different versions of Glide are needed for Banshee/Voodoo3 than for @@ -659,7 +658,7 @@ A software-based accumulation buffer is available in both 16 and 32bpp modes. acceleration is not supported in that mode. 32bpp mode is fully 3D accelerated. -10.1.4 Performance +10.1.4 Performance and Features o Normally, buffer swapping in double-buffered applications is synchro- nized to your monitor's refresh rate. This may be overridden by setting @@ -727,6 +726,9 @@ A software-based accumulation buffer is available in both 16 and 32bpp modes. o The lowest mipmap level is sometimes miscolored in trilinear- sampled polygons. + o The GL_EXT_texture_env_combine extension is supported on the Voodoo4 and + Voodoo5. + 10.1.5 Known Problems o The lowest mipmap level is sometimes miscolored in trilinear- sampled @@ -745,11 +747,9 @@ A software-based accumulation buffer is available in both 16 and 32bpp modes. 10.2 Intel i810 -10.2.1 Dependencies +10.2.1 Requirements -A Linux kernel with AGP GART support is required. The 2.2.x kernel series -does not have AGP GART support. The 2.4.x test kernels have AGP GART and -have been tested with the i810. +A kernel with AGP GART support (such as Linux 2.4.x) is needed. 10.2.2 Configuration @@ -800,12 +800,31 @@ ules/dri/i810_dri.so. This will be automatically loaded by libGL.so. too little memory is available for DMA buffers, back and depth buffers and textures, direct rendering will be disabled. +10.2.4 Performance and Features + +Basically all of the i810 features which can be exposed through OpenGL 1.2 +are implemented. However, the following OpenGL features are implemented in +software and will be slow: + + o Stencil buffer and accumulation buffer operations + + o Blend subtract, min/max and logic op blend modes + + o glColorMask when any mask is set to false + + o GL_SEPARATE_SPECULAR_COLOR lighting mode + + o glDrawBuffer(GL_FRONT_AND_BACK) + + o Using 1D or 3D textures + + o Using texture borders + 10.3 Matrox G200 and G400 -10.3.1 Dependencies +10.3.1 Requirements -A Linux kernel with AGP GART support (such as the 2.4.x test kernels) is -needed. +A kernel with AGP GART support (such as Linux 2.4.x) is needed. 10.3.2 Configuration @@ -855,7 +874,7 @@ by the Xserver if needed. The DRI 3D driver for the G200/G400 should be in /usr/X11R6/lib/mod- ules/dri/mga_dri.so. This will be automatically loaded by libGL.so. -10.3.3 Performance +10.3.3 Performance and Features Software rendering will be used under any of the following conditions: @@ -878,7 +897,7 @@ Software rendering will be used under any of the following conditions: The AGP mode may be set to 1, 2, or 4. One is used by default. Higher AGP speeds may result in unreliable performance depending on your motherboard. -Compaq has funded the implementation of AGP acclerated ReadPixels and Draw- +Compaq has funded the implementation of AGP accelerated ReadPixels and Draw- Pixels in this driver. With this implementation, on a G400 drawing directly from AGP memory (exported to the client), throughput of up to 1 GB/sec has been measured. @@ -938,10 +957,9 @@ None. 10.4 ATI Rage 128 -10.4.1 Dependencies +10.4.1 Requirements -A Linux kernel with AGP GART support (such as the 2.4.x test kernels) is -needed. +A kernel with AGP GART support (such as Linux 2.4.x) is needed. 10.4.2 Configuration @@ -983,7 +1001,7 @@ ules/dri/r128_dri.so. This will be automatically loaded by libGL.so. You may also set your screen depth to 32 for 32bpp mode. -10.4.3 Performance +10.4.3 Performance and Features While PCI Rage 128 based cards are supported, they do not yet support PCI GART, so they will not perform as well as their AGP counterparts. @@ -992,6 +1010,22 @@ For AGP cards, the AGP mode may be set to 1, 2, or 4. One is used by default. Higher AGP speeds may result in unreliable performance depending on your motherboard. +Note that even at 32bpp there is no alpha channel. + +The following OpenGL features are implemented in software and will be slow: + + o Stencil buffer and accumulation buffer operations + + o Blend subtract, min/max and logic op blend modes + + o GL_SEPARATE_SPECULAR_COLOR lighting mode + + o glDrawBuffer(GL_FRONT_AND_BACK) + + o Using 1D or 3D textures + + o Using texture borders + 10.4.4 Known Problems If you experience stability problems you may try setting the UseCCEFor2D @@ -1000,10 +1034,9 @@ Performance will be degraded, of course. 10.5 ATI Radeon -10.5.1 Dependencies +10.5.1 Requirements -A Linux kernel with AGP GART support (such as the 2.4.x test kernels) is -needed. +A kernel with AGP GART support (such as Linux 2.4.x) is needed. 10.5.2 Configuration @@ -1044,7 +1077,7 @@ ules/dri/radeon_dri.so. This will be automatically loaded by libGL.so. You may also set your screen depth to 32 for 32bpp mode. -10.5.3 Performance +10.5.3 Performance and Features While this driver supports many of the features of ATI Radeon cards, we do not yet fully support the card's TCL features. This work is progressing, but @@ -1053,9 +1086,38 @@ is not yet ready. The AGP mode may be set to 1, 2, or 4. One is used by default. Higher AGP speeds may result in unreliable performance depending on your motherboard. +The following OpenGL features are implemented in software and will be slow: + + o Blend subtract, blend min/max and blend logicops + + o Stencil and accumulation operations + + o 1D and 3D textures + + o Texture borders + +The GL_EXT_texture_env_combine, GL_EXT_texture_env_add and GL_EXT_tex- +ture_env_dot3 extensions are supported (or will be soon supported in the new +driver based on Mesa 3.5). + +We hope to implement support for the following features in the future: + + o Vertex transformation, clipping and lighting (TCL) + + o Hardware stencil buffer + + o Cube map textures + + o 3D textures + + o Three texture units + 10.5.4 Known Problems -None. +Certain (early?) revisions of the AMD Irongate chipset have AGPGART problems +which effect Radeon, and other graphics cards. The card may work unreliably, +or not work at all. If the DRM kernel module is not loaded, the 2D Xserver +may work. There's hope that this can be fixed in the future. 10.6 3DLabs Oxygen GMX 2000 @@ -1069,8 +1131,8 @@ oped or supported. The following OpenGL features are not supported at this time: overlays, stereo, hardware-accelerated indirect rendering. -OpenGL-like functionality is provided with the Mesa library. XFree86 4.0.2 -uses Mesa 3.4. Subsequent releases of XFree86 will use newer versions of +OpenGL-like functionality is provided with the Mesa library. XFree86 4.1.0 +uses Mesa 3.4.2. Subsequent releases of XFree86 will use newer versions of Mesa. When newer versions of Mesa are available, the 3D drivers can be updated without reinstalling XFree86 or libGL.so. @@ -1144,8 +1206,7 @@ has already been reported and perhaps fixed. 12.1 Software A collection of useful configuration files, libraries, headers, utilities and -demo programs is available from http://dri.source- -forge.net/resources/resources.html +demo programs is available from http://dri.sourceforge.net/res.phtml 12.2 Documentation @@ -1170,7 +1231,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.21 2001/04/10 16:07:58 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.24 2001/05/19 00:42:22 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.15 2001/04/10 16:44:31 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.16.2.1 2001/06/01 18:26:43 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp b/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp index c37706cf9..ae1f31e12 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp +++ b/xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp @@ -2,7 +2,7 @@ VA Linux Systems, Inc. Professional Services - Graphics. - 15 March 2001 + 21 April 2001 1. Preamble @@ -137,7 +137,8 @@ Here are the basic steps for kernel setup. o Go to Character devices o Disable Direct Rendering Manager (XFree86 DRI support) since we'll - use the DRI module from the XFree86/DRI tree. + use the DRI code from the XFree86/DRI tree and will compile it + there. o Go to /dev/agpgart (AGP Support) (EXPERIMENTAL) (NEW) @@ -424,7 +425,7 @@ headers. This can be fixed by explicitly setting the value of TREE. If the path to your kernel source is /usr/src/linux-2.4.x, cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel - make TREE=/usr/src/linux-2.4 + make TREE=/usr/src/linux-2.4.x/include or alternatively, edit Makefile to include this change. @@ -437,7 +438,7 @@ first. The DRI kernel modules are in ~/DRI-CVS/build/xc/pro- grams/Xserver/hw/xfree86/os-support/linux/drm/kernel/. -To load the appropriate DRI module in your running kernel you can either use +To load the appropriate DRM module in your running kernel you can either use ismod and restart your X server or copy the kernel module to /lib/mod- ules/2.4.x/kernel/drivers/char/drm/ then run depmod and restart your X server. @@ -445,6 +446,8 @@ server. Make sure you first unload any older DRI kernel modules that might be already loaded. +Note that some DRM modules require that the agpgart module be loaded first. + 9. Normal Installation and Configuration Most users will want to install the new X server and use it instead of the @@ -595,7 +598,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.13 2001/04/05 19:29:42 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.14 2001/05/02 15:06:08 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.9 2001/04/10 16:44:31 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.10.2.1 2001/06/01 18:26:43 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.Darwin b/xc/programs/Xserver/hw/xfree86/doc/README.Darwin index c3d118175..ad3950e04 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.Darwin +++ b/xc/programs/Xserver/hw/xfree86/doc/README.Darwin @@ -2,7 +2,7 @@ Torrey T. Lyons - 11 December 2000 + 25 May 2001 1. Introduction @@ -14,19 +14,31 @@ 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/. +XFree86 can be run either from the console or side by side with Mac OS X's +Aqua desktop in a full screen mode. In full screen mode with Aqua, when the X +window system is active, it takes over the entire screen. You can switch back +to the Mac OS X desktop by holding down Command-Option-A. This key combina- +tion can be changed in the user preferences. From the Mac OS X desktop, just +click on the XDarwin icon in the floating switch window to switch back to the +X window system. You can change this behavior in the user preferences so +that clicking on the XDarwin icon in the Dock switches as well. The full +screen cooperative mode with Aqua is known as Quartz mode, named after the +Quartz 2D compositing engine used by Aqua. + +From the console, 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 or Mac OS X sys- +tems. The descriptions found elsewhere of devices supported by XFree86 for +other operating systems also do not apply. Running XFree86 from the text +console is known as IOKit mode. + +XFree86 for Darwin or Mac OS X 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, you may need to download additional third-party drivers from +Apple's Darwin site. IOKit drivers are typically installed in /Sys- +tem/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. @@ -35,30 +47,20 @@ I have tested. I have done no testing with serial mice. 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) +are very similar. Where there are differences I have noted them below. Note +that to build XFree86 for yourself on Mac OS X, you will need to install the +Developers' Tools. -On the other hand, if you want to build things yourself from scratch, follow -the directions below. +If you don't feel the need to live on the cutting edge, you can save some +time and effort by using the precompiled binaries available on the XFree86 +FTP server at <URL:ftp://ftp.xfree86.org/pub/XFree86/4.1.0/binaries/Darwin/>. +Follow the instructions in the Install document to install it. This will cre- +ate two new directory trees, /usr/X11R6 and /etc/X11 For Mac OS X Quartz sup- +port, download the optional Xquartz.tgz tarball. -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). +If you get the precompiled binaries you can skip ahead to the section on run- +ning the X window system (section 4., page 1) On the other hand, if you want +to build things yourself from scratch, follow the directions below. 3.1 Get the Code @@ -68,8 +70,8 @@ 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. + properly, however, to tell it where to look. Follow the XFree86 instruc- + tions 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 @@ -83,22 +85,7 @@ project. 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 +3.2 Build XFree86 Once you have everything ready it is easy to build and install XFree86. From the command line: @@ -108,61 +95,69 @@ the command line: (wait for several hours) - su root - make install >& install.log - make install.man >& man.log + sudo make install >& install.log + sudo make install.man >& man.log -4. Run X Windows +4. Run the X Window System -You will want to add the X windows executables to your path. Your path is the +You will want to add the X window 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): +named ~/Library/init/tcsh/path: (You may need to create this file and direc- +tory path if it does not exist already.) - 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. + setenv MANPATH "${MANPATH}:/usr/X11R6/man" + +The next time you login or open a Terminal window, this file will be executed +automatically. + +You are now ready to go. On Mac OS X, you can run XFree86 from the text con- +sole or in full screen mode with Aqua. To get to the text console in Mac OS X +you need to logout and type ``>console'' as the user name. This will shutdown +Core Graphics and bring up the console login prompt. Login again as your +user. + +From the text console you can start the X Window System 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 XFree86 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, Core Graphics +will restart and you should be given a login window. + +To start XFree86 in Quartz mode you can launch the XDarwin application in the +/Applications folder, or from the command line type ``startx -- -quartz''. +When the X window system is active, it takes over the entire screen. You can +switch back to the Mac OS X desktop by holding down Command-Option-A. This +key combination can be changed in the user preferences. From the Mac OS X +desktop, just click on the XDarwin icon in the floating switch window to +switch back to the X window system. You can change this behavior in the user +preferences so that clicking on the XDarwin icon in the Dock switches as +well. 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. +The X window system 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 the +X window system. You can find a sample .xinitrc file in /etc/X11/xinit/xini- +trc. -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. +There are several window managers that have been ported to Darwin. The best +collection of window managers and other X window clients is at Darwinfo's +ports page. Another good place to look for Darwin ports in general is at +Stepwise's Softrak site. Good luck! @@ -173,176 +168,20 @@ know if you are interested in working on any of these issues. Things that are broken: - o The bell is broken. + o The bell does not work in IOKit mode. - 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 Server shutdown problem: After quitting the X server in IOKit mode, 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. 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> + o The display mode can not be changed once the X server has started. - 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. + o A screen saver is not supported. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml,v 1.4 2000/12/12 18:54:29 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml,v 1.4.4.2 2001/06/02 04:44:37 torrey Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.Darwin,v 1.3 2000/12/12 19:04:02 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.Darwin,v 1.3.4.4 2001/06/02 16:02:08 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.I128 b/xc/programs/Xserver/hw/xfree86/doc/README.I128 index b49c54b22..74d525713 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.I128 +++ b/xc/programs/Xserver/hw/xfree86/doc/README.I128 @@ -100,4 +100,4 @@ and special help from: 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.10 2000/12/14 17:12:00 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.I128,v 1.10.4.1 2001/06/01 18:26:44 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.LynxOS b/xc/programs/Xserver/hw/xfree86/doc/README.LynxOS index 05e190d43..f352a081a 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.LynxOS +++ b/xc/programs/Xserver/hw/xfree86/doc/README.LynxOS @@ -1,4 +1,4 @@ - README for XFree86 4.0.2 on LynxOS + README for XFree86 4.1.0 on LynxOS Thomas Mueller @@ -13,19 +13,19 @@ ments as well as many bug fixes. See the Copyright Notice. -The sources for XFree86 4.0.2 are available by anonymous ftp from: +The sources for XFree86 4.1.0 are available by anonymous ftp from: -ftp://ftp.XFree86.org/pub/XFree86/4.0.2 +ftp://ftp.XFree86.org/pub/XFree86/4.1.0 Binaries of XFree86 for LynxOS x86 are available from: -ftp://ftp.XFree86.org/pub/XFree86/4.0.2/binaries/LynxOS +ftp://ftp.XFree86.org/pub/XFree86/4.1.0/binaries/LynxOS A list of mirror sites is provided by ftp://ftp.XFree86.org/pub/XFree86/MIR- RORS The binaries on the FTP site were built on the latest released LynxOS version -at the time XFree86 4.0.2 was released. In this case it is `LynxOS x86 +at the time XFree86 4.1.0 was released. In this case it is `LynxOS x86 3.0.1'. Because of changes made to the object format they don't run on LynxOS versions earlier than 3.0.0. @@ -37,7 +37,7 @@ this OS release was not available long enough for serious testing `LynxOS 3.1.0' support has to be considered to be in `alpha state'. Initial tests were performed on LynxOS x86 only! -XFree86 4.0.2 supports LynxOS on the x86 and on the PowerPC platform. X +XFree86 4.1.0 supports LynxOS on the x86 and on the PowerPC platform. X servers are currently available only on the x86 platform. The X server may work with some PowerPC platforms supported by LynxOS though this has not (yet) been thoroughly tested. @@ -163,7 +163,7 @@ to 3.5 X Server debug diagnostics output and other VT peculiarities Output made by the XFree86 X on its stdout or stderr will be lost after the -server switches to graphics mode. The XFree86 4.0.2 server stores its output +server switches to graphics mode. The XFree86 4.1.0 server stores its output in /usr/adm/XFree86.n.log (where n is the screen number). When the X server is running output made to other consoles will be lost. @@ -266,4 +266,4 @@ duplicate entries: Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/LynxOS.sgml,v 3.20 2000/06/17 00:27:32 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.LynxOS,v 3.28 2000/12/01 19:47:46 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.LynxOS,v 3.28.4.1 2001/06/01 18:26:44 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.NetBSD b/xc/programs/Xserver/hw/xfree86/doc/README.NetBSD index da9b9dafc..4a8d5709f 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.NetBSD +++ b/xc/programs/Xserver/hw/xfree86/doc/README.NetBSD @@ -1,4 +1,4 @@ - README for XFree86 4.0.2 on NetBSD + README for XFree86 4.1.0 on NetBSD Rich Murphey, David Dawes, Marc Wandschneider, Mark Weaver, Matthieu Herrb @@ -14,10 +14,10 @@ See the Copyright Notice. The sources for XFree86 are available by anonymous ftp from: -ftp://ftp.XFree86.org/pub/XFree86/4.0.2 +ftp://ftp.XFree86.org/pub/XFree86/4.1.0 Binaries for NetBSD 1.4 and later are available from: -ftp://ftp.XFree86.org/pub/XFree86/4.0.2/binaries/NetBSD +ftp://ftp.XFree86.org/pub/XFree86/4.1.0/binaries/NetBSD A list of mirror sites is provided by http://www.xfree86.org/MIRRORS.shtml @@ -33,8 +33,6 @@ if you have comments or suggestions about this file and we'll revise it. 3. New OS dependent features -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 A fix for libXmu OS detection which was broken since unix isn't defined @@ -101,7 +99,7 @@ the xvidtune utility. 5.1 About mouse configuration -XFree86 4.0.2 has support for the mouse driver included in the wscons console +XFree86 4.1.0 has support for the mouse driver included in the wscons console driver introduced by NetBSD 1.4. Specify ``wsmouse'' as the protocol and ``/dev/wsmouse0'' as the device in /etc/X11/XF86Config if you're using NetBSD 1.4 or later with a PS/2 mouse. @@ -219,14 +217,14 @@ By default NetBSD include the BSD 4.4 kernel security feature that disable access to the /dev/mem device when in multi-users mode. But XFree86 servers can take advantage (or require) linear access to the display memory. -Most XFree86 4.0.2 card drivers require linear memory access. There are two +Most XFree86 4.1.0 card drivers require linear memory access. There are two ways to allow XFree86 to access linear memory: The first way is to disable the kernel security feature by adding ``option INSECURE'' in the kernel configuration file and build a new kernel. The second way is to install the aperture driver, included in source form in -xc/programs/Xserver/hw/xfree86/etc/apNetBSD.shar in the XFree86 4.0.2 source +xc/programs/Xserver/hw/xfree86/etc/apNetBSD.shar in the XFree86 4.1.0 source distribution. Unpack it in a new directory of your choice by running: sh apNetBSD.shar @@ -370,7 +368,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.60 2001/03/04 09:47:34 herrb Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.60.2.1 2001/06/01 18:09:48 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.NetBSD,v 3.76 2001/03/04 09:48:47 herrb Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.NetBSD,v 3.76.2.1 2001/06/01 18:26:44 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD b/xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD index bc01998fe..843b8bde1 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD +++ b/xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD @@ -1,4 +1,4 @@ - README for XFree86 4.0.2 on OpenBSD + README for XFree86 4.1.0 on OpenBSD Matthieu Herrb @@ -12,13 +12,13 @@ ing systems on Intel and other platforms. See the Copyright Notice. -The sources for XFree86 4.0.2 are available by anonymous ftp from: +The sources for XFree86 4.1.0 are available by anonymous ftp from: -ftp://ftp.XFree86.org/pub/XFree86/4.0.2 +ftp://ftp.XFree86.org/pub/XFree86/4.1.0 Binaries for OpenBSD/i386 2.8 and later are available from: -ftp://ftp.XFree86.org/pub/XFree86/4.0.2/binaries/OpenBSD +ftp://ftp.XFree86.org/pub/XFree86/4.1.0/binaries/OpenBSD A list of mirror sites is provided by http://www.xfree86.org/MIRRORS.shtml @@ -32,7 +32,7 @@ if you have comments or suggestions about this file and we'll revise it. 3. New OS dependent features -See the Release Notes for non-OS dependent new features in XFree86 4.0.2. +See the Release Notes for non-OS dependent new features in XFree86 4.1.0. 3.1 New OS dependent features in 4.0.3 @@ -122,7 +122,7 @@ the xvidtune utility. 5.1 About mouse configuration -XFree86 4.0.2 has support for the mouse driver included in the new wscons +XFree86 4.1.0 has support for the mouse driver included in the new wscons console driver introduced by OpenBSD-current after 2.8. Specify ``wsmouse'' as the protocol and ``/dev/wsmouse0'' as the device in /etc/X11/XF86Config if you're using OpenBSD-current with a PS/2 mouse. @@ -335,4 +335,4 @@ Nate Williams, Rod Grimes, Jack Velte and Michael Smith. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/OpenBSD.sgml,v 1.17 2001/04/05 19:29:43 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD,v 1.22 2001/04/10 16:44:31 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.OpenBSD,v 1.22.2.1 2001/06/01 18:26:44 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.SiS b/xc/programs/Xserver/hw/xfree86/doc/README.SiS index 339ee77c9..cf5af1b14 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.SiS +++ b/xc/programs/Xserver/hw/xfree86/doc/README.SiS @@ -113,4 +113,4 @@ Document based on 3.3 version written by Xavier Ducoin. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/SiS.sgml,v 3.7 2000/03/06 22:59:24 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.SiS,v 3.16 2000/12/01 19:47:48 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.SiS,v 3.16.4.1 2001/06/01 18:26:44 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.apm b/xc/programs/Xserver/hw/xfree86/doc/README.apm index 7c821ad7d..37ad919ea 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.apm +++ b/xc/programs/Xserver/hw/xfree86/doc/README.apm @@ -111,4 +111,4 @@ be possible to add support for the 3210 chipset if someone needs it. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/apm.sgml,v 1.3 2000/03/08 05:38:43 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.apm,v 1.8 2000/12/01 19:47:48 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.apm,v 1.8.4.1 2001/06/01 18:26:44 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.ati b/xc/programs/Xserver/hw/xfree86/doc/README.ati index af39d20db..16d0d5add 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.ati +++ b/xc/programs/Xserver/hw/xfree86/doc/README.ati @@ -694,4 +694,4 @@ Intel architectures. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/ati.sgml,v 3.37 2001/04/16 15:02:08 tsi Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.ati,v 3.56 2001/04/16 15:06:49 tsi Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.ati,v 3.56.2.1 2001/06/01 18:26:44 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.chips b/xc/programs/Xserver/hw/xfree86/doc/README.chips index 23d8180c4..b5043af1a 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.chips +++ b/xc/programs/Xserver/hw/xfree86/doc/README.chips @@ -3,11 +3,11 @@ David Bateman (<dbateman@club-internet.fr>), Egbert Eich (<eich@xfree86.org>) - 14th June 2000 + 1st January 2001 1. Introduction -With the release of XFree86 version 4.0.2, the Chips and Technologies driver +With the release of XFree86 version 4.1.0, the Chips and Technologies driver has been extensively rewritten and contains many new features. This driver must be considered work in progress, and those users wanting stability are encouraged to use the older XFree86 3.3.x versions. However this version of @@ -260,14 +260,6 @@ Screen, Monitor, Device. grammable clock makes this option obsolete and so it's use isn't recommended. It is completely ignored for HiQV chipsets. - Option "UseVclk1" - The HiQV series of chips have three programmable clocks. The - first two are usually loaded with 25.175 and 28.322MHz for VGA - backward compatibility, and the third is used as a fully pro- - grammable clock. On at least one system (the Inside 686 LCD/S - single board computer) the third clock is unusable. This option - forces the use of VClk1 as the programmable clock. - TextClockFreq 25.175 Except for the HiQV chipsets, it is impossible for the server to read the value of the currently used frequency for the text con- @@ -291,18 +283,29 @@ Screen, Monitor, Device. or 32bpp LCD panel clocks, where the options above set the clocks to 65MHz. + Option "CRTClkIndx" "2" + Option "FPClkIndx" "1"" The HiQV series of chips have three pro- + grammable clocks. The first two are usually loaded with 25.175 + and 28.322MHz for VGA backward compatibility, and the third is + used as a fully programmable clock. On at least one system (the + Inside 686 LCD/S single board computer) the third clock is unus- + able. These options can be used to force a particular clock index + to be used + Option "MMIO" This has a different effect depending on the hardware on which it is used. For the 6554x machines MMIO is only used to talk to the BitBLT engine and is only usable with PCI buses. It is enabled by default for 65545 machines since the blitter can not be used otherwise. The HiQV series of chipsets must use MMIO with - their BitBLT engines, and so this is enabled by default. However - the 690xx chipsets can use MMIO for all communications with the + their BitBLT engines, and so this is enabled by default. + + Option "FullMMIO" + The 690xx chipsets can use MMIO for all communications with the video processor. So using this option on a 690xx chipset forces them to use MMIO for all communications. This only makes sense when the 690xx is on a PCI bus so that normal PIO can be dis- - abled. (WARNING!! 690xx MMIO is untested) + abled. Option "SuspendHack" This option sets the centering and stretching to the BIOS default @@ -409,6 +412,20 @@ Screen, Monitor, Device. 255 for 8bit depth, 0 to 32,767 for 15bit depth, etc. This option might be used if the default video overlay key causes problems. + Option "DualRefresh" + The 69030 chipset has independent display channels, that can be + configured to support independent refresh rates on the flat panel + and on the CRT. The default behaviour is to have both the flat + panel and the CRT use the same display channel and thus the same + refresh rate. This option forces the two display channels to be + used, giving independent refresh rates. + + Option "Crt2Memory" "2048" + The ct69030 supports dual-head display. By default the two dis- + play share equally the available memory. This option forces the + second display to take a particular amount of memory. Please read + the section below about dual-head display. + Option "XaaNoScreenToScreenCopy", Option "XaaNoSolidFillRect", Option "XaaNoSolidHorVertLine", Option "XaaNoMono8x8PatternFillRect", Option "XaaNoColor8x8Pat- @@ -499,6 +516,13 @@ you'll needed to considered several points after a suspend/resume or LCD/CRT switch. For a complete discus- sion on the dot clock limitations, see the next section. + * Dual-head display + Dual-head display has two effects on the modelines. Firstly, the + memory requirements of both heads must fit in the available mem- + ory. Secondly, the memory bandwidth of the video processor is + shared between the two heads. Hence the maximum dot-clock might + need to be limited. + The driver is capable of driving both a CRT and a flat panel display. In fact the timing for the flat panel are dependent on the specification of the panel itself and are independent of the particular mode chosen. For this reason it @@ -530,7 +554,97 @@ The NEC Versa 4080 just needs the "FixPanelSize" option. To the best of my knowledge no machine with a HiQV needs the "UseModeline" or "FixPanelSize" options. -5. The Full Story on Clock Limitations +5. Dual Display Channel + +XFree86 releases later than 4.1.0 support dual-channel display on the +ct69030. This support can be used to give a single display image on two +screen with different refresh rates, or entirely different images on the two +displays. + +Dual refresh rate display can be selected with the "DualRefresh" option +described above. However to use the dual-head support is slightly more com- +plex. Firstly, the ct69030 chipset must be installed on a PCI bus. This is a +driver limitation that might be relaxed in the future. In addition the +device, screen and layout sections of the "XF86Config" must be correctly con- +figured. A sample of an incomplete "XF86Config" is given below + + Section "Device" + Identifier "Chips and Technologies - Pipe A" + Driver "chips" + BusID "PCI:0:20:0" + Screen 0 + EndSection + + Section "Device" + Identifier "Chips and Technologies - Pipe B" + Driver "chips" + BusID "PCI:0:20:0" + Screen 1 + EndSection + + Section "Screen" + Identifier "Screen 0" + Device "Chips and Technologies - Pipe A" + Monitor "generic LCD" + + SubSection "Display" + Depth 16 + Modes "1024x768" + EndSubsection + EndSection + + Section "Screen" + Identifier "Screen 1" + Device "Chips and Technologies - Pipe B" + Monitor "generic CRT" + + SubSection "Display" + Depth 16 + Modes "1024x768" + EndSubsection + EndSection + + Section "ServerLayout" + Identifier "Main Layout" + Screen "Screen 0" + Screen "Screen 1" RightOf "Screen 0" + InputDevice "Mouse1" "CorePointer" + InputDevice "Keyboard1" "CoreKeyboard" + EndSection + +The device section must include the PCI BusID. This can be found from the log +file of a working single-head installation. For instance, the line + + (--) PCI:*(0:20:0) C&T 69030 rev 97, Mem @ 0xed000000/24 + +appears for the case above. Additionally, the "Screen" option must appear in +the device section. It should be noted that if a flat panel is used, this it +must be allocated to "Screen 0". + +The server can then be started with the "+xinerama" option as follows + + startx -- +xinerama + +For more information, read the Xinerama documentation. + +It should be noted that the dual channel display options of the 69030 require +the use of additional memory bandwidth, as each display channel independently +accesses the video memory. For this reason, the maximum colour depth and res- +olution that can be supported in a dual channel mode will be reduced compared +to a single display channel mode. However, as the driver does not prevent you +from using a mode that will exceed the memory bandwidth of the 69030, but a +warning like + + (WW) Memory bandwidth requirements exceeded by dual-channel + (WW) mode. Display might be corrupted!!! + +If you see such display corruption, and you have this warning, your choices +are to reduce the refresh rate, colour depth or resolution, or increase the +speed of the memory clock with the the "SetMClk" option described above. Note +that increasing the memory clock also has its own problems as described +above. + +6. The Full Story on Clock Limitations There has been much confusion about exactly what the clock limitations of the Chips and Technologies chipsets are. Hence I hope that this section will @@ -575,17 +689,24 @@ EDO, might not be fast enough to handle this, resulting in drawing errors on the screen. The formula to determine the maximum usable dotclock on the HiQV series of chips is + Max dotclock = min(MaxDClk, 0.70 * 8 * MemoryClk / (BytesPerPixel + + (isDSTN == TRUE ? 1 : 0))) + +if you chips is a 69030 or 69000 or + Max dotclock = min(MaxDClk, 0.70 * 4 * MemoryClk / (BytesPerPixel + (isDSTN == TRUE ? 1 : 0))) -which says that there are two limits on the dotclock. One the overall maxi- -mum, and another due to the available memory bandwidth of the chip. For the -memory bandwidth 4 bytes are transfered every clock cycle (Hence the 4), but -after accounting for the RAS/CAS signaling only about 70% of the bandwidth is -available. The whole thing is divided by the bytes per pixel, plus an extra -byte if you are using a DSTN. The extra byte with DSTN screens is used for -the frame buffering/acceleration in these screens. So for the various Chips -and Technologies chips the maximum specifications are +otherwise. This effectively means that there are two limits on the dotclock. +One the overall maximum, and another due to the available memory bandwidth of +the chip. The 69030 and 69000 have a 64bit memory bus and thus transfer 8 +bytes every clock thus (hence the 8), while the other HiQV chipsets are 32bit +and transfer 4 bytes per clock cycle (hence the 4). However, after accounting +for the RAS/CAS signaling only about 70% of the bandwidth is available. The +whole thing is divided by the bytes per pixel, plus an extra byte if you are +using a DSTN. The extra byte with DSTN screens is used for the frame buffer- +ing/acceleration in these screens. So for the various Chips and Technologies +chips the maximum specifications are Max DClk MHz Max Mem Clk MHz 65550 rev A 3.3v 80 38 @@ -613,8 +734,8 @@ chips are 65554 94.5 77 51.33 77 51.33 38.5 65555 110 77 51.33 77 51.33 38.5 68554 110 77 51.33 77 51.33 38.5 - 69000 135 116.2 77.47 116.2 77.47 58.1 - 69030 170 140 93.33 140 93.33 70 + 69000 135 135 135 135 135 116.2 + 69030 170 170 170 170 170 140 If you exceed the maximum set by the memory clock, you'll get corruption on the screen during graphics operations, as you will be starving the HW BitBlt @@ -632,7 +753,7 @@ ticular mode to work. However use caution with these options, because there is no guarantee that driving the video processor beyond it capabilities won't cause damage. -6. Troubleshooting +7. Troubleshooting The cursor appears as a white box, after switching modes There is a known bug in the H/W cursor, that sometimes causes the @@ -805,13 +926,13 @@ cause damage. My ct69030 machine locks up when starting XFree The ct69030 chipset introduced a new dual channel architecture. - In its current form, XFree can not take advantage of this second - display channel. In fact if the video BIOS on the machine sets - the ct69030 to a dual channel mode by default, XFree will lockup - hard at this point. The solution is to use the BIOS setup to - change to a single display channel mode, ensuring that both the - IOSS and MSS registers are set to a single channel mode. Work is - underway to fix this. + In its current form, XFree86 can not take advantage of this sec- + ond display channel. In fact if the video BIOS on the machine + sets the ct69030 to a dual channel mode by default, XFree86 will + lockup hard at this point. The solution is to use the BIOS setup + to change to a single display channel mode, ensuring that both + the IOSS and MSS registers are set to a single channel mode. Work + is underway to fix this. I can't start X-windows with 16, 24 or 32bpp Firstly, is your machine capable of 16/24/32bpp with the mode @@ -829,7 +950,7 @@ cause damage. startx -- -depth 24 -fbbpp 32 8-8-8 RGB truecolor - however as XFree86 version 4.0.2 allows 32bpp pixmaps to be used + however as XFree86 version 4.1.0 allows 32bpp pixmaps to be used with framebuffers operating in 24bpp, this mode of operating will cost performance for no gain in functionality. @@ -847,7 +968,8 @@ perhaps more stable clock by simply changing the clock value slightly. For example 65.00MHz might be unstable while 65.10MHz is not. So for unexplained problems not addressed above, please try to alter the clock you are using slightly, say in steps of 0.05MHz and see if the problem goes away. Alterna- -tively, using the "UseVClk1" option with HiQV chips might also help. +tively, using the "CRTClkIndx" or "FPClkIndx" option with HiQV chips might +also help. For other screen drawing related problems, try the "NoAccel" or one of the XAA acceleration options discussed above. A useful trick for all laptop com- @@ -860,19 +982,19 @@ tacting the XFree86 team (the current driver maintainer can be reached at <dbateman@club-internet.fr> or <eich@xfree86.org>), or post in the Usenet newsgroup "comp.windows.x.i386unix". -7. Disclaimer +8. Disclaimer XFree86, allows the user to do damage to their hardware with software. Although the authors of this software have tried to prevent this, they dis- claim all responsibility for any damage caused by the software. Use caution, if you think the Xserver is frying your screen, TURN THE COMPUTER OFF!! -8. Acknowledgement +9. Acknowledgement The authors of this software wish to acknowledge the support supplied by Chips and Technologies during the development of this software. -9. Authors +10. Authors Major Contributors (In no particular order) @@ -899,7 +1021,7 @@ Contributors (In no particular order) We also thank the many people on the net who have contributed by reporting bugs and extensively testing this server. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml,v 3.33 2000/12/02 21:52:22 dbateman Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml,v 3.36 2001/05/19 00:35:42 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.chips,v 3.35 2000/12/04 19:47:24 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.chips,v 3.36.2.1 2001/06/01 18:26:44 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.cyrix b/xc/programs/Xserver/hw/xfree86/doc/README.cyrix index 457e3d3f8..f480f4de1 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.cyrix +++ b/xc/programs/Xserver/hw/xfree86/doc/README.cyrix @@ -50,4 +50,4 @@ lowing Cyrix CPUs with integrated graphics: Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/cyrix.sgml,v 1.3 2000/03/08 05:38:43 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.cyrix,v 1.8 2000/12/01 19:47:49 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.cyrix,v 1.8.4.1 2001/06/01 18:26:45 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.dps b/xc/programs/Xserver/hw/xfree86/doc/README.dps index da1bf9fdc..25b300daf 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.dps +++ b/xc/programs/Xserver/hw/xfree86/doc/README.dps @@ -167,4 +167,4 @@ Developers. 15 April 1993. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/dps.sgml,v 1.1 2001/03/02 02:45:37 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.dps,v 1.2 2001/03/02 17:47:53 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.dps,v 1.2.2.1 2001/06/01 18:26:45 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.fonts b/xc/programs/Xserver/hw/xfree86/doc/README.fonts index 9a3b84b26..fb30c0aa2 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.fonts +++ b/xc/programs/Xserver/hw/xfree86/doc/README.fonts @@ -1013,4 +1013,4 @@ favourite is RFC 373. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml,v 1.13 2001/03/01 00:37:09 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.16 2001/03/02 17:47:53 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.16.2.1 2001/06/01 18:26:45 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.i740 b/xc/programs/Xserver/hw/xfree86/doc/README.i740 index bf790fdd8..12bfdf00d 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.i740 +++ b/xc/programs/Xserver/hw/xfree86/doc/README.i740 @@ -178,4 +178,4 @@ http://www.precisioninsight.com Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/i740.sgml,v 1.3 2000/03/04 00:26:30 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.i740,v 1.8 2000/12/01 19:47:49 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.i740,v 1.8.4.1 2001/06/01 18:26:45 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.i810 b/xc/programs/Xserver/hw/xfree86/doc/README.i810 index cee453c26..38e255969 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.i810 +++ b/xc/programs/Xserver/hw/xfree86/doc/README.i810 @@ -109,4 +109,4 @@ http://www.precisioninsight.com Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/i810.sgml,v 1.3 2001/04/04 01:34:18 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.i810,v 1.6 2001/04/10 16:44:32 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.i810,v 1.6.2.1 2001/06/01 18:26:45 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.isc b/xc/programs/Xserver/hw/xfree86/doc/README.isc index 83627198d..6151da7c9 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.isc +++ b/xc/programs/Xserver/hw/xfree86/doc/README.isc @@ -489,4 +489,4 @@ tribute to this excellent piece of free software. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/isc.sgml,v 3.24 2000/03/06 22:59:25 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.isc,v 3.39 2000/12/01 19:47:50 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.isc,v 3.39.4.1 2001/06/01 18:26:45 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.mouse b/xc/programs/Xserver/hw/xfree86/doc/README.mouse index 89dadc30f..a3e3527f3 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.mouse +++ b/xc/programs/Xserver/hw/xfree86/doc/README.mouse @@ -6,7 +6,7 @@ 1. Introduction -This document describes mouse support in XFree86 4.0.2. +This document describes mouse support in XFree86 4.1.0. Mouse configuration has often been mysterious task for novice users. How- ever, once you learn several basics, it is straightforward to write the mouse @@ -928,4 +928,4 @@ wheel's movement will be reported as the buttons 6 and 7. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/mouse.sgml,v 1.11 2000/03/01 00:25:23 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.mouse,v 1.11 2000/12/01 19:47:50 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.mouse,v 1.11.4.1 2001/06/01 18:26:45 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.newport b/xc/programs/Xserver/hw/xfree86/doc/README.newport index 647969cdc..9ef0f4d10 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.newport +++ b/xc/programs/Xserver/hw/xfree86/doc/README.newport @@ -41,4 +41,4 @@ The following Section "Device" options are supported by the newport driver: 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.2 2000/12/12 19:04:03 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.newport,v 1.2.4.1 2001/06/01 18:26:45 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.r128 b/xc/programs/Xserver/hw/xfree86/doc/README.r128 index a666b3035..b6cfc6f48 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.r128 +++ b/xc/programs/Xserver/hw/xfree86/doc/README.r128 @@ -119,4 +119,4 @@ http://www.suse.com Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/r128.sgml,v 1.8 2000/06/14 00:16:09 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.r128,v 1.13 2000/12/01 19:47:51 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.r128,v 1.13.4.1 2001/06/01 18:26:45 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.rapidaccess b/xc/programs/Xserver/hw/xfree86/doc/README.rapidaccess new file mode 100644 index 000000000..a78dfb9bc --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/doc/README.rapidaccess @@ -0,0 +1,48 @@ +The IBM Rapid Access keyboard have some extra buttons +on it to launch programs, control a cd-player and so on. + +These buttons is not functional when the computer is turned +on but have to be activated by sending the codes 0xea 0x71 +to it. + +I've written the following hack to send codes to the keyboard: + +-------------------------------------------------------------- +/* gcc -O2 -s -Wall -osend_to_keyboard send_to_keyboard.c */ +#include <stdlib.h> +#include <unistd.h> +#include <sys/io.h> + +int main( int argc, char *argv[] ) +{ + int i; + + ioperm( 0x60, 3, 1 ); + + for( i = 1; i < argc; i++ ) { + int x = strtol( argv[i], 0, 16 ); + + usleep( 300 ); + outb( x, 0x60 ); + } + + return 0; +} +-------------------------------------------------------------- + +As root you can then call this program (in your boot scripts) +as "send_to_keyboard ea 71" to turn on the extra buttons. + +It's not a good idea to run several instances of this program +at the same time. It is a hack but it works. If you try to +send other codes to the keyboard it probably will lock up. +For other codes see: + +http://www.win.tue.nl/~aeb/linux/kbd/scancodes-2.html#ss2.22 + +-- +Dennis Björklund <db@zigo.dhs.org> + + + +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.rapidaccess,v 1.1 2001/05/18 23:35:32 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.rendition b/xc/programs/Xserver/hw/xfree86/doc/README.rendition index bc9db34bd..70cc35a00 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.rendition +++ b/xc/programs/Xserver/hw/xfree86/doc/README.rendition @@ -145,4 +145,4 @@ on the list of features to be included. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/rendition.sgml,v 1.12 2000/06/17 02:30:33 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.rendition,v 1.12 2000/12/01 19:47:51 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.rendition,v 1.12.4.1 2001/06/01 18:26:45 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/README.s3virge b/xc/programs/Xserver/hw/xfree86/doc/README.s3virge index 8b878827e..6b71b8f22 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/README.s3virge +++ b/xc/programs/Xserver/hw/xfree86/doc/README.s3virge @@ -6,7 +6,7 @@ 1. Supported hardware -The s3virge driver in XFree86 4.0.2 supports the S3 ViRGE, ViRGE DX, GX, MX, +The s3virge driver in XFree86 4.1.0 supports the S3 ViRGE, ViRGE DX, GX, MX, MX+, and VX chipsets. A majority of testing is done on ViRGE DX chips, mak- ing them the most stable to date. This release has improved support for ViRGE GX2 stability, XVideo support for ViRGE DX (tested) and ViRGE @@ -63,4 +63,4 @@ tact our support email address <XFree86@Xfree86.org> Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/s3virge.sgml,v 1.3 2000/11/28 20:59:17 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.s3virge,v 1.6 2000/12/01 19:47:51 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.s3virge,v 1.6.4.1 2001/06/01 18:26:45 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/RELNOTES b/xc/programs/Xserver/hw/xfree86/doc/RELNOTES index a1dd1afdb..eb39ead36 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/RELNOTES +++ b/xc/programs/Xserver/hw/xfree86/doc/RELNOTES @@ -1,4 +1,4 @@ - Release Notes for XFree86[tm] 4.0.2 + Release Notes for XFree86[tm] 4.1.0 The XFree86 Project, Inc @@ -7,17 +7,17 @@ Abstract This document contains some information about the features present - in XFree86 4.0.2 and their status. + in XFree86 4.1.0 and their status. 1. Introduction to the 4.x Release Series 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 +current release (4.1.0) 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. +how the hardware driver support compares between 3.3.6 and 4.1.0. Please +check there first before downloading 4.1.0. 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 @@ -28,7 +28,7 @@ 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 +the 4.1.0 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. @@ -37,17 +37,18 @@ release, please have a quick read through the Installation Document. It may 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 +The next section describes what is new in the latest version (4.1.0). The other sections below describe some of the new features and changes 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. -2. Summary of new features in 4.0.2. +2. Summary of new features in 4.1.0. 2.1 X server - 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 + o Darwin/Mac OS X is now supported on PowerPC and Intel/x86. The X server + runs from the console or in cooperation with the Mac OS X Aqua GUI. 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. @@ -289,7 +290,7 @@ enough space to cover them all here. 3.1 Video Drivers -XFree86 4.0.2 includes the following video drivers: +XFree86 4.1.0 includes the following video drivers: +--------------+--------------------------+----------------------------------+ |Driver Name | Description | Further Information | @@ -341,7 +342,7 @@ Drivers marked with (-) are for Linux/mips only. 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. -XFree86 4.0.2 includes the following input drivers: +XFree86 4.1.0 includes the following input drivers: 3.2 Input Drivers @@ -367,12 +368,12 @@ XFree86 4.0.2 includes the following input drivers: 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 +which drive different hardware, XFree86 4.1.0 has a single X server binary called XFree86. This binary can either have one or more video drivers linked 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 +XFree86 4.1.0 has X server support for most UNIX(R) and UNIX-like operating 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 @@ -394,7 +395,7 @@ they do not need to be recompiled for every different operating system. In the future we plan to take advantage of this to provide more frequent driver module updates in between major releases. -The loader in version 4.0.2 has support for Intel (x86), Alpha and PowerPC +The loader in version 4.1.0 has support for Intel (x86), Alpha and PowerPC platforms. It also has preliminary support for Sparc platforms. The X server makes use of modules for video drivers, X server extensions, @@ -733,7 +734,7 @@ Known problems: 4.7 DGA version 2 -DGA 2.0 is included in 4.0.2, but is not implemented by all drivers. Prelim- +DGA 2.0 is included in 4.1.0, 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. @@ -801,7 +802,7 @@ 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 4.0.2 provides a partial implementation of Render sufficient for +XFree86 4.1.0 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. @@ -836,10 +837,10 @@ the Xft man page. 4.11.2 FreeType support in Xft -XFree86 4.0.2 includes sources for FreeType version 2.0.1, and, by default, +XFree86 4.1.0 includes sources for FreeType version 2.0.1, and, by default, they are built and installed automatically. -If you prefer, you can configure XFree86 4.0.2 to use an existing Freetype2 +If you prefer, you can configure XFree86 4.1.0 to use an existing Freetype2 installation by telling XFree86 not to build the internal copy and indicating where that external version has been installed. Edit (or create) con- fig/cf/host.def to include: @@ -856,7 +857,7 @@ the FreeType release. 4.11.3 Application Support For Anti-Aliased Text -Only three applications have been modified in XFree86 4.0.2 to work with the +Only three applications have been modified in XFree86 4.1.0 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. @@ -1085,4 +1086,4 @@ symbolic links in the old location. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.60 2001/03/02 17:40:48 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/RELNOTES,v 3.97 2001/03/02 17:47:53 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/RELNOTES,v 3.97.2.2 2001/06/02 04:44:36 torrey Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/Status b/xc/programs/Xserver/hw/xfree86/doc/Status index bc8b7fa42..8280311b9 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/Status +++ b/xc/programs/Xserver/hw/xfree86/doc/Status @@ -1,24 +1,24 @@ - Driver Status for XFree86[tm] 4.0.2 + Driver Status for XFree86[tm] 4.1.0 The XFree86 Project, Inc - 4 December 2000 + 1 June 2001 Abstract This document provides information about the status of the driver - and hardware support in XFree86 4.0.2 compared with that in XFree86 + and hardware support in XFree86 4.1.0 compared with that in XFree86 3.3.6. Please send updates for this document to <fixes@xfree86.org>. Please do not send requests for information - or support to that address. + or support to that address (they will not be answered). 1. Introduction This document contains one section per vendor (organised alphabetically) for -each chipset family that is supported in XFree86 3.3.6 or XFree86 4.0.2. It +each chipset family that is supported in XFree86 3.3.6 or XFree86 4.1.0. It 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. Unless otherwise stated, hardware is classified as "sup- +3.3.6 and 4.1.0. Unless otherwise stated, hardware is classified as "sup- ported" if its driver provides basic 2D support. Support for additional fea- tures may or may not be present. @@ -27,9 +27,9 @@ 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 +In XFree86 4.1.0, 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. +server binary when 4.1.0 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. @@ -45,7 +45,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Support (including acceleration) for Voodoo Banshee and Voodoo3 cards is provided by the XF86_SVGA server with the tdfx driver. - 4.0.2: + 4.1.0: 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 @@ -55,7 +55,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Voodoo4, and Voodoo5 is provided by the "tdfx" 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.1.0. 3. 3Dlabs @@ -65,14 +65,14 @@ architectures known to work on (e.g., Alpha, PPC), etc. ramdacs), Permedia with IBM RGB526 RAMDAC, and Permedia 2, 2a, 2v is provided by the XF86_3DLabs server. - 4.0.2: + 4.1.0: 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. The - Permedia 3 is only supported in 4.0.2. + All hardware supported in 3.3.6 is also supported in 4.1.0. The + Permedia 3 is only supported in 4.1.0. 4. Alliance @@ -80,14 +80,14 @@ architectures known to work on (e.g., Alpha, PPC), etc. Support (including acceleration) for the AT24, AP6422, AT3D. Support is provided by the XF86_SVGA server with the apm driver. - 4.0.2: + 4.1.0: Support (including acceleration?) for the AT24, AT25 and AT3D. This support is provided by the "apm" driver. This driver cur- rently has only incomplete support for the AP6422. Summary: - The AP6422 is supported in 3.3.6 but not fully in 4.0.2. The - AT25 is supported in 4.0.2 but not in 3.3.6. + The AP6422 is supported in 3.3.6 but not fully in 4.1.0. The + AT25 is supported in 4.1.0 but not in 3.3.6. 5. ARK Logic @@ -96,12 +96,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. and ARK2000MT. Support is provided by the XF86_SVGA server with the ark driver. - 4.0.2: + 4.1.0: Support (including acceleration) for the ARK1000PV, ARK2000PV, and ARK2000MT. Support is provided by the "ark" 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.1.0. 6. ATI @@ -119,17 +119,17 @@ architectures known to work on (e.g., Alpha, PPC), etc. driver. Accelerated support is provided for the Rage 128 chips by the XF86_SVGA server with the r128 driver. - 4.0.2: + 4.1.0: 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 - Mach8 and some old Mach32 chips. The support in 4.0.2 is, how- - ever, unaccelerated for all chips except the Mach64, Rage and - Rage 128 variants. + All chips supported in 3.3.6 are supported in 4.1.0 except for + Mach8 and some old Mach32 chips. The support in 4.1.0 is, how- + ever, unaccelerated for all chips except the Mach64, Rage, Rage + 128 and Radeon variants. 7. Avance Logic @@ -140,12 +140,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. the others. These drivers reportedly work, but they have no maintainer. - 4.0.2: + 4.1.0: No native support for these chipsets, because the old drivers have not been ported. Summary: - No Avance Logic chips are supported in 4.0.2. + No Avance Logic chips are supported in 4.1.0. 8. Chips and Technologies @@ -155,13 +155,13 @@ architectures known to work on (e.g., Alpha, PPC), etc. 64300. This support is provided by the XF86_SVGA server with the chips driver. - 4.0.2: + 4.1.0: Support (accelerated) for the 65520, 65525, 65530, 65535, 65540, 65545, 65546, 65548, 65550, 65554, 65555, 68554, 69000, 64200 and 64300. This support is provided by the "chips" 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.1.0. 9. Cirrus Logic @@ -173,13 +173,13 @@ architectures known to work on (e.g., Alpha, PPC), etc. 7541, 7542, 7543, 7548, 7555 and 7556 is provided by the XF86_SVGA server with the cirrus driver. - 4.0.2: + 4.1.0: Support (accelerated) for the Alpine (5430, 5434, 5436, 5446, 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: + The following chips are supported in 3.3.6 but not in 4.1.0: 6410, 6412, 6420, 6440, 5420, 5422, 5424, 5426, 5428, 5429, 6205, 6215, 6225, 6235, 7541, 7542, 7543, 7555 and 7556. @@ -195,7 +195,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. 24 plane 3D chips (on Alpha platforms) is provided by the XF86_TGA server. - 4.0.2: + 4.1.0: No support for the Compaq AVGA (driver hasn't been ported). Support (accelerated) for the DEC 21030 TGA 8 plane, 24 plane and @@ -203,8 +203,8 @@ architectures known to work on (e.g., Alpha, PPC), etc. the "tga" driver. Summary: - No Compaq AVGA support in 4.0.2. DEC TGA support is equivalent - in both 3.3.6 and 4.0.2. + No Compaq AVGA support in 4.1.0. DEC TGA support is equivalent + in both 3.3.6 and 4.1.0. 11. Cyrix @@ -212,12 +212,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. Support (accelerated) for the Cyrix MediaGX is provided by the XF86_SVGA server with the cyrix driver. - 4.0.2: - The 3.3.6 driver has been ported to 4.0.2, including accelera- + 4.1.0: + The 3.3.6 driver has been ported to 4.1.0, including accelera- tion, but feedback is needed. Summary: - Cyrix MediaGX users are encouraged to test its support in 4.0.2. + Cyrix MediaGX users are encouraged to test its support in 4.1.0. 12. Epson @@ -225,12 +225,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. Support (accelerated) for the Epson SPC8110 is provided by the XF86_SVGA server with the spc8100 driver. - 4.0.2: + 4.1.0: No native support for this chipset, because the old driver has not been ported. Summary: - No Epson chips are supported in 4.0.2. + No Epson chips are supported in 4.1.0. 13. Genoa @@ -240,12 +240,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. because we don't have any recent test reports, and this driver has no maintainer. - 4.0.2: + 4.1.0: No native support for this chipset, because the old driver has not been ported. Summary: - No Genoa chips are supported in 4.0.2. + No Genoa chips are supported in 4.1.0. 14. IBM @@ -260,7 +260,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Support for the IBM XGA-2 chip is provided by the XF86_AGX server. - 4.0.2: + 4.1.0: Support for the standard IBM VGA chip (and compatibles) is pro- vided by the "vga" driver. @@ -269,7 +269,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Summary: The standard VGA core is supported in both versions, but there is - no support for the 8514/A or XGA-2 in 4.0.2. + no support for the 8514/A or XGA-2 in 4.1.0. 15. IIT @@ -277,12 +277,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. Support (accelerated) for the AGX-016, AGX-015 and AGX-014 is provided by the XF86_AGX server. - 4.0.2: + 4.1.0: No native support for these chipsets, because the old driver has not been ported. Summary: - No IIT chips are supported in 4.0.2. + No IIT chips are supported in 4.1.0. 16. Integrated Micro Solutions (IMS) @@ -290,12 +290,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. Support (accelerated) for the IMS Twin Turbo 128 is provided by the XF86_SVGA server with the imstt driver. - 4.0.2: + 4.1.0: 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. + All hardware supported in 3.3.6 is also supported in 4.1.0. 17. Intel @@ -306,7 +306,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. Linux, and requires the agpgart.o kernel module in order to use modes that require more than 1MB of video memory. - 4.0.2: + 4.1.0: Support (accelerated) for the Intel i740 is provided by the "i740" driver, and support for the Intel i810 (including i810-dc100 and i810e) and i815 is provided by the "i810" driver. @@ -325,13 +325,13 @@ architectures known to work on (e.g., Alpha, PPC), etc. (Mystique), MGA2164W (Millennium II) (PCI and AGP), G100, G200 and G400 is provided by the XF86_SVGA server with the mga driver. - 4.0.2: + 4.1.0: Support (accelerated) for the MGA2064W (Millennium I), MGA1064SG (Mystique), MGA2164W (Millennium II) (PCI and AGP), G100, G200 and G400 is provided by the "mga" 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.1.0. 19. MX (???) @@ -341,12 +341,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. is unknown because we don't have any recent test reports, and this driver has no maintainer. - 4.0.2: + 4.1.0: No native support for this chipset, because the old driver has not been ported. Summary: - No MX (???) chips are supported in 4.0.2. + No MX (???) chips are supported in 4.1.0. 20. NCR @@ -355,12 +355,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. XF86_SVGA server and the ncr77c22 driver. The status of this support is unknown because we don't have any recent test reports. - 4.0.2: + 4.1.0: No native support for this chipset, because the old driver has not been ported. Summary: - No NCR chips are supported in 4.0.2. + No NCR chips are supported in 4.1.0. 21. NeoMagic @@ -369,14 +369,14 @@ architectures known to work on (e.g., Alpha, PPC), etc. NM2097, NM2160 and NM2200 chipsets is provided by the XF86_SVGA server with the neo driver. - 4.0.2: + 4.1.0: Support (accelerated) for the NeoMagic NM2070, NM2090, NM2093, NM2097, NM2160, NM2200, NM2230, NM2360 and NM2380 chipsets is provided by the "neomagic" driver. Summary: - 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. + All hardware supported in 3.3.6 is also supported in 4.1.0. The + NM2230 and later chips are only supported in 4.1.0. 22. NVIDIA @@ -385,15 +385,15 @@ architectures known to work on (e.g., Alpha, PPC), etc. (Ultra, Vanta, M64), GeForce (DDR, 256) and Quadro is provided by the XF86_SVGA server and the nv driver. - 4.0.2: + 4.1.0: 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. 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. + in 4.1.0. Support for the newer chips (GeForce2 and later) is + only available in 4.1.0. 23. Number Nine @@ -401,12 +401,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. 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: + 4.1.0: Support (accelerated) for the Imagine 128, Ticket 2 Ride, Revolu- tion 3D and Revolution IV is provided by the "i128" 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.1.0. 24. Oak Technologies, Inc. @@ -415,12 +415,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. acceleration) is provided by the XF86_SVGA server and the oak driver. - 4.0.2: + 4.1.0: No native support for these chipsets, because the old driver has not been ported. Summary: - No Oak chips are supported in 4.0.2. + No Oak chips are supported in 4.1.0. 25. Paradise/Western Digital @@ -431,12 +431,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. port for some of these chipsets is uncertain because we don't have any recent test reports, and this driver has no maintainer. - 4.0.2: + 4.1.0: No native support for these chipsets, because the old driver has not been ported. Summary: - No Paradise/Western Digital chips are supported in 4.0.2. + No Paradise/Western Digital chips are supported in 4.1.0. 26. RealTek @@ -446,12 +446,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. unknown because we don't have any recent test reports, and this driver has no maintainer. - 4.0.2: + 4.1.0: No native support for these chipsets, because the old driver has not been ported. Summary: - No RealTek chips are supported in 4.0.2. + No RealTek chips are supported in 4.1.0. 27. Rendition/Micron @@ -459,12 +459,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. Support for the Verite 1000, 2100 and 2200 is provided by the XF86_SVGA server with the rendition driver. - 4.0.2: + 4.1.0: Support for the Verite 1000, 2100 and 2200 is provided by the "rendition" 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.1.0. 28. S3 @@ -481,7 +481,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. age2000, is provided by the XF86_SVGA server with the s3_savage driver on some OSes (Linux, *BSD). - 4.0.2: + 4.1.0: 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 (accelerated) for the @@ -491,19 +491,19 @@ architectures known to work on (e.g., Alpha, PPC), etc. 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. + 4.1.0. 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: + 4.1.0: Unaccelerated support for the SGI Indy's Newport cards is pro- vided by the "newport" driver. Summary: - SGI hardware is supported only in 4.0.2. + SGI hardware is supported only in 4.1.0. 30. Silicon Integrated Systems (SiS) @@ -512,7 +512,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. 86C225, 5597, 5598, 6326, 530, 620, 300, 630 and 540 is provided by the XF86_SVGA server with the sis driver. - 4.0.2: + 4.1.0: Support (accelerated) for the SiS 530, 620, 6326 is provided by the "sis" driver. The 630, 300, and 540 are also supported, but this code is new and there are @@ -529,20 +529,20 @@ architectures known to work on (e.g., Alpha, PPC), etc. LynxEM+ and Lynx3DM chips is provided by the XF86_SVGA server with the smi driver. - 4.0.2: + 4.1.0: 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. + All hardware supported in 3.3.6 is also supported in 4.1.0. 32. Sun Microsystems 3.3.6: No Sun hardware is supported in 3.3.6. - 4.0.2: + 4.1.0: 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 @@ -552,7 +552,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. framebuffers are supported by the "suntcx" driver. Summary: - Sun hardware is supported only in 4.0.2. + Sun hardware is supported only in 4.1.0. 33. Trident Microsystems @@ -567,7 +567,7 @@ architectures known to work on (e.g., Alpha, PPC), etc. CyberBlade/DSTN/i7 and CyberBlade/i1 is provided by the XF86_SVGA server with the tvga8900 driver. - 4.0.2: + 4.1.0: Support (accelerated where the chip supports it) for the TVGA8900D, TGUI9440AGi, TGUI9660, TGUI9680, ProVidia 9682, Pro- Vidia 9685, Cyber9320, Cyber9382, Cyber9385, Cyber9388, @@ -579,10 +579,10 @@ architectures known to work on (e.g., Alpha, PPC), etc. Summary: The following (older) chipsets that are supported in 3.3.6 are - not supported in 4.0.2: TVGA8200LX, TVGA8800CS, TVGA8900B, + not supported in 4.1.0: TVGA8200LX, TVGA8800CS, TVGA8900B, TVGA8900C, TVGA8900CL, TVGA9000, TVGA9000i, TVGA9100B, TVGA9200CXr, TGUI9400CXi, TGUI9420, TGUI9430DGi. The remaining - listed chipsets are supported in 4.0.2. + listed chipsets are supported in 4.1.0. 34. Tseng Labs @@ -594,13 +594,13 @@ architectures known to work on (e.g., Alpha, PPC), etc. driver. Support (accelerated) for the ET4000/W32 series and the ET6000 is also provided by the deprecated XF86_W32 server. - 4.0.2: + 4.1.0: Support for the ET4000AX, and accelerated support for the ET4000/W32, ET4000/W32i, ET4000/W32p, ET6000 and ET6100 is pro- vided by the "tseng" driver. Summary: - All cards supported by 3.3.6 are also supported by 4.0.2 except + All cards supported by 3.3.6 are also supported by 4.1.0 except for the old ET3000. 35. Video 7 @@ -611,12 +611,12 @@ architectures known to work on (e.g., Alpha, PPC), etc. unknown because we don't have any recent test reports, and this driver has no maintainer. - 4.0.2: + 4.1.0: No native support for these chipsets, because the old driver has not been ported. Summary: - No Video 7 chips are supported in 4.0.2. + No Video 7 chips are supported in 4.1.0. 36. Weitek @@ -625,14 +625,14 @@ architectures known to work on (e.g., Alpha, PPC), etc. server and accelerated support for the P9100 is provided by the XF86_SVGA server with the p9x00 driver. - 4.0.2: + 4.1.0: No native support for these chipsets, because the old drivers have not been ported. Summary: - No Weitek chips are supported in 4.0.2. + No Weitek chips are supported in 4.1.0. - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml,v 1.29 2001/04/04 01:34:18 dawes Exp $ + Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml,v 1.29.2.2 2001/06/01 18:09:49 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/Status,v 1.23 2001/04/10 16:44:32 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/Status,v 1.23.2.2 2001/06/01 18:26:45 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/Versions b/xc/programs/Xserver/hw/xfree86/doc/Versions index d681c5f75..feedad8e3 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/Versions +++ b/xc/programs/Xserver/hw/xfree86/doc/Versions @@ -298,4 +298,4 @@ and any other 4.0.x releases will continue with the Mmnn scheme. Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Versions.sgml,v 1.1 2001/02/07 18:49:31 dawes Exp $ -$XFree86: xc/programs/Xserver/hw/xfree86/doc/Versions,v 1.1 2001/02/07 18:52:28 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/Versions,v 1.1.4.1 2001/06/01 18:26:46 dawes Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml index a9ca6d546..b4d541442 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml @@ -27,7 +27,7 @@ <title>XFree86 X server ``New Design'' (DRAFT) <author>The XFree86 Project, Inc -<date>Last modified 2 December 2000 +<date>Last modified 1 May 2001 @@ -36,7 +36,7 @@ <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.40 2000/12/27 04:57:08 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.44 2001/05/19 00:40:30 dawes Exp $ </ident> @@ -2561,7 +2561,7 @@ Next, the higher level functions that most drivers would use. </quote> - &s.code;OptionInfoPtr xf86TokenToOptinfo(OptionInfoPtr table, int token)&e.code; + &s.code;OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int token)&e.code; <quote><p> Returns a pointer to the &s.code;OptionInfoRec&e.code; in &s.code;table&e.code; with a token field matching @@ -2570,7 +2570,7 @@ Next, the higher level functions that most drivers would use. </quote> - &s.code;Bool xf86IsOptionSet(OptionInfoPtr table, int token)&e.code; + &s.code;Bool xf86IsOptionSet(const OptionInfoRec *table, int token)&e.code; <quote><p> Returns the &s.code;found&e.code; field of the &s.code;OptionInfoRec&e.code; in &s.code;table&e.code; with a @@ -2582,7 +2582,7 @@ Next, the higher level functions that most drivers would use. </quote> - &s.code;char *xf86GetOptValString(OptionInfoPtr table, int token)&e.code; + &s.code;char *xf86GetOptValString(const OptionInfoRec *table, int token)&e.code; <quote><p> Returns the &s.code;value.str&e.code; field of the &s.code;OptionInfoRec&e.code; in &s.code;table&e.code; with a @@ -2591,7 +2591,7 @@ Next, the higher level functions that most drivers would use. </quote> - &s.code;Bool xf86GetOptValInteger(OptionInfoPtr table, int token, + &s.code;Bool xf86GetOptValInteger(const OptionInfoRec *table, int token, &f.indent;int *value)&e.code; <quote><p> Returns via &s.code;*value&e.code; the &s.code;value.num&e.code; @@ -2604,7 +2604,7 @@ Next, the higher level functions that most drivers would use. </quote> - &s.code;Bool xf86GetOptValULong(OptionInfoPtr table, int token, + &s.code;Bool xf86GetOptValULong(const OptionInfoRec *table, int token, &f.indent;unsigned long *value)&e.code; <quote><p> Like &s.code;xf86GetOptValInteger()&e.code;, except the value is @@ -2612,7 +2612,7 @@ Next, the higher level functions that most drivers would use. </quote> - &s.code;Bool xf86GetOptValReal(OptionInfoPtr table, int token, + &s.code;Bool xf86GetOptValReal(const OptionInfoRec *table, int token, &f.indent;double *value)&e.code; <quote><p> Like &s.code;xf86GetOptValInteger()&e.code;, except that @@ -2620,7 +2620,7 @@ Next, the higher level functions that most drivers would use. </quote> - &s.code;Bool xf86GetOptValFreq(OptionInfoPtr table, int token, + &s.code;Bool xf86GetOptValFreq(const OptionInfoRec *table, int token, &f.indent;OptFreqUnits expectedUnits, double *value)&e.code; <quote><p> Like &s.code;xf86GetOptValInteger()&e.code;, except that the @@ -2636,7 +2636,7 @@ Next, the higher level functions that most drivers would use. </quote> - &s.code;Bool xf86GetOptValBool(OptionInfoPtr table, int token, Bool *value)&e.code; + &s.code;Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value)&e.code; <quote><p> This function is used to check boolean options (&s.code;OPTV_BOOLEAN&e.code;). If the function return value is @@ -2654,7 +2654,7 @@ Next, the higher level functions that most drivers would use. </quote> - &s.code;Bool xf86ReturnOptValBool(OptionInfoPtr table, int token, Bool def)&e.code; + &s.code;Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def)&e.code; <quote><p> This function is used to check boolean options (&s.code;OPTV_BOOLEAN&e.code;). If the option is set, its value @@ -5774,7 +5774,15 @@ programming the standard VGA registers, and for handling VGA colourmaps. &s.code;hwp&e.code; with the standard VGA set of functions. This is called by &s.code;vgaHWGetHWRec()&e.code;, so there is usually no need to call this explicitly. The register access functions - are described below. + are described below. If the registers are shadowed in some other + port I/O space (for example a PCI I/O region), these functions + can be used to access the shadowed registers if + &s.code;hwp->PIOOffset&e.code; is initialised with + &s.code;offset&e.code;, calculated in such a way that when the + standard VGA I/O port value is added to it the correct offset into + the PIO area results. This value is initialised to zero in + &s.code;vgaHWGetHWRec()&e.code;. (Note: the PIOOffset functionality + is present in XFree86 4.1.0 and later.) </quote> @@ -5861,6 +5869,20 @@ programming the standard VGA registers, and for handling VGA colourmaps. </quote> + &s.code;void vgaHWEnable(vgaHWPtr hwp)&e.code; + <quote><p> + This function enables the VGA subsystem. (Note, this function is + present in XFree86 4.1.0 and later.). + + </quote> + + &s.code;void vgaHWDisable(vgaHWPtr hwp)&e.code; + <quote><p> + This function disables the VGA subsystem. (Note, this function is + present in XFree86 4.1.0 and later.). + + </quote> + &s.code;void vgaHWSave(ScrnInfoPtr pScrn, vgaRegPtr save, int flags)&e.code; <quote><p> This function saves the VGA state. The state is written to the @@ -6188,6 +6210,20 @@ programming the standard VGA registers, and for handling VGA colourmaps. Return the value read from the DAC Data register. </quote> + + &s.code;CARD8 readEnable(vgaHWptr hwp)&e.code; + <quote><p> + Return the value read from the VGA Enable register. (Note: This + function is present in XFree86 4.1.0 and later.) + + </quote> + + &s.code;void writeEnable(vgaHWPtr hwp, CARD8 value)&e.code; + <quote><p> + Write &s.code;value&e.code; to the VGA Enable register. (Note: This + function is present in XFree86 4.1.0 and later.) + + </quote> </quote> <sect>Some notes about writing a driver<label id="sample"> @@ -6409,6 +6445,7 @@ typedef struct { Bool noAccel; Bool hwCursor; CloseScreenProcPtr CloseScreen; + OptionInfoPtr Options; ... } ZZZRec, *ZZZPtr; </code> @@ -6425,15 +6462,13 @@ typedef enum { OPTION_NOACCEL } ZZZOpts; -static OptionInfoRec ZZZOptions[] = { +static const OptionInfoRec ZZZOptions[] = { { OPTION_FOO_HACK, "FooHack", OPTV_INTEGER, {0}, FALSE }, { OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; - -#define nZZZOptions (sizeof(ZZZOptions) / sizeof(ZZZOptions[0])) </code> <p> </itemize> @@ -6721,8 +6756,6 @@ ZZZProbe(DriverPtr drv, int flags) static Bool ZZZPreInit(ScrnInfoPtr pScrn, int flags) { - OptionInfoRec options[nZZZOptions]; - /* Fill in the monitor field */ pScrn->monitor = pScrn->confScreen->monitor; @@ -6801,10 +6834,14 @@ ZZZPreInit(ScrnInfoPtr pScrn, int flags) /* * Process the options based on the information in ZZZOptions. - * The results are written to options. + * The results are written to pZzz->Options. If all of the options + * processing is done within this function a local variable "options" + * can be used instead of pZzz->Options. */ - (void)memcpy(options, ZZZOptions, sizeof(ZZZOptions)); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); + if (!(pZzz->Options = xalloc(sizeof(ZZZOptions)))) + return FALSE; + (void)memcpy(pZzz->Options, ZZZOptions, sizeof(ZZZOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pZzz->Options); /* * Set various fields of ScrnInfoRec and/or ZZZRec based on @@ -6812,25 +6849,25 @@ ZZZPreInit(ScrnInfoPtr pScrn, int flags) */ from = X_DEFAULT; pZzz->hwCursor = FALSE; - if (xf86IsOptionSet(options, OPTION_HW_CURSOR)) { + if (xf86IsOptionSet(pZzz->Options, OPTION_HW_CURSOR)) { from = X_CONFIG; pZzz->hwCursor = TRUE; } xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pZzz->hwCursor ? "HW" : "SW"); - if (xf86IsOptionSet(options, OPTION_NOACCEL)) { + if (xf86IsOptionSet(pZzz->Options, OPTION_NOACCEL)) { pZzz->noAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } else { pZzz->noAccel = FALSE; } - if (xf86IsOptionSet(options, OPTION_PCI_RETRY)) { + if (xf86IsOptionSet(pZzz->Options, OPTION_PCI_RETRY)) { pZzz->UsePCIRetry = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n"); } pZzz->fooHack = 0; - if (xf86GetOptValInteger(options, OPTION_FOO_HACK, + if (xf86GetOptValInteger(pZzz->Options, OPTION_FOO_HACK, &pZzz->fooHack)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Foo Hack set to %d\n", pZzz->fooHack); diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml index 392439d35..9107b97ff 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml @@ -10,10 +10,10 @@ <author> <htmlurl url="http://www.valinux.com/" name="VA Linux Systems, Inc."> Professional Services - Graphics. - <date>15 March 2001 + <date>3 May 2001 <ident> - $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.21 2001/04/10 16:07:58 dawes Exp $ + $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.24 2001/05/19 00:42:22 dawes Exp $ </ident> <toc> @@ -131,16 +131,15 @@ </itemize> <item>ATI Rage 128, supported on Intel x86 and AMD: <itemize> - <item>Rage Fury AGP - <item>Rage Magnum AGP - <item>XPERT 2000 AGP - <item>XPERT 128 AGP - <item>XPERT 99 AGP - <item>All-in-Wonder 128 AGP + <item>Rage Fury + <item>Rage Magnum + <item>XPERT 2000 + <item>XPERT 128 + <item>XPERT 99 + <item>All-in-Wonder 128 </itemize> - The PCI versions of these cards also have minimal support. - Note that there are Rage 128 Pro boards on the market but they're - not yet supported. + Note that both PCI and AGP versions of Rage 128 based cards + are supported at this time. <item>ATI Radeon, supported on Intel x86 and AMD: <itemize> <item>Radeon SDR AGP @@ -678,7 +677,7 @@ <sect1>3dfx Banshee, Voodoo3, Voodoo4 and Voodoo5 Series <p> - <sect2>Dependencies + <sect2>Requirements <p> The 3dfx DRI driver requires special versions of the 3dfx Glide library. @@ -792,7 +791,7 @@ 32bpp mode is fully 3D accelerated. </itemize> - <sect2>Performance + <sect2>Performance and Features <p> <itemize> <item> @@ -874,6 +873,9 @@ <item> The lowest mipmap level is sometimes miscolored in trilinear- sampled polygons. + <item> + The GL_EXT_texture_env_combine extension is supported on the + Voodoo4 and Voodoo5. </itemize> <sect2>Known Problems @@ -900,13 +902,10 @@ <sect1>Intel i810 <p> - <sect2>Dependencies + <sect2>Requirements +<p> + A kernel with AGP GART support (such as Linux 2.4.x) is needed. <p> - A Linux kernel with AGP GART support is required. - The 2.2.x kernel series does not have AGP GART support. - The 2.4.x test kernels have AGP GART and have been tested - with the i810. - <p> <sect2>Configuration <p> @@ -966,15 +965,29 @@ rendering will be disabled. </itemize> + <sect2>Performance and Features +<p> + Basically all of the i810 features which can be exposed through + OpenGL 1.2 are implemented. + However, the following OpenGL features are implemented in software + and will be slow: + <itemize> + <item>Stencil buffer and accumulation buffer operations + <item>Blend subtract, min/max and logic op blend modes + <item>glColorMask when any mask is set to false + <item>GL_SEPARATE_SPECULAR_COLOR lighting mode + <item>glDrawBuffer(GL_FRONT_AND_BACK) + <item>Using 1D or 3D textures + <item>Using texture borders + </itemize> <p> <sect1>Matrox G200 and G400 <p> - <sect2>Dependencies + <sect2>Requirements +<p> + A kernel with AGP GART support (such as Linux 2.4.x) is needed. <p> - A Linux kernel with AGP GART support (such as the 2.4.x test - kernels) is needed. - <p> <sect2>Configuration <p> Your XF86Config file's device section must specify the @@ -1028,7 +1041,7 @@ <tt>/usr/X11R6/lib/modules/dri/mga_dri.so</tt>. This will be automatically loaded by libGL.so. - <sect2>Performance + <sect2>Performance and Features <p> Software rendering will be used under any of the following conditions: @@ -1048,7 +1061,7 @@ on your motherboard. <p> - Compaq has funded the implementation of AGP acclerated + Compaq has funded the implementation of AGP accelerated ReadPixels and DrawPixels in this driver. With this implementation, on a G400 drawing directly from AGP memory (exported to the client), throughput of up to 1 GB/sec has @@ -1126,11 +1139,10 @@ <sect1>ATI Rage 128 <p> - <sect2>Dependencies + <sect2>Requirements +<p> + A kernel with AGP GART support (such as Linux 2.4.x) is needed. <p> - A Linux kernel with AGP GART support (such as the 2.4.x test - kernels) is needed. - <p> <sect2>Configuration <p> Your XF86Config file's device section must specify the @@ -1175,7 +1187,7 @@ You may also set your screen depth to 32 for 32bpp mode. <p> - <sect2>Performance + <sect2>Performance and Features <p> While PCI Rage 128 based cards are supported, they do not yet support PCI GART, so they will not perform as well as their @@ -1185,7 +1197,20 @@ used by default. Higher AGP speeds may result in unreliable performance depending on your motherboard. - +<p> + Note that even at 32bpp there is no alpha channel. +<p> + The following OpenGL features are implemented in software and + will be slow: + <itemize> + <item>Stencil buffer and accumulation buffer operations + <item>Blend subtract, min/max and logic op blend modes + <item>GL_SEPARATE_SPECULAR_COLOR lighting mode + <item>glDrawBuffer(GL_FRONT_AND_BACK) + <item>Using 1D or 3D textures + <item>Using texture borders + </itemize> +<p> <sect2>Known Problems <p> If you experience stability problems you may try setting the @@ -1197,11 +1222,10 @@ <sect1>ATI Radeon <p> - <sect2>Dependencies + <sect2>Requirements +<p> + A kernel with AGP GART support (such as Linux 2.4.x) is needed. <p> - A Linux kernel with AGP GART support (such as the 2.4.x test - kernels) is needed. - <p> <sect2>Configuration <p> Your XF86Config file's device section must specify the @@ -1245,7 +1269,7 @@ You may also set your screen depth to 32 for 32bpp mode. <p> - <sect2>Performance + <sect2>Performance and Features <p> While this driver supports many of the features of ATI Radeon cards, we do not <em/yet/ fully support the card's TCL @@ -1254,11 +1278,38 @@ The AGP mode may be set to 1, 2, or 4. One is used by default. Higher AGP speeds may result in unreliable performance depending on your motherboard. - +<p> + The following OpenGL features are implemented in software and will + be slow: + <itemize> + <item>Blend subtract, blend min/max and blend logicops + <item>Stencil and accumulation operations + <item>1D and 3D textures + <item>Texture borders + </itemize> +<p> + The GL_EXT_texture_env_combine, GL_EXT_texture_env_add and + GL_EXT_texture_env_dot3 extensions are supported (or will be + soon supported in the new driver based on Mesa 3.5). +<p> + We hope to implement support for the following features in the + future: + <itemize> + <item>Vertex transformation, clipping and lighting (TCL) + <item>Hardware stencil buffer + <item>Cube map textures + <item>3D textures + <item>Three texture units + </itemize> +<p> <sect2>Known Problems <p> - None. - + Certain (early?) revisions of the AMD Irongate chipset have + AGPGART problems which effect Radeon, and other graphics cards. + The card may work unreliably, or not work at all. If the DRM + kernel module is not loaded, the 2D Xserver may work. There's + hope that this can be fixed in the future. +<p> <sect1>3DLabs Oxygen GMX 2000 <p> @@ -1274,7 +1325,7 @@ overlays, stereo, hardware-accelerated indirect rendering. <p> OpenGL-like functionality is provided with the Mesa library. - XFree86 4.0.2 uses Mesa 3.4. + XFree86 4.1.0 uses Mesa 3.4.2. Subsequent releases of XFree86 will use newer versions of Mesa. When newer versions of Mesa are available, the 3D drivers can be updated without reinstalling XFree86 or libGL.so. @@ -1369,8 +1420,8 @@ <p> A collection of useful configuration files, libraries, headers, utilities and demo programs is available from - <htmlurl url="http://dri.sourceforge.net/resources/resources.html" - name="http://dri.sourceforge.net/resources/resources.html"> + <htmlurl url="http://dri.sourceforge.net/res.phtml" + name="http://dri.sourceforge.net/res.phtml"> <sect1>Documentation <p> @@ -1385,7 +1436,8 @@ <item>Visit the <htmlurl url="http://dri.sourceforge.net" name="DRI project on SourceForge.net"> for the latest development news about the DRI and 3D drivers. - <item>The <htmlurl url="http://dri.sourceforge.net/DRIcompile.html" + <item>The <htmlurl + url="http://dri.sourceforge.net/doc/DRIcompile.html" name="DRI Compilation Guide"> explains how to download, compile and install the DRI for yourself. </itemize> diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml index f77dce508..75dc89bd9 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml @@ -10,10 +10,10 @@ <author> <htmlurl url="http://www.valinux.com/" name="VA Linux Systems, Inc."> Professional Services - Graphics. - <date>15 March 2001 + <date>21 April 2001 <ident> - $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.13 2001/04/05 19:29:42 dawes Exp $ + $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.14 2001/05/02 15:06:08 dawes Exp $ </ident> <toc> @@ -175,7 +175,8 @@ <item>hit ESC to return to the top-level menu <item>Go to <em>Character devices</em> <item>Disable <em>Direct Rendering Manager (XFree86 DRI support)</em> - since we'll use the DRI module from the XFree86/DRI tree. + since we'll use the DRI code from the XFree86/DRI tree and will + compile it there. <item>Go to <em>/dev/agpgart (AGP Support) (EXPERIMENTAL) (NEW)</em> <item>Hit SPACE twice to build AGP support into the kernel <item>Enable all chipsets' support for AGP @@ -503,7 +504,7 @@ <tt>/usr/src/linux-2.4.x</tt>, <verb> cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel - make TREE=/usr/src/linux-2.4 + make TREE=/usr/src/linux-2.4.x/include </verb> or alternatively, edit Makefile to include this change. <p> @@ -516,7 +517,7 @@ The DRI kernel modules are in <tt>~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/</tt>. <p> - To load the appropriate DRI module in your running kernel you can + To load the appropriate DRM module in your running kernel you can either use ismod and restart your X server or copy the kernel module to <tt>/lib/modules/2.4.x/kernel/drivers/char/drm/</tt> then run depmod and restart your X server. @@ -524,6 +525,9 @@ Make sure you first unload any older DRI kernel modules that might be already loaded. <p> + Note that some DRM modules require that the <tt>agpgart</tt> module + be loaded first. + <p> <sect>Normal Installation and Configuration <p> diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml index 17003440d..1659fc89b 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml @@ -5,10 +5,10 @@ <article> <title>XFree86 on Darwin and Mac OS X <author>Torrey T. Lyons -<date>11 December 2000 +<date>25 May 2001 <ident> -$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/sgml/Darwin.sgml,v 1.4.4.2 2001/06/02 04:44:37 torrey Exp $ </ident> <toc> @@ -19,8 +19,7 @@ $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Darwin.sgml,v 1.4 2000/12/12 1 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 +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 @@ -28,21 +27,36 @@ 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/. +XFree86 can be run either from the console or side by side with +Mac OS X's Aqua desktop in a full screen mode. In full screen mode +with Aqua, when the X window system is active, it takes over the entire +screen. You can switch back to the Mac OS X desktop by holding down +Command-Option-A. This key combination can be changed in the user +preferences. From the Mac OS X desktop, just click on the XDarwin +icon in the floating switch window to switch back to the X window system. +You can change this behavior in the user preferences so that clicking on +the XDarwin icon in the Dock switches as well. The full screen cooperative +mode with Aqua is known as Quartz mode, named after the Quartz 2D +compositing engine used by Aqua. + +<p> +From the console, 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 +or Mac OS X systems. The descriptions found elsewhere of devices +supported by XFree86 for other operating systems also do not apply. +Running XFree86 from the text console is known as IOKit mode. + +<p> +XFree86 for Darwin or Mac OS X 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, you may need to download +additional third-party drivers from +<htmlurl url="http://www.publicsource.apple.com/projects/darwin/" +name="Apple's Darwin site">. IOKit drivers are typically installed in +<tt>/System/Library/Extensions/</tt> or <tt>/Library/Extensions/</tt>. <p> Multi-button and scroll wheel mouse support works well with all @@ -53,42 +67,27 @@ mice. <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">. +Darwin and Mac OS X are very similar. Where there are differences +I have noted them below. Note that to build XFree86 for yourself on +Mac OS X, you will need to install the Developers' Tools. <p> -If you want to save some time, you can use the precompiled binaries -provided by the XFree86 server at <url +If you don't feel the need to live on the cutting edge, you can save +some time and effort by using the precompiled binaries available on +the XFree86 FTP 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. +document to install it. This will create two new directory trees, +<tt>/usr/X11R6</tt> and <tt>/etc/X11</tt> For Mac OS X Quartz +support, download the optional Xquartz.tgz tarball. <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, +on <ref id="running" name="running the X window system"> 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> @@ -96,11 +95,11 @@ 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 +<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 +<htmlurl url="http://www.xfree86.org/cvs/" name="XFree86 instructions"> 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 @@ -117,24 +116,6 @@ 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 @@ -146,47 +127,43 @@ make World >& world.log (wait for several hours) -su root -make install >& install.log -make install.man >& man.log +sudo make install >& install.log +sudo make install.man >& man.log </verb></tscreen> -<sect>Run X Windows<label id="running"> +<sect>Run the X Window System<label id="running"> <p> -You will want to add the X windows executables to your path. Your path +You will want to add the X window 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): +following two lines to a file named +<tt>~/Library/init/tcsh/path</tt>: (You may need to create this file and +directory path if it does not exist already.) + <tscreen><verb> -setenv MANPATH "${MANPATH}:/usr/X11R6/man:/usr/local/man" setenv PATH "${PATH}:/usr/X11R6/bin" +setenv MANPATH "${MANPATH}:/usr/X11R6/man" </verb></tscreen> -Now type ``<tt>source ~/.cshrc;rehash</tt>'' to -get these changes to take effect. On future logins, this file will be +The next time you login or open a Terminal window, 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. +You are now ready to go. On Mac OS X, you can run XFree86 from the +text console or in full screen mode with Aqua. To get to the text +console in Mac OS X you need to logout and type ``>console'' as +the user name. This will shutdown Core Graphics and +bring up the console login prompt. Login again as your user. <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. +From the text console you can start the X Window System 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 +When you are ready to quit XFree86 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 @@ -194,25 +171,36 @@ 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 +Mac OS X, Core Graphics will restart and you should be given a login window. <p> +To start XFree86 in Quartz mode you can launch the XDarwin application +in the <tt>/Applications</tt> folder, or from the command line type +``startx -- -quartz''. When the X window system is active, it takes over +the entire screen. You can switch back to the Mac OS X desktop by +holding down Command-Option-A. This key combination can be changed in +the user preferences. From the Mac OS X desktop, just click on the +XDarwin icon in the floating switch window to switch back to the X window +system. You can change this behavior in the user preferences so that +clicking on the XDarwin icon in the Dock switches as well. + +<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 +The X window system 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>. +programs are run when you start the X window system. You can find a sample +<tt>.xinitrc</tt> file in <tt>/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 +There are several window managers that have been ported to Darwin. +The best collection of window managers and other X window clients +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 @@ -230,195 +218,21 @@ 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>The bell does not work in IOKit mode. -<item>Server shutdown problem: After quitting the X server the colored -beachball cursor reappears, but the screen never returns to the +<item>Server shutdown problem: After quitting the X server in IOKit mode, +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>The display mode can not be changed once the X server +has started. -<item>Key repeat rate can not be adjusted. -</itemize> +<item>A screen saver is not supported. -<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/Imakefile b/xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile index c9b0477bb..334b798a9 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile @@ -3,14 +3,23 @@ XCOMM $XConsortium: Imakefile /main/16 1996/10/28 05:13:04 kaleb $ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile,v 3.71 2001/03/02 02:45:37 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile,v 3.71.2.1 2001/06/01 18:09:48 dawes Exp $ #include <Server.tmpl> #include <lnxdoc.rules> +/* Set this to YES if the RELNOTES file is up to date */ +#ifndef BuildRelnotes +#define BuildRelnotes NO +#endif + +#if BuildRelnotes +RELNOTES=RELNOTES.sgml +#endif + SGMLDEPENDS = defs.ent MANSGMLDEPENDS = mdefs.ent - INDEXLIST = README.sgml RELNOTES.sgml Status.sgml LICENSE.sgml Install.sgml \ + INDEXLIST = README.sgml $(RELNOTES) Status.sgml LICENSE.sgml Install.sgml \ DESIGN.sgml Versions.sgml \ mouse.sgml fonts.sgml DRI.sgml DRIcomp.sgml dps.sgml \ Darwin.sgml isc.sgml LynxOS.sgml NetBSD.sgml OpenBSD.sgml \ @@ -105,7 +114,9 @@ LinuxDocTarget(LICENSE) LinuxDocTargetLong(QStart.sgml,QuickStart.doc,QuickStart) #endif LinuxDocTarget(README) +#if BuildRelnotes LinuxDocTarget(RELNOTES) +#endif LinuxDocTarget(Status) /* Other docs */ @@ -149,6 +160,8 @@ clean:: FORMATTEDDIR = .. +#if BuildRelnotes /* Update RELNOTES at top level */ UpdateFormattedDoc(RELNOTES,$(TOP)) +#endif diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml index c4b02d73d..97b5da3e3 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>15 December 2000 +<date>1 June 2001 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml,v 1.11 2001/03/02 17:40:48 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Install.sgml,v 1.11.2.2 2001/06/01 18:09:48 dawes Exp $ </ident> <abstract> @@ -80,14 +80,31 @@ 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, -otherwise it won't run correctly. If you get lots of "command not found" -messages when you try to run it, then it is most likely because the -script wasn't downloaded in binary mode. Some web browsers won't do -this for files of that name, so we also have a copy of it called -"<tt>Xinstall.bin</tt>", and most browsers should download that correctly. -When downloading it under this name, select "save as" on your browser, -and save the file under the name "<tt>Xinstall.sh</tt>". +<bf>NOTES</bf>: + +<itemize> + <item>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 you try to run it, then it is most + likely because the script wasn't downloaded in binary mode. + Some web browsers won't do this for files of that name, so we + also have a copy of it called "<tt>Xinstall.bin</tt>", and most + browsers should download that correctly. When downloading it + under this name, select "save as" on your browser, and save the + file under the name "<tt>Xinstall.sh</tt>". + + <item>The Xinstall.sh script requires some system commands and + utilities to function correctly. While most systems will have + these, some Linux installations may not. If you find that the + script is failing because of some missing system command, you + will need to install it before you can continue. If you don't + know how to do this, then we recommend that you obtain this + version of XFree86 from your Operating System distributor. + + <item>Always use the version of the Xinstall.sh script that's provided + with the release you're installing. Older versions of the script + may not install newer releases correctly. +</itemize> Once you're run the <tt>Xinstall.sh</tt> script and found which binary <![ %updaterel; [update ]]>distribution is suitable for your system, @@ -98,27 +115,27 @@ will complain. <![ %fullrel [ <quote><verb> -1. Xinstall.sh The installer script -2. extract The utility for extracting tarballs -3. Xbin.tgz X clients/utilities and run-time libraries -4. Xlib.tgz Some data files required at run-time -5. Xman.tgz Manual pages -6. Xdoc.tgz XFree86 documentation -7. Xfnts.tgz Base set of fonts -8. Xfenc.tgz Base set of font encoding data -9. Xetc.tgz Run-time configuration files -10. Xvar.tgz Run-time data -11. Xxserv.tgz XFree86 X server -12. Xmod.tgz XFree86 X server modules +1. Xinstall.sh The installer script +2. extract The utility for extracting tarballs +3. Xbin.tgz X clients/utilities and run-time libraries +4. Xlib.tgz Some data files required at run-time +5. Xman.tgz Manual pages +6. Xdoc.tgz XFree86 documentation +7. Xfnts.tgz Base set of fonts +8. Xfenc.tgz Base set of font encoding data +9. Xetc.tgz Run-time configuration files +10. Xvar.tgz Run-time data +11. Xxserv.tgz XFree86 X server +12. Xmod.tgz XFree86 X server modules </verb></quote> ]]> <![ %updaterel [ <quote><verb> -1. Xinstall.sh The installer script -2. extract The utility for extracting tarballs -3. Xupdate.tgz Updated files except X server drivers -4. Xdrivers.tgz Updated X server drivers +1. Xinstall.sh The installer script +2. extract The utility for extracting tarballs +3. Xupdate.tgz Updated files except X server drivers +4. Xdrivers.tgz Updated X server drivers </verb></quote> ]]> @@ -145,23 +162,21 @@ NOTES: </itemize> <![ %fullrel [ -The following thirteen (13) tarballs are optional. You should download +The following eleven (11) tarballs are optional. You should download the ones you want to install. <quote><verb> -1. Xfsrv.tgz Font server -2. Xnest.tgz Nested X server -3. Xprog.tgz X header files, config files and compile-time libs -4. Xprt.tgz X Print server -5. Xvfb.tgz Virtual framebuffer X server -6. Xf100.tgz 100dpi fonts -7. Xfcyr.tgz Cyrillic fonts -8. Xflat2.tgz Latin-2 fonts -9. Xfnon.tgz Some large bitmap fonts -10. Xfscl.tgz Scalable fonts (Speedo and Type1) -11. Xhtml.tgz HTML version of the documentation -12. Xps.tgz PostScript version of the documentation -13. Xjdoc.tgz Documentation in Japanese +1. Xfsrv.tgz Font server +2. Xnest.tgz Nested X server +3. Xprog.tgz X header files, config files and compile-time libs +4. Xprt.tgz X Print server +5. Xvfb.tgz Virtual framebuffer X server +6. Xf100.tgz 100dpi fonts +7. Xfcyr.tgz Cyrillic fonts +8. Xfscl.tgz Scalable fonts (Speedo and Type1) +9. Xhtml.tgz HTML version of the documentation +10. Xps.tgz PostScript version of the documentation +11. Xjdoc.tgz Documentation in Japanese </verb></quote> NOTES: @@ -383,6 +398,7 @@ ln -s /etc/X11/xdm /usr/X11R6/lib/X11 ln -s /etc/X11/xinit /usr/X11R6/lib/X11 ln -s /etc/X11/xsm /usr/X11R6/lib/X11 ln -s /etc/X11/xserver /usr/X11R6/lib/X11 +chmod ug-w /usr/X11R6/lib # Make sure the permissions are OK /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 @@ -461,6 +477,7 @@ Once that's done, the main part of the installation can be done: ./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 +chmod ug-w /usr/X11R6/lib # Make sure the permissions are OK /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 diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml index 47f9d66d4..08618a679 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml @@ -12,7 +12,7 @@ Matthieu Herrb <Date>Last modified on: 3 March 2001 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.60 2001/03/04 09:47:34 herrb Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/NetBSD.sgml,v 3.60.2.1 2001/06/01 18:09:48 dawes Exp $ </ident> <toc> @@ -56,8 +56,10 @@ this file and we'll revise it. <sect>New OS dependent features <p> +<![ %haverelnotes [ See the <htmlurl url="RELNOTES.html" name="Release Notes"> for non-OS dependent new features in XFree86 &relvers;. +]]> <sect1>New OS dependent features in 4.0.2 <p> diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml index 55b0f8198..c476cedf1 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml @@ -5,6 +5,7 @@ <!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 --> +<!ENTITY % removefiles 'INCLUDE'> <!-- patching requires removing some files --> ]> @@ -12,10 +13,10 @@ <title>README for XFree86&tm; &relvers; <author>The XFree86 Project, Inc -<date>15 December 2000 +<date>2 June 2001 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.113 2001/03/16 22:13:19 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/README.sgml,v 3.113.2.3 2001/06/02 16:17:40 dawes Exp $ </ident> <abstract> @@ -33,8 +34,9 @@ operating systems on Intel and other platforms. <![ %updaterel [ XFree86 &relvers; is the &whichupdaterel; update to &fullrelvers;, -the &whichfullrel; full release in the <![ %earlyrel; [new]]> XFree86 -4 series. +the &whichfullrel; full release in the +<![ %earlyrel; [new]]> +XFree86 4 series. Update releases are taken from a stable/maintenance branch. They are designed to be installed on top of the full release that they are @@ -44,8 +46,9 @@ stability. ]]> <![ %fullrel [ -XFree86 &relvers; is the &whichfullrel; full release in the <![ %earlyrel; -[new]]> XFree86 4 series. +XFree86 &relvers; is the &whichfullrel; full release in the +<![ %earlyrel; [new]]> +XFree86 4 series. ]]> <p> @@ -77,8 +80,10 @@ 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. +<![ %haverelnotes [ Specific release enhancements can be viewed in the <htmlurl name="Release Notes" url="RELNOTES.html">. +]]> The XFree86 version numbering system has had some changes as of the 4.0.2 release. Information about this can be found in the @@ -238,7 +243,7 @@ The source for version &fullrelvers; is split into three tarballs: <tt>X&fullsrcvers;src-1.tgz</tt>, <tt>X&fullsrcvers;src-2.tgz</tt>, <tt>X&fullsrcvers;src-3.tgz</tt>. The first contains everything except the fonts and general X11 documentation. It is sufficient for building -XFree86 is you already have a set of fonts. The second contains the +XFree86 if you already have a set of fonts. The second contains the fonts and the source for the general X11 documentation. The third contains the general X11 documentation in hardcopy format. @@ -339,14 +344,28 @@ gzip -d < &prevfullrelvers;-&fullrelvers;.diff3.gz | patch -p0 -E gzip -d < &prevfullrelvers;-&fullrelvers;.diff4.gz | patch -p0 -E </verb></tscreen> <![ %difftar; [ +<![ %removefiles; [ +<tscreen><verb> +rm -f xc/programs/xieperf/images/image.012 +rm -fr xc/fonts/bdf/latin2 +rm -fr xc/fonts/bdf/100dpi +rm -fr xc/fonts/bdf/75dpi +</verb></tscreen> +]]> <tscreen><verb> gzip -d < &fullrelvers;.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. +<![ %prevrelwasupdate; [ +Patches might also be available relative to &prevrelvers;. If so, the +instructions for applying them are the same, except that you should start +with a clean &prevrelvers; source tree. +]]> + +The contrib part of the distribution was folded into the main source +tree a while ago, so a separate contrib tarball is not required. To format the XFree86 documentation use the latest version of our doctools package available as <tt>doctools-&doctoolsvers;.tgz</tt>. diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml index dbc5d5bd4..3c041e23d 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml @@ -9,7 +9,7 @@ <date>17 December 2000 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.60 2001/03/02 17:40:48 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/RELNOTES.sgml,v 1.60.2.1 2001/06/02 16:28:25 torrey Exp $ </ident> <abstract> @@ -92,9 +92,10 @@ don't have enough space to cover them all here. <sect1>X server <p> <itemize> - <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" + <item>Darwin/Mac OS X is now supported on PowerPC and Intel/x86. The X + server runs from the console or in cooperation with the Mac OS X + Aqua GUI. 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. diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml index 61b42d3c2..6f91321b3 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml @@ -6,10 +6,10 @@ <title>Driver Status for XFree86™ &relvers; <author>The XFree86 Project, Inc -<date>4 December 2000 +<date>1 June 2001 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml,v 1.29 2001/04/04 01:34:18 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Status.sgml,v 1.29.2.2 2001/06/01 18:09:49 dawes Exp $ </ident> <abstract> @@ -18,7 +18,7 @@ This document provides information about the status of the driver and hardware support in XFree86 &relvers; compared with that in XFree86 &legacyvers;. Please send updates for this document to <email>fixes@xfree86.org</email>. Please do not send requests for -information or support to that address. +information or support to that address (they will not be answered). </abstract> @@ -157,7 +157,7 @@ other architectures known to work on (e.g., Alpha, PPC), etc. All chips supported in &legacyvers; are supported in &relvers; except for Mach8 and some old Mach32 chips. The support in &relvers; is, however, unaccelerated for all chips except the - Mach64, Rage and Rage 128 variants. + Mach64, Rage, Rage 128 and Radeon variants. </descrip> diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml b/xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml index 2cdc21479..3e10a52a6 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml @@ -8,10 +8,10 @@ <title> Information for Chips and Technologies Users <author> David Bateman (<email>dbateman@club-internet.fr</email>), Egbert Eich (<email>eich@xfree86.org</email>) -<date> 14th June 2000 +<date> 1st January 2001 <ident> -$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml,v 3.33 2000/12/02 21:52:22 dbateman Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/chips.sgml,v 3.36 2001/05/19 00:35:42 dawes Exp $ </ident> <!-- Table of contents --> @@ -276,15 +276,6 @@ Option "HWclocks" programmable clock makes this option obsolete and so it's use isn't recommended. It is completely ignored for HiQV chipsets. <tag> -Option "UseVclk1" -</tag> - The HiQV series of chips have three programmable clocks. The - first two are usually loaded with 25.175 and 28.322MHz for - VGA backward compatibility, and the third is used as a fully - programmable clock. On at least one system (the Inside 686 LCD/S - single board computer) the third clock is unusable. This option - forces the use of VClk1 as the programmable clock. -<tag> TextClockFreq 25.175 </tag> Except for the HiQV chipsets, it is impossible for the server to read @@ -311,6 +302,16 @@ Option "FPClock32" "65.0MHz" less, 16, 24 or 32bpp LCD panel clocks, where the options above set the clocks to 65MHz. <tag> +Option "CRTClkIndx" "2" +Option "FPClkIndx" "1" +</tag> + The HiQV series of chips have three programmable clocks. The + first two are usually loaded with 25.175 and 28.322MHz for + VGA backward compatibility, and the third is used as a fully + programmable clock. On at least one system (the Inside 686 LCD/S + single board computer) the third clock is unusable. These options + can be used to force a particular clock index to be used +<tag> Option "MMIO" </tag> This has a different effect depending on the hardware on which it @@ -318,12 +319,14 @@ Option "MMIO" BitBLT engine and is only usable with PCI buses. It is enabled by default for 65545 machines since the blitter can not be used otherwise. The HiQV series of chipsets must use MMIO with their - BitBLT engines, and so this is enabled by default. However the - 690xx chipsets can use MMIO for all communications with the video - processor. So using this option on a 690xx chipset forces them - to use MMIO for all communications. This only makes sense when - the 690xx is on a PCI bus so that normal PIO can be disabled. - (WARNING!! 690xx MMIO is untested) + BitBLT engines, and so this is enabled by default. +<tag> +Option "FullMMIO" +</tag> + The 690xx chipsets can use MMIO for all communications with the + video processor. So using this option on a 690xx chipset forces + them to use MMIO for all communications. This only makes sense + when the 690xx is on a PCI bus so that normal PIO can be disabled. <tag> Option "SuspendHack" </tag> @@ -442,6 +445,22 @@ Option "VideoKey" "255" 8bit depth, 0 to 32,767 for 15bit depth, etc. This option might be used if the default video overlay key causes problems. <tag> +Option "DualRefresh" +</tag> + The 69030 chipset has independent display channels, that can be + configured to support independent refresh rates on the flat panel + and on the CRT. The default behaviour is to have both the flat panel + and the CRT use the same display channel and thus the same refresh + rate. This option forces the two display channels to be used, giving + independent refresh rates. +<tag> +Option "Crt2Memory" "2048" +</tag> + The ct69030 supports dual-head display. By default the two display + share equally the available memory. This option forces the second + display to take a particular amount of memory. Please read the + section below about dual-head display. +<tag> Option "XaaNoScreenToScreenCopy", Option "XaaNoSolidFillRect", Option "XaaNoSolidHorVertLine", @@ -532,6 +551,12 @@ driver you'll needed to considered several points they specified after a suspend/resume or LCD/CRT switch. For a complete discussion on the dot clock limitations, see the next section. +<tag> * Dual-head display </tag> + Dual-head display has two effects on the modelines. Firstly, + the memory requirements of both heads must fit in the available + memory. Secondly, the memory bandwidth of the video processor is + shared between the two heads. Hence the maximum dot-clock might + need to be limited. </descrip> The driver is capable of driving both a CRT and a flat panel @@ -572,6 +597,105 @@ The NEC Versa 4080 just needs the "FixPanelSize" option. To the best of my knowledge no machine with a HiQV needs the "UseModeline" or "FixPanelSize" options. +<sect> Dual Display Channel<p> + +XFree86 releases later than 4.1.0 support dual-channel display on the ct69030. +This support can be used to give a single display image on two screen with +different refresh rates, or entirely different images on the two displays. + +Dual refresh rate display can be selected with the "<tt>DualRefresh</tt>" +option described above. However to use the dual-head support is slightly +more complex. Firstly, the ct69030 chipset must be installed on a PCI bus. This +is a driver limitation that might be relaxed in the future. In addition the +device, screen and layout sections of the "<tt>XF86Config</tt>" must be +correctly configured. A sample of an incomplete "<tt>XF86Config</tt>" is +given below + +<quote><verb> +Section "Device" + Identifier "Chips and Technologies - Pipe A" + Driver "chips" + BusID "PCI:0:20:0" + Screen 0 +EndSection + +Section "Device" + Identifier "Chips and Technologies - Pipe B" + Driver "chips" + BusID "PCI:0:20:0" + Screen 1 +EndSection + +Section "Screen" + Identifier "Screen 0" + Device "Chips and Technologies - Pipe A" + Monitor "generic LCD" + + SubSection "Display" + Depth 16 + Modes "1024x768" + EndSubsection +EndSection + +Section "Screen" + Identifier "Screen 1" + Device "Chips and Technologies - Pipe B" + Monitor "generic CRT" + + SubSection "Display" + Depth 16 + Modes "1024x768" + EndSubsection +EndSection + +Section "ServerLayout" + Identifier "Main Layout" + Screen "Screen 0" + Screen "Screen 1" RightOf "Screen 0" + InputDevice "Mouse1" "CorePointer" + InputDevice "Keyboard1" "CoreKeyboard" +EndSection +</verb></quote> + +The device section must include the PCI BusID. This can be found from the +log file of a working single-head installation. For instance, the line + +<quote><verb> +(--) PCI:*(0:20:0) C&T 69030 rev 97, Mem @ 0xed000000/24 +</verb></quote> + +appears for the case above. Additionally, the "<tt>Screen</tt>" option +must appear in the device section. It should be noted that if a flat +panel is used, this it must be allocated to "<tt>Screen 0</tt>". + +The server can then be started with the "<tt>+xinerama</tt>" option +as follows + +<quote><verb> +startx -- +xinerama +</verb></quote> + +For more information, read the Xinerama documentation. + +It should be noted that the dual channel display options of the 69030 +require the use of additional memory bandwidth, as each display channel +independently accesses the video memory. For this reason, the maximum +colour depth and resolution that can be supported in a dual channel mode +will be reduced compared to a single display channel mode. However, as +the driver does not prevent you from using a mode that will exceed the +memory bandwidth of the 69030, but a warning like + +<quote><verb> +(WW) Memory bandwidth requirements exceeded by dual-channel +(WW) mode. Display might be corrupted!!! +</verb></quote> + +If you see such display corruption, and you have this warning, your choices +are to reduce the refresh rate, colour depth or resolution, or increase the +speed of the memory clock with the the "<tt>SetMClk</tt>" option described +above. Note that increasing the memory clock also has its own problems as +described above. + <sect> The Full Story on Clock Limitations <p> There has been much confusion about exactly what the clock limitations @@ -623,19 +747,29 @@ resulting in drawing errors on the screen. The formula to determine the maximum usable dotclock on the HiQV series of chips is <verb> +Max dotclock = min(MaxDClk, 0.70 * 8 * MemoryClk / (BytesPerPixel + + (isDSTN == TRUE ? 1 : 0))) +</verb> + +if you chips is a 69030 or 69000 or + +<verb> Max dotclock = min(MaxDClk, 0.70 * 4 * MemoryClk / (BytesPerPixel + (isDSTN == TRUE ? 1 : 0))) </verb> -which says that there are two limits on the dotclock. One the overall -maximum, and another due to the available memory bandwidth of the chip. -For the memory bandwidth 4 bytes are transfered every clock cycle (Hence -the 4), but after accounting for the RAS/CAS signaling only about 70% -of the bandwidth is available. The whole thing is divided by the bytes -per pixel, plus an extra byte if you are using a DSTN. The extra byte -with DSTN screens is used for the frame buffering/acceleration in these -screens. So for the various Chips and Technologies chips the maximum -specifications are + +otherwise. This effectively means that there are two limits on the +dotclock. One the overall maximum, and another due to the available +memory bandwidth of the chip. The 69030 and 69000 have a 64bit memory +bus and thus transfer 8 bytes every clock thus (hence the 8), while +the other HiQV chipsets are 32bit and transfer 4 bytes per clock cycle +(hence the 4). However, after accounting for the RAS/CAS signaling +only about 70% of the bandwidth is available. The whole thing is +divided by the bytes per pixel, plus an extra byte if you are using a +DSTN. The extra byte with DSTN screens is used for the frame +buffering/acceleration in these screens. So for the various Chips and +Technologies chips the maximum specifications are <verb> Max DClk MHz Max Mem Clk MHz @@ -666,8 +800,8 @@ clocks for the chips are 65554 94.5 77 51.33 77 51.33 38.5 65555 110 77 51.33 77 51.33 38.5 68554 110 77 51.33 77 51.33 38.5 -69000 135 116.2 77.47 116.2 77.47 58.1 -69030 170 140 93.33 140 93.33 70 +69000 135 135 135 135 135 116.2 +69030 170 170 170 170 170 140 </verb> If you exceed the maximum set by the memory clock, you'll get corruption @@ -841,9 +975,9 @@ video processor beyond it capabilities won't cause damage. However, 8 and 24 bit colour depths seem to work fine. <tag> My ct69030 machine locks up when starting XFree</tag> The ct69030 chipset introduced a new dual channel architecture. In its - current form, XFree can not take advantage of this second display + current form, XFree86 can not take advantage of this second display channel. In fact if the video BIOS on the machine sets the ct69030 - to a dual channel mode by default, XFree will lockup hard at this + to a dual channel mode by default, XFree86 will lockup hard at this point. The solution is to use the BIOS setup to change to a single display channel mode, ensuring that both the IOSS and MSS registers are set to a single channel mode. Work is underway to fix this. @@ -885,7 +1019,8 @@ video processor beyond it capabilities won't cause damage. 65.10MHz is not. So for unexplained problems not addressed above, please try to alter the clock you are using slightly, say in steps of 0.05MHz and see if the problem goes away. Alternatively, using the - "<tt>UseVClk1</tt>" option with HiQV chips might also help. + "<tt>CRTClkIndx</tt>" or "<tt>FPClkIndx</tt>" option with HiQV chips might + also help. For other screen drawing related problems, try the "<tt>NoAccel</tt>" or diff --git a/xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent b/xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent index f8a787438..cf77e69b0 100644 --- a/xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent +++ b/xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent @@ -1,17 +1,17 @@ -<!-- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent,v 1.16 2001/02/09 04:15:36 dawes Exp $ --> +<!-- $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/defs.ent,v 1.16.2.3 2001/06/02 16:17:40 dawes Exp $ --> <!-- shared entity definitions for the XFree86 documentation --> <!-- XFree86 version string --> -<!ENTITY relvers CDATA "4.0.2"> -<!ENTITY prevrelvers CDATA "4.0.1"> -<!ENTITY fullrelvers CDATA "4.0.2"> -<!ENTITY prevfullrelvers CDATA "4.0.1"> -<!ENTITY srcvers CDATA "402"> -<!ENTITY prevsrcvers CDATA "401"> -<!ENTITY fullsrcvers CDATA "402"> -<!ENTITY prevfullsrcvers CDATA "401"> -<!ENTITY whichfullrel CDATA "third"> +<!ENTITY relvers CDATA "4.1.0"> +<!ENTITY prevrelvers CDATA "4.0.3"> +<!ENTITY fullrelvers CDATA "4.1.0"> +<!ENTITY prevfullrelvers CDATA "4.0.2"> +<!ENTITY srcvers CDATA "410"> +<!ENTITY prevsrcvers CDATA "403"> +<!ENTITY fullsrcvers CDATA "410"> +<!ENTITY prevfullsrcvers CDATA "402"> +<!ENTITY whichfullrel CDATA "fourth"> <!ENTITY whichupdaterel CDATA "none"> <!-- Version of the most recent 3.3.x release --> @@ -30,8 +30,12 @@ <!ENTITY % snapshot 'IGNORE'> <!ENTITY % release 'INCLUDE'> <!ENTITY % firstrel 'IGNORE'> -<!ENTITY % earlyrel 'INCLUDE'> +<!ENTITY % earlyrel 'IGNORE'> <!ENTITY % laterrel 'INCLUDE'> <!ENTITY % fullrel 'INCLUDE'> <!ENTITY % updaterel 'IGNORE'> +<!ENTITY % prevrelwasupdate 'INCLUDE'> + +<!-- Set this to INCLUDE when references to the RELNOTES are to be included --> +<!ENTITY % haverelnotes 'IGNORE'> diff --git a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h index 1a5cf63dc..387d73ded 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h,v 1.16 2001/04/25 17:46:42 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm.h,v 1.17 2001/05/04 19:05:31 dawes Exp $ */ /* All drivers should typically include these */ @@ -175,6 +175,7 @@ typedef struct { XF86VideoAdaptorPtr adaptor; int timerIsOn; Time offTime; + OptionInfoPtr Options; } ApmRec, *ApmPtr; #define curr ((unsigned char *)pApm->regcurr) @@ -222,6 +223,8 @@ extern void ApmSetupXAAInfo(ApmPtr pApm, XAAInfoRecPtr pXAAinfo); extern Bool ApmSwitchMode(int scrnIndex, DisplayModePtr mode, int flags); extern void ApmAdjustFrame(int scrnIndex, int x, int y, int flags); +extern void ApmHWCursorReserveSpace(ApmPtr pApm); +extern void ApmAccelReserveSpace(ApmPtr pApm); extern int ApmPixmapIndex; #define APM_GET_PIXMAP_PRIVATE(pix)\ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_accel.c index cfa8b3f40..733a75ac7 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_accel.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_accel.c,v 1.16 2001/04/25 17:46:42 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_accel.c,v 1.16.2.1 2001/05/23 20:21:52 dawes Exp $ */ #define COMPILER_H_EXTRAS @@ -302,10 +302,12 @@ ApmAccelInit(ScreenPtr pScreen) SETROP(ROP_S_xor_D); SETROP(ROP_S); +#if 0 if (XAAPixmapOps.CopyArea != ApmCopyAreaPixmap) { SaveCopyAreaPixmap = XAAPixmapOps.CopyArea; XAAPixmapOps.CopyArea = ApmCopyAreaPixmap; } +#endif ApmSetupXAAInfo(pApm, pXAAinfo); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c index 77e033cab..47130023a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c,v 1.49 2001/04/25 17:46:42 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_driver.c,v 1.50 2001/05/04 19:05:31 dawes Exp $ */ #define COMPILER_H_EXTRAS #include "apm.h" @@ -27,7 +27,7 @@ #define TEXT_AMOUNT 32768 /* Mandatory functions */ -static OptionInfoPtr ApmAvailableOptions(int chipid, int busid); +static const OptionInfoRec * ApmAvailableOptions(int chipid, int busid); static void ApmIdentify(int flags); static Bool ApmProbe(DriverPtr drv, int flags); static Bool ApmPreInit(ScrnInfoPtr pScrn, int flags); @@ -95,7 +95,7 @@ typedef enum { OPTION_PCI_RETRY } ApmOpts; -static OptionInfoRec ApmOptions[] = +static const OptionInfoRec ApmOptions[] = { {OPTION_SET_MCLK, "SetMclk", OPTV_FREQ, {0}, FALSE}, @@ -294,8 +294,7 @@ ApmIdentify(int flags) ApmChipsets); } -static -OptionInfoPtr +static const OptionInfoRec * ApmAvailableOptions(int chipid, int busid) { return ApmOptions; @@ -612,7 +611,10 @@ ApmPreInit(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ApmOptions); + if (!(pApm->Options = xalloc(sizeof(ApmOptions)))) + return FALSE; + memcpy(pApm->Options, ApmOptions, sizeof(ApmOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pApm->Options); pApm->scrnIndex = pScrn->scrnIndex; /* Set the bits per RGB for 8bpp mode */ @@ -620,16 +622,16 @@ ApmPreInit(ScrnInfoPtr pScrn, int flags) /* Default to 8 */ pScrn->rgbBits = 8; } - if (xf86ReturnOptValBool(ApmOptions, OPTION_NOLINEAR, FALSE)) { + if (xf86ReturnOptValBool(pApm->Options, OPTION_NOLINEAR, FALSE)) { pApm->noLinear = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "No linear framebuffer\n"); } from = X_DEFAULT; pApm->hwCursor = FALSE; - if (xf86GetOptValBool(ApmOptions, OPTION_HW_CURSOR, &pApm->hwCursor)) + if (xf86GetOptValBool(pApm->Options, OPTION_HW_CURSOR, &pApm->hwCursor)) from = X_CONFIG; if (pApm->noLinear || - xf86ReturnOptValBool(ApmOptions, OPTION_SW_CURSOR, FALSE)) { + xf86ReturnOptValBool(pApm->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pApm->hwCursor = FALSE; } @@ -638,24 +640,24 @@ ApmPreInit(ScrnInfoPtr pScrn, int flags) from = X_DEFAULT; if (pScrn->bitsPerPixel < 8) pApm->NoAccel = TRUE; - if (xf86ReturnOptValBool(ApmOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pApm->Options, OPTION_NOACCEL, FALSE)) { from = X_CONFIG; pApm->NoAccel = TRUE; } if (pApm->NoAccel) xf86DrvMsg(pScrn->scrnIndex, from, "Acceleration disabled\n"); - if (xf86GetOptValFreq(ApmOptions, OPTION_SET_MCLK, OPTUNITS_MHZ, &real)) { + if (xf86GetOptValFreq(pApm->Options, OPTION_SET_MCLK, OPTUNITS_MHZ, &real)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MCLK used is %.1f MHz\n", real); pApm->MemClk = (int)(real * 1000.0); } - if (xf86ReturnOptValBool(ApmOptions, OPTION_SHADOW_FB, FALSE)) { + if (xf86ReturnOptValBool(pApm->Options, OPTION_SHADOW_FB, FALSE)) { pApm->ShadowFB = TRUE; pApm->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using \"Shadow Framebuffer\" - acceleration disabled\n"); } - if (xf86ReturnOptValBool(ApmOptions, OPTION_PCI_RETRY, FALSE)) { - if (xf86ReturnOptValBool(ApmOptions, OPTION_PCI_BURST, FALSE)) { + if (xf86ReturnOptValBool(pApm->Options, OPTION_PCI_RETRY, FALSE)) { + if (xf86ReturnOptValBool(pApm->Options, OPTION_PCI_BURST, FALSE)) { pApm->UsePCIRetry = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n"); } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c index 5ac7e7d23..d696078f0 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c,v 1.9 2001/01/06 21:29:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/apm/apm_rush.c,v 1.9.2.1 2001/05/23 20:21:52 dawes Exp $ */ /* * Copyright Loïc Grenié 1999 */ @@ -493,8 +493,10 @@ ProcXF86RushDispatch (register ClientPtr client) return ProcXF86RushUnlockAllPixmaps(client); case X_XF86RushSetCopyMode: return ProcXF86RushSetCopyMode(client); +#if 0 case X_XF86RushSetPixelStride: return ProcXF86RushSetPixelStride(client); +#endif case X_XF86RushOverlayPixmap: return ProcXF86RushOverlayPixmap(client); case X_XF86RushStatusRegOffset: diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c index 15e4eedbe..a5d63c30f 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c,v 1.11 2001/01/29 15:15:44 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c,v 1.14 2001/05/10 16:48:12 dawes Exp $ */ /* * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> * @@ -50,7 +50,7 @@ /* * prototypes */ -static OptionInfoPtr ARKAvailableOptions(int chipid, int busid); +static const OptionInfoRec * ARKAvailableOptions(int chipid, int busid); static void ARKIdentify(int flags); static Bool ARKProbe(DriverPtr drv, int flags); static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags); @@ -107,8 +107,9 @@ typedef enum { OPTION_NOACCEL } ARKOpts; -static OptionInfoRec ARKOptions[] = { - { OPTION_NOACCEL, "noaccel", OPTV_BOOLEAN, {0}, FALSE } +static const OptionInfoRec ARKOptions[] = { + { OPTION_NOACCEL, "noaccel", OPTV_BOOLEAN, {0}, FALSE }, + { -1, NULL, OPTV_NONE, {0}, FALSE } }; static const char *fbSymbols[] = { @@ -195,7 +196,7 @@ static void ARKFreeRec(ScrnInfoPtr pScrn) pScrn->driverPrivate = NULL; } -static OptionInfoPtr ARKAvailableOptions(int chipid, int busid) +static const OptionInfoRec * ARKAvailableOptions(int chipid, int busid) { return ARKOptions; } @@ -323,9 +324,12 @@ static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags) pARK = ARKPTR(pScrn); xf86CollectOptions(pScrn, NULL); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ARKOptions); + if (!(pARK->Options = xalloc(sizeof(ARKOptions)))) + return FALSE; + memcpy(pARK->Options, ARKOptions, sizeof(ARKOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pARK->Options); - if (xf86ReturnOptValBool(ARKOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pARK->Options, OPTION_NOACCEL, FALSE)) { pARK->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - acceleration disabled\n"); } else @@ -457,7 +461,7 @@ static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags) i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, pScrn->display->modes, clockRanges, NULL, 256, 2048, pScrn->bitsPerPixel, - 128, 2048, pScrn->virtualX, + 128, 2048, pScrn->display->virtualX, pScrn->display->virtualY, pARK->videoRam * 1024, LOOKUP_BEST_REFRESH); if (i == -1) { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile index 910a11040..dae4811c9 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile,v 1.30 2001/04/16 15:02:09 tsi Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/Imakefile,v 1.32 2001/05/18 20:22:28 tsi Exp $ XCOMM XCOMM Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org XCOMM @@ -76,6 +76,10 @@ DRIDEFINES = $(GLX_DEFINES) * For testing purposes, #define'ing ATIAvoidCPIO as YES is also supported on * platforms that do, in fact, provide or emulate a PIO address space as * described above, but this should not be the default driver configuration. + * + * Currently, ATIAvoidNonPCI needs to be set to YES for those platforms that + * "drop down" to firmware on accesses to allocated, but disabled, PCI space. + * ATIAvoidNonPCI necessarily implies ATIAvoidCPIO. */ #if defined(i386Architecture) || \ defined(ia64Architecture) || \ @@ -88,7 +92,26 @@ DRIDEFINES = $(GLX_DEFINES) # define ATIAvoidCPIO YES #endif -#if !ATIAvoidCPIO +#if defined(PpcArchitecture) +# undef ATIAvoidNonPCI +# define ATIAvoidNonPCI YES +#elif !defined(ATIAvoidNonPCI) +# define ATIAvoidNonPCI NO +#endif + +#if ATIAvoidNonPCI +# undef ATIAvoidCPIO +# define ATIAvoidCPIO YES + +NONPCIDEFINES = -DAVOID_NON_PCI + +#endif + +#if ATIAvoidCPIO + +CPIODEFINES = -DAVOID_CPIO + +#else CPIOSRCS1 = ativgaio.c CPIOSRCS2 = atibank.c ativga.c atiwonder.c atiwonderio.c @@ -96,13 +119,9 @@ CPIOSRCS2 = atibank.c ativga.c atiwonder.c atiwonderio.c CPIOOBJS1 = ativgaio.o CPIOOBJS2 = atibank.o ativga.o atiwonder.o atiwonderio.o -#else - -CPIODEFINES = -DAVOID_CPIO - #endif -DEFINES = $(CPIODEFINES) $(DRIDEFINES) +DEFINES = $(CPIODEFINES) $(NONPCIDEFINES) $(DRIDEFINES) SRCS1 = ati.c atiadapter.c atibus.c atichip.c atiident.c atioption.c \ atiprobe.c atividmem.c $(MODSRCS1) $(CPIOSRCS1) \ @@ -110,7 +129,7 @@ SRCS1 = ati.c atiadapter.c atibus.c atichip.c atiident.c atioption.c \ SRCS2 = atiaccel.c atiadjust.c aticlock.c aticonfig.c aticonsole.c \ aticursor.c atidac.c atidga.c atidsp.c atilock.c atimach64.c \ atimach64io.c atimode.c atipreinit.c atiprint.c atiscreen.c atiutil.c \ - ativalid.c $(MODSRCS2) $(CPIOSRCS2) + ativalid.c atixv.c $(MODSRCS2) $(CPIOSRCS2) SRCS3 = r128_accel.c r128_cursor.c r128_dga.c r128_driver.c r128_video.c \ $(MODSRCS3) $(DRISRCS3) SRCS4 = radeon_accel.c radeon_cursor.c radeon_dga.c radeon_driver.c \ @@ -122,7 +141,7 @@ OBJS1 = ati.o atiadapter.o atibus.o atichip.o atiident.o atioption.o \ OBJS2 = atiaccel.o atiadjust.o aticlock.o aticonfig.o aticonsole.o \ aticursor.o atidac.o atidga.o atidsp.o atilock.o atimach64.o \ atimach64io.o atimode.o atipreinit.o atiprint.o atiscreen.o atiutil.o \ - ativalid.o $(MODOBJS2) $(CPIOOBJS2) + ativalid.o atixv.o $(MODOBJS2) $(CPIOOBJS2) OBJS3 = r128_accel.o r128_cursor.o r128_dga.o r128_driver.o r128_video.o \ $(MODOBJS3) $(DRIOBJS3) OBJS4 = radeon_accel.o radeon_cursor.o radeon_dga.o radeon_driver.o \ @@ -248,6 +267,8 @@ InstallDriverSDKNonExecFile(atiwonder.c,$(DRIVERSDKDIR)/drivers/ati) InstallDriverSDKNonExecFile(atiwonder.h,$(DRIVERSDKDIR)/drivers/ati) InstallDriverSDKNonExecFile(atiwonderio.c,$(DRIVERSDKDIR)/drivers/ati) InstallDriverSDKNonExecFile(atiwonderio.h,$(DRIVERSDKDIR)/drivers/ati) +InstallDriverSDKNonExecFile(atixv.c,$(DRIVERSDKDIR)/drivers/ati) +InstallDriverSDKNonExecFile(atixv.h,$(DRIVERSDKDIR)/drivers/ati) InstallDriverSDKNonExecFile(r128.cpp,$(DRIVERSDKDIR)/drivers/ati) InstallDriverSDKNonExecFile(r128.h,$(DRIVERSDKDIR)/drivers/ati) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c index ea431b85c..a79dbfaa7 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c,v 1.16 2001/03/25 05:32:07 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ati.c,v 1.17 2001/05/09 03:12:02 tsi Exp $ */ /* * Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * @@ -57,7 +57,7 @@ * Henrik Harmsen, ervhch@erv.ericsson.se * Christian Lupien, lupien@physics.utoronto.ca * Precision Insight Incorporated - * Mark Vojkovich, mvojkovich@valinux.com + * Mark Vojkovich, mvojkovich@nvidia.com * Huw D M Davies, h.davies1@physics.ox.ac.uk * Andrew C Aitchison, A.C.Aitchison@dpmms.cam.ac.uk * Ani Joshi, ajoshi@shell.unixbox.com @@ -66,7 +66,8 @@ * David S. Miller, davem@redhat.com * A E Lawrence, adrian.lawrence@computing-services.oxford.ac.uk * Linus Torvalds, torvalds@transmeta.com - * William Blew <wblew@home.com> + * William Blew, wblew@home.com + * Ignacio Garcia Etxebarria, garetxe@euskalnet.net * * ... and, many, many others from around the world. * diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c index 4308ae8ae..3eba7f1d1 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c,v 1.5 2001/04/16 15:47:56 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.c,v 1.6 2001/05/07 21:59:06 tsi Exp $ */ /* * Copyright 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * @@ -34,8 +34,8 @@ Bool ATIInitializeAcceleration ( - ScrnInfoPtr pScreenInfo, ScreenPtr pScreen, + ScrnInfoPtr pScreenInfo, ATIPtr pATI ) { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h index d7d730313..309a9794b 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h,v 1.1 2001/03/25 05:33:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiaccel.h,v 1.2 2001/05/07 21:59:06 tsi Exp $ */ /* * Copyright 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * @@ -21,16 +21,16 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#ifndef ___ATIMODE_H___ -#define ___ATIMODE_H___ 1 +#ifndef ___ATIACCEL_H___ +#define ___ATIACCEL_H___ 1 #include "atipriv.h" #include "atiproto.h" #include "xf86str.h" -extern Bool ATIInitializeAcceleration FunctionPrototype((ScrnInfoPtr, - ScreenPtr, +extern Bool ATIInitializeAcceleration FunctionPrototype((ScreenPtr, + ScrnInfoPtr, ATIPtr)); #endif /* ___ATIACCEL_H___ */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c index f210c1f1e..9f9315dab 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c,v 1.11 2001/02/12 03:27:03 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiadjust.c,v 1.12 2001/05/09 03:12:02 tsi Exp $ */ /* * Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * @@ -133,7 +133,7 @@ ATIAdjustFrame { ScrnInfoPtr pScreenInfo = xf86Screens[scrnIndex]; ATIPtr pATI = ATIPTR(pScreenInfo); - int Base; + int Base, xy; /* * Assume the caller has already done its homework in ensuring the physical @@ -149,6 +149,21 @@ ATIAdjustFrame Base = ((((y * pATI->displayWidth) + x) & pATI->AdjustMask) * pATI->AdjustDepth) >> 3; + if (!pATI->currentMode) + { + /* + * Not in DGA. This reverse-calculates pScreenInfo->frame[XY][01] so + * that the cursor does not move on mode switches. + */ + xy = (Base << 3) / pATI->AdjustDepth; + pScreenInfo->frameX0 = xy % pATI->displayWidth; + pScreenInfo->frameY0 = xy / pATI->displayWidth; + pScreenInfo->frameX1 = + pScreenInfo->frameX0 + pScreenInfo->currentMode->HDisplay - 1; + pScreenInfo->frameY1 = + pScreenInfo->frameY0 + pScreenInfo->currentMode->VDisplay - 1; + } + /* Unlock registers */ ATIUnlock(pATI); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c index fef2c0753..ad425fc07 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.35 2001/04/23 17:15:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atimach64.c,v 1.36 2001/05/09 03:12:02 tsi Exp $ */ /* * Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * @@ -2064,6 +2064,7 @@ ATIMach64CursorInit HARDWARE_CURSOR_INVERT_MASK | HARDWARE_CURSOR_SHOW_TRANSPARENT | HARDWARE_CURSOR_UPDATE_UNHIDDEN | + HARDWARE_CURSOR_AND_SOURCE_WITH_MASK | #if X_BYTE_ORDER != X_LITTLE_ENDIAN diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c index 5d74e13ad..4810c7a21 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c,v 1.16 2001/03/25 05:32:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.c,v 1.18 2001/05/07 21:59:06 tsi Exp $ */ /* * Copyright 1999 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * @@ -30,7 +30,7 @@ /* * Recognised XF86Config options. */ -OptionInfoRec ATIPublicOptions[] = +const OptionInfoRec ATIPublicOptions[] = { { ATI_OPTION_ACCEL, @@ -124,14 +124,14 @@ const unsigned long ATIPublicOptionSize = SizeOf(ATIPublicOptions); * * Return recognised options that are intended for public consumption. */ -OptionInfoPtr +const OptionInfoRec * ATIAvailableOptions ( int ChipId, int BusId ) { - OptionInfoPtr pOptions; + const OptionInfoRec *pOptions; if ((pOptions = R128AvailableOptions(ChipId, BusId))) return pOptions; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h index 475b68144..5e6349c8d 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h,v 1.6 2001/03/25 05:32:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atioption.h,v 1.8 2001/05/18 20:22:28 tsi Exp $ */ /* * Copyright 1999 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * @@ -51,9 +51,9 @@ typedef enum ATI_OPTION_SWCURSOR } ATIPublicOptionType; -extern OptionInfoRec ATIPublicOptions[]; -extern const unsigned long ATIPublicOptionSize; +extern const OptionInfoRec ATIPublicOptions[]; +extern const unsigned long ATIPublicOptionSize; -extern OptionInfoPtr ATIAvailableOptions FunctionPrototype((int, int)); +extern const OptionInfoRec * ATIAvailableOptions FunctionPrototype((int, int)); #endif /* ___ATIOPTION_H___ */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c index 9b072da5f..2c8908c3c 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.44 2001/04/01 14:00:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atipreinit.c,v 1.47.2.1 2001/05/22 15:57:03 tsi Exp $ */ /* * Copyright 1999 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * @@ -459,6 +459,7 @@ ATIPreInit } ConfiguredMonitor = NULL; + (void)memset(BIOS, 0, SizeOf(BIOS)); if (!(flags & PROBE_DETECT)) { @@ -579,7 +580,6 @@ ATIPreInit * If there is an ix86-style BIOS, ensure its initialisation entry point * has been executed, and retrieve DDC and VBE information from it. */ - (void)memset(BIOS, 0, SizeOf(BIOS)); if (!(pInt10Module = xf86LoadSubModule(pScreenInfo, "int10"))) xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, "Unable to load int10 module.\n"); @@ -632,8 +632,11 @@ ATIPreInit return TRUE; } - xf86PrintEDID(ConfiguredMonitor); - xf86SetDDCproperties(pScreenInfo, ConfiguredMonitor); + if (ConfiguredMonitor) + { + xf86PrintEDID(ConfiguredMonitor); + xf86SetDDCproperties(pScreenInfo, ConfiguredMonitor); + } /* DDC module is no longer needed at this point */ xf86UnloadSubModule(pDDCModule); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c index 63a61a595..f3a7570ea 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.44 2001/04/19 14:14:05 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiprobe.c,v 1.45 2001/05/18 20:22:28 tsi Exp $ */ /* * Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * @@ -1334,6 +1334,8 @@ ATIProbe if (nATIGDev) { +#ifndef AVOID_NON_PCI + #ifdef AVOID_CPIO /* PCI sparse I/O adapters can still be used through MMIO */ @@ -1417,6 +1419,8 @@ ATIProbe } +#endif /* AVOID_NON_PCI */ + #ifndef AVOID_CPIO /* @@ -1720,10 +1724,13 @@ ATIProbe case ATI_CHIP_RAGE128PROVR: case ATI_CHIP_RAGE128MOBILITY3: case ATI_CHIP_RAGE128MOBILITY4: + case ATI_CHIP_RAGE128ULTRA: DoRage128 = TRUE; continue; case ATI_CHIP_RADEON: + case ATI_CHIP_RADEONVE: + case ATI_CHIP_RADEONMOBILITY: DoRadeon = TRUE; continue; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c index 83c44c698..92381f2ae 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c,v 1.19 2001/03/25 05:32:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atiscreen.c,v 1.21 2001/05/09 03:12:03 tsi Exp $ */ /* * Copyright 1999 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * @@ -27,9 +27,9 @@ #include "aticursor.h" #include "atidac.h" #include "atidga.h" -#include "atimode.h" #include "atiscreen.h" #include "atistruct.h" +#include "atixv.h" #include "shadowfb.h" #include "xf86cmap.h" @@ -229,7 +229,7 @@ ATIScreenInit (void)ATIDGAInit(pScreenInfo, pScreen, pATI); /* Setup acceleration */ - if (!ATIInitializeAcceleration(pScreenInfo, pScreen, pATI)) + if (!ATIInitializeAcceleration(pScreen, pScreenInfo, pATI)) return FALSE; /* Initialise backing store */ @@ -271,6 +271,9 @@ ATIScreenInit /* Initialise DPMS support */ (void)xf86DPMSInit(pScreen, ATISetDPMSMode, 0); + /* Initialise XVideo support */ + (void)ATIInitializeXVideo(pScreen, pScreenInfo, pATI); + /* Set pScreen->SaveScreen and wrap CloseScreen vector */ pScreen->SaveScreen = ATISaveScreen; pATI->CloseScreen = pScreen->CloseScreen; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h index dbed4e124..631543f57 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.36 2001/04/25 18:21:10 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/ativersion.h,v 1.38 2001/05/18 20:22:28 tsi Exp $ */ /* * Copyright 1997 through 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org * @@ -27,11 +27,11 @@ #define ATI_NAME "ATI" #define ATI_DRIVER_NAME "ati" -#define ATI_VERSION_NAME "6.3.4" +#define ATI_VERSION_NAME "6.3.6" #define ATI_VERSION_MAJOR 6 #define ATI_VERSION_MINOR 3 -#define ATI_VERSION_PATCH 4 +#define ATI_VERSION_PATCH 6 #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/atixv.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c new file mode 100644 index 000000000..0a67bf086 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c @@ -0,0 +1,52 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.c,v 1.1 2001/05/09 03:12:04 tsi Exp $ */ +/* + * Copyright 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * + * 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 Marc Aurele La France not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. Marc Aurele La France makes no representations + * about the suitability of this software for any purpose. It is provided + * "as-is" without express or implied warranty. + * + * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL MARC AURELE LA FRANCE 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. + */ + +#include "atistruct.h" +#include "atixv.h" + +#include "xf86xv.h" + +/* + * ATIInitializeXVideo -- + * + * This function is called to initialise XVideo extension support on a screen. + */ +Bool +ATIInitializeXVideo +( + ScreenPtr pScreen, + ScrnInfoPtr pScreenInfo, + ATIPtr pATI +) +{ + XF86VideoAdaptorPtr *ppAdaptor; + int nAdaptor; + + if (!(pScreenInfo->memPhysBase = pATI->LinearBase)) + return FALSE; + + pScreenInfo->fbOffset = 0; + + nAdaptor = xf86XVListGenericAdaptors(pScreenInfo, &ppAdaptor); + return xf86XVScreenInit(pScreen, ppAdaptor, nAdaptor); +} diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h new file mode 100644 index 000000000..6143539d7 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h @@ -0,0 +1,35 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/atixv.h,v 1.1 2001/05/09 03:12:04 tsi Exp $ */ +/* + * Copyright 2001 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org + * + * 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 Marc Aurele La France not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. Marc Aurele La France makes no representations + * about the suitability of this software for any purpose. It is provided + * "as-is" without express or implied warranty. + * + * MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL MARC AURELE LA FRANCE 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. + */ + +#ifndef ___ATIXV_H___ +#define ___ATIXV_H___ 1 + +#include "atipriv.h" +#include "atiproto.h" + +#include "xf86str.h" + +extern Bool ATIInitializeXVideo FunctionPrototype((ScreenPtr, ScrnInfoPtr, + ATIPtr)); + +#endif /* ___ATIXV_H___ */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h index f4d818fd0..4e2f846d3 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.11 2001/04/10 16:07:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h,v 1.13 2001/05/15 10:19:36 eich Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -351,6 +351,7 @@ typedef struct { void (*VideoTimerCallback)(ScrnInfoPtr, Time); int videoKey; Bool showCache; + OptionInfoPtr Options; } R128InfoRec, *R128InfoPtr; #define R128WaitForFifo(pScrn, entries) \ @@ -403,7 +404,8 @@ do { \ #define R128CCE_RESET(pScrn, info) \ do { \ - if (R128CCE_USE_RING_BUFFER(info->CCEMode)) { \ + if (info->directRenderingEnabled \ + && R128CCE_USE_RING_BUFFER(info->CCEMode)) { \ int _ret = drmR128ResetCCE(info->drmFD); \ if (_ret) { \ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, \ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man index 119b63e9b..de9cd7ff7 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man,v 1.2 2001/01/27 18:20:46 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128.man,v 1.2.2.1 2001/06/01 02:24:17 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH R128 __drivermansuffix__ __vendorversion__ @@ -67,6 +67,58 @@ are used. The default is This overrides the default pixel value for the YUV video overlay key. The default value is .B undefined. +.TP +.BI "Option \*qDisplay\*q \*q" string \*q +Select display mode for devices which support flat panels. Supported modes are: + +.B \*qFP\*q +- use flat panel; + +.B \*qCRT\*q +- use cathode ray tube; + +.B \*qMirror\*q +- use both FP and CRT; + +.B \*qBIOS\*q +- use mode as configured in the BIOS. + +The default is +.B FP. + +.PP +The following +.B Options +are mostly important for non-x86 architectures: +.TP +.BI "Option \*qProgramFPRegs\*q \*q" boolean \*q +Enable or disable programming of the flat panel registers. +Beware that this may damage your panel, so use this +.B at your own risk. +The default depends on the device. +.TP +.BI "Option \*qPanelWidth\*q \*q" integer \*q +.TP +.BI "Option \*qPanelHeight\*q \*q" integer \*q +Override the flat panel dimensions in pixels. They are used to program the flat panel +registers and normally determined using the video card BIOS. If the wrong dimensions +are used, the system may hang. +.TP +.BI "Option \*qUseFBDev\*q \*q" boolean \*q +Enable or disable use of an OS-specific framebuffer device interface +(which is not supported on all OSs). See fbdevhw(__drivermansuffix__) +for further information. +Default: off. + +.PP +The following additional +.B Options +are supported: +.TP +.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(__miscmansuffix__) .SH AUTHORS 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 e069d9100..1fc41847e 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.13 2001/04/10 16:07:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v 1.14 2001/05/02 15:06:08 dawes Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -80,8 +80,8 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen) case 8: /* 8bpp mode is not support */ case 15: /* FIXME */ case 24: /* FIXME */ - xf86DrvMsg(pScreen->myNum, X_WARNING, - "R128DRIScreenInit failed (depth %d not supported). " + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] R128DRIScreenInit failed (depth %d not supported). " "Disabling DRI.\n", info->CurrentLayout.pixel_code); return FALSE; @@ -200,16 +200,16 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen) pConfigs[i].redSize = 8; pConfigs[i].greenSize = 8; pConfigs[i].blueSize = 8; - pConfigs[i].alphaSize = 8; + pConfigs[i].alphaSize = 0; pConfigs[i].redMask = 0x00FF0000; pConfigs[i].greenMask = 0x0000FF00; pConfigs[i].blueMask = 0x000000FF; - pConfigs[i].alphaMask = 0xFF000000; + pConfigs[i].alphaMask = 0x00000000; if (accum) { /* Simulated in software */ pConfigs[i].accumRedSize = 16; pConfigs[i].accumGreenSize = 16; pConfigs[i].accumBlueSize = 16; - pConfigs[i].accumAlphaSize = 16; + pConfigs[i].accumAlphaSize = 0; } else { pConfigs[i].accumRedSize = 0; pConfigs[i].accumGreenSize = 0; @@ -877,7 +877,7 @@ Bool R128DRIScreenInit(ScreenPtr pScreen) if (!xf86LoaderCheckSymbol("drmAvailable")) return FALSE; if (!xf86LoaderCheckSymbol("DRIQueryVersion")) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "R128DRIScreenInit failed (libdri.a too old)\n"); + "[dri] R128DRIScreenInit failed (libdri.a too old)\n"); return FALSE; } @@ -885,10 +885,10 @@ Bool R128DRIScreenInit(ScreenPtr pScreen) DRIQueryVersion(&major, &minor, &patch); if (major != 4 || minor < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "R128DRIScreenInit failed " - "(DRI version = %d.%d.%d, expected 4.0.x). " - "Disabling DRI.\n", - major, minor, patch); + "[dri] R128DRIScreenInit failed because of a version mismatch.\n" + "[dri] libDRI version is %d.%d.%d but version 4.0.x is needed.\n" + "[dri] Disabling the DRI.\n", + major, minor, patch); return FALSE; } @@ -897,6 +897,9 @@ Bool R128DRIScreenInit(ScreenPtr pScreen) /* These modes are not supported (yet). */ case 15: case 24: + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] R128DRIScreenInit failed (depth %d not supported). " + "[dri] Disabling DRI.\n", info->CurrentLayout.pixel_code); return FALSE; /* Only 16 and 32 color depths are supports currently. */ @@ -943,7 +946,8 @@ Bool R128DRIScreenInit(ScreenPtr pScreen) * in the SAREA header */ if (sizeof(XF86DRISAREARec)+sizeof(R128SAREAPriv)>SAREA_MAX) { - ErrorF("Data does not fit in SAREA\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] Data does not fit in SAREA. Disabling DRI.\n"); return FALSE; } pDRIInfo->SAREASize = SAREA_MAX; @@ -969,7 +973,8 @@ Bool R128DRIScreenInit(ScreenPtr pScreen) pDRIInfo->createDummyCtxPriv = FALSE; if (!DRIScreenInit(pScreen, pDRIInfo, &info->drmFD)) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "DRIScreenInit failed!\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] DRIScreenInit failed. Disabling DRI.\n"); xfree(pDRIInfo->devPrivate); pDRIInfo->devPrivate = NULL; DRIDestroyInfoRec(pDRIInfo); @@ -984,12 +989,12 @@ Bool R128DRIScreenInit(ScreenPtr pScreen) version->version_minor < 1) { /* incompatible drm version */ xf86DrvMsg(pScreen->myNum, X_ERROR, - "R128DRIScreenInit failed " - "(DRM version = %d.%d.%d, expected 2.1.x). " - "Disabling DRI.\n", - version->version_major, - version->version_minor, - version->version_patchlevel); + "[dri] R128DRIScreenInit failed because of a version mismatch.\n" + "[dri] r128.o kernel module version is %d.%d.%d but version 2.1.x is needed.\n" + "[dri] Disabling the DRI.\n", + version->version_major, + version->version_minor, + version->version_patchlevel); drmFreeVersion(version); R128DRICloseScreen(pScreen); return FALSE; @@ -1001,9 +1006,9 @@ Bool R128DRIScreenInit(ScreenPtr pScreen) if (!info->IsPCI && !R128DRIAgpInit(info, pScreen)) { info->IsPCI = TRUE; xf86DrvMsg(pScreen->myNum, X_WARNING, - "AGP failed to initialize -- falling back to PCI mode.\n"); + "[agp] AGP failed to initialize -- falling back to PCI mode.\n"); xf86DrvMsg(pScreen->myNum, X_WARNING, - "Make sure you have the agpgart kernel module loaded.\n"); + "[agp] Make sure you have the agpgart kernel module loaded.\n"); } /* Initialize PCIGART */ @@ -1026,7 +1031,7 @@ Bool R128DRIScreenInit(ScreenPtr pScreen) R128DRICloseScreen(pScreen); return FALSE; } - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Visual configs initialized\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] Visual configs initialized\n"); return TRUE; } 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 5f3f1cbf3..c8003be38 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.26 2001/04/10 16:07:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c,v 1.29.2.1 2001/05/24 19:43:39 dawes Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -140,7 +140,7 @@ typedef enum { /* FIXME: Disable CRTOnly until it is tested */ OPTION_CRT, #endif - OPTION_BIOS_DISPLAY, + OPTION_DISPLAY, OPTION_PANEL_WIDTH, OPTION_PANEL_HEIGHT, OPTION_PROG_FP_REGS, @@ -149,7 +149,7 @@ typedef enum { OPTION_SHOW_CACHE } R128Opts; -OptionInfoRec R128Options[] = { +const OptionInfoRec R128Options[] = { { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_DAC_6BIT, "Dac6Bit", OPTV_BOOLEAN, {0}, FALSE }, @@ -165,7 +165,7 @@ OptionInfoRec R128Options[] = { { OPTION_BUFFER_SIZE, "BufferSize", OPTV_INTEGER, {0}, FALSE }, { OPTION_USE_CCE_2D, "UseCCEfor2D", OPTV_BOOLEAN, {0}, FALSE }, #endif - { OPTION_BIOS_DISPLAY, "UseBIOSDisplay", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_DISPLAY, "Display", OPTV_STRING, {0}, FALSE }, { OPTION_PANEL_WIDTH, "PanelWidth", OPTV_INTEGER, {0}, FALSE }, { OPTION_PANEL_HEIGHT, "PanelHeight", OPTV_INTEGER, {0}, FALSE }, { OPTION_PROG_FP_REGS, "ProgramFPRegs", OPTV_BOOLEAN, {0}, FALSE }, @@ -768,7 +768,7 @@ static Bool R128PreInitWeight(ScrnInfoPtr pScrn) if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight)) return FALSE; } else { pScrn->rgbBits = 8; - if (xf86ReturnOptValBool(R128Options, OPTION_DAC_6BIT, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_DAC_6BIT, FALSE)) { pScrn->rgbBits = 6; info->dac6bits = TRUE; } @@ -876,7 +876,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn) } /* Flat panel (part 1) */ - if (xf86GetOptValBool(R128Options, OPTION_PROG_FP_REGS, + if (xf86GetOptValBool(info->Options, OPTION_PROG_FP_REGS, &info->HasPanelRegs)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Turned flat panel register programming %s\n", @@ -915,15 +915,31 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn) /* On non-flat panel systems, the default is to display to the CRT, and on flat panel systems, the default is to display to the flat - panel unless the user explicity enables displaying to the device - initialized in the BIOS via the "UseBIOSDisplay" config file - setting. BIOS_5_SCRATCH holds the display device on flat panel - systems only. */ + panel unless the user explicity chooses otherwise using the "Display" + config file setting. BIOS_5_SCRATCH holds the display device on flat + panel systems only. */ if (info->HasPanelRegs) { - if (xf86ReturnOptValBool(R128Options, OPTION_BIOS_DISPLAY, FALSE)) - info->BIOSDisplay = INREG8(R128_BIOS_5_SCRATCH); - else + char *display = xf86GetOptValString(info->Options, OPTION_DISPLAY); + + if (info->FBDev) + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Option \"Display\" ignored " + "(framebuffer device determines display type)\n"); + else if (!display || !xf86NameCmp(display, "FP")) info->BIOSDisplay = R128_BIOS_DISPLAY_FP; + else if (!xf86NameCmp(display, "BIOS")) + info->BIOSDisplay = INREG8(R128_BIOS_5_SCRATCH); + else if (!xf86NameCmp(display, "Mirror")) + info->BIOSDisplay = R128_BIOS_DISPLAY_FP_CRT; + else if (!xf86NameCmp(display, "CRT")) + info->BIOSDisplay = R128_BIOS_DISPLAY_CRT; + else { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Unsupported type \"%s\" specified for Option \"Display\".\n" + "\tSupported types are: " + "\"BIOS\", \"Mirror\", \"CRT\" and \"FP\"\n", display); + return FALSE; + } } else { info->BIOSDisplay = R128_BIOS_DISPLAY_CRT; } @@ -987,12 +1003,12 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn) /* Panel width/height overrides */ info->PanelXRes = 0; info->PanelYRes = 0; - if (xf86GetOptValInteger(R128Options, + if (xf86GetOptValInteger(info->Options, OPTION_PANEL_WIDTH, &(info->PanelXRes))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Flat panel width: %d\n", info->PanelXRes); } - if (xf86GetOptValInteger(R128Options, + if (xf86GetOptValInteger(info->Options, OPTION_PANEL_HEIGHT, &(info->PanelYRes))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Flat panel height: %d\n", info->PanelYRes); @@ -1001,7 +1017,7 @@ static Bool R128PreInitConfig(ScrnInfoPtr pScrn) #ifdef XF86DRI /* AGP/PCI */ - if (xf86ReturnOptValBool(R128Options, OPTION_IS_PCI, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_IS_PCI, FALSE)) { info->IsPCI = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forced into PCI-only mode\n"); } else { @@ -1096,8 +1112,8 @@ static Bool R128PreInitModes(ScrnInfoPtr pScrn) 64 * pScrn->bitsPerPixel, /* pitchInc */ 128, /* minHeight */ 2048, /* maxHeight */ - pScrn->virtualX, - pScrn->virtualY, + pScrn->display->virtualX, + pScrn->display->virtualY, info->FbMapSize, LOOKUP_BEST_REFRESH); @@ -1153,7 +1169,9 @@ static Bool R128PreInitModes(ScrnInfoPtr pScrn) /* This is called by R128PreInit to initialize the hardware cursor. */ static Bool R128PreInitCursor(ScrnInfoPtr pScrn) { - if (!xf86ReturnOptValBool(R128Options, OPTION_SW_CURSOR, FALSE)) { + R128InfoPtr info = R128PTR(pScrn); + + if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) { if (!xf86LoadSubModule(pScrn, "ramdac")) return FALSE; } return TRUE; @@ -1162,7 +1180,9 @@ static Bool R128PreInitCursor(ScrnInfoPtr pScrn) /* This is called by R128PreInit to initialize hardware acceleration. */ static Bool R128PreInitAccel(ScrnInfoPtr pScrn) { - if (!xf86ReturnOptValBool(R128Options, OPTION_NOACCEL, FALSE)) { + R128InfoPtr info = R128PTR(pScrn); + + if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) { if (!xf86LoadSubModule(pScrn, "xaa")) return FALSE; } return TRUE; @@ -1186,21 +1206,21 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn) { R128InfoPtr info = R128PTR(pScrn); - if (xf86ReturnOptValBool(R128Options, OPTION_CCE_PIO, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_CCE_PIO, FALSE)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forcing CCE into PIO mode\n"); info->CCEMode = R128_DEFAULT_CCE_PIO_MODE; } else { info->CCEMode = R128_DEFAULT_CCE_BM_MODE; } - if (xf86ReturnOptValBool(R128Options, OPTION_USE_CCE_2D, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_USE_CCE_2D, FALSE)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using CCE for 2D\n"); info->CCE2D = TRUE; } else { info->CCE2D = FALSE; } - if (xf86ReturnOptValBool(R128Options, OPTION_NO_SECURITY, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_NO_SECURITY, FALSE)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "WARNING!!! CCE Security checks disabled!!! **********\n"); info->CCESecure = FALSE; @@ -1217,7 +1237,7 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn) info->CCEusecTimeout = R128_DEFAULT_CCE_TIMEOUT; if (!info->IsPCI) { - if (xf86GetOptValInteger(R128Options, + if (xf86GetOptValInteger(info->Options, OPTION_AGP_MODE, &(info->agpMode))) { if (info->agpMode < 1 || info->agpMode > R128_AGP_MAX_MODE) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -1228,7 +1248,7 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn) "Using AGP %dx mode\n", info->agpMode); } - if (xf86GetOptValInteger(R128Options, + if (xf86GetOptValInteger(info->Options, OPTION_AGP_SIZE, (int *)&(info->agpSize))) { switch (info->agpSize) { case 4: @@ -1246,7 +1266,7 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn) } } - if (xf86GetOptValInteger(R128Options, + if (xf86GetOptValInteger(info->Options, OPTION_RING_SIZE, &(info->ringSize))) { if (info->ringSize < 1 || info->ringSize >= (int)info->agpSize) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -1256,7 +1276,7 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn) } } - if (xf86GetOptValInteger(R128Options, + if (xf86GetOptValInteger(info->Options, OPTION_BUFFER_SIZE, &(info->bufSize))) { if (info->bufSize < 1 || info->bufSize >= (int)info->agpSize) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -1284,7 +1304,7 @@ static Bool R128PreInitDRI(ScrnInfoPtr pScrn) info->agpTexSize = info->agpSize - (info->ringSize + info->bufSize); } - if (xf86GetOptValInteger(R128Options, OPTION_USEC_TIMEOUT, + if (xf86GetOptValInteger(info->Options, OPTION_USEC_TIMEOUT, &(info->CCEusecTimeout))) { /* This option checked by the R128 DRM kernel module */ } @@ -1379,23 +1399,25 @@ Bool R128PreInit(ScrnInfoPtr pScrn, int flags) /* We can't do this until we have a pScrn->display. */ xf86CollectOptions(pScrn, NULL); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, R128Options); + if (!(info->Options = xalloc(sizeof(R128Options)))) goto fail; + memcpy(info->Options, R128Options, sizeof(R128Options)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, info->Options); if (!R128PreInitWeight(pScrn)) goto fail; - if(xf86GetOptValInteger(R128Options, OPTION_VIDEO_KEY, &(info->videoKey))) { + if(xf86GetOptValInteger(info->Options, OPTION_VIDEO_KEY, &(info->videoKey))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n", info->videoKey); } else { info->videoKey = 0x1E; } - if (xf86ReturnOptValBool(R128Options, OPTION_SHOW_CACHE, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_SHOW_CACHE, FALSE)) { info->showCache = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache enabled\n"); } - if (xf86ReturnOptValBool(R128Options, OPTION_FBDEV, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_FBDEV, FALSE)) { info->FBDev = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using framebuffer device\n"); @@ -1591,7 +1613,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) info->CurrentLayout.pixel_bytes); int maxy = info->FbMapSize / width_bytes; - if (xf86ReturnOptValBool(R128Options, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) { xf86DrvMsg(scrnIndex, X_WARNING, "Acceleration disabled, not initializing the DRI\n"); info->directRenderingEnabled = FALSE; @@ -1896,7 +1918,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86SetSilkenMouse(pScreen); /* Acceleration setup */ - if (!xf86ReturnOptValBool(R128Options, OPTION_NOACCEL, FALSE)) { + if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) { if (R128AccelInit(pScreen)) { xf86DrvMsg(scrnIndex, X_INFO, "Acceleration enabled\n"); info->accelOn = TRUE; @@ -1915,7 +1937,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); /* Hardware cursor setup */ - if (!xf86ReturnOptValBool(R128Options, OPTION_SW_CURSOR, FALSE)) { + if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) { if (R128CursorInit(pScreen)) { int width, height; @@ -1949,7 +1971,7 @@ Bool R128ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) #endif )) return FALSE; - /* DPMS setup */ + /* DPMS setup - FIXME: also for mirror mode? - Michel */ if (!info->HasPanelRegs || info->BIOSDisplay == R128_BIOS_DISPLAY_CRT) xf86DPMSInit(pScreen, R128DisplayPowerManagementSet, 0); @@ -2414,6 +2436,9 @@ static Bool R128InitCrtcRegisters(ScrnInfoPtr pScrn, R128SavePtr save, : 0) | ((mode->Flags & V_INTERLACE) ? R128_CRTC_INTERLACE_EN + : 0) + | ((mode->Flags & V_CSYNC) + ? R128_CRTC_CSYNC_EN : 0)); save->crtc_ext_cntl = R128_VGA_ATI_LINEAR | R128_XCRT_CNT_EN; @@ -2576,8 +2601,8 @@ static void R128InitFPRegisters(R128SavePtr orig, R128SavePtr save, } /* Define PLL registers for requested video mode. */ -static void R128InitPLLRegisters(R128SavePtr save, R128PLLPtr pll, - double dot_clock) +static void R128InitPLLRegisters(ScrnInfoPtr pScrn, R128SavePtr save, + R128PLLPtr pll, double dot_clock) { unsigned long freq = dot_clock * 100; struct { @@ -2756,7 +2781,7 @@ static Bool R128Init(ScrnInfoPtr pScrn, DisplayModePtr mode, R128SavePtr save) if (!R128InitCrtcRegisters(pScrn, save, mode, info)) return FALSE; if (info->HasPanelRegs) R128InitFPRegisters(&info->SavedReg, save, mode, info); - R128InitPLLRegisters(save, &info->pll, dot_clock); + R128InitPLLRegisters(pScrn, save, &info->pll, dot_clock); if (!R128InitDDARegisters(pScrn, save, &info->pll, info)) return FALSE; if (!info->PaletteSavedOnVT) R128InitPalette(save); 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 39921b245..0e2783916 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.9 2001/04/01 14:00:09 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.c,v 1.10 2001/05/04 19:05:33 dawes Exp $ */ /* * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, * Precision Insight, Inc., Cedar Park, Texas, and @@ -105,7 +105,7 @@ PciChipsets R128PciChipsets[] = { }; /* Return the options for supported chipset 'n'; NULL otherwise */ -OptionInfoPtr +const OptionInfoRec * R128AvailableOptions(int chipid, int busid) { int i; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h index 4d5ea691e..78c81c2da 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h,v 1.3 2000/11/18 19:37:11 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/r128_probe.h,v 1.5 2001/05/07 21:59:06 tsi Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -42,34 +42,35 @@ #include "xf86str.h" /* r128_probe.c */ -extern OptionInfoPtr R128AvailableOptions - FunctionPrototype((int, int)); -extern void R128Identify - FunctionPrototype((int)); -extern Bool R128Probe - FunctionPrototype((DriverPtr, int)); +extern const OptionInfoRec * R128AvailableOptions + FunctionPrototype((int, int)); +extern void R128Identify + FunctionPrototype((int)); +extern Bool R128Probe + FunctionPrototype((DriverPtr, int)); -extern SymTabRec R128Chipsets[]; -extern PciChipsets R128PciChipsets[]; +extern SymTabRec R128Chipsets[]; +extern PciChipsets R128PciChipsets[]; /* r128_driver.c */ -extern Bool R128PreInit - FunctionPrototype((ScrnInfoPtr, int)); -extern Bool R128ScreenInit - FunctionPrototype((int, ScreenPtr, int, char **)); -extern Bool R128SwitchMode - FunctionPrototype((int, DisplayModePtr, int)); -extern void R128AdjustFrame - FunctionPrototype((int, int, int, int)); -extern Bool R128EnterVT - FunctionPrototype((int, int)); -extern void R128LeaveVT - FunctionPrototype((int, int)); -extern void R128FreeScreen - FunctionPrototype((int, int)); -extern int R128ValidMode - FunctionPrototype((int, DisplayModePtr, Bool, int)); +extern Bool R128PreInit + FunctionPrototype((ScrnInfoPtr, int)); +extern Bool R128ScreenInit + FunctionPrototype((int, ScreenPtr, int, char **)); +extern Bool R128SwitchMode + FunctionPrototype((int, DisplayModePtr, int)); +extern void R128AdjustFrame + FunctionPrototype((int, int, int, int)); +extern Bool R128EnterVT + FunctionPrototype((int, int)); +extern void R128LeaveVT + FunctionPrototype((int, int)); +extern void R128FreeScreen + FunctionPrototype((int, int)); +extern int R128ValidMode + FunctionPrototype((int, DisplayModePtr, Bool, + int)); -extern OptionInfoRec R128Options[]; +extern const OptionInfoRec R128Options[]; #endif /* _R128_PROBE_H_ */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h index 4a51516f4..9b4a3e2be 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.18 2001/04/16 15:02:11 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v 1.19 2001/05/04 19:05:33 dawes Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -376,6 +376,7 @@ typedef struct { void (*VideoTimerCallback)(ScrnInfoPtr, Time); int videoKey; Bool showCache; + OptionInfoPtr Options; } RADEONInfoRec, *RADEONInfoPtr; #define RADEONWaitForFifo(pScrn, entries) \ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c index 55c481090..023dcd3f4 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c,v 1.13 2001/03/28 20:08:22 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c,v 1.14 2001/05/02 15:06:08 dawes Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -238,8 +238,13 @@ void RADEONEngineReset(ScrnInfoPtr pScrn) clock_cntl_index = INREG(RADEON_CLOCK_CNTL_INDEX); mclk_cntl = INPLL(pScrn, RADEON_MCLK_CNTL); - /* FIXME: Remove magic numbers! */ - OUTPLL(RADEON_MCLK_CNTL, (mclk_cntl | 0x003f0000)); + OUTPLL(RADEON_MCLK_CNTL, (mclk_cntl | + RADEON_FORCEON_MCLKA | + RADEON_FORCEON_MCLKB | + RADEON_FORCEON_YCLKA | + RADEON_FORCEON_YCLKB | + RADEON_FORCEON_MC | + RADEON_FORCEON_AIC)); rbbm_soft_reset = INREG(RADEON_RBBM_SOFT_RESET); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c index 9ce6221a8..79011ea77 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c,v 1.12 2001/04/16 15:02:11 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c,v 1.13 2001/05/02 15:06:08 dawes Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, * VA Linux Systems Inc., Fremont, California. @@ -52,6 +52,12 @@ #include "GL/glxtokens.h" #include "sarea.h" +#if defined(__alpha__) +# define PCIGART_ENABLED +#else +# undef PCIGART_ENABLED +#endif + /* ?? HACK - for now, put this here... */ /* ?? Alpha - this may need to be a variable to handle UP1x00 vs TITAN */ #if defined(__alpha__) @@ -78,6 +84,9 @@ static Bool RADEONInitVisualConfigs(ScreenPtr pScreen) case 8: /* 8bpp mode is not support */ case 15: /* FIXME */ case 24: /* FIXME */ + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] RADEONInitVisualConfigs failed (depth %d not supported). " + "Disabling DRI.\n", info->CurrentLayout.pixel_code); return FALSE; #define RADEON_USE_ACCUM 1 @@ -265,7 +274,7 @@ static Bool RADEONCreateContext(ScreenPtr pScreen, VisualPtr visual, DRM_REMOVABLE, &ctx_info->sarea_handle) < 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "[DRI] could not create private sarea for ctx id (%d)\n", + "[dri] could not create private sarea for ctx id (%d)\n", (int)hwContext); return FALSE; } @@ -273,7 +282,7 @@ static Bool RADEONCreateContext(ScreenPtr pScreen, VisualPtr visual, if (drmAddContextPrivateMapping(info->drmFD, hwContext, ctx_info->sarea_handle) < 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "[DRI] could not associate private sarea to ctx id (%d)\n", + "[dri] could not associate private sarea to ctx id (%d)\n", (int)hwContext); drmRmMap(info->drmFD, ctx_info->sarea_handle); return FALSE; @@ -298,7 +307,7 @@ static void RADEONDestroyContext(ScreenPtr pScreen, drmContext hwContext, if (drmRmMap(info->drmFD, ctx_info->sarea_handle) < 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "[DRI] could not remove private sarea for ctx id (%d)\n", + "[dri] could not remove private sarea for ctx id (%d)\n", (int)hwContext); } #endif @@ -530,7 +539,7 @@ static void RADEONDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 indx) pSAREAPriv->boxes, pSAREAPriv->nbox); if (ret) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "DRIInitBuffers timed out, resetting engine...\n"); + "[dri] DRIInitBuffers timed out, resetting engine...\n"); RADEONEngineReset(pScrn); RADEONEngineRestore(pScrn); RADEONCP_RESET(pScrn, info); @@ -867,7 +876,7 @@ static Bool RADEONDRIAgpInit(RADEONInfoPtr info, ScreenPtr pScreen) return TRUE; } -#if 0 +#if defined(PCIGART_ENABLED) /* Initialize the PCIGART state. Request memory for use in PCI space, and initialize the Radeon registers to point to that memory. */ static Bool RADEONDRIPciInit(RADEONInfoPtr info, ScreenPtr pScreen) @@ -1035,7 +1044,7 @@ static Bool RADEONDRIBufInit(RADEONInfoPtr info, ScreenPtr pScreen) { /* Initialize vertex buffers */ if (info->IsPCI) { -#if 1 +#if !defined(PCIGART_ENABLED) return TRUE; #else info->bufNumBufs = drmAddBufs(info->drmFD, @@ -1108,7 +1117,7 @@ static void RADEONDRISAREAInit(ScreenPtr pScreen, break; default: xf86DrvMsg(pScreen->myNum, X_ERROR, - "RADEONDRISAREAInit failed: Unsupported depth (%d bpp)\n", + "[dri] RADEONDRISAREAInit failed: Unsupported depth (%d bpp). Disabling DRI.\n", info->CurrentLayout.pixel_code); return; } @@ -1292,7 +1301,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen) if (!xf86LoaderCheckSymbol("drmAvailable")) return FALSE; if (!xf86LoaderCheckSymbol("DRIQueryVersion")) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "RADEONDRIScreenInit failed (libdri.a too old)\n"); + "[dri] RADEONDRIScreenInit failed (libdri.a too old)\n"); return FALSE; } @@ -1300,18 +1309,21 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen) DRIQueryVersion(&major, &minor, &patch); if (major != 4 || minor < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "RADEONDRIScreenInit failed " - "(DRI version = %d.%d.%d, expected 4.0.x). " - "Disabling DRI.\n", + "[dri] RADEONDRIScreenInit failed because of a version mismatch.\n" + "[dri] libDRI version is %d.%d.%d but version 4.0.x is needed.\n" + "[dri] Disabling DRI.\n", major, minor, patch); return FALSE; } switch (info->CurrentLayout.pixel_code) { case 8: - /* These modes are not supported (yet). */ case 15: case 24: + /* These modes are not supported (yet). */ + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] RADEONInitVisualConfigs failed (depth %d not supported). " + "Disabling DRI.\n", info->CurrentLayout.pixel_code); return FALSE; /* Only 16 and 32 color depths are supports currently. */ @@ -1389,7 +1401,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen) pDRIInfo->createDummyCtxPriv = FALSE; if (!DRIScreenInit(pScreen, pDRIInfo, &info->drmFD)) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "DRIScreenInit failed!\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] DRIScreenInit failed. Disabling DRI.\n"); xfree(pDRIInfo->devPrivate); pDRIInfo->devPrivate = NULL; DRIDestroyInfoRec(pDRIInfo); @@ -1404,12 +1416,12 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen) version->version_minor < 1) { /* incompatible drm version */ xf86DrvMsg(pScreen->myNum, X_ERROR, - "RADEONDRIScreenInit failed " - "(DRM version = %d.%d.%d, expected 1.1.x). " - "Disabling DRI.\n", - version->version_major, - version->version_minor, - version->version_patchlevel); + "[dri] RADEONDRIScreenInit failed because of a version mismatch.\n" + "[dri] radeon.o kernel module version is %d.%d.%d but version 1.1.x is needed.\n" + "[dri] Disabling DRI.\n", + version->version_major, + version->version_minor, + version->version_patchlevel); drmFreeVersion(version); RADEONDRICloseScreen(pScreen); return FALSE; @@ -1417,7 +1429,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen) drmFreeVersion(version); } -#if 1 +#if !defined(PCIGART_ENABLED) /* Initialize AGP */ if (!info->IsPCI && !RADEONDRIAgpInit(info, pScreen)) { RADEONDRICloseScreen(pScreen); @@ -1426,7 +1438,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen) /* Initialize PCI */ if (info->IsPCI) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "PCI cards not yet supported\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] PCI cards not yet supported. Disabling DRI.\n"); RADEONDRICloseScreen(pScreen); return FALSE; } @@ -1435,9 +1447,9 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen) if (!info->IsPCI && !RADEONDRIAgpInit(info, pScreen)) { info->IsPCI = TRUE; xf86DrvMsg(pScreen->myNum, X_WARNING, - "AGP failed to initialize -- falling back to PCI mode.\n"); + "[agp] AGP failed to initialize -- falling back to PCI mode.\n"); xf86DrvMsg(pScreen->myNum, X_WARNING, - "Make sure you have the agpgart kernel module loaded.\n"); + "[agp] Make sure you have the agpgart kernel module loaded.\n"); } /* Initialize PCI */ @@ -1461,7 +1473,7 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen) RADEONDRICloseScreen(pScreen); return FALSE; } - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Visual configs initialized\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] Visual configs initialized\n"); return TRUE; } 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 400495fb2..6147f9b93 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.21 2001/04/27 14:40:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v 1.25.2.2 2001/05/31 08:36:15 alanh Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -145,7 +145,7 @@ typedef enum { OPTION_FBDEV } RADEONOpts; -OptionInfoRec RADEONOptions[] = { +const OptionInfoRec RADEONOptions[] = { { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_DAC_6BIT, "Dac6Bit", OPTV_BOOLEAN, {0}, FALSE }, @@ -306,6 +306,106 @@ static const char *vbeSymbols[] = { }; #endif +#if !defined(__alpha__) +# define RADEONPreInt10Save(s, r1, r2) +# define RADEONPostInt10Check(s, r1, r2) +#else /* __alpha__ */ +static void +RADEONSaveRegsZapMemCntl(ScrnInfoPtr pScrn, CARD32 *MEM_CNTL, CARD32 *MEMSIZE) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char *RADEONMMIO; + int mapped = 0; + + /* + * First make sure we have the pci and mmio info and that mmio is mapped + */ + if (!info->PciInfo) + info->PciInfo = xf86GetPciInfoForEntity(info->pEnt->index); + if (!info->PciTag) + info->PciTag = pciTag(info->PciInfo->bus, info->PciInfo->device, + info->PciInfo->func); + if (!info->MMIOAddr) + info->MMIOAddr = info->PciInfo->memBase[2] & 0xffffff00; + if (!info->MMIO) { + RADEONMapMMIO(pScrn); + mapped = 1; + } + RADEONMMIO = info->MMIO; + + /* + * Save the values and zap MEM_CNTL + */ + *MEM_CNTL = INREG(RADEON_MEM_CNTL); + *MEMSIZE = INREG(RADEON_CONFIG_MEMSIZE); + OUTREG(RADEON_MEM_CNTL, 0); + + /* + * Unmap mmio space if we mapped it + */ + if (mapped) + RADEONUnmapMMIO(pScrn); +} + +static void +RADEONCheckRegs(ScrnInfoPtr pScrn, CARD32 Saved_MEM_CNTL, CARD32 Saved_MEMSIZE) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char *RADEONMMIO; + CARD32 MEM_CNTL; + int mapped = 0; + + /* + * If we don't have a valid (non-zero) saved MEM_CNTL, get out now + */ + if (!Saved_MEM_CNTL) + return; + + /* + * First make sure that mmio is mapped + */ + if (!info->MMIO) { + RADEONMapMMIO(pScrn); + mapped = 1; + } + RADEONMMIO = info->MMIO; + + /* + * If either MEM_CNTL is currently zero or inconistent (configured for + * two channels with the two channels configured differently), restore + * the saved registers. + */ + MEM_CNTL = INREG(RADEON_MEM_CNTL); + if (!MEM_CNTL || + ((MEM_CNTL & 1) && + (((MEM_CNTL >> 8) & 0xff) != ((MEM_CNTL >> 24) & 0xff)))) { + /* + * Restore the saved registers + */ + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Restoring MEM_CNTL (%08x), setting to %08x\n", + MEM_CNTL, Saved_MEM_CNTL); + OUTREG(RADEON_MEM_CNTL, Saved_MEM_CNTL); + + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Restoring CONFIG_MEMSIZE (%08x), setting to %08x\n", + INREG(RADEON_CONFIG_MEMSIZE), Saved_MEMSIZE); + OUTREG(RADEON_CONFIG_MEMSIZE, Saved_MEMSIZE); + } + + /* + * Unmap mmio space if we mapped it + */ + if (mapped) + RADEONUnmapMMIO(pScrn); +} + +# define RADEONPreInt10Save(s, r1, r2) \ + RADEONSaveRegsZapMemCntl((s), (r1), (r2)) +# define RADEONPostInt10Check(s, r1, r2) \ + RADEONCheckRegs((s), (r1), (r2)) +#endif /* __alpha__ */ + /* Allocate our private RADEONInfoRec. */ static Bool RADEONGetRec(ScrnInfoPtr pScrn) { @@ -731,7 +831,7 @@ static Bool RADEONPreInitWeight(ScrnInfoPtr pScrn) if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight)) return FALSE; } else { pScrn->rgbBits = 8; - if (xf86ReturnOptValBool(RADEONOptions, OPTION_DAC_6BIT, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_DAC_6BIT, FALSE)) { pScrn->rgbBits = 6; info->dac6bits = TRUE; } @@ -850,6 +950,7 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn) case PCI_CHIP_RADEON_QE: case PCI_CHIP_RADEON_QF: case PCI_CHIP_RADEON_QG: + case PCI_CHIP_RADEON_VE: default: info->HasPanelRegs = FALSE; break; } #endif @@ -898,7 +999,7 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn) "Using flat panel for display\n"); #else /* Panel CRT mode override */ - if ((info->CRTOnly = xf86ReturnOptValBool(RADEONOptions, + if ((info->CRTOnly = xf86ReturnOptValBool(info->Options, OPTION_CRT, FALSE))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using external CRT instead of " @@ -912,12 +1013,12 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn) /* Panel width/height overrides */ info->PanelXRes = 0; info->PanelYRes = 0; - if (xf86GetOptValInteger(RADEONOptions, + if (xf86GetOptValInteger(info->Options, OPTION_PANEL_WIDTH, &(info->PanelXRes))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Flat panel width: %d\n", info->PanelXRes); } - if (xf86GetOptValInteger(RADEONOptions, + if (xf86GetOptValInteger(info->Options, OPTION_PANEL_HEIGHT, &(info->PanelYRes))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Flat panel height: %d\n", info->PanelYRes); @@ -929,7 +1030,7 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn) #ifdef XF86DRI /* AGP/PCI */ - if (xf86ReturnOptValBool(RADEONOptions, OPTION_IS_PCI, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_IS_PCI, FALSE)) { info->IsPCI = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forced into PCI-only mode\n"); } else { @@ -941,6 +1042,7 @@ static Bool RADEONPreInitConfig(ScrnInfoPtr pScrn) case PCI_CHIP_RADEON_QE: case PCI_CHIP_RADEON_QF: case PCI_CHIP_RADEON_QG: + case PCI_CHIP_RADEON_VE: default: info->IsPCI = FALSE; break; } } @@ -1016,8 +1118,8 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn) 64 * pScrn->bitsPerPixel, /* pitchInc */ 128, /* minHeight */ 2048, /* maxHeight */ - pScrn->virtualX, - pScrn->virtualY, + pScrn->display->virtualX, + pScrn->display->virtualY, info->FbMapSize, LOOKUP_BEST_REFRESH); @@ -1067,7 +1169,9 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn) /* This is called by RADEONPreInit to initialize the hardware cursor. */ static Bool RADEONPreInitCursor(ScrnInfoPtr pScrn) { - if (!xf86ReturnOptValBool(RADEONOptions, OPTION_SW_CURSOR, FALSE)) { + RADEONInfoPtr info = RADEONPTR(pScrn); + + if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) { if (!xf86LoadSubModule(pScrn, "ramdac")) return FALSE; } return TRUE; @@ -1076,7 +1180,9 @@ static Bool RADEONPreInitCursor(ScrnInfoPtr pScrn) /* This is called by RADEONPreInit to initialize hardware acceleration. */ static Bool RADEONPreInitAccel(ScrnInfoPtr pScrn) { - if (!xf86ReturnOptValBool(RADEONOptions, OPTION_NOACCEL, FALSE)) { + RADEONInfoPtr info = RADEONPTR(pScrn); + + if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) { if (!xf86LoadSubModule(pScrn, "xaa")) return FALSE; } return TRUE; @@ -1098,7 +1204,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); - if (xf86ReturnOptValBool(RADEONOptions, OPTION_CP_PIO, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_CP_PIO, FALSE)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forcing CP into PIO mode\n"); info->CPMode = RADEON_DEFAULT_CP_PIO_MODE; } else { @@ -1114,7 +1220,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn) info->CPusecTimeout = RADEON_DEFAULT_CP_TIMEOUT; if (!info->IsPCI) { - if (xf86GetOptValInteger(RADEONOptions, + if (xf86GetOptValInteger(info->Options, OPTION_AGP_MODE, &(info->agpMode))) { if (info->agpMode < 1 || info->agpMode > RADEON_AGP_MAX_MODE) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -1125,7 +1231,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn) "Using AGP %dx mode\n", info->agpMode); } - if (xf86GetOptValInteger(RADEONOptions, + if (xf86GetOptValInteger(info->Options, OPTION_AGP_SIZE, (int *)&(info->agpSize))) { switch (info->agpSize) { case 4: @@ -1143,7 +1249,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn) } } - if (xf86GetOptValInteger(RADEONOptions, + if (xf86GetOptValInteger(info->Options, OPTION_RING_SIZE, &(info->ringSize))) { if (info->ringSize < 1 || info->ringSize >= (int)info->agpSize) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -1153,7 +1259,7 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn) } } - if (xf86GetOptValInteger(RADEONOptions, + if (xf86GetOptValInteger(info->Options, OPTION_BUFFER_SIZE, &(info->bufSize))) { if (info->bufSize < 1 || info->bufSize >= (int)info->agpSize) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, @@ -1181,13 +1287,13 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn) info->agpTexSize = info->agpSize - (info->ringSize + info->bufSize); } - if (xf86GetOptValInteger(RADEONOptions, OPTION_USEC_TIMEOUT, + if (xf86GetOptValInteger(info->Options, OPTION_USEC_TIMEOUT, &(info->CPusecTimeout))) { /* This option checked by the RADEON DRM kernel module */ } /* Depth moves are disabled by default since they are extremely slow */ - if ((info->depthMoves = xf86ReturnOptValBool(RADEONOptions, + if ((info->depthMoves = xf86ReturnOptValBool(info->Options, OPTION_DEPTH_MOVE, FALSE))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Enabling depth moves\n"); } else { @@ -1214,6 +1320,7 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) { RADEONInfoPtr info; xf86Int10InfoPtr pInt10 = NULL; + CARD32 save1, save2; #ifdef XFree86LOADER /* @@ -1251,8 +1358,11 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) info->pEnt = xf86GetEntityInfo(pScrn->entityList[0]); if (info->pEnt->location.type != BUS_PCI) goto fail; + RADEONPreInt10Save(pScrn, &save1, &save2); + if (flags & PROBE_DETECT) { RADEONProbeDDC(pScrn, info->pEnt->index); + RADEONPostInt10Check(pScrn, save1, save2); return TRUE; } @@ -1284,11 +1394,13 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) /* We can't do this until we have a pScrn->display. */ xf86CollectOptions(pScrn, NULL); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, RADEONOptions); + if (!(info->Options = xalloc(sizeof(RADEONOptions)))) goto fail; + memcpy(info->Options, RADEONOptions, sizeof(RADEONOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, info->Options); if (!RADEONPreInitWeight(pScrn)) goto fail; - if (xf86ReturnOptValBool(RADEONOptions, OPTION_FBDEV, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_FBDEV, FALSE)) { info->FBDev = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using framebuffer device\n"); @@ -1309,13 +1421,18 @@ Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) if (!info->FBDev) if (!RADEONPreInitInt10(pScrn, &pInt10)) goto fail; + RADEONPostInt10Check(pScrn, save1, save2); + if (!RADEONPreInitConfig(pScrn)) goto fail; if (!RADEONGetBIOSParameters(pScrn, pInt10)) goto fail; if (!RADEONGetPLLParameters(pScrn)) goto fail; - if (!RADEONPreInitDDC(pScrn, pInt10)) goto fail; + /* shouldn't fail just because we can't get DDC */ + RADEONPreInitDDC(pScrn, pInt10); + + RADEONPostInt10Check(pScrn, save1, save2); if (!RADEONPreInitGamma(pScrn)) goto fail; @@ -1499,7 +1616,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) info->CurrentLayout.pixel_bytes); int maxy = info->FbMapSize / width_bytes; - if (xf86ReturnOptValBool(RADEONOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) { xf86DrvMsg(scrnIndex, X_WARNING, "Acceleration disabled, not initializing the DRI\n"); info->directRenderingEnabled = FALSE; @@ -1779,7 +1896,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86SetSilkenMouse(pScreen); /* Acceleration setup */ - if (!xf86ReturnOptValBool(RADEONOptions, OPTION_NOACCEL, FALSE)) { + if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, FALSE)) { if (RADEONAccelInit(pScreen)) { xf86DrvMsg(scrnIndex, X_INFO, "Acceleration enabled\n"); info->accelOn = TRUE; @@ -1798,7 +1915,7 @@ Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); /* Hardware cursor setup */ - if (!xf86ReturnOptValBool(RADEONOptions, OPTION_SW_CURSOR, FALSE)) { + if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) { if (RADEONCursorInit(pScreen)) { int width, height; @@ -2376,6 +2493,11 @@ static Bool RADEONInitCrtcRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save, ? RADEON_CRTC_INTERLACE_EN : 0)); + if (info->Chipset == PCI_CHIP_RADEON_VE) { + save->crtc_ext_cntl = RADEON_VGA_ATI_LINEAR | RADEON_CRTC_CRT_ON; + } else { + save->crtc_ext_cntl = RADEON_VGA_ATI_LINEAR | RADEON_XCRT_CNT_EN; + } save->crtc_ext_cntl = RADEON_VGA_ATI_LINEAR | RADEON_XCRT_CNT_EN; save->dac_cntl = (RADEON_DAC_MASK_ALL | RADEON_DAC_VGA_ADR_EN 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 e1fdb6c87..474943ce8 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.7 2001/04/01 14:00:10 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.c,v 1.9 2001/05/04 19:05:33 dawes Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -78,6 +78,7 @@ SymTabRec RADEONChipsets[] = { { PCI_CHIP_RADEON_QE, "ATI Radeon QE (AGP)" }, { PCI_CHIP_RADEON_QF, "ATI Radeon QF (AGP)" }, { PCI_CHIP_RADEON_QG, "ATI Radeon QG (AGP)" }, + { PCI_CHIP_RADEON_VE, "ATI Radeon VE (AGP)" }, { -1, NULL } }; @@ -86,11 +87,12 @@ PciChipsets RADEONPciChipsets[] = { { PCI_CHIP_RADEON_QE, PCI_CHIP_RADEON_QE, RES_SHARED_VGA }, { PCI_CHIP_RADEON_QF, PCI_CHIP_RADEON_QF, RES_SHARED_VGA }, { PCI_CHIP_RADEON_QG, PCI_CHIP_RADEON_QG, RES_SHARED_VGA }, + { PCI_CHIP_RADEON_VE, PCI_CHIP_RADEON_VE, RES_SHARED_VGA }, { -1, -1, RES_UNDEFINED } }; /* Return the options for supported chipset 'n'; NULL otherwise */ -OptionInfoPtr +const OptionInfoRec * RADEONAvailableOptions(int chipid, int busid) { int i; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h index 3ed541e7a..94f11d01e 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h,v 1.3 2000/11/18 19:37:12 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_probe.h,v 1.5 2001/05/07 21:59:06 tsi Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -42,34 +42,35 @@ #include "xf86str.h" /* radeon_probe.c */ -extern OptionInfoPtr RADEONAvailableOptions - FunctionPrototype((int, int)); -extern void RADEONIdentify - FunctionPrototype((int)); -extern Bool RADEONProbe - FunctionPrototype((DriverPtr, int)); +extern const OptionInfoRec * RADEONAvailableOptions + FunctionPrototype((int, int)); +extern void RADEONIdentify + FunctionPrototype((int)); +extern Bool RADEONProbe + FunctionPrototype((DriverPtr, int)); -extern SymTabRec RADEONChipsets[]; -extern PciChipsets RADEONPciChipsets[]; +extern SymTabRec RADEONChipsets[]; +extern PciChipsets RADEONPciChipsets[]; /* radeon_driver.c */ -extern Bool RADEONPreInit - FunctionPrototype((ScrnInfoPtr, int)); -extern Bool RADEONScreenInit - FunctionPrototype((int, ScreenPtr, int, char **)); -extern Bool RADEONSwitchMode - FunctionPrototype((int, DisplayModePtr, int)); -extern void RADEONAdjustFrame - FunctionPrototype((int, int, int, int)); -extern Bool RADEONEnterVT - FunctionPrototype((int, int)); -extern void RADEONLeaveVT - FunctionPrototype((int, int)); -extern void RADEONFreeScreen - FunctionPrototype((int, int)); -extern int RADEONValidMode - FunctionPrototype((int, DisplayModePtr, Bool, int)); +extern Bool RADEONPreInit + FunctionPrototype((ScrnInfoPtr, int)); +extern Bool RADEONScreenInit + FunctionPrototype((int, ScreenPtr, int, char **)); +extern Bool RADEONSwitchMode + FunctionPrototype((int, DisplayModePtr, int)); +extern void RADEONAdjustFrame + FunctionPrototype((int, int, int, int)); +extern Bool RADEONEnterVT + FunctionPrototype((int, int)); +extern void RADEONLeaveVT + FunctionPrototype((int, int)); +extern void RADEONFreeScreen + FunctionPrototype((int, int)); +extern int RADEONValidMode + FunctionPrototype((int, DisplayModePtr, Bool, + int)); -extern OptionInfoRec RADEONOptions[]; +extern const OptionInfoRec RADEONOptions[]; #endif /* _RADEON_PROBE_H_ */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h index 0d006dfa5..68d4d2685 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h,v 1.8 2001/03/21 17:02:22 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_reg.h,v 1.9 2001/05/02 15:06:08 dawes Exp $ */ /* * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and * VA Linux Systems Inc., Fremont, California. @@ -687,9 +687,12 @@ #define RADEON_MC_AGP_LOCATION 0x014c #define RADEON_MC_FB_LOCATION 0x0148 #define RADEON_MCLK_CNTL 0x0012 /* PLL */ -# define RADEON_FORCE_GCP (1 << 16) -# define RADEON_FORCE_PIPE3D_CP (1 << 17) -# define RADEON_FORCE_RCP (1 << 18) +# define RADEON_FORCEON_MCLKA (1 << 16) +# define RADEON_FORCEON_MCLKB (1 << 17) +# define RADEON_FORCEON_YCLKA (1 << 18) +# define RADEON_FORCEON_YCLKB (1 << 19) +# define RADEON_FORCEON_MC (1 << 20) +# define RADEON_FORCEON_AIC (1 << 21) #define RADEON_MDGPIO_A_REG 0x01ac #define RADEON_MDGPIO_EN_REG 0x01b0 #define RADEON_MDGPIO_MASK 0x0198 diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.man b/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.man index 7c6a3a74a..04c35283f 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.man +++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/chips.man @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/chips.man,v 1.2 2001/01/27 18:20:47 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/chips.man,v 1.3 2001/05/09 19:57:04 dbateman Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH CHIPS __drivermansuffix__ __vendorversion__ @@ -157,6 +157,9 @@ Force the use of a particular video clock speed for use with the flat panel at a specified depth .TP .BI "Option \*qMMIO\*q \*q" boolean \*q +Force the use of memory mapped IO for acceleration registers. Default: off +.TP +.BI "Option \*qFullMMIO\*q \*q" boolean \*q Force the use of memory mapped IO where it can be used. Default: off .TP .BI "Option \*qSuspendHack\*q \*q" boolean \*q @@ -190,6 +193,19 @@ Default: off. .BI "Option \*q18bitBus\*q \*q" boolean \*q Force the driver to assume that the flat panel has an 18bit data bus. Default: off. +.TP +.BI "Option \*qCrt2Memory\*q \*q" integer \*q +In a dual-head mode (69030 only) this option selects the amount of memory +to set aside for the second head. If not specified, half the memory is used. +Default: off. +.TP +.BI "Option \*qDualRefresh\*q \*q" integer \*q +The 69030 supports independent refresh rates on its two display channels. +This mode of operations uses additional memory bandwidth and thus limits +the maximum colour depth and refresh rate that can be achieved, and so is +off by default. Using this option forces the use of an independent refresh +rate on the two screens. +Default: off. .SH "SEE ALSO" XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__) .PP diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c index 2b423086b..5c2789bdc 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c,v 1.35 2000/09/26 15:57:10 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_accel.c,v 1.36 2001/05/09 19:57:04 dbateman Exp $ */ /* * Copyright 1996, 1997, 1998 by David Bateman <dbateman@ee.uts.edu.au> * Modified 1997, 1998 by Nozomi Ytow @@ -50,9 +50,6 @@ /* Drivers that use XAA need this */ #include "xf86fbman.h" -/* The vga HW register stuff. Do we need this? */ -#include "vgaHW.h" - /* Our driver specific include file */ #include "ct_driver.h" diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c index 048563e68..07d9db9c5 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c,v 1.20 2000/04/04 19:25:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_cursor.c,v 1.23 2001/05/15 10:19:36 eich Exp $ */ /* * Copyright 1994 The XFree86 Project @@ -40,10 +40,6 @@ /* Drivers that need to access the PCI config space directly need this */ #include "xf86Pci.h" -/* All drivers using the vgahw module need this */ -/* This driver needs to be modified to not use vgaHW for multihead operation */ -#include "vgaHW.h" - #include "xf86Cursor.h" /* Driver specific headers */ @@ -74,6 +70,20 @@ CHIPSShowCursor(ScrnInfoPtr pScrn) if (IS_HiQV(cPtr)) { tmp = cPtr->readXR(cPtr, 0xA0); cPtr->writeXR(cPtr, 0xA0, (tmp & 0xF8) | 5); + if (cPtr->UseDualChannel && + (! xf86IsEntityShared(pScrn->entityList[0]))) { + unsigned int IOSS, MSS; + IOSS = cPtr->readIOSS(cPtr); + MSS = cPtr->readMSS(cPtr); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | + MSS_PIPE_B)); + tmp = cPtr->readXR(cPtr, 0xA0); + cPtr->writeXR(cPtr, 0xA0, (tmp & 0xF8) | 5); + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + } } else { if(!cPtr->UseMMIO) { HW_DEBUG(0x8); @@ -99,6 +109,20 @@ CHIPSHideCursor(ScrnInfoPtr pScrn) if (IS_HiQV(cPtr)) { tmp = cPtr->readXR(cPtr, 0xA0); cPtr->writeXR(cPtr, 0xA0, tmp & 0xF8); + if (cPtr->UseDualChannel && + (! xf86IsEntityShared(pScrn->entityList[0]))) { + unsigned int IOSS, MSS; + IOSS = cPtr->readIOSS(cPtr); + MSS = cPtr->readMSS(cPtr); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | + MSS_PIPE_B)); + tmp = cPtr->readXR(cPtr, 0xA0); + cPtr->writeXR(cPtr, 0xA0, tmp & 0xF8); + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + } } else { if(!cPtr->UseMMIO) { HW_DEBUG(0x8); @@ -133,6 +157,22 @@ CHIPSSetCursorPosition(ScrnInfoPtr pScrn, int x, int y) cPtr->writeXR(cPtr, 0xA5, (x >> 8) & 0x87); cPtr->writeXR(cPtr, 0xA6, y & 0xFF); cPtr->writeXR(cPtr, 0xA7, (y >> 8) & 0x87); + if (cPtr->UseDualChannel && + (! xf86IsEntityShared(pScrn->entityList[0]))) { + unsigned int IOSS, MSS; + IOSS = cPtr->readIOSS(cPtr); + MSS = cPtr->readMSS(cPtr); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | + MSS_PIPE_B)); + cPtr->writeXR(cPtr, 0xA4, x & 0xFF); + cPtr->writeXR(cPtr, 0xA5, (x >> 8) & 0x87); + cPtr->writeXR(cPtr, 0xA6, y & 0xFF); + cPtr->writeXR(cPtr, 0xA7, (y >> 8) & 0x87); + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + } } else { CARD32 xy; @@ -188,6 +228,47 @@ CHIPSSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) } /* Enable normal palette addressing */ cPtr->writeXR(cPtr, 0x80, xr80); + + if (cPtr->UseDualChannel && + (! xf86IsEntityShared(pScrn->entityList[0]))) { + unsigned int IOSS, MSS; + IOSS = cPtr->readIOSS(cPtr); + MSS = cPtr->readMSS(cPtr); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | + MSS_PIPE_B)); + /* Enable extended palette addressing */ + xr80 = cPtr->readXR(cPtr, 0x80); + cPtr->writeXR(cPtr, 0x80, xr80 | 0x1); + + /* Write the new colours to the extended VGA palette. Palette + * index is incremented after each write, so only write index + * once + */ + hwp->writeDacWriteAddr(hwp, 0x04); + if (xr80 & 0x80) { + /* 8bit DAC */ + hwp->writeDacData(hwp, (bg >> 16) & 0xFF); + hwp->writeDacData(hwp, (bg >> 8) & 0xFF); + hwp->writeDacData(hwp, bg & 0xFF); + hwp->writeDacData(hwp, (fg >> 16) & 0xFF); + hwp->writeDacData(hwp, (fg >> 8) & 0xFF); + hwp->writeDacData(hwp, fg & 0xFF); + } else { + /* 6bit DAC */ + hwp->writeDacData(hwp, (bg >> 18) & 0xFF); + hwp->writeDacData(hwp, (bg >> 10) & 0xFF); + hwp->writeDacData(hwp, (bg >> 2) & 0xFF); + hwp->writeDacData(hwp, (fg >> 18) & 0xFF); + hwp->writeDacData(hwp, (fg >> 10) & 0xFF); + hwp->writeDacData(hwp, (fg >> 2) & 0xFF); + } + /* Enable normal palette addressing */ + cPtr->writeXR(cPtr, 0x80, xr80); + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + } } else if (IS_Wingine(cPtr)) { outl(DR(0xA), (bg & 0xFFFFFF)); outl(DR(0x9), (fg & 0xFFFFFF)); @@ -215,6 +296,11 @@ CHIPSLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src) CURSOR_SYNC(pScrn); + if (cPtr->cursorDelay) { + usleep(200000); + cPtr->cursorDelay = FALSE; + } + if (IS_Wingine(cPtr)) { int i; CARD32 *tmp = (CARD32 *)src; @@ -258,6 +344,20 @@ CHIPSLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *src) if (IS_HiQV(cPtr)) { cPtr->writeXR(cPtr, 0xA2, (cAcl->CursorAddress >> 8) & 0xFF); cPtr->writeXR(cPtr, 0xA3, (cAcl->CursorAddress >> 16) & 0x3F); + if (cPtr->UseDualChannel && + (! xf86IsEntityShared(pScrn->entityList[0]))) { + unsigned int IOSS, MSS; + IOSS = cPtr->readIOSS(cPtr); + MSS = cPtr->readMSS(cPtr); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | + MSS_PIPE_B)); + cPtr->writeXR(cPtr, 0xA2, (cAcl->CursorAddress >> 8) & 0xFF); + cPtr->writeXR(cPtr, 0xA3, (cAcl->CursorAddress >> 16) & 0x3F); + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + } } else if (!IS_Wingine(cPtr)) { if (!cPtr->UseMMIO) { HW_DEBUG(0xC); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c index c32a3695e..028668592 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c,v 1.7 2000/04/04 19:25:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_ddc.c,v 1.8 2001/05/09 19:57:04 dbateman Exp $ */ /* All drivers should typically include these */ #include "xf86.h" @@ -14,9 +14,6 @@ /* Drivers that need to access the PCI config space directly need this */ #include "xf86Pci.h" -/* All drivers using the vgahw module need this */ -#include "vgaHW.h" - #include "ct_driver.h" static Bool chips_TestI2C(int scrnIndex); 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 29bb3cbb1..55bff9a02 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.106 2001/02/15 18:36:09 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.c,v 1.110.2.1 2001/05/25 18:15:44 eich Exp $ */ /* * Copyright 1993 by Jon Block <block@frc.com> @@ -126,11 +126,13 @@ /* Needed for replacement LoadPalette function for Gamma Correction */ #include "xf86cmap.h" +#include "dixstruct.h" + /* Driver specific headers */ #include "ct_driver.h" /* Mandatory functions */ -static OptionInfoPtr CHIPSAvailableOptions(int chipid, int busid); +static const OptionInfoRec * CHIPSAvailableOptions(int chipid, int busid); static void CHIPSIdentify(int flags); static Bool CHIPSProbe(DriverPtr drv, int flags); static Bool CHIPSPreInit(ScrnInfoPtr pScrn, int flags); @@ -148,7 +150,8 @@ static Bool CHIPSSaveScreen(ScreenPtr pScreen, int mode); static int chipsFindIsaDevice(GDevPtr dev); static Bool chipsClockSelect(ScrnInfoPtr pScrn, int no); Bool chipsModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); -static void chipsSave(ScrnInfoPtr pScrn); +static void chipsSave(ScrnInfoPtr pScrn, vgaRegPtr VgaSave, + CHIPSRegPtr ChipsSave); static void chipsRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, CHIPSRegPtr ChipsReg, Bool restoreFonts); static void chipsLock(ScrnInfoPtr pScrn); @@ -178,14 +181,15 @@ static int chipsVideoMode(int vgaBitsPerPixel,int displayHSize, int displayVSize); static void chipsDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags); -static void chipsHWCursorOn(CHIPSPtr cPtr); -static void chipsHWCursorOff(CHIPSPtr cPtr); +static void chipsHWCursorOn(CHIPSPtr cPtr, ScrnInfoPtr pScrn); +static void chipsHWCursorOff(CHIPSPtr cPtr, ScrnInfoPtr pScrn); static void chipsFixResume(ScrnInfoPtr pScrn); static void chipsLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual); static void chipsLoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual); static void chipsSetPanelType(CHIPSPtr cPtr); +static void chipsBlockHandler(int, pointer, pointer, pointer); /* * This is intentionally screen-independent. It indicates the binding @@ -193,8 +197,15 @@ static void chipsSetPanelType(CHIPSPtr cPtr); */ static int pix24bpp = 0; +/* + * Index of Entity + */ +static int CHIPSEntityIndex = -1; + + /* Set the non-documented SAR04 register for overlay/video */ #define SAR04 + /* * Initialise some arrays that are used in multiple instances of the * acceleration code. Set them up here as its a convenient place to do it. @@ -554,10 +565,14 @@ typedef enum { OPTION_FP_CLOCK_32, OPTION_SET_MCLK, OPTION_ROTATE, - OPTION_NO_TMED + OPTION_NO_TMED, + OPTION_CRT2_MEM, + OPTION_DUAL_REFRESH, + OPTION_CRT_CLK_INDX, + OPTION_FP_CLK_INDX } CHIPSOpts; -static OptionInfoRec Chips655xxOptions[] = { +static const OptionInfoRec Chips655xxOptions[] = { { OPTION_LINEAR, "Linear", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CLKS, "HWclocks", OPTV_BOOLEAN, {0}, FALSE }, @@ -584,7 +599,7 @@ static OptionInfoRec Chips655xxOptions[] = { { -1, NULL, OPTV_NONE, {0}, FALSE } }; -static OptionInfoRec ChipsWingineOptions[] = { +static const OptionInfoRec ChipsWingineOptions[] = { { OPTION_LINEAR, "Linear", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CLKS, "HWclocks", OPTV_BOOLEAN, {0}, FALSE }, @@ -599,7 +614,7 @@ static OptionInfoRec ChipsWingineOptions[] = { { -1, NULL, OPTV_NONE, {0}, FALSE } }; -static OptionInfoRec ChipsHiQVOptions[] = { +static const OptionInfoRec ChipsHiQVOptions[] = { { OPTION_LINEAR, "Linear", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, @@ -626,6 +641,10 @@ static OptionInfoRec ChipsHiQVOptions[] = { { OPTION_FP_CLOCK_32, "FPClock32", OPTV_FREQ, {0}, FALSE }, { OPTION_SET_MCLK, "SetMclk", OPTV_FREQ, {0}, FALSE }, { OPTION_NO_TMED, "NoTMED", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_CRT2_MEM, "Crt2Memory", OPTV_INTEGER, {0}, FALSE }, + { OPTION_DUAL_REFRESH, "DualRefresh", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_CRT_CLK_INDX, "CrtClkIndx", OPTV_INTEGER, {0}, FALSE }, + { OPTION_FP_CLK_INDX, "FPClkIndx", OPTV_INTEGER, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; @@ -797,8 +816,7 @@ CHIPSIdentify(int flags) CHIPSChipsets); } -static -OptionInfoPtr +static const OptionInfoRec * CHIPSAvailableOptions(int chipid, int busid) { int chip = chipid & 0x0000ffff; @@ -842,6 +860,7 @@ CHIPSProbe(DriverPtr drv, int flags) if (flags & PROBE_DETECT) foundScreen = TRUE; else for (i = 0; i < numUsed; i++) { + EntityInfoPtr pEnt; /* Allocate a ScrnInfoRec */ ScrnInfoPtr pScrn = NULL; if ((pScrn = xf86ConfigPciEntity(pScrn,0,usedChips[i], @@ -861,6 +880,40 @@ CHIPSProbe(DriverPtr drv, int flags) pScrn->ValidMode = CHIPSValidMode; foundScreen = TRUE; } + + /* + * For cards that can do dual head per entity, mark the entity + * as sharable. + */ + pEnt = xf86GetEntityInfo(usedChips[i]); + if (pEnt->chipset == CHIPS_CT69030) { + CHIPSEntPtr cPtrEnt = NULL; + DevUnion *pPriv; + + xf86SetEntitySharable(usedChips[i]); + /* Allocate an entity private if necessary */ + if (CHIPSEntityIndex < 0) + CHIPSEntityIndex = xf86AllocateEntityPrivateIndex(); + pPriv = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex); + if (!pPriv->ptr) { + pPriv->ptr = xnfcalloc(sizeof(CHIPSEntRec), 1); + cPtrEnt = pPriv->ptr; + cPtrEnt->lastInstance = -1; + } else { + cPtrEnt = pPriv->ptr; + } + /* + * Set the entity instance for this instance of the + * driver. For dual head per card, instance 0 is the + * "master" instance, driving the primary head, and + * instance 1 is the "slave". + */ + cPtrEnt->lastInstance++; + xf86SetEntityInstanceForScreen(pScrn, pScrn->entityList[0], + cPtrEnt->lastInstance); + } + } xfree(usedChips); } @@ -994,6 +1047,7 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) int i; CHIPSPtr cPtr; Bool res = FALSE; + CHIPSEntPtr cPtrEnt = NULL; if (flags & PROBE_DETECT) return FALSE; @@ -1008,12 +1062,14 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) } cPtr = CHIPSPTR(pScrn); + /* XXX Check the number of entities, and fail if it isn't one. */ + if (pScrn->numEntities != 1) + return FALSE; + /* Since the capabilities are determined by the chipset the very * first thing to do is, figure out the chipset and its capabilities */ - /* This driver doesn't expect more than one entity per screen */ - if (pScrn->numEntities > 1) - return FALSE; + /* This is the general case */ for (i = 0; i<pScrn->numEntities; i++) { cPtr->pEnt = xf86GetEntityInfo(pScrn->entityList[i]); @@ -1090,6 +1146,30 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) case CHIPS_CT65520: break; } + + /* Check for shared entities */ + if (xf86IsEntityShared(pScrn->entityList[0])) { + if (!(cPtr->Flags & ChipsDualChannelSupport)) + return FALSE; + + /* Make sure entity is PCI for now, though this might not be needed. */ + if (cPtr->pEnt->location.type != BUS_PCI) + return FALSE; + + /* Allocate an entity private if necessary */ + if (xf86IsEntityShared(pScrn->entityList[0])) { + cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; + cPtr->entityPrivate = cPtrEnt; + } +#if 0 + /* Set cPtr->device to the relevant Device section */ + cPtr->device = xf86GetDevFromEntity(pScrn->entityList[0], + pScrn->entityInstanceList[0]); +#endif + } + + /* Set the driver to use the PIO register functions by default */ CHIPSSetStdExtFuncs(cPtr); /* Call the device specific PreInit */ @@ -1103,9 +1183,12 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) if (cPtr->UseFullMMIO) chipsUnmapMem(pScrn); - if (!res) + if (!res) { + vbeFree(cPtr->pVbe); + cPtr->pVbe = NULL; return FALSE; - + } + /*********/ /* * Setup the ClockRanges, which describe what clock ranges are available, @@ -1140,6 +1223,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) LOOKUP_BEST_REFRESH); if (i == -1) { + vbeFree(cPtr->pVbe); + cPtr->pVbe = NULL; CHIPSFreeRec(pScrn); return FALSE; } @@ -1154,6 +1239,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) if (i == 0 || pScrn->modes == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); + vbeFree(cPtr->pVbe); + cPtr->pVbe = NULL; CHIPSFreeRec(pScrn); return FALSE; } @@ -1181,6 +1268,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) switch (pScrn->bitsPerPixel) { case 1: if (xf86LoadSubModule(pScrn, "xf1bpp") == NULL) { + vbeFree(cPtr->pVbe); + cPtr->pVbe = NULL; CHIPSFreeRec(pScrn); return FALSE; } @@ -1188,6 +1277,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) break; case 4: if (xf86LoadSubModule(pScrn, "xf4bpp") == NULL) { + vbeFree(cPtr->pVbe); + cPtr->pVbe = NULL; CHIPSFreeRec(pScrn); return FALSE; } @@ -1196,6 +1287,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) case 16: if (cPtr->Flags & ChipsOverlay8plus16) { if (xf86LoadSubModule(pScrn, "xf8_16bpp") == NULL) { + vbeFree(cPtr->pVbe); + cPtr->pVbe = NULL; CHIPSFreeRec(pScrn); return FALSE; } @@ -1204,6 +1297,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) } default: if (xf86LoadSubModule(pScrn, "fb") == NULL) { + vbeFree(cPtr->pVbe); + cPtr->pVbe = NULL; CHIPSFreeRec(pScrn); return FALSE; } @@ -1213,6 +1308,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) if (cPtr->Flags & ChipsAccelSupport) { if (!xf86LoadSubModule(pScrn, "xaa")) { + vbeFree(cPtr->pVbe); + cPtr->pVbe = NULL; CHIPSFreeRec(pScrn); return FALSE; } @@ -1221,6 +1318,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) if (cPtr->Flags & ChipsShadowFB) { if (!xf86LoadSubModule(pScrn, "shadowfb")) { + vbeFree(cPtr->pVbe); + cPtr->pVbe = NULL; CHIPSFreeRec(pScrn); return FALSE; } @@ -1229,6 +1328,8 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) if (cPtr->Accel.UseHWCursor) { if (!xf86LoadSubModule(pScrn, "ramdac")) { + vbeFree(cPtr->pVbe); + cPtr->pVbe = NULL; CHIPSFreeRec(pScrn); return FALSE; } @@ -1241,7 +1342,6 @@ CHIPSPreInit(ScrnInfoPtr pScrn, int flags) if (cPtr->MMIOBaseVGA) xf86SetOperatingState(RES_SHARED_VGA, cPtr->pEnt->index, ResDisableOpr); - return TRUE; } @@ -1254,11 +1354,12 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) int i; unsigned int Probed[3], FPclkI, CRTclkI; double real; - int val; + int val, indx; const char *s; vgaHWPtr hwp; CHIPSPtr cPtr = CHIPSPTR(pScrn); + CHIPSEntPtr cPtrEnt = NULL; CHIPSPanelSizePtr Size = &cPtr->PanelSize; CHIPSMemClockPtr MemClk = &cPtr->MemClock; CHIPSClockPtr SaveClk = &(cPtr->SavedReg.Clock); @@ -1306,6 +1407,14 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) vgaHWGetIOBase(hwp); /* + * Must allow ensure that storage for the 2nd set of vga registers is + * allocated for dual channel cards + */ + if ((cPtr->Flags & ChipsDualChannelSupport) && + (! xf86IsEntityShared(pScrn->entityList[0]))) + vgaHWAllocDefaultRegs(&(cPtr->VgaSavedReg2)); + + /* * This must happen after pScrn->display has been set because * xf86SetWeight references it. */ @@ -1337,7 +1446,9 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); /* Process the options */ - cPtr->Options = (OptionInfoPtr)ChipsHiQVOptions; + if (!(cPtr->Options = xalloc(sizeof(ChipsHiQVOptions)))) + return FALSE; + memcpy(cPtr->Options, ChipsHiQVOptions, sizeof(ChipsHiQVOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, cPtr->Options); /* Set the bits per RGB */ @@ -1541,33 +1652,95 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) 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; + + if (cPtr->Flags & ChipsDualChannelSupport) + /* !!!! Full MMIO doesn't work on the 69030 for now */ + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "FULL_MMIO option ignored for Dual Channel\n"); + else { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Enabling Full MMIO\n"); + cPtr->UseFullMMIO = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Using Full MMIO\n"); + + /* + * 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); + /* 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"); + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "FULL_MMIO option ignored\n"); } } } else { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,"Disabling MMIO: " + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,"Disabling MMIO: " "no acceleration, no hw_cursor\n"); cPtr->UseMMIO = FALSE; cPtr->Accel.UseHWCursor = FALSE; cPtr->Flags &= ~ChipsAccelSupport; } + + if (cPtr->Flags & ChipsDualChannelSupport) { + + if (xf86IsEntityShared(pScrn->entityList[0])) { + cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; +#if 1 + /* + * XXX This assumes that the lower number screen is always the + * "master" head, and that the "master" is the first CRTC. This + * can result in unexpected behaviour when the config file marks + * the primary CRTC as the second screen. + */ + if (xf86IsPrimInitDone(pScrn->entityList[0])) { +#else + /* + * This is an alternative version that determines which is the + * secondary CRTC from the screen field in cPtr->pEnt->device. + * It doesn't currently work because there are things that assume + * the primary CRTC is initialised first. + */ + if (cPtr->pEnt->device->screen == 1) { + +#endif + /* This is the second crtc */ + cPtr->SecondCrtc = TRUE; + cPtr->UseDualChannel = TRUE; + } else + cPtr->SecondCrtc = FALSE; + + } else { + if (xf86ReturnOptValBool(cPtr->Options, + OPTION_DUAL_REFRESH, FALSE)) { + cPtr->Flags |= ChipsDualRefresh; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Dual Refresh mode enabled\n"); + cPtr->UseDualChannel = TRUE; + } + } + + /* Store IOSS/MSS so that we can restore them */ + cPtr->storeIOSS = cPtr->readIOSS(cPtr); + cPtr->storeMSS = cPtr->readMSS(cPtr); + DUALOPEN; + } + /* memory size */ if (cPtr->pEnt->device->videoRam != 0) { pScrn->videoRam = cPtr->pEnt->device->videoRam; @@ -1631,10 +1804,53 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) break; } } - xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VideoRAM: %d kByte\n", - pScrn->videoRam); } - cPtr->FbMapSize = pScrn->videoRam * 1024; + + + if ((cPtr->Flags & ChipsDualChannelSupport) && + (xf86IsEntityShared(pScrn->entityList[0]))) { + /* + * This takes gives either half or the amount of memory specified + * with the Crt2Memory option + */ + if(cPtr->SecondCrtc == FALSE) { + MessageType from; + + int crt2mem = -1, adjust; + + xf86GetOptValInteger(cPtr->Options, OPTION_CRT2_MEM, &crt2mem); + if (crt2mem > 0) { + adjust = crt2mem; + from = X_CONFIG; + } else { + adjust = pScrn->videoRam / 2; + from = X_DEFAULT; + } + xf86DrvMsg(pScrn->scrnIndex, from, + "CRT2 will use %dK of VideoRam\n", + adjust); + + cPtrEnt->mastervideoRam = pScrn->videoRam - adjust; + pScrn->videoRam = cPtrEnt->mastervideoRam; + cPtrEnt->slavevideoRam = adjust; + cPtrEnt->masterFbAddress = cPtr->FbAddress; + cPtr->FbMapSize = + cPtrEnt->masterFbMapSize = pScrn->videoRam * 1024; + cPtrEnt->slaveFbMapSize = cPtrEnt->slavevideoRam * 1024; + } else { + cPtrEnt->slaveFbAddress = cPtr->FbAddress + + cPtrEnt->masterFbAddress; + cPtr->FbMapSize = cPtrEnt->slaveFbMapSize; + pScrn->videoRam = cPtrEnt->slavevideoRam; + } + cPtrEnt->refCount++; + } else { + /* Normal Handling of video ram etc */ + cPtr->FbMapSize = pScrn->videoRam * 1024; + } + + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VideoRAM: %d kByte\n", + pScrn->videoRam); /* Store register values that might be messed up by a suspend resume */ /* Do this early as some of the other code in PreInit relies on it */ @@ -1642,6 +1858,7 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) cPtr->IOBase = (unsigned int)(cPtr->SuspendHack.vgaIOBaseFlag ? 0x3D0 : 0x3B0); + /*test STN / TFT */ tmp = cPtr->readFR(cPtr, 0x10); @@ -1845,16 +2062,9 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) } CRTclkI = (hwp->readMiscOut(hwp) >> 2) & 0x03; if (CRTclkI == 3) CRTclkI = 2; - if (cPtr->Flags & ChipsDualChannelSupport) { - unsigned char IOSS, MSS; - IOSS = cPtr->readIOSS(cPtr); - MSS = cPtr->readMSS(cPtr); - cPtr->writeIOSS(cPtr,((IOSS&0xE0) | 0x11)); /* Select Pipeline A */ - cPtr->writeMSS(cPtr,((MSS&0xF0) | 0x8)); + if (cPtr->Chipset == CHIPS_CT69030) FPclkI = (cPtr->readFR(cPtr, 0x01) >> 2) & 0x3; - cPtr->writeIOSS(cPtr,IOSS); - cPtr->writeMSS(cPtr,MSS); - } else + else FPclkI = (cPtr->readFR(cPtr, 0x03) >> 2) & 0x3; if (FPclkI == 3) FPclkI = 2; for (i = 0; i < 3; i++) { @@ -1875,6 +2085,46 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) } cPtr->CRTclkInx = CRTclkI; + + /* + * Some chips seem to dislike some clocks in one of the PLL's. Give + * the user the oppurtunity to change it + */ + if (xf86GetOptValInteger(cPtr->Options, OPTION_CRT_CLK_INDX, &indx)) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Force CRT Clock index to %d\n", + indx); + cPtr->CRTclkInx = indx; + + if (xf86GetOptValInteger(cPtr->Options, OPTION_FP_CLK_INDX, &indx)) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Force FP Clock index to %d\n", indx); + cPtr->FPclkInx = indx; + } else { + if (indx == cPtr->FPclkInx) { + if (indx == 2) + cPtr->FPclkInx = 1; + else + cPtr->FPclkInx = indx + 1; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "FP Clock index forced to %d\n", cPtr->FPclkInx); + } + } + } else if (xf86GetOptValInteger(cPtr->Options, OPTION_FP_CLK_INDX, + &indx)) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "Force FP Clock index to %d\n", indx); + cPtr->FPclkInx = indx; + if (indx == cPtr->CRTclkInx) { + if (indx == 2) + cPtr->CRTclkInx = 1; + else + cPtr->CRTclkInx = indx + 1; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + "CRT Clock index forced to %d\n", cPtr->CRTclkInx); + } + } + + /* Probe the memory clock currently in use */ MemClk->xrCC = cPtr->readXR(cPtr, 0xCC); MemClk->M = (MemClk->xrCC & 0x7F) + 2; @@ -1961,18 +2211,37 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) /* Check if maxClock is limited by the MemClk. Only 70% to allow for */ /* RAS/CAS. Extra byte per memory clock needed if framebuffer used */ /* Extra byte if the overlay plane is avtivated */ - if (cPtr->FrameBufferSize && (cPtr->PanelType & ChipsLCD)) - if (cPtr->Flags & ChipsOverlay8plus16 ) - cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 4 * 0.7 / 4); + /* We have a 64bit wide memory bus on the 69030 and 69000, and 32bits */ + /* on the others. Thus multiply by a suitable factor */ + if ((cPtr->Chipset == CHIPS_CT69030) || (cPtr->Chipset == CHIPS_CT69000)) { + if (cPtr->FrameBufferSize && (cPtr->PanelType & ChipsLCD)) + if (cPtr->Flags & ChipsOverlay8plus16 ) + cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 8 * 0.7 / 4); + else + cPtr->MaxClock = min(cPtr->MaxClock, + MemClk->Clk * 8 * 0.7 / (bytesPerPixel + 1)); else - cPtr->MaxClock = min(cPtr->MaxClock, + if (cPtr->Flags & ChipsOverlay8plus16) + cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 8 * 0.7 / 3); + else + cPtr->MaxClock = min(cPtr->MaxClock, + MemClk->Clk * 8 * 0.7 / bytesPerPixel); + } else { + if (cPtr->FrameBufferSize && (cPtr->PanelType & ChipsLCD)) + if (cPtr->Flags & ChipsOverlay8plus16 ) + cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 4 * 0.7 / 4); + else + cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 4 * 0.7 / (bytesPerPixel + 1)); - else - if (cPtr->Flags & ChipsOverlay8plus16) - cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 4 * 0.7 / 3); else - cPtr->MaxClock = min(cPtr->MaxClock, + if (cPtr->Flags & ChipsOverlay8plus16) + cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 4 * 0.7 / 3); + else + cPtr->MaxClock = min(cPtr->MaxClock, MemClk->Clk * 4 * 0.7 / bytesPerPixel); + } + + if (cPtr->pEnt->device->dacSpeeds[0]) { int speed = 0; @@ -2083,6 +2352,21 @@ chipsPreInitHiQV(ScrnInfoPtr pScrn, int flags) chips_ddc1(pScrn); } + if (cPtr->Flags & ChipsDualChannelSupport) { + if (xf86IsEntityShared(pScrn->entityList[0])) { + if (cPtr->SecondCrtc == TRUE) { + cPtrEnt->slaveActive = FALSE; + } else { + cPtrEnt->masterActive = FALSE; + } + } + /* Put IOSS/MSS back to normal */ + cPtr->writeIOSS(cPtr, cPtr->storeIOSS); + cPtr->writeMSS(cPtr, cPtr->storeMSS); + + xf86SetPrimInitDone(pScrn->entityList[0]); + } + return TRUE; } @@ -2191,7 +2475,9 @@ chipsPreInitWingine(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); /* Process the options */ - cPtr->Options = (OptionInfoPtr)ChipsWingineOptions; + if (!(cPtr->Options = xalloc(sizeof(ChipsWingineOptions)))) + return FALSE; + memcpy(cPtr->Options, ChipsWingineOptions, sizeof(ChipsWingineOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, cPtr->Options); /* Set the bits per RGB */ @@ -2655,7 +2941,9 @@ chipsPreInit655xx(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); /* Process the options */ - cPtr->Options = (OptionInfoPtr)Chips655xxOptions; + if (!(cPtr->Options = xalloc(sizeof(Chips655xxOptions)))) + return FALSE; + memcpy(cPtr->Options, Chips655xxOptions, sizeof(Chips655xxOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, cPtr->Options); /* Set the bits per RGB */ @@ -3321,6 +3609,11 @@ CHIPSEnterVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; CHIPSPtr cPtr = CHIPSPTR(pScrn); + CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; + + if (cPtr->Flags & ChipsDualChannelSupport) + DUALOPEN; /* Should we re-save the text mode on each VT enter? */ if(!chipsModeInit(pScrn, pScrn->currentMode)) @@ -3330,8 +3623,8 @@ CHIPSEnterVT(int scrnIndex, int flags) && (cPtr->Flags & ChipsAccelSupport)) CHIPSResetVideo(pScrn); - xf86UDelay(50000); - chipsHWCursorOn(cPtr); + /*xf86UDelay(50000);*/ + chipsHWCursorOn(cPtr, pScrn); /* cursor settle delay */ xf86UDelay(50000); CHIPSAdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); @@ -3346,14 +3639,24 @@ CHIPSLeaveVT(int scrnIndex, int flags) ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; CHIPSPtr cPtr = CHIPSPTR(pScrn); CHIPSACLPtr cAcl = CHIPSACLPTR(pScrn); + CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; /* Invalidate the cached acceleration registers */ cAcl->planemask = -1; cAcl->fgColor = -1; cAcl->bgColor = -1; - chipsHWCursorOff(cPtr); - chipsRestore(pScrn, &(VGAHWPTR(pScrn))->SavedReg, &cPtr->SavedReg, TRUE); - chipsLock(pScrn); + + if (cPtr->Flags & ChipsDualChannelSupport) { + if (cPtr->UseDualChannel) + DUALREOPEN; + DUALCLOSE; + } else { + chipsHWCursorOff(cPtr, pScrn); + chipsRestore(pScrn, &(VGAHWPTR(pScrn))->SavedReg, &cPtr->SavedReg, + TRUE); + chipsLock(pScrn); + } } @@ -3363,11 +3666,16 @@ chipsLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, { vgaHWPtr hwp = VGAHWPTR(pScrn); CHIPSPtr cPtr = CHIPSPTR(pScrn); + CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; int i, index, shift ; shift = ((pScrn->depth == 15) && (!(cPtr->Flags & ChipsOverlay8plus16))) ? 3 : 0; + if (cPtr->UseDualChannel) + DUALREOPEN; + for (i = 0; i < numColors; i++) { index = indices[i]; hwp->writeDacWriteAddr(hwp,index << shift); @@ -3380,6 +3688,30 @@ chipsLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, DACDelay(hwp); } + if (cPtr->UseDualChannel && + (! xf86IsEntityShared(pScrn->entityList[0]))) { + unsigned int IOSS, MSS; + IOSS = cPtr->readIOSS(cPtr); + MSS = cPtr->readMSS(cPtr); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_B)); + + for (i = 0; i < numColors; i++) { + index = indices[i]; + hwp->writeDacWriteAddr(hwp,index << shift); + DACDelay(hwp); + hwp->writeDacData(hwp, colors[index].red); + DACDelay(hwp); + hwp->writeDacData(hwp, colors[index].green); + DACDelay(hwp); + hwp->writeDacData(hwp, colors[index].blue); + DACDelay(hwp); + } + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + } + /* This shouldn't be necessary, but we'll play safe. */ hwp->disablePalette(hwp); } @@ -3389,8 +3721,14 @@ chipsLoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual) { vgaHWPtr hwp = VGAHWPTR(pScrn); + CHIPSPtr cPtr = CHIPSPTR(pScrn); + CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; int i, index; + if (cPtr->UseDualChannel) + DUALREOPEN; + for (i = 0; i < numColors; i++) { index = indices[i]; hwp->writeDacWriteAddr(hwp, index << 2); @@ -3403,6 +3741,32 @@ chipsLoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices, DACDelay(hwp); } + + if (cPtr->UseDualChannel && + (! xf86IsEntityShared(pScrn->entityList[0]))) { + unsigned int IOSS, MSS; + IOSS = cPtr->readIOSS(cPtr); + MSS = cPtr->readMSS(cPtr); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_B)); + + for (i = 0; i < numColors; i++) { + index = indices[i]; + hwp->writeDacWriteAddr(hwp, index << 2); + DACDelay(hwp); + hwp->writeDacData(hwp, colors[index >> 1].red); + DACDelay(hwp); + hwp->writeDacData(hwp, colors[index].green); + DACDelay(hwp); + hwp->writeDacData(hwp, colors[index >> 1].blue); + DACDelay(hwp); + } + + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + } + /* This shouldn't be necessary, but we'll play safe. */ hwp->disablePalette(hwp); } @@ -3411,7 +3775,7 @@ chipsLoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices, static Bool CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { - ScrnInfoPtr pScrn; + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; vgaHWPtr hwp; CHIPSPtr cPtr; CHIPSACLPtr cAcl; @@ -3421,6 +3785,8 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) unsigned int racflag = 0; unsigned char *FBStart; int height, width, displayWidth; + CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; #ifdef DEBUG ErrorF("CHIPSScreenInit\n"); #endif @@ -3428,7 +3794,6 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) * we need to get the ScrnInfoRec for this screen, so let's allocate * one first thing */ - pScrn = xf86Screens[pScreen->myNum]; cPtr = CHIPSPTR(pScrn); cAcl = CHIPSACLPTR(pScrn); hwp = VGAHWPTR(pScrn); @@ -3459,11 +3824,14 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } /* Setup the MMIO register access functions if need */ - if (cPtr->MMIOBaseVGA) { + if (cPtr->UseFullMMIO && cPtr->MMIOBaseVGA) { CHIPSSetMmioExtFuncs(cPtr); CHIPSHWSetMmioFuncs(pScrn, cPtr->MMIOBaseVGA, 0x0); } + if (cPtr->Flags & ChipsDualChannelSupport) + DUALOPEN; + #if defined(__arm32__) && defined(__NetBSD__) if (strcmp(pScrn->currentMode->name,"PAL") == 0) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using built-in PAL TV mode\n"); @@ -3483,11 +3851,28 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* * next we save the current state and setup the first mode */ - chipsSave(pScrn); + if ((cPtr->Flags & ChipsDualChannelSupport) && + (! xf86IsEntityShared(pScrn->entityList[0]))) { + unsigned int IOSS, MSS; + IOSS = cPtr->readIOSS(cPtr); + MSS = cPtr->readMSS(cPtr); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_A)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_A)); + chipsSave(pScrn, &hwp->SavedReg, &cPtr->SavedReg); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_B)); + chipsSave(pScrn, &cPtr->VgaSavedReg2, &cPtr->SavedReg2); + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + } else + chipsSave(pScrn, &hwp->SavedReg, &cPtr->SavedReg); + if (!chipsModeInit(pScrn,pScrn->currentMode)) return FALSE; CHIPSSaveScreen(pScreen,SCREEN_SAVER_ON); - CHIPSAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + CHIPSAdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); /* * The next step is to setup the screen's visuals, and initialise the @@ -3511,6 +3896,8 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (!miSetVisualTypes(8, PseudoColorMask | GrayScaleMask, pScrn->rgbBits, PseudoColor)) return FALSE; + if (!miSetVisualTypes(16, TrueColorMask, pScrn->rgbBits, TrueColor)) + return FALSE; } else { if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), @@ -3593,6 +3980,9 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86SetBlackWhitePixels(pScreen); + cPtr->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = chipsBlockHandler; + if ( (pScrn->depth >= 8)) CHIPSDGAInit(pScreen); @@ -3693,7 +4083,11 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) freespace = allocatebase - pScrn->displayWidth * pScrn->virtualY * (pScrn->bitsPerPixel >> 3); - currentaddr = allocatebase; + if ((cPtr->Flags & ChipsDualChannelSupport) && + (cPtr->SecondCrtc == TRUE)) + currentaddr = allocatebase + cPtrEnt->masterFbMapSize; + else + currentaddr = allocatebase; if (serverGeneration == 1) xf86DrvMsg(scrnIndex, X_PROBED, "%d bytes off-screen memory available\n", freespace); @@ -3845,14 +4239,11 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if(!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, chipsLoadPalette, NULL, CMAP_RELOAD_ON_MODE_SWITCH)) return FALSE; - } else if ((cPtr->Flags & ChipsGammaSupport) && (pScrn->depth > 8)) { + } else { if(!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, (pScrn->depth == 16 ? chipsLoadPalette16 : chipsLoadPalette), NULL, CMAP_RELOAD_ON_MODE_SWITCH | CMAP_PALETTED_TRUECOLOR)) return FALSE; - } else { - if (!vgaHWHandleColormaps(pScreen)) - return FALSE; } if (pScrn->bitsPerPixel <= 8) @@ -3879,6 +4270,13 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86DPMSInit(pScreen, (DPMSSetProcPtr)chipsDisplayPowerManagementSet, 0); +#if 0 /* #### Shouldn't be needed */ + /* Dual head, needs to fix framebuffer memory address */ + if ((cPtr->Flags & ChipsDualChannelSupport) && + (cPtr->SecondCrtc == TRUE)) + pScrn->memPhysBase = cPtr->FbAddress + cPtrEnt->masterFbMapSize; +#endif + /* Wrap the current CloseScreen function */ cPtr->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = CHIPSCloseScreen; @@ -3895,7 +4293,16 @@ CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) Bool CHIPSSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) { + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + CHIPSPtr cPtr = CHIPSPTR(pScrn); + CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; + ErrorF("CHIPSSwitchMode\n"); + + if (cPtr->UseDualChannel) + DUALREOPEN; + return chipsModeInit(xf86Screens[scrnIndex], mode); } @@ -3903,16 +4310,14 @@ CHIPSSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) void CHIPSAdjustFrame(int scrnIndex, int x, int y, int flags) { - ScrnInfoPtr pScrn; + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + CHIPSPtr cPtr = CHIPSPTR(pScrn); + CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; int Base; - CHIPSPtr cPtr; - vgaHWPtr hwp; + vgaHWPtr hwp = VGAHWPTR(pScrn); unsigned char tmp; - pScrn = xf86Screens[scrnIndex]; - hwp = VGAHWPTR(pScrn); - cPtr = CHIPSPTR(pScrn); - if (xf86ReturnOptValBool(cPtr->Options, OPTION_SHOWCACHE, FALSE) && y) { int lastline = cPtr->FbMapSize / ((pScrn->displayWidth * pScrn->bitsPerPixel) / 8); @@ -3922,7 +4327,7 @@ CHIPSAdjustFrame(int scrnIndex, int x, int y, int flags) } Base = y * pScrn->displayWidth + x; - + /* calculate base bpp dep. */ switch (pScrn->bitsPerPixel) { case 1: @@ -3948,6 +4353,9 @@ CHIPSAdjustFrame(int scrnIndex, int x, int y, int flags) break; } + if (cPtr->UseDualChannel) + DUALREOPEN; + /* write base to chip */ /* * These are the generic starting address registers. @@ -3964,6 +4372,25 @@ CHIPSAdjustFrame(int scrnIndex, int x, int y, int flags) 0x030000)) >> 16) | (tmp & 0xF8)); } + if (cPtr->UseDualChannel && + (! xf86IsEntityShared(pScrn->entityList[0]))) { + unsigned int IOSS, MSS; + IOSS = cPtr->readIOSS(cPtr); + MSS = cPtr->readMSS(cPtr); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_B)); + + chipsFixResume(pScrn); + hwp->writeCrtc(hwp, 0x0C, (Base & 0xFF00) >> 8); + hwp->writeCrtc(hwp, 0x0D, Base & 0xFF); + if (((cPtr->readXR(cPtr, 0x09)) & 0x1) == 0x1) + hwp->writeCrtc(hwp, 0x40, ((Base & 0x0F0000) >> 16) | 0x80); + + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + } + if (cPtr->Flags & ChipsOverlay8plus16) { Base = (Base << 3) & ~(unsigned long)0xF; @@ -3971,7 +4398,7 @@ CHIPSAdjustFrame(int scrnIndex, int x, int y, int flags) cPtr->writeMR(cPtr, 0x23, ((cPtr->FbOffset16 + Base) >> 8) & 0xFF); cPtr->writeMR(cPtr, 0x24, ((cPtr->FbOffset16 + Base) >> 16) & 0xFF); } - + } /* Mandatory */ @@ -3980,13 +4407,32 @@ CHIPSCloseScreen(int scrnIndex, ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; CHIPSPtr cPtr = CHIPSPTR(pScrn); + CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; if(pScrn->vtSema){ /*§§§*/ - chipsHWCursorOff(cPtr); - chipsRestore(pScrn, &(VGAHWPTR(pScrn))->SavedReg, &cPtr->SavedReg, TRUE); - chipsLock(pScrn); - chipsUnmapMem(pScrn); + if (cPtr->Flags & ChipsDualChannelSupport) { + if (cPtr->UseDualChannel) + DUALREOPEN; + DUALCLOSE; + } else { + chipsHWCursorOff(cPtr, pScrn); + chipsRestore(pScrn, &(VGAHWPTR(pScrn))->SavedReg, &cPtr->SavedReg, + TRUE); + chipsLock(pScrn); + } + chipsUnmapMem(pScrn); } + + if (xf86IsEntityShared(pScrn->entityList[0])) { + DevUnion *pPriv; + pPriv = xf86GetEntityPrivate(pScrn->entityList[0], CHIPSEntityIndex); + cPtrEnt = pPriv->ptr; + cPtrEnt->refCount--; + } + if (cPtr->pVbe) + vbeFree(cPtr->pVbe); + cPtr->pVbe = NULL; if (cPtr->AccelInfoRec) XAADestroyInfoRec(cPtr->AccelInfoRec); if (cPtr->CursorInfoRec) @@ -3996,7 +4442,11 @@ CHIPSCloseScreen(int scrnIndex, ScreenPtr pScreen) if (cPtr->DGAModes) xfree(cPtr->DGAModes); pScrn->vtSema = FALSE; + if(cPtr->BlockHandler) + pScreen->BlockHandler = cPtr->BlockHandler; + pScreen->CloseScreen = cPtr->CloseScreen; /*§§§*/ + xf86ClearPrimInitDone(pScrn->entityList[0]); return (*pScreen->CloseScreen)(scrnIndex, pScreen);/*§§§*/ } @@ -4040,6 +4490,8 @@ chipsDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, { vgaHWPtr hwp = VGAHWPTR(pScrn); CHIPSPtr cPtr = CHIPSPTR(pScrn); + CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; unsigned char dpmsreg, seqreg, lcdoff, tmp; if (!pScrn->vtSema) @@ -4075,6 +4527,9 @@ chipsDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, return; } + if (cPtr->UseDualChannel) + DUALREOPEN; + seqreg |= hwp->readSeq(hwp, 0x01) & ~0x20; hwp->writeSeq(hwp, 0x01, seqreg); if (IS_HiQV(cPtr)) { @@ -4181,6 +4636,8 @@ chipsClockSave(ScrnInfoPtr pScrn, CHIPSClockPtr Clock) unsigned char tmp; vgaHWPtr hwp = VGAHWPTR(pScrn); CHIPSPtr cPtr = CHIPSPTR(pScrn); + CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; unsigned char Type = cPtr->ClockType; Clock->msr = hwp->readMiscOut(hwp)&0xFE; /* save standard VGA clock reg */ @@ -4188,16 +4645,12 @@ chipsClockSave(ScrnInfoPtr pScrn, CHIPSClockPtr Clock) case HiQV_STYLE: /* save alternate clock select reg.*/ /* The 69030 FP clock select is at FR01 instead */ - if (cPtr->Flags & ChipsDualChannelSupport) { - unsigned char IOSS, MSS; - IOSS = cPtr->readIOSS(cPtr); - MSS = cPtr->readMSS(cPtr); - cPtr->writeIOSS(cPtr,((IOSS&0xE0) | 0x11)); /* Select Pipeline A */ - cPtr->writeMSS(cPtr,((MSS&0xF0) | 0x8)); + if (cPtr->UseDualChannel) + DUALREOPEN; + + if (cPtr->Flags & ChipsDualChannelSupport) Clock->fr03 = cPtr->readFR(cPtr, 0x01); - cPtr->writeIOSS(cPtr,IOSS); - cPtr->writeMSS(cPtr,MSS); - } else + else Clock->fr03 = cPtr->readFR(cPtr, 0x03); if (!Clock->Clock) { /* save HiQV console clock */ tmp = cPtr->CRTclkInx << 2; @@ -4235,11 +4688,16 @@ chipsClockFind(ScrnInfoPtr pScrn, int no, CHIPSClockPtr Clock) { vgaHWPtr hwp = VGAHWPTR(pScrn); CHIPSPtr cPtr = CHIPSPTR(pScrn); + CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; unsigned char Type = cPtr->ClockType; if (no > (pScrn->numClocks - 1)) return (FALSE); + if (cPtr->UseDualChannel) + DUALREOPEN; + switch (Type & GET_STYLE) { case HiQV_STYLE: Clock->msr = cPtr->CRTclkInx << 2; @@ -4310,6 +4768,7 @@ chipsClockFind(ScrnInfoPtr pScrn, int no, CHIPSClockPtr Clock) #endif return (TRUE); } + static int chipsGetHWClock(ScrnInfoPtr pScrn) @@ -4368,7 +4827,6 @@ chipsClockLoad(ScrnInfoPtr pScrn, CHIPSClockPtr Clock) volatile unsigned char tmp, tmpmsr, tmpfcr, tmp02; volatile unsigned char tmp33, tmp54, tmpf03; unsigned char vclk[3]; - volatile unsigned char IOSS, MSS; tmpmsr = hwp->readMiscOut(hwp); /* read msr, needed for all styles */ @@ -4377,13 +4835,7 @@ chipsClockLoad(ScrnInfoPtr pScrn, CHIPSClockPtr Clock) /* save alternate clock select reg. */ /* The 69030 FP clock select is at FR01 instead */ if (cPtr->Flags & ChipsDualChannelSupport) { - IOSS = cPtr->readIOSS(cPtr); - MSS = cPtr->readMSS(cPtr); - cPtr->writeIOSS(cPtr,((IOSS&0xE0) | 0x11)); /* Select Pipeline A */ - cPtr->writeMSS(cPtr,((MSS&0xF0) | 0x8)); tmpf03 = cPtr->readFR(cPtr, 0x01); - cPtr->writeIOSS(cPtr,IOSS); - cPtr->writeMSS(cPtr,MSS); } else tmpf03 = cPtr->readFR(cPtr, 0x03); /* select fixed clock 0 before tampering with VCLK select */ @@ -4391,11 +4843,7 @@ chipsClockLoad(ScrnInfoPtr pScrn, CHIPSClockPtr Clock) cPtr->SuspendHack.vgaIOBaseFlag); /* The 69030 FP clock select is at FR01 instead */ if (cPtr->Flags & ChipsDualChannelSupport) { - cPtr->writeIOSS(cPtr,((IOSS&0xE0) | 0x11)); /* Select Pipeline A */ - cPtr->writeMSS(cPtr,((MSS&0xF0) | 0x8)); cPtr->writeFR(cPtr, 0x01, (tmpf03 & ~0x0C) | 0x04); - cPtr->writeIOSS(cPtr,IOSS); - cPtr->writeMSS(cPtr,MSS); } else cPtr->writeFR(cPtr, 0x03, (tmpf03 & ~0x0C) | 0x04); if (!Clock->Clock) { /* Hack to load saved console clock */ @@ -4438,12 +4886,8 @@ chipsClockLoad(ScrnInfoPtr pScrn, CHIPSClockPtr Clock) usleep(10000); /* Let VCO stabilise */ /* The 69030 FP clock select is at FR01 instead */ if (cPtr->Flags & ChipsDualChannelSupport) { - cPtr->writeIOSS(cPtr,((IOSS&0xE0) | 0x11)); /* Select Pipeline A */ - cPtr->writeMSS(cPtr,((MSS&0xF0) | 0x8)); cPtr->writeFR(cPtr, 0x01, ((tmpf03 & ~0x0C) | (Clock->fr03 & 0x0C))); - cPtr->writeIOSS(cPtr,IOSS); - cPtr->writeMSS(cPtr,MSS); } else cPtr->writeFR(cPtr, 0x03, ((tmpf03 & ~0x0C) | (Clock->fr03 & 0x0C))); @@ -4535,6 +4979,7 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk) /* Hack to deal with problem of Toshiba 720CDT clock */ int M_max = (IS_HiQV(cPtr) && cPtr->Chipset != CHIPS_CT69000 && cPtr->Chipset != CHIPS_CT69030) ? 63 : 127; + /* @@@ < CHIPS_CT690x0 ?? */ /* Other parameters available on the 65548 but not the 65545, and @@ -4574,8 +5019,8 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk) target = Clock * 1000; /* @@@ >= CHIPS_CT690x0 ?? */ - for (PSNx = (cPtr->Chipset == CHIPS_CT69000 || - cPtr->Chipset == CHIPS_CT69030) ? 1 : 0; PSNx <= 1; PSNx++) { + for (PSNx = ((cPtr->Chipset == CHIPS_CT69000) || + (cPtr->Chipset == CHIPS_CT69030)) ? 1 : 0; PSNx <= 1; PSNx++) { int low_N, high_N; double Fref4PSN; @@ -4584,7 +5029,8 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk) low_N = 3; high_N = 127; - while (Fref / (PSN * low_N) > 2.0e6) + while (Fref / (PSN * low_N) > (((cPtr->Chipset == CHIPS_CT69000) || + (cPtr->Chipset == CHIPS_CT69030)) ? 5.0e6 : 2.0e6)) low_N++; while (Fref / (PSN * high_N) < 150.0e3) high_N--; @@ -4594,8 +5040,8 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk) double tmp = Fref4PSN / N; /* @@@ < CHIPS_CT690x0 ?? */ - for (P = (IS_HiQV(cPtr) && cPtr->Chipset != CHIPS_CT69000 && - cPtr->Chipset != CHIPS_CT69030) ? 1 : 0; + for (P = (IS_HiQV(cPtr) && (cPtr->Chipset != CHIPS_CT69000) && + (cPtr->Chipset != CHIPS_CT69030)) ? 1 : 0; P <= 5; P++) { /* to force post divisor on Toshiba 720CDT */ double Fvco_desired = target * (1 << P); @@ -4643,7 +5089,7 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk) } /* @@@ >= CHIPS_CT690x0 ?? */ vclk[0] = (bestP << (IS_HiQV(cPtr) ? 4 : 1)) + - ((cPtr->Chipset == CHIPS_CT69000 || cPtr->Chipset == CHIPS_CT69030) + (((cPtr->Chipset == CHIPS_CT69000) || (cPtr->Chipset == CHIPS_CT69030)) ? 0 : (bestPSN == 1)); vclk[1] = bestM - 2; vclk[2] = bestN - 2; @@ -4655,20 +5101,16 @@ chipsCalcClock(ScrnInfoPtr pScrn, int Clock, unsigned char *vclk) } static void -chipsSave(ScrnInfoPtr pScrn) +chipsSave(ScrnInfoPtr pScrn, vgaRegPtr VgaSave, CHIPSRegPtr ChipsSave) { - vgaRegPtr VgaSave = &VGAHWPTR(pScrn)->SavedReg; vgaHWPtr hwp = VGAHWPTR(pScrn); CHIPSPtr cPtr = CHIPSPTR(pScrn); - CHIPSRegPtr ChipsSave; int i; unsigned char tmp; #ifdef DEBUG ErrorF("chipsSave\n"); #endif - ChipsSave = &cPtr->SavedReg; - /* set registers that we can program the controller */ /* bank 0 */ if (IS_HiQV(cPtr)) { @@ -4688,12 +5130,6 @@ chipsSave(ScrnInfoPtr pScrn) /* save clock */ chipsClockSave(pScrn, &ChipsSave->Clock); - /* Save the IOSS/MSS dual display channel registers */ - if (cPtr->Flags & ChipsDualChannelSupport) { - ChipsSave->MSS = cPtr->readMSS(cPtr); - ChipsSave->IOSS = cPtr->readIOSS(cPtr); - } - /* save extended registers */ if (IS_HiQV(cPtr)) { for (i = 0; i < 0xFF; i++) { @@ -4751,6 +5187,12 @@ chipsModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) chipsUnlock(pScrn); chipsFixResume(pScrn); + /* + * We need to delay cursor loading after resetting the video mode + * to give the engine a chance to recover. + */ + cPtr->cursorDelay = TRUE; + if (IS_HiQV(cPtr)) return chipsModeInitHiQV(pScrn, mode); else if (IS_Wingine(cPtr)) @@ -4805,6 +5247,7 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode) ChipsNew = &cPtr->ModeReg; ChipsStd = &hwp->ModeReg; + /* * Possibly fix up the panel size, if the manufacture is stupid * enough to set it incorrectly in text modes @@ -4826,7 +5269,22 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode) ErrorF("bomb 2\n"); return (FALSE); } - + + /* Give Warning if the dual display mode will cause problems */ + /* Note 64bit wide memory bus assumed (as in 69000 and 69030 */ + if (cPtr->UseDualChannel && ((cPtr->SecondCrtc == TRUE) || + (cPtr->Flags & ChipsDualRefresh))) { + if (((ChipsNew->Clock.FPClock + ChipsNew->Clock.Clock) * + (max(1, pScrn->bitsPerPixel >> 3) + + ((cPtr->FrameBufferSize && (cPtr->PanelType & ChipsLCD)) ? + 1 : 0)) / (8 * 0.7)) > cPtr->MemClock.Max) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Memory bandwidth requirements exceeded by dual-channel\n"); + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + " mode. Display might be corrupted!!!\n"); + } + } + /* get C&T Specific Registers */ for (i = 0; i < 0xFF; i++) { #ifdef SAR04 @@ -4846,14 +5304,6 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode) ChipsNew->CR[i] = hwp->readCrtc(hwp, i); } - /* Read the display panel registers and force them to desired mode */ - if (cPtr->Flags & ChipsDualChannelSupport) { - ChipsNew->MSS = cPtr->readMSS(cPtr); - ChipsNew->IOSS = cPtr->readIOSS(cPtr); - ChipsNew->MSS &= 0xF0 | 0x0B ; - ChipsNew->IOSS &= 0xE0 |0x13 ; - } - /* * Here all of the other fields of 'ChipsNew' get filled in, to * handle the SVGA extended registers. It is also allowable @@ -4919,6 +5369,25 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode) ChipsNew->XR[0xCE] = cPtr->MemClock.xrCE; } + /* Set the 69030 dual channel settings */ + if (cPtr->Flags & ChipsDualChannelSupport) { + ChipsNew->FR[0x01] &= 0xFC; + if ((cPtr->SecondCrtc == FALSE) && (cPtr->PanelType & ChipsLCD)) + ChipsNew->FR[0x01] |= 0x02; + else + ChipsNew->FR[0x01] |= 0x01; + ChipsNew->FR[0x02] &= 0xCC; + if ((cPtr->SecondCrtc == TRUE) || (cPtr->Flags & ChipsDualRefresh)) + ChipsNew->FR[0x02] |= 0x01; /* Set DAC to pipe B */ + else + ChipsNew->FR[0x02] &= 0xFE; /* Set DAC to pipe A */ + + if (cPtr->PanelType & ChipsLCD) + ChipsNew->FR[0x02] |= 0x20; /* Enable the LCD output */ + if (cPtr->PanelType & ChipsCRT) + ChipsNew->FR[0x02] |= 0x10; /* Enable the CRT output */ + } + /* linear specific */ if (cPtr->Flags & ChipsLinearSupport) { ChipsNew->XR[0x0A] |= 0x02; /* Linear Addressing Mode */ @@ -4993,11 +5462,13 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode) ChipsStd->CRTC[5] = (ChipsStd->CRTC[5] & ~0x80) | ((i << 2) &0x80); ChipsNew->CR[0x3C] = (i & 0xC0); } +#else + ChipsNew->CR[0x3C] = vgaHWHBlankKGA(mode, ChipsStd, 8, + KGA_FIX_OVERSCAN | KGA_ENABLE_ON_ZERO) << 6; #endif - ChipsNew->CR[0x3C] = vgaHWHBlankKGA(mode, ChipsStd, 8, 0) << 6; } else - vgaHWHBlankKGA(mode, ChipsStd, 6, 0); - vgaHWVBlankKGA(mode, ChipsStd, 8, 0); + vgaHWHBlankKGA(mode, ChipsStd, 6, KGA_FIX_OVERSCAN | KGA_ENABLE_ON_ZERO); + vgaHWVBlankKGA(mode, ChipsStd, 8, KGA_FIX_OVERSCAN | KGA_ENABLE_ON_ZERO); ChipsNew->CR[0x40] |= 0x80; @@ -5164,21 +5635,24 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode) if (cPtr->PanelType & ChipsLCD) { cPtr->OverlaySkewX = (((ChipsNew->FR[0x23] & 0xFF) - (ChipsNew->FR[0x20] & 0xFF) + 3) << 3) - - 1; + - 1; cPtr->OverlaySkewY = (ChipsNew->FR[0x33] + ((ChipsNew->FR[0x36] & 0xF) << 8) - (ChipsNew->FR[0x31] & 0xF0) - (ChipsNew->FR[0x32] & 0x0F) - ((ChipsNew->FR[0x35] & 0xF0) << 4)); + if (!xf86ReturnOptValBool(cPtr->Options, OPTION_LCD_STRETCH, + FALSE)) { if (cPtr->PanelSize.HDisplay > mode->CrtcHDisplay) cPtr->OverlaySkewX += (cPtr->PanelSize.HDisplay - mode->CrtcHDisplay) / 2; if (cPtr->PanelSize.VDisplay > mode->CrtcVDisplay) cPtr->OverlaySkewY += (cPtr->PanelSize.VDisplay - - mode->CrtcVDisplay) / 2; + mode->CrtcVDisplay) / 2; + } } else { - cPtr->OverlaySkewX = mode->CrtcHTotal - mode->CrtcHBlankStart - 1; - cPtr->OverlaySkewY = mode->CrtcVTotal - mode->CrtcVSyncEnd; + cPtr->OverlaySkewX = mode->CrtcHTotal - mode->CrtcHBlankStart - 9; + cPtr->OverlaySkewY = mode->CrtcVTotal - mode->CrtcVSyncEnd - 2; if (mode->Flags & V_INTERLACE) { /* @@ -5192,6 +5666,25 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode) } } + + /* mask for viewport granularity */ + + switch (pScrn->bitsPerPixel) { + case 8: + cPtr->viewportMask = ~7U; + break; + case 16: + cPtr->viewportMask = ~3U; + break; + case 24: + cPtr->viewportMask = ~7U; + break; + case 32: + cPtr->viewportMask = ~0U; + break; + default: + cPtr->viewportMask = ~7U; + } /* Turn off multimedia by default as it degrades performance */ ChipsNew->XR[0xD0] &= 0x0f; @@ -5250,7 +5743,7 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode) ChipsNew->MR[0x41] = 0xFF; ChipsNew->MR[0x42] = 0x00; } else if (cPtr->Flags & ChipsVideoSupport) { -#if 0 +#if 0 /* if we do this even though video isn't playing we kill performance */ ChipsNew->XR[0xD0] |= 0x10; /* Force the Multimedia engine on */ #endif #ifdef SAR04 @@ -5268,7 +5761,39 @@ chipsModeInitHiQV(ScrnInfoPtr pScrn, DisplayModePtr mode) /* Program the registers */ /*vgaHWProtect(pScrn, TRUE);*/ - chipsRestore(pScrn, ChipsStd, ChipsNew, FALSE); + + + if ((cPtr->Flags & ChipsDualChannelSupport) && + (!xf86IsEntityShared(pScrn->entityList[0]))) { + unsigned char IOSS, MSS, tmpfr01; + + + IOSS = cPtr->readIOSS(cPtr); + MSS = cPtr->readMSS(cPtr); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_A)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | + MSS_PIPE_A)); + chipsRestore(pScrn, ChipsStd, ChipsNew, FALSE); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | + MSS_PIPE_B)); + /* + * Hack:: Force Pipe-B on for dual refresh, and off elsewise + */ + tmpfr01 = ChipsNew->FR[0x01]; + ChipsNew->FR[0x01] &= 0xFC; + if (cPtr->UseDualChannel) + ChipsNew->FR[0x01] |= 0x01; + chipsRestore(pScrn, ChipsStd, ChipsNew, FALSE); + ChipsNew->FR[0x01] = tmpfr01; + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + } else { + chipsRestore(pScrn, ChipsStd, ChipsNew, FALSE); + } + /*vgaHWProtect(pScrn, FALSE);*/ usleep(100000); /* prevents cursor corruption seen on a TECRA 510 */ @@ -5994,17 +6519,16 @@ chipsRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, CHIPSRegPtr ChipsReg, CHIPSPtr cPtr = CHIPSPTR(pScrn); unsigned char tmp = 0; - /* Before we do anything, if using dual channel set the IOSS/MSS regs */ - if (cPtr->Flags & ChipsDualChannelSupport) { - cPtr->writeIOSS(cPtr,ChipsReg->IOSS); - cPtr->writeMSS(cPtr,ChipsReg->MSS); - } - /*vgaHWProtect(pScrn, TRUE);*/ /* set registers so that we can program the controller */ if (IS_HiQV(cPtr)) { cPtr->writeXR(cPtr, 0x0E, 0x00); + if (cPtr->Flags & ChipsDualChannelSupport) { + tmp = cPtr->readFR(cPtr, 0x01); /* Disable pipeline */ + cPtr->writeFR(cPtr, 0x01, (tmp & 0xFC)); + cPtr->writeFR(cPtr, 0x02, 0x00); /* CRT/FP off */ + } } else { cPtr->writeXR(cPtr, 0x10, 0x00); cPtr->writeXR(cPtr, 0x11, 0x00); @@ -6017,8 +6541,12 @@ chipsRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, CHIPSRegPtr ChipsReg, chipsFixResume(pScrn); - /* wait for vsync if sequencer is running - stop sequencer */ - if (cPtr->SyncResetIgn) { /* only do if sync reset is ignored */ + /* + * Wait for vsync if sequencer is running - stop sequencer. + * Only do if sync reset is ignored. Dual pipeline capable + * chips have pipeline forced off here, so we don't care. + */ + if ((cPtr->SyncResetIgn) && (!(cPtr->Flags & ChipsDualChannelSupport))) { while (((hwp->readST01(hwp)) & 0x08) == 0x08); /* VSync off */ while (((hwp->readST01(hwp)) & 0x08) == 0x00); /* VSync on */ hwp->writeSeq(hwp, 0x07, 0x00); /* reset hsync - just in case... */ @@ -6033,33 +6561,23 @@ chipsRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, CHIPSRegPtr ChipsReg, chipsRestoreExtendedRegs(pScrn, ChipsReg); #if 0 - /* - * If we are using the multimedia engine with the 69030, make sure only - * pipeline A's multimedia engine is on - */ - if (cPtr->Flags & ChipsDualChannelSupport) { - unsigned char IOSS, MSS, tmpXRD0; - IOSS = cPtr->readIOSS(cPtr); - MSS = cPtr->readMSS(cPtr); - cPtr->writeIOSS(cPtr,((IOSS&0xE0) | 0x11)); /* Select Pipeline B */ - cPtr->writeMSS(cPtr,((MSS&0xF0) | 0x8)); - - tmpXRD0 = cPtr->readXR(cPtr, 0xD0); - cPtr->writeXR(cPtr, 0xD0, (tmpXRD0 & 0xEF)); - cPtr->writeIOSS(cPtr,IOSS); - cPtr->writeMSS(cPtr,MSS); - } -#endif - -#if 0 /* if people complain about lock ups or blank screens -- reenable */ /* set CRTC registers - do it before sequencer restarts */ for (i=0; i<25; i++) hwp->writeCrtc(hwp, i, VgaReg->CRTC[i]); #endif /* set generic registers */ - vgaHWRestore(pScrn, VgaReg, - VGA_SR_MODE | VGA_SR_CMAP | (restoreFonts ? VGA_SR_FONTS : 0)); + /* + * Enabling writing to the colourmap causes 69030's to lock. + * Anyone care to explain to me why ???? + */ + if (cPtr->Flags & ChipsDualChannelSupport) { + vgaHWRestore(pScrn, VgaReg, VGA_SR_MODE | + (restoreFonts ? VGA_SR_FONTS : 0)); + } else { + vgaHWRestore(pScrn, VgaReg, VGA_SR_MODE | VGA_SR_CMAP | + (restoreFonts ? VGA_SR_FONTS : 0)); + } /* set stretching registers */ if (IS_HiQV(cPtr)) { @@ -6100,6 +6618,13 @@ chipsRestore(ScrnInfoPtr pScrn, vgaRegPtr VgaReg, CHIPSRegPtr ChipsReg, /* Fix resume again here, as Nozomi seems to need it */ chipsFixResume(pScrn); /*vgaHWProtect(pScrn, FALSE);*/ + + /* Enable pipeline if needed */ + if (cPtr->Flags & ChipsDualChannelSupport) { + cPtr->writeFR(cPtr, 0x01, ChipsReg->FR[0x01]); + cPtr->writeFR(cPtr, 0x02, ChipsReg->FR[0x02]); + } + } static void @@ -6152,8 +6677,18 @@ chipsRestoreExtendedRegs(ScrnInfoPtr pScrn, CHIPSRegPtr Regs) for (i = 0; i < 0x80; i++) { /* Don't touch alternate clock select reg. */ - if ((i == 0x01) && (cPtr->Chipset == CHIPS_CT69030)) + if ((i == 0x01) && (cPtr->Chipset == CHIPS_CT69030)) { + /* restore the non clock bits */ + tmp = cPtr->readFR(cPtr, 0x01); + cPtr->writeFR(cPtr, 0x01, ((Regs->FR[0x01] & 0xF0) | + (tmp & ~0xF0))); continue; + } + + if ((i == 0x02) && (cPtr->Chipset == CHIPS_CT69030)) + /* keep pipeline disabled till we are ready */ + continue; + if ((i == 0x03) && (cPtr->Chipset != CHIPS_CT69030)) { /* restore the non clock bits */ tmp = cPtr->readFR(cPtr, 0x03); @@ -6161,6 +6696,11 @@ chipsRestoreExtendedRegs(ScrnInfoPtr pScrn, CHIPSRegPtr Regs) (tmp & ~0xC3))); continue; } + + if ((i > 0x03) && (cPtr->Chipset != CHIPS_CT69030) && + (cPtr->SecondCrtc == TRUE)) + continue; + if ( (i == 0x40) || (i==0x48)) { /* !! set stretching but disable compensation */ cPtr->writeFR(cPtr, i, Regs->FR[i] & 0xFE); @@ -6316,6 +6856,8 @@ chipsMapMem(ScrnInfoPtr pScrn) { CHIPSPtr cPtr = CHIPSPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); + CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; if (cPtr->Flags & ChipsLinearSupport) { if (cPtr->UseMMIO) { @@ -6341,14 +6883,27 @@ chipsMapMem(ScrnInfoPtr pScrn) return FALSE; } if (cPtr->FbMapSize) { + unsigned long Addr = (unsigned long)cPtr->FbAddress; + unsigned int Map = cPtr->FbMapSize; + + if ((cPtr->Flags & ChipsDualChannelSupport) && + (xf86IsEntityShared(pScrn->entityList[0]))) { + if(cPtr->SecondCrtc == FALSE) { + Addr = cPtrEnt->masterFbAddress; + Map = cPtrEnt->masterFbMapSize; + } else { + Addr = cPtrEnt->slaveFbAddress; + Map = cPtrEnt->slaveFbMapSize; + } + } + if (cPtr->Bus == ChipsPCI) cPtr->FbBase = xf86MapPciMem(pScrn->scrnIndex,VIDMEM_FRAMEBUFFER, - cPtr->PciTag, (unsigned long)cPtr->FbAddress, - cPtr->FbMapSize); + cPtr->PciTag, Addr, Map); + else cPtr->FbBase = xf86MapVidMem(pScrn->scrnIndex,VIDMEM_FRAMEBUFFER, - (unsigned long)cPtr->FbAddress, - cPtr->FbMapSize); + Addr, Map); if (cPtr->FbBase == NULL) return FALSE; @@ -6405,8 +6960,13 @@ chipsBlankScreen(ScrnInfoPtr pScrn, Bool unblank) { CHIPSPtr cPtr = CHIPSPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); + CHIPSEntPtr cPtrEnt = xf86GetEntityPrivate(pScrn->entityList[0], + CHIPSEntityIndex)->ptr; unsigned char scrn; + if (cPtr->UseDualChannel) + DUALREOPEN; + /* fix things that could be messed up by suspend/resume */ if (!IS_HiQV(cPtr)) cPtr->writeXR(cPtr, 0x15, 0x00); @@ -6430,6 +6990,44 @@ chipsBlankScreen(ScrnInfoPtr pScrn, Bool unblank) if (!cPtr->SyncResetIgn) { hwp->writeSeq(hwp, 0x00, 0x03); } + + if ((cPtr->UseDualChannel) && + (! xf86IsEntityShared(pScrn->entityList[0]))) { + unsigned int IOSS, MSS; + IOSS = cPtr->readIOSS(cPtr); + MSS = cPtr->readMSS(cPtr); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_B)); + + /* fix things that could be messed up by suspend/resume */ + if (!IS_HiQV(cPtr)) + cPtr->writeXR(cPtr, 0x15, 0x00); + + scrn = hwp->readSeq(hwp, 0x01); + + if (unblank) { + scrn &= 0xDF; /* enable screen */ + } else { + scrn |= 0x20; /* blank screen */ + } + + /* synchronous reset - stop counters */ + if (!cPtr->SyncResetIgn) { + hwp->writeSeq(hwp, 0x00, 0x01); + } + + hwp->writeSeq(hwp, 0x01, scrn); /* change mode */ + + /* end reset - start counters */ + if (!cPtr->SyncResetIgn) { + hwp->writeSeq(hwp, 0x00, 0x03); + } + + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + } + } static void @@ -6480,12 +7078,25 @@ chipsUnlock(ScrnInfoPtr pScrn) } static void -chipsHWCursorOn(CHIPSPtr cPtr) +chipsHWCursorOn(CHIPSPtr cPtr, ScrnInfoPtr pScrn) { /* enable HW cursor */ if (cPtr->HWCursorShown) { if (IS_HiQV(cPtr)) { cPtr->writeXR(cPtr, 0xA0, cPtr->HWCursorContents & 0xFF); + if (cPtr->UseDualChannel && + (! xf86IsEntityShared(pScrn->entityList[0]))) { + unsigned int IOSS, MSS; + IOSS = cPtr->readIOSS(cPtr); + MSS = cPtr->readMSS(cPtr); + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | + IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | + MSS_PIPE_B)); + cPtr->writeXR(cPtr, 0xA0, cPtr->HWCursorContents & 0xFF); + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + } } else { HW_DEBUG(0x8); if (cPtr->UseMMIO) { @@ -6498,7 +7109,7 @@ chipsHWCursorOn(CHIPSPtr cPtr) } static void -chipsHWCursorOff(CHIPSPtr cPtr) +chipsHWCursorOff(CHIPSPtr cPtr, ScrnInfoPtr pScrn) { /* disable HW cursor */ if (cPtr->HWCursorShown) { @@ -6564,6 +7175,28 @@ chipsProbeMonitor(ScrnInfoPtr pScrn) unsigned char dacdata[3]; unsigned char xr1, xr2; int type = 2; /* no monitor */ + unsigned char IOSS=0, MSS=0, tmpfr02=0, tmpfr01a=0, tmpfr01b=0; + + /* Dual channel display, enable both pipelines */ + if (cPtr->Flags & ChipsDualChannelSupport) { + IOSS = cPtr->readIOSS(cPtr); + MSS = cPtr->readMSS(cPtr); + tmpfr02 = cPtr->readFR(cPtr,0x02); + cPtr->writeFR(cPtr, 0x02, tmpfr02 & 0xCF); /* CRT/FP off */ + usleep(1000); + cPtr->writeIOSS(cPtr, ((IOSS & IOSS_MASK) | IOSS_PIPE_A)); + cPtr->writeMSS(cPtr, ((MSS & MSS_MASK) | MSS_PIPE_A)); + tmpfr01a = cPtr->readFR(cPtr,0x01); + if ((tmpfr01a & 0x3) == 0) + cPtr->writeFR(cPtr, 0x01, ((tmpfr01a & 0xFC) | 0x1)); + cPtr->writeIOSS(cPtr, ((IOSS & IOSS_MASK) | IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((MSS & MSS_MASK) | MSS_PIPE_B)); + tmpfr01b = cPtr->readFR(cPtr,0x01); + if ((tmpfr01b & 0x3) == 0) + cPtr->writeFR(cPtr, 0x01, ((tmpfr01b & 0xFC) | 0x1)); + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + } dacmask = hwp->readDacMask(hwp); /* save registers */ hwp->writeDacMask(hwp, 0x00); @@ -6612,6 +7245,20 @@ chipsProbeMonitor(ScrnInfoPtr pScrn) cPtr->writeXR(cPtr,0x81,xr1); cPtr->writeXR(cPtr,0xD0,xr2); } + + if (cPtr->Flags & ChipsDualChannelSupport) { + cPtr->writeIOSS(cPtr, ((IOSS & IOSS_MASK) | IOSS_PIPE_A)); + cPtr->writeMSS(cPtr, ((MSS & MSS_MASK) | MSS_PIPE_A)); + cPtr->writeFR(cPtr, 0x01, tmpfr01a); + cPtr->writeIOSS(cPtr, ((IOSS & IOSS_MASK) | IOSS_PIPE_B)); + cPtr->writeMSS(cPtr, ((MSS & MSS_MASK) | MSS_PIPE_B)); + cPtr->writeFR(cPtr, 0x01, tmpfr01b); + usleep(1000); + cPtr->writeIOSS(cPtr, IOSS); + cPtr->writeMSS(cPtr, MSS); + cPtr->writeFR(cPtr, 0x02, tmpfr02); + } + return type; } @@ -6639,17 +7286,32 @@ chipsSetPanelType(CHIPSPtr cPtr) CARD8 tmp; if (IS_HiQV(cPtr)) { - /* test LCD */ - /* FR01: DISPLAY TYPE REGISTER */ - /* FR01[1:0]: Display Type, 01 = CRT, 10 = FlatPanel */ - /* LCD */ - tmp = cPtr->readFR(cPtr, 0x01); - if ((tmp & 0x03) == 0x02) { - cPtr->PanelType |= ChipsLCD; - } - tmp = cPtr->readXR(cPtr,0xD0); - if (tmp & 0x01) { - cPtr->PanelType |= ChipsCRT; + if (cPtr->Chipset == CHIPS_CT69030) { + tmp = cPtr->readFR(cPtr, 0x00); + if (tmp & 0x20) { + /* FR02: DISPLAY TYPE REGISTER */ + /* FR02[4] = CRT, FR02[5] = FlatPanel */ + tmp = cPtr->readFR(cPtr, 0x02); + if (tmp & 0x10) + cPtr->PanelType |= ChipsCRT; + if (tmp & 0x20) + cPtr->PanelType |= ChipsLCD; + } else { + cPtr->PanelType |= ChipsCRT; + } + } else { + /* test LCD */ + /* FR01: DISPLAY TYPE REGISTER */ + /* FR01[1:0]: Display Type, 01 = CRT, 10 = FlatPanel */ + /* LCD */ + tmp = cPtr->readFR(cPtr, 0x01); + if ((tmp & 0x03) == 0x02) { + cPtr->PanelType |= ChipsLCD; + } + tmp = cPtr->readXR(cPtr,0xD0); + if (tmp & 0x01) { + cPtr->PanelType |= ChipsCRT; + } } } else { tmp = cPtr->readXR(cPtr, 0x51); @@ -6665,4 +7327,23 @@ chipsSetPanelType(CHIPSPtr cPtr) } } +static void +chipsBlockHandler ( + int i, + pointer blockData, + pointer pTimeout, + pointer pReadmask +){ + ScreenPtr pScreen = screenInfo.screens[i]; + ScrnInfoPtr pScrn = xf86Screens[i]; + CHIPSPtr cPtr = CHIPSPTR(pScrn); + + pScreen->BlockHandler = cPtr->BlockHandler; + (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + pScreen->BlockHandler = chipsBlockHandler; + if(cPtr->VideoTimerCallback) { + UpdateCurrentTime(); + (*cPtr->VideoTimerCallback)(pScrn, currentTime.milliseconds); + } +} diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h index 05aa7bfe4..b7bcfd39b 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h @@ -22,7 +22,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h,v 1.30 2000/10/23 12:10:13 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_driver.h,v 1.32 2001/05/15 10:19:36 eich Exp $ */ #ifndef _CT_DRIVER_H_ @@ -35,6 +35,7 @@ #include "xf86i2c.h" #include "xf86DDC.h" #include "xf86xv.h" +#include "vgaHW.h" /* Supported chipsets */ typedef enum { @@ -106,6 +107,7 @@ typedef struct { #define ChipsGammaSupport 0x00000080 #define ChipsVideoSupport 0x00000100 #define ChipsDualChannelSupport 0x00000200 +#define ChipsDualRefresh 0x00000400 /* Options flags for the C&T chipsets */ #define ChipsHWCursor 0x00001000 @@ -152,14 +154,22 @@ typedef struct { #define ChipsSS 0x0800 #define IS_STN(x) ((x) & 0xE00) +/* Dual channel register enable masks */ +#define IOSS_MASK 0xE0 +#define IOSS_BOTH 0x13 +#define IOSS_PIPE_A 0x11 +#define IOSS_PIPE_B 0x1E +#define MSS_MASK 0xF0 +#define MSS_BOTH 0x0B +#define MSS_PIPE_A 0x02 +#define MSS_PIPE_B 0x05 + /* Storage for the registers of the C&T chipsets */ typedef struct { unsigned char XR[0xFF]; unsigned char CR[0x80]; unsigned char FR[0x80]; unsigned char MR[0x80]; - unsigned char MSS; - unsigned char IOSS; CHIPSClockReg Clock; } CHIPSRegRec, *CHIPSRegPtr; @@ -238,6 +248,23 @@ typedef void (*chipsWriteIOSSPtr)(CHIPSPtr cPtr, CARD8 value); /* The privates of the C&T driver */ #define CHIPSPTR(p) ((CHIPSPtr)((p)->driverPrivate)) + +typedef struct { + int lastInstance; + int refCount; + CARD32 masterFbAddress; + long masterFbMapSize; + CARD32 slaveFbAddress; + long slaveFbMapSize; + int mastervideoRam; + int slavevideoRam; + Bool masterOpen; + Bool slaveOpen; + Bool masterActive; + Bool slaveActive; +} CHIPSEntRec, *CHIPSEntPtr; + + typedef struct _CHIPSRec { pciVideoPtr PciInfo; PCITAG PciTag; @@ -281,6 +308,8 @@ typedef struct _CHIPSRec { CARD32 PanelType; CHIPSRegRec ModeReg; CHIPSRegRec SavedReg; + CHIPSRegRec SavedReg2; + vgaRegRec VgaSavedReg2; unsigned int * Regs32; unsigned int Flags; CARD32 Bus; @@ -295,12 +324,16 @@ typedef struct _CHIPSRec { int DGAViewportStatus; CloseScreenProcPtr CloseScreen; ScreenBlockHandlerProcPtr BlockHandler; + void (*VideoTimerCallback)(ScrnInfoPtr, Time); int videoKey; XF86VideoAdaptorPtr adaptor; int OverlaySkewX; int OverlaySkewY; int VideoZoomMax; - + Bool SecondCrtc; + CHIPSEntPtr entityPrivate; + unsigned char storeMSS; + unsigned char storeIOSS; #ifdef __arm32__ #ifdef __NetBSD__ int TVMode; @@ -320,6 +353,8 @@ typedef struct _CHIPSRec { chipsWriteMSSPtr writeMSS; chipsReadIOSSPtr readIOSS; chipsWriteIOSSPtr writeIOSS; + Bool cursorDelay; + unsigned int viewportMask; } CHIPSRec; typedef struct _CHIPSi2c { @@ -390,6 +425,112 @@ void chipsRefreshArea32(ScrnInfoPtr pScrn, int num, BoxPtr pbox); void chipsPointerMoved(int index, int x, int y); +/* + * Some macros for switching display channels. NOTE... It appears that we + * can't write to both display channels at the same time, and so the options + * MSS_BOTH and IOSS_BOTH should not be used. Need to get around this by set + * dual channel mode to pipe A by default and handling multiple channel writes + * in ModeInit.. + */ + +#define DUALOPEN \ + { \ + /* Set the IOSS/MSS registers to point to the right register set */ \ + if (xf86IsEntityShared(pScrn->entityList[0])) { \ + if (cPtr->SecondCrtc == TRUE) { \ + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \ + IOSS_PIPE_B)); \ + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | \ + MSS_PIPE_B)); \ + cPtrEnt->slaveOpen = TRUE; \ + cPtrEnt->slaveActive = TRUE; \ + cPtrEnt->masterActive = FALSE; \ + } else { \ + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \ + IOSS_PIPE_A)); \ + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | \ + MSS_PIPE_A)); \ + cPtrEnt->masterOpen = TRUE; \ + cPtrEnt->masterActive = TRUE; \ + cPtrEnt->slaveActive = FALSE; \ + } \ + } else { \ + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \ + IOSS_PIPE_A)); \ + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_A)); \ + } \ + } + +#define DUALREOPEN \ + { \ + if (xf86IsEntityShared(pScrn->entityList[0])) { \ + if (cPtr->SecondCrtc == TRUE) { \ + if (! cPtrEnt->slaveActive) { \ + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \ + IOSS_PIPE_B)); \ + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | \ + MSS_PIPE_B)); \ + cPtrEnt->slaveOpen = TRUE; \ + cPtrEnt->slaveActive = TRUE; \ + cPtrEnt->masterActive = FALSE; \ + } \ + } else { \ + if (! cPtrEnt->masterActive) { \ + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \ + IOSS_PIPE_A)); \ + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | \ + MSS_PIPE_A)); \ + cPtrEnt->masterOpen = TRUE; \ + cPtrEnt->masterActive = TRUE; \ + cPtrEnt->slaveActive = FALSE; \ + } \ + } \ + } \ + } + +#define DUALCLOSE \ + { \ + if (! xf86IsEntityShared(pScrn->entityList[0])) { \ + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \ + IOSS_PIPE_A)); \ + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_A)); \ + chipsHWCursorOff(cPtr, pScrn); \ + chipsRestore(pScrn, &(VGAHWPTR(pScrn))->SavedReg, \ + &cPtr->SavedReg, TRUE); \ + chipsLock(pScrn); \ + cPtr->writeIOSS(cPtr, ((cPtr->storeIOSS & IOSS_MASK) | \ + IOSS_PIPE_B)); \ + cPtr->writeMSS(cPtr, ((cPtr->storeMSS & MSS_MASK) | MSS_PIPE_B)); \ + chipsHWCursorOff(cPtr, pScrn); \ + chipsRestore(pScrn, &cPtr->VgaSavedReg2, &cPtr->SavedReg2, TRUE); \ + cPtr->writeIOSS(cPtr, cPtr->storeIOSS); \ + cPtr->writeMSS(cPtr, cPtr->storeMSS); \ + chipsLock(pScrn); \ + } else { \ + chipsHWCursorOff(cPtr, pScrn); \ + chipsRestore(pScrn, &(VGAHWPTR(pScrn))->SavedReg, &cPtr->SavedReg,\ + TRUE); \ + if (cPtr->SecondCrtc == TRUE) { \ + cPtrEnt->slaveActive = FALSE; \ + cPtrEnt->slaveOpen = FALSE; \ + if (! cPtrEnt->masterActive) { \ + cPtr->writeIOSS(cPtr, cPtr->storeIOSS); \ + cPtr->writeMSS(cPtr, cPtr->storeMSS); \ + chipsLock(pScrn); \ + } \ + } else { \ + cPtrEnt->masterActive = FALSE; \ + cPtrEnt->masterOpen = FALSE; \ + if (! cPtrEnt->slaveActive) { \ + cPtr->writeIOSS(cPtr, cPtr->storeIOSS); \ + cPtr->writeMSS(cPtr, cPtr->storeMSS); \ + chipsLock(pScrn); \ + } \ + } \ + } \ + } + + /* To aid debugging of 32 bit register access we make the following defines */ /* #define DEBUG diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c index 248c85624..ac98aac7a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c @@ -19,7 +19,7 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c,v 1.5 2000/09/22 11:35:48 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_regs.c,v 1.6 2001/05/09 19:57:05 dbateman Exp $ */ /* * The functions in this file are used to read/write the C&T extension register @@ -65,9 +65,6 @@ /* This is used for module versioning */ #include "xf86Version.h" -/* All drivers using the vgahw module need this */ -#include "vgaHW.h" - /* Driver specific headers */ #include "ct_driver.h" @@ -201,8 +198,8 @@ CHIPSSetStdExtFuncs(CHIPSPtr cPtr) * MMIO Access to the C&T extension registers */ -#define chipsminb(p) MMIO_IN8(cPtr->MMIOBase, (p)) -#define chipsmoutb(p,v) MMIO_OUT8(cPtr->MMIOBase, (p),(v)) +#define chipsminb(p) MMIO_IN8(cPtr->MMIOBaseVGA, (p)) +#define chipsmoutb(p,v) MMIO_OUT8(cPtr->MMIOBaseVGA, (p),(v)) static void chipsMmioWriteXR(CHIPSPtr cPtr, CARD8 index, CARD8 value) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c index 864b7843b..6f3e7fb8c 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c,v 1.6 2001/02/15 18:36:11 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/ct_video.c,v 1.7 2001/05/15 10:19:36 eich Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -43,14 +43,15 @@ static int CHIPSPutImage( ScrnInfoPtr, int, unsigned char*, short, short, Bool, RegionPtr, pointer); static int CHIPSQueryImageAttributes(ScrnInfoPtr, int, unsigned short *, unsigned short *, int *, int *); +static void CHIPSVideoTimerCallback(ScrnInfoPtr pScrn, Time time); -static void CHIPSBlockHandler(int, pointer, pointer, pointer); #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) static Atom xvColorKey; -void CHIPSInitVideo(ScreenPtr pScreen) +void +CHIPSInitVideo(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; @@ -92,7 +93,8 @@ void CHIPSInitVideo(ScreenPtr pScreen) } /* client libraries expect an encoding */ -static XF86VideoEncodingRec DummyEncoding[1] = +static +XF86VideoEncodingRec DummyEncoding[1] = { { 0, @@ -159,7 +161,7 @@ static XF86ImageRec Images[NUM_IMAGES] = }; typedef struct { - FBAreaPtr area; + FBLinearPtr linear; RegionRec clip; CARD32 colorKey; CARD32 videoStatus; @@ -171,7 +173,8 @@ typedef struct { #define GET_PORT_PRIVATE(pScrn) \ (CHIPSPortPrivPtr)((CHIPSPTR(pScrn))->adaptor->pPortPrivates[0].ptr) -void CHIPSResetVideo(ScrnInfoPtr pScrn) +void +CHIPSResetVideo(ScrnInfoPtr pScrn) { CHIPSPtr cPtr = CHIPSPTR(pScrn); CHIPSPortPrivPtr pPriv = cPtr->adaptor->pPortPrivates[0].ptr; @@ -319,18 +322,19 @@ RegionsEqual(RegionPtr A, RegionPtr B) boundaries in 16.16 fixed point. */ -static void +static Bool CHIPSClipVideo( BoxPtr dst, INT32 *x1, INT32 *x2, INT32 *y1, INT32 *y2, - BoxPtr extents, /* extents of the clip region */ + 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); @@ -371,6 +375,8 @@ CHIPSClipVideo( dst->x2 -= diff; *x2 -= diff * hscale; } + if(*x1 >= *x2) return FALSE; + if(*y1 < 0) { diff = (- *y1 + vscale - 1)/ vscale; dst->y1 += diff; @@ -382,6 +388,17 @@ CHIPSClipVideo( 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 @@ -400,18 +417,16 @@ CHIPSStopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit) tmp = cPtr->readXR(cPtr, 0xD0); cPtr->writeXR(cPtr, 0xD0, (tmp & 0xf)); } - if(pPriv->area) { - xf86FreeOffscreenArea(pPriv->area); - pPriv->area = NULL; + if(pPriv->linear) { + xf86FreeOffscreenLinear(pPriv->linear); + pPriv->linear = NULL; } pPriv->videoStatus = 0; - pScrn->pScreen->BlockHandler = cPtr->BlockHandler; } else { if(pPriv->videoStatus & CLIENT_VIDEO_ON) { pPriv->videoStatus |= OFF_TIMER; pPriv->offTime = currentTime.milliseconds + OFF_DELAY; - cPtr->BlockHandler = pScrn->pScreen->BlockHandler; - pScrn->pScreen->BlockHandler = CHIPSBlockHandler; + cPtr->VideoTimerCallback = CHIPSVideoTimerCallback; } } } @@ -533,13 +548,8 @@ CHIPSCopyMungedData( for(j = 0; j < h; j++) { for(i = 0; i < w; i++) { -#if 1 dst[i] = src1[i << 1] | (src1[(i << 1) + 1] << 16) | (src3[i] << 8) | (src2[i] << 24); -#else - dst[i] = (src1[i << 1] << 24) | (src1[(i << 1) + 1] << 8) | - (src3[i] << 0) | (src2[i] << 16); -#endif } dst += dstPitch; src1 += srcPitch; @@ -550,45 +560,45 @@ CHIPSCopyMungedData( } } -static FBAreaPtr +static FBLinearPtr CHIPSAllocateMemory( ScrnInfoPtr pScrn, - FBAreaPtr area, - int numlines + FBLinearPtr linear, + int size ){ ScreenPtr pScreen; - FBAreaPtr new_area; + FBLinearPtr new_linear; - if(area) { - if((area->box.y2 - area->box.y1) >= numlines) - return area; + if(linear) { + if(linear->size >= size) + return linear; - if(xf86ResizeOffscreenArea(area, pScrn->displayWidth, numlines)) - return area; + if(xf86ResizeOffscreenLinear(linear, size)) + return linear; - xf86FreeOffscreenArea(area); + xf86FreeOffscreenLinear(linear); } pScreen = screenInfo.screens[pScrn->scrnIndex]; - new_area = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth, - numlines, 0, NULL, NULL, NULL); + new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16, + NULL, NULL, NULL); - if(!new_area) { - int max_w, max_h; + if(!new_linear) { + int max_size; - xf86QueryLargestOffscreenArea(pScreen, &max_w, &max_h, 0, - FAVOR_WIDTH_THEN_AREA, PRIORITY_EXTREME); + xf86QueryLargestOffscreenLinear(pScreen, &max_size, 16, + PRIORITY_EXTREME); - if((max_w < pScrn->displayWidth) || (max_h < numlines)) + if(max_size < size) return NULL; xf86PurgeUnlockedOffscreenAreas(pScreen); - new_area = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth, - numlines, 0, NULL, NULL, NULL); + new_linear = xf86AllocateOffscreenLinear(pScreen, size, 16, + NULL, NULL, NULL); } - return new_area; + return new_linear; } static void @@ -641,6 +651,8 @@ CHIPSDisplayVideo( tmp &= 0xC3; cPtr->writeMR(cPtr, 0x20, tmp); + offset += (x1 >> 15) & ~0x01; + /* Setup Pointer 1 */ cPtr->writeMR(cPtr, 0x22, (offset & 0xF8)); cPtr->writeMR(cPtr, 0x23, ((offset >> 8) & 0xFF)); @@ -686,11 +698,13 @@ CHIPSDisplayVideo( /* Vertical Zoom */ if (drw_h > src_h) { +#if 1 tmp = cPtr->readMR(cPtr, 0x1F); - cPtr->writeMR(cPtr, 0x1F, (tmp | 0x80)); /* set V-interpolation */ + cPtr->writeMR(cPtr, 0x1F, (tmp | 0xc0)); /* set V-interpolation */ +#endif tmp = cPtr->readMR(cPtr, 0x1E); cPtr->writeMR(cPtr, 0x1E, (tmp | 0x08)); - tmp = cPtr->VideoZoomMax * src_h / drw_h; + tmp = cPtr->VideoZoomMax * src_h / drw_h ; cPtr->writeMR(cPtr, 0x33, tmp); } @@ -715,15 +729,12 @@ CHIPSPutImage( CHIPSPtr cPtr = CHIPSPTR(pScrn); INT32 x1, x2, y1, y2; unsigned char *dst_start; - int pitch, new_h, offset, offset2, offset3; - int srcPitch, srcPitch2, dstPitch; - int top, left, npixels, nlines; + int pitch, new_size, offset, offset2 = 0, offset3 = 0; + int srcPitch, srcPitch2 = 0, dstPitch; + int top, left, npixels, nlines, bpp; BoxRec dstBox; CARD32 tmp; - - if (pScrn->pScreen->BlockHandler == CHIPSBlockHandler) - pScrn->pScreen->BlockHandler = cPtr->BlockHandler; - + if(drw_w > 16384) drw_w = 16384; /* Clip */ @@ -736,22 +747,20 @@ CHIPSPutImage( dstBox.x2 = drw_x + drw_w; dstBox.y1 = drw_y; dstBox.y2 = drw_y + drw_h; + + if (!CHIPSClipVideo(&dstBox, &x1, &x2, &y1, &y2, clipBoxes, width, height)) + return Success; - CHIPSClipVideo(&dstBox, &x1, &x2, &y1, &y2, - REGION_EXTENTS(pScreen, clipBoxes), width, height); - - if((x1 >= x2) || (y1 >= y2)) - return Success; - - dstBox.x1 -= pScrn->frameX0; - dstBox.x2 -= pScrn->frameX0; + dstBox.x1 -= pScrn->frameX0 & cPtr->viewportMask; + dstBox.x2 -= pScrn->frameX0 & cPtr->viewportMask; dstBox.y1 -= pScrn->frameY0; dstBox.y2 -= pScrn->frameY0; - pitch = pScrn->bitsPerPixel * pScrn->displayWidth >> 3; + bpp = pScrn->bitsPerPixel >> 3; + pitch = bpp * pScrn->displayWidth; dstPitch = ((width << 1) + 15) & ~15; - new_h = ((dstPitch * height) + pitch - 1) / pitch; + new_size = ((dstPitch * height) + bpp - 1) / bpp; switch(id) { case FOURCC_YV12: /* YV12 */ @@ -765,16 +774,17 @@ CHIPSPutImage( break; } - if(!(pPriv->area = CHIPSAllocateMemory(pScrn, pPriv->area, new_h))) + if(!(pPriv->linear = CHIPSAllocateMemory(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->area->box.y1 * pitch) + (top * dstPitch); - dst_start = cPtr->FbBase + offset + left; + offset = pPriv->linear->offset * bpp; + dst_start = cPtr->FbBase + offset + left + (top * dstPitch); switch(id) { case FOURCC_YV12: /* YV12 */ @@ -802,12 +812,13 @@ CHIPSPutImage( REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes)); } - + +offset += top * dstPitch; CHIPSDisplayVideo(pScrn, id, offset, width, height, dstPitch, x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h); pPriv->videoStatus = CLIENT_VIDEO_ON; - + return Success; } @@ -850,29 +861,17 @@ CHIPSQueryImageAttributes( return size; } + static void -CHIPSBlockHandler ( - int i, - pointer blockData, - pointer pTimeout, - pointer pReadmask -){ - ScreenPtr pScreen = screenInfo.screens[i]; - ScrnInfoPtr pScrn = xf86Screens[i]; +CHIPSVideoTimerCallback(ScrnInfoPtr pScrn, Time time) +{ CHIPSPtr cPtr = CHIPSPTR(pScrn); CHIPSPortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn); unsigned char mr3c; - - pScreen->BlockHandler = cPtr->BlockHandler; - - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); - - pScreen->BlockHandler = CHIPSBlockHandler; if(pPriv->videoStatus & TIMER_MASK) { - UpdateCurrentTime(); if(pPriv->videoStatus & OFF_TIMER) { - if(pPriv->offTime < currentTime.milliseconds) { + if(pPriv->offTime < time) { CHIPSHiQVSync(pScrn); mr3c = cPtr->readMR(cPtr, 0x3C); cPtr->writeMR(cPtr, 0x3C, (mr3c & 0xFE)); @@ -880,23 +879,24 @@ CHIPSBlockHandler ( pPriv->freeTime = currentTime.milliseconds + FREE_DELAY; } } else { /* FREE_TIMER */ - if(pPriv->freeTime < currentTime.milliseconds) { - if(pPriv->area) { - xf86FreeOffscreenArea(pPriv->area); - pPriv->area = NULL; + if(pPriv->freeTime < time) { + if(pPriv->linear) { + xf86FreeOffscreenLinear(pPriv->linear); + pPriv->linear = NULL; } pPriv->videoStatus = 0; - pScreen->BlockHandler = cPtr->BlockHandler; + cPtr->VideoTimerCallback = NULL; } } - } + } else /* shouldn't get here */ + cPtr->VideoTimerCallback = NULL; } /****************** Offscreen stuff ***************/ typedef struct { - FBAreaPtr area; + FBLinearPtr linear; Bool isOn; } OffscreenPrivRec, * OffscreenPrivPtr; @@ -908,8 +908,8 @@ CHIPSAllocateSurface( unsigned short h, XF86SurfacePtr surface ){ - FBAreaPtr area; - int pitch, fbpitch, numlines; + FBLinearPtr linear; + int pitch, fbpitch, size, bpp; OffscreenPrivPtr pPriv; if((w > 1024) || (h > 1024)) @@ -917,34 +917,39 @@ CHIPSAllocateSurface( w = (w + 1) & ~1; pitch = ((w << 1) + 15) & ~15; - fbpitch = pScrn->bitsPerPixel * pScrn->displayWidth >> 3; - numlines = ((pitch * h) + fbpitch - 1) / fbpitch; + bpp = pScrn->bitsPerPixel >> 3; + fbpitch = bpp * pScrn->displayWidth; + size = ((pitch * h) + bpp - 1) / bpp; - if(!(area = CHIPSAllocateMemory(pScrn, NULL, numlines))) + if(!(linear = CHIPSAllocateMemory(pScrn, NULL, size))) return BadAlloc; surface->width = w; surface->height = h; - if(!(surface->pitches = xalloc(sizeof(int)))) + 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->area = area; + pPriv->linear = linear; pPriv->isOn = FALSE; surface->pScrn = pScrn; surface->id = id; surface->pitches[0] = pitch; - surface->offsets[0] = area->box.y1 * fbpitch; + surface->offsets[0] = linear->offset * bpp; surface->devPrivate.ptr = (pointer)pPriv; return Success; @@ -978,7 +983,7 @@ CHIPSFreeSurface( if(pPriv->isOn) CHIPSStopSurface(surface); - xf86FreeOffscreenArea(pPriv->area); + xf86FreeOffscreenLinear(pPriv->linear); xfree(surface->pitches); xfree(surface->offsets); xfree(surface->devPrivate.ptr); @@ -1018,6 +1023,7 @@ CHIPSDisplaySurface( ){ OffscreenPrivPtr pPriv = (OffscreenPrivPtr)surface->devPrivate.ptr; ScrnInfoPtr pScrn = surface->pScrn; + CHIPSPtr cPtr = CHIPSPTR(pScrn); CHIPSPortPrivPtr portPriv = GET_PORT_PRIVATE(pScrn); INT32 x1, y1, x2, y2; BoxRec dstBox; @@ -1032,11 +1038,8 @@ CHIPSDisplaySurface( dstBox.y1 = drw_y; dstBox.y2 = drw_y + drw_h; - CHIPSClipVideo(&dstBox, &x1, &x2, &y1, &y2, - REGION_EXTENTS(pScreen, clipBoxes), - surface->width, surface->height); - - if((x1 >= x2) || (y1 >= y2)) + if(!CHIPSClipVideo(&dstBox, &x1, &x2, &y1, &y2, clipBoxes, + surface->width, surface->height)) return Success; dstBox.x1 -= pScrn->frameX0; @@ -1044,20 +1047,22 @@ CHIPSDisplaySurface( dstBox.y1 -= pScrn->frameY0; dstBox.y2 -= pScrn->frameY0; - XAAFillSolidRects(pScrn, portPriv->colorKey, GXcopy, ~0, - REGION_NUM_RECTS(clipBoxes), - REGION_RECTS(clipBoxes)); CHIPSDisplayVideo(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; if(portPriv->videoStatus & CLIENT_VIDEO_ON) { REGION_EMPTY(pScrn->pScreen, &portPriv->clip); UpdateCurrentTime(); portPriv->videoStatus = FREE_TIMER; portPriv->freeTime = currentTime.milliseconds + FREE_DELAY; + cPtr->VideoTimerCallback = CHIPSVideoTimerCallback; } return Success; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c index 1f4e9b01c..06c47a3c2 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c @@ -4,7 +4,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c,v 1.6 2000/09/22 11:35:49 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/dRegs.c,v 1.6.4.1 2001/05/25 18:15:45 eich Exp $ */ #ifdef __NetBSD__ # include <sys/types.h> @@ -188,7 +188,7 @@ void main(void) storeReg = inb(0x3CE); for(i = 0;i < 0x10;i++){ outb(0x3CE,i); - printf("GC 0x%2.2X\t0x%X2.2\n",i,inb(0x3CF)&0xFF); + printf("GC 0x%2.2X\t0x%2.2X\n",i,inb(0x3CF)&0xFF); } outb(0x3CE,storeReg); printf("port 0x3C4 (Sequencer)\n"); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/chips/util/modClock.c b/xc/programs/Xserver/hw/xfree86/drivers/chips/util/modClock.c index 9d5b90e83..de35bd5ec 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/chips/util/modClock.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/chips/util/modClock.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/modClock.c,v 1.4 2000/09/22 11:35:49 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/modClock.c,v 1.5 2001/05/09 19:57:06 dbateman Exp $ */ #ifdef __NetBSD__ # include <sys/types.h> @@ -60,12 +60,39 @@ #define tolerance 0.01 /* +/- 1% */ + +#define CT65520 0x1 +#define CT65525 0x2 +#define CT65530 0x3 +#define CT64200 0x4 + +#define CT65535 0x11 +#define CT65540 0x12 +#define CT65545 0x13 +#define CT65546 0x14 +#define CT65548 0x15 +#define CT64300 0x16 + +#define CT65550 0x31 +#define CT65554 0x32 +#define CT65555 0x33 +#define CT68554 0x34 +#define CT69000 0x35 +#define CT69030 0x36 + +#define IS_Programmable(X) X&0x10 +#define IS_HiQV(X) X&0x20 + +#define DotClk 0 +#define MemClk 1 +#define IS_MemClk(X) X&0x1 + int compute_clock ( + unsigned int ChipType, double target, double Fref, unsigned int ClkMaxN, unsigned int ClkMaxM, - unsigned int PStart, unsigned int *bestM, unsigned int *bestN, unsigned int *bestP, @@ -104,7 +131,8 @@ int compute_clock ( they should be set to 0 on the 65548, and left untouched on earlier chips. */ - for (PSNx = 0; PSNx <= 1; PSNx++) { + for (PSNx = ((ChipType == CT69000) || (ChipType == CT69030)) ? 1 : 0; + PSNx <= 1; PSNx++) { unsigned int low_N, high_N; double Fref4PSN; @@ -113,7 +141,8 @@ int compute_clock ( low_N = 3; high_N = ClkMaxN; - while (Fref / (PSN * low_N) > 2.0e6) + while (Fref / (PSN * low_N) > (((ChipType == CT69000) || + (ChipType == CT69030)) ? 5.0e6 : 2.0e6)) low_N++; while (Fref / (PSN * high_N) < 150.0e3) high_N--; @@ -121,7 +150,9 @@ int compute_clock ( Fref4PSN = Fref * 4 / PSN; for (N = low_N; N <= high_N; N++) { double tmp = Fref4PSN / N; - for (P = PStart; P <= 5; P++) { + + for (P = (IS_HiQV(ChipType) && (ChipType != CT69000) && + (ChipType != CT69030)) ? 1 : 0; P <= 5; P++) { double Fvco_desired = target * (1 << P); double M_desired = Fvco_desired / tmp; /* Which way will M_desired be rounded? Do all three just to @@ -139,7 +170,8 @@ int compute_clock ( for (M = M_low; M <= M_hi; M++) { Fvco = tmp * M; - if (Fvco <= 48.0e6) + if (Fvco <= ((ChipType == CT69000) || (ChipType == CT69030) ? + 100e6 : 48.0e6)) continue; if (Fvco > 220.0e6) break; @@ -180,35 +212,10 @@ int compute_clock ( return 1; } -#define CT65520 0x1 -#define CT65525 0x2 -#define CT65530 0x3 -#define CT64200 0x4 - -#define CT65535 0x11 -#define CT65540 0x12 -#define CT65545 0x13 -#define CT65546 0x14 -#define CT65548 0x15 -#define CT64300 0x16 - -#define CT65550 0x31 -#define CT65554 0x32 -#define CT65555 0x33 -#define CT68554 0x34 -#define CT69000 0x35 -#define CT69030 0x36 - -#define IS_Programmable(X) X&0x10 -#define IS_HiQV(X) X&0x20 - -#define DotClk 0 -#define MemClk 1 -#define IS_MemClk(X) X&0x1 - int set_clock( unsigned int ChipType, unsigned int ClockType, + unsigned int ProgClock, unsigned int M, unsigned int N, unsigned int P, @@ -235,18 +242,18 @@ int set_clock( outb(0x3D6, 0xCE); outb(0x3D7, (0x80 | (P * 16 + (PSN == 1)))); } else { - printf ("XRC8 = 0x%02X\n", M - 2); - printf ("XRC9 = 0x%02X\n", N - 2); - printf ("XRCA = 0x%02X\n", 0); - printf ("XRCB = 0x%02X\n", P * 16 + (PSN == 1)); + printf ("XR%X = 0x%02X\n", 0xC0 + 4 * ProgClock, M - 2); + printf ("XR%X = 0x%02X\n", 0xC1 + 4 * ProgClock, N - 2); + printf ("XR%X = 0x%02X\n", 0xC2 + 4 * ProgClock, 0); + printf ("XR%X = 0x%02X\n", 0xC3 + 4 * ProgClock, P * 16 + (PSN == 1)); - outb(0x3D6, 0xC8); + outb(0x3D6, 0xC0 + 4 * ProgClock); outb(0x3D7, (M - 2)); - outb(0x3D6, 0xC9); + outb(0x3D6, 0xC1 + 4 * ProgClock); outb(0x3D7, (N - 2)); - outb(0x3D6, 0xCA); + outb(0x3D6, 0xC2 + 4 * ProgClock); outb(0x3D7, 0x0); - outb(0x3D6, 0xCB); + outb(0x3D6, 0xC3 + 4 * ProgClock); outb(0x3D7, (P * 16 + (PSN == 1))); } } else { @@ -355,10 +362,19 @@ unsigned int probe_chip(void) { int main (int argc, char *argv[]) { double target; double Fref = 14318180; - unsigned int M, N, P, PSN, ChipType, ClockType; - - if (argc != 2) { - fprintf (stderr, "usage: %s freq\n", argv[0]); + unsigned int M, N, P, PSN, ChipType, ClockType, progclock; + + switch (argc) { + case 2: + progclock = 2; + target = atof (argv[1]); + break; + case 3: + progclock = abs(atof (argv[1])); + target = atof (argv[2]); + break; + default: + fprintf (stderr, "usage: %s [-0|-1|-2] freq\n", argv[0]); return 1; } @@ -371,8 +387,6 @@ int main (int argc, char *argv[]) { ClockType = MemClk; } - target = atof (argv[1]); - ChipType = probe_chip(); if (!ChipType) { return 1; @@ -384,14 +398,14 @@ int main (int argc, char *argv[]) { } if (IS_HiQV(ChipType)) { - if (! compute_clock(target, Fref, 63, 127, 1, &M, &N, &P, &PSN)) { - return set_clock(ChipType, ClockType, M, N, P, PSN); + if (! compute_clock(ChipType, target, Fref, 63, 127, &M, &N, &P, &PSN)) { + return set_clock(ChipType, ClockType, progclock, M, N, P, PSN); } else { return 1; } } else { - if (! compute_clock(target, Fref, 127, 127, 0, &M, &N, &P, &PSN)) { - return set_clock(ChipType, ClockType, M, N, P, PSN); + if (! compute_clock(ChipType, target, Fref, 127, 127, &M, &N, &P, &PSN)) { + return set_clock(ChipType, ClockType, progclock, M, N, P, PSN); } else { return 1; } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h index 4373eabba..474cfe158 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h,v 1.6 2001/02/15 17:39:28 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp.h,v 1.7 2001/05/04 19:05:35 dawes Exp $ */ /* (c) Itai Nahshon */ @@ -6,7 +6,7 @@ #define ALP_H extern ScrnInfoPtr AlpProbe(int entity); -extern OptionInfoPtr AlpAvailableOptions(int chipid); +extern const OptionInfoRec * AlpAvailableOptions(int chipid); # ifdef _ALP_PRIVATE_ /* Saved registers that are not part of the core VGA */ 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 9d68f0767..3c678f6f9 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.19 2001/02/15 17:39:27 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_driver.c,v 1.20 2001/05/04 19:05:35 dawes Exp $ */ /* All drivers should typically include these */ #include "xf86.h" @@ -127,7 +127,7 @@ typedef enum { OPTION_MEMCFG2 } CirOpts; -static OptionInfoRec CirOptions[] = { +static const OptionInfoRec CirOptions[] = { { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_MMIO, "MMIO", OPTV_BOOLEAN, {0}, FALSE }, @@ -270,7 +270,7 @@ alpSetup(pointer module, pointer opts, int *errmaj, int *errmin) #endif /* XFree86LOADER */ -OptionInfoPtr +const OptionInfoRec * AlpAvailableOptions(int chipid) { return CirOptions; @@ -631,11 +631,14 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, CirOptions); + if (!(pCir->Options = xalloc(sizeof(CirOptions)))) + return FALSE; + memcpy(pCir->Options, CirOptions, sizeof(CirOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pCir->Options); if (!xf86IsPrimaryPci(pCir->PciInfo) - && !(pInt || (xf86IsOptionSet(CirOptions,OPTION_MEMCFG1) - && xf86IsOptionSet(CirOptions,OPTION_MEMCFG2)))) + && !(pInt || (xf86IsOptionSet(pCir->Options,OPTION_MEMCFG1) + && xf86IsOptionSet(pCir->Options,OPTION_MEMCFG2)))) return FALSE; if (pScrn->depth == 8) @@ -643,12 +646,12 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) from = X_DEFAULT; pCir->HWCursor = FALSE; - if (xf86GetOptValBool(CirOptions, OPTION_HW_CURSOR, &pCir->HWCursor)) + if (xf86GetOptValBool(pCir->Options, OPTION_HW_CURSOR, &pCir->HWCursor)) from = X_CONFIG; xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pCir->HWCursor ? "HW" : "SW"); - if (xf86ReturnOptValBool(CirOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pCir->Options, OPTION_NOACCEL, FALSE)) { pCir->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } @@ -721,12 +724,12 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) /* User options can override the MMIO default */ #if 0 /* Will we ever support MMIO on 5446A or older? */ - if (xf86ReturnOptValBool(CirOptions, OPTION_MMIO, FALSE)) { + if (xf86ReturnOptValBool(pCir->Options, OPTION_MMIO, FALSE)) { pCir->UseMMIO = TRUE; from = X_CONFIG; } #endif - if (!xf86ReturnOptValBool(CirOptions, OPTION_MMIO, TRUE)) { + if (!xf86ReturnOptValBool(pCir->Options, OPTION_MMIO, TRUE)) { pCir->UseMMIO = FALSE; from1 = X_CONFIG; } else if (pCir->IOAddress) { @@ -806,12 +809,12 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) /* XXX If UseMMIO == TRUE and for any reason we cannot do MMIO, abort here */ - if (xf86GetOptValBool(CirOptions, + if (xf86GetOptValBool(pCir->Options, OPTION_SHADOW_FB,&pCir->shadowFB)) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowFB %s.\n", pCir->shadowFB ? "enabled" : "disabled"); - if ((s = xf86GetOptValString(CirOptions, OPTION_ROTATE))) { + if ((s = xf86GetOptValString(pCir->Options, OPTION_ROTATE))) { if(!xf86NameCmp(s, "CW")) { /* accel is disabled below for shadowFB */ pCir->shadowFB = TRUE; @@ -856,8 +859,8 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) pCir->chip.alp->sr0f = (CARD32)-1; pCir->chip.alp->sr17 = (CARD32)-1; - (void) xf86GetOptValULong(CirOptions, OPTION_MEMCFG1, (unsigned long *)&pCir->chip.alp->sr0f); - (void) xf86GetOptValULong(CirOptions, OPTION_MEMCFG2, (unsigned long *)&pCir->chip.alp->sr17); + (void) xf86GetOptValULong(pCir->Options, OPTION_MEMCFG1, (unsigned long *)&pCir->chip.alp->sr0f); + (void) xf86GetOptValULong(pCir->Options, OPTION_MEMCFG2, (unsigned long *)&pCir->chip.alp->sr17); /* * If the user has specified the amount of memory in the XF86Config * file, we respect that setting. 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 626fe3023..a4f058161 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.4 2000/12/06 15:35:15 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/alp_hwcurs.c,v 1.5 2001/05/07 21:59:06 tsi Exp $ */ /* (c) Itai Nahshon */ @@ -246,7 +246,6 @@ AlpHWCursorInit(ScreenPtr pScreen, int size) infoPtr->HideCursor = AlpHideCursor; infoPtr->ShowCursor = AlpShowCursor; infoPtr->UseHWCursor = AlpUseHWCursor; - infoPtr->RealizeCursor = NULL; #ifdef ALP_DEBUG ErrorF("AlpHWCursorInit before xf86InitCursor\n"); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h index fcc77b37c..354101af1 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.18 2001/02/15 17:39:28 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir.h,v 1.19 2001/05/04 19:05:35 dawes Exp $ */ /* (c) Itai Nahshon */ @@ -63,6 +63,7 @@ typedef struct { void (* InitAccel)(ScrnInfoPtr); int offscreen_size; int offscreen_offset; + OptionInfoPtr Options; } CirRec, *CirPtr; /* CirrusClk.c */ 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 2a3afaa3a..ada5c7f94 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.65 2001/02/15 17:39:27 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/cir_driver.c,v 1.67 2001/05/15 10:19:37 eich Exp $ */ /* All drivers should typically include these */ #include "xf86.h" @@ -40,7 +40,7 @@ /* Mandatory functions */ -static OptionInfoPtr CIRAvailableOptions(int chipid, int busid); +static const OptionInfoRec * CIRAvailableOptions(int chipid, int busid); static void CIRIdentify(int flags); static Bool CIRProbe(DriverPtr drv, int flags); @@ -184,8 +184,7 @@ CIRIdentify(int flags) xf86PrintChipsets(CIR_NAME, "driver for Cirrus chipsets", CIRChipsets); } -static -OptionInfoPtr +static const OptionInfoRec * CIRAvailableOptions(int chipid, int busid) { int chip = chipid & 0xffff; @@ -407,5 +406,6 @@ cirProbeDDC(ScrnInfoPtr pScrn, int index) #endif pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); + vbeFree(pVbe); } } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h index c76cca590..9d9105328 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h @@ -10,14 +10,14 @@ * Inspired by cir.h */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h,v 1.11 2000/12/06 15:35:16 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg.h,v 1.12 2001/05/04 19:05:36 dawes Exp $ */ #ifndef LG_H #define LG_H #define LG_DEBUG extern ScrnInfoPtr LgProbe(int entity); -extern OptionInfoPtr LgAvailableOptions(int chipid); +extern const OptionInfoRec * LgAvailableOptions(int chipid); # ifdef _LG_PRIVATE_ 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 abf511e86..5d9de934c 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.36 2001/02/15 17:39:28 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_driver.c,v 1.37 2001/05/04 19:05:36 dawes Exp $ */ #define EXPERIMENTAL @@ -119,7 +119,7 @@ typedef enum { OPTION_NOACCEL } LgOpts; -static OptionInfoRec LgOptions[] = { +static const OptionInfoRec LgOptions[] = { { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE }, @@ -278,7 +278,7 @@ lgSetup(pointer module, pointer opts, int *errmaj, int *errmin) #endif /* XFree86LOADER */ -OptionInfoPtr +const OptionInfoRec * LgAvailableOptions(int chipid) { return LgOptions; @@ -527,17 +527,20 @@ LgPreInit(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, LgOptions); + if (!(pCir->Options = xalloc(sizeof(LgOptions)))) + return FALSE; + memcpy(pCir->Options, LgOptions, sizeof(LgOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pCir->Options); pScrn->rgbBits = 6; from = X_DEFAULT; pCir->HWCursor = FALSE; - if (xf86GetOptValBool(LgOptions, OPTION_HW_CURSOR, &pCir->HWCursor)) + if (xf86GetOptValBool(pCir->Options, OPTION_HW_CURSOR, &pCir->HWCursor)) from = X_CONFIG; xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pCir->HWCursor ? "HW" : "SW"); - if (xf86ReturnOptValBool(LgOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pCir->Options, OPTION_NOACCEL, FALSE)) { pCir->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } @@ -681,12 +684,12 @@ LgPreInit(ScrnInfoPtr pScrn, int flags) if (!xf86SetGamma(pScrn, zeros)) return FALSE; } - if (xf86GetOptValBool(LgOptions, + if (xf86GetOptValBool(pCir->Options, OPTION_SHADOW_FB,&pCir->shadowFB)) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowFB %s.\n", pCir->shadowFB ? "enabled" : "disabled"); - if ((s = xf86GetOptValString(LgOptions, OPTION_ROTATE))) { + if ((s = xf86GetOptValString(pCir->Options, OPTION_ROTATE))) { if(!xf86NameCmp(s, "CW")) { /* accel is disabled below for shadowFB */ pCir->shadowFB = TRUE; 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 4644ce593..7e30bdb03 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.4 2000/12/06 15:35:17 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cirrus/lg_hwcurs.c,v 1.5 2001/05/07 21:59:06 tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -375,10 +375,6 @@ Bool LgHWCursorInit(ScreenPtr pScreen) infoPtr->HideCursor = LgHideCursor; infoPtr->ShowCursor = LgShowCursor; infoPtr->UseHWCursor = LgUseHWCursor; - /* RealizeCursor is how the cursor bits are converted from an infoPtr - to the bits to slam out to the card. Can we use one of the - pre-defined realize'rs? Look in ramdac/xf86HWCurs.c. */ - infoPtr->RealizeCursor = NULL; #ifdef LG_CURSOR_DEBUG ErrorF("LgHWCursorInit before xf86InitCursor\n"); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h b/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h index ff0ba00d8..3fa584906 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h @@ -26,7 +26,7 @@ * Dirk H. Hohndel (hohndel@suse.de), * Portions: the GGI project & confidential CYRIX databooks. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h,v 1.2 2000/04/19 16:57:43 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix.h,v 1.3 2001/05/04 19:05:36 dawes Exp $ */ #ifndef _CYRIX_H_ #define _CYRIX_H_ @@ -116,6 +116,7 @@ typedef struct { Bool IsCyber; Bool NewClockCode; Bool NoAccel; + OptionInfoPtr Options; /* accel stuff */ int bltBufWidth; int blitMode; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c index a5e8604dc..92bfd836b 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c @@ -26,7 +26,7 @@ * Dirk H. Hohndel (hohndel@suse.de), * Portions: the GGI project & confidential CYRIX databooks. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c,v 1.18 2001/02/16 01:45:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/cyrix/cyrix_driver.c,v 1.19 2001/05/04 19:05:36 dawes Exp $ */ #include "fb.h" #include "mibank.h" @@ -52,7 +52,7 @@ #define DPMS_SERVER #include "extensions/dpms.h" -static OptionInfoPtr CYRIXAvailableOptions(int chip, int busid); +static const OptionInfoRec * CYRIXAvailableOptions(int chip, int busid); static void CYRIXIdentify(int flags); static Bool CYRIXProbe(DriverPtr drv, int flags); static Bool CYRIXPreInit(ScrnInfoPtr pScrn, int flags); @@ -133,7 +133,7 @@ typedef enum { OPTION_NOACCEL } CYRIXOpts; -static OptionInfoRec CYRIXOptions[] = { +static const OptionInfoRec CYRIXOptions[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, @@ -282,8 +282,7 @@ CYRIXIdentify(int flags) xf86PrintChipsets(CYRIX_NAME, "driver for Cyrix MediaGX Processors", CYRIXChipsets); } -static -OptionInfoPtr +static const OptionInfoRec * CYRIXAvailableOptions(int chip, int busid) { return CYRIXOptions; @@ -612,7 +611,10 @@ CYRIXPreInit(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, CYRIXOptions); + if (!(pCyrix->Options = xalloc(sizeof(CYRIXOptions)))) + return FALSE; + memcpy(pCyrix->Options, CYRIXOptions, sizeof(CYRIXOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pCyrix->Options); /* Set the bits per RGB for 8bpp mode */ if (pScrn->depth == 8) { @@ -620,7 +622,7 @@ CYRIXPreInit(ScrnInfoPtr pScrn, int flags) /* Default to 8 */ pScrn->rgbBits = 8; #if 0 - if (xf86GetOptValInteger(CYRIXOptions, OPTION_RGB_BITS, + if (xf86GetOptValInteger(pCyrix->Options, OPTION_RGB_BITS, &pScrn->rgbBits)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Bits per RGB set to %d\n", pScrn->rgbBits); @@ -629,17 +631,17 @@ CYRIXPreInit(ScrnInfoPtr pScrn, int flags) } from = X_DEFAULT; pCyrix->HWCursor = TRUE; - if (xf86IsOptionSet(CYRIXOptions, OPTION_HW_CURSOR)) { + if (xf86IsOptionSet(pCyrix->Options, OPTION_HW_CURSOR)) { from = X_CONFIG; pCyrix->HWCursor = TRUE; } - if (xf86IsOptionSet(CYRIXOptions, OPTION_SW_CURSOR)) { + if (xf86IsOptionSet(pCyrix->Options, OPTION_SW_CURSOR)) { from = X_CONFIG; pCyrix->HWCursor = FALSE; } xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pCyrix->HWCursor ? "HW" : "SW"); - if (xf86IsOptionSet(CYRIXOptions, OPTION_NOACCEL)) { + if (xf86IsOptionSet(pCyrix->Options, OPTION_NOACCEL)) { pCyrix->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c b/xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c index 82b2d2fd3..2baaf0514 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.29 2001/04/06 18:16:30 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.c,v 1.30 2001/05/04 19:05:37 dawes Exp $ */ /* * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> @@ -48,7 +48,7 @@ /* -------------------------------------------------------------------- */ /* prototypes */ -static OptionInfoPtr FBDevAvailableOptions(int chipid, int busid); +static const OptionInfoRec * FBDevAvailableOptions(int chipid, int busid); static void FBDevIdentify(int flags); static Bool FBDevProbe(DriverPtr drv, int flags); static Bool FBDevPreInit(ScrnInfoPtr pScrn, int flags); @@ -113,7 +113,7 @@ typedef enum { OPTION_FBDEV } FBDevOpts; -static OptionInfoRec FBDevOptions[] = { +static const OptionInfoRec FBDevOptions[] = { { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE }, #if 0 { OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE }, @@ -222,6 +222,7 @@ typedef struct { /* DGA info */ DGAModePtr pDGAMode; int nDGAMode; + OptionInfoPtr Options; } FBDevRec, *FBDevPtr; #define FBDEVPTR(p) ((FBDevPtr)((p)->driverPrivate)) @@ -247,7 +248,7 @@ FBDevFreeRec(ScrnInfoPtr pScrn) /* -------------------------------------------------------------------- */ -static OptionInfoPtr +static const OptionInfoRec * FBDevAvailableOptions(int chipid, int busid) { return FBDevOptions; @@ -438,15 +439,18 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags) /* handle options */ xf86CollectOptions(pScrn, NULL); - xf86ProcessOptions(pScrn->scrnIndex, fPtr->pEnt->device->options, FBDevOptions); + if (!(fPtr->Options = xalloc(sizeof(FBDevOptions)))) + return FALSE; + memcpy(fPtr->Options, FBDevOptions, sizeof(FBDevOptions)); + xf86ProcessOptions(pScrn->scrnIndex, fPtr->pEnt->device->options, fPtr->Options); /* use shadow framebuffer by default */ - fPtr->shadowFB = xf86ReturnOptValBool(FBDevOptions, OPTION_SHADOW_FB, TRUE); + fPtr->shadowFB = xf86ReturnOptValBool(fPtr->Options, OPTION_SHADOW_FB, TRUE); #if 0 /* rotation (doesn't work yet) */ fPtr->rotate = 0; - if ((s = xf86GetOptValString(FBDevOptions, OPTION_ROTATE))) + if ((s = xf86GetOptValString(fPtr->Options, OPTION_ROTATE))) { if(!xf86NameCmp(s, "CW")) { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile index 852dc5e5c..f01a0fa6c 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile @@ -1,7 +1,7 @@ XCOMM XCOMM This is an Imakefile for the glide driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile,v 1.6 2001/01/24 00:06:18 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/Imakefile,v 1.7 2001/05/16 06:48:08 keithp Exp $ #define IHaveModules #include <Server.tmpl> @@ -22,8 +22,8 @@ OBJS = glide_driver.o INCLUDES = -I. -I../../include #else INCLUDES = -I. -I$(GLIDE2INCDIR) -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ + -I$(XF86SRC)/xaa \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ -I$(SERVERSRC)/Xext -I$(XF86SRC)/xf8_32bpp\ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c index 242de1d7d..e87008d5b 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c @@ -45,7 +45,7 @@ * Support static loading. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c,v 1.22 2001/01/21 21:19:25 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glide/glide_driver.c,v 1.24 2001/05/16 06:48:08 keithp Exp $ */ #include "xaa.h" #include "xf86Cursor.h" @@ -60,11 +60,7 @@ #include "globals.h" #define DPMS_SERVER #include "extensions/dpms.h" -#define PSZ 8 /* needed for cfb.h */ -#include "cfb.h" -#undef PSZ -#include "cfb16.h" -#include "cfb32.h" +#include "fb.h" #include "xf86cmap.h" #include "shadowfb.h" @@ -126,6 +122,7 @@ typedef struct { Bool OnAtExit; Bool GlideInitiated; EntityInfoPtr pEnt; + OptionInfoPtr Options; } GLIDERec, *GLIDEPtr; static pgrSstQueryBoards_t pgrSstQueryBoards; @@ -140,7 +137,7 @@ static pgrLfbUnlock_t pgrLfbUnlock; static pgrGlideShutdown_t pgrGlideShutdown; static pgrLfbWriteRegion_t pgrLfbWriteRegion; -static OptionInfoPtr GLIDEAvailableOptions(int chipid, int busid); +static const OptionInfoRec * GLIDEAvailableOptions(int chipid, int busid); static void GLIDEIdentify(int flags); static Bool GLIDEProbe(DriverPtr drv, int flags); static Bool GLIDEPreInit(ScrnInfoPtr pScrn, int flags); @@ -192,7 +189,7 @@ typedef enum { OPTION_GLIDEDEVICE } GLIDEOpts; -static OptionInfoRec GLIDEOptions[] = { +static const OptionInfoRec GLIDEOptions[] = { { OPTION_ON_AT_EXIT, "OnAtExit", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_GLIDEDEVICE, "GlideDevice", OPTV_INTEGER, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } @@ -214,10 +211,11 @@ static SymTabRec GLIDEChipsets[] = { * unresolved symbols that are not required. */ -static const char *cfbSymbols[] = { - "cfbScreenInit", - "cfb16ScreenInit", - "cfb32ScreenInit", +static const char *fbSymbols[] = { + "fbScreenInit", +#ifdef RENDER + "fbPictureInit", +#endif NULL }; @@ -307,7 +305,7 @@ glideSetup(pointer module, pointer opts, int *errmaj, int *errmin) * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(cfbSymbols, shadowSymbols, NULL); + LoaderRefSymLists(fbSymbols, shadowSymbols, NULL); /* * The return value must be non-NULL on success even though there @@ -352,8 +350,7 @@ GLIDEFreeRec(ScrnInfoPtr pScrn) } -static -OptionInfoPtr +static const OptionInfoRec * GLIDEAvailableOptions(int chipid, int busid) { return GLIDEOptions; @@ -456,8 +453,6 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags) MessageType from; int i; ClockRangePtr clockRanges; - char *mod = NULL; - const char *reqSym = NULL; int sst; if (flags & PROBE_DETECT) return FALSE; @@ -544,11 +539,14 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, GLIDEOptions); + if (!(pGlide->Options = xalloc(sizeof(GLIDEOptions)))) + return FALSE; + memcpy(pGlide->Options, GLIDEOptions, sizeof(GLIDEOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pGlide->Options); pGlide->OnAtExit = FALSE; from = X_DEFAULT; - if (xf86GetOptValBool(GLIDEOptions, OPTION_ON_AT_EXIT, &(pGlide->OnAtExit))) + if (xf86GetOptValBool(pGlide->Options, OPTION_ON_AT_EXIT, &(pGlide->OnAtExit))) from = X_CONFIG; xf86DrvMsg(pScrn->scrnIndex, from, @@ -636,24 +634,14 @@ GLIDEPreInit(ScrnInfoPtr pScrn, int flags) /* Set display resolution */ xf86SetDpi(pScrn, 0, 0); - - /* Load bpp-specific modules */ - switch (pScrn->bitsPerPixel) { - case 16: - mod = "cfb16"; - reqSym = "cfb16ScreenInit"; - break; - case 32: - mod = "cfb32"; - reqSym = "cfb32ScreenInit"; - break; - } - if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { + + /* Load fb */ + if (xf86LoadSubModule(pScrn, "fb") == NULL) { GLIDEFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymbols(reqSym, NULL); + xf86LoaderReqSymLists(fbSymbols, NULL); /* Load the shadow framebuffer */ if (!xf86LoadSubModule(pScrn, "shadowfb")) { @@ -694,7 +682,7 @@ GLIDEScreenInit(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 + * For most PC hardware at depths >= 8, the defaults that fb uses * are not appropriate. In this driver, we fixup the visuals after. */ @@ -707,36 +695,29 @@ GLIDEScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; + miSetPixmapDepths (); + pGlide->ShadowPitch = ((pScrn->virtualX * pScrn->bitsPerPixel >> 3) + 3) & ~3L; pGlide->ShadowPtr = xnfalloc(pGlide->ShadowPitch * pScrn->virtualY); + /* * Call the framebuffer layer's ScreenInit function, and fill in other * pScreen fields. */ - switch (pScrn->bitsPerPixel) { - case 16: - ret = cfb16ScreenInit(pScreen, pGlide->ShadowPtr, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth); - break; - case 32: - ret = cfb32ScreenInit(pScreen, pGlide->ShadowPtr, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth); - break; - default: - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Internal error: invalid bpp (%d) in GLIDEScreenInit\n", - pScrn->bitsPerPixel); - ret = FALSE; - break; - } + ret = fbScreenInit(pScreen, pGlide->ShadowPtr, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth, + pScrn->bitsPerPixel); + if (!ret) return FALSE; +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif + /* Fixup RGB ordering */ visual = pScreen->visuals + pScreen->numVisuals; while (--visual >= pScreen->visuals) { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile index 9d0d04db1..a23fb7820 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile,v 1.32 2001/02/24 14:29:16 alanh Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/Imakefile,v 1.34.2.1 2001/05/25 11:19:31 alanh Exp $ XCOMM XCOMM This is an Imakefile for the GLINT driver. XCOMM @@ -39,7 +39,7 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ -I$(SERVERSRC)/render #endif -DEFINES = $(GLX_DEFINES) -DPPC_MMIO_IS_BE +DEFINES = $(GLX_DEFINES) -DPPC_MMIO_IS_BE -DSPARC_MMIO_IS_BE #if MakeHasPosixVariableSubstitutions SubdirLibraryRule($(OBJS)) @@ -76,6 +76,8 @@ InstallDriverSDKNonExecFile(pm2v_dac.c,$(DRIVERSDKDIR)/drivers/glint) InstallDriverSDKNonExecFile(pm2vramdac.c,$(DRIVERSDKDIR)/drivers/glint) InstallDriverSDKNonExecFile(pm3_dac.c,$(DRIVERSDKDIR)/drivers/glint) InstallDriverSDKNonExecFile(pm3_accel.c,$(DRIVERSDKDIR)/drivers/glint) +InstallDriverSDKNonExecFile(pm3_video.c,$(DRIVERSDKDIR)/drivers/glint) +InstallDriverSDKNonExecFile(pm3_regs.h,$(DRIVERSDKDIR)/drivers/glint) InstallDriverSDKNonExecFile(pm_accel.c,$(DRIVERSDKDIR)/drivers/glint) InstallDriverSDKNonExecFile(pm_dac.c,$(DRIVERSDKDIR)/drivers/glint) InstallDriverSDKNonExecFile(tx_accel.c,$(DRIVERSDKDIR)/drivers/glint) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3 b/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3 index c8950a4bc..c4db56f6b 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3 +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3 @@ -1,6 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3,v 1.9 2001/04/18 09:24:47 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/README.pm3,v 1.11 2001/05/08 19:31:22 alanh Exp $ */ -STATUS as of Fri, 13 Apr 2001 21:43:39 +0200 +STATUS as of Tue, 8 May 2001 19:01:39 +0200 Working : * Unaccelerated : Depth 8, 15, 16 and 24 are ok. I tested them upto @@ -24,13 +24,25 @@ Working : - Pixmap Writes using direct FIFO writes with or without FIFO Disconnect. * Appian J2000 second head initialization. * Dual head : The console fonts will get trashed, but dual head works. - * Xv : Hardware video scaler with the following attributes : - - FILTER : None, Partial (X only) or Full filtering. - - OVERLAY_MODE : Opaque, Blended or Color keyed Video Overlay. - - MIRROR : X and/or Y Axis mirroring. + * Xv : Hardware video scaler : + - Needs checking on a big endian machine. + - Needs acceleration to work. + - Clipping supported trough the alpha channel in depth 15 and 24 + and with an overlay key color in depth 8 and 16. + - Support both dual head and single head, trough gamma or permedia3. + - Attributes are : + - FILTER : None, Partial (X only) or Full filtering. + - MIRROR : X and/or Y Axis mirroring. + - ALPHA : + - 0 -> FB Only + - 1 -> 25% Video, 75% FB + - 2 -> 75% Video, 25% FB + - 3 -> Video Only + - [TODO] VIDEOKEY : Overlay Key Color for clipping in depth 8 and 16. * DRI : Work is underway. Not Working : + * [NOT POSSIBLE] 2D Accel : - Solid & Dashed Lines are not possible on glint hardware. - 8x8 Color Pattern Fill is almost never used. @@ -40,19 +52,20 @@ Not Working : - CPUToScreenTexture. - CPUToScreenAlphaTexture. * [NEED FIX] Xv has still some minor problems : - - Currently it needs accel to work. - => we could enable the offscreen memory manager, but this will crash the - server. I guess this is because of bad timing. - - Crashes when used with the gamma chip. - - Clipping is not supported. - => we could use framebuffer alpha blending or alpha channel keyed video - overlay to simulate it, but this would need to set the framebuffer alpha - channel as a mask, and would be very inefficient. Maybe we could use a - second framebuffer to do this, and use it as a mask ? + - depth 8 does not work, but then it may be the app i am using. + - when using 2D accels there is some unstability in the video display. I + guess this is because there is then not enough bandwith to do the + copying of the data in time. After a time of the above, the images + becomes black. It will come back once stopvideo is called. + [FIX] i will disable VideoOverlay each 25 frames, this causes a flicker, + but at least it will bing the image back. * [WORK IS UNDERWAY] DRI/OpenGL (only together with a gamma chip) : - DRI support should be ok, but accelerated openGL is not yet supported. - The accelerated OpenGL library supposes we are using a gamma together with a MX rasterizer, not a Permedia3 one. + +Known problems : + * Console gets broken when using dual headed mode. The culprit seems to be the vga graphics index & port (GraphicsIndexReg : 0x63ce, GraphicsPort : 0x3cf). I had to use IO acces for both these two, because if not, console @@ -67,6 +80,8 @@ Not Working : Well, this is partly fixed, but still appears under very heavy load. * [FIXED] When moving a window around a lot quickly, the video outputs dies. Well, this is partly fixed, but still appears under very heavy load. + => [NOTE] If this two still happens, try disabling the Hardware cursor, with + the "SWCursor" option to your device XF86Config section. * Sometimes there are blue transparent garbage in the form of small horizontal bands, few pixels high, and more pixels width, maybe 64pixels ? This may be a hardware bug. diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h index 2baed5658..3db30c12d 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h,v 1.47 2001/04/18 09:24:47 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h,v 1.48.2.1 2001/05/24 20:12:47 alanh Exp $ */ /* * Copyright 1997-2001 by Alan Hourihane <alanh@fairlite.demon.co.uk> * @@ -46,7 +46,6 @@ #endif #define GLINT_MAX_MULTI_DEVICES 2 -#define GLINT_VGA_MMIO_OFF 0x6000 #define VERSION 4000 #define GLINT_NAME "GLINT" @@ -83,29 +82,28 @@ typedef struct { int HwBpp; int BppShift; int pprod; - int ForeGroundColor; - int BackGroundColor; + CARD32 ForeGroundColor; + CARD32 BackGroundColor; int bppalign; - int startxdom; - int startxsub; - int starty; - int count; - int dy; - int x; - int y; - int w; - int h; - int dxdom; + CARD32 startxdom; + CARD32 startxsub; + CARD32 starty; + CARD32 count; + CARD32 dy; + CARD32 x; + CARD32 y; + CARD32 w; + CARD32 h; + CARD32 dxdom; int dwords; int cpuheight; int cpucount; - int planemask; + CARD32 planemask; int realWidth; CARD32 IOAddress; unsigned long FbAddress; int irq; unsigned char * IOBase; - unsigned char * IOBaseVGA; unsigned char * FbBase; long FbMapSize; long IOOffset; @@ -126,7 +124,6 @@ typedef struct { Bool UseFlatPanel; Bool UseFireGL3000; CARD8 VGAdata[65536]; - Bool VGAcore; Bool STATE; Bool ScanlineDirect; int MXFbSize; @@ -160,10 +157,11 @@ typedef struct { void (*LoadCursorCallback)(ScrnInfoPtr); void (*CursorColorCallback)(ScrnInfoPtr); CARD32 PM3_PixelSize; - int PM3_Config2D; - int PM3_Render2D; - int PM3_AreaStippleMode; - int PM3_VideoControl; + CARD32 PM3_Config2D; + CARD32 PM3_Render2D; + CARD32 PM3_AreaStippleMode; + CARD32 PM3_VideoControl; + int InFifoSpace; #ifdef XF86DRI Bool directRenderingEnabled; DRIInfoPtr pDRIInfo; @@ -174,6 +172,7 @@ typedef struct { GLINTConfigPrivPtr pVisualConfigsPriv; GLINTRegRec DRContextRegs; #endif + OptionInfoPtr Options; } GLINTRec, *GLINTPtr; /* Defines for PCI data */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c index c02847088..2e2759283 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c,v 1.26 2001/04/10 16:08:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c,v 1.27 2001/05/02 15:06:09 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -345,7 +345,7 @@ GLINTDRIScreenInit(ScreenPtr pScreen) if (!xf86LoaderCheckSymbol("drmAvailable")) return FALSE; if (!xf86LoaderCheckSymbol("DRIQueryVersion")) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "GLINTDRIScreenInit failed (libdri.a too old)\n"); + "[dri] GLINTDRIScreenInit failed (libdri.a too old)\n"); return FALSE; } @@ -355,7 +355,9 @@ GLINTDRIScreenInit(ScreenPtr pScreen) DRIQueryVersion(&major, &minor, &patch); if (major != 4 || minor < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "GLINTDRIScreenInit failed (DRI version = %d.%d.%d, expected 4.0.x). Disabling DRI.\n", + "[dri] GLINTDRIScreenInit failed because of a version mismatch.\n" + "[dri] libDRI version is %d.%d.%d but version 4.0.x is needed.\n" + "[dri] Disabling DRI.\n", major, minor, patch); return FALSE; } @@ -446,10 +448,12 @@ GLINTDRIScreenInit(ScreenPtr pScreen) version->version_minor < 0) { /* incompatible drm version */ xf86DrvMsg(pScreen->myNum, X_ERROR, - "GLINTDRIScreenInit failed (DRM version = %d.%d.%d, expected 1.0.x). Disabling DRI.\n", - version->version_major, - version->version_minor, - version->version_patchlevel); + "[dri] GLINTDRIScreenInit failed because of a version mismatch.\n" + "[dri] gamma.o kernel module version is %d.%d.%d but version 1.0.x is needed.\n" + "[dri] Disabling DRI.\n", + version->version_major, + version->version_minor, + version->version_patchlevel); GLINTDRICloseScreen(pScreen); drmFreeVersion(version); return FALSE; @@ -622,7 +626,7 @@ GLINTDRIScreenInit(ScreenPtr pScreen) DRICloseScreen(pScreen); return FALSE; } - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "visual configs initialized\n" ); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized.\n" ); return TRUE; } 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 fe03f47b1..76f0b0620 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.122 2001/04/19 09:28:32 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c,v 1.125.2.4 2001/05/29 11:32:22 alanh Exp $ */ #include "fb.h" #include "cfb8_32.h" @@ -42,7 +42,6 @@ #include "xf86cmap.h" #include "shadowfb.h" #include "fbdevhw.h" -#include "vgaHW.h" #include "xf86RAC.h" #include "xf86Resources.h" #include "xf86int10.h" @@ -79,7 +78,7 @@ # define TRACE(str) #endif -static OptionInfoPtr GLINTAvailableOptions(int chipid, int busid); +static const OptionInfoRec * GLINTAvailableOptions(int chipid, int busid); static void GLINTIdentify(int flags); static Bool GLINTProbe(DriverPtr drv, int flags); static Bool GLINTPreInit(ScrnInfoPtr pScrn, int flags); @@ -158,9 +157,7 @@ static SymTabRec GLINTChipsets[] = { { PCI_VENDOR_3DLABS_CHIP_300SX, "300sx" }, { PCI_VENDOR_3DLABS_CHIP_500TX, "500tx" }, { PCI_VENDOR_3DLABS_CHIP_MX, "mx" }, -/* { PCI_VENDOR_3DLABS_CHIP_DELTA, "delta" }, -*/ { -1, NULL } }; @@ -175,9 +172,7 @@ static PciChipsets GLINTPciChipsets[] = { { PCI_VENDOR_3DLABS_CHIP_300SX, PCI_VENDOR_3DLABS_CHIP_300SX, NULL }, { PCI_VENDOR_3DLABS_CHIP_500TX, PCI_VENDOR_3DLABS_CHIP_500TX, NULL }, { PCI_VENDOR_3DLABS_CHIP_MX, PCI_VENDOR_3DLABS_CHIP_MX, NULL }, -/* { PCI_VENDOR_3DLABS_CHIP_DELTA, PCI_VENDOR_3DLABS_CHIP_DELTA, NULL }, -*/ { -1, -1, RES_UNDEFINED } }; @@ -193,7 +188,7 @@ typedef enum { OPTION_FLATPANEL } GLINTOpts; -static OptionInfoRec GLINTOptions[] = { +static const OptionInfoRec GLINTOptions[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_RGB_BITS, "RGBbits", OPTV_INTEGER, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, @@ -219,24 +214,6 @@ static RamDacSupportedInfoRec TIRamdacs[] = { { -1 } }; -static const char *vgahwSymbols[] = { - "vgaHWGetIndex", - "vgaHWSave", - "vgaHWRestore", - "vgaHWGetHWRec", - "vgaHWUnlock", - "vgaHWInit", - "vgaHWProtect", - "vgaHWSetMmioFuncs", - "vgaHWGetIOBase", - "vgaHWMapMem", - "vgaHWLock", - "vgaHWFreeHWRec", - "vgaHWSaveScreen", - "vgaHWddc1SetSpeed", - NULL -}; - static const char *xf8_32bppSymbols[] = { "xf86Overlay8Plus32Init", NULL @@ -252,6 +229,7 @@ static const char *xaaSymbols[] = { "XAAScreenIndex", "XAAPolyLines", "XAAPolySegment", + "XAAFillSolidRects", NULL }; @@ -289,6 +267,7 @@ static const char *shadowSymbols[] = { static const char *vbeSymbols[] = { "VBEInit", "vbeDoEDID", + "vbeFree", NULL }; @@ -387,7 +366,7 @@ glintSetup(pointer module, pointer opts, int *errmaj, int *errmin) if (!setupDone) { setupDone = TRUE; xf86AddDriver(&GLINT, module, 0); - LoaderRefSymLists(vgahwSymbols, fbSymbols, ddcSymbols, i2cSymbols, + LoaderRefSymLists(fbSymbols, ddcSymbols, i2cSymbols, xaaSymbols, xf8_32bppSymbols, shadowSymbols, fbdevHWSymbols, int10Symbols, vbeSymbols, @@ -493,6 +472,12 @@ GLINTDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, if((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX) || (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) || (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_MX) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_300SX)) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_500TX)) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_MX)) || ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) && (pGlint->MultiChip == PCI_CHIP_MX)) ) { vtgpolarity = GLINT_READ_REG(VTGPolarity) & 0xFFFFFFF0; @@ -528,6 +513,12 @@ GLINTDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, if((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX) || (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) || (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_MX) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_300SX)) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_500TX)) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_MX)) || ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) && (pGlint->MultiChip == PCI_CHIP_MX)) ) { GLINT_SLOW_WRITE_REG(vtgpolarity, VTGPolarity); @@ -574,7 +565,7 @@ GLINTIdentify(int flags) xf86PrintChipsets(GLINT_NAME, "driver for 3Dlabs chipsets", GLINTChipsets); } -static OptionInfoPtr +static const OptionInfoRec * GLINTAvailableOptions(int chipid, int busid) { return GLINTOptions; @@ -590,6 +581,7 @@ GLINTProbeDDC(ScrnInfoPtr pScrn, int index) { pVbe = VBEInit(NULL,index); vbeDoEDID(pVbe, NULL); + vbeFree(pVbe); } } @@ -744,7 +736,8 @@ GLINTProbe(DriverPtr drv, int flags) } } else /* Only claim other chips when GAMMA is used */ - if (pPci->chipType == PCI_CHIP_GAMMA) { + if ((pPci->chipType == PCI_CHIP_GAMMA) || + (pPci->chipType == PCI_CHIP_DELTA)) { while (*checkusedPci != NULL) { int eIndex; /* make sure we claim all but our source device */ @@ -852,13 +845,19 @@ GetAccelPitchValues(ScrnInfoPtr pScrn) linep = &partprod500TX[0]; break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: - /* When GAMMA in use, we always have MultiChip defined, even if - * only one chip is connected to GAMMA as the entites > 1 + case PCI_VENDOR_3DLABS_CHIP_DELTA: + /* When GAMMA/DELTA in use, we always have MultiChip defined, even if + * only one chip is connected to GAMMA/DELTA as the entities > 1 */ switch (pGlint->MultiChip) { case PCI_CHIP_MX: + case PCI_CHIP_500TX: + case PCI_CHIP_300SX: linep = &partprod500TX[0]; break; + case PCI_CHIP_PERMEDIA: + linep = &partprodPermedia[0]; + break; } break; } @@ -990,6 +989,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) pGlint->PciInfo->func); } + pGlint->InFifoSpace = 0; /* Force a Read of FIFO space on first run */ pGlint->numMultiDevices = 0; pGlint->IOOffset = 0; /* Set IO Offset for Gamma */ @@ -1001,6 +1001,9 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) pEnt = xf86GetEntityInfo(pScrn->entityList[i]); pPci = xf86GetPciInfoForEntity(pEnt->index); if ( (pPci->chipType == PCI_CHIP_MX) || + (pPci->chipType == PCI_CHIP_PERMEDIA) || + (pPci->chipType == PCI_CHIP_500TX) || + (pPci->chipType == PCI_CHIP_300SX) || (pPci->chipType == PCI_CHIP_PERMEDIA3) ) { pGlint->MultiChip = pPci->chipType; if (pGlint->numMultiDevices >= GLINT_MAX_MULTI_DEVICES) { @@ -1020,10 +1023,11 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]); pciVideoPtr pPci = xf86GetPciInfoForEntity(pEnt->index); - if ( (pPci->chipType == PCI_CHIP_GAMMA) && + if ( ((pPci->chipType == PCI_CHIP_GAMMA) || + (pPci->chipType == PCI_CHIP_DELTA)) && (pGlint->numMultiDevices == 0) ) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Gamma with ZERO connected chips, aborting\n"); + "Gamma/Delta with ZERO connected chips, aborting\n"); return FALSE; } } @@ -1032,7 +1036,8 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) EntityInfoPtr pEnt = xf86GetEntityInfo(pScrn->entityList[0]); pciVideoPtr pPci = xf86GetPciInfoForEntity(pEnt->index); - if (!(pPci->chipType == PCI_CHIP_GAMMA)) { + if ((pPci->chipType != PCI_CHIP_GAMMA) && + (pPci->chipType != PCI_CHIP_DELTA)) { GLINTProbeDDC(pScrn, pGlint->pEnt->index); return TRUE; } else @@ -1135,33 +1140,36 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, GLINTOptions); + if (!(pGlint->Options = xalloc(sizeof(GLINTOptions)))) + return FALSE; + memcpy(pGlint->Options, GLINTOptions, sizeof(GLINTOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pGlint->Options); /* Default to 8bits per RGB */ if (pScrn->depth == 30) pScrn->rgbBits = 10; else pScrn->rgbBits = 8; - if (xf86GetOptValInteger(GLINTOptions, OPTION_RGB_BITS, &pScrn->rgbBits)) { + if (xf86GetOptValInteger(pGlint->Options, OPTION_RGB_BITS, &pScrn->rgbBits)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Bits per RGB set to %d\n", pScrn->rgbBits); } from = X_DEFAULT; pGlint->HWCursor = TRUE; /* ON by default */ - if (xf86ReturnOptValBool(GLINTOptions, OPTION_SW_CURSOR, FALSE)) { + if (xf86ReturnOptValBool(pGlint->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pGlint->HWCursor = FALSE; } xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pGlint->HWCursor ? "HW" : "SW"); - if (xf86ReturnOptValBool(GLINTOptions, OPTION_FLATPANEL, FALSE)) { + if (xf86ReturnOptValBool(pGlint->Options, OPTION_FLATPANEL, FALSE)) { pGlint->UseFlatPanel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using Flat Panel Interface\n"); } - if (xf86ReturnOptValBool(GLINTOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pGlint->Options, OPTION_NOACCEL, FALSE)) { pGlint->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } - if (xf86ReturnOptValBool(GLINTOptions, OPTION_SHADOW_FB, FALSE)) { + if (xf86ReturnOptValBool(pGlint->Options, OPTION_SHADOW_FB, FALSE)) { pGlint->ShadowFB = TRUE; pGlint->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, @@ -1169,7 +1177,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) } /* Check whether to use the FBDev stuff and fill in the rest of pScrn */ - if (xf86ReturnOptValBool(GLINTOptions, OPTION_FBDEV, FALSE)) { + if (xf86ReturnOptValBool(pGlint->Options, OPTION_FBDEV, FALSE)) { if (!FBDevProbed && !xf86LoadSubModule(pScrn, "fbdevhw")) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "couldn't load fbdevHW module!\n"); @@ -1206,7 +1214,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) pScrn->overlayFlags = 0; from = X_DEFAULT; - if ((s = xf86GetOptValString(GLINTOptions, OPTION_OVERLAY))) { + if ((s = xf86GetOptValString(pGlint->Options, OPTION_OVERLAY))) { if (!*s || !xf86NameCmp(s, "8,24") || !xf86NameCmp(s, "24,8")) { Overlay = TRUE; } else { @@ -1222,7 +1230,6 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) } } - pGlint->VGAcore = FALSE; pGlint->DoubleBuffer = FALSE; pGlint->RamDac = NULL; pGlint->STATE = FALSE; @@ -1283,19 +1290,17 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) if ((pGlint->Chipset == PCI_VENDOR_TI_CHIP_PERMEDIA2) || (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V) || (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2)) { - if (xf86ReturnOptValBool(GLINTOptions, OPTION_BLOCK_WRITE, FALSE)) { + if (xf86ReturnOptValBool(pGlint->Options, OPTION_BLOCK_WRITE, FALSE)) { pGlint->UseBlockWrite = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Block Writes enabled\n"); } } - if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX) { - if (xf86ReturnOptValBool(GLINTOptions, OPTION_FIREGL3000, FALSE)) { - /* Can't we detect a Fire GL 3000 ????? and remove this ? */ - pGlint->UseFireGL3000 = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + if (xf86ReturnOptValBool(pGlint->Options, OPTION_FIREGL3000, FALSE)) { + /* Can't we detect a Fire GL 3000 ????? and remove this ? */ + pGlint->UseFireGL3000 = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Diamond FireGL3000 mode enabled\n"); - } } if (!FBDevProbed) { @@ -1394,6 +1399,65 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) break; } break; + case PCI_VENDOR_3DLABS_CHIP_DELTA: + /* Delta has a bug, we need to fix it here */ + { + int basecopro = + pGlint->MultiPciInfo[0]->memBase[0] & 0xFFFFC000; + int basedelta = pGlint->PciInfo->memBase[0] & 0xFFFFC000; + int glintdelta = pGlint->PciTag; + int glintcopro = pciTag(pGlint->MultiPciInfo[0]->bus, + pGlint->MultiPciInfo[0]->device, + pGlint->MultiPciInfo[0]->func); + int temp, base3copro, offset; + + if( (basedelta & 0x20000) ^ (basecopro & 0x20000) ) { + if (pGlint->MultiChip == PCI_CHIP_PERMEDIA) { + offset = 0x20; /* base4 */ + } else { + offset = 0x1c; /* base3 */ + } + base3copro = pciReadLong(glintcopro, offset); + if( (basecopro & 0x20000) ^ (base3copro & 0x20000) ) { + /* + * oops, still different; we know that base3 + * is at least 16 MB, so we just take 128k + * offset into it. + */ + base3copro += 0x20000; + } + /* + * and now for the magic. + * read old value + * write fffffffff + * read value + * write new value + */ + temp = pciReadLong(glintdelta, 0x10); + pciWriteLong(glintdelta, 0x10, 0xffffffff); + temp = pciReadLong(glintdelta, 0x10); + pciWriteLong(glintdelta, 0x10, base3copro); + + /* + * additionally,sometimes we see the baserom which might + * confuse the chip, so let's make sure that is disabled + */ + temp = pciReadLong(glintcopro, 0x30); + pciWriteLong(glintcopro, 0x30, 0xffffffff); + temp = pciReadLong(glintcopro, 0x30); + pciWriteLong(glintcopro, 0x30, 0); + + /* + * now update our internal structure accordingly + */ + pGlint->IOAddress = + pGlint->PciInfo->memBase[0] = base3copro; + xf86DrvMsg(pScrn->scrnIndex, from, + "Delta Bug - Changing MMIO registers to 0x%lX\n", + (unsigned long)pGlint->IOAddress); + } + } + break; default: break; } @@ -1429,8 +1493,27 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3: pScrn->videoRam = Permedia3MemorySizeDetect(pScrn); break; + case PCI_VENDOR_3DLABS_CHIP_DELTA: case PCI_VENDOR_3DLABS_CHIP_GAMMA: switch (pGlint->MultiChip) { + case PCI_CHIP_PERMEDIA: + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Attached Rasterizer is GLINT Permedia\n"); + pScrn->videoRam = (((GLINT_READ_REG(PMMemConfig)>>29) & + 0x03) + 1) * 2048; + break; + case PCI_CHIP_300SX: + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Attached Rasterizer is GLINT 300SX\n"); + pScrn->videoRam = (1 << ((GLINT_READ_REG(FBMemoryCtl) & + 0xE0000000)>>29)) * 1024; + break; + case PCI_CHIP_500TX: + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Attached Rasterizer is GLINT 500TX\n"); + pScrn->videoRam = (1 << ((GLINT_READ_REG(FBMemoryCtl) & + 0xE0000000)>>29)) * 1024; + break; case PCI_CHIP_MX: xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Attached Rasterizer is GLINT MX\n"); @@ -1515,7 +1598,6 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) maxheight = 2048; maxwidth = 2048; pGlint->RefClock = 14318; - pGlint->VGAcore = TRUE; /* chip has a vga core */ pGlint->RamDacRec = RamDacCreateInfoRec(); pGlint->RamDacRec->ReadDAC = Permedia2InIndReg; pGlint->RamDacRec->WriteDAC = Permedia2OutIndReg; @@ -1533,7 +1615,6 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) maxheight = 2048; maxwidth = 2048; pGlint->RefClock = 14318; - pGlint->VGAcore = TRUE; /* chip has a vga core */ pGlint->RamDacRec = RamDacCreateInfoRec(); pGlint->RamDacRec->ReadDAC = Permedia2vInIndReg; pGlint->RamDacRec->WriteDAC = Permedia2vOutIndReg; @@ -1551,7 +1632,6 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) maxheight = 4096; maxwidth = 4096; pGlint->RefClock = 14318; - pGlint->VGAcore = TRUE; pGlint->RamDacRec = RamDacCreateInfoRec(); pGlint->RamDacRec->ReadDAC = Permedia2vInIndReg; pGlint->RamDacRec->WriteDAC = Permedia2vOutIndReg; @@ -1566,9 +1646,9 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) break; case PCI_VENDOR_TI_CHIP_PERMEDIA: case PCI_VENDOR_3DLABS_CHIP_PERMEDIA: + pGlint->FIFOSize = 31; maxheight = 1024; maxwidth = 1536; - pGlint->VGAcore = TRUE; /* chip has a vga core */ GLINTProbeIBMramdac(pScrn); if (pGlint->RamDac == NULL) return FALSE; if (pGlint->RamDac->RamDacType != (IBM526DB_RAMDAC) && @@ -1579,7 +1659,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) case PCI_VENDOR_3DLABS_CHIP_500TX: case PCI_VENDOR_3DLABS_CHIP_300SX: case PCI_VENDOR_3DLABS_CHIP_MX: - pGlint->FIFOSize = 16; + pGlint->FIFOSize = 15; if (pScrn->bitsPerPixel == 24) { xf86DrvMsg(pScrn->scrnIndex, from, "-depth 24 -pixmap24 not supported by this chip.\n"); @@ -1610,6 +1690,50 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) if (!pGlint->RamDac) return FALSE; break; + case PCI_VENDOR_3DLABS_CHIP_DELTA: + pGlint->FIFOSize = 15; + switch (pGlint->MultiChip) { + case PCI_CHIP_PERMEDIA: + maxheight = 1024; + maxwidth = 1536; + GLINTProbeIBMramdac(pScrn); + if (pGlint->RamDac == NULL) return FALSE; + if (pGlint->RamDac->RamDacType != (IBM526DB_RAMDAC) && + pGlint->RamDac->RamDacType != (IBM526_RAMDAC)) + return FALSE; + pGlint->RefClock = 14318; + break; + case PCI_CHIP_500TX: + case PCI_CHIP_300SX: + case PCI_CHIP_MX: + if (pScrn->bitsPerPixel == 24) { + xf86DrvMsg(pScrn->scrnIndex, from, + "-depth 24 -pixmap24 not supported by this chip.\n"); + return FALSE; + } + maxheight = 4096; + maxwidth = 4096; + /* Test for an TI ramdac */ + if (!pGlint->RamDac) { + GLINTProbeTIramdac(pScrn); + if (pGlint->RamDac) + if ( (pGlint->RamDac->RamDacType == (TI3026_RAMDAC)) || + (pGlint->RamDac->RamDacType == (TI3030_RAMDAC)) ) + pGlint->RefClock = 14318; + } + /* Test for an IBM ramdac */ + if (!pGlint->RamDac) { + GLINTProbeIBMramdac(pScrn); + if (pGlint->RamDac) { + if (pGlint->RamDac->RamDacType == (IBM640_RAMDAC) || + pGlint->RamDac->RamDacType == (IBM526DB_RAMDAC) || + pGlint->RamDac->RamDacType == (IBM526_RAMDAC)) + pGlint->RefClock = 40000; + } + } + break; + } + break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: pGlint->FIFOSize = 32; if (pScrn->bitsPerPixel == 24) { @@ -1704,30 +1828,18 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "FIFO Size is %d DWORDS\n", pGlint->FIFOSize); - if (pGlint->FBDev || FBDevProbed) - pGlint->VGAcore = FALSE; - - if (pGlint->VGAcore) { - /* Initialize the card through int10 interface if needed */ + /* Initialize the card through int10 interface if needed */ + if (pGlint->Chipset != PCI_VENDOR_3DLABS_CHIP_GAMMA && + pGlint->Chipset != PCI_VENDOR_3DLABS_CHIP_DELTA && + !xf86IsPrimaryPci(pGlint->PciInfo)) { if ( xf86LoadSubModule(pScrn, "int10")){ - xf86Int10InfoPtr pInt; - - xf86LoaderReqSymLists(int10Symbols, NULL); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n"); - pInt = xf86InitInt10(pGlint->pEnt->index); - xf86FreeInt10(pInt); - } + xf86Int10InfoPtr pInt; - /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) - return FALSE; - - xf86LoaderReqSymLists(vgahwSymbols, NULL); - /* - * Allocate a vgaHWRec - */ - if (!vgaHWGetHWRec(pScrn)) - return FALSE; + xf86LoaderReqSymLists(int10Symbols, NULL); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Initializing int10\n"); + pInt = xf86InitInt10(pGlint->pEnt->index); + xf86FreeInt10(pInt); + } } /* Set the min pixel clock */ @@ -1765,11 +1877,19 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) if((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX)|| (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) || (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_MX) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_300SX)) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_500TX)) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_MX)) || ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) && (pGlint->MultiChip == PCI_CHIP_MX)) ) pGlint->MaxClock = 220000; if ( (pGlint->Chipset == PCI_VENDOR_TI_CHIP_PERMEDIA) || - (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA) ) { + (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_PERMEDIA)) ) { switch (pScrn->bitsPerPixel) { case 8: pGlint->MaxClock = 200000; @@ -1920,6 +2040,12 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) if ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_500TX) || (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) || (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_MX) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_300SX)) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_500TX)) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_MX)) || ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_GAMMA) && (pGlint->MultiChip == PCI_CHIP_MX)) ) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, @@ -1937,6 +2063,20 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) } } + /* Check Virtual resolution */ + if (pScrn->virtualX > maxwidth) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "GLINTModeInit: virtual width (%d) too big for hardware\n", + pScrn->virtualX); + return FALSE; + } + if (pScrn->virtualY > maxheight) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "GLINTModeInit: virtual height (%d) too big for hardware\n", + pScrn->virtualY); + return FALSE; + } + switch (pGlint->Chipset) { /* Now we know displaywidth, so set linepitch data */ case PCI_VENDOR_TI_CHIP_PERMEDIA2: @@ -1954,11 +2094,18 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) pGlint->bppalign = 0; break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: + case PCI_VENDOR_3DLABS_CHIP_DELTA: switch (pGlint->MultiChip) { case PCI_CHIP_MX: + case PCI_CHIP_500TX: + case PCI_CHIP_300SX: pGlint->pprod = partprod500TX[pScrn->displayWidth >> 5]; pGlint->bppalign = 0; break; + case PCI_CHIP_PERMEDIA: + pGlint->pprod = partprodPermedia[pScrn->displayWidth >> 5]; + pGlint->bppalign = bppand[(pScrn->bitsPerPixel>>3)-1]; + break; } break; } @@ -2166,12 +2313,6 @@ GLINTMapMem(ScrnInfoPtr pScrn) pGlint->IOBase = fbdevHWMapMMIO(pScrn); if (pGlint->IOBase == NULL) return FALSE; - /* - * This does not work on Alphas ! They need VGA MMIO space - * mapped in a special way as they cannot access it byte - * or wordwise. - */ - pGlint->IOBaseVGA = pGlint->IOBase + GLINT_VGA_MMIO_OFF; TRACE_EXIT("GLINTMapMem"); return TRUE; @@ -2183,8 +2324,6 @@ GLINTMapMem(ScrnInfoPtr pScrn) */ pGlint->IOBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO_32BIT, pGlint->PciTag, pGlint->IOAddress, 0x20000); - pGlint->IOBaseVGA = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO, - pGlint->PciTag, pGlint->IOAddress + GLINT_VGA_MMIO_OFF, 0x2000); if (pGlint->IOBase == NULL) return FALSE; @@ -2231,10 +2370,6 @@ GLINTUnmapMem(ScrnInfoPtr pScrn) xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pGlint->IOBase, 0x20000); pGlint->IOBase = NULL; - if (pGlint->IOBaseVGA != NULL) - xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pGlint->IOBaseVGA, 0x2000); - pGlint->IOBaseVGA = NULL; - if (pGlint->FbBase != NULL) xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pGlint->FbBase, pGlint->FbMapSize); pGlint->FbBase = NULL; @@ -2262,16 +2397,6 @@ GLINTSave(ScrnInfoPtr pScrn) RAMDACreg = &pRAMDAC->SavedReg; TRACE_ENTER("GLINTSave"); - if (pGlint->VGAcore) { - vgaRegPtr vgaReg; - vgaReg = &VGAHWPTR(pScrn)->SavedReg; - if (xf86IsPrimaryPci(pGlint->PciInfo)) { - vgaHWSave(pScrn, vgaReg, VGA_SR_MODE | VGA_SR_FONTS); - } else { - vgaHWSave(pScrn, vgaReg, VGA_SR_MODE); - } - } - switch (pGlint->Chipset) { case PCI_VENDOR_TI_CHIP_PERMEDIA2: @@ -2296,7 +2421,10 @@ GLINTSave(ScrnInfoPtr pScrn) (*pGlint->RamDac->Save)(pScrn, pGlint->RamDacRec, RAMDACreg); break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: + case PCI_VENDOR_3DLABS_CHIP_DELTA: switch (pGlint->MultiChip) { + case PCI_CHIP_500TX: + case PCI_CHIP_300SX: case PCI_CHIP_MX: if (pGlint->numMultiDevices == 2) { ACCESSCHIP2() @@ -2309,6 +2437,10 @@ GLINTSave(ScrnInfoPtr pScrn) TXSave(pScrn, glintReg); (*pGlint->RamDac->Save)(pScrn, pGlint->RamDacRec, RAMDACreg); break; + case PCI_CHIP_PERMEDIA: + PermediaSave(pScrn, glintReg); + (*pGlint->RamDac->Save)(pScrn, pGlint->RamDacRec, RAMDACreg); + break; case PCI_CHIP_PERMEDIA3: if (pGlint->numMultiDevices == 2) { ACCESSCHIP2(); @@ -2340,15 +2472,6 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) GLINTRegPtr glintReg = &pGlint->ModeReg[0]; GLINTRegPtr glintReg2 = &pGlint->ModeReg[1]; - if (pGlint->VGAcore) { - vgaHWPtr hwp = VGAHWPTR(pScrn); - vgaHWUnlock(hwp); - - /* Initialise the ModeReg values */ - if (!vgaHWInit(pScrn, mode)) - return FALSE; - } - pScrn->vtSema = TRUE; switch (pGlint->Chipset) { @@ -2372,8 +2495,11 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) ret = TXInit(pScrn, mode, glintReg); break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: + case PCI_VENDOR_3DLABS_CHIP_DELTA: switch (pGlint->MultiChip) { case PCI_CHIP_MX: + case PCI_CHIP_500TX: + case PCI_CHIP_300SX: if (pGlint->numMultiDevices == 2) { ACCESSCHIP2(); ret = TXInit(pScrn, mode, glintReg2); @@ -2381,6 +2507,9 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) } ret = TXInit(pScrn, mode, glintReg); break; + case PCI_CHIP_PERMEDIA: + ret = PermediaInit(pScrn, mode); + break; case PCI_CHIP_PERMEDIA3: if (pGlint->numMultiDevices == 2) { ACCESSCHIP2(); @@ -2396,14 +2525,6 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) if (!ret) return FALSE; - /* Program the registers */ - if (pGlint->VGAcore) { - vgaHWPtr hwp = VGAHWPTR(pScrn); - vgaRegPtr vgaReg = &hwp->ModeReg; - vgaHWProtect(pScrn, TRUE); - vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE); - } - glintReg = &pGlint->ModeReg[0]; glintReg2 = &pGlint->ModeReg[1]; RAMDACreg = &pRAMDAC->ModeReg; @@ -2433,7 +2554,10 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg); break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: + case PCI_VENDOR_3DLABS_CHIP_DELTA: switch (pGlint->MultiChip) { + case PCI_CHIP_500TX: + case PCI_CHIP_300SX: case PCI_CHIP_MX: if (pGlint->numMultiDevices == 2) { ACCESSCHIP2(); @@ -2446,6 +2570,10 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) TXRestore(pScrn, glintReg); (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg); break; + case PCI_CHIP_PERMEDIA: + PermediaRestore(pScrn, glintReg); + (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg); + break; case PCI_CHIP_PERMEDIA3: if (pGlint->numMultiDevices == 2) { ACCESSCHIP2(); @@ -2458,10 +2586,6 @@ GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) break; } - if (pGlint->VGAcore) { - vgaHWProtect(pScrn, FALSE); - } - if (xf86IsPc98()) outb(0xfac, 0x01); @@ -2487,9 +2611,6 @@ GLINTRestore(ScrnInfoPtr pScrn) RAMDACreg = &pRAMDAC->SavedReg; TRACE_ENTER("GLINTRestore"); - if (pGlint->VGAcore) { - vgaHWProtect(pScrn, TRUE); - } switch (pGlint->Chipset) { case PCI_VENDOR_TI_CHIP_PERMEDIA2: @@ -2520,8 +2641,11 @@ GLINTRestore(ScrnInfoPtr pScrn) (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg); break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: + case PCI_VENDOR_3DLABS_CHIP_DELTA: switch (pGlint->MultiChip) { case PCI_CHIP_MX: + case PCI_CHIP_500TX: + case PCI_CHIP_300SX: if (pGlint->numMultiDevices == 2) { ACCESSCHIP2(); TXRestore(pScrn, glintReg2); @@ -2533,6 +2657,10 @@ GLINTRestore(ScrnInfoPtr pScrn) TXRestore(pScrn, glintReg); (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg); break; + case PCI_CHIP_PERMEDIA: + PermediaRestore(pScrn, glintReg); + (*pGlint->RamDac->Restore)(pScrn, pGlint->RamDacRec, RAMDACreg); + break; case PCI_CHIP_PERMEDIA3: #ifdef PM3Video TRACE("PM3Video : VideoLeaveVT"); @@ -2549,17 +2677,6 @@ GLINTRestore(ScrnInfoPtr pScrn) break; } - if (pGlint->VGAcore) { - vgaHWPtr hwp = VGAHWPTR(pScrn); - vgaRegPtr vgaReg = &hwp->SavedReg; - if (xf86IsPrimaryPci(pGlint->PciInfo)) { - vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE | VGA_SR_FONTS); - } else { - vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE); - } - vgaHWProtect(pScrn, FALSE); - } - TRACE_EXIT("GLINTRestore"); } @@ -2582,20 +2699,6 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (!GLINTMapMem(pScrn)) return FALSE; - /* Initialize the MMIO vgahw functions */ - if (pGlint->VGAcore) { - vgaHWPtr hwp; - hwp = VGAHWPTR(pScrn); - if (xf86IsPrimaryPci(pGlint->PciInfo)) { - hwp->MapSize = 0x10000; /* Standard 64k VGA window */ - if (!vgaHWMapMem(pScrn)) - return FALSE; - } - - vgaHWSetMmioFuncs(hwp, pGlint->IOBaseVGA, 0); - vgaHWGetIOBase(hwp); - } - if (pGlint->FBDev) { fbdevHWSave(pScrn); if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) { @@ -2742,8 +2845,10 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pGlint->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = GLINTBlockHandler; +#if !defined(__sparc__) if (!pGlint->ShadowFB) GLINTDGAInit(pScreen); +#endif if (pScrn->bitsPerPixel > 8) { /* Fixup RGB ordering */ @@ -2780,10 +2885,18 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) TXAccelInit(pScreen); break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: + case PCI_VENDOR_3DLABS_CHIP_DELTA: switch (pGlint->MultiChip) { + case PCI_CHIP_500TX: case PCI_CHIP_MX: TXAccelInit(pScreen); break; + case PCI_CHIP_300SX: + SXAccelInit(pScreen); + break; + case PCI_CHIP_PERMEDIA: + PermediaAccelInit(pScreen); + break; case PCI_CHIP_PERMEDIA3: Permedia3AccelInit(pScreen); break; @@ -2968,10 +3081,18 @@ GLINTSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) SXInitializeEngine(pScrn); break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: + case PCI_VENDOR_3DLABS_CHIP_DELTA: switch (pGlint->MultiChip) { + case PCI_CHIP_500TX: case PCI_CHIP_MX: TXInitializeEngine(pScrn); break; + case PCI_CHIP_300SX: + SXInitializeEngine(pScrn); + break; + case PCI_CHIP_PERMEDIA: + PermediaInitializeEngine(pScrn); + break; case PCI_CHIP_PERMEDIA3: Permedia3InitializeEngine(pScrn); break; @@ -3028,9 +3149,15 @@ GLINTAdjustFrame(int scrnIndex, int x, int y, int flags) GLINT_SLOW_WRITE_REG(base, PMScreenBase); break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: - if (pGlint->MultiChip == PCI_CHIP_PERMEDIA3) { + case PCI_VENDOR_3DLABS_CHIP_DELTA: + switch (pGlint->MultiChip) { + case PCI_CHIP_PERMEDIA3: base = (y * pScrn->displayWidth + x) >> pGlint->BppShift; GLINT_SLOW_WRITE_REG(base, PMScreenBase); + break; + case PCI_CHIP_PERMEDIA: + GLINT_SLOW_WRITE_REG(base, PMScreenBase); + break; } break; } @@ -3103,10 +3230,18 @@ GLINTEnterVT(int scrnIndex, int flags) SXInitializeEngine(pScrn); break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: + case PCI_VENDOR_3DLABS_CHIP_DELTA: switch (pGlint->MultiChip) { + case PCI_CHIP_500TX: case PCI_CHIP_MX: TXInitializeEngine(pScrn); break; + case PCI_CHIP_300SX: + SXInitializeEngine(pScrn); + break; + case PCI_CHIP_PERMEDIA: + PermediaInitializeEngine(pScrn); + break; case PCI_CHIP_PERMEDIA3: Permedia3InitializeEngine(pScrn); break; @@ -3137,8 +3272,6 @@ GLINTLeaveVT(int scrnIndex, int flags) TRACE_ENTER("GLINTLeaveVT"); pGlint->STATE = TRUE; GLINTRestore(pScrn); - if (pGlint->VGAcore) - vgaHWLock(VGAHWPTR(pScrn)); if (xf86IsPc98()) outb(0xfac, 0x00); @@ -3193,8 +3326,6 @@ GLINTCloseScreen(int scrnIndex, ScreenPtr pScreen) else { pGlint->STATE = TRUE; GLINTRestore(pScrn); - if (pGlint->VGAcore) - vgaHWLock(VGAHWPTR(pScrn)); } GLINTUnmapMem(pScrn); } @@ -3234,8 +3365,6 @@ GLINTFreeScreen(int scrnIndex, int flags) TRACE_ENTER("GLINTFreeScreen"); if (xf86LoaderCheckSymbol("fbdevHWFreeRec")) fbdevHWFreeRec(xf86Screens[scrnIndex]); - if (xf86LoaderCheckSymbol("vgaHWFreeHWRec")) - vgaHWFreeHWRec(xf86Screens[scrnIndex]); if (xf86LoaderCheckSymbol("RamDacFreeRec")) RamDacFreeRec(xf86Screens[scrnIndex]); GLINTFreeRec(xf86Screens[scrnIndex]); @@ -3333,11 +3462,15 @@ GLINTSaveScreen(ScreenPtr pScreen, int mode) case PCI_VENDOR_3DLABS_CHIP_MX: break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: - if (pGlint->MultiChip == PCI_CHIP_PERMEDIA3) { - temp = GLINT_READ_REG(PMVideoControl); - if (unblank) temp |= 1; - else temp &= 0xFFFFFFFE; - GLINT_SLOW_WRITE_REG(temp, PMVideoControl); + case PCI_VENDOR_3DLABS_CHIP_DELTA: + switch (pGlint->MultiChip) { + case PCI_CHIP_PERMEDIA3: + case PCI_CHIP_PERMEDIA: + temp = GLINT_READ_REG(PMVideoControl); + if (unblank) temp |= 1; + else temp &= 0xFFFFFFFE; + GLINT_SLOW_WRITE_REG(temp, PMVideoControl); + break; } break; } @@ -3433,22 +3566,74 @@ void GLINT_MoveDWORDS( #ifdef __alpha__ write_mem_barrier(); #endif - while(dwords & ~0x03) { - *dest = *src; - *(dest + 1) = *(src + 1); - *(dest + 2) = *(src + 2); - *(dest + 3) = *(src + 3); - src += 4; - dest += 4; - dwords -= 4; - } - - while(dwords) { - *dest = *src; - src++; - dest++; - dwords--; - } + if ((unsigned long)src & 0x3UL) { + unsigned char *pchar; + while (dwords & ~0x03) { + pchar = (unsigned char *)(src + 0); + *(dest + 0) = (((CARD32)pchar[0] << 24) | + ((CARD32)pchar[1] << 16) | + ((CARD32)pchar[2] << 8) | + ((CARD32)pchar[3] << 0)); + pchar = (unsigned char *)(src + 1); + *(dest + 1) = (((CARD32)pchar[0] << 24) | + ((CARD32)pchar[1] << 16) | + ((CARD32)pchar[2] << 8) | + ((CARD32)pchar[3] << 0)); + pchar = (unsigned char *)(src + 2); + *(dest + 2) = (((CARD32)pchar[0] << 24) | + ((CARD32)pchar[1] << 16) | + ((CARD32)pchar[2] << 8) | + ((CARD32)pchar[3] << 0)); + pchar = (unsigned char *)(src + 3); + *(dest + 3) = (((CARD32)pchar[0] << 24) | + ((CARD32)pchar[1] << 16) | + ((CARD32)pchar[2] << 8) | + ((CARD32)pchar[3] << 0)); + src += 4; + dest += 4; + dwords -= 4; + } + if (!dwords) + return; + pchar = (unsigned char *)(src + 0); + *(dest + 0) = (((CARD32)pchar[0] << 24) | + ((CARD32)pchar[1] << 16) | + ((CARD32)pchar[2] << 8) | + ((CARD32)pchar[3] << 0)); + if (dwords == 1) + return; + pchar = (unsigned char *)(src + 1); + *(dest + 1) = (((CARD32)pchar[0] << 24) | + ((CARD32)pchar[1] << 16) | + ((CARD32)pchar[2] << 8) | + ((CARD32)pchar[3] << 0)); + if (dwords == 2) + return; + pchar = (unsigned char *)(src + 2); + *(dest + 2) = (((CARD32)pchar[0] << 24) | + ((CARD32)pchar[1] << 16) | + ((CARD32)pchar[2] << 8) | + ((CARD32)pchar[3] << 0)); + } else { + while (dwords & ~0x03) { + *dest = *src; + *(dest + 1) = *(src + 1); + *(dest + 2) = *(src + 2); + *(dest + 3) = *(src + 3); + src += 4; + dest += 4; + dwords -= 4; + } + if (!dwords) + return; + *dest = *src; + if (dwords == 1) + return; + *(dest + 1) = *(src + 1); + if (dwords == 2) + return; + *(dest + 2) = *(src + 2); + } } int @@ -3478,7 +3663,10 @@ Shiftbpp(ScrnInfoPtr pScrn, int value) logbytesperaccess = 3; break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: + case PCI_VENDOR_3DLABS_CHIP_DELTA: switch (pGlint->MultiChip) { + case PCI_CHIP_500TX: + case PCI_CHIP_300SX: case PCI_CHIP_MX: if ( (pGlint->RamDac->RamDacType == (IBM640_RAMDAC)) || (pGlint->RamDac->RamDacType == (TI3030_RAMDAC)) ) @@ -3486,6 +3674,9 @@ Shiftbpp(ScrnInfoPtr pScrn, int value) else logbytesperaccess = 3; break; + case PCI_CHIP_PERMEDIA: + logbytesperaccess = 2; + break; case PCI_CHIP_PERMEDIA3: logbytesperaccess = 4; break; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h index a684b81b6..4690035ea 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h,v 1.26 2001/04/19 09:28:32 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h,v 1.26.2.1 2001/05/24 20:12:47 alanh Exp $ */ /* * glint register file @@ -1202,7 +1202,16 @@ #define GLINT_WAIT(n) \ do{ \ - while(GLINT_READ_REG(InFIFOSpace)<(n)); \ + if (pGlint->InFifoSpace>=(n)) \ + pGlint->InFifoSpace -= (n); \ + else { \ + int tmp; \ + while((tmp=GLINT_READ_REG(InFIFOSpace))<(n)); \ + /* Clamp value due to bugs in PM3 */ \ + if (tmp > pGlint->FIFOSize) \ + tmp = pGlint->FIFOSize; \ + pGlint->InFifoSpace = tmp - (n); \ + } \ }while(0) #define GLINTDACDelay(x) do { \ @@ -1217,7 +1226,7 @@ do{ \ #define GLINT_SLOW_WRITE_REG(v,r) \ do{ \ mem_barrier(); \ - GLINT_WAIT(1); \ + GLINT_WAIT(pGlint->FIFOSize); \ mem_barrier(); \ GLINT_WRITE_REG(v,r); \ }while(0) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c index 532c56178..67c7c2b18 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c @@ -30,7 +30,7 @@ * * Permedia 2 accelerated options. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c,v 1.29 2001/02/27 23:04:59 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c,v 1.29.2.1 2001/05/30 11:42:22 alanh Exp $ */ #include "Xarch.h" #include "xf86.h" @@ -336,12 +336,14 @@ Permedia2AccelInit(ScreenPtr pScreen) infoPtr->WriteBitmap = Permedia2WriteBitmap; - if (pScrn->bitsPerPixel == 8) + if (pScrn->bitsPerPixel == 8) { infoPtr->WritePixmap = Permedia2WritePixmap8bpp; - else - if (pScrn->bitsPerPixel == 16) + infoPtr->WritePixmapFlags = NO_GXCOPY; + } else + if (pScrn->bitsPerPixel == 16) { infoPtr->WritePixmap = Permedia2WritePixmap16bpp; - else + infoPtr->WritePixmapFlags = NO_GXCOPY; + } else if (pScrn->bitsPerPixel == 32) infoPtr->WritePixmap = Permedia2WritePixmap32bpp; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c index 4baeabf84..0f51dab4a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c @@ -28,7 +28,7 @@ * this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen and * Siemens Nixdorf Informationssysteme */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c,v 1.22 2001/02/07 13:26:20 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_dac.c,v 1.23.2.1 2001/05/24 20:12:48 alanh Exp $ */ #include "Xarch.h" #include "xf86.h" @@ -211,6 +211,11 @@ Permedia2Save(ScrnInfoPtr pScrn, GLINTRegPtr glintReg) GLINTPtr pGlint = GLINTPTR(pScrn); int i; + /* We can't rely on the vgahw layer copying the font information + * back properly, due to problems with MMIO access to VGA space + * so we memcpy the information using the slow routines */ + xf86SlowBcopy((CARD8*)pGlint->FbBase, (CARD8*)pGlint->VGAdata, 65536); + glintReg->glintRegs[Aperture0 >> 3] = GLINT_READ_REG(Aperture0); glintReg->glintRegs[Aperture1 >> 3] = GLINT_READ_REG(Aperture1); glintReg->glintRegs[PMFramebufferWriteMask >> 3] = @@ -266,6 +271,12 @@ Permedia2Restore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg) GLINTPtr pGlint = GLINTPTR(pScrn); int i; + /* We can't rely on the vgahw layer copying the font information + * back properly, due to problems with MMIO access to VGA space + * so we memcpy the information using the slow routines */ + if (pGlint->STATE) + xf86SlowBcopy((CARD8*)pGlint->VGAdata, (CARD8*)pGlint->FbBase, 65536); + #if 0 GLINT_SLOW_WRITE_REG(0, ResetStatus); while(GLINT_READ_REG(ResetStatus) != 0) { @@ -273,6 +284,8 @@ Permedia2Restore(ScrnInfoPtr pScrn, GLINTRegPtr glintReg) }; #endif + GLINT_SLOW_WRITE_REG(0xFF, PM2DACReadMask); + GLINT_SLOW_WRITE_REG(glintReg->glintRegs[Aperture0 >> 3], Aperture0); GLINT_SLOW_WRITE_REG(glintReg->glintRegs[Aperture1 >> 3], Aperture1); GLINT_SLOW_WRITE_REG(glintReg->glintRegs[PMFramebufferWriteMask >> 3], diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c index 70a269c7e..50f8650f6 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c,v 1.18 2001/01/31 16:14:59 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_video.c,v 1.19 2001/05/04 19:05:38 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -211,6 +211,7 @@ typedef enum { OPTION_EXPOSE /* obsolete, ignored */ } OptToken; +/* XXX These should be made const, and per-screen/adaptor copies processed. */ static OptionInfoRec AdaptorOptions[] = { { OPTION_DEVICE, "Device", OPTV_STRING, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c index 91b0b9419..03f5a2f2a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c @@ -27,7 +27,7 @@ * this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen and * Siemens Nixdorf Informationssysteme */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c,v 1.25 2001/02/27 18:47:25 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c,v 1.26 2001/05/16 07:56:07 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -113,8 +113,34 @@ Permedia2VInit(ScrnInfoPtr pScrn, DisplayModePtr mode) GLINTRegPtr pReg = &pGlint->ModeReg[0]; CARD32 temp1, temp2, temp3, temp4; - pReg->glintRegs[Aperture0 >> 3] = 0; - pReg->glintRegs[Aperture1 >> 3] = 0; + temp1 = 0; + temp2 = 0; +#if X_BYTE_ORDER == X_BIG_ENDIAN + switch (pGlint->HwBpp) { + case 8: + case 24: + temp1 = 0x00; + temp2 = 0x00; + break; + + case 15: + case 16: + temp1 = 0x02; + temp2 = 0x02; + break; + + case 32: + temp1 = 0x01; + temp2 = 0x01; + break; + default: + break; + }; +#endif /* BIG_ENDIAN */ + + pReg->glintRegs[Aperture0 >> 3] = temp1; + pReg->glintRegs[Aperture1 >> 3] = temp2; + pReg->glintRegs[PMFramebufferWriteMask >> 3] = 0xFFFFFFFF; pReg->glintRegs[PMBypassWriteMask >> 3] = 0xFFFFFFFF; @@ -163,7 +189,7 @@ Permedia2VInit(ScrnInfoPtr pScrn, DisplayModePtr mode) pReg->glintRegs[PMVTotal >> 3] -= 1; /* PMVTotal */ pReg->glintRegs[ChipConfig >> 3] = GLINT_READ_REG(ChipConfig) & 0xFFFFFFDD; - pReg->DacRegs[PM2VDACRDDACControl] = 0x80; + pReg->DacRegs[PM2VDACRDDACControl] = 0x00; { /* Get the programmable clock values */ @@ -197,6 +223,7 @@ Permedia2VInit(ScrnInfoPtr pScrn, DisplayModePtr mode) pReg->DacRegs[PM2VDACRDColorFormat] = 0x2E; break; case 16: + pReg->DacRegs[PM2VDACRDMiscControl] |= 0x08; pReg->DacRegs[PM2VDACRDPixelSize] = 0x01; if (pScrn->depth == 15) pReg->DacRegs[PM2VDACRDColorFormat] = 0x61; @@ -204,10 +231,12 @@ Permedia2VInit(ScrnInfoPtr pScrn, DisplayModePtr mode) pReg->DacRegs[PM2VDACRDColorFormat] = 0x70; break; case 24: + pReg->DacRegs[PM2VDACRDMiscControl] |= 0x08; pReg->DacRegs[PM2VDACRDPixelSize] = 0x04; pReg->DacRegs[PM2VDACRDColorFormat] = 0x60; break; case 32: + pReg->DacRegs[PM2VDACRDMiscControl] |= 0x08; pReg->DacRegs[PM2VDACRDPixelSize] = 0x02; pReg->DacRegs[PM2VDACRDColorFormat] = 0x20; if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c index 29b0a7715..9e330e190 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c @@ -26,7 +26,7 @@ * this work is sponsored by Appian Graphics. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c,v 1.22 2001/03/20 19:08:58 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c,v 1.24 2001/05/16 07:56:07 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -331,6 +331,7 @@ Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr pReg) STOREDAC(PM2VDACRDColorFormat, 0x2E); break; case 16: + temp3 |= PM3RD_MiscControl_DIRECTCOLOR_ENABLE; STOREDAC(PM2VDACRDPixelSize, 0x01); if (pScrn->depth == 15) { STOREDAC(PM2VDACRDColorFormat, 0x61); @@ -339,10 +340,12 @@ Permedia3Init(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr pReg) } break; case 24: + temp3 |= PM3RD_MiscControl_DIRECTCOLOR_ENABLE; STOREDAC(PM2VDACRDPixelSize, 0x04); STOREDAC(PM2VDACRDColorFormat, 0x60); break; case 32: + temp3 |= PM3RD_MiscControl_DIRECTCOLOR_ENABLE; if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) { temp3 |= 0x18; STOREDAC(PM2VDACRDOverlayKey, pScrn->colorKey); @@ -366,8 +369,8 @@ Permedia3Save(ScrnInfoPtr pScrn, GLINTRegPtr pReg) /* We can't rely on the vgahw layer copying the font information * back properly, due to problems with MMIO access to VGA space - * so we memcpy the information */ - memcpy((CARD8*)pGlint->VGAdata,(CARD8*)pGlint->FbBase, 65536); + * so we memcpy the information using the slow routines */ + xf86SlowBcopy((CARD8*)pGlint->FbBase, (CARD8*)pGlint->VGAdata, 65536); if ((pGlint->numMultiDevices == 2) || (IS_J2000)) { SAVEREG(GCSRAperture); @@ -435,9 +438,9 @@ Permedia3Restore(ScrnInfoPtr pScrn, GLINTRegPtr pReg) /* We can't rely on the vgahw layer copying the font information * back properly, due to problems with MMIO access to VGA space - * so we memcpy the information */ + * so we memcpy the information using the slow routines */ if (pGlint->STATE) - memcpy((CARD8*)pGlint->FbBase,(CARD8*)pGlint->VGAdata, 65536); + xf86SlowBcopy((CARD8*)pGlint->VGAdata, (CARD8*)pGlint->FbBase, 65536); if ((pGlint->numMultiDevices == 2) || (IS_J2000)) { RESTOREREG(GCSRAperture); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h index a09ca3508..d707bee94 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h,v 1.6 2001/04/18 09:24:48 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_regs.h,v 1.7 2001/05/08 19:31:22 alanh Exp $ */ /* * glint register file @@ -400,8 +400,8 @@ #define PM3RD_VideoOverlayBlend 0x02c #define PM3RD_VideoOverlayBlend_FACTOR_0_PERCENT (0<<6) #define PM3RD_VideoOverlayBlend_FACTOR_25_PERCENT (1<<6) - #define PM3RD_VideoOverlayBlend_FACTOR_59_PERCENT (2<<6) - #define PM3RD_VideoOverlayBlend_FACTOR_75_PERCENT (3<<6) + #define PM3RD_VideoOverlayBlend_FACTOR_75_PERCENT (2<<6) + #define PM3RD_VideoOverlayBlend_FACTOR_100_PERCENT (3<<6) #define PM3RD_DClkSetup1 0x1f0 #define PM3RD_DClkSetup2 0x1f1 diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c index 78c0fcad6..589eb8d5c 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c @@ -23,7 +23,7 @@ * Based on work of Michael H. Schimek <m.schimek@netway.at> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c,v 1.3 2001/04/18 09:24:49 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_video.c,v 1.6 2001/05/08 19:31:22 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -34,12 +34,18 @@ #include "xf86fbman.h" #include "xf86xv.h" #include "Xv.h" +#include "regionstr.h" +#include "xaa.h" +#include "xaalocal.h" #include "glint_regs.h" #include "pm3_regs.h" #include "glint.h" #define DEBUG(x) +#define USE_HARDWARE_COPY 1 +#define SUPPORT_CLIPPING 1 +#define BLACKNESS_WORKAROUND 1 #ifndef XvExtension @@ -60,8 +66,6 @@ void Permedia3VideoLeaveVT(ScrnInfoPtr pScrn) {} #define CLAMP(v, min, max) (((v) < (min)) ? (min) : MIN(v, max)) #define ENTRIES(array) (sizeof(array) / sizeof((array)[0])) -#define MAX_BUFFERS 3 - enum { OVERLAY_DATA_NONE, OVERLAY_DATA_COLORKEY, @@ -69,22 +73,39 @@ enum { OVERLAY_DATA_ALPHABLEND } ; +#define MAX_BUFFERS 3 + typedef struct _PortPrivRec { struct _AdaptorPrivRec * pAdaptor; + /* Sync function */ + void (*Sync) (ScrnInfoPtr pScrn); + /* Attributes */ - char OverlayData; + INT32 ColorKey; + INT32 OverlayAlpha; INT32 OverlayMode; - INT32 OverlayControl; INT32 Attribute[3]; + /* Clipping */ + RegionRec clip; + +#if 0 /* Adding this cause the server to crash if we minimize the video */ + /* Frame counter */ + char Frames; +#endif + + /* Ramdac save values, ... */ + INT32 ramdac_x, ramdac_w; + INT32 ramdac_y, ramdac_h; + Bool ramdac_on; + /* Buffers */ - int Id, Bpp; - int Format, Bpp_shift; + int Id, Format; + int FB_Shift, Video_Shift; short display, copy; - FBLinearPtr Buffer[MAX_BUFFERS]; - CARD32 BufferStride; /* bytes */ - int OverlayStride; /* pixels */ + FBAreaPtr Buffer[MAX_BUFFERS]; + CARD32 BufferBase[MAX_BUFFERS]; /* Buffer and Drawable size and position */ INT32 vx, vy, vw, vh; /* 12.10 fp */ @@ -103,8 +124,7 @@ typedef struct _AdaptorPrivRec { PortPrivPtr pPort; } AdaptorPrivRec, *AdaptorPrivPtr; -static AdaptorPrivPtr AdaptorPriv; - +static AdaptorPrivPtr AdaptorPrivList = NULL; /* * Proprietary Attributes @@ -114,42 +134,35 @@ static AdaptorPrivPtr AdaptorPriv; /* We support 3 sorts of filters : * 0 : None. * 1 : Partial (only in the X directrion). - * 2 : Full. + * 2 : Full (incompatible with X mirroring). */ #define XV_MIRROR "XV_MIRROR" /* We also support mirroring of the image : - * bit 0 : if set, will mirror in the X direction. + * bit 0 : if set, will mirror in the X direction + * (incompatible with full filtering). * bit 1 : if set, will mirror in the Y direction. */ -#define XV_OVERLAY_MODE "XV_OVERLAY_MODE" -/* We support these different overlay modes (bit 0-2) : - * 0 : Opaque video overlay (default). - * 1 : Color keyed overlay, framebuffer color key. - * Data : bit 3-27 : color key in RGB 888 format. - * 2 : Color keyed overlay, framebuffer alpha key. - * Data : bit 3-11 : 8 bit alpha key. - * 3 : Color keyed overlay, overlay color key. - * Data : bit 3-27 : color key in RGB 888 format. - * 4 : Per pixel alpha blending. - * 5 : Constant alpha blending. - * Data : bit 3-11 : 8 bit alpha blend factor. - * 6-7 : Reserved. +#define XV_ALPHA "XV_ALPHA" +/* We support the following alpha blend factors : + * 0 -> 0% Video, 100% Framebuffer + * 1 -> 25% Video, 75% Framebuffer + * 2 -> 75% Video, 25% Framebuffer + * 3 -> 100% Video, 0% Framebuffer */ - static XF86AttributeRec ScalerAttributes[] = { { XvSettable | XvGettable, 0, 2, XV_FILTER }, { XvSettable | XvGettable, 0, 3, XV_MIRROR }, - { XvSettable | XvGettable, 0, (2<<27)-1, XV_OVERLAY_MODE }, + { XvSettable | XvGettable, 0, 3, XV_ALPHA }, }; #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) -static Atom xvFilter, xvMirror, xvOverlayMode; +static Atom xvFilter, xvMirror, xvAlpha; /* Scaler */ @@ -261,7 +274,7 @@ ScalerImages[] = */ static void -RemoveAreaCallback(FBLinearPtr Buffer) +RemoveBufferCallback(FBAreaPtr Buffer) { PortPrivPtr pPPriv = (PortPrivPtr) Buffer->devPrivate.ptr; int i = -1; @@ -287,9 +300,11 @@ FreeBuffers(PortPrivPtr pPPriv, Bool from_timer) } } + pPPriv->display = -1; + pPPriv->copy = -1; for (i=0; i < MAX_BUFFERS; i++) if (pPPriv->Buffer[i]) { - xf86FreeOffscreenLinear (pPPriv->Buffer[i]); + xf86FreeOffscreenArea (pPPriv->Buffer[i]); pPPriv->Buffer[i] = NULL; } } @@ -313,13 +328,14 @@ TimerCallback(OsTimerPtr pTim, CARD32 now, pointer p) } static int -AllocateBuffers(PortPrivPtr pPPriv, - int w_bpp, int h) +AllocateBuffers(PortPrivPtr pPPriv, int w_bpp, int h) { AdaptorPrivPtr pAPriv = pPPriv->pAdaptor; ScrnInfoPtr pScrn = pAPriv->pScrn; int i = -1; + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "We try to allocate a %dx%d buffer.\n", w_bpp, h)); /* we start a timer to free the buffers if they are nto used within * 5 seconds (pPPriv->Delay * pPPriv->Instant) */ pPPriv->StopDelay = pPPriv->Delay; @@ -328,73 +344,194 @@ AllocateBuffers(PortPrivPtr pPPriv, TimerSet(pPPriv->Timer, 0, 80, TimerCallback, pAPriv); } - for (i=0; i < MAX_BUFFERS && (i == pPPriv->display || i == pPPriv->copy); i++); + for (i=0; i < MAX_BUFFERS + && (i == pPPriv->display || i == pPPriv->copy); i++); if (pPPriv->Buffer[i]) { - DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4, + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Buffer %d exists.\n", i)); - if (pPPriv->Buffer[i]->size == w_bpp * h) { - DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4, + if ((pPPriv->Buffer[i]->box.x2 - pPPriv->Buffer[i]->box.x1) == w_bpp && + (pPPriv->Buffer[i]->box.y2 - pPPriv->Buffer[i]->box.y1) == h) { + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Buffer %d is of the good size, let's use it.\n", i)); return (pPPriv->copy = i); } - else if (xf86ResizeOffscreenLinear (pPPriv->Buffer[i], w_bpp * h)) { - DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4, + else if (xf86ResizeOffscreenArea (pPPriv->Buffer[i], w_bpp, h)) { + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "I was able to resize buffer %d, let's use it.\n", i)); + pPPriv->BufferBase[i] = + ((pPPriv->Buffer[i]->box.y1 * pScrn->displayWidth) + + pPPriv->Buffer[i]->box.x1)<<pPPriv->FB_Shift; return (pPPriv->copy = i); } else { - DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4, + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "I was not able to resize buffer %d.\n", i)); - xf86FreeOffscreenLinear (pPPriv->Buffer[i]); + xf86FreeOffscreenArea (pPPriv->Buffer[i]); pPPriv->Buffer[i] = NULL; } } - if ((pPPriv->Buffer[i] = xf86AllocateOffscreenLinear (pScrn->pScreen, - w_bpp * h, 0, NULL, NULL, (pointer) pPPriv))) { - DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4, + if ((pPPriv->Buffer[i] = xf86AllocateOffscreenArea (pScrn->pScreen, + w_bpp, h, 4 >> pPPriv->FB_Shift, NULL, NULL, (pointer) pPPriv))) { + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Sucessfully allocated buffer %d, let's use it.\n", i)); + pPPriv->BufferBase[i] = + ((pPPriv->Buffer[i]->box.y1 * pScrn->displayWidth) + + pPPriv->Buffer[i]->box.x1)<<pPPriv->FB_Shift; return (pPPriv->copy = i); } - DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 4, + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "Unable to allocate a buffer.\n")); return -1; } -#define GET_OFFSET(pScrn, offset) \ - (offset + (pScrn->virtualY*pScrn->displayWidth*pScrn->bitsPerPixel/8)) - /* * Xv interface */ +#if USE_HARDWARE_COPY static void -CopyYV12LE(CARD8 *Y, CARD32 *dst, int width, int height, int pitch) +HWCopySetup(PortPrivPtr pPPriv, int x, int y, int w, int h) { - int Y_size = width * height; + AdaptorPrivPtr pAPriv = pPPriv->pAdaptor; + ScrnInfoPtr pScrn = pAPriv->pScrn; + GLINTPtr pGlint = GLINTPTR(pScrn); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "x = %d, y = %d, w = %d, h = %d.\n", x, y, w, h)); + + GLINT_WAIT(4); + GLINT_WRITE_REG(0xffffffff, FBHardwareWriteMask); + GLINT_WRITE_REG( + PM3Config2D_ForegroundROPEnable | + PM3Config2D_ForegroundROP(GXcopy) | + PM3Config2D_FBWriteEnable, + PM3Config2D); + GLINT_WRITE_REG( + PM3RectanglePosition_XOffset(x) | + PM3RectanglePosition_YOffset(y), + PM3RectanglePosition); + GLINT_WRITE_REG( + PM3Render2D_SpanOperation | + PM3Render2D_XPositive | + PM3Render2D_YPositive | + PM3Render2D_Operation_SyncOnHostData | + PM3Render2D_Width(w) | PM3Render2D_Height(h), + PM3Render2D); +} +static void +HWCopyYV12(PortPrivPtr pPPriv, CARD8 *Y, int w, int h) +{ + AdaptorPrivPtr pAPriv = pPPriv->pAdaptor; + ScrnInfoPtr pScrn = pAPriv->pScrn; + GLINTPtr pGlint = GLINTPTR(pScrn); + int Y_size = w * h; CARD8 *V = Y + Y_size; CARD8 *U = V + (Y_size >> 2); - int pad = (pitch >> 2) - (width >> 1); - int x; - - width >>= 1; - - for (height >>= 1; height > 0; height--) { - for (x = 0; x < width; Y += 2, x++) - *dst++ = Y[0] + (U[x] << 8) + (Y[1] << 16) + (V[x] << 24); - dst += pad; - for (x = 0; x < width; Y += 2, x++) - *dst++ = Y[0] + (U[x] << 8) + (Y[1] << 16) + (V[x] << 24); - dst += pad; - U += width; - V += width; + CARD32 *dst; + int dwords, i, x; + + dwords = Y_size >> 1; + + x = 0; + while (dwords >= pGlint->FIFOSize) { + dst = (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4); + GLINT_WAIT(pGlint->FIFOSize); + /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ + GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x15 << 4) | + 0x05, OutputFIFO); + for (i = pGlint->FIFOSize - 1; i; i--, Y += 2, U++, V++, dst++, x++) { + /* mmm, i don't know if this is really needed, as we perform + * endianess inversion as usual, let's check it before removing */ +#if X_BYTE_ORDER == X_BIG_ENDIAN + *dst = V[0] + (Y[1] << 8) + (U[0] << 16) + (Y[0] << 24); +#else + *dst = Y[0] + (U[0] << 8) + (Y[1] << 16) + (V[0] << 24); +#endif + if (x == w>>1) { U -= w>>1; V -= w>>1; } + if (x == w) x = 0; + } + dwords -= pGlint->FIFOSize - 1; } -} - + if (dwords) { + dst = (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4); + GLINT_WAIT(dwords + 1); + /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ + GLINT_WRITE_REG(((dwords - 1) << 16) | (0x15 << 4) | + 0x05, OutputFIFO); + for (i = dwords; i; i--, Y += 2, U++, V++, dst++, x++) { + /* mmm, i don't know if this is really needed, as we perform + * endianess inversion as usual, let's check it before removing */ #if X_BYTE_ORDER == X_BIG_ENDIAN + *dst = V[0] + (Y[1] << 8) + (U[0] << 16) + (Y[0] << 24); +#else + *dst = Y[0] + (U[0] << 8) + (Y[1] << 16) + (V[0] << 24); +#endif + if (x == w>>1) { U -= w>>1; V -= w>>1; } + if (x == w) x = 0; + } + } +} +static void +HWCopyFlat(PortPrivPtr pPPriv, CARD8 *src, int w, int h) +{ + AdaptorPrivPtr pAPriv = pPPriv->pAdaptor; + ScrnInfoPtr pScrn = pAPriv->pScrn; + GLINTPtr pGlint = GLINTPTR(pScrn); + int size = w * h; + int pitch = pScrn->displayWidth<<pPPriv->FB_Shift; + CARD32 *dst; + CARD8 *tmp_src; + int dwords, i; + if (w == pitch) { + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "HWCopyFlat : src = %08x, w = pitch = %d, h = %d.\n", + src, w, h)); + dwords = size >> pPPriv->Video_Shift; + while (dwords >= pGlint->FIFOSize) { + dst = (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4); + GLINT_WAIT(pGlint->FIFOSize); + GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x15 << 4) | + 0x05, OutputFIFO); + for (i = pGlint->FIFOSize - 1; i; i--, dst++, src++) *dst = *src; + dwords -= pGlint->FIFOSize - 1; + } + if (dwords) { + dst = (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4); + GLINT_WAIT(dwords + 1); + GLINT_WRITE_REG(((dwords - 1) << 16) | (0x15 << 4) | + 0x05, OutputFIFO); + for (i = dwords; i; i--, dst++, src++) *dst = *src; + } + } else { + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "HWCopyFlat : src = %08x, w = %d, pitch = %d, h = %d.\n", + src, w, pitch, h)); + while (h) { + tmp_src = src; + dwords = w >> pPPriv->Video_Shift; + while (dwords >= pGlint->FIFOSize) { + dst = (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4); + GLINT_WAIT(pGlint->FIFOSize); + GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | (0x15 << 4) | + 0x05, OutputFIFO); + for (i = pGlint->FIFOSize - 1; i; i--, dst++, src++) *dst = *src; + dwords -= pGlint->FIFOSize - 1; + } + if (dwords) { + dst = (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4); + GLINT_WAIT(dwords + 1); + GLINT_WRITE_REG(((dwords - 1) << 16) | (0x15 << 4) | + 0x05, OutputFIFO); + for (i = dwords; i; i--, dst++, src++) *dst = *src; + } + src = tmp_src + pitch; + } + } +} +#else static void -CopyYV12BE(CARD8 *Y, CARD32 *dst, int width, int height, int pitch) +CopyYV12(CARD8 *Y, CARD32 *dst, int width, int height, int pitch) { int Y_size = width * height; CARD8 *V = Y + Y_size; @@ -406,18 +543,24 @@ CopyYV12BE(CARD8 *Y, CARD32 *dst, int width, int height, int pitch) for (height >>= 1; height > 0; height--) { for (x = 0; x < width; Y += 2, x++) +#if X_BYTE_ORDER == X_BIG_ENDIAN *dst++ = V[x] + (Y[1] << 8) + (U[x] << 16) + (Y[0] << 24); +#else + *dst++ = Y[0] + (U[x] << 8) + (Y[1] << 16) + (V[x] << 24); +#endif dst += pad; for (x = 0; x < width; Y += 2, x++) +#if X_BYTE_ORDER == X_BIG_ENDIAN *dst++ = V[x] + (Y[1] << 8) + (U[x] << 16) + (Y[0] << 24); +#else + *dst++ = Y[0] + (U[x] << 8) + (Y[1] << 16) + (V[x] << 24); +#endif dst += pad; U += width; V += width; } } -#endif /* X_BYTE_ORDER == X_BIG_ENDIAN */ - static void CopyFlat(CARD8 *src, CARD8 *dst, int width, int height, int pitch) { @@ -433,6 +576,7 @@ CopyFlat(CARD8 *src, CARD8 *dst, int width, int height, int pitch) height--; } } +#endif #define FORMAT_RGB8888 PM3VideoOverlayMode_COLORFORMAT_RGB8888 #define FORMAT_RGB4444 PM3VideoOverlayMode_COLORFORMAT_RGB4444 @@ -463,6 +607,9 @@ do{ \ mem_barrier(); \ }while(0) +#define RAMDAC_WRITE_OLD(data,index) \ + Permedia2vOutIndReg(pScrn, index, 0x00, data) + /* Notice, have to check that we dont overflow the deltas here ... */ static void compute_scale_factor( @@ -487,33 +634,8 @@ compute_scale_factor( } } -/* Some thougth about clipping : - * - * To support clipping, we will need to : - * - We need to convert the clipregion to a bounding box - * and a bitmap that is the mask associated with the clipregion. - * - Load this bitmap to offscreen memory. - * - Copy/expand this bitmap to the needed area, masking only the alpha - * channel of the framebuffer. - * - Use either the alpha blended or framebuffer alpha keyed overlay mode to - * mask the clipped away region. - * - If the clip region gets changed, we have to upload a new clip mask, - * clear the old alpha mask in the framebuffer and copy the new clip mask - * to the framebuffer again. - * - If the position of the region get's changed (but not the clip mask) we - * need to clear the old frambuffer clip mask in the alpha channel and - * upload the new one. - * - * All this will only work if : - * - * 1) we are using an framebuffer format with an alpha channel, that is - * RGBA 8888 (depth 24) and RGBA 5551 (depth 15). - * 2) nobody else uses the alpha channel. - * - */ - static void -BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent) +BeginOverlay(PortPrivPtr pPPriv, int display) { AdaptorPrivPtr pAPriv = pPPriv->pAdaptor; ScrnInfoPtr pScrn = pAPriv->pScrn; @@ -523,10 +645,13 @@ BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent) unsigned int src_w = pPPriv->vw, dst_w = pPPriv->dw; unsigned int src_h = pPPriv->vh, dst_h = pPPriv->dh; unsigned int shrink_delta, zoom_delta; +#if BLACKNESS_WORKAROUND + static int Frames = 50; +#endif + unsigned int stride = + (pScrn->displayWidth << pPPriv->FB_Shift) >> pPPriv->Video_Shift; - /* Let's overlay only to visible parts of the screen - * Note : this has no place here, and will not work if - * clipping is not supported, since Xv will not show this. */ + /* Let's overlay only to visible parts of the screen */ if (pPPriv->dx < pScrn->frameX0) { dst_w = dst_w - pScrn->frameX0 + dst_x; dst_x = 0; @@ -554,7 +679,13 @@ BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent) * the Permedia3 overlay unit requirement, and compute the X deltas. */ compute_scale_factor(&src_w, &dst_w, &shrink_delta, &zoom_delta); - DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "BeginOverlay\n")); +#if BLACKNESS_WORKAROUND + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "BeginOverlay %d (buffer %d)\n", Frames, display)); +#else + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "BeginOverlay (buffer %d)\n", display)); +#endif if (src_w != pPPriv->vw) DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "BeginOverlay : Padding video width to 4 pixels %d->%d.\n", @@ -562,17 +693,45 @@ BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent) if (dst_w != pPPriv->dw) DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "BeginOverlay : Scaling destination width from %d to %d.\n" - "\tThe scaling factor is to high, and may cause problems.", + "\tThe scaling factor is to high, and may cause problems.\n", pPPriv->dw, dst_w)); if (display != -1) pPPriv->display = display; - GLINT_WAIT(12); + +#if BLACKNESS_WORKAROUND + if (++Frames>25) { + Frames = 0; + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "Registers (1) : %08x, %08x, %08x, %08x, %08x.\n", + GLINT_READ_REG(PM3VideoOverlayFifoControl), + GLINT_READ_REG(PM3VideoOverlayMode), + GLINT_READ_REG(PM3VideoOverlayBase0), + GLINT_READ_REG(PM3VideoOverlayBase1), + GLINT_READ_REG(PM3VideoOverlayBase2))); + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "Registers (2) : %08x, %08x, %08x, %08x.\n", + GLINT_READ_REG(PM3VideoOverlayStride), + GLINT_READ_REG(PM3VideoOverlayWidth), + GLINT_READ_REG(PM3VideoOverlayHeight), + GLINT_READ_REG(PM3VideoOverlayOrigin))); + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "Registers (3) : %08x, %08x, %08x, %08x.\n", + GLINT_READ_REG(PM3VideoOverlayYDelta), + GLINT_READ_REG(PM3VideoOverlayShrinkXDelta), + GLINT_READ_REG(PM3VideoOverlayZoomXDelta), + GLINT_READ_REG(PM3VideoOverlayIndex))); + GLINT_WAIT(8); + GLINT_WRITE_REG(PM3VideoOverlayMode_DISABLE, + PM3VideoOverlayMode); + } else GLINT_WAIT(7); +#else + GLINT_WAIT(7); +#endif GLINT_WRITE_REG(3|(12<<16), PM3VideoOverlayFifoControl); /* Updating the Video Overlay Source Image Parameters */ GLINT_WRITE_REG( - GET_OFFSET(pScrn, pPPriv->Buffer[pPPriv->display]->offset)>>bpp_shift, + pPPriv->BufferBase[pPPriv->display]>>pPPriv->Video_Shift, PM3VideoOverlayBase+(pPPriv->display*8)); - GLINT_WRITE_REG(pPPriv->display, PM3VideoOverlayIndex); GLINT_WRITE_REG(pPPriv->Format | PM3VideoOverlayMode_BUFFERSYNC_MANUAL | PM3VideoOverlayMode_FLIP_VIDEO | @@ -581,7 +740,7 @@ BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent) PM3VideoOverlayMode_ENABLE, PM3VideoOverlayMode); /* Let's set the source stride. */ - GLINT_WRITE_REG(PM3VideoOverlayStride_STRIDE(pPPriv->OverlayStride), + GLINT_WRITE_REG(PM3VideoOverlayStride_STRIDE(stride), PM3VideoOverlayStride); /* Let's set the position and size of the visible part of the source. */ GLINT_WRITE_REG(PM3VideoOverlayWidth_WIDTH(src_w), @@ -592,6 +751,8 @@ BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent) PM3VideoOverlayOrigin_XORIGIN(src_x) | PM3VideoOverlayOrigin_YORIGIN(src_y), PM3VideoOverlayOrigin); + + GLINT_WAIT(5); /* Scale the source to the destinationsize */ if (src_h == dst_h) { GLINT_WRITE_REG( @@ -604,50 +765,150 @@ BeginOverlay(PortPrivPtr pPPriv, int display, int bpp_shift, BoxPtr extent) } GLINT_WRITE_REG(shrink_delta, PM3VideoOverlayShrinkXDelta); GLINT_WRITE_REG(zoom_delta, PM3VideoOverlayZoomXDelta); - /* Launch the true update at the next FrameBlank */ + GLINT_WRITE_REG(pPPriv->display, PM3VideoOverlayIndex); GLINT_WRITE_REG(PM3VideoOverlayUpdate_ENABLE, PM3VideoOverlayUpdate); - /* Setting the ramdac video overlay rgion */ - /* Begining of overlay region */ - RAMDAC_WRITE((dst_x&0xff), PM3RD_VideoOverlayXStartLow); - RAMDAC_WRITE((dst_x&0xf00)>>8, PM3RD_VideoOverlayXStartHigh); - RAMDAC_WRITE((dst_y&0xff), PM3RD_VideoOverlayYStartLow); - RAMDAC_WRITE((dst_y&0xf00)>>8, PM3RD_VideoOverlayYStartHigh); - /* End of overlay regions (+1) */ - RAMDAC_WRITE(((dst_x+dst_w)&0xff), PM3RD_VideoOverlayXEndLow); - RAMDAC_WRITE(((dst_x+dst_w)&0xf00)>>8,PM3RD_VideoOverlayXEndHigh); - RAMDAC_WRITE(((dst_y+dst_h)&0xff), PM3RD_VideoOverlayYEndLow); - RAMDAC_WRITE(((dst_y+dst_h)&0xf00)>>8,PM3RD_VideoOverlayYEndHigh); + + + /* Now set the ramdac video overlay region and mode */ + if ((pPPriv->ramdac_x != dst_x) || (pPPriv->ramdac_w != dst_w)) { + RAMDAC_WRITE((dst_x&0xff), PM3RD_VideoOverlayXStartLow); + RAMDAC_WRITE((dst_x&0xf00)>>8, PM3RD_VideoOverlayXStartHigh); + RAMDAC_WRITE(((dst_x+dst_w)&0xff), PM3RD_VideoOverlayXEndLow); + RAMDAC_WRITE(((dst_x+dst_w)&0xf00)>>8,PM3RD_VideoOverlayXEndHigh); + pPPriv->ramdac_x = dst_x; + pPPriv->ramdac_w = dst_w; + } + if ((pPPriv->ramdac_y != dst_y) || (pPPriv->ramdac_h != dst_h)) { + RAMDAC_WRITE((dst_y&0xff), PM3RD_VideoOverlayYStartLow); + RAMDAC_WRITE((dst_y&0xf00)>>8, PM3RD_VideoOverlayYStartHigh); + RAMDAC_WRITE(((dst_y+dst_h)&0xff), PM3RD_VideoOverlayYEndLow); + RAMDAC_WRITE(((dst_y+dst_h)&0xf00)>>8,PM3RD_VideoOverlayYEndHigh); + pPPriv->ramdac_y = dst_y; + pPPriv->ramdac_h = dst_h; + } - switch (pPPriv->OverlayData) { - case OVERLAY_DATA_COLORKEY : - RAMDAC_WRITE(((pPPriv->OverlayControl>>8)&0xff), - PM3RD_VideoOverlayKeyR); - RAMDAC_WRITE(((pPPriv->OverlayControl>>16)&0xff), - PM3RD_VideoOverlayKeyG); - RAMDAC_WRITE(((pPPriv->OverlayControl>>24)&0xff), - PM3RD_VideoOverlayKeyB); - break; - case OVERLAY_DATA_ALPHAKEY : - RAMDAC_WRITE(((pPPriv->OverlayControl>>8)&0xff), - PM3RD_VideoOverlayKeyR); - break; - case OVERLAY_DATA_ALPHABLEND : - RAMDAC_WRITE(((pPPriv->OverlayControl>>8)&0xff), - PM3RD_VideoOverlayBlend); - break; + if (!pPPriv->ramdac_on) { + if (pPPriv->OverlayAlpha<(3<<6)) { + RAMDAC_WRITE(pPPriv->OverlayAlpha, PM3RD_VideoOverlayBlend); + RAMDAC_WRITE(PM3RD_VideoOverlayControl_ENABLE | + PM3RD_VideoOverlayControl_MODE_BLEND | + PM3RD_VideoOverlayControl_BLENDSRC_REGISTER, + PM3RD_VideoOverlayControl); + } else { +#if SUPPORT_CLIPPING + switch (pScrn->depth) { + case 8: + case 16: + RAMDAC_WRITE((pPPriv->ColorKey&0xff0000)>>16, + PM3RD_VideoOverlayKeyR); + RAMDAC_WRITE((pPPriv->ColorKey&0x00ff00)>>8, + PM3RD_VideoOverlayKeyG); + RAMDAC_WRITE(pPPriv->ColorKey&0x0000ff, + PM3RD_VideoOverlayKeyB); + RAMDAC_WRITE(PM3RD_VideoOverlayControl_ENABLE | + PM3RD_VideoOverlayControl_MODE_MAINKEY | + PM3RD_VideoOverlayControl_KEY_COLOR, + PM3RD_VideoOverlayControl); + break; + case 15: + RAMDAC_WRITE(0x1, PM3RD_VideoOverlayKeyR); + RAMDAC_WRITE(PM3RD_VideoOverlayControl_ENABLE | + PM3RD_VideoOverlayControl_MODE_MAINKEY | + PM3RD_VideoOverlayControl_KEY_ALPHA, + PM3RD_VideoOverlayControl); + break; + case 24: + RAMDAC_WRITE(0xff, PM3RD_VideoOverlayKeyR); + RAMDAC_WRITE(PM3RD_VideoOverlayControl_ENABLE | + PM3RD_VideoOverlayControl_MODE_MAINKEY | + PM3RD_VideoOverlayControl_KEY_ALPHA, + PM3RD_VideoOverlayControl); + break; + } +#else + RAMDAC_WRITE(PM3RD_VideoOverlayControl_ENABLE | + PM3RD_VideoOverlayControl_MODE_ALWAYS, + PM3RD_VideoOverlayControl); +#endif + } + pPPriv->ramdac_on = TRUE; } - /* And now enable Video Overlay in the RAMDAC */ - RAMDAC_WRITE(PM3RD_VideoOverlayControl_ENABLE | - /* OverlayMode attribute */ - (pPPriv->OverlayControl&0xff), - PM3RD_VideoOverlayControl); - - pPPriv->Buffer[pPPriv->display]->RemoveLinearCallback = - RemoveAreaCallback; + + pPPriv->Buffer[pPPriv->display]->RemoveAreaCallback = + RemoveBufferCallback; if (display != -1) pPPriv->copy = -1; } +#if SUPPORT_CLIPPING + +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; +} +static void Clip (PortPrivPtr pPPriv, RegionPtr clipBoxes) +{ + AdaptorPrivPtr pAPriv = pPPriv->pAdaptor; + ScrnInfoPtr pScrn = pAPriv->pScrn; + + /* Let's handle the clipping here. */ + if(!RegionsEqual(&pPPriv->clip, clipBoxes)) { + REGION_COPY(pScrn->pScreen, &pPPriv->clip, clipBoxes); + if (pPPriv->OverlayAlpha<(3<<6)) { + XAAFillSolidRects(pScrn, pPPriv->OverlayAlpha<<24, GXcopy, + 0xff000000, REGION_NUM_RECTS(clipBoxes), + REGION_RECTS(clipBoxes)); + } else { + switch (pScrn->depth) { + case 8: /* CI8 */ + XAAFillSolidRects(pScrn, pPPriv->ColorKey, + GXcopy, 0xffffffff, REGION_NUM_RECTS(clipBoxes), + REGION_RECTS(clipBoxes)); + break; + case 15: /* RGB5551 */ + XAAFillSolidRects(pScrn, 0xffffffff, GXcopy, 0x80008000, + REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes)); + break; + case 16: /* RGB565 */ + XAAFillSolidRects(pScrn, pPPriv->ColorKey, GXcopy, + 0xffffffff, REGION_NUM_RECTS(clipBoxes), + REGION_RECTS(clipBoxes)); + break; + case 24: /* RGB8888 */ + XAAFillSolidRects(pScrn, 0xffffffff, GXcopy, + 0xff000000, REGION_NUM_RECTS(clipBoxes), + REGION_RECTS(clipBoxes)); + break; + } + } + } +} +#endif + static void StopOverlay(PortPrivPtr pPPriv, int cleanup) { @@ -657,38 +918,42 @@ StopOverlay(PortPrivPtr pPPriv, int cleanup) DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "StopOverlay.\n")); /* Stop the Video Overlay in the RAMDAC */ - RAMDAC_WRITE(PM3RD_VideoOverlayControl_DISABLE, - PM3RD_VideoOverlayControl); + if (pPPriv->ramdac_on) { + RAMDAC_WRITE(PM3RD_VideoOverlayControl_DISABLE, + PM3RD_VideoOverlayControl); + pPPriv->ramdac_on = FALSE; + } /* Stop the Video Overlay in the Video Overlay Unit */ GLINT_WAIT(1); GLINT_WRITE_REG(PM3VideoOverlayMode_DISABLE, PM3VideoOverlayMode); } -/* ReputImage may be used if only the position of the destination changes, - * maybe while moving the window around or something such. - */ +/* ReputImage is used if only the destination position or + * the clipboxes change. */ static int Permedia3ReputImage(ScrnInfoPtr pScrn, short drw_x, short drw_y, RegionPtr clipBoxes, pointer data) { PortPrivPtr pPPriv = (PortPrivPtr) data; - GLINTPtr pGlint = GLINTPTR(pScrn); - BoxPtr extent; DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "ReputImage %d,%d.\n", drw_x, drw_y)); - /* If the buffer was freed, we cannot overlay it. */ - if (pPPriv->display == -1) { + +#if !SUPPORT_CLIPPING + /* If the clip region is not a rectangle */ + if (REGION_SIZE(clipBoxes) != 0) { StopOverlay (pPPriv, FALSE); return Success; } - if (REGION_SIZE(clipBoxes) != 0) { - /* We need to transform the clipBoxes into a bitmap, - * and upload it to offscreen memory. */ +#endif + + /* If the buffer was freed, we cannot overlay it. */ + if (pPPriv->display == -1) { StopOverlay (pPPriv, FALSE); return Success; } + /* Check that the dst area is some part of the visible screen. */ if ((drw_x + pPPriv->dw) < pScrn->frameX0 || (drw_y + pPPriv->dh) < pScrn->frameY0 || @@ -699,16 +964,13 @@ Permedia3ReputImage(ScrnInfoPtr pScrn, pPPriv->dx = drw_x; pPPriv->dy = drw_y; - /* We sync the chip. */ - if (pGlint->MultiAperture) DualPermedia3Sync(pScrn); - else Permedia3Sync(pScrn); - - extent = REGION_EXTENTS(pScrn, clipBoxes); - BeginOverlay(pPPriv, -1, pPPriv->Bpp_shift, extent); +#if SUPPORT_CLIPPING + /* Clipping */ + Clip (pPPriv, clipBoxes); +#endif - /* We sync the chip. */ - if (pGlint->MultiAperture) DualPermedia3Sync(pScrn); - else Permedia3Sync(pScrn); + /* Restart the overlay */ + BeginOverlay(pPPriv, -1); return Success; } @@ -721,10 +983,12 @@ Permedia3PutImage(ScrnInfoPtr pScrn, Bool sync, RegionPtr clipBoxes, pointer data) { PortPrivPtr pPPriv = (PortPrivPtr) data; +#if !USE_HARDWARE_COPY GLINTPtr pGlint = GLINTPTR(pScrn); +#endif int copy = -1; - BoxPtr extent; - BoxRec ext; + Bool copy_flat = TRUE; + int w_bpp; DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "PutImage %d,%d,%d,%d -> %d,%d,%d,%d " @@ -732,20 +996,27 @@ Permedia3PutImage(ScrnInfoPtr pScrn, src_x, src_y, src_w, src_h, drw_x, drw_y, drw_w, drw_h, id, buf, width, height, sync)); - extent = REGION_EXTENTS(pScrn, clipBoxes); - ext = *extent; - if (REGION_SIZE(clipBoxes) != 0) return Success; +#if !SUPPORT_CLIPPING + /* If the clip region is not a rectangle */ + if (REGION_SIZE(clipBoxes) != 0) { + StopOverlay (pPPriv, FALSE); + return Success; + } +#endif /* Check that the src area to put is included in the buffer. */ if ((src_x + src_w) > width || (src_y + src_h) > height || - src_x < 0 || src_y < 0) + src_x < 0 || src_y < 0) { + StopOverlay(pPPriv, FALSE); return BadValue; + } /* Check that the dst area is some part of the visible screen. */ if ((drw_x + drw_w) < pScrn->frameX0 || (drw_y + drw_h) < pScrn->frameY0 || drw_x > pScrn->frameX1 || drw_y > pScrn->frameY1) { + StopOverlay(pPPriv, FALSE); return Success; } @@ -771,176 +1042,119 @@ Permedia3PutImage(ScrnInfoPtr pScrn, if (i >= ENTRIES(ScalerImages)) return XvBadAlloc; pPPriv->Id = id; - pPPriv->Bpp = ScalerImages[i].bits_per_pixel; } - /* We sync the chip. I don't know if it is really - * needed but X crashed when i didn't do it. */ - if (pGlint->MultiAperture) DualPermedia3Sync(pScrn); - else Permedia3Sync(pScrn); - - /* Let's define the different strides values */ - pPPriv->OverlayStride = width; - pPPriv->BufferStride = ((pPPriv->Bpp+7)>>3) * width; + /* Let's find the image format and Video_Shift values */ + switch (id) { + case LE4CC('Y','V','1','2'): + pPPriv->Format = FORMAT_YUV422; + pPPriv->Video_Shift = 1; + copy_flat = FALSE; + break; + case LE4CC('Y','U','Y','2'): + pPPriv->Format = FORMAT_YUV422; + pPPriv->Video_Shift = 1; + break; + case LE4CC('U','Y','V','Y'): + pPPriv->Format = FORMAT_VUY422; + pPPriv->Video_Shift = 1; + break; + case LE4CC('Y','U','V','A'): + pPPriv->Format = FORMAT_YUV444; + pPPriv->Video_Shift = 2; + break; + case LE4CC('V','U','Y','A'): + pPPriv->Format = FORMAT_VUY444; + pPPriv->Video_Shift = 2; + break; + case 0x41: /* RGBA 8:8:8:8 */ + pPPriv->Format = FORMAT_RGB8888; + pPPriv->Video_Shift = 2; + break; + case 0x42: /* RGB 5:6:5 */ + pPPriv->Format = FORMAT_RGB565; + pPPriv->Video_Shift = 1; + break; + case 0x43: /* RGB 1:5:5:5 */ + pPPriv->Format = FORMAT_RGB5551; + pPPriv->Video_Shift = 1; + break; + case 0x44: /* RGB 4:4:4:4 */ + pPPriv->Format = FORMAT_RGB4444; + pPPriv->Video_Shift = 1; + break; + case 0x46: /* RGB 2:3:3 */ + pPPriv->Format = FORMAT_RGB332; + pPPriv->Video_Shift = 0; + break; + case 0x47: /* BGRA 8:8:8:8 */ + pPPriv->Format = FORMAT_BGR8888; + pPPriv->Video_Shift = 2; + break; + case 0x48: /* BGR 5:6:5 */ + pPPriv->Format = FORMAT_BGR565; + pPPriv->Video_Shift = 1; + break; + case 0x49: /* BGR 1:5:5:5 */ + pPPriv->Format = FORMAT_BGR5551; + pPPriv->Video_Shift = 1; + break; + case 0x4A: /* BGR 4:4:4:4 */ + pPPriv->Format = FORMAT_BGR4444; + pPPriv->Video_Shift = 1; + break; + case 0x4C: /* BGR 2:3:3 */ + pPPriv->Format = FORMAT_BGR332; + pPPriv->Video_Shift = 0; + break; + default: + return XvBadAlloc; + } /* Now we allocate a buffer, if it is needed */ - if ((copy = AllocateBuffers(pPPriv, pPPriv->BufferStride, height)) == -1) + w_bpp = (width << pPPriv->Video_Shift) >> pPPriv->FB_Shift; + if ((copy = AllocateBuffers(pPPriv, w_bpp, height)) == -1) return XvBadAlloc; - /* Now, we can copy the image to the buffer */ - switch (id) { - case LE4CC('Y','V','1','2'): -#if X_BYTE_ORDER == X_LITTLE_ENDIAN - CopyYV12LE(buf, - (CARD32 *)((CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset)), - width, height, pPPriv->BufferStride); + /* Let's copy the image to the framebuffer */ +#if USE_HARDWARE_COPY + /* Erm, ... removing this log message will make the server crash. */ + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "Hardware image upload.\n")); + HWCopySetup(pPPriv, pPPriv->Buffer[copy]->box.x1, + pPPriv->Buffer[copy]->box.y1, w_bpp, height); + if (copy_flat) HWCopyFlat(pPPriv, buf, width, height); + else HWCopyYV12(pPPriv, buf, width, height); #else - if (pGlint->FBDev) - CopyYV12LE(buf, - (CARD32 *)((CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset)), - width, height, pPPriv->BufferStride); - else - CopyYV12BE(buf, - (CARD32 *)((CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset)), - width, height, pPPriv->BufferStride); + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "Software image upload (1).\n")); + pPPriv->Sync(pScrn); + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "Software image upload (2).\n")); + if (copy_flat) CopyFlat(buf, + (CARD8 *) pGlint->FbBase + pPPriv->BufferBase[copy], + width << pPPriv->FB_Shift, height, + pScrn->displayWidth << pPPriv->FB_Shift); + else CopyYV12(buf, + (CARD32 *)((CARD8 *) pGlint->FbBase + pPPriv->BufferBase[copy]), + width, height, pScrn->displayWidth << pPPriv->FB_Shift); + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "Software image upload (3).\n")); + pPPriv->Sync(pScrn); + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, + "Software image upload (4).\n")); #endif - pPPriv->Format = FORMAT_YUV422; - pPPriv->Bpp_shift = 1; - break; - case LE4CC('Y','U','Y','2'): - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width << 1, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_YUV422; - pPPriv->Bpp_shift = 1; - break; - - case LE4CC('U','Y','V','Y'): - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width << 1, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_VUY422; - pPPriv->Bpp_shift = 1; - break; - - case LE4CC('Y','U','V','A'): - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width << 2, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_YUV444; - pPPriv->Bpp_shift = 2; - break; - - case LE4CC('V','U','Y','A'): - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width << 2, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_VUY444; - pPPriv->Bpp_shift = 2; - break; - - case 0x41: /* RGBA 8:8:8:8 */ - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width << 2, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_RGB8888; - pPPriv->Bpp_shift = 2; - break; - - case 0x42: /* RGB 5:6:5 */ - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width << 1, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_RGB565; - pPPriv->Bpp_shift = 1; - break; - - case 0x43: /* RGB 1:5:5:5 */ - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width << 1, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_RGB5551; - pPPriv->Bpp_shift = 1; - break; - - case 0x44: /* RGB 4:4:4:4 */ - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width << 1, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_RGB4444; - pPPriv->Bpp_shift = 1; - break; - - case 0x46: /* RGB 2:3:3 */ - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_RGB332; - pPPriv->Bpp_shift = 0; - break; - - case 0x47: /* BGRA 8:8:8:8 */ - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width << 2, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_BGR8888; - pPPriv->Bpp_shift = 2; - break; - - case 0x48: /* BGR 5:6:5 */ - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width << 1, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_BGR565; - pPPriv->Bpp_shift = 1; - break; - - case 0x49: /* BGR 1:5:5:5 */ - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width << 1, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_BGR5551; - pPPriv->Bpp_shift = 1; - break; - - case 0x4A: /* BGR 4:4:4:4 */ - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width << 1, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_BGR4444; - pPPriv->Bpp_shift = 1; - break; - - case 0x4C: /* BGR 2:3:3 */ - CopyFlat(buf, (CARD8 *) pGlint->FbBase + - GET_OFFSET(pScrn, pPPriv->Buffer[copy]->offset), - width << 0, height, pPPriv->BufferStride); - pPPriv->Format = FORMAT_BGR332; - pPPriv->Bpp_shift = 0; - break; - default: - return XvBadAlloc; - } - /* We sync the chip. */ - if (pGlint->MultiAperture) DualPermedia3Sync(pScrn); - else Permedia3Sync(pScrn); - /* Don't know why we need this, - * but the server will crash if i remove it. */ - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, - "Starting the overlay.\n"); +#if SUPPORT_CLIPPING + /* Clipping*/ + Clip (pPPriv, clipBoxes); +#endif /* We start the overlay */ - BeginOverlay(pPPriv, copy, pPPriv->Bpp_shift, extent); + BeginOverlay(pPPriv, copy); - /* We sync the chip again. */ - if (sync) { - if (pGlint->MultiAperture) DualPermedia3Sync(pScrn); - else Permedia3Sync(pScrn); - } + /* We sync the chip again (if needed). */ + if (sync) pPPriv->Sync(pScrn); return Success; } @@ -953,6 +1167,7 @@ Permedia3StopVideo(ScrnInfoPtr pScrn, pointer data, Bool cleanup) DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, "StopVideo : exit=%d\n", cleanup)); + REGION_EMPTY(pScrn->pScreen, &pPPriv->clip); StopOverlay(pPPriv, cleanup); if (cleanup) { @@ -966,7 +1181,6 @@ Permedia3SetPortAttribute(ScrnInfoPtr pScrn, { PortPrivPtr pPPriv = (PortPrivPtr) data; - /* Note, we could decode and store attributes directly here */ if (attribute == xvFilter) { switch (value) { case 0: /* No Filtering */ @@ -975,17 +1189,20 @@ Permedia3SetPortAttribute(ScrnInfoPtr pScrn, ~PM3VideoOverlayMode_FILTER_MASK) | PM3VideoOverlayMode_FILTER_OFF; break; - case 1: /* No Filtering */ + case 1: /* Partial Filtering (X axis only) */ pPPriv->OverlayMode = (pPPriv->OverlayMode & ~PM3VideoOverlayMode_FILTER_MASK) | PM3VideoOverlayMode_FILTER_PARTIAL; break; - case 2: /* No Filtering */ + case 2: /* Full Bilinear Filtering */ + /* We have to disable X mirroring also */ pPPriv->OverlayMode = (pPPriv->OverlayMode & - ~PM3VideoOverlayMode_FILTER_MASK) | + ~(PM3VideoOverlayMode_FILTER_MASK | + PM3VideoOverlayMode_MIRRORX_ON)) | PM3VideoOverlayMode_FILTER_FULL; + pPPriv->Attribute[1] &= 2; break; default: return BadValue; @@ -1002,11 +1219,23 @@ Permedia3SetPortAttribute(ScrnInfoPtr pScrn, PM3VideoOverlayMode_MIRRORY_OFF; break; case 1: /* X Axis Mirroring */ - pPPriv->OverlayMode = - (pPPriv->OverlayMode & - ~PM3VideoOverlayMode_MIRROR_MASK) | - PM3VideoOverlayMode_MIRRORX_ON | - PM3VideoOverlayMode_MIRRORY_OFF; + /* If full filtering was enabled, rever to partial. */ + if (pPPriv->Attribute[0] == 2) { + pPPriv->OverlayMode = + (pPPriv->OverlayMode & + ~(PM3VideoOverlayMode_MIRROR_MASK | + PM3VideoOverlayMode_FILTER_MASK)) | + PM3VideoOverlayMode_MIRRORX_ON | + PM3VideoOverlayMode_MIRRORY_OFF | + PM3VideoOverlayMode_FILTER_PARTIAL; + pPPriv->Attribute[0] = 1; + } else { + pPPriv->OverlayMode = + (pPPriv->OverlayMode & + ~PM3VideoOverlayMode_MIRROR_MASK) | + PM3VideoOverlayMode_MIRRORX_ON | + PM3VideoOverlayMode_MIRRORY_OFF; + } break; case 2: /* Y Axis Mirroring */ pPPriv->OverlayMode = @@ -1016,73 +1245,33 @@ Permedia3SetPortAttribute(ScrnInfoPtr pScrn, PM3VideoOverlayMode_MIRRORY_ON; break; case 3: /* X and Y Axis Mirroring */ - pPPriv->OverlayMode = - (pPPriv->OverlayMode & - ~PM3VideoOverlayMode_MIRROR_MASK) | - PM3VideoOverlayMode_MIRRORX_ON | - PM3VideoOverlayMode_MIRRORY_ON; + /* If full filtering was enabled, rever to partial. */ + if (pPPriv->Attribute[0] == 2) { + pPPriv->OverlayMode = + (pPPriv->OverlayMode & + ~(PM3VideoOverlayMode_MIRROR_MASK | + PM3VideoOverlayMode_FILTER_MASK)) | + PM3VideoOverlayMode_MIRRORX_ON | + PM3VideoOverlayMode_MIRRORY_ON | + PM3VideoOverlayMode_FILTER_PARTIAL; + pPPriv->Attribute[0] = 1; + } else { + pPPriv->OverlayMode = + (pPPriv->OverlayMode & + ~PM3VideoOverlayMode_MIRROR_MASK) | + PM3VideoOverlayMode_MIRRORX_ON | + PM3VideoOverlayMode_MIRRORY_ON; + } break; default: return BadValue; } pPPriv->Attribute[1] = value; } - else if (attribute == xvOverlayMode) { - pPPriv->OverlayControl = - PM3RD_VideoOverlayControl_ENABLE; - switch (value&&0xff) { - case 0: /* Opaque video overlay */ - pPPriv->OverlayData = - OVERLAY_DATA_NONE; - pPPriv->OverlayControl = - PM3RD_VideoOverlayControl_MODE_ALWAYS; - break; - case 1: /* Color keyed overlay, framebuffer color key */ - pPPriv->OverlayData = - OVERLAY_DATA_COLORKEY; - pPPriv->OverlayControl = - /* color key in RGB 888 mode */ - ((value<<5)&0xffffff00) | - PM3RD_VideoOverlayControl_MODE_MAINKEY | - PM3RD_VideoOverlayControl_KEY_COLOR; - break; - case 2: /* Color keyed overlay, framebuffer alpha key */ - pPPriv->OverlayData = - OVERLAY_DATA_ALPHAKEY; - pPPriv->OverlayControl = - /* 8 bit alpha key */ - ((value<<5)&0xff00) | - PM3RD_VideoOverlayControl_MODE_MAINKEY | - PM3RD_VideoOverlayControl_KEY_ALPHA; - break; - case 3: /* Color keyed overlay, overlay color key */ - pPPriv->OverlayData = - OVERLAY_DATA_COLORKEY; - pPPriv->OverlayControl = - /* color key in RGB 888 mode */ - ((value<<5)&0xffffff00) | - PM3RD_VideoOverlayControl_MODE_OVERLAYKEY; - break; - case 4: /* Per pixel alpha blending */ - pPPriv->OverlayData = - OVERLAY_DATA_NONE; - pPPriv->OverlayControl = - PM3RD_VideoOverlayControl_MODE_BLEND | - PM3RD_VideoOverlayControl_BLENDSRC_MAIN; - break; - case 5: /* Constant alpha blending */ - pPPriv->OverlayData = - OVERLAY_DATA_ALPHABLEND; - pPPriv->OverlayControl = - /* 8 bit alpha blend factor - * (only the 2 top bits are used) */ - ((value<<5)&0xff00) | - PM3RD_VideoOverlayControl_MODE_BLEND | - PM3RD_VideoOverlayControl_BLENDSRC_REGISTER; - break; - default: - return BadValue; - } + else if (attribute == xvAlpha) { + if (value >= 0 && value <= 3) { + pPPriv->OverlayAlpha = value << 6; + } else return BadValue; pPPriv->Attribute[2] = value; } else return BadMatch; @@ -1104,7 +1293,7 @@ Permedia3GetPortAttribute(ScrnInfoPtr pScrn, *value = pPPriv->Attribute[0]; else if (attribute == xvMirror) *value = pPPriv->Attribute[1]; - else if (attribute == xvOverlayMode) + else if (attribute == xvAlpha) *value = pPPriv->Attribute[2]; else return BadMatch; @@ -1204,6 +1393,7 @@ NewAdaptorPriv(ScrnInfoPtr pScrn) { AdaptorPrivPtr pAPriv = (AdaptorPrivPtr) xcalloc(1, sizeof(AdaptorPrivRec)); PortPrivPtr pPPriv = (PortPrivPtr) xcalloc(1, sizeof(PortPrivRec)); + GLINTPtr pGlint = GLINTPTR(pScrn); int i; if (!pAPriv) return NULL; @@ -1218,23 +1408,41 @@ NewAdaptorPriv(ScrnInfoPtr pScrn) return NULL; } - /* Attributes */ pPPriv->pAdaptor = pAPriv; - pPPriv->Attribute[0] = 0; /* Full filtering enabled */ + /* Sync */ + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 2, + "Sync is using : %sPermedia3Sync.\n", + pGlint->MultiAperture?"Dual":"")); + if (pGlint->MultiAperture) pPPriv->Sync = DualPermedia3Sync; + else pPPriv->Sync = Permedia3Sync; + + /* Framebuffer bpp shift */ + pPPriv->FB_Shift = pScrn->bitsPerPixel >> 4; + + /* Attributes */ + pPPriv->Attribute[0] = 2; /* Full filtering enabled */ pPPriv->Attribute[1] = 0; /* No mirroring */ - pPPriv->Attribute[2] = 0; /* Opaque overlay mode */ - pPPriv->OverlayData = 0; + pPPriv->Attribute[2] = 3; /* Opaque overlay mode */ + pPPriv->ColorKey = 0; + pPPriv->OverlayAlpha = + PM3RD_VideoOverlayBlend_FACTOR_100_PERCENT; pPPriv->OverlayMode = PM3VideoOverlayMode_FILTER_FULL | PM3VideoOverlayMode_MIRRORX_OFF | PM3VideoOverlayMode_MIRRORY_OFF; - pPPriv->OverlayControl = - PM3RD_VideoOverlayControl_ENABLE | - PM3RD_VideoOverlayControl_MODE_ALWAYS; + + /* Clipping */ + REGION_EMPTY(pScrn->pScreen, &pPPriv->clip); + + /* RAMDAC saved values */ + pPPriv->ramdac_x = 0; + pPPriv->ramdac_w = 0; + pPPriv->ramdac_y = 0; + pPPriv->ramdac_h = 0; + pPPriv->ramdac_on = FALSE; /* Buffers */ pPPriv->Id = ScalerImages[0].id; - pPPriv->Bpp = ScalerImages[0].bits_per_pixel; pPPriv->copy = -1; pPPriv->display = -1; for (i = 0; i < MAX_BUFFERS; i++) @@ -1267,10 +1475,15 @@ Permedia3VideoLeaveVT(ScrnInfoPtr pScrn) void Permedia3VideoUninit(ScrnInfoPtr pScrn) { - if (AdaptorPriv->pScrn == pScrn) { - DeleteAdaptorPriv(AdaptorPriv); - AdaptorPriv = NULL; - } + AdaptorPrivPtr pAPriv, *ppAPriv; + + for (ppAPriv = &AdaptorPrivList; (pAPriv = *ppAPriv); ppAPriv = &(pAPriv->Next)) + if (pAPriv->pScrn == pScrn) { + *ppAPriv = pAPriv->Next; + DeleteAdaptorPriv(pAPriv); + break; + } + DEBUG(xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 2, "Xv cleanup\n")); } @@ -1286,9 +1499,15 @@ Permedia3VideoInit(ScreenPtr pScreen) switch (pGlint->Chipset) { case PCI_VENDOR_3DLABS_CHIP_PERMEDIA3: + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 1, + "Using the Permedia3 chipset.\n"); break; case PCI_VENDOR_3DLABS_CHIP_GAMMA: - if (pGlint->MultiChip == PCI_CHIP_PERMEDIA3) break; + if (pGlint->MultiChip == PCI_CHIP_PERMEDIA3) { + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 1, + "Using the Gamma chipset.\n"); + break; + } default: xf86DrvMsgVerb(pScrn->scrnIndex, X_ERROR, 1, "No Xv support for chipset %d.\n", pGlint->Chipset); @@ -1299,14 +1518,9 @@ Permedia3VideoInit(ScreenPtr pScreen) "Initializing Permedia3 Xv driver rev. 1\n"); if (pGlint->NoAccel) { - xf86DrvMsgVerb(pScrn->scrnIndex, X_ERROR, 1, - "Xv : Sorry, Xv is not supported without accelerations"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Xv initialization failed : XAA is needed\n"); return; -#if 0 /* This works, but crashes the X server after a time. */ - xf86DrvMsgVerb(pScrn->scrnIndex, X_ERROR, 1, - "Xv : Acceleration disabled, starting offscreen memory manager\n."); - Permedia3EnableOffscreen (pScreen); -#endif } if (!(pAPriv = NewAdaptorPriv(pScrn))) { @@ -1321,7 +1535,7 @@ Permedia3VideoInit(ScreenPtr pScreen) VARPtrs = &VAR; VAR.type = XvInputMask | XvWindowMask | XvImageMask; - VAR.flags = VIDEO_OVERLAID_IMAGES; + VAR.flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; VAR.name = "Permedia 3 Frontend Scaler"; VAR.nEncodings = ENTRIES(ScalerEncodings); VAR.pEncodings = ScalerEncodings; @@ -1349,12 +1563,15 @@ Permedia3VideoInit(ScreenPtr pScreen) if (xf86XVScreenInit(pScreen, &VARPtrs, 1)) { xvFilter = MAKE_ATOM(XV_FILTER); xvMirror = MAKE_ATOM(XV_MIRROR); - xvOverlayMode = MAKE_ATOM(XV_OVERLAY_MODE); + xvAlpha = MAKE_ATOM(XV_ALPHA); - /* Add it to the AdaptatorList */ - AdaptorPriv = pAPriv; - - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Xv frontend scaler enabled\n"); +#if USE_HARDWARE_COPY + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Xv frontend scaler enabled (HW)\n"); +#else + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Xv frontend scaler enabled (SW)\n"); +#endif } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Xv initialization failed\n"); DeleteAdaptorPriv(pAPriv); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c index d168c1c4b..6f54484b0 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c @@ -28,7 +28,7 @@ * * Permedia accelerated options. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c,v 1.21 2001/01/31 16:15:02 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c,v 1.21.2.2 2001/05/29 11:32:23 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -102,8 +102,6 @@ static void PermediaPolylinesThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC, static void PermediaPolySegmentThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC, int nseg, xSegment *pSeg); -#define MAX_FIFO_ENTRIES 15 - void PermediaInitializeEngine(ScrnInfoPtr pScrn) { @@ -217,8 +215,7 @@ PermediaAccelInit(ScreenPtr pScreen) infoPtr->PolySegmentThinSolid = PermediaPolySegmentThinSolidWrapper; infoPtr->PolylinesThinSolid = PermediaPolylinesThinSolidWrapper; - infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY | - ONLY_LEFT_TO_RIGHT_BITBLT; + infoPtr->ScreenToScreenCopyFlags = NO_TRANSPARENCY; infoPtr->SetupForScreenToScreenCopy = PermediaSetupForScreenToScreenCopy; infoPtr->SubsequentScreenToScreenCopy = PermediaSubsequentScreenToScreenCopy; @@ -240,14 +237,14 @@ PermediaAccelInit(ScreenPtr pScreen) #endif BIT_ORDER_IN_BYTE_LSBFIRST; - pGlint->XAAScanlineColorExpandBuffers[0] = - xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8)); - pGlint->XAAScanlineColorExpandBuffers[1] = - xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8)); - - infoPtr->NumScanlineColorExpandBuffers = 2; + infoPtr->NumScanlineColorExpandBuffers = 1; + pGlint->ScratchBuffer = xalloc(((pScrn->virtualX+62)/32*4) + + (pScrn->virtualX + * pScrn->bitsPerPixel / 8)); infoPtr->ScanlineColorExpandBuffers = pGlint->XAAScanlineColorExpandBuffers; + pGlint->XAAScanlineColorExpandBuffers[0] = + pGlint->IOBase + OutputFIFO + 4; infoPtr->SetupForScanlineCPUToScreenColorExpandFill = PermediaSetupForScanlineCPUToScreenColorExpandFill; @@ -256,7 +253,7 @@ PermediaAccelInit(ScreenPtr pScreen) infoPtr->SubsequentColorExpandScanline = PermediaSubsequentColorExpandScanline; - infoPtr->ColorExpandRange = MAX_FIFO_ENTRIES; + infoPtr->ColorExpandRange = pGlint->FIFOSize; infoPtr->WriteBitmap = PermediaWriteBitmap; @@ -553,15 +550,11 @@ PermediaWriteBitmap(ScrnInfoPtr pScrn, register CARD32* pattern; int dobackground = 0; - skipleft = 0; - w += skipleft; x -= skipleft; dwords = (w + 31) >> 5; -#if 0 PermediaSetClippingRectangle(pScrn, x+skipleft, y, x+w, y+h); -#endif GLINT_WAIT(14); DO_PLANEMASK(planemask); @@ -620,6 +613,7 @@ PermediaWriteBitmap(ScrnInfoPtr pScrn, srcpntr += srcwidth; } + PermediaDisableClipping(pScrn); SET_SYNC_FLAG(infoRec); } @@ -678,50 +672,60 @@ PermediaSubsequentScanlineCPUToScreenColorExpandFill( PermediaSetClippingRectangle(pScrn, x+skipleft, y, x+w, y+h); #endif - pGlint->cpucount = y; - pGlint->cpuheight = h; + pGlint->cpucount = h; - GLINT_WAIT(6); - PermediaLoadCoord(pScrn, x<<16, y<<16, (x+w)<<16, 1, 0, 1<<16); + GLINT_WAIT(8); + PermediaLoadCoord(pScrn, x<<16, y<<16, (x+w)<<16, h, 0, 1<<16); + GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask, + Render); +#if defined(__alpha__) + if (0) /* force Alpha to use indirect always */ +#else + if ((pGlint->dwords*h) < pGlint->FIFOSize) +#endif + { + /* Turn on direct for less than FIFOSize dword colour expansion */ + pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->IOBase+OutputFIFO+4; + pGlint->ScanlineDirect = 1; + GLINT_WRITE_REG(((pGlint->dwords*h)-1)<<16 | 0x0D, OutputFIFO); + GLINT_WAIT(pGlint->dwords*h); + } else { + /* Use indirect for anything else */ + pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->ScratchBuffer; + pGlint->ScanlineDirect = 0; + } + + pGlint->cpucount--; } static void PermediaSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); GLINTPtr pGlint = GLINTPTR(pScrn); - CARD32 *src; + CARD32 *srcp = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno]; int dwords = pGlint->dwords; - GLINT_WAIT(7); - PermediaLoadCoord(pScrn, pGlint->startxdom, pGlint->cpucount<<16, pGlint->startxsub, 1, 0, 1<<16); - - GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask, - Render); - dwords = pGlint->dwords; - - src = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno]; - while (dwords >= infoRec->ColorExpandRange) { - GLINT_WAIT(infoRec->ColorExpandRange); - GLINT_WRITE_REG((infoRec->ColorExpandRange - 2)<<16 | 0x0D, OutputFIFO); - GLINT_MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), - src, infoRec->ColorExpandRange - 1); - dwords -= (infoRec->ColorExpandRange - 1); - src += (infoRec->ColorExpandRange - 1); - } - if (dwords) { - GLINT_WAIT(dwords); - GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO); - GLINT_MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), - src,dwords); + if (!pGlint->ScanlineDirect) { + while(dwords >= pGlint->FIFOSize) { + GLINT_WAIT(pGlint->FIFOSize); + GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | 0x0D, OutputFIFO); + GLINT_MoveDWORDS( + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), + (CARD32*)srcp, pGlint->FIFOSize - 1); + dwords -= pGlint->FIFOSize - 1; + srcp += pGlint->FIFOSize - 1; + } + if(dwords) { + GLINT_WAIT(dwords + 1); + GLINT_WRITE_REG(((dwords - 1) << 16) | 0x0D, OutputFIFO); + GLINT_MoveDWORDS( + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), + (CARD32*)srcp, dwords); + } } - pGlint->cpucount += 1; -#if 0 - if (pGlint->cpucount == (pGlint->cpuheight + 1)) - CHECKCLIPPING; -#endif } + static void PermediaWritePixmap8bpp( ScrnInfoPtr pScrn, diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_dac.c index acc329ef2..35c01c120 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_dac.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/pm_dac.c @@ -27,7 +27,7 @@ * this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen and * Siemens Nixdorf Informationssysteme */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm_dac.c,v 1.9 2001/02/07 13:26:21 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/pm_dac.c,v 1.9.2.1 2001/05/24 20:12:48 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -55,8 +55,8 @@ PermediaInit(ScrnInfoPtr pScrn, DisplayModePtr mode) pReg->glintRegs[PMFramebufferWriteMask >> 3] = 0xFFFFFFFF; pReg->glintRegs[PMBypassWriteMask >> 3] = 0xFFFFFFFF; - pReg->glintRegs[DFIFODis >> 3] = 0; - pReg->glintRegs[FIFODis >> 3] = 1; + pReg->glintRegs[DFIFODis >> 3] = 1; + pReg->glintRegs[FIFODis >> 3] = 3; temp1 = mode->CrtcHSyncStart - mode->CrtcHDisplay; temp2 = mode->CrtcVSyncStart - mode->CrtcVDisplay; @@ -122,6 +122,7 @@ PermediaInit(ScrnInfoPtr pScrn, DisplayModePtr mode) ramdacReg->DacRegs[IBMRGB_misc2] |= PCLK_SEL_LCLK; else ramdacReg->DacRegs[IBMRGB_misc2] |= PCLK_SEL_PLL; + ramdacReg->DacRegs[IBMRGB_misc3] = 0; ramdacReg->DacRegs[IBMRGB_misc_clock] = 1; ramdacReg->DacRegs[IBMRGB_sync] = 0; ramdacReg->DacRegs[IBMRGB_hsync_pos] = 0; @@ -139,6 +140,11 @@ PermediaSave(ScrnInfoPtr pScrn, GLINTRegPtr glintReg) { GLINTPtr pGlint = GLINTPTR(pScrn); + /* We can't rely on the vgahw layer copying the font information + * back properly, due to problems with MMIO access to VGA space + * so we memcpy the information using the slow routines */ + xf86SlowBcopy((CARD8*)pGlint->FbBase, (CARD8*)pGlint->VGAdata, 65536); + glintReg->glintRegs[Aperture0 >> 3] = GLINT_READ_REG(Aperture0); glintReg->glintRegs[Aperture1 >> 3] = GLINT_READ_REG(Aperture1); glintReg->glintRegs[PMFramebufferWriteMask] = @@ -169,6 +175,12 @@ PermediaRestore(ScrnInfoPtr pScrn, GLINTRegPtr pReg) { GLINTPtr pGlint = GLINTPTR(pScrn); + /* We can't rely on the vgahw layer copying the font information + * back properly, due to problems with MMIO access to VGA space + * so we memcpy the information using the slow routines */ + if (pGlint->STATE) + xf86SlowBcopy((CARD8*)pGlint->VGAdata, (CARD8*)pGlint->FbBase, 65536); + RESTOREREG(ChipConfig); RESTOREREG(DFIFODis); RESTOREREG(FIFODis); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c index ed833ea72..26f51107e 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c @@ -28,7 +28,7 @@ * * GLINT 300SX accelerated options. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c,v 1.6 2001/04/19 09:28:32 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c,v 1.6.2.1 2001/05/29 11:32:23 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -215,14 +215,14 @@ SXAccelInit(ScreenPtr pScreen) TRANSPARENCY_ONLY | BIT_ORDER_IN_BYTE_LSBFIRST; - pGlint->XAAScanlineColorExpandBuffers[0] = - xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8)); - pGlint->XAAScanlineColorExpandBuffers[1] = - xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8)); - - infoPtr->NumScanlineColorExpandBuffers = 2; + infoPtr->NumScanlineColorExpandBuffers = 1; + pGlint->ScratchBuffer = xalloc(((pScrn->virtualX+62)/32*4) + + (pScrn->virtualX + * pScrn->bitsPerPixel / 8)); infoPtr->ScanlineColorExpandBuffers = pGlint->XAAScanlineColorExpandBuffers; + pGlint->XAAScanlineColorExpandBuffers[0] = + pGlint->IOBase + OutputFIFO + 4; infoPtr->SetupForScanlineCPUToScreenColorExpandFill = SXSetupForScanlineCPUToScreenColorExpandFill; @@ -244,6 +244,8 @@ SXAccelInit(ScreenPtr pScreen) AvailFBArea.y2 = memory / (pScrn->displayWidth * pScrn->bitsPerPixel / 8); + if (AvailFBArea.y2 > 2047) AvailFBArea.y2 = 2047; + xf86InitFBManager(pScreen, &AvailFBArea); return (XAAInit(pScreen, infoPtr)); @@ -457,43 +459,57 @@ SXSubsequentScanlineCPUToScreenColorExpandFill( pGlint->dwords = ((w + 31) >> 5); /* dwords per scanline */ - pGlint->cpucount = y; - pGlint->cpuheight = h; - GLINT_WAIT(6); - SXLoadCoord(pScrn, x, pGlint->cpucount, x+w, 1, 0, 1); + pGlint->cpucount = h; + + GLINT_WAIT(8); + SXLoadCoord(pScrn, x, y, x+w, 1, 0, 1); + GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask, + Render); +#if defined(__alpha__) + if (0) /* force Alpha to use indirect always */ +#else + if ((pGlint->dwords*h) < pGlint->FIFOSize) +#endif + { + /* Turn on direct for less than FIFOSize dword colour expansion */ + pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->IOBase+OutputFIFO+4; + pGlint->ScanlineDirect = 1; + GLINT_WRITE_REG(((pGlint->dwords*h)-1)<<16 | 0x0D, OutputFIFO); + GLINT_WAIT(pGlint->dwords*h); + } else { + /* Use indirect for anything else */ + pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->ScratchBuffer; + pGlint->ScanlineDirect = 0; + } + + pGlint->cpucount--; } static void SXSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); GLINTPtr pGlint = GLINTPTR(pScrn); - CARD32 *src; + CARD32 *srcp = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno]; int dwords = pGlint->dwords; - GLINT_WAIT(7); - SXLoadCoord(pScrn, pGlint->startxdom, pGlint->cpucount, pGlint->startxsub, 1, 0, 1); - - GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask, - Render); - - src = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno]; - while (dwords >= infoRec->ColorExpandRange) { - GLINT_WAIT(infoRec->ColorExpandRange); - GLINT_WRITE_REG((infoRec->ColorExpandRange - 2)<<16 | 0x0D, OutputFIFO); - GLINT_MoveDWORDS( - (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src, - infoRec->ColorExpandRange - 1); - dwords -= (infoRec->ColorExpandRange - 1); - src += (infoRec->ColorExpandRange - 1); - } - if (dwords) { - GLINT_WAIT(dwords); - GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO); - GLINT_MoveDWORDS( - (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords); + if (!pGlint->ScanlineDirect) { + while(dwords >= pGlint->FIFOSize) { + GLINT_WAIT(pGlint->FIFOSize); + GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | 0x0D, OutputFIFO); + GLINT_MoveDWORDS( + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), + (CARD32*)srcp, pGlint->FIFOSize - 1); + dwords -= pGlint->FIFOSize - 1; + srcp += pGlint->FIFOSize - 1; + } + if(dwords) { + GLINT_WAIT(dwords + 1); + GLINT_WRITE_REG(((dwords - 1) << 16) | 0x0D, OutputFIFO); + GLINT_MoveDWORDS( + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), + (CARD32*)srcp, dwords); + } } - pGlint->cpucount += 1; } void SXSetupForMono8x8PatternFill( diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c index 95db91fa7..271754097 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c @@ -28,7 +28,7 @@ * * GLINT 500TX / MX accelerated options. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c,v 1.26 2001/04/19 09:28:32 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c,v 1.26.2.2 2001/05/30 10:08:19 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -94,8 +94,6 @@ static void TXPolylinesThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC, static void TXPolySegmentThinSolidWrapper(DrawablePtr pDraw, GCPtr pGC, int nseg, xSegment *pSeg); -#define MAX_FIFO_ENTRIES 15 - void TXInitializeEngine(ScrnInfoPtr pScrn) { @@ -252,14 +250,14 @@ TXAccelInit(ScreenPtr pScreen) TRANSPARENCY_ONLY | BIT_ORDER_IN_BYTE_LSBFIRST; - pGlint->XAAScanlineColorExpandBuffers[0] = - xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8)); - pGlint->XAAScanlineColorExpandBuffers[1] = - xnfalloc(((pScrn->virtualX + 63)/32) *4* (pScrn->bitsPerPixel / 8)); - - infoPtr->NumScanlineColorExpandBuffers = 2; + infoPtr->NumScanlineColorExpandBuffers = 1; + pGlint->ScratchBuffer = xalloc(((pScrn->virtualX+62)/32*4) + + (pScrn->virtualX + * pScrn->bitsPerPixel / 8)); infoPtr->ScanlineColorExpandBuffers = pGlint->XAAScanlineColorExpandBuffers; + pGlint->XAAScanlineColorExpandBuffers[0] = + pGlint->IOBase + OutputFIFO + 4; infoPtr->SetupForScanlineCPUToScreenColorExpandFill = TXSetupForScanlineCPUToScreenColorExpandFill; @@ -268,7 +266,7 @@ TXAccelInit(ScreenPtr pScreen) infoPtr->SubsequentColorExpandScanline = TXSubsequentColorExpandScanline; - infoPtr->ColorExpandRange = MAX_FIFO_ENTRIES; + infoPtr->ColorExpandRange = pGlint->FIFOSize; infoPtr->WriteBitmap = TXWriteBitmap; infoPtr->WritePixmap = TXWritePixmap; @@ -280,6 +278,8 @@ TXAccelInit(ScreenPtr pScreen) AvailFBArea.y2 = memory / (pScrn->displayWidth * pScrn->bitsPerPixel / 8); + if (AvailFBArea.y2 > 4095) AvailFBArea.y2 = 4095; + xf86InitFBManager(pScreen, &AvailFBArea); return (XAAInit(pScreen, infoPtr)); @@ -537,43 +537,57 @@ TXSubsequentScanlineCPUToScreenColorExpandFill( pGlint->dwords = ((w + 31) >> 5); /* dwords per scanline */ - pGlint->cpucount = y; - pGlint->cpuheight = h; - GLINT_WAIT(6); - TXLoadCoord(pScrn, x, pGlint->cpucount, x+w, 1, 0, 1); + pGlint->cpucount = h; + + GLINT_WAIT(8); + TXLoadCoord(pScrn, x, y, (x+w), h, 0, 1); + GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask, + Render); +#if defined(__alpha__) + if (0) /* force Alpha to use indirect always */ +#else + if ((pGlint->dwords*h) < pGlint->FIFOSize) +#endif + { + /* Turn on direct for less than FIFOSize dword colour expansion */ + pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->IOBase+OutputFIFO+4; + pGlint->ScanlineDirect = 1; + GLINT_WRITE_REG(((pGlint->dwords*h)-1)<<16 | 0x0D, OutputFIFO); + GLINT_WAIT(pGlint->dwords*h); + } else { + /* Use indirect for anything else */ + pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->ScratchBuffer; + pGlint->ScanlineDirect = 0; + } + + pGlint->cpucount--; } static void TXSubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); GLINTPtr pGlint = GLINTPTR(pScrn); - CARD32 *src; + CARD32 *srcp = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno]; int dwords = pGlint->dwords; - GLINT_WAIT(7); - TXLoadCoord(pScrn, pGlint->startxdom, pGlint->cpucount, pGlint->startxsub, 1, 0, 1); - - GLINT_WRITE_REG(PrimitiveTrapezoid | pGlint->FrameBufferReadMode | SyncOnBitMask, - Render); - - src = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno]; - while (dwords >= infoRec->ColorExpandRange) { - GLINT_WAIT(infoRec->ColorExpandRange); - GLINT_WRITE_REG((infoRec->ColorExpandRange - 2)<<16 | 0x0D, OutputFIFO); - GLINT_MoveDWORDS( - (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src, - infoRec->ColorExpandRange - 1); - dwords -= (infoRec->ColorExpandRange - 1); - src += (infoRec->ColorExpandRange - 1); - } - if (dwords) { - GLINT_WAIT(dwords); - GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO); - GLINT_MoveDWORDS( - (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords); + if (!pGlint->ScanlineDirect) { + while(dwords >= pGlint->FIFOSize) { + GLINT_WAIT(pGlint->FIFOSize); + GLINT_WRITE_REG(((pGlint->FIFOSize - 2) << 16) | 0x0D, OutputFIFO); + GLINT_MoveDWORDS( + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), + (CARD32*)srcp, pGlint->FIFOSize - 1); + dwords -= pGlint->FIFOSize - 1; + srcp += pGlint->FIFOSize - 1; + } + if(dwords) { + GLINT_WAIT(dwords + 1); + GLINT_WRITE_REG(((dwords - 1) << 16) | 0x0D, OutputFIFO); + GLINT_MoveDWORDS( + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), + (CARD32*)srcp, dwords); + } } - pGlint->cpucount += 1; } void TXSetupForMono8x8PatternFill( diff --git a/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_dac.c b/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_dac.c index b33ca8ced..9cd969b0a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_dac.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/glint/tx_dac.c @@ -27,7 +27,7 @@ * this work is sponsored by S.u.S.E. GmbH, Fuerth, Elsa GmbH, Aachen and * Siemens Nixdorf Informationssysteme */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/tx_dac.c,v 1.13 2001/04/19 09:28:32 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/glint/tx_dac.c,v 1.13.2.2 2001/05/29 11:32:23 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -155,11 +155,16 @@ TXInit(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr pReg) STOREREG(VTGModeCtl, 0x44); } - if (IS_GMX2000 || IS_GLORIAXXL) + if (IS_GMX2000 || IS_GLORIAXXL) { STOREREG(FBMemoryCtl, 0x800); /* Optimum memory timings */ + } else { + STOREREG(FBMemoryCtl, GLINT_READ_REG(FBMemoryCtl)); + } /* Override FBModeSel for 300SX chip */ - if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) { + if ( (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_300SX) || + ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_DELTA) && + (pGlint->MultiChip == PCI_CHIP_300SX)) ) { switch (pScrn->bitsPerPixel) { case 8: STOREREG(FBModeSel, 0x905); @@ -236,7 +241,7 @@ TXInit(ScrnInfoPtr pScrn, DisplayModePtr mode, GLINTRegPtr pReg) STORERAMDAC(RGB640_VGA_CONTROL, temp1); STORERAMDAC(RGB640_DAC_CONTROL, IBM640_DACENBL | IBM640_SHUNT); - STORERAMDAC(RGB640_OUTPUT_CONTROL, IBM640_WATCTL); + STORERAMDAC(RGB640_OUTPUT_CONTROL, IBM640_RDAI | IBM640_WATCTL); STORERAMDAC(RGB640_SYNC_CONTROL, 0x00); STORERAMDAC(RGB640_VRAM_MASK0, 0xFF); STORERAMDAC(RGB640_VRAM_MASK1, 0xFF); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h b/xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h index 031111ff7..fd03ef703 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.5 2001/04/01 14:00:11 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128.h,v 1.6 2001/05/04 19:05:39 dawes Exp $ */ /* * Number Nine I128 functions * @@ -99,6 +99,8 @@ typedef struct { unsigned int (*ddc1Read)(ScrnInfoPtr); Bool (*i2cInit)(ScrnInfoPtr); + OptionInfoPtr Options; + } I128Rec, *I128Ptr; 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 91aed1167..0e158c379 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.19 2001/04/01 14:00:11 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i128/i128_driver.c,v 1.20 2001/05/04 19:05:39 dawes Exp $ */ /* All drivers should typically include these */ @@ -71,7 +71,7 @@ */ /* Mandatory functions */ -static OptionInfoPtr I128AvailableOptions(int chipid, int busid); +static const OptionInfoRec * I128AvailableOptions(int chipid, int busid); static void I128Identify(int flags); static Bool I128Probe(DriverPtr drv, int flags); static Bool I128PreInit(ScrnInfoPtr pScrn, int flags); @@ -460,7 +460,7 @@ typedef enum { OPTION_DEBUG } I128Opts; -static OptionInfoRec I128Options[] = { +static const OptionInfoRec I128Options[] = { { OPTION_FLATPANEL, "FlatPanel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, @@ -482,10 +482,10 @@ static OptionInfoRec I128Options[] = { * int chipid - currently unused * int busid - currently unused * Returns: - * OptionInfoPtr - all accepted options + * const OptionInfoRec * - all accepted options */ -static OptionInfoPtr +static const OptionInfoRec * I128AvailableOptions(int chipid, int busid) { return I128Options; @@ -637,7 +637,10 @@ I128PreInit(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, I128Options); + if (!(pI128->Options = xalloc(sizeof(I128Options)))) + return FALSE; + memcpy(pI128->Options, I128Options, sizeof(I128Options)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pI128->Options); if (pScrn->depth == 8) pScrn->rgbBits = 8; @@ -648,38 +651,38 @@ I128PreInit(ScrnInfoPtr pScrn, int flags) */ from = X_DEFAULT; pI128->HWCursor = TRUE; - if (xf86GetOptValBool(I128Options, OPTION_HW_CURSOR, &pI128->HWCursor)) { + if (xf86GetOptValBool(pI128->Options, OPTION_HW_CURSOR, &pI128->HWCursor)) { from = X_CONFIG; } /* For compatibility, accept this too (as an override) */ - if (xf86ReturnOptValBool(I128Options, OPTION_SW_CURSOR, FALSE)) { + if (xf86ReturnOptValBool(pI128->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pI128->HWCursor = FALSE; } xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pI128->HWCursor ? "HW" : "SW"); - if (xf86ReturnOptValBool(I128Options, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pI128->Options, OPTION_NOACCEL, FALSE)) { pI128->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } else pI128->NoAccel = FALSE; - if (xf86ReturnOptValBool(I128Options, OPTION_SYNC_ON_GREEN, FALSE)) { + if (xf86ReturnOptValBool(pI128->Options, OPTION_SYNC_ON_GREEN, FALSE)) { pI128->DACSyncOnGreen = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Sync-on-Green enabled\n"); } else pI128->DACSyncOnGreen = FALSE; - if (xf86ReturnOptValBool(I128Options, OPTION_SHOWCACHE, FALSE)) { + if (xf86ReturnOptValBool(pI128->Options, OPTION_SHOWCACHE, FALSE)) { pI128->ShowCache = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache enabled\n"); } else pI128->ShowCache = FALSE; - if (xf86ReturnOptValBool(I128Options, OPTION_DAC6BIT, FALSE)) { + if (xf86ReturnOptValBool(pI128->Options, OPTION_DAC6BIT, FALSE)) { pI128->DAC8Bit = FALSE; pScrn->rgbBits = 6; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Dac6Bit enabled\n"); } else pI128->DAC8Bit = TRUE; - if (xf86ReturnOptValBool(I128Options, OPTION_DEBUG, FALSE)) { + if (xf86ReturnOptValBool(pI128->Options, OPTION_DEBUG, FALSE)) { pI128->Debug = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Debug enabled\n"); } else pI128->Debug = FALSE; - if (xf86ReturnOptValBool(I128Options, OPTION_FLATPANEL, FALSE)) { + if (xf86ReturnOptValBool(pI128->Options, OPTION_FLATPANEL, FALSE)) { pI128->FlatPanel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "FlatPanel forced\n"); } else pI128->FlatPanel = FALSE; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile index 2512d44e2..fa000dacc 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile,v 1.7 2001/01/24 00:06:19 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/Imakefile,v 1.8 2001/05/15 10:19:38 eich Exp $ XCOMM XCOMM This is the Imakefile for the i740 driver. XCOMM @@ -18,7 +18,7 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \ -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(SERVERSRC)/Xext -I$(XF86OSSRC)/vbe \ + -I$(SERVERSRC)/Xext -I$(XF86OSSRC)/vbe -I$(SERVERSRC)/fb\ -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ -I$(EXTINCSRC) -I$(XF86SRC)/int10 -I$(SERVERSRC)/render #endif diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.h b/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.h index 96f33f1fd..bac445ed1 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/i740/i740.h @@ -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/i740/i740.h,v 1.3 2000/02/23 04:47:12 martin Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/i740.h,v 1.4 2001/05/04 19:05:39 dawes Exp $ */ /* * Authors: @@ -113,6 +113,7 @@ typedef struct _I740Rec { I740ReadIndexedByteFunc readControl; I740WriteByteFunc writeStandard; I740ReadByteFunc readStandard; + OptionInfoPtr Options; } I740Rec; #define I740PTR(p) ((I740Ptr)((p)->driverPrivate)) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c index 4dfb370d8..1cf9ed5b7 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/i740/i740_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/i740/i740_driver.c,v 1.28 2001/01/21 21:19:27 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i740/i740_driver.c,v 1.30 2001/05/15 10:19:38 eich Exp $ */ /* * Authors: @@ -71,6 +71,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "micmap.h" +#define USE_FB + +#ifdef USE_FB +#include "fb.h" +#else /* Drivers using cfb need: */ #define PSZ 8 @@ -82,6 +87,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "cfb16.h" #include "cfb24.h" #include "cfb32.h" +#endif /* The driver's own header file: */ @@ -95,7 +101,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vbe.h" /* Required Functions: */ -static OptionInfoPtr I740AvailableOptions(int chipid, int busid); +static const OptionInfoRec * I740AvailableOptions(int chipid, int busid); /* Print a driver identifying message. */ static void I740Identify(int flags); @@ -137,6 +143,8 @@ static int I740ValidMode(int scrnIndex, DisplayModePtr mode, Bool static void I740DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagermentMode, int flags); +static void I740ProbeDDC(ScrnInfoPtr pScrn, int index); + #define VERSION 4000 #define I740_NAME "I740" #define I740_DRIVER_NAME "i740" @@ -177,7 +185,7 @@ typedef enum { OPTION_USE_PIO } I740Opts; -static OptionInfoRec I740Options[] = { +static const OptionInfoRec I740Options[] = { { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SDRAM, "SDRAM", OPTV_BOOLEAN, {0}, FALSE}, @@ -205,11 +213,16 @@ static const char *vgahwSymbols[] = { 0 }; -static const char *cfbSymbols[] = { +static const char *fbSymbols[] = { +#ifdef USE_FB + "fbScreenInit", + "fbPictureInit", +#else "cfbScreenInit", "cfb16ScreenInit", "cfb24ScreenInit", "cfb32ScreenInit", +#endif "cfb8_32ScreenInit", "cfb24_32ScreenInit", NULL @@ -284,7 +297,7 @@ i740Setup(pointer module, pointer opts, int *errmaj, int *errmin) * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(vgahwSymbols, cfbSymbols, xaaSymbols, + LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, xf8_32bppSymbols, ramdacSymbols, vbeSymbols, NULL /* ddcsymbols */, NULL /* i2csymbols */, NULL /* shadowSymbols */, NULL /* fbdevsymbols */, NULL); @@ -325,8 +338,7 @@ I740FreeRec(ScrnInfoPtr pScrn) { pScrn->driverPrivate=0; } -static -OptionInfoPtr +static const OptionInfoRec * I740AvailableOptions(int chipid, int busid) { return I740Options; @@ -440,7 +452,7 @@ I740Probe(DriverPtr drv, int flags) { return foundScreen; } -void +static void I740ProbeDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; @@ -465,7 +477,9 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) { int i; MessageType from; int temp; +#ifndef USE_FB char *mod=0, *reqSym=0; +#endif int flags24; rgb defaultWeight = {0, 0, 0}; @@ -527,7 +541,7 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) { xf86PrintDepthBpp(pScrn); pScrn->rgbBits=8; - if (xf86ReturnOptValBool(I740Options, OPTION_DAC_6BIT, FALSE)) + if (xf86ReturnOptValBool(pI740->Options, OPTION_DAC_6BIT, FALSE)) pScrn->rgbBits=6; if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight)) return FALSE; @@ -552,13 +566,16 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) { /* Process the options */ xf86CollectOptions(pScrn, NULL); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, I740Options); + if (!(pI740->Options = xalloc(sizeof(I740Options)))) + return FALSE; + memcpy(pI740->Options, I740Options, sizeof(I740Options)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pI740->Options); /* 6-BIT dac isn't reasonable for modes with > 8bpp */ - if (xf86ReturnOptValBool(I740Options, OPTION_DAC_6BIT, FALSE) && + if (xf86ReturnOptValBool(pI740->Options, OPTION_DAC_6BIT, FALSE) && pScrn->bitsPerPixel>8) { OptionInfoPtr ptr; - ptr=xf86TokenToOptinfo(I740Options, OPTION_DAC_6BIT); + ptr=xf86TokenToOptinfo(pI740->Options, OPTION_DAC_6BIT); ptr->found=FALSE; } @@ -637,24 +654,24 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) { temp=pI740->readControl(pI740, XRX, DRAM_ROW_CNTL_LO); pI740->HasSGRAM = !((temp&DRAM_RAS_TIMING)||(temp&DRAM_RAS_PRECHARGE)); - if (xf86IsOptionSet(I740Options, OPTION_SDRAM)) { - if (xf86IsOptionSet(I740Options, OPTION_SGRAM)) { + if (xf86IsOptionSet(pI740->Options, OPTION_SDRAM)) { + if (xf86IsOptionSet(pI740->Options, OPTION_SGRAM)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "It is nonsensical to set both SDRAM and SGRAM options\n"); return FALSE; } - if (xf86ReturnOptValBool(I740Options, OPTION_SDRAM, FALSE)) { + if (xf86ReturnOptValBool(pI740->Options, OPTION_SDRAM, FALSE)) { pI740->HasSGRAM = FALSE; } else { pI740->HasSGRAM = TRUE; } } else { - if (xf86IsOptionSet(I740Options, OPTION_SDRAM)) { + if (xf86IsOptionSet(pI740->Options, OPTION_SDRAM)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "It is nonsensical to set both SDRAM and SGRAM options\n"); return FALSE; } - if (xf86ReturnOptValBool(I740Options, OPTION_SGRAM, FALSE)) { + if (xf86ReturnOptValBool(pI740->Options, OPTION_SGRAM, FALSE)) { pI740->HasSGRAM = TRUE; } else { pI740->HasSGRAM = FALSE; @@ -751,6 +768,13 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) { xf86SetDpi(pScrn, 0, 0); +#ifdef USE_FB + if (!xf86LoadSubModule(pScrn, "fb")) { + I740FreeRec(pScrn); + return FALSE; + } + xf86LoaderReqSymbols("fbScreenInit","fbPictureInit", NULL); +#else switch (pScrn->bitsPerPixel) { case 8: mod = "cfb"; @@ -774,15 +798,16 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) { return FALSE; } xf86LoaderReqSymbols(reqSym, NULL); +#endif - if (!xf86ReturnOptValBool(I740Options, OPTION_NOACCEL, FALSE)) { + if (!xf86ReturnOptValBool(pI740->Options, OPTION_NOACCEL, FALSE)) { if (!xf86LoadSubModule(pScrn, "xaa")) { I740FreeRec(pScrn); return FALSE; } } - if (!xf86ReturnOptValBool(I740Options, OPTION_SW_CURSOR, FALSE)) { + if (!xf86ReturnOptValBool(pI740->Options, OPTION_SW_CURSOR, FALSE)) { if (!xf86LoadSubModule(pScrn, "ramdac")) { I740FreeRec(pScrn); return FALSE; @@ -791,7 +816,7 @@ I740PreInit(ScrnInfoPtr pScrn, int flags) { } /* We wont be using the VGA access after the probe */ - if (!xf86ReturnOptValBool(I740Options, OPTION_USE_PIO, FALSE)) { + if (!xf86ReturnOptValBool(pI740->Options, OPTION_USE_PIO, FALSE)) { resRange vgaio[] = { {ResShrIoBlock,0x3B0,0x3BB}, {ResShrIoBlock,0x3C0,0x3DF}, _END }; @@ -1284,7 +1309,7 @@ I740SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { } /* Turn on 8 bit dac if requested */ - if (xf86ReturnOptValBool(I740Options, OPTION_DAC_6BIT, FALSE)) + if (xf86ReturnOptValBool(pI740->Options, OPTION_DAC_6BIT, FALSE)) i740Reg->PixelPipeCfg0 = DAC_6_BIT; else i740Reg->PixelPipeCfg0 = DAC_8_BIT; @@ -1301,7 +1326,7 @@ I740SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { i740Reg->DisplayControl = HIRES_MODE; /* Set the MCLK freq */ - if (xf86ReturnOptValBool(I740Options, OPTION_SLOW_RAM, FALSE)) + if (xf86ReturnOptValBool(pI740->Options, OPTION_SLOW_RAM, FALSE)) i740Reg->PLLControl = PLL_MEMCLK__66667KHZ; /* 66 MHz */ else i740Reg->PLLControl = PLL_MEMCLK_100000KHZ; /* 100 MHz -- use as default */ @@ -1312,7 +1337,15 @@ I740SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { i740Reg->ExtVertSyncStart = mode->CrtcVSyncStart >> 8; i740Reg->ExtVertBlankStart = mode->CrtcVBlankStart >> 8; i740Reg->ExtHorizTotal = ((mode->CrtcHTotal >> 3) - 5) >> 8; - i740Reg->ExtHorizBlank = ((mode->CrtcHSyncEnd >> 3) & 0x40) >> 6; + /* + * the KGA fix in vgaHW.c results in the first + * scanline and the first character clock (8 pixels) + * of each scanline thereafter on display with an i740 + * to be blank. Restoring CRTC 3, 5, & 22 to their + * "theoretical" values corrects the problem. KAO. + */ + i740Reg->ExtHorizBlank = vgaHWHBlankKGA(mode, pVga, 7, 0) << 6; + vgaHWVBlankKGA(mode, pVga, 8, 0); /* Turn on interlaced mode if necessary */ if (mode->Flags & V_INTERLACE) @@ -1346,7 +1379,6 @@ I740ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) { vgaHWPtr hwp; I740Ptr pI740; - vgaRegPtr pVga; hwp = VGAHWPTR(pScrn); pI740 = I740PTR(pScrn); @@ -1354,18 +1386,6 @@ I740ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) vgaHWUnlock(hwp); if (!vgaHWInit(pScrn, mode)) return FALSE; - /* - * the KGA fix in vgaHW.c results in the first - * scanline and the first character clock (8 pixels) - * of each scanline thereafter on display with an i740 - * to be blank. Restoring CRTC 3, 5, & 22 to their - * "theoretical" values corrects the problem. KAO. - */ - pVga = &VGAHWPTR(pScrn)->ModeReg; - pVga->CRTC[3] = (((mode->CrtcHBlankEnd >> 3) - 1) & 0x1F) | 0x80; - pVga->CRTC[5] = ((((mode->CrtcHBlankEnd >> 3) - 1) & 0x20) << 2) - | (((mode->CrtcHSyncEnd >> 3)) & 0x1F); - pVga->CRTC[22] = (mode->CrtcVBlankEnd - 1) & 0xFF; pScrn->vtSema = TRUE; @@ -1461,8 +1481,23 @@ I740ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; +#ifdef USE_FB + if (!miSetPixmapDepths ()) return FALSE; +#endif switch (pScrn->bitsPerPixel) { +#ifdef USE_FB + case 8: + case 16: + case 24: + case 32: + if (!fbScreenInit(pScreen, pI740->FbBase, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth,pScrn->bitsPerPixel)) + return FALSE; + break; +#else case 8: if (!cfbScreenInit(pScreen, pI740->FbBase, pScrn->virtualX, pScrn->virtualY, @@ -1491,12 +1526,16 @@ I740ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { pScrn->displayWidth)) return FALSE; break; +#endif default: xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) in I740ScrnInit\n", pScrn->bitsPerPixel); return FALSE; } +#ifdef USE_FB + fbPictureInit(pScreen,0,0); +#endif xf86SetBlackWhitePixels(pScreen); @@ -1556,14 +1595,14 @@ I740ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { return FALSE; } - if (!xf86ReturnOptValBool(I740Options, OPTION_NOACCEL, FALSE)) { + if (!xf86ReturnOptValBool(pI740->Options, OPTION_NOACCEL, FALSE)) { if (!I740AccelInit(pScreen)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Hardware acceleration initialization failed\n"); } } - if (!xf86ReturnOptValBool(I740Options, OPTION_SW_CURSOR, FALSE)) { + if (!xf86ReturnOptValBool(pI740->Options, OPTION_SW_CURSOR, FALSE)) { if (!I740CursorInit(pScreen)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Hardware cursor initialization failed\n"); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h index 4a28dafed..52c6a7b30 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h @@ -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/i810/i810.h,v 1.19 2000/12/01 14:28:56 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h,v 1.21 2001/05/19 00:26:44 dawes Exp $ */ /* * Authors: @@ -136,6 +136,8 @@ typedef struct _I810Rec { unsigned char *MMIOBase; unsigned char *FbBase; long FbMapSize; + long DepthOffset; + long BackOffset; int cpp; int MaxClock; @@ -230,6 +232,7 @@ typedef struct _I810Rec { Bool agpAcquired2d; XF86VideoAdaptorPtr adaptor; + OptionInfoPtr Options; } I810Rec; #define I810PTR(p) ((I810Ptr)((p)->driverPrivate)) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c index 7bf02f271..a9becbd9f 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v 1.18 2001/04/10 16:08:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v 1.21 2001/05/19 00:26:44 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -19,18 +19,18 @@ static char I810KernelDriverName[] = "i810"; static char I810ClientDriverName[] = "i810"; static Bool I810InitVisualConfigs(ScreenPtr pScreen); -static Bool I810CreateContext(ScreenPtr pScreen, VisualPtr visual, +static Bool I810CreateContext(ScreenPtr pScreen, VisualPtr visual, drmContext hwContext, void *pVisualConfigPriv, DRIContextType contextStore); static void I810DestroyContext(ScreenPtr pScreen, drmContext hwContext, DRIContextType contextStore); -static void I810DRISwapContext(ScreenPtr pScreen, DRISyncType syncType, - DRIContextType readContextType, +static void I810DRISwapContext(ScreenPtr pScreen, DRISyncType syncType, + DRIContextType readContextType, void *readContextStore, - DRIContextType writeContextType, + DRIContextType writeContextType, void *writeContextStore); static void I810DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index); -static void I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, +static void I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, RegionPtr prgnSrc, CARD32 index); extern void GlxSetVisualConfigs(int nconfigs, @@ -57,10 +57,10 @@ Bool I810CleanupDma(ScrnInfoPtr pScrn) { I810Ptr pI810 = I810PTR(pScrn); Bool ret_val; - + ret_val = drmI810CleanupDma(pI810->drmSubFD); if (ret_val == FALSE) - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I810 Dma Cleanup Failed\n"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[dri] I810 Dma Cleanup Failed\n"); return ret_val; } @@ -71,9 +71,9 @@ Bool I810InitDma(ScrnInfoPtr pScrn) I810DRIPtr pI810DRI = (I810DRIPtr) pI810->pDRIInfo->devPrivate; drmI810Init info; Bool ret_val; - + info.start = ring->mem.Start; - info.end = ring->mem.End; + info.end = ring->mem.End; info.size = ring->mem.Size; info.mmio_offset = (unsigned int)pI810DRI->regs; info.buffers_offset = (unsigned int)pI810->buffer_map; @@ -88,7 +88,10 @@ Bool I810InitDma(ScrnInfoPtr pScrn) info.pitch_bits = pI810->auxPitchBits; ret_val = drmI810InitDma(pI810->drmSubFD, &info); - if(ret_val == FALSE) ErrorF("I810 Dma Initialization Failed\n"); + if(ret_val == FALSE) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "[drm] I810 Dma Initialization failed.\n"); + } return ret_val; } @@ -129,7 +132,7 @@ I810InitVisualConfigs(ScreenPtr pScreen) return FALSE; } - for (i=0; i<numConfigs; i++) + for (i=0; i<numConfigs; i++) pI810ConfigPtrs[i] = &pI810Configs[i]; i = 0; @@ -168,7 +171,7 @@ I810InitVisualConfigs(ScreenPtr pScreen) pConfigs[i].depthSize = 0; if (stencil) pConfigs[i].stencilSize = 8; - else + else pConfigs[i].stencilSize = 0; pConfigs[i].auxBuffers = 0; pConfigs[i].level = 0; @@ -219,7 +222,7 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) int bufs; int width = pScrn->displayWidth * pI810->cpp; int i; - + /* Hardware 3D rendering only implemented for 16bpp */ /* And it only works for 5:6:5 (Mark) */ if (pScrn->depth != 16) @@ -232,17 +235,19 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) if (!xf86LoaderCheckSymbol("drmAvailable")) return FALSE; if (!xf86LoaderCheckSymbol("DRIQueryVersion")) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "TDFXDRIScreenInit failed (libdri.a too old)\n"); + "[dri] I810DRIScreenInit failed (libdri.a too old)\n"); return FALSE; } - + /* Check the DRI version */ { int major, minor, patch; DRIQueryVersion(&major, &minor, &patch); if (major != 4 || minor < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "I810DRIScreenInit failed (DRI version = %d.%d.%d, expected 4.0.x). Disabling DRI.\n", + "[dri] I810DRIScreenInit failed because of a version mismatch.\n" + "[dri] libDRI version is %d.%d.%d bug version 4.0.x is needed.\n" + "[dri] Disabling DRI.\n", major, minor, patch); return FALSE; } @@ -250,7 +255,8 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) pDRIInfo = DRICreateInfoRec(); if (!pDRIInfo) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "DRICreateInfoRec failed\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] DRICreateInfoRec failed. Disabling DRI.\n"); return FALSE; } @@ -273,8 +279,8 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) pDRIInfo->ddxDriverMinorVersion = I810_MINOR_VERSION; pDRIInfo->ddxDriverPatchVersion = I810_PATCHLEVEL; pDRIInfo->frameBufferPhysicalAddress = pI810->LinearAddr; - pDRIInfo->frameBufferSize = (((pScrn->displayWidth * - pScrn->virtualY * pI810->cpp) + + pDRIInfo->frameBufferSize = (((pScrn->displayWidth * + pScrn->virtualY * pI810->cpp) + 4096 - 1) / 4096) * 4096; pDRIInfo->frameBufferStride = pScrn->displayWidth*pI810->cpp; @@ -289,7 +295,7 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) * in the SAREA header */ if (sizeof(XF86DRISAREARec)+sizeof(I810SAREARec)>SAREA_MAX) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "Data does not fit in SAREA\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, "[dri] Data does not fit in SAREA\n"); return FALSE; } pDRIInfo->SAREASize = SAREA_MAX; @@ -302,29 +308,30 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) pDRIInfo->devPrivate = pI810DRI; pDRIInfo->devPrivateSize = sizeof(I810DRIRec); pDRIInfo->contextSize = sizeof(I810DRIContextRec); - + pDRIInfo->CreateContext = I810CreateContext; pDRIInfo->DestroyContext = I810DestroyContext; pDRIInfo->SwapContext = I810DRISwapContext; pDRIInfo->InitBuffers = I810DRIInitBuffers; pDRIInfo->MoveBuffers = I810DRIMoveBuffers; pDRIInfo->bufferRequests = DRI_ALL_WINDOWS; - + pDRIInfo->createDummyCtx = TRUE; pDRIInfo->createDummyCtxPriv = FALSE; - + /* This adds the framebuffer as a drm map *before* we have asked agp * to allocate it. Scary stuff, hold on... */ if (!DRIScreenInit(pScreen, pDRIInfo, &pI810->drmSubFD)) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "DRIScreenInit failed\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] DRIScreenInit failed. Disabling DRI.\n"); xfree(pDRIInfo->devPrivate); pDRIInfo->devPrivate=0; DRIDestroyInfoRec(pI810->pDRIInfo); pI810->pDRIInfo=0; return FALSE; } - + /* Check the i810 DRM version */ { drmVersionPtr version = drmGetVersion(pI810->drmSubFD); @@ -333,7 +340,9 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) version->version_minor < 1) { /* incompatible drm version */ xf86DrvMsg(pScreen->myNum, X_ERROR, - "I810DRIScreenInit failed (DRM version = %d.%d.%d, expected 1.0.x). Disabling DRI.\n", + "[dri] I810DRIScreenInit failed because of a version mismatch.\n" + "[dri] i810.o kernel module version is %d.%d.%d but version 1.0.x is needed.\n" + "[dri] Disabling DRI.\n", version->version_major, version->version_minor, version->version_patchlevel); @@ -346,33 +355,33 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) } pI810DRI->regsSize=I810_REG_SIZE; - if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->MMIOAddr, + if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->MMIOAddr, pI810DRI->regsSize, DRM_REGISTERS, 0, &pI810DRI->regs)<0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAddMap(regs) failed\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAddMap(regs) failed\n"); DRICloseScreen(pScreen); return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Registers = 0x%08lx\n", pI810DRI->regs); - + pI810->backHandle = 0; pI810->zHandle = 0; pI810->cursorHandle = 0; pI810->sysmemHandle = 0; pI810->agpAcquired = FALSE; pI810->dcacheHandle = 0; - + /* Agp Support - Need this just to get the framebuffer. */ if(drmAgpAcquire(pI810->drmSubFD) < 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAgpAquire failed\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, "[agp] drmAgpAquire failed\n"); DRICloseScreen(pScreen); return FALSE; } pI810->agpAcquired = TRUE; - + if (drmAgpEnable(pI810->drmSubFD, 0) < 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAgpEnable failed\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, "[agp] drmAgpEnable failed\n"); DRICloseScreen(pScreen); return FALSE; } @@ -381,23 +390,23 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) memset (&pI810->BackBuffer, 0, sizeof(I810MemRange)); memset (&pI810->DepthBuffer, 0, sizeof(I810MemRange)); pI810->CursorPhysical = 0; - + /* Dcache - half the speed of normal ram, but has use as a Z buffer - * under the DRI. + * under the DRI. */ drmAgpAlloc(pI810->drmSubFD, 4096 * 1024, 1, NULL, &dcacheHandle); pI810->dcacheHandle = dcacheHandle; - xf86DrvMsg(pScreen->myNum, X_INFO, "dcacheHandle : %p\n", dcacheHandle); - + xf86DrvMsg(pScreen->myNum, X_INFO, "[agp] dcacheHandle : %p\n", dcacheHandle); + #define Elements(x) sizeof(x)/sizeof(*x) - for (pitch_idx = 0 ; pitch_idx < Elements(i810_pitches) ; pitch_idx++) - if (width <= i810_pitches[pitch_idx]) + for (pitch_idx = 0 ; pitch_idx < Elements(i810_pitches) ; pitch_idx++) + if (width <= i810_pitches[pitch_idx]) break; - + if (pitch_idx == Elements(i810_pitches)) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Couldn't find depth/back buffer pitch"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "[dri] Couldn't find depth/back buffer pitch"); DRICloseScreen(pScreen); return FALSE; } @@ -405,11 +414,11 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) back_size = i810_pitches[pitch_idx] * (pScrn->virtualY + 4); back_size = ((back_size + 4096 - 1) / 4096) * 4096; } - + sysmem_size = pScrn->videoRam * 1024; if (dcacheHandle != 0) { if (back_size > 4*1024*1024) { - xf86DrvMsg(pScreen->myNum, X_INFO, "Backsize is larger then 4 meg\n"); + xf86DrvMsg(pScreen->myNum, X_INFO, "[dri] Backsize is larger then 4 meg\n"); sysmem_size = sysmem_size - 2*back_size; drmAgpFree(pI810->drmSubFD, dcacheHandle); pI810->dcacheHandle = dcacheHandle = 0; @@ -422,13 +431,13 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) sysmem_size = sysmem_size - 2*back_size; } - if(sysmem_size > 48*1024*1024) { - sysmem_size = 48*1024*1024; + if(sysmem_size > pI810->FbMapSize) { + sysmem_size = pI810->FbMapSize; xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "User requested more memory then fits in the agp aperture\n" - "Truncating to %d bytes of memory\n", - sysmem_size); + "[dri] User requested more memory then fits in the agp" + " aperture\n\tTruncating to %d bytes of memory\n", + sysmem_size); } sysmem_size -= 4096; /* remove 4k for the hw cursor */ @@ -441,121 +450,119 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) pI810->SavedSysMem = pI810->SysMem; if (dcacheHandle != 0) { - /* The Z buffer is always aligned to the 48 mb mark in the aperture */ - if(drmAgpBind(pI810->drmSubFD, dcacheHandle, 48*1024*1024) == 0) { + if(drmAgpBind(pI810->drmSubFD, dcacheHandle, pI810->DepthOffset) == 0) { memset (&pI810->DcacheMem, 0, sizeof(I810MemRange)); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "GART: Found 4096K Z buffer memory\n"); - pI810->DcacheMem.Start = 48*1024*1024; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "[agp] GART: Found 4096K Z buffer memory\n"); + pI810->DcacheMem.Start = pI810->DepthOffset; pI810->DcacheMem.Size = 1024 * 4096; pI810->DcacheMem.End = pI810->DcacheMem.Start + pI810->DcacheMem.Size; - if (!I810AllocLow(&(pI810->DepthBuffer), + if (!I810AllocLow(&(pI810->DepthBuffer), &(pI810->DcacheMem), - back_size)) + back_size)) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Depth buffer allocation failed\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "[agp] Depth buffer allocation failed\n"); DRICloseScreen(pScreen); return FALSE; } } else { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "GART: dcache bind failed\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[agp] GART: dcache bind failed\n"); drmAgpFree(pI810->drmSubFD, dcacheHandle); pI810->dcacheHandle = dcacheHandle = 0; - } + } } else { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "GART: no dcache memory found\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[agp] GART: no dcache memory found\n"); } drmAgpAlloc(pI810->drmSubFD, back_size, 0, NULL, &agpHandle); pI810->backHandle = agpHandle; - + if (agpHandle != 0) { - /* The backbuffer is always aligned to the 56 mb mark in the aperture */ - if(drmAgpBind(pI810->drmSubFD, agpHandle, 56*1024*1024) == 0) { + if(drmAgpBind(pI810->drmSubFD, agpHandle, pI810->BackOffset) == 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Bound backbuffer memory\n"); - - pI810->BackBuffer.Start = 56*1024*1024; + "[agp] Bound backbuffer memory\n"); + + pI810->BackBuffer.Start = pI810->BackOffset; pI810->BackBuffer.Size = back_size; - pI810->BackBuffer.End = (pI810->BackBuffer.Start + + pI810->BackBuffer.End = (pI810->BackBuffer.Start + pI810->BackBuffer.Size); } else { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Unable to bind backbuffer\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "[agp] Unable to bind backbuffer. Disabling DRI.\n"); DRICloseScreen(pScreen); return FALSE; } } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Unable to allocate backbuffer memory\n"); + "[dri] Unable to allocate backbuffer memory. Disabling DRI.\n"); DRICloseScreen(pScreen); return FALSE; } - + if(dcacheHandle == 0) { - /* The Z buffer is always aligned to the 48 mb mark in the aperture */ drmAgpAlloc(pI810->drmSubFD, back_size, 0, NULL, &agpHandle); pI810->zHandle = agpHandle; if(agpHandle != 0) { - if(drmAgpBind(pI810->drmSubFD, agpHandle, 48*1024*1024) == 0) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Bound depthbuffer memory\n"); - pI810->DepthBuffer.Start = 48*1024*1024; + if(drmAgpBind(pI810->drmSubFD, agpHandle, pI810->DepthOffset) == 0) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[agp] Bound depthbuffer memory\n"); + pI810->DepthBuffer.Start = pI810->DepthOffset; pI810->DepthBuffer.Size = back_size; - pI810->DepthBuffer.End = (pI810->DepthBuffer.Start + + pI810->DepthBuffer.End = (pI810->DepthBuffer.Start + pI810->DepthBuffer.Size); } else { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Unable to bind depthbuffer\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "[agp] Unable to bind depthbuffer. Disabling DRI.\n"); DRICloseScreen(pScreen); return FALSE; } } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Unable to allocate depthbuffer memory\n"); + "[agp] Unable to allocate depthbuffer memory. Disabling DRI.\n"); DRICloseScreen(pScreen); return FALSE; } - } - + } + /* Now allocate and bind the agp space. This memory will include the * regular framebuffer as well as texture memory. */ drmAgpAlloc(pI810->drmSubFD, sysmem_size, 0, NULL, &agpHandle); if (agpHandle == 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAgpAlloc failed\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, "[agp] drmAgpAlloc failed\n"); DRICloseScreen(pScreen); return FALSE; } pI810->sysmemHandle = agpHandle; if (drmAgpBind(pI810->drmSubFD, agpHandle, 0) != 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAgpBind failed\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, "[agp] drmAgpBind failed\n"); DRICloseScreen(pScreen); return FALSE; } - - drmAgpAlloc(pI810->drmSubFD, 4096, 2, - (unsigned long *)&pI810->CursorPhysical, &agpHandle); + + drmAgpAlloc(pI810->drmSubFD, 4096, 2, + (unsigned long *)&pI810->CursorPhysical, &agpHandle); pI810->cursorHandle = agpHandle; if (agpHandle != 0) { tom = sysmem_size; - if (drmAgpBind(pI810->drmSubFD, agpHandle, tom) == 0) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "GART: Allocated 4K for mouse cursor image\n"); - pI810->CursorStart = tom; + if (drmAgpBind(pI810->drmSubFD, agpHandle, tom) == 0) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "[agp] GART: Allocated 4K for mouse cursor image\n"); + pI810->CursorStart = tom; tom += 4096; } else { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "GART: cursor bind failed\n"); - pI810->CursorPhysical = 0; - } + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[agp] GART: cursor bind failed\n"); + pI810->CursorPhysical = 0; + } } else { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "GART: cursor alloc failed\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[agp] GART: cursor alloc failed\n"); pI810->CursorPhysical = 0; } @@ -573,34 +580,36 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) pI810->DepthBuffer.Start, i810_pitches[pitch_idx], 8*1024*1024); - + I810SetTiledMemory(pScrn, 2, pI810->BackBuffer.Start, i810_pitches[pitch_idx], 8*1024*1024); - + pI810->auxPitch = i810_pitches[pitch_idx]; pI810->auxPitchBits = i810_pitch_flags[pitch_idx]; pI810->SavedDcacheMem = pI810->DcacheMem; pI810DRI->backbufferSize = pI810->BackBuffer.Size; if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->BackBuffer.Start, - pI810->BackBuffer.Size, DRM_AGP, 0, + pI810->BackBuffer.Size, DRM_AGP, 0, &pI810DRI->backbuffer) < 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAddMap(backbuffer) failed\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[drm] drmAddMap(backbuffer) failed. Disabling DRI\n"); DRICloseScreen(pScreen); return FALSE; } - + pI810DRI->depthbufferSize = pI810->DepthBuffer.Size; if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->DepthBuffer.Start, - pI810->DepthBuffer.Size, DRM_AGP, 0, + pI810->DepthBuffer.Size, DRM_AGP, 0, &pI810DRI->depthbuffer) < 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAddMap(depthbuffer) failed\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[drm] drmAddMap(depthbuffer) failed. Disabling DRI.\n"); DRICloseScreen(pScreen); return FALSE; } - + /* Allocate FrontBuffer etc. */ if (!I810AllocateFront(pScrn)) { DRICloseScreen(pScreen); @@ -608,24 +617,25 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) } /* Allocate buffer memory */ - I810AllocHigh( &(pI810->BufferMem), &(pI810->SysMem), + I810AllocHigh( &(pI810->BufferMem), &(pI810->SysMem), I810_DMA_BUF_NR * I810_DMA_BUF_SZ); - - xf86DrvMsg(pScreen->myNum, X_INFO, "Buffer map : %lx\n", + + xf86DrvMsg(pScreen->myNum, X_INFO, "[dri] Buffer map : %lx\n", pI810->BufferMem.Start); - - if (pI810->BufferMem.Start == 0 || - pI810->BufferMem.End - pI810->BufferMem.Start > + + if (pI810->BufferMem.Start == 0 || + pI810->BufferMem.End - pI810->BufferMem.Start > I810_DMA_BUF_NR * I810_DMA_BUF_SZ) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "Not enough memory for dma buffers\n"); + "[dri] Not enough memory for dma buffers. Disabling DRI.\n"); DRICloseScreen(pScreen); return FALSE; } if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->BufferMem.Start, pI810->BufferMem.Size, DRM_AGP, 0, &pI810->buffer_map) < 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAddMap(buffer_map) failed\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[drm] drmAddMap(buffer_map) failed. Disabling DRI.\n"); DRICloseScreen(pScreen); return FALSE; } @@ -636,11 +646,12 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->LpRing.mem.Start, pI810->LpRing.mem.Size, DRM_AGP, 0, &pI810->ring_map) < 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAddMap(ring_map) failed\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[drm] drmAddMap(ring_map) failed. Disabling DRI.\n"); DRICloseScreen(pScreen); return FALSE; } - + /* Use the rest of memory for textures. */ pI810DRI->textureSize = pI810->SysMem.Size; @@ -653,28 +664,30 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) pI810DRI->textureSize = (pI810DRI->textureSize >> i) << i; /* truncate */ if(pI810DRI->textureSize < 512*1024) { - ErrorF("Less then 512k for textures\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[drm] Less then 512k memory left for textures. Disabling DRI.\n"); DRICloseScreen(pScreen); return FALSE; } - + I810AllocLow( &(pI810->TexMem), &(pI810->SysMem), pI810DRI->textureSize); - + if (drmAddMap(pI810->drmSubFD, (drmHandle)pI810->TexMem.Start, pI810->TexMem.Size, DRM_AGP, 0, &pI810DRI->textures) < 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAddMap(textures) failed\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[drm] drmAddMap(textures) failed. Disabling DRI.\n"); DRICloseScreen(pScreen); return FALSE; } - + if((bufs = drmAddBufs(pI810->drmSubFD, I810_DMA_BUF_NR, I810_DMA_BUF_SZ, DRM_AGP_BUFFER, pI810->BufferMem.Start)) <= 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "[drm] failure adding %d %d byte DMA buffers\n", + "[drm] failure adding %d %d byte DMA buffers. Disabling DRI.\n", I810_DMA_BUF_NR, I810_DMA_BUF_SZ); DRICloseScreen(pScreen); @@ -687,7 +700,7 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) xf86EnablePciBusMaster(pI810->PciInfo, TRUE); I810InitDma(pScrn); - + /* Okay now initialize the dma engine */ if (!pI810DRI->irq) { @@ -702,7 +715,7 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] failure adding irq handler, there is a device " "already using that irq\n Consider rearranging your " - "PCI cards\n"); + "PCI cards. Disabling DRI.\n"); DRICloseScreen(pScreen); return FALSE; } @@ -711,41 +724,41 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[drm] dma control initialized, using IRQ %d\n", pI810DRI->irq); - - pI810DRI=(I810DRIPtr)pI810->pDRIInfo->devPrivate; + pI810DRI->deviceID=pI810->PciInfo->chipType; pI810DRI->width=pScrn->virtualX; pI810DRI->height=pScrn->virtualY; pI810DRI->mem=pScrn->videoRam*1024; pI810DRI->cpp=pI810->cpp; - + pI810DRI->fbOffset=pI810->FrontBuffer.Start; pI810DRI->fbStride=pI810->auxPitch; - + pI810DRI->bitsPerPixel = pScrn->bitsPerPixel; - - + + pI810DRI->textureOffset=pI810->TexMem.Start; - + pI810DRI->backOffset=pI810->BackBuffer.Start; pI810DRI->depthOffset=pI810->DepthBuffer.Start; - + pI810DRI->ringOffset=pI810->LpRing.mem.Start; pI810DRI->ringSize=pI810->LpRing.mem.Size; - + pI810DRI->auxPitch = pI810->auxPitch; pI810DRI->auxPitchBits = pI810->auxPitchBits; pI810DRI->sarea_priv_offset = sizeof(XF86DRISAREARec); if (!(I810InitVisualConfigs(pScreen))) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "I810InitVisualConfigs failed\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] I810InitVisualConfigs failed. Disabling DRI.\n"); DRICloseScreen(pScreen); return FALSE; } - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "visual configs initialized\n" ); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized.\n" ); pI810->pDRIInfo->driverSwapMethod = DRI_HIDE_X_CONTEXT; - + return TRUE; } @@ -764,7 +777,7 @@ I810DRICloseScreen(ScreenPtr pScreen) if(pI810->sysmemHandle) drmAgpFree(pI810->drmSubFD, pI810->sysmemHandle); if(pI810->agpAcquired == TRUE) drmAgpRelease(pI810->drmSubFD); - + pI810->backHandle = 0; pI810->zHandle = 0; pI810->cursorHandle = 0; @@ -772,7 +785,7 @@ I810DRICloseScreen(ScreenPtr pScreen) pI810->agpAcquired = FALSE; pI810->dcacheHandle = 0; - + DRICloseScreen(pScreen); if (pI810->pDRIInfo) { @@ -788,7 +801,7 @@ I810DRICloseScreen(ScreenPtr pScreen) } static Bool -I810CreateContext(ScreenPtr pScreen, VisualPtr visual, +I810CreateContext(ScreenPtr pScreen, VisualPtr visual, drmContext hwContext, void *pVisualConfigPriv, DRIContextType contextStore) { @@ -796,7 +809,7 @@ I810CreateContext(ScreenPtr pScreen, VisualPtr visual, } static void -I810DestroyContext(ScreenPtr pScreen, drmContext hwContext, +I810DestroyContext(ScreenPtr pScreen, drmContext hwContext, DRIContextType contextStore) { } @@ -811,29 +824,29 @@ I810DRIFinishScreenInit(ScreenPtr pScreen) } void -I810DRISwapContext(ScreenPtr pScreen, DRISyncType syncType, +I810DRISwapContext(ScreenPtr pScreen, DRISyncType syncType, DRIContextType oldContextType, void *oldContext, DRIContextType newContextType, void *newContext) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; I810Ptr pI810 = I810PTR(pScrn); - if (syncType == DRI_3D_SYNC && + if (syncType == DRI_3D_SYNC && oldContextType == DRI_2D_CONTEXT && - newContextType == DRI_2D_CONTEXT) - { + newContextType == DRI_2D_CONTEXT) + { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; if (I810_DEBUG & DEBUG_VERBOSE_DRI) ErrorF("I810DRISwapContext (in)\n"); - + pI810->LockHeld = 1; I810RefreshRing( pScrn ); } - else if (syncType == DRI_2D_SYNC && + else if (syncType == DRI_2D_SYNC && oldContextType == DRI_NO_CONTEXT && - newContextType == DRI_2D_CONTEXT) - { + newContextType == DRI_2D_CONTEXT) + { pI810->LockHeld = 0; if (I810_DEBUG & DEBUG_VERBOSE_DRI) ErrorF("I810DRISwapContext (out)\n"); @@ -857,7 +870,7 @@ I810DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index) I810SetupForSolidFill(pScrn, 0, GXcopy, -1); while (nbox--) { I810SelectBuffer(pScrn, I810_BACK); - I810SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1, + I810SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1, pbox->x2-pbox->x1, pbox->y2-pbox->y1); pbox++; } @@ -868,8 +881,8 @@ I810DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index) nbox = REGION_NUM_RECTS(prgn); I810SelectBuffer(pScrn, I810_DEPTH); I810SetupForSolidFill(pScrn, 0xffff, GXcopy, -1); - while (nbox--) { - I810SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1, + while (nbox--) { + I810SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1, pbox->x2-pbox->x1, pbox->y2-pbox->y1); pbox++; } @@ -880,12 +893,12 @@ I810DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index) /* This routine is a modified form of XAADoBitBlt with the calls to * ScreenToScreenBitBlt built in. My routine has the prgnSrc as source * instead of destination. My origin is upside down so the ydir cases - * are reversed. + * are reversed. * * KW: can you believe that this is called even when a 2d window moves? */ static void -I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, +I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, RegionPtr prgnSrc, CARD32 index) { ScreenPtr pScreen = pParent->drawable.pScreen; @@ -988,21 +1001,21 @@ I810DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, I810EmitFlush(pScrn); I810SetupForScreenToScreenCopy(pScrn, xdir, ydir, GXcopy, -1, -1); for ( ; nbox-- ; pbox++ ) { - + int x1 = pbox->x1; int y1 = pbox->y1; int destx = x1 + dx; int desty = y1 + dy; int w = pbox->x2 - x1 + 1; int h = pbox->y2 - y1 + 1; - - if ( destx < 0 ) x1 -= destx, w += destx, destx = 0; + + if ( destx < 0 ) x1 -= destx, w += destx, destx = 0; if ( desty < 0 ) y1 -= desty, h += desty, desty = 0; if ( destx + w > screenwidth ) w = screenwidth - destx; if ( desty + h > screenheight ) h = screenheight - desty; if ( w <= 0 ) continue; if ( h <= 0 ) continue; - + if (I810_DEBUG & DEBUG_VERBOSE_DRI) ErrorF( "MoveBuffers %d,%d %dx%d dx: %d dy: %d\n", diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c index 603baf7d4..5e3ae9c45 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_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/i810/i810_driver.c,v 1.46 2001/04/18 14:52:41 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.49.2.1 2001/05/23 20:21:52 dawes Exp $ */ /* * Authors: @@ -71,7 +71,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* Required Functions: */ static void I810Identify(int flags); -static OptionInfoPtr I810AvailableOptions(int chipid, int busid); +static const OptionInfoRec * I810AvailableOptions(int chipid, int busid); static Bool I810Probe(DriverPtr drv, int flags); static Bool I810PreInit(ScrnInfoPtr pScrn, int flags); static Bool I810ScreenInit(int Index, ScreenPtr pScreen, int argc, char **argv); @@ -124,7 +124,7 @@ typedef enum { OPTION_NO_DDC } I810Opts; -static OptionInfoRec I810Options[] = { +static const OptionInfoRec I810Options[] = { { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_COLOR_KEY, "ColorKey", OPTV_INTEGER, {0}, FALSE }, @@ -355,8 +355,7 @@ I810Identify(int flags) { xf86PrintChipsets(I810_NAME, "Driver for Intel i810 chipset", I810Chipsets); } -static -OptionInfoPtr +static const OptionInfoRec * I810AvailableOptions(int chipid, int busid) { return I810Options; @@ -440,9 +439,10 @@ I810DoDDC(ScrnInfoPtr pScrn, int index) { vbeInfoPtr pVbe; xf86MonPtr MonInfo = NULL; + I810Ptr pI810 = I810PTR(pScrn); /* Honour Option "noDDC" */ - if (xf86ReturnOptValBool(I810Options, OPTION_NO_DDC, FALSE) ) { + if (xf86ReturnOptValBool(pI810->Options, OPTION_NO_DDC, FALSE) ) { return MonInfo; } @@ -478,14 +478,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) { if (pScrn->numEntities != 1) return FALSE; - /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) return FALSE; - - xf86LoaderReqSymLists(vgahwSymbols, NULL); - - /* Allocate a vgaHWRec */ - if (!vgaHWGetHWRec(pScrn)) return FALSE; - /* Allocate driverPrivate */ if (!I810GetRec(pScrn)) return FALSE; @@ -499,6 +491,14 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) { return TRUE; } + /* The vgahw module should be loaded here when needed */ + if (!xf86LoadSubModule(pScrn, "vgahw")) return FALSE; + + xf86LoaderReqSymLists(vgahwSymbols, NULL); + + /* Allocate a vgaHWRec */ + if (!vgaHWGetHWRec(pScrn)) return FALSE; + pI810->PciInfo = xf86GetPciInfoForEntity(pI810->pEnt->index); pI810->PciTag = pciTag(pI810->PciInfo->bus, pI810->PciInfo->device, pI810->PciInfo->func); @@ -541,10 +541,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) { return FALSE; } - pScrn->rgbBits=8; - if (xf86ReturnOptValBool(I810Options, OPTION_DAC_6BIT, FALSE)) - pScrn->rgbBits=6; - if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight)) return FALSE; @@ -559,13 +555,20 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) { /* Process the options */ xf86CollectOptions(pScrn, NULL); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, I810Options); + if (!(pI810->Options = xalloc(sizeof(I810Options)))) + return FALSE; + memcpy(pI810->Options, I810Options, sizeof(I810Options)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pI810->Options); + + pScrn->rgbBits=8; + if (xf86ReturnOptValBool(pI810->Options, OPTION_DAC_6BIT, FALSE)) + pScrn->rgbBits=6; /* 6-BIT dac isn't reasonable for modes with > 8bpp */ - if (xf86ReturnOptValBool(I810Options, OPTION_DAC_6BIT, FALSE) && + if (xf86ReturnOptValBool(pI810->Options, OPTION_DAC_6BIT, FALSE) && pScrn->bitsPerPixel>8) { OptionInfoPtr ptr; - ptr=xf86TokenToOptinfo(I810Options, OPTION_DAC_6BIT); + ptr=xf86TokenToOptinfo(pI810->Options, OPTION_DAC_6BIT); ptr->found=FALSE; } @@ -690,9 +693,23 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) { xf86DrvMsg(pScrn->scrnIndex, from, "Will alloc AGP framebuffer: %d kByte\n", pScrn->videoRam); - /* Since we always want write combining on first 32 mb of framebuffer - * we pass a mapsize of 32 mb */ - pI810->FbMapSize = 32*1024*1024; + /* Calculate Fixed Offsets depending on graphics aperture size */ + { + PCITAG bridge; + long smram_miscc; + + bridge = pciTag(0,0,0); /* This is always the host bridge */ + smram_miscc = pciReadLong(bridge, SMRAM_MISCC); + if((smram_miscc & GFX_MEM_WIN_SIZE) == GFX_MEM_WIN_32M) { + pI810->FbMapSize = 0x1000000; + pI810->DepthOffset = 0x1000000; + pI810->BackOffset = 0x1800000; + } else { + pI810->FbMapSize = 0x3000000; + pI810->DepthOffset = 0x3000000; + pI810->BackOffset = 0x3800000; + } + } /* * If the driver can do gamma correction, it should call xf86SetGamma() @@ -786,14 +803,14 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) { } xf86LoaderReqSymbols("fbScreenInit", NULL); - if (!xf86ReturnOptValBool(I810Options, OPTION_NOACCEL, FALSE)) { + if (!xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE)) { if (!xf86LoadSubModule(pScrn, "xaa")) { I810FreeRec(pScrn); return FALSE; } } - if (!xf86ReturnOptValBool(I810Options, OPTION_SW_CURSOR, FALSE)) { + if (!xf86ReturnOptValBool(pI810->Options, OPTION_SW_CURSOR, FALSE)) { if (!xf86LoadSubModule(pScrn, "ramdac")) { I810FreeRec(pScrn); return FALSE; @@ -801,7 +818,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) { xf86LoaderReqSymLists(ramdacSymbols, NULL); } - if (xf86GetOptValInteger(I810Options, OPTION_COLOR_KEY, &(pI810->colorKey))) + if (xf86GetOptValInteger(pI810->Options, OPTION_COLOR_KEY, &(pI810->colorKey))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video overlay key set to 0x%x\n", pI810->colorKey); @@ -1394,7 +1411,7 @@ I810SetMode(ScrnInfoPtr pScrn, DisplayModePtr mode) } /* Turn on 8 bit dac if requested */ - if (xf86ReturnOptValBool(I810Options, OPTION_DAC_6BIT, FALSE)) + if (xf86ReturnOptValBool(pI810->Options, OPTION_DAC_6BIT, FALSE)) i810Reg->PixelPipeCfg0 = DAC_6_BIT; else i810Reg->PixelPipeCfg0 = DAC_8_BIT; @@ -1526,6 +1543,32 @@ I810ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) return TRUE; } + +static void +I810LoadPalette15(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, + VisualPtr pVisual) { + I810Ptr pI810; + vgaHWPtr hwp; + int i, j, index; + unsigned char r, g, b; + + pI810 = I810PTR(pScrn); + hwp = VGAHWPTR(pScrn); + + for (i=0; i<numColors; i++) { + index=indices[i]; + r=colors[index].red; + g=colors[index].green; + b=colors[index].blue; + for (j=0; j<8; j++) { + hwp->writeDacWriteAddr(hwp, (index<<3)+j); + hwp->writeDacData(hwp, r); + hwp->writeDacData(hwp, g); + hwp->writeDacData(hwp, b); + } + } +} + static void I810LoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual) { @@ -1629,7 +1672,7 @@ I810AllocateFront(ScrnInfoPtr pScrn) { pI810->FbMemBox.y1=0; pI810->FbMemBox.y2=pScrn->virtualY; - xf86GetOptValInteger(I810Options, OPTION_CACHE_LINES, &cache_lines); + xf86GetOptValInteger(pI810->Options, OPTION_CACHE_LINES, &cache_lines); if (cache_lines < 0) { /* make sure there is enough for two DVD sized YUV buffers */ @@ -1637,14 +1680,25 @@ I810AllocateFront(ScrnInfoPtr pScrn) { if (pScrn->displayWidth <= 1024) cache_lines *= 2; } - /* Make sure there's enough space for cache_lines. */ + /* Make sure there's enough space for cache_lines. + * + * Had a bug here where maxCacheLines was computed to be less than 0. + * Not sure why 256 was initially subtracted from videoRam in the + * maxCacheLines calculation, but that was causing a problem + * for configurations that have exactly enough Ram for the framebuffer. + * Common code should catch the case where there isn't enough space for + * framebuffer, we'll just check for no space for cache_lines. -jens + * + */ { int maxCacheLines; - maxCacheLines = ((pScrn->videoRam - 256) * 1024 / + maxCacheLines = (pScrn->videoRam * 1024 / (pScrn->bitsPerPixel / 8) / pScrn->displayWidth) - pScrn->virtualY; - if (maxCacheLines >= 0 && cache_lines > maxCacheLines) + if (maxCacheLines < 0) + maxCacheLines = 0; + if (cache_lines > maxCacheLines) cache_lines = maxCacheLines; } pI810->FbMemBox.y2 += cache_lines; @@ -1735,8 +1789,8 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { * InitGLXVisuals call back. */ - if (xf86ReturnOptValBool(I810Options, OPTION_NOACCEL, FALSE) || - !xf86ReturnOptValBool(I810Options, OPTION_DRI, TRUE)) { + if (xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE) || + !xf86ReturnOptValBool(pI810->Options, OPTION_DRI, TRUE)) { pI810->directRenderingEnabled = FALSE; driFrom = X_CONFIG; } else { @@ -1816,7 +1870,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { return FALSE; } - if (!xf86ReturnOptValBool(I810Options, OPTION_NOACCEL, FALSE)) { + if (!xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE)) { if (pI810->LpRing.mem.Size != 0) { I810SetRingRegs( pScrn ); @@ -1833,7 +1887,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); - if (!xf86ReturnOptValBool(I810Options, OPTION_SW_CURSOR, FALSE)) { + if (!xf86ReturnOptValBool(pI810->Options, OPTION_SW_CURSOR, FALSE)) { if (!I810CursorInit(pScreen)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Hardware cursor initialization failed\n"); @@ -1844,10 +1898,17 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { /* Use driver specific palette load routines for Direct Color support. -jens */ if (pScrn->bitsPerPixel==16) { - if (!xf86HandleColormaps(pScreen, 256, 8, I810LoadPalette16, 0, - CMAP_PALETTED_TRUECOLOR| - CMAP_RELOAD_ON_MODE_SWITCH)) + if (pScrn->depth == 15) { + if (!xf86HandleColormaps(pScreen, 256, 8, I810LoadPalette15, 0, + CMAP_PALETTED_TRUECOLOR| + CMAP_RELOAD_ON_MODE_SWITCH)) + return FALSE; + } else { + if (!xf86HandleColormaps(pScreen, 256, 8, I810LoadPalette16, 0, + CMAP_PALETTED_TRUECOLOR| + CMAP_RELOAD_ON_MODE_SWITCH)) return FALSE; + } } else { if (!xf86HandleColormaps(pScreen, 256, 8, I810LoadPalette24, 0, CMAP_PALETTED_TRUECOLOR| @@ -2043,6 +2104,11 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen) pI810->DcacheMem = pI810->SavedDcacheMem; pI810->DoneFrontAlloc = FALSE; + /* Need to actually close the gart fd, or the unbound memory will just sit + * around. Will prevent the Xserver from recycling. + */ + xf86GARTCloseScreen(scrnIndex); + pScrn->vtSema=FALSE; pScreen->CloseScreen = pI810->CloseScreen; return (*pScreen->CloseScreen)(scrnIndex, pScreen); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile index 313ed5002..cc9bdbd3b 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile,v 1.4 2001/01/24 00:06:20 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/Imakefile,v 1.5 2001/05/16 06:48:09 keithp Exp $ /* * * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> @@ -16,10 +16,10 @@ OBJS = imstt_driver.o imstt_accel.o INCLUDES = -I. -I../../include #else INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ + -I$(XF86SRC)/xaa \ -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \ - -I$(XF86SRC)/xf24_32bpp -I$(SERVERSRC)/Xext \ + -I$(SERVERSRC)/Xext \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ -I$(XF86SRC)/fbdevhw -I$(SERVERSRC)/render \ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h index 095dead6b..b714aafeb 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h,v 1.4 2001/04/05 21:29:14 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt.h,v 1.5 2001/05/16 06:48:09 keithp Exp $ */ #ifndef _IMSTT_H #define _IMSTT_H @@ -59,9 +59,11 @@ typedef struct _IMSTTRec { } IMSTTRec, *IMSTTPtr; #if 0 -#define IMSTTTRACE ErrorF +#define IMSTTTRACE(s) ErrorF(s) +#define IMSTTTRACE1(s,a) ErrorF(s,a) #else -#define IMSTTTRACE +#define IMSTTTRACE(s) +#define IMSTTTRACE1(s,a) #endif #define IMSTTPTR(p) ((IMSTTPtr)((p)->driverPrivate)) @@ -72,4 +74,6 @@ typedef struct _IMSTTRec { #define RAMDAC_IBM 1 #define RAMDAC_TVP 2 +Bool IMSTTAccelInit(ScreenPtr pScreen); + #endif /* _IMSTT_H */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c index 5eef2aa19..86dca5854 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c,v 1.5 2001/04/05 21:29:14 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_accel.c,v 1.6 2001/05/16 06:48:09 keithp Exp $ */ /* * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> @@ -41,7 +41,7 @@ static void IMSTTSync(ScrnInfoPtr pScrn) { IMSTTPtr iptr = IMSTTPTR(pScrn); - IMSTTMMIO_VARS(); +/* IMSTTMMIO_VARS(); */ while(INREG(IMSTT_SSTATUS) & 0x80); while(INREG(IMSTT_SSTATUS) & 0x40); @@ -54,7 +54,7 @@ static void IMSTTSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, unsigned int planemask) { IMSTTPtr iptr = IMSTTPTR(pScrn); - IMSTTMMIO_VARS(); +/* IMSTTMMIO_VARS(); */ switch (pScrn->depth) { case 8: @@ -75,7 +75,7 @@ static void IMSTTSubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h) { IMSTTPtr iptr = IMSTTPTR(pScrn); - IMSTTMMIO_VARS(); +/* IMSTTMMIO_VARS(); */ x *= (pScrn->bitsPerPixel >> 3); y *= iptr->ll; @@ -107,8 +107,8 @@ static void IMSTTSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int trans_color) { IMSTTPtr iptr = IMSTTPTR(pScrn); - IMSTTMMIO_VARS(); - unsigned long sp, dp, ll, cnt; +/* IMSTTMMIO_VARS(); */ + unsigned long sp, dp, ll; iptr->bltctl = 0x05; @@ -146,7 +146,7 @@ static void IMSTTSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int w, int h) { IMSTTPtr iptr = IMSTTPTR(pScrn); - IMSTTMMIO_VARS(); +/* IMSTTMMIO_VARS(); */ unsigned long cnt; x1 *= (pScrn->bitsPerPixel >> 3); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c index 70d8f9c67..23631ee12 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c,v 1.11 2001/04/05 21:29:14 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/imstt/imstt_driver.c,v 1.15 2001/05/16 06:48:09 keithp Exp $ */ /* * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> @@ -46,12 +46,7 @@ #include "mibstore.h" #include "fbdevhw.h" -#define PSZ 8 -#include "cfb.h" -#undef PSZ -#include "cfb16.h" -#include "cfb24.h" -#include "cfb32.h" +#include "fb.h" #include "xf86cmap.h" @@ -67,19 +62,23 @@ /* * prototypes */ -static OptionInfoPtr IMSTTAvailableOptions(int chipid, int busid); +static const OptionInfoRec * IMSTTAvailableOptions(int chipid, int busid); static void IMSTTIdentify(int flags); static Bool IMSTTProbe(DriverPtr drv, int flags); static Bool IMSTTPreInit(ScrnInfoPtr pScrn, int flags); +#if 0 static Bool IMSTTEnterVT(int scrnIndex, int flags); static void IMSTTLeaveVT(int scrnIndex, int flags); static void IMSTTSave(ScrnInfoPtr pScrn); +#endif static Bool IMSTTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv); +#if 0 static int IMSTTInternalScreenInit(int scrnIndex, ScreenPtr pScreen); static ModeStatus IMSTTValidMode(int index, DisplayModePtr mode, Bool verbose, int flags); +#endif static Bool IMSTTMapMem(ScrnInfoPtr pScrn); static void IMSTTUnmapMem(ScrnInfoPtr pScrn); @@ -87,10 +86,11 @@ static Bool IMSTTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); static void IMSTTAdjustFrame(int scrnIndex, int x, int y, int flags); Bool IMSTTCloseScreen(int scrnIndex, ScreenPtr pScreen); Bool IMSTTSaveScreen(ScreenPtr pScreen, int mode); +#if 0 static void IMSTTLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, LOCO *colors, VisualPtr pVisual); - +#endif static void IMSTTGetVideoMemSize(ScrnInfoPtr pScrn); static void IMSTTSetClock(ScrnInfoPtr pScrn, unsigned long mhz); static void IMSTTWriteMode(ScrnInfoPtr pScrn); @@ -137,28 +137,20 @@ typedef enum { OPTION_FBDEV } IMSTTOpts; -static OptionInfoRec IMSTTOptions[] = +static const OptionInfoRec IMSTTOptions[] = { { OPTION_NOACCEL, "noaccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SWCURSOR, "swcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_INITDAC, "initdac", OPTV_BOOLEAN, {0}, FALSE }, - { OPTION_FBDEV, "UseFBDev", OPTV_BOOLEAN, {0}, FALSE } + { OPTION_FBDEV, "UseFBDev", OPTV_BOOLEAN, {0}, FALSE }, + { -1, NULL, OPTV_NONE, {0}, FALSE } }; - -static const char *cfbSymbols[] = { - "cfbScreenInit", - "cfb16ScreenInit", - "cfb24ScreenInit", - "cfb32ScreenInit", - "cfb16BresS", - "cfb24BresS", - NULL -}; - - static const char *fbSymbols[] = { "fbScreenInit", +#ifdef RENDER + "fbPictureInit", +#endif NULL }; @@ -225,7 +217,7 @@ pointer IMSTTSetup(pointer module, pointer opts, int *errmaj, if (!setupDone) { setupDone = TRUE; xf86AddDriver(&IMSTT, module, 0); - LoaderRefSymLists(cfbSymbols, xaaSymbols, fbdevHWSymbols, NULL); + LoaderRefSymLists(fbSymbols, xaaSymbols, fbdevHWSymbols, NULL); return (pointer) 1; } else { if (errmaj) @@ -260,7 +252,7 @@ static void IMSTTFreeRec(ScrnInfoPtr pScrn) } -static OptionInfoPtr IMSTTAvailableOptions(int chipid, int busid) +static const OptionInfoRec * IMSTTAvailableOptions(int chipid, int busid) { return IMSTTOptions; } @@ -333,11 +325,8 @@ static Bool IMSTTPreInit(ScrnInfoPtr pScrn, int flags) { EntityInfoPtr pEnt; IMSTTPtr iptr; - MessageType from = X_DEFAULT; int i; ClockRangePtr clockRanges; - char *mod = NULL; - const char *reqSym = NULL; rgb zeros = {0, 0, 0}; Gamma gzeros = {0.0, 0.0, 0.0}; @@ -387,15 +376,18 @@ static Bool IMSTTPreInit(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, IMSTTOptions); + if (!(iptr->Options = xalloc(sizeof(IMSTTOptions)))) + return FALSE; + memcpy(iptr->Options, IMSTTOptions, sizeof(IMSTTOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, iptr->Options); - if (xf86ReturnOptValBool(IMSTTOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(iptr->Options, OPTION_NOACCEL, FALSE)) { iptr->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - acceleration disabled\n"); } else iptr->NoAccel = FALSE; #if 0 - if (xf86ReturnOptValBool(IMSTTOptions, OPTION_SWCURSOR, FALSE)) + if (xf86ReturnOptValBool(iptr->Options, OPTION_SWCURSOR, FALSE)) iptr->HWCursor = FALSE; else iptr->HWCursor = TRUE; @@ -407,14 +399,14 @@ static Bool IMSTTPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using %s cursor\n", iptr->HWCursor ? "HW" : "SW"); - if (xf86ReturnOptValBool(IMSTTOptions, OPTION_INITDAC, FALSE)) { + if (xf86ReturnOptValBool(iptr->Options, OPTION_INITDAC, FALSE)) { iptr->InitDAC = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: not initalizing DACn"); } else { iptr->InitDAC = FALSE; } - if (xf86ReturnOptValBool(IMSTTOptions, OPTION_FBDEV, FALSE)) { + if (xf86ReturnOptValBool(iptr->Options, OPTION_FBDEV, FALSE)) { iptr->FBDev = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using framebuffer device\n"); @@ -530,7 +522,7 @@ static Bool IMSTTPreInit(ScrnInfoPtr pScrn, int flags) i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, pScrn->display->modes, clockRanges, NULL, 256, 2048, pScrn->bitsPerPixel, - 128, 2048, pScrn->virtualX, + 128, 2048, pScrn->display->virtualX, pScrn->display->virtualY, iptr->videoRam, LOOKUP_BEST_REFRESH); @@ -560,7 +552,7 @@ static Bool IMSTTPreInit(ScrnInfoPtr pScrn, int flags) xf86SetDpi(pScrn, 0, 0); xf86LoadSubModule(pScrn, "fb"); - xf86LoaderReqSymbols("fbScreenInit", NULL); + xf86LoaderReqSymLists(fbSymbols, NULL); if (!xf86LoadSubModule(pScrn, "xaa")) return FALSE; @@ -589,7 +581,7 @@ static Bool IMSTTMapMem(ScrnInfoPtr pScrn) return FALSE; } - IMSTTTRACE("Mapped MMIO @ 0x%x with size 0x1000\n", iptr->PciInfo->memBase[0] + 0x800000); + IMSTTTRACE1("Mapped MMIO @ 0x%x with size 0x1000\n", iptr->PciInfo->memBase[0] + 0x800000); IMSTTGetVideoMemSize(pScrn); @@ -655,8 +647,7 @@ static void IMSTTUnmapMem(ScrnInfoPtr pScrn) static void IMSTTGetVideoMemSize(ScrnInfoPtr pScrn) { - IMSTTPtr iptr; - IMSTTMMIO_VARS(); + IMSTTPtr iptr = IMSTTPTR(pScrn); unsigned long tmp; if (iptr->FBDev) { @@ -679,7 +670,6 @@ static Bool IMSTTScreenInit(int scrnIndex, ScreenPtr pScreen, { ScrnInfoPtr pScrn; IMSTTPtr iptr; - IMSTTMMIO_VARS(); unsigned long tmp; VisualPtr visual; int r = TRUE; @@ -797,25 +787,21 @@ static Bool IMSTTScreenInit(int scrnIndex, ScreenPtr pScreen, return FALSE; } - switch (pScrn->bitsPerPixel) { - case 8: - case 16: - case 24: - case 32: - r = fbScreenInit(pScreen, iptr->FBBase, pScrn->virtualX, - pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth, pScrn->bitsPerPixel); - break; - default: - ErrorF("invalid bpp %d\n", pScrn->bitsPerPixel); - return FALSE; - } + miSetPixmapDepths (); + + r = fbScreenInit(pScreen, iptr->FBBase, pScrn->virtualX, + pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth, pScrn->bitsPerPixel); if (!r) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ScreenInit failed\n"); return FALSE; } +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif + if (pScrn->bitsPerPixel > 8) { visual = pScreen->visuals + pScreen->numVisuals; while (--visual >= pScreen->visuals) { @@ -872,7 +858,6 @@ static Bool IMSTTScreenInit(int scrnIndex, ScreenPtr pScreen, static Bool IMSTTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) { IMSTTPtr iptr; - IMSTTMMIO_VARS(); unsigned long mhz; unsigned short hes, heb, veb, htp, vtp; @@ -1115,9 +1100,8 @@ static void IMSTTWriteMode(ScrnInfoPtr pScrn) { IMSTTPtr iptr; unsigned char pixformat; - unsigned long ctl, pitch, byteswap, scr; - unsigned char tcc, mxc, lckl_n, mic, mlc, lckl_p; - IMSTTMMIO_VARS(); + unsigned long ctl = 0, pitch = 0, byteswap = 0, scr = 0; + unsigned char tcc = 0, mxc = 0, lckl_n = 0, mic, mlc = 0, lckl_p = 0; iptr = IMSTTPTR(pScrn); @@ -1288,7 +1272,6 @@ static void IMSTTAdjustFrame(int scrnIndex, int x, int y, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; IMSTTPtr iptr; - IMSTTMMIO_VARS(); unsigned long offset; iptr = IMSTTPTR(pScrn); @@ -1316,7 +1299,5 @@ Bool IMSTTCloseScreen(int scrnIndex, ScreenPtr pScreen) Bool IMSTTSaveScreen(ScreenPtr pScreen, int mode) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - return TRUE; } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h index fd24a1a61..c2ec1e39c 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.74 2001/04/18 15:29:18 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v 1.75 2001/05/04 19:05:41 dawes Exp $ */ /* * MGA Millennium (MGA2064W) functions * @@ -372,6 +372,7 @@ typedef struct { #ifdef USEMGAHAL Bool HALLoaded; #endif + OptionInfoPtr Options; } MGARec, *MGAPtr; extern CARD32 MGAAtype[16]; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man index 7246cf563..aa6733c49 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man +++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man,v 1.2 2001/01/27 18:20:51 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man,v 1.3 2001/05/10 21:53:48 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH MGA __drivermansuffix__ __vendorversion__ @@ -20,7 +20,10 @@ accelerated, and provides support for the following framebuffer depths: visual types are supported for depth 8, and both TrueColor and DirectColor visuals are supported for the other depths except 8+24 mode which supports PseudoColor, GrayScale and TrueColor. Multi-head configurations -are supported. +are supported. XVideo is supported on G200 and newer systems, with +either +.B TexturedVideo +or video overlay. .SH SUPPORTED HARDWARE The .B mga @@ -97,7 +100,7 @@ only). Default: off. Enable 8+24 overlay mode. Only appropriate for depth 24. .RB ( Note: the G100 is unaccelerated in the 8+24 overlay mode due to a missing -hardware feature) Default: off. +hardware feature.) Default: off. .TP .BI "Option \*qPciRetry\*q \*q" boolean \*q Enable or disable PCI retries. Default: off. 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 83154198f..9b01d1d8b 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.20 2001/04/10 16:08:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.21 2001/05/02 15:06:09 dawes Exp $ */ /* * Copyright 2000 VA Linux Systems Inc., Fremont, California. @@ -355,7 +355,7 @@ static void MGAWaitForIdleDMA( ScrnInfoPtr pScrn ) return; xf86DrvMsg( pScrn->scrnIndex, X_ERROR, - "Idle timed out, resetting engine...\n" ); + "[dri] Idle timed out, resetting engine...\n" ); drmMGAEngineReset( pMga->drmFD ); } @@ -919,7 +919,7 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) if ( !xf86LoaderCheckSymbol( "drmAvailable" ) ) return FALSE; if ( !xf86LoaderCheckSymbol( "DRIQueryVersion" ) ) { xf86DrvMsg( pScreen->myNum, X_ERROR, - "MGADRIScreenInit failed (libdri.a too old)\n" ); + "[dri] MGADRIScreenInit failed (libdri.a too old)\n" ); return FALSE; } @@ -927,11 +927,11 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) { int major, minor, patch; DRIQueryVersion( &major, &minor, &patch ); - if ( major != 4 || minor < 0) { + if ( major != 4 || minor < 0 ) { xf86DrvMsg( pScreen->myNum, X_ERROR, - "[drm] MGADRIScreenInit failed " - "(DRI version = %d.%d.%d, expected 4.0.x). " - "Disabling DRI.\n", + "[dri] MGADRIScreenInit failed because of a version mismatch.\n" + "[dri] libDRI version = %d.%d.%d but version 4.0.x is needed.\n" + "[dri] Disabling the DRI.\n", major, minor, patch ); return FALSE; } @@ -944,14 +944,14 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) if ( (pScrn->bitsPerPixel / 8) != 2 && (pScrn->bitsPerPixel / 8) != 4 ) { xf86DrvMsg( pScreen->myNum, X_ERROR, - "[drm] Direct rendering only supported in 16 and 32 bpp modes\n" ); + "[dri] Direct rendering only supported in 16 and 32 bpp modes\n" ); return FALSE; } pDRIInfo = DRICreateInfoRec(); if ( !pDRIInfo ) { xf86DrvMsg( pScreen->myNum, X_ERROR, - "[drm] DRICreateInfoRec() failed\n" ); + "[dri] DRICreateInfoRec() failed\n" ); return FALSE; } pMga->pDRIInfo = pDRIInfo; @@ -1059,7 +1059,7 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) DRIDestroyInfoRec( pMga->pDRIInfo ); pMga->pDRIInfo = 0; xf86DrvMsg( pScreen->myNum, X_ERROR, - "[drm] DRIScreenInit Failed\n" ); + "[drm] DRIScreenInit failed. Disabling DRI.\n" ); return FALSE; } @@ -1068,12 +1068,12 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) drmVersionPtr version = drmGetVersion(pMga->drmFD); if ( version ) { if ( version->version_major != 3 || - version->version_minor < 0) { + version->version_minor < 0 ) { /* incompatible drm version */ xf86DrvMsg( pScreen->myNum, X_ERROR, - "[drm] MGADRIScreenInit failed " - "(DRM version = %d.%d.%d, expected 3.0.x). " - "Disabling DRI.\n", + "[dri] MGADRIScreenInit failed because of a version mismatch.\n" + "[dri] mga.o kernel module version is %d.%d.%d but version 3.0.x is needed.\n" + "[dri] Disabling DRI.\n", version->version_major, version->version_minor, version->version_patchlevel ); @@ -1117,7 +1117,7 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) DRICloseScreen( pScreen ); return FALSE; } - xf86DrvMsg( pScrn->scrnIndex, X_INFO, "visual configs initialized\n" ); + xf86DrvMsg( pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized\n" ); return TRUE; } 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 c1bf3ef23..ebb885bcc 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c @@ -45,7 +45,7 @@ * Added digital screen option for first head */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.199 2001/04/27 05:14:04 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.202.2.2 2001/05/28 14:23:38 eich Exp $ */ /* * This is a first cut at a non-accelerated version to work with the @@ -103,7 +103,7 @@ */ /* Mandatory functions */ -static OptionInfoPtr MGAAvailableOptions(int chipid, int busid); +static const OptionInfoRec * MGAAvailableOptions(int chipid, int busid); static void MGAIdentify(int flags); static Bool MGAProbe(DriverPtr drv, int flags); static Bool MGAPreInit(ScrnInfoPtr pScrn, int flags); @@ -221,7 +221,7 @@ typedef enum { OPTION_DRI } MGAOpts; -static OptionInfoRec MGAOptions[] = { +static const OptionInfoRec MGAOptions[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE }, @@ -547,8 +547,7 @@ MGAFreeRec(ScrnInfoPtr pScrn) pScrn->driverPrivate = NULL; } -static -OptionInfoPtr +static const OptionInfoRec * MGAAvailableOptions(int chipid, int busid) { return MGAOptions; @@ -737,7 +736,7 @@ MGAProbe(DriverPtr drv, int flags) static void MGAReadBios(ScrnInfoPtr pScrn) { - CARD8 tmp[ 64 ]; + CARD8 BIOS[0x10000]; CARD16 offset; CARD8 chksum; CARD8 *pPINSInfo; @@ -745,6 +744,7 @@ MGAReadBios(ScrnInfoPtr pScrn) MGABiosInfo *pBios; MGABios2Info *pBios2; Bool pciBIOS = TRUE; + int rlen; pMga = MGAPTR(pScrn); pBios = &pMga->Bios; @@ -760,32 +760,36 @@ MGAReadBios(ScrnInfoPtr pScrn) else if (pMga->BiosFrom == X_CONFIG && pMga->BiosAddress < 0x100000) pciBIOS = TRUE; -#define MGADoBIOSRead(offset, buf, len) \ - (pciBIOS ? \ - xf86ReadPciBIOS(offset, pMga->PciTag, pMga->FbBaseReg, buf, len) : \ - xf86ReadBIOS(pMga->BiosAddress, offset, buf, len)) - - MGADoBIOSRead(0, tmp, sizeof( tmp )); - if ( - tmp[ 0 ] != 0x55 - || tmp[ 1 ] != 0xaa - || strncmp(( char * )( tmp + 45 ), "MATROX", 6 ) - ) { + if (pciBIOS) + rlen = xf86ReadPciBIOS(0, pMga->PciTag, pMga->FbBaseReg, + BIOS, sizeof(BIOS)); + else + rlen = xf86ReadBIOS(pMga->BiosAddress, 0, BIOS, sizeof(BIOS)); + + if (rlen < (BIOS[2] << 9)) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Could not retrieve video BIOS!\n"); + return; + } + + if (strncmp((char *)(&BIOS[45]), "MATROX", 6)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Video BIOS info block not detected!\n"); return; } /* Get the info block offset */ - MGADoBIOSRead(0x7ffc, ( CARD8 * ) & offset, sizeof( offset )); - + offset = (BIOS[0x7ffd] << 8) | BIOS[0x7ffc]; /* Let the world know what we are up to */ xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Video BIOS info block at offset 0x%05lX\n", (long)(offset)); +#define MGADoBIOSRead(offset, buf, len) memcpy(buf, &BIOS[offset], len) + /* Copy the info block */ + /* XXX What about big-endianness? */ switch (pMga->Chipset){ case PCI_CHIP_MGA2064: MGADoBIOSRead(offset, @@ -796,7 +800,6 @@ MGAReadBios(ScrnInfoPtr pScrn) ( CARD8 * ) & pBios2->PinID, sizeof( MGABios2Info )); } - /* matrox millennium-2 and mystique pins info */ if ( pBios2->PinID == 0x412e ) { int i; @@ -847,7 +850,6 @@ MGAReadBios(ScrnInfoPtr pScrn) ErrorF("Pins[0x%02x] is 0x%02x\n", i, ((unsigned char *)pBios2)[i]); #endif - return; } else { /* Set default MCLK values (scaled by 10 kHz) */ if ( pBios->ClkBase == 0 ) @@ -857,7 +859,6 @@ MGAReadBios(ScrnInfoPtr pScrn) if ( pBios->Clk8MB == 0 ) pBios->Clk8MB = pBios->Clk4MB; pBios2->PinID = 0; /* not in use */ - return; } } @@ -1016,6 +1017,36 @@ MGAdoDDC(ScrnInfoPtr pScrn) pMga = MGAPTR(pScrn); MGAdac = &pMga->Dac; + /* Load DDC if we have the code to use it */ + /* This gives us DDC1 */ + if (pMga->ddc1Read || pMga->i2cInit) { + if (xf86LoadSubModule(pScrn, "ddc")) { + xf86LoaderReqSymLists(ddcSymbols, NULL); + } else { + /* ddc module not found, we can do without it */ + pMga->ddc1Read = NULL; + + /* Without DDC, we have no use for the I2C bus */ + pMga->i2cInit = NULL; + return NULL; + } + } else + return NULL; + +#if MGAuseI2C + /* - DDC can use I2C bus */ + /* Load I2C if we have the code to use it */ + if (pMga->i2cInit) { + if ( xf86LoadSubModule(pScrn, "i2c") ) { + xf86LoaderReqSymLists(i2cSymbols,NULL); + } else { + /* i2c module not found, we can do without it */ + pMga->i2cInit = NULL; + pMga->I2C = NULL; + } + } +#endif /* MGAuseI2C */ + /* Map the MGA memory and MMIO areas */ if (!MGAMapMem(pScrn)) return NULL; @@ -1147,6 +1178,7 @@ MGAProbeDDC(ScrnInfoPtr pScrn, int index) if (xf86LoadSubModule(pScrn, "vbe")) { pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); + vbeFree(pVbe); } } @@ -1388,11 +1420,14 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, MGAOptions); + if (!(pMga->Options = xalloc(sizeof(MGAOptions)))) + return FALSE; + memcpy(pMga->Options, MGAOptions, sizeof(MGAOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pMga->Options); #if !defined(__powerpc__) pMga->softbooted = FALSE; - if (xf86ReturnOptValBool(MGAOptions, OPTION_INT10, FALSE) && + if (xf86ReturnOptValBool(pMga->Options, OPTION_INT10, FALSE) && xf86LoadSubModule(pScrn, "int10")) { xf86Int10InfoPtr pInt; @@ -1435,7 +1470,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) } #ifdef USEMGAHAL - if (HAL_CHIPSETS && !xf86ReturnOptValBool(MGAOptions, OPTION_NOHAL, FALSE) + if (HAL_CHIPSETS && !xf86ReturnOptValBool(pMga->Options, OPTION_NOHAL, FALSE) && xf86LoadSubModule(pScrn, "mga_hal")) { xf86LoaderReqSymLists(halSymbols, NULL); xf86DrvMsg(pScrn->scrnIndex, X_INFO,"Matrox HAL module used\n"); @@ -1467,7 +1502,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) from = X_DEFAULT; pMga->agpMode = MGA_DEFAULT_AGP_MODE; - if (xf86GetOptValInteger(MGAOptions, + if (xf86GetOptValInteger(pMga->Options, OPTION_AGP_MODE, &(pMga->agpMode))) { if (pMga->agpMode < 1) { pMga->agpMode = 1; @@ -1488,40 +1523,40 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) * The preferred method is to use the "hw cursor" option as a tri-state * option, with the default set above. */ - if (xf86GetOptValBool(MGAOptions, OPTION_HW_CURSOR, &pMga->HWCursor)) { + if (xf86GetOptValBool(pMga->Options, OPTION_HW_CURSOR, &pMga->HWCursor)) { from = X_CONFIG; } /* For compatibility, accept this too (as an override) */ - if (xf86ReturnOptValBool(MGAOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pMga->Options, OPTION_NOACCEL, FALSE)) { pMga->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } - if (xf86ReturnOptValBool(MGAOptions, OPTION_PCI_RETRY, FALSE)) { + if (xf86ReturnOptValBool(pMga->Options, OPTION_PCI_RETRY, FALSE)) { pMga->UsePCIRetry = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n"); } - if (xf86ReturnOptValBool(MGAOptions, OPTION_SYNC_ON_GREEN, FALSE)) { + if (xf86ReturnOptValBool(pMga->Options, OPTION_SYNC_ON_GREEN, FALSE)) { pMga->SyncOnGreen = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Sync-on-Green enabled\n"); } - if (xf86ReturnOptValBool(MGAOptions, OPTION_SHOWCACHE, FALSE)) { + if (xf86ReturnOptValBool(pMga->Options, OPTION_SHOWCACHE, FALSE)) { pMga->ShowCache = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache enabled\n"); } - if (xf86ReturnOptValBool(MGAOptions, OPTION_MGA_SDRAM, FALSE)) { + if (xf86ReturnOptValBool(pMga->Options, OPTION_MGA_SDRAM, FALSE)) { pMga->HasSDRAM = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Has SDRAM\n"); } - if (xf86GetOptValFreq(MGAOptions, OPTION_SET_MCLK, OPTUNITS_MHZ, &real)) { + if (xf86GetOptValFreq(pMga->Options, OPTION_SET_MCLK, OPTUNITS_MHZ, &real)) { pMga->MemClk = (int)(real * 1000.0); } - if ((s = xf86GetOptValString(MGAOptions, OPTION_OVERLAY))) { + if ((s = xf86GetOptValString(pMga->Options, OPTION_OVERLAY))) { if (!*s || !xf86NameCmp(s, "8,24") || !xf86NameCmp(s, "24,8")) { if(pScrn->bitsPerPixel == 32 && pMga->SecondCrtc == FALSE) { pMga->Overlay8Plus24 = TRUE; if(!xf86GetOptValInteger( - MGAOptions, OPTION_COLOR_KEY,&(pMga->colorKey))) + pMga->Options, OPTION_COLOR_KEY,&(pMga->colorKey))) pMga->colorKey = TRANSPARENCY_KEY; pScrn->colorKey = pMga->colorKey; pScrn->overlayFlags = OVERLAY_8_32_PLANAR; @@ -1538,7 +1573,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) } } - if(xf86GetOptValInteger(MGAOptions, OPTION_VIDEO_KEY, &(pMga->videoKey))) { + if(xf86GetOptValInteger(pMga->Options, OPTION_VIDEO_KEY, &(pMga->videoKey))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n", pMga->videoKey); } else { @@ -1546,22 +1581,22 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) (1 << pScrn->offset.green) | (((pScrn->mask.blue >> pScrn->offset.blue) - 1) << pScrn->offset.blue); } - if (xf86ReturnOptValBool(MGAOptions, OPTION_SHADOW_FB, FALSE)) { + if (xf86ReturnOptValBool(pMga->Options, OPTION_SHADOW_FB, FALSE)) { pMga->ShadowFB = TRUE; pMga->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using \"Shadow Framebuffer\" - acceleration disabled\n"); } - if (xf86ReturnOptValBool(MGAOptions, OPTION_FBDEV, FALSE)) { + if (xf86ReturnOptValBool(pMga->Options, OPTION_FBDEV, FALSE)) { pMga->FBDev = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using framebuffer device\n"); } - if (xf86ReturnOptValBool(MGAOptions, OPTION_OVERCLOCK_MEM, FALSE)) { + if (xf86ReturnOptValBool(pMga->Options, OPTION_OVERCLOCK_MEM, FALSE)) { pMga->OverclockMem = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Overclocking memory\n"); } - if (xf86ReturnOptValBool(MGAOptions, OPTION_TEXTURED_VIDEO, FALSE)) { + if (xf86ReturnOptValBool(pMga->Options, OPTION_TEXTURED_VIDEO, FALSE)) { pMga->TexturedVideo = TRUE; } if (pMga->FBDev) { @@ -1578,7 +1613,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) pScrn->ValidMode = fbdevHWValidMode; } pMga->Rotate = 0; - if ((s = xf86GetOptValString(MGAOptions, OPTION_ROTATE))) { + if ((s = xf86GetOptValString(pMga->Options, OPTION_ROTATE))) { if(!xf86NameCmp(s, "CW")) { pMga->ShadowFB = TRUE; pMga->NoAccel = TRUE; @@ -1772,11 +1807,11 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) Bool UseHalf = FALSE; int adjust; - xf86GetOptValBool(MGAOptions, OPTION_CRTC2HALF, &UseHalf); + xf86GetOptValBool(pMga->Options, OPTION_CRTC2HALF, &UseHalf); adjust = pScrn->videoRam / 2; if (UseHalf == TRUE || - xf86GetOptValInteger(MGAOptions, OPTION_CRTC2RAM, &adjust)) { + xf86GetOptValInteger(pMga->Options, OPTION_CRTC2RAM, &adjust)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Crtc2 will use %dK of VideoRam\n", adjust); @@ -1836,32 +1871,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) (*pMga->PreInit)(pScrn); #if !defined(__powerpc__) - /* Load DDC if we have the code to use it */ - /* This gives us DDC1 */ - if (pMga->ddc1Read || pMga->i2cInit) { - if (xf86LoadSubModule(pScrn, "ddc")) { - xf86LoaderReqSymLists(ddcSymbols, NULL); - } else { - /* ddc module not found, we can do without it */ - pMga->ddc1Read = NULL; - - /* Without DDC, we have no use for the I2C bus */ - pMga->i2cInit = NULL; - } - } -#if MGAuseI2C - /* - DDC can use I2C bus */ - /* Load I2C if we have the code to use it */ - if (pMga->i2cInit) { - if ( xf86LoadSubModule(pScrn, "i2c") ) { - xf86LoaderReqSymLists(i2cSymbols,NULL); - } else { - /* i2c module not found, we can do without it */ - pMga->i2cInit = NULL; - pMga->I2C = NULL; - } - } -#endif /* MGAuseI2C */ /* Read and print the Monitor DDC info */ pScrn->monitor->DDC = MGAdoDDC(pScrn); @@ -2041,7 +2050,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) #ifdef USEMGAHAL MGA_HAL( swap_head - = xf86ReturnOptValBool(MGAOptions, OPTION_SWAPPED_HEAD, FALSE); + = xf86ReturnOptValBool(pMga->Options, OPTION_SWAPPED_HEAD, FALSE); if(pMga->SecondCrtc == FALSE) { pMga->pBoard = xalloc(sizeof(CLIENTDATA) + MGAGetBOARDHANDLESize()); @@ -2557,7 +2566,7 @@ static void FillModeInfoStruct(ScrnInfoPtr pScrn, DisplayModePtr mode) pMga->pMgaModeInfo->flSignalMode = 0x10; /* Set TV standard */ - if ((s = xf86GetOptValString(MGAOptions, OPTION_TVSTANDARD))) { + if ((s = xf86GetOptValString(pMga->Options, OPTION_TVSTANDARD))) { if (!xf86NameCmp(s, "PAL")) { pMga->pMgaModeInfo->flSignalMode = 0x00; pMga->pMgaModeInfo->ulRefreshRate = 50; @@ -2572,7 +2581,7 @@ static void FillModeInfoStruct(ScrnInfoPtr pScrn, DisplayModePtr mode) } /* Set Cable Type */ - if ((s = xf86GetOptValString(MGAOptions, OPTION_CABLETYPE))) { + if ((s = xf86GetOptValString(pMga->Options, OPTION_CABLETYPE))) { if (!xf86NameCmp(s, "SCART_RGB")) { pMga->pMgaModeInfo->ulCableType = TV_SCART_RGB; } else if (!xf86NameCmp(s, "SCART_COMPOSITE")) { @@ -2623,7 +2632,7 @@ MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) Bool tv2 = FALSE; ULONG status; Bool swap_head - = xf86ReturnOptValBool(MGAOptions, OPTION_SWAPPED_HEAD, FALSE); + = xf86ReturnOptValBool(pMga->Options, OPTION_SWAPPED_HEAD, FALSE); if (pMga->pMgaHwInfo) { @@ -2933,6 +2942,22 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, 0x100, 0x000); if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) return FALSE; + if(pMga->SecondCrtc == FALSE && pMga->HWCursor == TRUE) { + switch (pMga->Chipset) { + case PCI_CHIP_MGA1064: + case PCI_CHIP_MGAG100: + case PCI_CHIP_MGAG100_PCI: + case PCI_CHIP_MGAG200: + case PCI_CHIP_MGAG200_PCI: + case PCI_CHIP_MGAG400: + outMGAdac(MGA1064_CURSOR_BASE_ADR_LOW, pMga->FbCursorOffset >> 10); + outMGAdac(MGA1064_CURSOR_BASE_ADR_HI, pMga->FbCursorOffset >> 18); + break; + default: + break; + } + } + MGAStormEngineInit(pScrn); } else { /* Save the current state */ @@ -3028,7 +3053,7 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) * InitGLXVisuals call back. * The DRI does not work when textured video is enabled at this time. */ - if (!xf86ReturnOptValBool(MGAOptions, OPTION_DRI, TRUE)) { + if (!xf86ReturnOptValBool(pMga->Options, OPTION_DRI, TRUE)) { driFrom = X_CONFIG; } else if ( pMga->NoAccel ) { xf86DrvMsg( pScrn->scrnIndex, X_ERROR, 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 c1aca3dd7..d11ab6bf0 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.88 2001/04/10 16:08:01 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c,v 1.91 2001/05/10 21:53:48 dawes Exp $ */ /* All drivers should typically include these */ @@ -1007,7 +1007,11 @@ MGANAME(RestoreAccelState)(ScrnInfoPtr pScrn) SET_FOREGROUND(tmp); OUTREG(MGAREG_SRCORG, pMga->realSrcOrg); OUTREG(MGAREG_DSTORG, pMga->DstOrg); +#if X_BYTE_ORDER == X_LITTLE_ENDIAN + OUTREG(MGAREG_OPMODE, MGAOPM_DMA_BLIT ); +#else OUTREG(MGAREG_OPMODE, MGAOPM_DMA_BLIT | 0x10000); +#endif OUTREG(MGAREG_CXBNDRY, 0xFFFF0000); /* (maxX << 16) | minX */ OUTREG(MGAREG_YTOP, 0x00000000); /* minPixelPointer */ OUTREG(MGAREG_YBOT, 0x007FFFFF); /* maxPixelPointer */ @@ -1104,21 +1108,24 @@ MGAStormEngineInit(ScrnInfoPtr pScrn) maccess |= (1 << 31); Mga16InitSolidFillRectFuncs(pMga); pMga->RestoreAccelState = Mga16RestoreAccelState; - opmode |= 10000; + opmode |= 0x10000; break; case 24: maccess |= 3; Mga24InitSolidFillRectFuncs(pMga); pMga->RestoreAccelState = Mga24RestoreAccelState; + opmode |= 0x20000; break; - opmode |= 20000; case 32: maccess |= 2; Mga32InitSolidFillRectFuncs(pMga); pMga->RestoreAccelState = Mga32RestoreAccelState; - opmode |= 20000; + opmode |= 0x20000; break; } +#if X_BYTE_ORDER == X_LITTLE_ENDIAN + opmode &= ~0x30000; +#endif pMga->fifoCount = 0; 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 2728fdf82..443099a9d 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.24 2001/04/25 14:23:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c,v 1.24.2.1 2001/06/01 02:24:18 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -688,8 +688,6 @@ MGADisplayVideoOverlay( /* enable accelerated 2x horizontal zoom when pixelclock >135MHz */ hzoom = (pScrn->currentMode->Clock > 135000) ? 1 : 0; - intrep = (((drw_w >= src_w) && !hzoom) || (drw_w == src_w) || - (drw_w < 2)) ? 0 : 1; switch(id) { case FOURCC_UYVY: @@ -720,11 +718,13 @@ MGADisplayVideoOverlay( OUTREG(MGAREG_BESV1WGHT, y1 & 0x0000fffc); OUTREG(MGAREG_BESV1SRCLST, height - 1 - (y1 >> 16)); - tmp = ((src_h - 1) << 16)/drw_h; + intrep = ((drw_h == src_h) || (drw_h < 2)) ? 0 : 1; + tmp = ((src_h - intrep) << 16)/(drw_h - intrep); if(tmp >= (32 << 16)) tmp = (32 << 16) - 1; OUTREG(MGAREG_BESVISCAL, tmp & 0x001ffffc); + intrep = ((drw_w == src_w) || (drw_w < 2)) ? 0 : 1; tmp = (((src_w - intrep) << 16)/(drw_w - intrep)) << hzoom; if(tmp >= (32 << 16)) tmp = (32 << 16) - 1; 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 ce7b033ea..ece710ac8 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.50 2001/02/15 17:44:24 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c,v 1.52 2001/05/15 10:19:39 eich Exp $ */ /* * The original Precision Insight driver for @@ -110,7 +110,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "extensions/xf86dgastr.h" /* Mandatory functions */ -static OptionInfoPtr NEOAvailableOptions(int chipid, int busid); +static const OptionInfoRec * NEOAvailableOptions(int chipid, int busid); static void NEOIdentify(int flags); static Bool NEOProbe(DriverPtr drv, int flags); static Bool NEOPreInit(ScrnInfoPtr pScrn, int flags); @@ -265,7 +265,7 @@ typedef enum { OPTION_ROTATE } NEOOpts; -static OptionInfoRec NEO_2070_Options[] = { +static const OptionInfoRec NEO_2070_Options[] = { { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NO_MMIO, "noMMIO", OPTV_BOOLEAN, {0}, FALSE }, @@ -285,7 +285,7 @@ static OptionInfoRec NEO_2070_Options[] = { { -1, NULL, OPTV_NONE, {0}, FALSE } }; -static OptionInfoRec NEOOptions[] = { +static const OptionInfoRec NEOOptions[] = { { OPTION_NOLINEAR_MODE,"NoLinear", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, @@ -364,6 +364,8 @@ static const char *ddcSymbols[] = { static const char *vbeSymbols[] = { "VBEInit", + "vbeDoEDID", + "vbeFree", NULL }; @@ -458,8 +460,7 @@ NEOFreeRec(ScrnInfoPtr pScrn) pScrn->driverPrivate = NULL; } -static -OptionInfoPtr +static const OptionInfoRec * NEOAvailableOptions(int chipid, int busid) { int chip = (chipid & 0x0000ffff); @@ -906,10 +907,15 @@ NEOPreInit(ScrnInfoPtr pScrn, int flags) /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); /* Process the options */ - if (nPtr->NeoChipset == NM2070) - nPtr->Options = (OptionInfoPtr)NEO_2070_Options; - else - nPtr->Options = (OptionInfoPtr)NEOOptions; + if (nPtr->NeoChipset == NM2070) { + if (!(nPtr->Options = xalloc(sizeof(NEO_2070_Options)))) + return FALSE; + memcpy(nPtr->Options, NEO_2070_Options, sizeof(NEO_2070_Options)); + } else { + if (!(nPtr->Options = xalloc(sizeof(NEOOptions)))) + return FALSE; + memcpy(nPtr->Options, NEOOptions, sizeof(NEOOptions)); + } xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, nPtr->Options); @@ -1332,7 +1338,7 @@ NEOScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; - miSetPixmapDepths (); + if (!miSetPixmapDepths ()) return FALSE; /* * Call the framebuffer layer's ScreenInit function, and fill in other @@ -2797,7 +2803,9 @@ neoProbeDDC(ScrnInfoPtr pScrn, int index) vbeInfoPtr pVbe; if (xf86LoadSubModule(pScrn, "vbe")) { - pVbe = VBEInit(NULL,index); - ConfiguredMonitor = vbeDoEDID(pVbe, NULL); + if ((pVbe = VBEInit(NULL,index))) { + ConfiguredMonitor = vbeDoEDID(pVbe, NULL); + vbeFree(pVbe); + } } } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile index f3fc19a4b..b0e2d67af 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.3 2001/01/24 00:06:22 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/Imakefile,v 1.4 2001/05/16 06:48:09 keithp Exp $ #define IHaveModules #include <Server.tmpl> @@ -14,10 +14,9 @@ INCLUDES = -I. -I../../include #else INCLUDES = -I. \ -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mi -I$(SERVERSRC)/cfb \ - -I$(SERVERSRC)/mfb -I$(XF86SRC)/shadowfb \ + -I$(SERVERSRC)/mi -I$(SERVERSRC)/fb \ + -I$(XF86SRC)/shadowfb \ -I$(XF86SRC)/xaa -I$(XF86SRC)/ramdac \ - -I$(XF86SRC)/xf24_32bpp \ -I$(EXTINCSRC) -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ -I$(SERVERSRC)/include -I$(FONTINCSRC) -I$(XINCLUDESRC) #endif diff --git a/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h b/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h index f6c787cc1..34e15014a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h @@ -1,7 +1,7 @@ /* * 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.2 2000/12/06 22:00:46 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport.h,v 1.3 2001/05/04 19:05:42 dawes Exp $ */ #ifndef __NEWPORT_H__ #define __NEWPORT_H__ @@ -50,6 +50,7 @@ typedef struct { CARD8 txt_xmap9_cfg1; /* 1. Xmap9's control register */ CARD8 txt_xmap9_mi; /* Xmap9's mode index register */ LOCO txt_colormap[256]; + OptionInfoPtr Options; } NewportRec, *NewportPtr; #define NEWPORTPTR(p) ((NewportPtr)((p)->driverPrivate)) 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 c4b3fc455..3edac64d3 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.8 2001/04/01 14:00:11 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c,v 1.10 2001/05/16 06:48:09 keithp Exp $ */ /* function prototypes, common data structures & generic includes */ #include "newport.h" @@ -42,12 +42,8 @@ /* Drivers using the mi colourmap code need: */ #include "micmap.h" -/* Drivers using cfb need: */ -#define PSZ 8 -#include "cfb.h" -#undef PSZ -#include "cfb24.h" -#include "cfb24_32.h" +/* Drivers using fb need: */ +#include "fb.h" /* Drivers using the shadow frame buffer need: */ #include "shadowfb.h" @@ -66,7 +62,7 @@ /* Prototypes ------------------------------------------------------- */ static void NewportIdentify(int flags); -static OptionInfoPtr NewportAvailableOptions(int chipid, int busid); +static const OptionInfoRec * NewportAvailableOptions(int chipid, int busid); static Bool NewportProbe(DriverPtr drv, int flags); static Bool NewportPreInit(ScrnInfoPtr pScrn, int flags); static Bool NewportScreenInit(int Index, ScreenPtr pScreen, int argc, char **argv); @@ -104,8 +100,11 @@ static SymTabRec NewportChipsets[] = { /* List of Symbols from other modules that this module references */ -static const char *cfbSymbols[] = { - "cfbScreenInit", +static const char *fbSymbols[] = { + "fbScreenInit", +#ifdef RENDER + "fbPictureInit", +#endif NULL }; @@ -153,7 +152,7 @@ newportSetup(pointer module, pointer opts, int *errmaj, int *errmin) * might refer to. * */ - LoaderRefSymLists( cfbSymbols, shadowSymbols, NULL); + LoaderRefSymLists( fbSymbols, shadowSymbols, NULL); /* @@ -175,7 +174,7 @@ typedef enum { } NewportOpts; /* Supported options */ -static OptionInfoRec NewportOptions [] = { +static const OptionInfoRec NewportOptions [] = { { OPTION_BITPLANES, "bitplanes", OPTV_INTEGER, {0}, FALSE }, { OPTION_BUS_ID, "BusID", OPTV_INTEGER, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } @@ -279,7 +278,6 @@ NewportPreInit(ScrnInfoPtr pScrn, int flags) NewportPtr pNewport; MessageType from; ClockRangePtr clockRanges; - char *mod=0, *reqSym=0; if (flags & PROBE_DETECT) return FALSE; @@ -352,7 +350,10 @@ NewportPreInit(ScrnInfoPtr pScrn, int flags) /* Fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, NewportOptions); + if (!(pNewport->Options = xalloc(sizeof(NewportOptions)))) + return FALSE; + memcpy(pNewport->Options, NewportOptions, sizeof(NewportOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pNewport->Options); /* Set fields in ScreenInfoRec && NewportRec */ pScrn->videoRam = 1280 * (pScrn->bitsPerPixel >> 3); @@ -369,7 +370,7 @@ NewportPreInit(ScrnInfoPtr pScrn, int flags) pNewport->board_rev, pNewport->rex3_rev, pNewport->cmap_rev, pNewport->xmap9_rev); - if ( (xf86GetOptValInteger(NewportOptions, OPTION_BITPLANES, &pNewport->bitplanes))) + if ( (xf86GetOptValInteger(pNewport->Options, OPTION_BITPLANES, &pNewport->bitplanes))) from = X_CONFIG; xf86DrvMsg(pScrn->scrnIndex, from, "Newport has %d bitplanes\n", pNewport->bitplanes); @@ -429,17 +430,12 @@ NewportPreInit(ScrnInfoPtr pScrn, int flags) xf86PrintModes(pScrn); xf86SetDpi (pScrn, 0, 0); - switch(pScrn->bitsPerPixel) { - case 8: - mod = "cfb"; - reqSym = "cfbScreenInit"; - break; - } - if ( mod && (!xf86LoadSubModule(pScrn, mod))) { + /* Load FB module */ + if (!xf86LoadSubModule (pScrn, "fb")) { NewportFreeRec(pScrn); return FALSE; } - xf86LoaderReqSymbols( reqSym, NULL); + xf86LoaderReqSymLists( fbSymbols, NULL); /* Load ShadowFB module */ if (!xf86LoadSubModule(pScrn, "shadowfb")) { @@ -476,6 +472,8 @@ NewportScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; + miSetPixmapDepths (); + pNewport->Bpp = pScrn->bitsPerPixel >> 3; /* Setup the stuff for the shadow framebuffer */ pNewport->ShadowPitch = (( pScrn->virtualX * pNewport->Bpp ) + 3) & ~3L; @@ -484,23 +482,19 @@ NewportScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) if (!NewportModeInit(pScrn, pScrn->currentMode)) return FALSE; - switch( pScrn->bitsPerPixel) { - case 8: - ret=cfbScreenInit(pScreen, pNewport->ShadowPtr, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth); - break; - default: - xf86Msg(X_ERROR, - "Internal Error: Display depth not supported in NewportScreenInit.\n"); - ret=FALSE; - break; - } + ret = fbScreenInit(pScreen, pNewport->ShadowPtr, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth, + pScrn->bitsPerPixel); if(!ret) return FALSE; +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif + /* we need rgb ordering if bitsPerPixel > 8 */ if (pScrn->bitsPerPixel > 8) { for (i = 0, visual = pScreen->visuals; @@ -622,7 +616,7 @@ NewportSaveScreen(ScreenPtr pScreen, int mode) } -static OptionInfoPtr +static const OptionInfoRec * NewportAvailableOptions(int chipid, int busid) { return NewportOptions; 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 4744100ec..24f65cc63 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.63 2001/03/28 01:17:43 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_driver.c,v 1.66 2001/05/15 10:19:39 eich Exp $ */ #include "nv_include.h" @@ -40,7 +40,7 @@ * Forward definitions for the functions that make up the driver. */ /* Mandatory functions */ -static OptionInfoPtr NVAvailableOptions(int chipid, int busid); +static const OptionInfoRec * NVAvailableOptions(int chipid, int busid); static void NVIdentify(int flags); static Bool NVProbe(DriverPtr drv, int flags); static Bool NVPreInit(ScrnInfoPtr pScrn, int flags); @@ -294,11 +294,12 @@ typedef enum { OPTION_SHADOW_FB, OPTION_FBDEV, OPTION_ROTATE, - OPTION_VIDEO_KEY + OPTION_VIDEO_KEY, + OPTION_FLAT_PANEL } NVOpts; -static OptionInfoRec NVOptions[] = { +static const OptionInfoRec NVOptions[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, @@ -307,6 +308,7 @@ static OptionInfoRec NVOptions[] = { { OPTION_FBDEV, "UseFBDev", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE }, { OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE }, + { OPTION_FLAT_PANEL, "FlatPanel", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; @@ -403,8 +405,7 @@ nvSetup(pointer module, pointer opts, int *errmaj, int *errmin) #endif /* XFree86LOADER */ -static -OptionInfoPtr +static const OptionInfoRec * NVAvailableOptions(int chipid, int busid) { return NVOptions; @@ -652,6 +653,8 @@ NVCloseScreen(int scrnIndex, ScreenPtr pScreen) NVUnmapMem(pScrn); vgaHWUnmapMem(pScrn); + if (pNv->pInt) + xf86FreeInt10(pNv->pInt); if (pNv->AccelInfoRec) XAADestroyInfoRec(pNv->AccelInfoRec); if (pNv->CursorInfoRec) @@ -823,6 +826,7 @@ nvProbeDDC(ScrnInfoPtr pScrn, int index) if (xf86LoadSubModule(pScrn, "vbe")) { pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); + vbeFree(pVbe); } } @@ -944,11 +948,13 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) if (pScrn->chipset == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ChipID 0x%04X is not recognised\n", pNv->Chipset); + xf86FreeInt10(pNv->pInt); return FALSE; } if (pNv->Chipset < 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Chipset \"%s\" is not recognised\n", pScrn->chipset); + xf86FreeInt10(pNv->pInt); return FALSE; } @@ -961,6 +967,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) */ if (!xf86SetDepthBpp(pScrn, 8, 8, 8, Support32bppFb)) { + xf86FreeInt10(pNv->pInt); return FALSE; } else { /* Check that the returned depth is one we support */ @@ -982,6 +989,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given depth (%d) is not supported by this driver\n", pScrn->depth); + xf86FreeInt10(pNv->pInt); return FALSE; } } @@ -999,11 +1007,14 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) /* The defaults are OK for us */ rgb zeros = {0, 0, 0}; - if (!xf86SetWeight(pScrn, zeros, zeros)) + if (!xf86SetWeight(pScrn, zeros, zeros)) { + xf86FreeInt10(pNv->pInt); return FALSE; + } } if (!xf86SetDefaultVisual(pScrn, -1)) { + xf86FreeInt10(pNv->pInt); return FALSE; } else { /* We don't currently support DirectColor at > 8bpp */ @@ -1011,6 +1022,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Given default visual" " (%s) is not supported at depth %d\n", xf86GetVisualName(pScrn->defaultVisual), pScrn->depth); + xf86FreeInt10(pNv->pInt); return FALSE; } } @@ -1018,17 +1030,21 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) bytesPerPixel = pScrn->bitsPerPixel / 8; /* The vgahw module should be loaded here when needed */ - if (!xf86LoadSubModule(pScrn, "vgahw")) + if (!xf86LoadSubModule(pScrn, "vgahw")) { + xf86FreeInt10(pNv->pInt); return FALSE; - + } + xf86LoaderReqSymLists(vgahwSymbols, NULL); /* * Allocate a vgaHWRec */ - if (!vgaHWGetHWRec(pScrn)) + if (!vgaHWGetHWRec(pScrn)) { + xf86FreeInt10(pNv->pInt); return FALSE; - + } + /* We use a programamble clock */ pScrn->progClock = TRUE; @@ -1036,7 +1052,10 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, NVOptions); + if (!(pNv->Options = xalloc(sizeof(NVOptions)))) + return FALSE; + memcpy(pNv->Options, NVOptions, sizeof(NVOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pNv->Options); /* Set the bits per RGB for 8bpp mode */ if (pScrn->depth == 8) @@ -1048,42 +1067,47 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) * The preferred method is to use the "hw cursor" option as a tri-state * option, with the default set above. */ - if (xf86GetOptValBool(NVOptions, OPTION_HW_CURSOR, &pNv->HWCursor)) { + if (xf86GetOptValBool(pNv->Options, OPTION_HW_CURSOR, &pNv->HWCursor)) { from = X_CONFIG; } /* For compatibility, accept this too (as an override) */ - if (xf86ReturnOptValBool(NVOptions, OPTION_SW_CURSOR, FALSE)) { + if (xf86ReturnOptValBool(pNv->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pNv->HWCursor = FALSE; } xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pNv->HWCursor ? "HW" : "SW"); - if (xf86ReturnOptValBool(NVOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pNv->Options, OPTION_NOACCEL, FALSE)) { pNv->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } - if (xf86ReturnOptValBool(NVOptions, OPTION_SHOWCACHE, FALSE)) { + if (xf86ReturnOptValBool(pNv->Options, OPTION_SHOWCACHE, FALSE)) { pNv->ShowCache = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache enabled\n"); } - if (xf86ReturnOptValBool(NVOptions, OPTION_SHADOW_FB, FALSE)) { + if (xf86ReturnOptValBool(pNv->Options, OPTION_SHADOW_FB, FALSE)) { pNv->ShadowFB = TRUE; pNv->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using \"Shadow Framebuffer\" - acceleration disabled\n"); } - if (xf86ReturnOptValBool(NVOptions, OPTION_FBDEV, FALSE)) { + if (xf86ReturnOptValBool(pNv->Options, OPTION_FBDEV, FALSE)) { pNv->FBDev = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using framebuffer device\n"); } if (pNv->FBDev) { /* check for linux framebuffer device */ - if (!xf86LoadSubModule(pScrn, "fbdevhw")) + if (!xf86LoadSubModule(pScrn, "fbdevhw")) { + xf86FreeInt10(pNv->pInt); return FALSE; + } + xf86LoaderReqSymLists(fbdevHWSymbols, NULL); - if (!fbdevHWInit(pScrn, pNv->PciInfo, NULL)) + if (!fbdevHWInit(pScrn, pNv->PciInfo, NULL)) { + xf86FreeInt10(pNv->pInt); return FALSE; + } pScrn->SwitchMode = fbdevHWSwitchMode; pScrn->AdjustFrame = fbdevHWAdjustFrame; pScrn->EnterVT = NVEnterVTFBDev; @@ -1091,7 +1115,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) pScrn->ValidMode = fbdevHWValidMode; } pNv->Rotate = 0; - if ((s = xf86GetOptValString(NVOptions, OPTION_ROTATE))) { + if ((s = xf86GetOptValString(pNv->Options, OPTION_ROTATE))) { if(!xf86NameCmp(s, "CW")) { pNv->ShadowFB = TRUE; pNv->NoAccel = TRUE; @@ -1114,7 +1138,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) "Valid options are \"CW\" or \"CCW\"\n"); } } - if(xf86GetOptValInteger(NVOptions, OPTION_VIDEO_KEY, &(pNv->videoKey))) { + if(xf86GetOptValInteger(pNv->Options, OPTION_VIDEO_KEY, &(pNv->videoKey))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n", pNv->videoKey); } else { @@ -1123,6 +1147,10 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) (((pScrn->mask.blue >> pScrn->offset.blue) - 1) << pScrn->offset.blue); } + if (xf86ReturnOptValBool(pNv->Options, OPTION_FLAT_PANEL, FALSE)) { + pNv->FlatPanel = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "using flat panel\n"); + } if (pNv->pEnt->device->MemBase != 0) { /* Require that the config file value matches one of the PCI values. */ @@ -1130,6 +1158,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "MemBase 0x%08lX doesn't match any PCI base register.\n", pNv->pEnt->device->MemBase); + xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } @@ -1144,6 +1173,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid FB address in PCI config space\n"); + xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } @@ -1157,6 +1187,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "IOBase 0x%08lX doesn't match any PCI base register.\n", pNv->pEnt->device->IOBase); + xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } @@ -1170,6 +1201,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid MMIO address in PCI config space\n"); + xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } @@ -1180,6 +1212,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) if (xf86RegisterResources(pNv->pEnt->index, NULL, ResExclusive)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86RegisterResources() found resource conflicts\n"); + xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } @@ -1289,6 +1322,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) Gamma zeros = {0.0, 0.0, 0.0}; if (!xf86SetGamma(pScrn, zeros)) { + xf86FreeInt10(pNv->pInt); return FALSE; } } @@ -1345,6 +1379,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) i = 1; } if (i == -1) { + xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } @@ -1354,6 +1389,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) if (i == 0 || pScrn->modes == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); + xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } @@ -1399,9 +1435,11 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) reqSym = "cfb32ScreenInit"; break; default: + xf86FreeInt10(pNv->pInt); return FALSE; } if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { + xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } @@ -1409,6 +1447,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) xf86LoaderReqSymbols(reqSym, NULL); #else if (xf86LoadSubModule(pScrn, "fb") == NULL) { + xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } @@ -1419,6 +1458,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) /* Load XAA if needed */ if (!pNv->NoAccel) { if (!xf86LoadSubModule(pScrn, "xaa")) { + xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } @@ -1428,6 +1468,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) /* Load ramdac if needed */ if (pNv->HWCursor) { if (!xf86LoadSubModule(pScrn, "ramdac")) { + xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } @@ -1437,6 +1478,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) /* Load shadowfb if needed */ if (pNv->ShadowFB) { if (!xf86LoadSubModule(pScrn, "shadowfb")) { + xf86FreeInt10(pNv->pInt); NVFreeRec(pScrn); return FALSE; } @@ -1818,8 +1860,7 @@ NVScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) Must follow initialization of the default colormap */ if(!xf86HandleColormaps(pScreen, 256, 8, (pNv->FBDev ? fbdevHWLoadPalette : NVdac->LoadPalette), - NULL, CMAP_RELOAD_ON_MODE_SWITCH | - ((pNv->riva.Architecture != NV_ARCH_03) ? CMAP_PALETTED_TRUECOLOR : 0))) + NULL, CMAP_RELOAD_ON_MODE_SWITCH | CMAP_PALETTED_TRUECOLOR)) return FALSE; DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "- Palette loaded\n")); 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 4fc8107a2..6e8b4f457 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.22 2001/03/28 01:17:43 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nv_type.h,v 1.24 2001/05/09 00:39:51 mvojkovi Exp $ */ #ifndef __NV_STRUCT_H__ #define __NV_STRUCT_H__ @@ -117,6 +117,8 @@ typedef struct { void (*VideoTimerCallback)(ScrnInfoPtr, Time); XF86VideoAdaptorPtr overlayAdaptor; int videoKey; + Bool FlatPanel; + OptionInfoPtr Options; } NVRec, *NVPtr; #define NVPTR(p) ((NVPtr)((p)->driverPrivate)) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile index 0312c431d..77440d922 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile,v 1.18 2001/01/24 00:06:26 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/Imakefile,v 1.19 2001/05/16 06:48:10 keithp Exp $ XCOMM XCOMM This is an Imakefile for the Rendition driver. @@ -16,14 +16,12 @@ OBJS = rendition.o vboard.o vmodes.o vramdac.o v1krisc.o vvga.o \ #if defined(XF86DriverSDK) INCLUDES = -I. -I../../include #else -INCLUDES = -I. -I$(XF86SRC)/xf4bpp -I$(XF86SRC)/xf1bpp \ - -I$(SERVERSRC)/cfb -I$(SERVERSRC)/mfb \ +INCLUDES = -I. -I$(SERVERSRC)/fb \ -I$(SERVERSRC)/mi -I$(SERVERSRC)/cfb\ -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(XF86SRC)/vgahw \ -I$(XF86SRC)/rac -I$(XF86SRC)/int10 -I$(XF86OSSRC)/vbe \ -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(FONTINCSRC) -I$(XINCLUDESRC) \ -I$(SERVERSRC)/include -I$(XF86SRC)/xaa \ - -I$(XF86SRC)/xf24_32bpp -I$(XF86SRC)/xf8_32bpp \ -I$(XF86SRC)/ramdac -I$(SERVERSRC)/Xext \ -I$(XF86SRC)/shadowfb -I$(XF86SRC)/rac -I$(XF86SRC)/loader \ -I$(SERVERSRC)/render -I$(EXTINCSRC) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c b/xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c index aad4fb8a7..3e48d0845 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c @@ -3,7 +3,7 @@ * * accelerator functions for X */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c,v 1.8 2000/06/13 02:28:33 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/accelX.c,v 1.9 2001/05/16 06:48:10 keithp Exp $ */ @@ -112,7 +112,6 @@ void RENDITIONAccelPreInit(ScrnInfoPtr pScreenInfo) { renditionPtr pRendition = RENDITIONPTR(pScreenInfo); - int c; #ifdef DEBUG ErrorF("RENDITION: RENDITIONAccelPreInit called\n"); @@ -140,7 +139,6 @@ RENDITIONAccelXAAInit(ScreenPtr pScreen) XAAInfoRecPtr pXAAinfo; BoxRec AvailFBArea; - int c; #ifdef DEBUG ErrorF("RENDITION: RENDITIONAccelInit called\n"); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c index a12d8171e..9159e7cb9 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.40 2001/02/15 17:50:33 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c,v 1.42 2001/05/16 06:48:10 keithp Exp $ */ /* * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. * @@ -82,7 +82,7 @@ * local function prototypes */ -static OptionInfoPtr renditionAvailableOptions(int, int); +static const OptionInfoRec * renditionAvailableOptions(int, int); static void renditionIdentify(int); static Bool renditionProbe(DriverPtr, int); static Bool renditionPreInit(ScrnInfoPtr, int); @@ -108,7 +108,7 @@ static void renditionLoadPalette(ScrnInfoPtr, int, int *, LOCO *, VisualPtr); * global data */ -OptionInfoRec renditionOptions[]={ +OptionInfoRec const renditionOptions[]={ { OPTION_FBWC, "FramebufferWC", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SW_Cursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, @@ -187,9 +187,10 @@ static const char *int10Symbols[] = { static const char *fbSymbols[]={ "xf1bppScreenInit", "xf4bppScreenInit", - "cfbScreenInit", - "cfb16ScreenInit", - "cfb32ScreenInit", + "fbScreenInit", +#ifdef RENDER + "fbPictureInit", +#endif NULL }; @@ -274,7 +275,7 @@ static PciChipsets renditionPCIchipsets[] = { * functions */ -static OptionInfoPtr +static const OptionInfoRec * renditionAvailableOptions(int chipid, int busid) { return renditionOptions; @@ -466,12 +467,10 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags) { static ClockRange renditionClockRange = {NULL, 0, 135000, -1, FALSE, TRUE, 1, 1, 0}; MessageType From; - int i, videoRam, Rounding, nModes = 0; - char *Module; - const char *Sym; - vgaHWPtr pvgaHW; + int videoRam, Rounding, nModes = 0; renditionPtr pRendition; char *in_string; + vgaHWPtr pvgaHW; #ifdef DEBUG ErrorF("Rendition: renditionPreInit() called\n"); @@ -540,43 +539,31 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags) if (!xf86SetDepthBpp(pScreenInfo, 8, 8, 8, Support32bppFb)) return FALSE; - switch (pScreenInfo->depth) { - case 8: Module = "cfb"; Sym = "cfbScreenInit"; break; - - case 15: if (PCI_CHIP_V1000==pRendition->PciInfo->chipType){ - Module = "cfb16"; Sym = "cfbScreenInit16"; break; - } - else { - xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, + if (pScreenInfo->depth == 15) + { + if (PCI_CHIP_V1000 != pRendition->PciInfo->chipType) { + xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, "Given depth (%d) is not supported by this chipset.\n", pScreenInfo->depth); - return FALSE; - } - case 16: Module = "cfb16"; Sym = "cfbScreenInit16"; break; - - case 24: Module = "cfb32"; Sym = "cfbScreenInit32"; break; - - default: - xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, - "Given depth (%d) is not supported by this driver.\n", - pScreenInfo->depth); - return FALSE; + return FALSE; + } } - - /* collect all of the options flags and process them */ xf86CollectOptions(pScreenInfo, NULL); + if (!(pRendition->Options = xalloc(sizeof(renditionOptions)))) + return FALSE; + memcpy(pRendition->Options, renditionOptions, sizeof(renditionOptions)); xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options, - renditionOptions); + pRendition->Options); - /* Ensure depth-specific entry points are available */ - if (!xf86LoadSubModule(pScreenInfo, Module)) + /* Load fb */ + if (!xf86LoadSubModule(pScreenInfo, "fb")) return FALSE; - xf86LoaderReqSymbols(Sym, NULL); + xf86LoaderReqSymbols("fbScreenInit", NULL); /* determine colour weights */ pScreenInfo->rgbBits=8; @@ -661,7 +648,7 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags) /* Reserv memory and load the microcode */ /****************************************/ #if USE_ACCEL - if (!xf86ReturnOptValBool(renditionOptions, OPTION_NOACCEL,0)) { + if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NOACCEL,0)) { RENDITIONAccelPreInit (pScreenInfo); } else @@ -672,8 +659,6 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags) ("Skipping acceleration\n")); #endif - xf86MarkOptionUsedByName(renditionOptions,"NoAccel"); - From = X_PROBED; xf86DrvMsg(pScreenInfo->scrnIndex, From, "videoRam: %d kBytes\n", videoRam); pScreenInfo->videoRam=videoRam; @@ -689,7 +674,7 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags) pRendition->board.shadowfb=TRUE; - if ((in_string = xf86GetOptValString(renditionOptions, OPTION_ROTATE))) { + if ((in_string = xf86GetOptValString(pRendition->Options, OPTION_ROTATE))) { if(!xf86NameCmp(in_string, "CW")) { /* accel is disabled below for shadowFB */ pRendition->board.shadowfb = TRUE; @@ -708,9 +693,8 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags) "Valid options are \"CW\" or \"CCW\"\n"); } } - xf86MarkOptionUsedByName(renditionOptions,"Rotate"); - if (xf86ReturnOptValBool(renditionOptions, OPTION_SHADOW_FB,1)|| + if (xf86ReturnOptValBool(pRendition->Options, OPTION_SHADOW_FB,1)|| pRendition->board.rotate) { if (!xf86LoadSubModule(pScreenInfo, "shadowfb")) { xf86DrvMsg(pScreenInfo->scrnIndex, X_WARNING, @@ -728,22 +712,20 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags) xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG, "\"Shadow Framebuffer\" disabled\n"); } - xf86MarkOptionUsedByName(renditionOptions,"ShadowFB"); /* Load Ramdac module if needed */ - if (!xf86ReturnOptValBool(renditionOptions, OPTION_SW_CURSOR,0) && + if (!xf86ReturnOptValBool(pRendition->Options, OPTION_SW_CURSOR,0) && !pRendition->board.rotate){ if (!xf86LoadSubModule(pScreenInfo, "ramdac")) { return FALSE; } xf86LoaderReqSymLists(ramdacSymbols, NULL); } - xf86MarkOptionUsedByName(renditionOptions,"SWCursor"); #if USE_ACCEL /* Load XAA if needed */ - if (!xf86ReturnOptValBool(renditionOptions, OPTION_NOACCEL,0) && + if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NOACCEL,0) && !pRendition->board.rotate) { if (!xf86LoadSubModule(pScreenInfo, "xaa")) { return FALSE; @@ -754,7 +736,7 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags) #if 0 /* Load DDC module if needed */ - if (!xf86ReturnOptValBool(renditionOptions, OPTION_NO_DDC,0)){ + if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NO_DDC,0)){ if (!xf86LoadSubModule(pScreenInfo, "ddc")) { xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, ("Loading of DDC library failed, skipping DDC-probe\n")); @@ -770,7 +752,7 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags) } #else /* Load DDC module if needed */ - if (!xf86ReturnOptValBool(renditionOptions, OPTION_NO_DDC,0)){ + if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NO_DDC,0)){ if (!xf86LoadSubModule(pScreenInfo, "vbe")) { xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, ("Loading of DDC library failed, skipping DDC-probe\n")); @@ -860,7 +842,7 @@ renditionPreInit(ScrnInfoPtr pScreenInfo, int flags) if (!pScreenInfo->chipset) pScreenInfo->chipset = (char *)renditionChipsets[0].name; - if(!xf86ReturnOptValBool(renditionOptions, OPTION_SW_CURSOR,0)){ + if(!xf86ReturnOptValBool(pRendition->Options, OPTION_SW_CURSOR,0)){ if(!pRendition->board.rotate) /* Do preemtive things for HW cursor */ RenditionHWCursorPreInit(pScreenInfo); @@ -1139,10 +1121,9 @@ renditionScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) Bool Inited = FALSE; unsigned char *FBBase; VisualPtr visual; + vgaHWPtr pvgaHW; int displayWidth,width,height; - vgaHWPtr pvgaHW; - #ifdef DEBUG ErrorF("RENDITION: renditionScreenInit() called\n"); sleep(1); @@ -1167,6 +1148,8 @@ renditionScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScreenInfo->rgbBits, pScreenInfo->defaultVisual)) return FALSE; + miSetPixmapDepths (); + if (pRendition->board.rotate) { height = pScreenInfo->virtualX; width = pScreenInfo->virtualY; @@ -1187,38 +1170,18 @@ renditionScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) displayWidth=pScreenInfo->displayWidth; } - - /* initialise the framebuffer */ - switch (pScreenInfo->bitsPerPixel) - { - case 8: - Inited = cfbScreenInit(pScreen, FBBase, - width, height, - pScreenInfo->xDpi, pScreenInfo->yDpi, - displayWidth); - break; - case 16: - Inited = cfb16ScreenInit(pScreen, FBBase, - width, height, - pScreenInfo->xDpi, pScreenInfo->yDpi, - displayWidth); - break; - case 32: - Inited = cfb32ScreenInit(pScreen, FBBase, - width, height, - pScreenInfo->xDpi, pScreenInfo->yDpi, - displayWidth); - break; - default: - xf86DrvMsg(scrnIndex, X_ERROR, - "Internal error: invalid bpp (%d) in renditionScreenInit\n", - pScreenInfo->bitsPerPixel); - break; - } - + Inited = fbScreenInit(pScreen, FBBase, + width, height, + pScreenInfo->xDpi, pScreenInfo->yDpi, + displayWidth, + pScreenInfo->bitsPerPixel); + if (!Inited) return FALSE; +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif if (pScreenInfo->bitsPerPixel > 8) { /* Fixup RGB ordering */ @@ -1279,10 +1242,10 @@ renditionScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /*********************************************************/ /* The actual setup of the driver-specific code */ - /* has to be after cfb*ScreenInit and before cursor init */ + /* has to be after fbScreenInit and before cursor init */ /*********************************************************/ #if USE_ACCEL - if (!xf86ReturnOptValBool(renditionOptions, OPTION_NOACCEL,0)) + if (!xf86ReturnOptValBool(pRendition->Options, OPTION_NOACCEL,0)) RENDITIONAccelXAAInit (pScreen); #endif @@ -1290,7 +1253,7 @@ renditionScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86SetSilkenMouse(pScreen); miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); - if(!xf86ReturnOptValBool(renditionOptions, OPTION_SW_CURSOR,0)&& + if(!xf86ReturnOptValBool(pRendition->Options, OPTION_SW_CURSOR,0)&& !pRendition->board.rotate){ /* Initialise HW cursor */ if(!RenditionHWCursorInit(scrnIndex, pScreen)){ @@ -1335,10 +1298,9 @@ renditionScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86DPMSInit(pScreen, renditionDPMSSet, 0); - if (xf86ReturnOptValBool(renditionOptions, OPTION_OVERCLOCK_MEM,0)) { + if (xf86ReturnOptValBool(pRendition->Options, OPTION_OVERCLOCK_MEM,0)) { RENDITIONPTR(pScreenInfo)->board.overclock_mem=TRUE; } - xf86MarkOptionUsedByName(renditionOptions,"Overclock_Mem"); /* Wrap the screen's CloseScreen vector and set its SaveScreen vector */ prenditionPriv->CloseScreen = pScreen->CloseScreen; @@ -1434,15 +1396,16 @@ renditionMapMem(ScrnInfoPtr pScreenInfo) { Bool WriteCombine; int mapOption; + renditionPtr pRendition = RENDITIONPTR(pScreenInfo); #ifdef DEBUG ErrorF("Mapping ...\n"); ErrorF("%d %d %d %x %d\n", pScreenInfo->scrnIndex, VIDMEM_FRAMEBUFFER, - RENDITIONPTR(pScreenInfo)->pcitag, - RENDITIONPTR(pScreenInfo)->board.mem_base, pScreenInfo->videoRam); + pRendition->pcitag, + pRendition->board.mem_base, pScreenInfo->videoRam); #endif - if (RENDITIONPTR(pScreenInfo)->board.chip==V1000_DEVICE){ + if (pRendition->board.chip==V1000_DEVICE){ /* Some V1000 boards are known to have problems with Write-Combining */ /* V2x00 also found to have similar problems with memcpy & WC ! */ WriteCombine = 0; @@ -1452,7 +1415,7 @@ renditionMapMem(ScrnInfoPtr pScreenInfo) WriteCombine = 1; } /* Override on users request */ - WriteCombine=xf86ReturnOptValBool(renditionOptions, OPTION_FBWC, WriteCombine); + WriteCombine=xf86ReturnOptValBool(pRendition->Options, OPTION_FBWC, WriteCombine); if (WriteCombine){ xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG, ("Requesting Write-Combined memory access\n")); @@ -1464,12 +1427,10 @@ renditionMapMem(ScrnInfoPtr pScreenInfo) mapOption = VIDMEM_MMIO; } - xf86MarkOptionUsedByName(renditionOptions,"FramebufferWC"); - - RENDITIONPTR(pScreenInfo)->board.vmem_base= + pRendition->board.vmem_base= xf86MapPciMem(pScreenInfo->scrnIndex, mapOption, - RENDITIONPTR(pScreenInfo)->pcitag, - (unsigned long)RENDITIONPTR(pScreenInfo)->board.mem_base, + pRendition->pcitag, + (unsigned long)pRendition->board.mem_base, pScreenInfo->videoRam); return TRUE; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h index 6a5a6e81b..3ec672636 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h,v 1.6 2000/04/04 19:25:15 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.h,v 1.7 2001/05/16 06:48:10 keithp Exp $ */ #ifndef __RENDITION_H__ #define __RENDITION_H__ @@ -51,21 +51,9 @@ /* Needed for replacement LoadPalette function for Gamma Correction */ #include "xf86cmap.h" -/* Needed for the 1 and 4 bpp framebuffers */ -#include "xf1bpp.h" -#include "xf4bpp.h" +/* Drivers using fb need this */ -/* Drivers using cfb need this */ - -#undef PSZ -#define PSZ 8 -#include "cfb.h" -#undef PSZ - -/* Drivers supporting bpp 16, 24 or 32 with cfb need these */ - -#include "cfb16.h" -#include "cfb32.h" +#include "fb.h" /* Drivers using the XAA interface ... */ #include "xaa.h" diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h index 89eb3d1df..c41db4940 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h,v 1.4 2000/03/01 00:25:24 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition_options.h,v 1.5 2001/05/04 19:05:42 dawes Exp $ */ #ifndef __RENDITION_OPTION_H__ #define __RENDITION_OPTION_H__ @@ -20,7 +20,7 @@ typedef enum { /*********************************/ For reference only <DI> -static OptionInfoRec renditionOptions[]={ +static const OptionInfoRec renditionOptions[]={ { OPTION_FBWC, "FramebufferWC", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SWCursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c index 740cc07ac..aa0aa358e 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c,v 1.9 2001/02/15 17:50:34 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vmodes.c,v 1.10 2001/05/04 19:05:42 dawes Exp $ */ /* * file vmodes.c * @@ -22,11 +22,6 @@ #undef DEBUG -/* Options data */ -#include "rendition_options.h" -extern OptionInfoRec renditionOptions[]; - - /* * defines */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c index 2a3f0ed4b..05d6b9951 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c,v 1.12 2001/02/15 17:50:34 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vramdac.c,v 1.13 2001/05/16 06:48:10 keithp Exp $ */ /* * includes */ @@ -422,7 +422,6 @@ verite_setpalette(ScrnInfoPtr pScreenInfo, int numColors, int *indices, vu16 iob=pRendition->board.io_base; vu32 crtc_status; int i, index; - int c; #ifdef DEBUG ErrorF ("Rendition: Debug verite_setpalette called\n"); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h index 8fd62e5e5..8a14825ae 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h,v 1.6 2000/03/31 20:13:28 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/vtypes.h,v 1.7 2001/05/04 19:05:42 dawes Exp $ */ #ifndef _VTYPES_H_ #define _VTYPES_H_ @@ -166,6 +166,7 @@ typedef struct _renditionRec CloseScreenProcPtr CloseScreen; /* wrap CloseScreen */ xf86CursorInfoPtr CursorInfoRec; /* Cursor data */ XAAInfoRecPtr AccelInfoRec; /* Needed for XAA */ + OptionInfoPtr Options; } renditionRec, *renditionPtr; #define RENDITIONPTR(p) ((renditionPtr)((p)->driverPrivate)) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h b/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h index 2267c744e..8acefe9b9 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h,v 1.26 2000/11/28 20:59:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v.h,v 1.27 2001/05/04 19:05:43 dawes Exp $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. @@ -257,6 +257,7 @@ typedef struct tagS3VRec { /*************************/ /* ViRGE options -start- */ /*************************/ + OptionInfoPtr Options; /* Enable PCI burst mode for reads? */ Bool pci_burst; /* Diasable PCI retries */ 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 191dc9d57..85036ef74 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.72 2001/02/09 03:23:29 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3virge/s3v_driver.c,v 1.74.2.2 2001/05/28 08:40:10 eich Exp $ */ /* Copyright (C) 1994-1999 The XFree86 Project, Inc. All Rights Reserved. @@ -67,7 +67,7 @@ static void S3VDisableMmio(ScrnInfoPtr pScrn); */ /* Mandatory functions */ -static OptionInfoPtr S3VAvailableOptions(int chipid, int busid); +static const OptionInfoRec * S3VAvailableOptions(int chipid, int busid); static void S3VIdentify(int flags); static Bool S3VProbe(DriverPtr drv, int flags); static Bool S3VPreInit(ScrnInfoPtr pScrn, int flags); @@ -210,7 +210,7 @@ typedef enum { OPTION_FB_DRAW } S3VOpts; -static OptionInfoRec S3VOptions[] = +static const OptionInfoRec S3VOptions[] = { { OPTION_SLOW_EDODRAM, "slow_edodram", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SLOW_DRAM, "slow_dram", OPTV_BOOLEAN, {0}, FALSE }, @@ -469,8 +469,7 @@ S3VFreeRec(ScrnInfoPtr pScrn) pScrn->driverPrivate = NULL; } -static -OptionInfoPtr +static const OptionInfoRec * S3VAvailableOptions(int chipid, int busid) { return S3VOptions; @@ -684,10 +683,13 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) } /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, S3VOptions); + if (!(ps3v->Options = xalloc(sizeof(S3VOptions)))) + return FALSE; + memcpy(ps3v->Options, S3VOptions, sizeof(S3VOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ps3v->Options); - if (xf86ReturnOptValBool(S3VOptions, OPTION_PCI_BURST, FALSE)) { + if (xf86ReturnOptValBool(ps3v->Options, OPTION_PCI_BURST, FALSE)) { ps3v->pci_burst = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_burst - PCI burst read enabled\n"); } else @@ -695,8 +697,8 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) /* default */ ps3v->NoPCIRetry = 1; /* Set option */ - if (xf86ReturnOptValBool(S3VOptions, OPTION_PCI_RETRY, FALSE)) { - if (xf86ReturnOptValBool(S3VOptions, OPTION_PCI_BURST, FALSE)) { + if (xf86ReturnOptValBool(ps3v->Options, OPTION_PCI_RETRY, FALSE)) { + if (xf86ReturnOptValBool(ps3v->Options, OPTION_PCI_BURST, FALSE)) { ps3v->NoPCIRetry = 0; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_retry\n"); } @@ -705,85 +707,85 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) "\"pci_retry\" option requires \"pci_burst\".\n"); } } - if (xf86IsOptionSet(S3VOptions, OPTION_FIFO_CONSERV)) { + if (xf86IsOptionSet(ps3v->Options, OPTION_FIFO_CONSERV)) { ps3v->fifo_conservative = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_conservative set\n"); } else ps3v->fifo_conservative = FALSE; - if (xf86IsOptionSet(S3VOptions, OPTION_FIFO_MODERATE)) { + if (xf86IsOptionSet(ps3v->Options, OPTION_FIFO_MODERATE)) { ps3v->fifo_moderate = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_moderate set\n"); } else ps3v->fifo_moderate = FALSE; - if (xf86IsOptionSet(S3VOptions, OPTION_FIFO_AGGRESSIVE)) { + if (xf86IsOptionSet(ps3v->Options, OPTION_FIFO_AGGRESSIVE)) { ps3v->fifo_aggressive = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_aggressive set\n"); } else ps3v->fifo_aggressive = FALSE; - if (xf86IsOptionSet(S3VOptions, OPTION_SLOW_EDODRAM)) { + if (xf86IsOptionSet(ps3v->Options, OPTION_SLOW_EDODRAM)) { ps3v->slow_edodram = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: slow_edodram set\n"); } else ps3v->slow_edodram = FALSE; - if (xf86IsOptionSet(S3VOptions, OPTION_SLOW_DRAM)) { + if (xf86IsOptionSet(ps3v->Options, OPTION_SLOW_DRAM)) { ps3v->slow_dram = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: slow_dram set\n"); } else ps3v->slow_dram = FALSE; - if (xf86IsOptionSet(S3VOptions, OPTION_FAST_DRAM)) { + if (xf86IsOptionSet(ps3v->Options, OPTION_FAST_DRAM)) { ps3v->fast_dram = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fast_dram set\n"); } else ps3v->fast_dram = FALSE; - if (xf86IsOptionSet(S3VOptions, OPTION_FPM_VRAM)) { + if (xf86IsOptionSet(ps3v->Options, OPTION_FPM_VRAM)) { ps3v->fpm_vram = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fpm_vram set\n"); } else ps3v->fpm_vram = FALSE; - if (xf86ReturnOptValBool(S3VOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(ps3v->Options, OPTION_NOACCEL, FALSE)) { ps3v->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - Acceleration disabled\n"); } else ps3v->NoAccel = FALSE; - if (xf86ReturnOptValBool(S3VOptions, OPTION_EARLY_RAS_PRECHARGE, FALSE)) { + if (xf86ReturnOptValBool(ps3v->Options, OPTION_EARLY_RAS_PRECHARGE, FALSE)) { ps3v->early_ras_precharge = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: early_ras_precharge set\n"); } else ps3v->early_ras_precharge = FALSE; - if (xf86ReturnOptValBool(S3VOptions, OPTION_LATE_RAS_PRECHARGE, FALSE)) { + if (xf86ReturnOptValBool(ps3v->Options, OPTION_LATE_RAS_PRECHARGE, FALSE)) { ps3v->late_ras_precharge = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: late_ras_precharge set\n"); } else ps3v->late_ras_precharge = FALSE; - if (xf86ReturnOptValBool(S3VOptions, OPTION_LCD_CENTER, FALSE)) { + if (xf86ReturnOptValBool(ps3v->Options, OPTION_LCD_CENTER, FALSE)) { ps3v->lcd_center = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: lcd_center set\n"); } else ps3v->lcd_center = FALSE; - if (xf86ReturnOptValBool(S3VOptions, OPTION_SHOWCACHE, FALSE)) { + if (xf86ReturnOptValBool(ps3v->Options, OPTION_SHOWCACHE, FALSE)) { ps3v->ShowCache = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: show_cache set\n"); } else ps3v->ShowCache = FALSE; - if (xf86GetOptValInteger(S3VOptions, OPTION_LCDCLOCK, &ps3v->LCDClk)) { + if (xf86GetOptValInteger(ps3v->Options, OPTION_LCDCLOCK, &ps3v->LCDClk)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: lcd_setclk set to %1.3f Mhz\n", ps3v->LCDClk / 1000.0 ); } else ps3v->LCDClk = 0; - if (xf86GetOptValFreq(S3VOptions, OPTION_MCLK, OPTUNITS_MHZ, &real)) { + if (xf86GetOptValFreq(ps3v->Options, OPTION_MCLK, OPTUNITS_MHZ, &real)) { ps3v->MCLK = (int)(real * 1000.0); if (ps3v->MCLK <= 100000) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: set_mclk set to %1.3f Mhz\n", @@ -797,7 +799,7 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) } else ps3v->MCLK = 0; - if (xf86GetOptValFreq(S3VOptions, OPTION_REFCLK, OPTUNITS_MHZ, &real)) { + if (xf86GetOptValFreq(ps3v->Options, OPTION_REFCLK, OPTUNITS_MHZ, &real)) { ps3v->REFCLK = (int)(real * 1000.0); xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: set_refclk set to %1.3f Mhz\n", ps3v->REFCLK / 1000.0 ); @@ -806,20 +808,20 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) from = X_DEFAULT; ps3v->hwcursor = TRUE; - if (xf86GetOptValBool(S3VOptions, OPTION_HWCURSOR, &ps3v->hwcursor)) + if (xf86GetOptValBool(ps3v->Options, OPTION_HWCURSOR, &ps3v->hwcursor)) from = X_CONFIG; - if (xf86ReturnOptValBool(S3VOptions, OPTION_SWCURSOR, FALSE)) { + if (xf86ReturnOptValBool(ps3v->Options, OPTION_SWCURSOR, FALSE)) { ps3v->hwcursor = FALSE; from = X_CONFIG; } xf86DrvMsg(pScrn->scrnIndex, from, "Using %s Cursor\n", ps3v->hwcursor ? "HW" : "SW"); - if (xf86GetOptValBool(S3VOptions, OPTION_SHADOW_FB,&ps3v->shadowFB)) + if (xf86GetOptValBool(ps3v->Options, OPTION_SHADOW_FB,&ps3v->shadowFB)) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowFB %s.\n", ps3v->shadowFB ? "enabled" : "disabled"); - if ((s = xf86GetOptValString(S3VOptions, OPTION_ROTATE))) { + if ((s = xf86GetOptValString(ps3v->Options, OPTION_ROTATE))) { if(!xf86NameCmp(s, "CW")) { /* accel is disabled below for shadowFB */ ps3v->shadowFB = TRUE; @@ -851,9 +853,9 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) ps3v->hwcursor = FALSE; } - if (xf86IsOptionSet(S3VOptions, OPTION_FB_DRAW)) + if (xf86IsOptionSet(ps3v->Options, OPTION_FB_DRAW)) { - if (xf86GetOptValBool(S3VOptions, OPTION_FB_DRAW ,&ps3v->UseFB)) + if (xf86GetOptValBool(ps3v->Options, OPTION_FB_DRAW ,&ps3v->UseFB)) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using %s.\n", ps3v->UseFB ? "fb (not cfb)" : "cfb (not fb)"); } @@ -938,11 +940,15 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) if (pScrn->chipset == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "ChipID 0x%04X is not recognised\n", ps3v->Chipset); + vbeFree(ps3v->pVbe); + ps3v->pVbe = NULL; return FALSE; } if (ps3v->Chipset < 0) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Chipset \"%s\" is not recognised\n", pScrn->chipset); + vbeFree(ps3v->pVbe); + ps3v->pVbe = NULL; return FALSE; } @@ -987,9 +993,10 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) S3Vddc2(pScrn->scrnIndex); } } - if (ps3v->pVbe) + if (ps3v->pVbe) { vbeFree(ps3v->pVbe); - + ps3v->pVbe = NULL; + } /* * If the driver can do gamma correction, it should call xf86SetGamma() @@ -1442,8 +1449,8 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) { if( xf86LoadSubModule(pScrn, "fb") == NULL ) { - S3VFreeRec(pScrn); - return FALSE; + S3VFreeRec(pScrn); + return FALSE; } xf86LoaderReqSymLists(fbSymbols, NULL); } @@ -1473,8 +1480,8 @@ S3VPreInit(ScrnInfoPtr pScrn, int flags) break; } if (mod && xf86LoadSubModule(pScrn, mod) == NULL) { - S3VFreeRec(pScrn); - return FALSE; + S3VFreeRec(pScrn); + return FALSE; } xf86LoaderReqSymbols(reqSym, NULL); @@ -3860,6 +3867,7 @@ S3VProbeDDC(ScrnInfoPtr pScrn, int index) if (xf86LoadSubModule(pScrn, "vbe")) { pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); + vbeFree(pVbe); } } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man index aa2f9a0b4..943278ea5 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man +++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man,v 1.3 2001/02/13 21:15:19 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage.man,v 1.4 2001/05/18 23:35:32 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH SAVAGE __drivermansuffix__ __vendorversion__ @@ -38,6 +38,12 @@ driver supports PCI and AGP boards with the following chips: .TP 16 .B ProSavage KM133 (8a26) +.TP 16 +.B Twister +(8d01) +.TP 16 +.B TwisterK +(8d02) .SH CONFIGURATION DETAILS Please refer to XF86Config(__filemansuffix__) for general configuration details. This section only covers configuration details specific to this @@ -95,6 +101,15 @@ you would rather have the .B savage driver use your mode line timing exactly, turn off the UseBios option. Default: on (use the BIOS). +.BI "Option \*qShadowStatus\*q \q*" boolean \*q +Enables the use of a shadow status register. There is a chip bug in the +Savage graphics engine that can cause a bus lock when reading the engine +status register under heavy load, such as when scrolling text or dragging +windows. The bug affects about 4% of all Savage users. If your system +hangs regularly while scrolling text or dragging windows, try turning this +option on. This uses an alternate method of reading the engine status +which is slightly more expensive, but avoids the problem. Default: off +(use normal status register). .SH FILES savage_drv.o .SH "SEE ALSO" 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 37776b1cc..c97c67e27 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.8 2001/04/19 14:09:36 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_accel.c,v 1.10 2001/05/18 23:35:32 dawes Exp $ */ /* * @@ -198,8 +198,12 @@ void SavageWriteBitmapCPUToScreenColorExpand ( unsigned int planemask ); +unsigned long writedw( unsigned long addr, unsigned long value ); +unsigned long readdw( unsigned long addr ); +unsigned long readfb( unsigned long addr ); +unsigned long writefb( unsigned long addr, unsigned long value ); +void writescan( unsigned long scan, unsigned long color ); -void SavageSetGBD( ScrnInfoPtr ); /* * This is used to cache the last known value for routines we want to @@ -230,20 +234,7 @@ SavageInitialize2DEngine(ScrnInfoPtr pScrn) OUTREG(0x812C, ~0); /* enable all read planes */ OUTREG16(0x8134, 0x27); OUTREG16(0x8136, 0x07); - - if( psav->ShadowStatus && !psav->ShadowPhysical ) - { - psav->ShadowPhysical = - psav->FrameBufferBase + psav->CursorKByte*1024 + 4096 - 32; - - psav->ShadowVirtual = (unsigned long*) - (psav->FBBase + psav->CursorKByte*1024 + 4096 - 32); - - xf86DrvMsg( pScrn->scrnIndex, X_PROBED, - "Shadow area physical %08x, linear %08x\n", - psav->ShadowPhysical, psav->ShadowVirtual ); - } - + switch( psav->Chipset ) { case S3_SAVAGE3D: diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c index ecd931bc4..9449b3c5f 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c,v 1.2 2001/02/13 21:15:19 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_cursor.c,v 1.4 2001/05/18 23:35:32 dawes Exp $ */ /* * Hardware cursor support for S3 Savage 4.0 driver. Taken with @@ -22,8 +22,19 @@ static void SavageSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg); #define inCRReg(reg) (VGAHWPTR(pScrn))->readCrtc( VGAHWPTR(pScrn), reg ) #define outCRReg(reg, val) (VGAHWPTR(pScrn))->writeCrtc( VGAHWPTR(pScrn), reg, val ) +#define inStatus1() (VGAHWPTR(pScrn))->readST01( VGAHWPTR(pScrn) ) - +/* + * certain HW cursor operations seem + * to require a delay to prevent lockups. + */ +#define waitHSync(n) { \ + int num = n; \ + while (num--) { \ + while ((inStatus1()) & 0x01){};\ + while (!(inStatus1()) & 0x01){};\ + } \ + } #define MAX_CURS 64 @@ -55,11 +66,12 @@ SavageHWCursorInit(ScreenPtr pScreen) */ if( - ( (inCRReg(0x18) & 0x80) && (inCRReg(0x15) & 0x50) ) + ((psav->Chipset != S3_SAVAGE4) + && (inCRReg(0x18) & 0x80) && (inCRReg(0x15) & 0x50) ) || (psav->Chipset == S3_SAVAGE_MX) - ) - infoPtr->Flags |= HARDWARE_CURSOR_TRUECOLOR_AT_8BPP; + ) + infoPtr->Flags |= HARDWARE_CURSOR_TRUECOLOR_AT_8BPP; infoPtr->SetCursorColors = SavageSetCursorColors; infoPtr->SetCursorPosition = SavageSetCursorPosition; @@ -87,10 +99,14 @@ SavageShowCursor(ScrnInfoPtr pScrn) void SavageHideCursor(ScrnInfoPtr pScrn) { - /* Turn cursor off. */ - outCRReg( 0x45, inCRReg(0x45) & 0xfe ); -} + /* Turn cursor off. */ + if( S3_SAVAGE4_SERIES( SAVPTR(pScrn)->Chipset ) ) + { + waitHSync(5); + } + outCRReg( 0x45, inCRReg(0x45) & 0xfe ); +} static void SavageLoadCursorImage( @@ -115,7 +131,6 @@ SavageLoadCursorImage( } } - static void SavageSetCursorPosition( ScrnInfoPtr pScrn, @@ -124,6 +139,10 @@ SavageSetCursorPosition( { unsigned char xoff, yoff; + if( S3_SAVAGE4_SERIES( SAVPTR(pScrn)->Chipset ) ) + { + waitHSync(5); + } /* adjust for frame buffer base address granularity */ if (pScrn->bitsPerPixel == 8) x += ((pScrn->frameX0) & 3); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c index cba254710..6f58409f7 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c,v 1.2 2001/04/18 15:29:19 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dga.c,v 1.3 2001/05/18 23:35:32 dawes Exp $ */ /* Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. @@ -38,6 +38,7 @@ in this Software without prior written authorization from the XFree86 Project. #include "dgaproc.h" +Bool SavageDGAInit(ScreenPtr pScreen); static Bool Savage_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, int *, int *, int *); static Bool Savage_SetMode(ScrnInfoPtr, DGAModePtr); 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 633013a49..2b2a5ef4d 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.15 2001/04/20 02:52:45 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.c,v 1.19 2001/05/18 23:35:32 dawes Exp $ */ /* * vim: sw=4 ts=8 ai ic: * @@ -35,7 +35,7 @@ static void SavageEnableMMIO(ScrnInfoPtr pScrn); static void SavageDisableMMIO(ScrnInfoPtr pScrn); -static OptionInfoPtr SavageAvailableOptions(int chipid, int busid); +static const OptionInfoRec * SavageAvailableOptions(int chipid, int busid); static void SavageIdentify(int flags); static Bool SavageProbe(DriverPtr drv, int flags); static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags); @@ -61,6 +61,9 @@ static Bool SavageSaveScreen(ScreenPtr pScreen, int mode); static void SavageLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, LOCO *colors, VisualPtr pVisual); +static void SavageLoadPaletteSavage4(ScrnInfoPtr pScrn, int numColors, + int *indicies, LOCO *colors, + VisualPtr pVisual); static void SavageCalcClock(long freq, int min_m, int min_n1, int max_n1, int min_n2, int max_n2, long freq_min, long freq_max, unsigned int *mdiv, @@ -86,7 +89,7 @@ extern ScrnInfoPtr gpScrn; PATCHLEVEL) -/* #define TRACEON */ +/*#define TRACEON*/ #ifdef TRACEON #define TRACE(prms) ErrorF prms #else @@ -169,7 +172,7 @@ typedef enum { } SavageOpts; -static OptionInfoRec SavageOptions[] = +static const OptionInfoRec SavageOptions[] = { { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HWCURSOR, "HWCursor", OPTV_BOOLEAN, {0}, FALSE }, @@ -217,9 +220,7 @@ static const char *vbeSymbols[] = { }; static const char *vbeOptSymbols[] = { -#if 0 "vbeModeInit", -#endif "VBESetVBEMode", NULL }; @@ -341,19 +342,13 @@ static Bool ShadowWait( SavagePtr psav ) { BCI_GET_PTR; - static int dwBCIWait2DIdle = 0; int loop = 0; - if( !dwBCIWait2DIdle ) - { - if( psav->Chipset == S3_SAVAGE2000 ) - dwBCIWait2DIdle = 0xc0040000; - else - dwBCIWait2DIdle = 0xc0020000; - } + if( !psav->NoPCIRetry ) + return 0; psav->ShadowCounter = (psav->ShadowCounter + 1) & 0x7fff; - BCI_SEND( dwBCIWait2DIdle ); + BCI_SEND( psav->dwBCIWait2DIdle ); BCI_SEND( 0x98000000 + psav->ShadowCounter ); while( @@ -365,6 +360,13 @@ ShadowWait( SavagePtr psav ) return loop >= MAXLOOP; } +static Bool +ShadowWait1( SavagePtr psav, int v ) +{ + return ShadowWait( psav ); +} + + /* Wait until "v" queue entries are free */ static int @@ -376,7 +378,7 @@ WaitQueue3D( SavagePtr psav, int v ) mem_barrier(); if( psav->ShadowVirtual ) { - psav->WaitIdle = ShadowWait; + psav->WaitQueue = ShadowWait1; return ShadowWait(psav); } else @@ -399,7 +401,7 @@ WaitQueue4( SavagePtr psav, int v ) mem_barrier(); if( psav->ShadowVirtual ) { - psav->WaitIdle = ShadowWait; + psav->WaitQueue = ShadowWait1; return ShadowWait(psav); } else @@ -419,7 +421,7 @@ WaitQueue2K( SavagePtr psav, int v ) mem_barrier(); if( psav->ShadowVirtual ) { - psav->WaitIdle = ShadowWait; + psav->WaitQueue = ShadowWait1; return ShadowWait(psav); } else @@ -551,7 +553,7 @@ static void SavageFreeRec(ScrnInfoPtr pScrn) } -static OptionInfoPtr SavageAvailableOptions(int chipid, int busid) +static const OptionInfoRec * SavageAvailableOptions(int chipid, int busid) { return SavageOptions; } @@ -742,9 +744,12 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) if (pScrn->depth == 8) pScrn->rgbBits = 6; - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, SavageOptions); + if (!(psav->Options = xalloc(sizeof(SavageOptions)))) + return FALSE; + memcpy(psav->Options, SavageOptions, sizeof(SavageOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, psav->Options); - xf86GetOptValBool(SavageOptions, OPTION_PCI_BURST, &psav->pci_burst); + xf86GetOptValBool(psav->Options, OPTION_PCI_BURST, &psav->pci_burst); if (psav->pci_burst) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, @@ -752,20 +757,20 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) } psav->NoPCIRetry = 1; /* default */ - if (xf86ReturnOptValBool(SavageOptions, OPTION_PCI_RETRY, FALSE)) { - if (xf86ReturnOptValBool(SavageOptions, OPTION_PCI_BURST, FALSE)) { + if (xf86ReturnOptValBool(psav->Options, OPTION_PCI_RETRY, FALSE)) { + if (xf86ReturnOptValBool(psav->Options, OPTION_PCI_BURST, FALSE)) { psav->NoPCIRetry = 0; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_retry\n"); } else xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"pci_retry\" option requires \"pci_burst\"\n"); } - xf86GetOptValBool( SavageOptions, OPTION_SHADOW_FB, &psav->shadowFB ); + xf86GetOptValBool( psav->Options, OPTION_SHADOW_FB, &psav->shadowFB ); if (psav->shadowFB) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: shadow FB enabled\n"); } - if ((s = xf86GetOptValString(SavageOptions, OPTION_ROTATE))) { + if ((s = xf86GetOptValString(psav->Options, OPTION_ROTATE))) { if(!xf86NameCmp(s, "CW")) { /* accel is disabled below for shadowFB */ psav->shadowFB = TRUE; @@ -785,7 +790,7 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) } } - if (xf86GetOptValBool(SavageOptions, OPTION_NOACCEL, &psav->NoAccel)) + if (xf86GetOptValBool(psav->Options, OPTION_NOACCEL, &psav->NoAccel)) xf86DrvMsg( pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - Acceleration Disabled\n"); @@ -803,9 +808,9 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) from = X_DEFAULT; psav->hwcursor = psav->shadowFB ? FALSE : TRUE; - if (xf86GetOptValBool(SavageOptions, OPTION_HWCURSOR, &psav->hwcursor)) + if (xf86GetOptValBool(psav->Options, OPTION_HWCURSOR, &psav->hwcursor)) from = X_CONFIG; - if (xf86ReturnOptValBool(SavageOptions, OPTION_SWCURSOR, FALSE)) { + if (xf86ReturnOptValBool(psav->Options, OPTION_SWCURSOR, FALSE)) { psav->hwcursor = FALSE; from = X_CONFIG; } @@ -814,17 +819,17 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags) from = X_DEFAULT; psav->UseBIOS = TRUE; - if (xf86GetOptValBool(SavageOptions, OPTION_USEBIOS, &psav->UseBIOS) ) + if (xf86GetOptValBool(psav->Options, OPTION_USEBIOS, &psav->UseBIOS) ) from = X_CONFIG; xf86DrvMsg(pScrn->scrnIndex, from, "%ssing video BIOS to set modes\n", psav->UseBIOS ? "U" : "Not u" ); psav->LCDClock = 0.0; - if( xf86GetOptValFreq( SavageOptions, OPTION_LCDCLOCK, OPTUNITS_MHZ, &psav->LCDClock ) ) + if( xf86GetOptValFreq( psav->Options, OPTION_LCDCLOCK, OPTUNITS_MHZ, &psav->LCDClock ) ) xf86DrvMsg( pScrn->scrnIndex, X_CONFIG, "Option: LCDClock %1.2f MHz\n", psav->LCDClock ); - if( xf86GetOptValBool( SavageOptions, OPTION_SHADOW_STATUS, &psav->ShadowStatus)) + if( xf86GetOptValBool( psav->Options, OPTION_SHADOW_STATUS, &psav->ShadowStatus)) xf86DrvMsg( pScrn->scrnIndex, X_CONFIG, "Option: ShadowStatus enabled\n" ); @@ -1712,15 +1717,8 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, break; } - #if 0 - if( !psav->NoAccel ) - { - #endif - SavageInitialize2DEngine(pScrn); - SavageSetGBD(pScrn); -#if 0 - } -#endif + SavageInitialize2DEngine(pScrn); + SavageSetGBD(pScrn); VGAOUT16(vgaCRIndex, 0x0140); @@ -1934,11 +1932,8 @@ static void SavageWriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, { VerticalRetraceWait(); OUTREG(FIFO_CONTROL_REG, restore->MMPR0); - psav->WaitIdle(psav); OUTREG(MIU_CONTROL_REG, restore->MMPR1); - psav->WaitIdle(psav); OUTREG(STREAMS_TIMEOUT_REG, restore->MMPR2); - psav->WaitIdle(psav); OUTREG(MISC_TIMEOUT_REG, restore->MMPR3); } @@ -2096,6 +2091,28 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen, if (!SavageMapFB(pScrn)) return FALSE; + + if( psav->ShadowStatus ) { + psav->ShadowPhysical = + psav->FrameBufferBase + psav->CursorKByte*1024 + 4096 - 32; + + psav->ShadowVirtual = (unsigned long*) + (psav->FBBase + psav->CursorKByte*1024 + 4096 - 32); + + xf86DrvMsg( pScrn->scrnIndex, X_PROBED, + "Shadow area physical %08x, linear %08x\n", + psav->ShadowPhysical, psav->ShadowVirtual ); + + psav->WaitQueue = ShadowWait1; + psav->WaitIdle = ShadowWait; + psav->WaitIdleEmpty = ShadowWait; + + if( psav->Chipset == S3_SAVAGE2000 ) + psav->dwBCIWait2DIdle = 0xc0040000; + else + psav->dwBCIWait2DIdle = 0xc0020000; + } + psav->ShadowCounter = 0; SavageSave(pScrn); @@ -2182,9 +2199,15 @@ static Bool SavageScreenInit(int scrnIndex, ScreenPtr pScreen, if (!miCreateDefColormap(pScreen)) return FALSE; - if (!xf86HandleColormaps(pScreen, 256, 6, SavageLoadPalette, NULL, - CMAP_RELOAD_ON_MODE_SWITCH)) - return FALSE; + if (psav->Chipset == S3_SAVAGE4) { + if (!xf86HandleColormaps(pScreen, 256, 6, SavageLoadPaletteSavage4, + NULL, CMAP_RELOAD_ON_MODE_SWITCH)) + return FALSE; + } else { + if (!xf86HandleColormaps(pScreen, 256, 6, SavageLoadPalette, NULL, + CMAP_RELOAD_ON_MODE_SWITCH)) + return FALSE; + } vgaHWBlankScreen(pScrn, FALSE); @@ -2569,10 +2592,10 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) else new->CR50 |= 0xc1; /* Use GBD */ - if( psav->Chipset == S3_SAVAGE2000 ) - new->CR33 = 0x08; + if( psav->Chipset == S3_SAVAGE_MX ) + new->CR33 = 0x00; else - new->CR33 = 0x20; + new->CR33 = 0x08; vganew->CRTC[0x17] = 0xeb; @@ -2742,7 +2765,6 @@ void SavageDisableMMIO(ScrnInfoPtr pScrn) return; } - void SavageLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, LOCO *colors, VisualPtr pVisual) { @@ -2758,6 +2780,32 @@ void SavageLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, } } +#define inStatus1() (hwp->readST01( hwp )) + +void SavageLoadPaletteSavage4(ScrnInfoPtr pScrn, int numColors, int *indicies, + LOCO *colors, VisualPtr pVisual) +{ + SavagePtr psav = SAVPTR(pScrn); + int i, index; + + vgaHWPtr hwp = VGAHWPTR(pScrn); + int vgaCRIndex, vgaCRReg, vgaIOBase; + vgaIOBase = hwp->IOBase; + vgaCRIndex = vgaIOBase + 4; + vgaCRReg = vgaIOBase + 5; + VerticalRetraceWait(); + + for (i=0; i<numColors; i++) { + if (!(inStatus1()) & 0x08) + VerticalRetraceWait(); + index = indicies[i]; + VGAOUT8(0x3c8, index); + VGAOUT8(0x3c9, colors[index].red); + VGAOUT8(0x3c9, colors[index].green); + VGAOUT8(0x3c9, colors[index].blue); + } +} + static void SavageCalcClock(long freq, int min_m, int min_n1, int max_n1, 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 f8f5abb0b..1bb0bfc5e 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.7 2001/04/27 12:58:28 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h,v 1.10 2001/05/18 23:35:32 dawes Exp $ */ #ifndef SAVAGE_VGAHWMMIO_H #define SAVAGE_VGAHWMMIO_H @@ -107,6 +107,7 @@ typedef struct _Savage { /* Here are all the Options */ + OptionInfoPtr Options; Bool ShowCache; Bool pci_burst; Bool NoPCIRetry; @@ -174,6 +175,7 @@ typedef struct _Savage { int videoFourCC; XF86VideoAdaptorPtr adaptor; int VideoZoomMax; + int dwBCIWait2DIdle; } SavageRec, *SavagePtr; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_image.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_image.c index 34a13a56b..d2a2924fb 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_image.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_image.c @@ -1,9 +1,35 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_image.c,v 1.3 2001/04/18 15:29:19 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_image.c,v 1.4 2001/05/18 23:35:32 dawes Exp $ */ #include "savage_driver.h" #include "xaarop.h" #include "savage_bci.h" +void SavageSubsequentImageWriteRect ( + ScrnInfoPtr pScrn, + int x, + int y, + int w, + int h, + int skipleft); + +void SavageSetupForImageWrite ( + ScrnInfoPtr pScrn, + int rop, + unsigned planemask, + int transparency_color, + int bpp, + int depth); + +void SavageWriteBitmapCPUToScreenColorExpand ( + ScrnInfoPtr pScrn, + int x, int y, int w, int h, + unsigned char * src, + int srcwidth, + int skipleft, + int fg, int bg, + int rop, + unsigned int planemask); + #if 0 void SavageWriteBitmapScreenToScreenColorExpand( ScrnPtr pScrn, 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 e1a046b01..e3c896055 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.7 2001/04/27 12:58:28 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_regs.h,v 1.8 2001/05/15 10:19:39 eich Exp $ */ #ifndef _SAVAGE_REGS_H #define _SAVAGE_REGS_H @@ -173,8 +173,14 @@ enum S3CHIPTAGS { #define MAXFIFO 0x7f00 +/* + * NOTE: don't remove 'VGAIN8(vgaCRIndex);'. + * If not present it will cause lockups on Savage4. + * Ask S3, why. + */ #define VerticalRetraceWait() \ { \ + VGAIN8(vgaCRIndex); \ VGAOUT8(vgaCRIndex, 0x17); \ if (VGAIN8(vgaCRReg) & 0x80) { \ while ((VGAIN8(vgaIOBase + 0x0a) & 0x08) == 0x08) ; \ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c index 49b60bb59..61c02ed38 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c,v 1.6 2001/04/19 14:07:05 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_vbe.c,v 1.9 2001/05/19 02:05:55 dawes Exp $ */ #include "savage_driver.h" #include "savage_vbe.h" @@ -13,9 +13,7 @@ #endif #define L_ADD(x) (B_O32(x) & 0xffff) + ((B_O32(x) >> 12) & 0xffff00) -#if 0 Bool vbeModeInit( vbeInfoPtr, int ); -#endif static void SavageClearVM86Regs( xf86Int10InfoPtr pInt ) @@ -63,7 +61,7 @@ SavageSetVESAMode( SavagePtr psav, int n, int Refresh ) ErrorF("Set video mode failed\n"); } } -#if 0 +#ifdef XFree86LOADER else { if( !vbeModeInit( psav->pVbe, n ) ) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c index 221111c85..1efca5907 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c,v 1.2 2001/04/18 15:29:19 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/savage/savage_video.c,v 1.3 2001/05/18 23:35:33 dawes Exp $ */ #include "Xv.h" #include "dix.h" @@ -22,6 +22,8 @@ void SavageInitVideo(ScreenPtr pScreen) {} void SavageResetVideo(ScrnInfoPtr pScrn) {} #else +void myOUTREG( SavagePtr psav, unsigned long offset, unsigned long value ); + static XF86VideoAdaptorPtr SavageSetupImageVideo(ScreenPtr); static void SavageInitOffscreenImages(ScreenPtr); static void SavageStopVideo(ScrnInfoPtr, pointer, Bool); @@ -35,6 +37,10 @@ static int SavagePutImage( ScrnInfoPtr, static int SavageQueryImageAttributes(ScrnInfoPtr, int, unsigned short *, unsigned short *, int *, int *); +void SavageStreamsOn(ScrnInfoPtr pScrn, int id); +void SavageStreamsOff(ScrnInfoPtr pScrn); +void SavageResetVideo(ScrnInfoPtr pScrn); + static void SavageInitStreamsOld(ScrnInfoPtr pScrn); static void SavageInitStreamsNew(ScrnInfoPtr pScrn); static void (*SavageInitStreams)(ScrnInfoPtr pScrn) = NULL; @@ -344,9 +350,11 @@ void SavageInitStreamsOld(ScrnInfoPtr pScrn) } #undef OUTREG +#if 0 #define OUTREG(a,v) myOUTREG(psav,a,v) -#undef OUTREG +#else #define OUTREG(addr,val) MMIO_OUT32(psav->MapBase, addr, val) +#endif void SavageInitStreamsNew(ScrnInfoPtr pScrn) { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h index 3061d60fa..c2b6f18c0 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h @@ -26,11 +26,13 @@ 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.4 2001/03/03 22:26:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi.h,v 1.6 2001/05/15 10:19:40 eich Exp $ */ #ifndef _SMI_H #define _SMI_H +#define USE_FB + #include "xf86.h" #include "xf86_OSproc.h" #include "xf86_ansic.h" @@ -44,11 +46,16 @@ authorization from the XFree86 Project and Silicon Motion. #include "mipointer.h" #include "micmap.h" +#ifdef USE_FB +#include "fb.h" +#else + #define PSZ 8 #include "cfb.h" #undef PSZ #include "cfb16.h" #include "cfb24.h" +#endif #include "xaa.h" #include "xf86cmap.h" @@ -239,7 +246,8 @@ typedef struct void (*BlockHandler)(int i, pointer blockData, pointer pTimeout, pointer pReadMask); #endif - + OptionInfoPtr Options; + CARD8 DACmask; } SMIRec, *SMIPtr; #define SMIPTR(p) ((SMIPtr)((p)->driverPrivate)) 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 9a583f336..60e1202a1 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c @@ -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.10 2001/03/08 17:12:12 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/siliconmotion/smi_driver.c,v 1.12.2.1 2001/05/25 18:15:46 eich Exp $ */ #include "xf86Resources.h" #include "xf86RAC.h" @@ -51,7 +51,7 @@ static void SMI_DisableMmio(ScrnInfoPtr pScrn); * Forward definitions for the functions that make up the driver. */ -static OptionInfoPtr SMI_AvailableOptions(int chipid, int busid); +static const OptionInfoRec * SMI_AvailableOptions(int chipid, int busid); static void SMI_Identify(int flags); static Bool SMI_Probe(DriverPtr drv, int flags); static Bool SMI_PreInit(ScrnInfoPtr pScrn, int flags); @@ -65,6 +65,8 @@ static int SMI_InternalScreenInit(int scrnIndex, ScreenPtr pScreen); static void SMI_PrintRegs(ScrnInfoPtr); static ModeStatus SMI_ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags); +static void SMI_DisableVideo(ScrnInfoPtr pScrn); +static void SMI_EnableVideo(ScrnInfoPtr pScrn); static Bool SMI_MapMem(ScrnInfoPtr pScrn); static void SMI_UnmapMem(ScrnInfoPtr pScrn); static Bool SMI_ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); @@ -158,7 +160,7 @@ typedef enum } SMIOpts; -static OptionInfoRec SMIOptions[] = +static const OptionInfoRec SMIOptions[] = { { OPTION_PCI_BURST, "pci_burst", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_FIFO_CONSERV, "fifo_conservative", OPTV_BOOLEAN, {0}, FALSE }, @@ -188,7 +190,7 @@ static OptionInfoRec SMIOptions[] = * Note that vgahwSymbols and xaaSymbols are referenced outside the * XFree86LOADER define in later code, so are defined outside of that * define here also. - * cfbSymbols and ramdacSymbols are only referenced from within the + * fbSymbols and ramdacSymbols are only referenced from within the * ...LOADER define. */ @@ -267,10 +269,12 @@ static const char *vbeSymbols[] = NULL }; -#ifdef XFree86LOADER - -static const char *cfbSymbols[] = +static const char *fbSymbols[] = { +#ifdef USE_FB + "fbScreenInit", + "fbPictureInit", +#else "cfbScreenInit", "cfb16ScreenInit", "cfb24ScreenInit", @@ -278,9 +282,12 @@ static const char *cfbSymbols[] = "cfb32ScreenInit", "cfb16BresS", "cfb24BresS", +#endif NULL }; +#ifdef XFree86LOADER + static MODULESETUPPROTO(siliconmotionSetup); static XF86ModuleVersionInfo SMIVersRec = @@ -330,7 +337,7 @@ siliconmotionSetup(pointer module, pointer opts, int *errmaj, int *errmin) * Tell the loader about symbols from other modules that this module * might refer to. */ - LoaderRefSymLists(vgahwSymbols, cfbSymbols, xaaSymbols, ramdacSymbols, + LoaderRefSymLists(vgahwSymbols, fbSymbols, xaaSymbols, ramdacSymbols, ddcSymbols, i2cSymbols, int10Symbols, vbeSymbols, shadowSymbols, NULL); @@ -385,7 +392,7 @@ SMI_FreeRec(ScrnInfoPtr pScrn) LEAVE_PROC("SMI_FreeRec"); } -static OptionInfoPtr +static const OptionInfoRec * SMI_AvailableOptions(int chipid, int busid) { ENTER_PROC("SMI_AvailableOptions"); @@ -489,8 +496,10 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) int i; double real; ClockRangePtr clockRanges; +#ifndef USE_FB char *mod = NULL; const char *reqSym = NULL; +#endif char *s; unsigned char config, m, n, shift; int mclk; @@ -618,9 +627,12 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) } /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, SMIOptions); + if (!(pSmi->Options = xalloc(sizeof(SMIOptions)))) + return FALSE; + memcpy(pSmi->Options, SMIOptions, sizeof(SMIOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pSmi->Options); - if (xf86ReturnOptValBool(SMIOptions, OPTION_PCI_BURST, FALSE)) + if (xf86ReturnOptValBool(pSmi->Options, OPTION_PCI_BURST, FALSE)) { pSmi->pci_burst = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_burst - PCI burst " @@ -632,9 +644,9 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) } pSmi->NoPCIRetry = TRUE; - if (xf86ReturnOptValBool(SMIOptions, OPTION_PCI_RETRY, FALSE)) + if (xf86ReturnOptValBool(pSmi->Options, OPTION_PCI_RETRY, FALSE)) { - if (xf86ReturnOptValBool(SMIOptions, OPTION_PCI_BURST, FALSE)) + if (xf86ReturnOptValBool(pSmi->Options, OPTION_PCI_BURST, FALSE)) { pSmi->NoPCIRetry = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: pci_retry\n"); @@ -646,7 +658,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) } } - if (xf86IsOptionSet(SMIOptions, OPTION_FIFO_CONSERV)) + if (xf86IsOptionSet(pSmi->Options, OPTION_FIFO_CONSERV)) { pSmi->fifo_conservative = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_conservative " @@ -657,7 +669,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) pSmi->fifo_conservative = FALSE; } - if (xf86IsOptionSet(SMIOptions, OPTION_FIFO_MODERATE)) + if (xf86IsOptionSet(pSmi->Options, OPTION_FIFO_MODERATE)) { pSmi->fifo_moderate = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_moderate set\n"); @@ -667,7 +679,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) pSmi->fifo_moderate = FALSE; } - if (xf86IsOptionSet(SMIOptions, OPTION_FIFO_AGGRESSIVE)) + if (xf86IsOptionSet(pSmi->Options, OPTION_FIFO_AGGRESSIVE)) { pSmi->fifo_aggressive = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: fifo_aggressive set\n"); @@ -677,7 +689,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) pSmi->fifo_aggressive = FALSE; } - if (xf86ReturnOptValBool(SMIOptions, OPTION_NOACCEL, FALSE)) + if (xf86ReturnOptValBool(pSmi->Options, OPTION_NOACCEL, FALSE)) { pSmi->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - Acceleration " @@ -688,7 +700,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) pSmi->NoAccel = FALSE; } - if (xf86ReturnOptValBool(SMIOptions, OPTION_SHOWCACHE, FALSE)) + if (xf86ReturnOptValBool(pSmi->Options, OPTION_SHOWCACHE, FALSE)) { pSmi->ShowCache = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: show_cache set\n"); @@ -698,7 +710,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) pSmi->ShowCache = FALSE; } - if (xf86GetOptValFreq(SMIOptions, OPTION_MCLK, OPTUNITS_MHZ, &real)) + if (xf86GetOptValFreq(pSmi->Options, OPTION_MCLK, OPTUNITS_MHZ, &real)) { pSmi->MCLK = (int)(real * 1000.0); if (pSmi->MCLK <= 120000) @@ -721,11 +733,11 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) from = X_DEFAULT; pSmi->hwcursor = TRUE; - if (xf86GetOptValBool(SMIOptions, OPTION_HWCURSOR, &pSmi->hwcursor)) + if (xf86GetOptValBool(pSmi->Options, OPTION_HWCURSOR, &pSmi->hwcursor)) { from = X_CONFIG; } - if (xf86ReturnOptValBool(SMIOptions, OPTION_SWCURSOR, FALSE)) + if (xf86ReturnOptValBool(pSmi->Options, OPTION_SWCURSOR, FALSE)) { pSmi->hwcursor = FALSE; from = X_CONFIG; @@ -733,7 +745,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, from, "Using %s Cursor\n", pSmi->hwcursor ? "Hardware" : "Software"); - if (xf86GetOptValBool(SMIOptions, OPTION_SHADOW_FB, &pSmi->shadowFB)) + if (xf86GetOptValBool(pSmi->Options, OPTION_SHADOW_FB, &pSmi->shadowFB)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowFB %s.\n", pSmi->shadowFB ? "enabled" : "disabled"); @@ -742,7 +754,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) #if 1 /* PDR#932 */ if ((pScrn->depth == 8) || (pScrn->depth == 16)) #endif /* PDR#932 */ - if ((s = xf86GetOptValString(SMIOptions, OPTION_ROTATE))) + if ((s = xf86GetOptValString(pSmi->Options, OPTION_ROTATE))) { if(!xf86NameCmp(s, "CW")) { @@ -768,7 +780,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) } #ifdef XvExtension - if (xf86GetOptValInteger(SMIOptions, OPTION_VIDEOKEY, &pSmi->videoKey)) + if (xf86GetOptValInteger(pSmi->Options, OPTION_VIDEOKEY, &pSmi->videoKey)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: Video key set to " "0x%08X\n", pSmi->videoKey); @@ -780,7 +792,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) << pScrn->offset.blue); } - if (xf86ReturnOptValBool(SMIOptions, OPTION_BYTESWAP, FALSE)) + if (xf86ReturnOptValBool(pSmi->Options, OPTION_BYTESWAP, FALSE)) { pSmi->ByteSwap = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: ByteSwap enabled.\n"); @@ -791,7 +803,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) } #endif - if (xf86GetOptValBool(SMIOptions, OPTION_USEBIOS, &pSmi->useBIOS)) + if (xf86GetOptValBool(pSmi->Options, OPTION_USEBIOS, &pSmi->useBIOS)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: UseBIOS %s.\n", pSmi->useBIOS ? "enabled" : "disabled"); @@ -802,15 +814,15 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) pSmi->useBIOS = TRUE; } - if (xf86GetOptValBool(SMIOptions, OPTION_ZOOMONLCD, &pSmi->zoomOnLCD)) + if (xf86GetOptValBool(pSmi->Options, OPTION_ZOOMONLCD, &pSmi->zoomOnLCD)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: ZoomOnLCD %s.\n", pSmi->zoomOnLCD ? "enabled" : "disabled"); } else { - /* Default to ZoomOnLCD disabled. */ - pSmi->zoomOnLCD = FALSE; + /* Default to ZoomOnLCD enabled. */ + pSmi->zoomOnLCD = TRUE; } /* Find the PCI slot for this screen */ @@ -902,6 +914,8 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) pSmi->PciInfo->func); SMI_MapMem(pScrn); + SMI_DisableVideo(pScrn); + hwp = VGAHWPTR(pScrn); vgaIOBase = hwp->IOBase; vgaCRIndex = vgaIOBase + VGA_CRTC_INDEX_OFFSET; @@ -968,6 +982,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) if (pSmi->pVbe) { vbeFree(pSmi->pVbe); + pSmi->pVbe = NULL; } /* @@ -981,6 +996,8 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) if (!xf86SetGamma(pScrn, zeros)) { LEAVE_PROC("SMI_PreInit"); + SMI_EnableVideo(pScrn); + SMI_UnmapMem(pScrn); return(FALSE); } } @@ -1084,6 +1101,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected current MCLK value of " "%1.3f MHz\n", mclk / 1000.0); + SMI_EnableVideo(pScrn); SMI_UnmapMem(pScrn); pScrn->virtualX = pScrn->display->virtualX; @@ -1147,6 +1165,16 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) /* Set display resolution */ xf86SetDpi(pScrn, 0, 0); +#ifdef USE_FB + if ((xf86LoadSubModule(pScrn, "fb") == NULL)) + { + SMI_FreeRec(pScrn); + LEAVE_PROC("SMI_PreInit"); + return(FALSE); + } + + xf86LoaderReqSymLists(fbSymbols, NULL); +#else /* Load bpp-specific modules */ switch (pScrn->bitsPerPixel) { @@ -1174,7 +1202,7 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) } xf86LoaderReqSymbols(reqSym, NULL); - +#endif /* Load XAA if needed */ if (!pSmi->NoAccel || pSmi->hwcursor) { @@ -1839,7 +1867,7 @@ SMI_MapMem(ScrnInfoPtr pScrn) pSmi->lcdHeight = 1024; break; } - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, VERBLEV, "%s Panel Size = %dx%d\n", + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s Panel Size = %dx%d\n", (pSmi->lcd == 0) ? "OFF" : (pSmi->lcd == 1) ? "TFT" : "DSTN", pSmi->lcdWidth, pSmi->lcdHeight); @@ -1951,7 +1979,7 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) * support TrueColor and not DirectColor. To deal with this, call * miSetVisualTypes with the appropriate visual mask. */ - +#ifndef USE_FB if (pScrn->bitsPerPixel > 8) { if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, @@ -1962,6 +1990,7 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } } else +#endif { if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, @@ -1971,6 +2000,9 @@ SMI_ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) return(FALSE); } } +#ifdef USE_FB + if (!miSetPixmapDepths ()) return FALSE; +#endif if (!SMI_InternalScreenInit(scrnIndex, pScreen)) { @@ -2152,28 +2184,40 @@ SMI_InternalScreenInit(int scrnIndex, ScreenPtr pScreen) pSmi->FBBase, width, height, displayWidth)); switch (pScrn->bitsPerPixel) { - case 8: - ret = cfbScreenInit(pScreen, pSmi->FBBase, width, height, xDpi, - yDpi, displayWidth); - break; - - case 16: - ret = cfb16ScreenInit(pScreen, pSmi->FBBase, width, height, xDpi, - yDpi, displayWidth); - break; +#ifdef USE_FB + case 8: + case 16: + case 24: + ret = fbScreenInit(pScreen, pSmi->FBBase, width, height, xDpi, + yDpi, displayWidth,pScrn->bitsPerPixel); + break; +#else + case 8: + ret = cfbScreenInit(pScreen, pSmi->FBBase, width, height, xDpi, + yDpi, displayWidth); + break; - case 24: - ret = cfb24ScreenInit(pScreen, pSmi->FBBase, width, height, xDpi, + case 16: + ret = cfb16ScreenInit(pScreen, pSmi->FBBase, width, height, xDpi, yDpi, displayWidth); - break; + break; - default: - xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) " - "in SMI_InternalScreenInit\n", pScrn->bitsPerPixel); - LEAVE_PROC("SMI_InternalScreenInit"); - return(FALSE); + case 24: + ret = cfb24ScreenInit(pScreen, pSmi->FBBase, width, height, xDpi, + yDpi, displayWidth); + break; +#endif + default: + xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) " + "in SMI_InternalScreenInit\n", pScrn->bitsPerPixel); + LEAVE_PROC("SMI_InternalScreenInit"); + return(FALSE); } - + +#ifdef USE_FB + if (ret) + fbPictureInit(pScreen, 0, 0); +#endif LEAVE_PROC("SMI_InternalScreenInit"); return(ret); } @@ -2184,11 +2228,13 @@ SMI_ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; SMIPtr pSmi = SMIPTR(pScrn); + float refresh; ENTER_PROC("SMI_ValidMode"); - + refresh = (mode->VRefresh > 0) ? mode->VRefresh + : mode->Clock * 1000.0 / mode->VTotal / mode->HTotal; xf86DrvMsg(scrnIndex, X_INFO, "Mode: %dx%d %d-bpp, %fHz\n", mode->HDisplay, - mode->VDisplay, pScrn->bitsPerPixel, mode->VRefresh); + mode->VDisplay, pScrn->bitsPerPixel, refresh); if (pSmi->shadowFB) { @@ -2759,6 +2805,27 @@ SMI_LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indicies, LOCO *colors, LEAVE_PROC("SMI_LoadPalette"); } +static void +SMI_DisableVideo(ScrnInfoPtr pScrn) +{ + SMIPtr pSmi = SMIPTR(pScrn); + CARD8 tmp; + + if (!(tmp = VGAIN8(pSmi, VGA_DAC_MASK))) + return; + pSmi->DACmask = tmp; + VGAOUT8(pSmi, VGA_DAC_MASK, 0); +} + +static void +SMI_EnableVideo(ScrnInfoPtr pScrn) +{ + SMIPtr pSmi = SMIPTR(pScrn); + + VGAOUT8(pSmi, VGA_DAC_MASK, pSmi->DACmask); +} + + void SMI_EnableMmio(ScrnInfoPtr pScrn) { @@ -2774,9 +2841,6 @@ SMI_EnableMmio(ScrnInfoPtr pScrn) */ vgaHWSetStdFuncs(hwp); - /* Disable video output */ - outb(VGA_DAC_MASK, 0x00); - /* Enable linear mode */ outb(VGA_SEQ_INDEX, 0x18); tmp = inb(VGA_SEQ_DATA); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile index 5c53c6289..4764b0fea 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile,v 1.24 2001/04/19 12:40:33 alanh Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/Imakefile,v 1.26 2001/05/16 13:43:17 alanh Exp $ XCOMM XCOMM This is an Imakefile for the SIS driver. XCOMM @@ -32,8 +32,8 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) -I$(SERVERSRC)/Xext \ -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \ -I$(XF86SRC)/xf24_32bpp \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ - -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(XF86SRC)/rac \ + -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c -I$(XF86OSSRC)/vbe \ + -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ -I$(XTOP)/include/extensions \ -I$(SERVERSRC)/render \ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h index da25bfba9..d0c69da60 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h @@ -25,7 +25,7 @@ * Mitani Hiroshi <hmitani@drl.mei.co.jp> * David Thomas <davtom@dream.org.uk>. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h,v 1.20 2001/04/19 12:40:33 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h,v 1.22 2001/05/16 13:43:17 alanh Exp $ */ #ifndef _SIS_H #define _SIS_H_ @@ -144,6 +144,7 @@ typedef struct { Bool DGAactive; int DGAViewportStatus; Bool NoAccel; + Bool NoXvideo; Bool HWCursor; Bool UsePCIRetry; Bool TurboQueue; @@ -229,6 +230,8 @@ typedef struct { XF86VideoAdaptorPtr adaptor; ScreenBlockHandlerProcPtr BlockHandler; + OptionInfoPtr Options; + } SISRec, *SISPtr; #endif diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c index 62a6f0c75..7c7e0315e 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c @@ -25,7 +25,7 @@ * Mitani Hiroshi <hmitani@drl.mei.co.jp> * David Thomas <davtom@dream.org.uk>. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c,v 1.4 2001/04/19 12:40:33 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_cursor.c,v 1.5 2001/05/07 21:59:07 tsi Exp $ */ #include "xf86.h" #include "xf86PciInfo.h" @@ -249,53 +249,6 @@ SiS300UseHWCursor(ScreenPtr pScreen, CursorPtr pCurs) return TRUE; } -#ifdef IMP_REALIZE_CURSOR -static unsigned char * -SiSRealizeCursor(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) -{ - unsigned char *mem; - int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2; - int w, h; - int i, j; - unsigned char *srcM, *srcS, *dst, s, m; - - if (!(mem=xcalloc(1,size))) - return NULL; - dst = mem; - - srcS = pCurs->bits->source; - srcM = pCurs->bits->mask; - h = pCurs->bits->height; - if (h > infoPtr->MaxHeight) - h = infoPtr->MaxHeight; - w = (pCurs->bits->width + 31)/32*4; - for (i=0; i<infoPtr->MaxHeight; i++, dst+=16) { - for (j=0; j<infoPtr->MaxWidth/8; j++) { - if (i<h && j<w) { - s = *srcS++; - m = *srcM++; - s = s&m; - m = ~m; - dst[j*2] = ((m&0x01) << 7) | ((s&0x01) << 6) | - ((m&0x02) << 4) | ((s&0x02) << 3) | - ((m&0x04) << 1) | (s&0x04) | - ((m&0x08) >> 2) | ((s&0x08) >> 3) ; - dst[j*2+1] = ((m&0x10) << 3) | ((s&0x10)<<2) | - (m&0x20) | ((s&0x20) >> 1) | - ((m&0x40) >> 3) | ((s&0x40) >> 4) | - ((m&0x80) >> 6) | ((s&0x80) >> 7) ; - } - else { - dst[j*2] = 0xAA; - dst[j*2+1] = 0xAA; - } - } - } - - return mem; -} -#endif - Bool SiSHWCursorInit(ScreenPtr pScreen) { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c index 3dcdfb7c5..9b727c2a5 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c,v 1.12 2001/04/19 12:40:33 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c,v 1.15.2.1 2001/05/22 21:25:44 dawes Exp $ */ /* modified from tdfx_dri.c, mga_dri.c */ @@ -54,8 +54,6 @@ static void SISDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index); static void SISDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg, RegionPtr prgnSrc, CARD32 index); -void SISLostContext(ScreenPtr pScreen); - static Bool SISInitVisualConfigs(ScreenPtr pScreen) { @@ -80,17 +78,17 @@ SISInitVisualConfigs(ScreenPtr pScreen) case 32: numConfigs = (useZ16)?8:16; - if (!(pConfigs = (__GLXvisualConfig*)xnfcalloc(sizeof(__GLXvisualConfig), - numConfigs))) { + if (!(pConfigs = (__GLXvisualConfig*)xcalloc(sizeof(__GLXvisualConfig), + numConfigs))) { return FALSE; } - if (!(pSISConfigs = (SISConfigPrivPtr)xnfcalloc(sizeof(SISConfigPrivRec), - numConfigs))) { + if (!(pSISConfigs = (SISConfigPrivPtr)xcalloc(sizeof(SISConfigPrivRec), + numConfigs))) { xfree(pConfigs); return FALSE; } - if (!(pSISConfigPtrs = (SISConfigPrivPtr*)xnfcalloc(sizeof(SISConfigPrivPtr), - numConfigs))) { + if (!(pSISConfigPtrs = (SISConfigPrivPtr*)xcalloc(sizeof(SISConfigPrivPtr), + numConfigs))) { xfree(pConfigs); xfree(pSISConfigs); return FALSE; @@ -162,7 +160,7 @@ SISInitVisualConfigs(ScreenPtr pScreen) } if (i != numConfigs) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "[drm] Incorrect initialization of visuals\n"); + "[dri] Incorrect initialization of visuals. Disabling DRI.\n"); return FALSE; } break; @@ -190,7 +188,7 @@ Bool SISDRIScreenInit(ScreenPtr pScreen) if (!xf86LoaderCheckSymbol("drmAvailable")) return FALSE; if (!xf86LoaderCheckSymbol("DRIQueryVersion")) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "SISDRIScreenInit failed (libdri.a too old)\n"); + "[dri] SISDRIScreenInit failed (libdri.a too old)\n"); return FALSE; } @@ -198,9 +196,11 @@ Bool SISDRIScreenInit(ScreenPtr pScreen) { int major, minor, patch; DRIQueryVersion(&major, &minor, &patch); - if (major != 3 || minor != 1 || patch < 0) { + if (major != 4 || minor < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "[drm] SISDRIScreenInit failed (DRI version = %d.%d.%d, expected 3.1.x). Disabling DRI.\n", + "[dri] SISDRIScreenInit failed because of a version mismatch.\n" + "[dri] libDRI version is %d.%d.%d but version 4.0.x is needed.\n" + "[dri] Disabling DRI.\n", major, minor, patch); return FALSE; } @@ -244,13 +244,14 @@ Bool SISDRIScreenInit(ScreenPtr pScreen) * in the SAREA header */ if (sizeof(XF86DRISAREARec)+sizeof(SISSAREAPriv) > SAREA_MAX) { - ErrorF("Data does not fit in SAREA\n"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Data does not fit in SAREA\n"); return FALSE; } pDRIInfo->SAREASize = SAREA_MAX; #endif - if (!(pSISDRI = (SISDRIPtr)xnfcalloc(sizeof(SISDRIRec),1))) { + if (!(pSISDRI = (SISDRIPtr)xcalloc(sizeof(SISDRIRec),1))) { DRIDestroyInfoRec(pSIS->pDRIInfo); pSIS->pDRIInfo=0; return FALSE; @@ -267,6 +268,8 @@ Bool SISDRIScreenInit(ScreenPtr pScreen) pDRIInfo->bufferRequests = DRI_ALL_WINDOWS; if (!DRIScreenInit(pScreen, pDRIInfo, &pSIS->drmSubFD)) { + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] DRIScreenInit failed. Disabling DRI.\n"); xfree(pDRIInfo->devPrivate); pDRIInfo->devPrivate=0; DRIDestroyInfoRec(pSIS->pDRIInfo); @@ -275,6 +278,28 @@ Bool SISDRIScreenInit(ScreenPtr pScreen) return FALSE; } +#if 000 + /* XXX Check DRM kernel version here */ + version = drmGetVersion(info->drmFD); + if (version) { + if (version->version_major != 1 || + version->version_minor < 0) { + /* incompatible drm version */ + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] SISDRIScreenInit failed because of a version mismatch.\n" + "[dri] sis.o kernel module version is %d.%d.%d but version 1.0.x is needed.\n" + "[dri] Disabling the DRI.\n", + version->version_major, + version->version_minor, + version->version_patchlevel); + drmFreeVersion(version); + R128DRICloseScreen(pScreen); + return FALSE; + } + drmFreeVersion(version); + } +#endif + pSISDRI->regs.size = SISIOMAPSIZE; pSISDRI->regs.map = 0; if (drmAddMap(pSIS->drmSubFD, (drmHandle)pSIS->IOAddress, @@ -304,7 +329,7 @@ Bool SISDRIScreenInit(ScreenPtr pScreen) xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAgpEnable failed\n"); break; } - ErrorF("[drm] drmAgpEnabled succeeded\n"); + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] drmAgpEnabled succeeded\n"); if (drmAgpAlloc(pSIS->drmSubFD, AGP_SIZE, 0, NULL, &pSIS->agpHandle) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, @@ -373,7 +398,7 @@ Bool SISDRIScreenInit(ScreenPtr pScreen) SISDRICloseScreen(pScreen); return FALSE; } - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "visual configs initialized\n" ); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized.\n" ); return TRUE; } @@ -398,9 +423,9 @@ SISDRICloseScreen(ScreenPtr pScreen) if (pSIS->pVisualConfigsPriv) xfree(pSIS->pVisualConfigsPriv); if(pSIS->agpSize){ - ErrorF("Freeing agp memory\n"); + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Freeing agp memory\n"); drmAgpFree(pSIS->drmSubFD, pSIS->agpHandle); - ErrorF("releasing agp module\n"); + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Releasing agp module\n"); drmAgpRelease(pSIS->drmSubFD); } } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h index 5aa2edb66..55714d0d5 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h,v 1.5 2001/04/20 02:53:59 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h,v 1.6 2001/05/16 13:43:17 alanh Exp $ */ /* modified from tdfx_dri.h */ @@ -66,5 +66,4 @@ void SISDRICloseScreen(ScreenPtr pScreen); Bool SISDRIFinishScreenInit(ScreenPtr pScreen); #endif - #endif diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c index 4c07baa7d..56accb362 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c @@ -25,7 +25,7 @@ * Mitani Hiroshi <hmitani@drl.mei.co.jp> * David Thomas <davtom@dream.org.uk>. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c,v 1.61 2001/04/19 14:05:55 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c,v 1.64.2.1 2001/05/22 21:25:44 dawes Exp $ */ #include "fb.h" #include "xf1bpp.h" @@ -43,10 +43,10 @@ #include "vgaHW.h" #include "xf86RAC.h" #include "shadowfb.h" +#include "vbe.h" #include "sis_shadow.h" - #include "mipointer.h" #include "mibstore.h" @@ -101,7 +101,7 @@ static void SISModifyModeInfo(DisplayModePtr mode); static void SiSPreSetMode(ScrnInfoPtr pScrn); void SiSOptions(ScrnInfoPtr pScrn); -OptionInfoPtr SISAvailableOptions(int chipid, int busid); +const OptionInfoRec * SISAvailableOptions(int chipid, int busid); void SiSSetup(ScrnInfoPtr pScrn); void SISVGAPreInit(ScrnInfoPtr pScrn); Bool SiSAccelInit(ScreenPtr pScreen); @@ -176,7 +176,6 @@ static PciChipsets SISPciChipsets[] = { }; - int sisReg32MMIO[]={0x8280,0x8284,0x8288,0x828C,0x8290,0x8294,0x8298,0x829C, 0x82A0,0x82A4,0x82A8,0x82AC}; /* Engine Register for the 2nd Generation Graphics Engine */ @@ -559,8 +558,18 @@ SISPreInit(ScrnInfoPtr pScrn, int flags) const char *Sym = NULL; int pix24flags; - if (flags & PROBE_DETECT) - return FALSE; + vbeInfoPtr pVbe; + + if (flags & PROBE_DETECT) { + if (xf86LoadSubModule(pScrn, "vbe")) { + int index = xf86GetEntityInfo(pScrn->entityList[0])->index; + if ((pVbe = VBEInit(NULL,index))) { + ConfiguredMonitor = vbeDoEDID(pVbe, NULL); + vbeFree(pVbe); + } + } + return TRUE; + } /* * Note: This function is only called once at server startup, and @@ -1039,10 +1048,21 @@ SISPreInit(ScrnInfoPtr pScrn, int flags) } xf86LoaderReqSymLists(ddcSymbols, NULL); + { + Bool ret; + if (xf86LoadSubModule(pScrn, "vbe")) { + if ((pVbe = VBEInit(NULL,pSiS->pEnt->index))) { + ret = xf86SetDDCproperties(pScrn, + xf86PrintEDID(vbeDoEDID(pVbe,NULL))); + vbeFree(pVbe); + } + } + } + #if 0 - /* Initialize DDC1 if possible */ - if (pSiS->ddc1Read) - xf86PrintEDID(xf86DoEDID_DDC1(pScrn->scrnIndex,vgaHWddc1SetSpeed,pSiS->ddc1Read)); + if (!ret && pSiS->ddc1Read) + xf86SetDDCProperties(xf86PrintEDID(xf86DoEDID_DDC1( + pScrn->scrnIndex,vgaHWddc1SetSpeed,pSiS->ddc1Read ))); #endif return TRUE; @@ -1352,10 +1372,6 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) #ifdef XF86DRI pSiS->directRenderingEnabled = SISDRIScreenInit(pScreen); /* Force the initialization of the context */ -#if 0 - SISLostContext(pScreen); -#endif - #endif /* @@ -1475,14 +1491,22 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86DPMSInit(pScreen, (DPMSSetProcPtr)SISDisplayPowerManagementSet, 0); #ifdef XvExtension - { - XF86VideoAdaptorPtr *ptr; - int n; - - n = xf86XVListGenericAdaptors(pScrn, &ptr); - if (n) { - xf86XVScreenInit(pScreen, ptr, n); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "use generic Xv\n" ); + if (!pSiS->NoXvideo) { + /* HW Xv for SiS630 */ + if (pSiS->Chipset == PCI_CHIP_SIS630) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using SiS630 HW Xv\n" ); + SISInitVideo(pScreen); + } + else { /* generic Xv */ + + XF86VideoAdaptorPtr *ptr; + int n; + + n = xf86XVListGenericAdaptors(pScrn, &ptr); + if (n) { + xf86XVScreenInit(pScreen, ptr, n); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using generic Xv\n" ); + } } } #endif @@ -1503,10 +1527,6 @@ SISScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } #endif - if (pSiS->Chipset == PCI_CHIP_SIS630) { - SISInitVideo(pScreen); - } - pSiS->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = SISCloseScreen; pScreen->SaveScreen = SISSaveScreen; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c index a295614c2..b72e1ed91 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c,v 1.5 2001/04/19 12:40:33 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_opt.c,v 1.7 2001/05/16 13:43:17 alanh Exp $ */ #include "xf86.h" #include "xf86PciInfo.h" @@ -16,10 +16,11 @@ typedef enum { OPTION_SET_MEMCLOCK, OPTION_FORCE_CRT2TYPE, OPTION_SHADOW_FB, - OPTION_ROTATE + OPTION_ROTATE, + OPTION_NOXVIDEO } SISOpts; -static OptionInfoRec SISOptions[] = { +static const OptionInfoRec SISOptions[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE }, @@ -31,11 +32,12 @@ static OptionInfoRec SISOptions[] = { { OPTION_FORCE_CRT2TYPE, "ForceCRT2Type",OPTV_ANYSTR, {0}, FALSE }, { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE }, + { OPTION_NOXVIDEO, "NoXvideo", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; void SiSOptions(ScrnInfoPtr pScrn); -OptionInfoPtr SISAvailableOptions(int chipid, int busid); +const OptionInfoRec * SISAvailableOptions(int chipid, int busid); void SiSOptions(ScrnInfoPtr pScrn) @@ -49,7 +51,10 @@ SiSOptions(ScrnInfoPtr pScrn) xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, SISOptions); + if (!(pSiS->Options = xalloc(sizeof(SISOptions)))) + return; + memcpy(pSiS->Options, SISOptions, sizeof(SISOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pSiS->Options); /* initalize some defaults */ pSiS->FastVram = TRUE; @@ -58,6 +63,7 @@ SiSOptions(ScrnInfoPtr pScrn) pSiS->HWCursor = TRUE; pSiS->Rotate = FALSE; pSiS->ShadowFB = FALSE; + pSiS->NoXvideo = FALSE; switch(pSiS->Chipset) { case PCI_CHIP_SIS530: pSiS->TurboQueue = FALSE; /* FIXME ? */ @@ -68,7 +74,7 @@ SiSOptions(ScrnInfoPtr pScrn) #if 0 /* we only work with a depth greater or equal to 8 */ if (pScrn->depth <= 8) { - if (xf86GetOptValInteger(SISOptions, OPTION_RGB_BITS, + if (xf86GetOptValInteger(pSiS->Options, OPTION_RGB_BITS, &pScrn->rgbBits)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, @@ -79,10 +85,10 @@ SiSOptions(ScrnInfoPtr pScrn) /* sw/hw cursor */ from = X_DEFAULT; - if (xf86GetOptValBool(SISOptions, OPTION_HW_CURSOR, &pSiS->HWCursor)) { + if (xf86GetOptValBool(pSiS->Options, OPTION_HW_CURSOR, &pSiS->HWCursor)) { from = X_CONFIG; } - if (xf86ReturnOptValBool(SISOptions, OPTION_SW_CURSOR, FALSE)) { + if (xf86ReturnOptValBool(pSiS->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pSiS->HWCursor = FALSE; } @@ -90,21 +96,21 @@ SiSOptions(ScrnInfoPtr pScrn) pSiS->HWCursor ? "HW" : "SW"); /* Accel */ - if (xf86ReturnOptValBool(SISOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pSiS->Options, OPTION_NOACCEL, FALSE)) { pSiS->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } /* PCI retry */ from = X_DEFAULT; - if (xf86GetOptValBool(SISOptions, OPTION_PCI_RETRY, &pSiS->UsePCIRetry)) { + if (xf86GetOptValBool(pSiS->Options, OPTION_PCI_RETRY, &pSiS->UsePCIRetry)) { from = X_CONFIG; } xf86DrvMsg(pScrn->scrnIndex, from, "PCI retry %s\n", pSiS->UsePCIRetry ? "enabled" : "disabled"); /* Mem clock */ - if (xf86GetOptValFreq(SISOptions, OPTION_SET_MEMCLOCK, OPTUNITS_MHZ, + if (xf86GetOptValFreq(pSiS->Options, OPTION_SET_MEMCLOCK, OPTUNITS_MHZ, &temp)) { pSiS->MemClock = (int)(temp * 1000.0); xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, @@ -113,7 +119,7 @@ SiSOptions(ScrnInfoPtr pScrn) /* fast VRAM */ from = X_DEFAULT; - if (xf86GetOptValBool(SISOptions, OPTION_FAST_VRAM, &pSiS->FastVram)) { + if (xf86GetOptValBool(pSiS->Options, OPTION_FAST_VRAM, &pSiS->FastVram)) { from = X_CONFIG; } xf86DrvMsg(pScrn->scrnIndex, from, "Fast VRAM %s\n", @@ -121,7 +127,7 @@ SiSOptions(ScrnInfoPtr pScrn) /* Turbo QUEUE */ from = X_DEFAULT; - if (xf86GetOptValBool(SISOptions, OPTION_TURBOQUEUE, &pSiS->TurboQueue)) { + if (xf86GetOptValBool(pSiS->Options, OPTION_TURBOQUEUE, &pSiS->TurboQueue)) { from = X_CONFIG; } xf86DrvMsg(pScrn->scrnIndex, from, "TurboQueue %s\n", @@ -129,7 +135,7 @@ SiSOptions(ScrnInfoPtr pScrn) /* CRT2 type */ pSiS->ForceCRT2Type = CRT2_DEFAULT; - strptr = (char *)xf86GetOptValString(SISOptions, OPTION_FORCE_CRT2TYPE); + strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_FORCE_CRT2TYPE); if (strptr != NULL) { if (!xf86strcmp(strptr,"TV")) @@ -146,7 +152,7 @@ SiSOptions(ScrnInfoPtr pScrn) /* ShadowFB */ from = X_DEFAULT; - if (xf86GetOptValBool(SISOptions, OPTION_SHADOW_FB, &pSiS->ShadowFB)) { + if (xf86GetOptValBool(pSiS->Options, OPTION_SHADOW_FB, &pSiS->ShadowFB)) { from = X_CONFIG; } if (pSiS->ShadowFB) { @@ -156,7 +162,7 @@ SiSOptions(ScrnInfoPtr pScrn) } /* Rotate */ - if ((strptr = (char *)xf86GetOptValString(SISOptions, OPTION_ROTATE))) { + if ((strptr = (char *)xf86GetOptValString(pSiS->Options, OPTION_ROTATE))) { if(!xf86NameCmp(strptr, "CW")) { pSiS->ShadowFB = TRUE; pSiS->NoAccel = TRUE; @@ -179,9 +185,16 @@ SiSOptions(ScrnInfoPtr pScrn) "Valid options are \"CW\" or \"CCW\"\n"); } } + + /* NOXvideo */ + if (xf86ReturnOptValBool(pSiS->Options, OPTION_NOXVIDEO, FALSE)) { + pSiS->NoXvideo = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "XVideo Extension Disabled\n"); + } + } -OptionInfoPtr +const OptionInfoRec * SISAvailableOptions(int chipid, int busid) { return SISOptions; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c index 00a3ba469..13b086cc3 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c @@ -24,7 +24,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/sis/sis_video.c,v 1.2 2001/04/19 12:40:33 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_video.c,v 1.3 2001/05/16 13:43:17 alanh Exp $ */ /* * sis_video.c: SIS Xv driver. Based on the mga Xv driver by Mark Vojkovich @@ -212,9 +212,8 @@ void SISInitVideo(ScreenPtr pScreen) XF86VideoAdaptorPtr newAdaptor = NULL; int num_adaptors; - if (pScrn->bitsPerPixel != 8) - { - newAdaptor = SISSetupImageVideo(pScreen); + if (pScrn->bitsPerPixel != 8) { + newAdaptor = SISSetupImageVideo(pScreen); } num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); @@ -224,8 +223,8 @@ void SISInitVideo(ScreenPtr pScreen) num_adaptors = 1; adaptors = &newAdaptor; } else { - newAdaptors = /* need to free this someplace */ - xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*)); + /* need to free this someplace */ + newAdaptors = xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*)); if(newAdaptors) { memcpy(newAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr)); @@ -337,7 +336,7 @@ typedef struct { CARD8 contrastCtrl; CARD8 contrastFactor; - CARD8 lineBufSize; + CARD8 lineBufSize; CARD8 (*VBlankActiveFunc)(SISPtr); CARD32 (*GetScanLineFunc)(SISPtr pSIS); @@ -814,7 +813,7 @@ set_colorkey(SISPtr pSIS, CARD32 colorkey) g = (CARD8)((colorkey>>8) & 0xFF); r = (CARD8)((colorkey>>16) & 0xFF); - /* Activate the colorkey mode */ + /* Activate the colorkey mode */ setvideoreg(pSIS, Index_VI_Overlay_ColorKey_Blue_Min ,(CARD8)b); setvideoreg(pSIS, Index_VI_Overlay_ColorKey_Green_Min ,(CARD8)g); setvideoreg(pSIS, Index_VI_Overlay_ColorKey_Red_Min ,(CARD8)r); @@ -1134,7 +1133,7 @@ SISPutImage( /* TODO: use xf86AllocateOffscreenLinear is better */ if(pPriv->fbAreaPtr) { /* TODO: resize */ - xf86FreeOffscreenArea(pPriv->fbAreaPtr); + xf86FreeOffscreenArea(pPriv->fbAreaPtr); } depth = (pScrn->bitsPerPixel + 7 ) / 8; pitch = pScrn->displayWidth * depth; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c index 0313a249e..00b0072aa 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.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/drivers/sunbw2/bw2_driver.c,v 1.2 2000/12/02 15:30:52 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunbw2/bw2_driver.c,v 1.3 2001/05/04 19:05:45 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -34,7 +34,7 @@ #include "xf86cmap.h" #include "bw2.h" -static OptionInfoPtr BW2AvailableOptions(int chipid, int busid); +static const OptionInfoRec * BW2AvailableOptions(int chipid, int busid); static void BW2Identify(int flags); static Bool BW2Probe(DriverPtr drv, int flags); static Bool BW2PreInit(ScrnInfoPtr pScrn, int flags); @@ -82,7 +82,7 @@ DriverRec SUNBW2 = { 0 }; -static OptionInfoRec BW2Options[] = { +static const OptionInfoRec BW2Options[] = { { -1, NULL, OPTV_NONE, {0}, FALSE } }; @@ -164,8 +164,7 @@ BW2FreeRec(ScrnInfoPtr pScrn) return; } -static -OptionInfoPtr +static const OptionInfoRec * BW2AvailableOptions(int chipid, int busid) { return BW2Options; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile index 20ee055c5..b823d5c8e 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile @@ -1,7 +1,7 @@ XCOMM XCOMM This is an Imakefile for the cg14 driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile,v 1.2 2001/01/24 00:06:28 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/Imakefile,v 1.3 2001/05/16 06:48:10 keithp Exp $ #define IHaveModules #include <Server.tmpl> @@ -13,8 +13,8 @@ OBJS = cg14_driver.o INCLUDES = -I. -I../../include #else INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/Xext -I$(SERVERSRC)/cfb \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ -I$(XF86SRC)/ramdac \ -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ -I$(EXTINCSRC) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h index 8d96e3d20..d4a603420 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h @@ -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/drivers/suncg14/cg14.h,v 1.2 2001/03/03 22:41:33 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h,v 1.3 2001/05/04 19:05:45 dawes Exp $ */ #ifndef CG14_H #define CG14_H @@ -60,6 +60,7 @@ typedef struct { int height; sbusDevicePtr psdp; CloseScreenProcPtr CloseScreen; + OptionInfoPtr Options; } Cg14Rec, *Cg14Ptr; #define GET_CG14_FROM_SCRN(p) ((Cg14Ptr)((p)->driverPrivate)) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c index 6a2468164..565e3973f 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c @@ -20,9 +20,8 @@ * 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/drivers/suncg14/cg14_driver.c,v 1.2 2000/12/02 15:30:53 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14_driver.c,v 1.4 2001/05/16 06:48:10 keithp Exp $ */ -#define PSZ 8 #include "xf86.h" #include "xf86_OSproc.h" #include "xf86_ansic.h" @@ -31,13 +30,11 @@ #include "mibstore.h" #include "micmap.h" -#include "cfb.h" -#undef PSZ -#include "cfb32.h" +#include "fb.h" #include "xf86cmap.h" #include "cg14.h" -static OptionInfoPtr CG14AvailableOptions(int chipid, int busid); +static const OptionInfoRec * CG14AvailableOptions(int chipid, int busid); static void CG14Identify(int flags); static Bool CG14Probe(DriverPtr drv, int flags); static Bool CG14PreInit(ScrnInfoPtr pScrn, int flags); @@ -87,7 +84,7 @@ DriverRec SUNCG14 = { 0 }; -static OptionInfoRec CG14Options[] = { +static const OptionInfoRec CG14Options[] = { { -1, NULL, OPTV_NONE, {0}, FALSE } }; @@ -169,8 +166,7 @@ CG14FreeRec(ScrnInfoPtr pScrn) return; } -static -OptionInfoPtr +static const OptionInfoRec * CG14AvailableOptions(int chipid, int busid) { return CG14Options; @@ -346,7 +342,10 @@ CG14PreInit(ScrnInfoPtr pScrn, int flags) /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, CG14Options); + if (!(pCg14->Options = xalloc(sizeof(CG14Options)))) + return FALSE; + memcpy(pCg14->Options, CG14Options, sizeof(CG14Options)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pCg14->Options); /* * This must happen after pScrn->display has been set because @@ -385,7 +384,7 @@ CG14PreInit(ScrnInfoPtr pScrn, int flags) } } - if (xf86LoadSubModule(pScrn, "cfb32") == NULL) { + if (xf86LoadSubModule(pScrn, "fb") == NULL) { CG14FreeRec(pScrn); return FALSE; } @@ -465,19 +464,25 @@ CG14ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; + miSetPixmapDepths (); + /* * Call the framebuffer layer's ScreenInit function, and fill in other * pScreen fields. */ CG14InitCplane24(pScrn); - ret = cfb32ScreenInit(pScreen, pCg14->fb, pScrn->virtualX, - pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, - pScrn->virtualX); + ret = fbScreenInit(pScreen, pCg14->fb, pScrn->virtualX, + pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, + pScrn->virtualX, pScrn->bitsPerPixel); if (!ret) return FALSE; +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif + miInitializeBackingStore(pScreen); xf86SetBackingStore(pScreen); xf86SetSilkenMouse(pScreen); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile index 83df17d4c..01798e3cf 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile @@ -1,7 +1,7 @@ XCOMM XCOMM This is an Imakefile for the cg3 driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile,v 1.2 2001/01/24 00:06:29 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/Imakefile,v 1.3 2001/05/16 06:48:10 keithp Exp $ #define IHaveModules #include <Server.tmpl> @@ -13,8 +13,8 @@ OBJS = cg3_driver.o INCLUDES = -I. -I../../include #else INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/Xext -I$(SERVERSRC)/cfb \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ -I$(XF86SRC)/ramdac \ -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ -I$(EXTINCSRC) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c index a5acd802d..12e14e6ca 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.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/drivers/suncg3/cg3_driver.c,v 1.2 2000/12/02 15:30:54 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg3/cg3_driver.c,v 1.4 2001/05/16 06:48:10 keithp Exp $ */ #define PSZ 8 #include "xf86.h" @@ -31,11 +31,11 @@ #include "mibstore.h" #include "micmap.h" -#include "cfb.h" +#include "fb.h" #include "xf86cmap.h" #include "cg3.h" -static OptionInfoPtr CG3AvailableOptions(int chipid, int busid); +static const OptionInfoRec * CG3AvailableOptions(int chipid, int busid); static void CG3Identify(int flags); static Bool CG3Probe(DriverPtr drv, int flags); static Bool CG3PreInit(ScrnInfoPtr pScrn, int flags); @@ -83,7 +83,7 @@ DriverRec SUNCG3 = { 0 }; -static OptionInfoRec CG3Options[] = { +static const OptionInfoRec CG3Options[] = { { -1, NULL, OPTV_NONE, {0}, FALSE } }; @@ -165,8 +165,7 @@ CG3FreeRec(ScrnInfoPtr pScrn) return; } -static -OptionInfoPtr +static const OptionInfoRec * CG3AvailableOptions(int chipid, int busid) { return CG3Options; @@ -356,7 +355,7 @@ CG3PreInit(ScrnInfoPtr pScrn, int flags) /* Set the bits per RGB for 8bpp mode */ from = X_DEFAULT; - if (xf86LoadSubModule(pScrn, "cfb") == NULL) { + if (xf86LoadSubModule(pScrn, "fb") == NULL) { CG3FreeRec(pScrn); return FALSE; } @@ -436,17 +435,23 @@ CG3ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; + miSetPixmapDepths (); + /* * Call the framebuffer layer's ScreenInit function, and fill in other * pScreen fields. */ - ret = cfbScreenInit(pScreen, pCg3->fb, pScrn->virtualX, - pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, - pScrn->virtualX); + ret = fbScreenInit(pScreen, pCg3->fb, pScrn->virtualX, + pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, + pScrn->virtualX, 8); if (!ret) return FALSE; +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif + miInitializeBackingStore(pScreen); xf86SetBackingStore(pScreen); xf86SetSilkenMouse(pScreen); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile index a0398181a..0c9a71385 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile @@ -1,7 +1,7 @@ XCOMM XCOMM This is an Imakefile for the cg6 driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile,v 1.3 2001/01/24 00:06:29 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/Imakefile,v 1.4 2001/05/16 06:48:11 keithp Exp $ #define IHaveModules #include <Server.tmpl> @@ -13,8 +13,8 @@ OBJS = cg6_driver.o cg6_cursor.o INCLUDES = -I. -I../../include #else INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/Xext -I$(SERVERSRC)/cfb \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ -I$(XF86SRC)/ramdac \ -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ -I$(EXTINCSRC) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h index 5945b201f..00ed5b79f 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h @@ -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/drivers/suncg6/cg6.h,v 1.2 2000/06/30 17:15:15 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6.h,v 1.3 2001/05/04 19:05:45 dawes Exp $ */ #ifndef CG6_H #define CG6_H @@ -72,6 +72,7 @@ typedef struct { unsigned int CursorXY; int CursorBg, CursorFg; Bool CursorEnabled; + OptionInfoPtr Options; } Cg6Rec, *Cg6Ptr; extern int Cg6ScreenPrivateIndex; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c index 228567d3b..74284bbc3 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c @@ -20,9 +20,8 @@ * 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/drivers/suncg6/cg6_driver.c,v 1.4 2000/12/02 15:30:54 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg6/cg6_driver.c,v 1.6 2001/05/16 06:48:11 keithp Exp $ */ -#define PSZ 8 #include "xf86.h" #include "xf86_OSproc.h" #include "xf86_ansic.h" @@ -31,11 +30,11 @@ #include "mibstore.h" #include "micmap.h" -#include "cfb.h" +#include "fb.h" #include "xf86cmap.h" #include "cg6.h" -static OptionInfoPtr CG6AvailableOptions(int chipid, int busid); +static const OptionInfoRec * CG6AvailableOptions(int chipid, int busid); static void CG6Identify(int flags); static Bool CG6Probe(DriverPtr drv, int flags); static Bool CG6PreInit(ScrnInfoPtr pScrn, int flags); @@ -89,7 +88,7 @@ typedef enum { OPTION_NOACCEL } CG6Opts; -static OptionInfoRec CG6Options[] = { +static const OptionInfoRec CG6Options[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, @@ -174,8 +173,7 @@ CG6FreeRec(ScrnInfoPtr pScrn) return; } -static -OptionInfoPtr +static const OptionInfoRec * CG6AvailableOptions(int chipid, int busid) { return CG6Options; @@ -350,7 +348,10 @@ CG6PreInit(ScrnInfoPtr pScrn, int flags) /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, CG6Options); + if (!(pCg6->Options = xalloc(sizeof(CG6Options)))) + return FALSE; + memcpy(pCg6->Options, CG6Options, sizeof(CG6Options)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pCg6->Options); if (!xf86SetDefaultVisual(pScrn, -1)) return FALSE; @@ -373,9 +374,9 @@ CG6PreInit(ScrnInfoPtr pScrn, int flags) /* determine whether we use hardware or software cursor */ pCg6->HWCursor = TRUE; - if (xf86GetOptValBool(CG6Options, OPTION_HW_CURSOR, &pCg6->HWCursor)) + if (xf86GetOptValBool(pCg6->Options, OPTION_HW_CURSOR, &pCg6->HWCursor)) from = X_CONFIG; - if (xf86ReturnOptValBool(CG6Options, OPTION_SW_CURSOR, FALSE)) { + if (xf86ReturnOptValBool(pCg6->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pCg6->HWCursor = FALSE; } @@ -383,12 +384,12 @@ CG6PreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pCg6->HWCursor ? "HW" : "SW"); - if (xf86ReturnOptValBool(CG6Options, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pCg6->Options, OPTION_NOACCEL, FALSE)) { pCg6->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } - if (xf86LoadSubModule(pScrn, "cfb") == NULL) { + if (xf86LoadSubModule(pScrn, "fb") == NULL) { CG6FreeRec(pScrn); return FALSE; } @@ -477,17 +478,23 @@ CG6ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; + miSetPixmapDepths (); + /* * Call the framebuffer layer's ScreenInit function, and fill in other * pScreen fields. */ - ret = cfbScreenInit(pScreen, pCg6->fb, pScrn->virtualX, - pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, - pScrn->virtualX); + ret = fbScreenInit(pScreen, pCg6->fb, pScrn->virtualX, + pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, + pScrn->virtualX, 8); if (!ret) return FALSE; +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif + miInitializeBackingStore(pScreen); xf86SetBackingStore(pScreen); xf86SetSilkenMouse(pScreen); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h index 5848ecb6e..13838959b 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h @@ -24,7 +24,7 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h,v 1.6 2001/03/03 22:41:34 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb.h,v 1.7 2001/05/04 19:05:46 dawes Exp $ */ #ifndef FFB_H #define FFB_H @@ -212,6 +212,8 @@ typedef struct { Bool dri_enabled; ffb_dri_state_t *pFfbSarea; #endif + + OptionInfoPtr Options; } FFBRec, *FFBPtr; /* Acceleration */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c index 8cceed85a..334bdfdbe 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c,v 1.8 2001/04/18 14:52:42 dawes Exp $ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_dri.c,v 1.9 2001/05/02 15:06:10 dawes Exp $ * Acceleration for the Creator and Creator3D framebuffer - DRI/DRM support. * * Copyright (C) 2000 David S. Miller (davem@redhat.com) @@ -221,8 +221,9 @@ FFBDRIScreenInit(ScreenPtr pScreen) DRIQueryVersion(&major, &minor, &patch); if (major != 4 || minor < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "[drm] FFBDRIScreenInit failed (DRI version = %d.%d.%d, " - "expected 4.0.x). Disabling DRI.\n", + "[dri] FFBDRIScreenInit failed because of a version mismatch.\n" + "[dri] libDRI version is %d.%d.%d but version, 4.0.x is needed.\n" + "[dri] Disabling DRI.\n", major, minor, patch); return FALSE; } @@ -277,11 +278,35 @@ FFBDRIScreenInit(ScreenPtr pScreen) pDRIInfo->createDummyCtxPriv = FALSE; if (!DRIScreenInit(pScreen, pDRIInfo, &(pFfb->drmSubFD))) { + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] DRIScreenInit failed. Disabling DRI.\n"); DRIDestroyInfoRec(pFfb->pDRIInfo); xfree(pFfbDRI); return FALSE; } +#if 000 /* XXX this should be cleaned up and used */ + /* Check the ffb DRM version */ + version = drmGetVersion(info->drmFD); + if (version) { + if (version->version_major != 1 || + version->version_minor < 0) { + /* incompatible drm version */ + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] FFBDRIScreenInit failed because of a version mismatch.\n" + "[dri] ffb.o kernel module version is %d.%d.%d but version 1.0.x is needed.\n" + "[dri] Disabling the DRI.\n", + version->version_major, + version->version_minor, + version->version_patchlevel); + drmFreeVersion(version); + R128DRICloseScreen(pScreen); + return FALSE; + } + drmFreeVersion(version); + } +#endif + pFfb->pFfbSarea = DRIGetSAREAPrivate(pScreen); init_ffb_sarea(pFfb, pFfb->pFfbSarea); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c index 689607ff3..e30e4610e 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.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/drivers/sunffb/ffb_driver.c,v 1.8 2001/04/05 17:42:33 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunffb/ffb_driver.c,v 1.9 2001/05/04 19:05:46 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -40,7 +40,7 @@ #include "ffb.h" -static OptionInfoPtr FFBAvailableOptions(int chipid, int busid); +static const OptionInfoRec * FFBAvailableOptions(int chipid, int busid); static void FFBIdentify(int flags); static Bool FFBProbe(DriverPtr drv, int flags); static Bool FFBPreInit(ScrnInfoPtr pScrn, int flags); @@ -97,7 +97,7 @@ typedef enum { OPTION_NOACCEL } FFBOpts; -static OptionInfoRec FFBOptions[] = { +static const OptionInfoRec FFBOptions[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, @@ -182,8 +182,7 @@ FFBFreeRec(ScrnInfoPtr pScrn) return; } -static -OptionInfoPtr +static const OptionInfoRec * FFBAvailableOptions(int chipid, int busid) { return FFBOptions; @@ -358,7 +357,10 @@ FFBPreInit(ScrnInfoPtr pScrn, int flags) /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, FFBOptions); + if (!(pFfb->Options = xalloc(sizeof(FFBOptions)))) + return FALSE; + memcpy(pFfb->Options, FFBOptions, sizeof(FFBOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pFfb->Options); /* * This must happen after pScrn->display has been set because @@ -394,9 +396,9 @@ FFBPreInit(ScrnInfoPtr pScrn, int flags) /* determine whether we use hardware or software cursor */ pFfb->HWCursor = TRUE; - if (xf86GetOptValBool(FFBOptions, OPTION_HW_CURSOR, &pFfb->HWCursor)) + if (xf86GetOptValBool(pFfb->Options, OPTION_HW_CURSOR, &pFfb->HWCursor)) from = X_CONFIG; - if (xf86ReturnOptValBool(FFBOptions, OPTION_SW_CURSOR, FALSE)) { + if (xf86ReturnOptValBool(pFfb->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pFfb->HWCursor = FALSE; } @@ -404,7 +406,7 @@ FFBPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pFfb->HWCursor ? "HW" : "SW"); - if (xf86ReturnOptValBool(FFBOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pFfb->Options, OPTION_NOACCEL, FALSE)) { pFfb->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile index 6269e0116..2af304ae7 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile @@ -1,7 +1,7 @@ XCOMM XCOMM This is an Imakefile for the leo driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile,v 1.2 2001/01/24 00:06:30 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile,v 1.4 2001/05/18 16:03:13 tsi Exp $ #define IHaveModules #include <Server.tmpl> diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h index 70b4f808c..8df93027a 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h @@ -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/drivers/sunleo/leo.h,v 1.3 2000/12/01 00:24:35 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo.h,v 1.4 2001/05/04 19:05:46 dawes Exp $ */ #ifndef LEO_H #define LEO_H @@ -82,6 +82,7 @@ typedef struct { xf86CursorInfoPtr CursorInfoRec; unsigned char CursorShiftX, CursorShiftY; unsigned char *CursorData; + OptionInfoPtr Options; } LeoRec, *LeoPtr; extern int LeoScreenPrivateIndex; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c index 513b76a92..768461f8f 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c @@ -21,7 +21,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/drivers/sunleo/leo_driver.c,v 1.4 2000/12/02 15:30:56 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c,v 1.7 2001/05/18 16:03:13 tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -37,7 +37,7 @@ #include "xf86cmap.h" #include "leo.h" -static OptionInfoPtr LeoAvailableOptions(int chipid, int busid); +static const OptionInfoRec * LeoAvailableOptions(int chipid, int busid); static void LeoIdentify(int flags); static Bool LeoProbe(DriverPtr drv, int flags); static Bool LeoPreInit(ScrnInfoPtr pScrn, int flags); @@ -91,7 +91,7 @@ typedef enum { OPTION_NOACCEL } LeoOpts; -static OptionInfoRec LeoOptions[] = { +static const OptionInfoRec LeoOptions[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, @@ -176,8 +176,7 @@ LeoFreeRec(ScrnInfoPtr pScrn) return; } -static -OptionInfoPtr +static const OptionInfoRec * LeoAvailableOptions(int chipid, int busid) { return LeoOptions; @@ -352,7 +351,10 @@ LeoPreInit(ScrnInfoPtr pScrn, int flags) /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, LeoOptions); + if (!(pLeo->Options = xalloc(sizeof(LeoOptions)))) + return FALSE; + memcpy(pLeo->Options, LeoOptions, sizeof(LeoOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pLeo->Options); /* * This must happen after pScrn->display has been set because @@ -397,9 +399,9 @@ LeoPreInit(ScrnInfoPtr pScrn, int flags) /* determine whether we use hardware or software cursor */ pLeo->HWCursor = TRUE; - if (xf86GetOptValBool(LeoOptions, OPTION_HW_CURSOR, &pLeo->HWCursor)) + if (xf86GetOptValBool(pLeo->Options, OPTION_HW_CURSOR, &pLeo->HWCursor)) from = X_CONFIG; - if (xf86ReturnOptValBool(LeoOptions, OPTION_SW_CURSOR, FALSE)) { + if (xf86ReturnOptValBool(pLeo->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pLeo->HWCursor = FALSE; } @@ -407,7 +409,7 @@ LeoPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pLeo->HWCursor ? "HW" : "SW"); - if (xf86ReturnOptValBool(LeoOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pLeo->Options, OPTION_NOACCEL, FALSE)) { pLeo->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile index ac64a1128..1fb7df8ad 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile @@ -1,7 +1,7 @@ XCOMM XCOMM This is an Imakefile for the tcx driver. XCOMM -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile,v 1.2 2001/01/24 00:06:31 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/Imakefile,v 1.4 2001/05/16 12:38:10 alanh Exp $ #define IHaveModules #include <Server.tmpl> @@ -13,8 +13,8 @@ OBJS = tcx_driver.o tcx_cursor.o INCLUDES = -I. -I../../include #else INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ - -I$(SERVERSRC)/Xext -I$(SERVERSRC)/cfb \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ -I$(XF86SRC)/ramdac \ -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ -I$(EXTINCSRC) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h index da02617a4..2528a71eb 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h @@ -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/drivers/suntcx/tcx.h,v 1.1 2000/06/30 17:15:16 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx.h,v 1.2 2001/05/04 19:05:46 dawes Exp $ */ #ifndef TCX_H #define TCX_H @@ -60,6 +60,7 @@ typedef struct { Bool CursorEnabled; unsigned char CursorShiftX, CursorShiftY; unsigned char *CursorData; + OptionInfoPtr Options; } TcxRec, *TcxPtr; #define TCX_CPLANE_MODE 0x03000000 diff --git a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c index 14e689239..b2dc24dcf 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c @@ -20,9 +20,8 @@ * 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/drivers/suntcx/tcx_driver.c,v 1.3 2000/12/02 15:30:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suntcx/tcx_driver.c,v 1.5 2001/05/16 06:48:11 keithp Exp $ */ -#define PSZ 8 #include "xf86.h" #include "xf86_OSproc.h" #include "xf86_ansic.h" @@ -31,13 +30,11 @@ #include "mibstore.h" #include "micmap.h" -#include "cfb.h" -#undef PSZ -#include "cfb32.h" +#include "fb.h" #include "xf86cmap.h" #include "tcx.h" -static OptionInfoPtr TCXAvailableOptions(int chipid, int busid); +static const OptionInfoRec * TCXAvailableOptions(int chipid, int busid); static void TCXIdentify(int flags); static Bool TCXProbe(DriverPtr drv, int flags); static Bool TCXPreInit(ScrnInfoPtr pScrn, int flags); @@ -91,7 +88,7 @@ typedef enum { OPTION_HW_CURSOR } TCXOpts; -static OptionInfoRec TCXOptions[] = { +static const OptionInfoRec TCXOptions[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } @@ -175,8 +172,7 @@ TCXFreeRec(ScrnInfoPtr pScrn) return; } -static -OptionInfoPtr +static const OptionInfoRec * TCXAvailableOptions(int chipid, int busid) { return TCXOptions; @@ -374,7 +370,10 @@ TCXPreInit(ScrnInfoPtr pScrn, int flags) /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, TCXOptions); + if (!(pTcx->Options = xalloc(sizeof(TCXOptions)))) + return FALSE; + memcpy(pTcx->Options, TCXOptions, sizeof(TCXOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTcx->Options); /* * This must happen after pScrn->display has been set because @@ -420,9 +419,9 @@ TCXPreInit(ScrnInfoPtr pScrn, int flags) if (hwCursor) { from = X_DEFAULT; pTcx->HWCursor = TRUE; - if (xf86GetOptValBool(TCXOptions, OPTION_HW_CURSOR, &pTcx->HWCursor)) + if (xf86GetOptValBool(pTcx->Options, OPTION_HW_CURSOR, &pTcx->HWCursor)) from = X_CONFIG; - if (xf86ReturnOptValBool(TCXOptions, OPTION_SW_CURSOR, FALSE)) { + if (xf86ReturnOptValBool(pTcx->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pTcx->HWCursor = FALSE; } @@ -431,8 +430,7 @@ TCXPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pTcx->HWCursor ? "HW" : "SW"); - if (xf86LoadSubModule(pScrn, pScrn->depth > 8 ? "cfb32" : "cfb") == - NULL) { + if (xf86LoadSubModule(pScrn, "fb") == NULL) { TCXFreeRec(pScrn); return FALSE; } @@ -537,25 +535,26 @@ TCXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; + miSetPixmapDepths (); + /* * Call the framebuffer layer's ScreenInit function, and fill in other * pScreen fields. */ - if (pScrn->depth == 8) - ret = cfbScreenInit(pScreen, pTcx->fb, pScrn->virtualX, - pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, - pScrn->virtualX); - else { + if (pScrn->bitsPerPixel != 8) TCXInitCplane24(pScrn); - ret = cfb32ScreenInit(pScreen, pTcx->fb, pScrn->virtualX, - pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, - pScrn->virtualX); - } + ret = fbScreenInit(pScreen, pTcx->fb, pScrn->virtualX, + pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, + pScrn->virtualX, pScrn->bitsPerPixel); if (!ret) return FALSE; +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif + miInitializeBackingStore(pScreen); xf86SetBackingStore(pScreen); xf86SetSilkenMouse(pScreen); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile index 24087804c..33435486c 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.20 2001/01/24 00:06:31 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/Imakefile,v 1.20.2.1 2001/05/22 21:25:45 dawes Exp $ XCOMM XCOMM This is the Imakefile for the TDFX driver. XCOMM @@ -17,11 +17,16 @@ DRIINCLUDES = -I$(SERVERSRC)/GL/dri -I$(LIBSRC)/GL/dri -I$(TOP)/include DRIDEFINES = $(GLX_DEFINES) #endif +#if BuildXvExt +XVSRCS = tdfx_video.c +XVOBJS = tdfx_video.o +#endif + SRCS = tdfx_driver.c tdfx_io.c tdfx_hwcurs.c tdfx_accel.c \ - tdfx_dga.c tdfx_priv.c tdfx_sli.c tdfx_video.c $(DRISRCS) + tdfx_dga.c tdfx_priv.c tdfx_sli.c $(XVSRCS) $(DRISRCS) OBJS = tdfx_driver.o tdfx_io.o tdfx_hwcurs.o tdfx_accel.o \ - tdfx_dga.o tdfx_priv.o tdfx_sli.o tdfx_video.o $(DRIOBJS) + tdfx_dga.o tdfx_priv.o tdfx_sli.o $(XVOBJS) $(DRIOBJS) #if defined(XF86DriverSDK) INCLUDES = -I. -I../../include diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h index 098318ce0..6743245d6 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.22 2001/04/19 19:54:50 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx.h,v 1.23.2.1 2001/05/22 21:25:45 dawes Exp $ */ #ifndef _TDFX_H_ #define _TDFX_H_ @@ -213,14 +213,27 @@ typedef struct _TDFXRec { int pixmapCacheLinesMax; FBAreaPtr reservedArea; Bool ShowCache; - FBLinearPtr videoScratch; int videoKey; void (*VideoTimerCallback)(ScrnInfoPtr, Time); - XF86VideoAdaptorPtr adaptor; + FBLinearPtr overlayBuffer; + FBAreaPtr textureBuffer; + Bool TextureXvideo; + XF86VideoAdaptorPtr overlayAdaptor; + XF86VideoAdaptorPtr textureAdaptor; ScreenBlockHandlerProcPtr BlockHandler; + OptionInfoPtr Options; } TDFXRec; typedef struct { + RegionRec clip; + CARD32 colorKey; + int filterQuality; + CARD32 videoStatus; + Time offTime; + Time freeTime; +} TDFXPortPrivRec, *TDFXPortPrivPtr; + +typedef struct { PROPSAREADATA int fifoOwner; int CtxOwner; @@ -278,5 +291,6 @@ extern void TDFXSubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, extern void TDFXSelectBuffer(TDFXPtr pTDFX, int which); extern void TDFXInitVideo(ScreenPtr pScreen); +extern void TDFXCloseVideo(ScreenPtr pScreen); #endif 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 320e86a31..236b1f597 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.21 2001/04/19 19:54:50 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c,v 1.22.2.1 2001/05/22 21:25:45 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -132,7 +132,7 @@ TDFXInitVisualConfigs(ScreenPtr pScreen) } if (i!=numConfigs) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "Incorrect initialization of visuals\n"); + "[dri] TDFXInitVisualConfigs: wrong number of visuals\n"); return FALSE; } break; /* 16bpp */ @@ -227,7 +227,7 @@ TDFXInitVisualConfigs(ScreenPtr pScreen) } if (i!=numConfigs) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "Incorrect initialization of visuals\n"); + "[dri] TDFXInitVisualConfigs: wrong number of visuals\n"); return FALSE; } break; @@ -279,17 +279,16 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen) } if (!bppOk) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "DRI not supported in %d bpp mode, disabling DRI.\n", + "[dri] tdfx DRI not supported in %d bpp mode, disabling DRI.\n", (pScrn->bitsPerPixel)); if (pTDFX->ChipType <= PCI_CHIP_VOODOO3) { xf86DrvMsg(pScreen->myNum, X_INFO, - "To use DRI, invoke the server using 16 bpp " - "(-depth 15 or -depth 16).\n"); + "[dri] To use DRI, invoke the server using 16 bpp\n" + "\t(-depth 15 or -depth 16).\n"); } else { xf86DrvMsg(pScreen->myNum, X_INFO, - "To use DRI, invoke the server using 16 bpp " - "(-depth 15 or -depth 16)\n" - "\tor 32 bpp (-depth 24 -fbbpp 32).\n"); + "[dri] To use DRI, invoke the server using 16 bpp\n" + "\t(-depth 15 or -depth 16) or 32 bpp (-depth 24 -fbbpp 32).\n"); } return FALSE; } @@ -311,7 +310,9 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen) DRIQueryVersion(&major, &minor, &patch); if (major != 4 || minor < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "TDFXDRIScreenInit failed (DRI version = %d.%d.%d, expected 4.0.x). Disabling DRI.\n", + "[dri] TDFXDRIScreenInit failed because of a version mismatch.\n" + "[dri] libDRI version is %d.%d.%d but version 4.0.x is needed.\n" + "[dri] Disabling the DRI.\n", major, minor, patch); return FALSE; } @@ -320,7 +321,7 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen) pDRIInfo = DRICreateInfoRec(); if (!pDRIInfo) { xf86DrvMsg(pScreen->myNum, X_ERROR, - "DRICreateInfoRect() failed, disabling DRI.\n"); + "[dri] DRICreateInfoRect() failed, disabling DRI.\n"); return FALSE; } @@ -370,7 +371,8 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen) #endif if (!(pTDFXDRI = (TDFXDRIPtr)xcalloc(sizeof(TDFXDRIRec),1))) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "DRI memory allocation failed, disabling DRI.\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] DRI memory allocation failed, disabling DRI.\n"); DRIDestroyInfoRec(pTDFX->pDRIInfo); pTDFX->pDRIInfo=0; return FALSE; @@ -398,7 +400,8 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen) pDRIInfo->devPrivate=0; DRIDestroyInfoRec(pTDFX->pDRIInfo); pTDFX->pDRIInfo=0; - xf86DrvMsg(pScreen->myNum, X_ERROR, "DRIScreenInit failed, disabling DRI.\n"); + xf86DrvMsg(pScreen->myNum, X_ERROR, + "[dri] DRIScreenInit failed, disabling DRI.\n"); return FALSE; } @@ -411,7 +414,9 @@ Bool TDFXDRIScreenInit(ScreenPtr pScreen) version->version_minor < 0) { /* incompatible drm version */ xf86DrvMsg(pScreen->myNum, X_ERROR, - "TDFXDRIScreenInit failed (DRM version = %d.%d.%d, expected 1.0.x). Disabling DRI.\n", + "[dri] TDFXDRIScreenInit failed because of a version mismatch.\n" + "[dri] tdfx.o kernel module version is %d.%d.%d but version 1.0.x is needed.\n" + "[dri] Disabling the DRI.\n", version->version_major, version->version_minor, version->version_patchlevel); @@ -619,7 +624,6 @@ TDFXDRITransitionTo2d(ScreenPtr pScreen) xf86FreeOffscreenArea(pTDFX->reservedArea); } - static void TDFXDRITransitionTo3d(ScreenPtr pScreen) { @@ -627,8 +631,15 @@ TDFXDRITransitionTo3d(ScreenPtr pScreen) TDFXPtr pTDFX = TDFXPTR(pScrn); FBAreaPtr pArea; - if(pTDFX->videoScratch) - xf86FreeOffscreenLinear(pTDFX->videoScratch); + if(pTDFX->overlayBuffer) { + xf86FreeOffscreenLinear(pTDFX->overlayBuffer); + pTDFX->overlayBuffer = NULL; + } + + if(pTDFX->textureBuffer) { + xf86FreeOffscreenArea(pTDFX->textureBuffer); + pTDFX->textureBuffer = NULL; + } xf86PurgeUnlockedOffscreenAreas(pScreen); 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 d6207994b..61275ba23 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.71 2001/04/23 16:52:22 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c,v 1.75.2.2 2001/05/23 13:29:28 alanh Exp $ */ /* * Authors: @@ -98,7 +98,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* Required Functions: */ -static OptionInfoPtr TDFXAvailableOptions(int chipid, int busid); +static const OptionInfoRec * TDFXAvailableOptions(int chipid, int busid); /* Print a driver identifying message. */ static void TDFXIdentify(int flags); @@ -170,16 +170,18 @@ typedef enum { OPTION_SHOWCACHE, OPTION_VIDEO_KEY, OPTION_NO_SLI, + OPTION_TEXTURED_VIDEO, OPTION_DRI } TDFXOpts; -static OptionInfoRec TDFXOptions[] = { +static const OptionInfoRec TDFXOptions[] = { { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_USE_PIO, "UsePIO", OPTV_BOOLEAN, {0}, FALSE}, { OPTION_SHOWCACHE, "ShowCache", OPTV_BOOLEAN, {0}, FALSE}, { OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE}, { OPTION_NO_SLI, "NoSLI", OPTV_BOOLEAN, {0}, FALSE}, + { OPTION_TEXTURED_VIDEO, "TexturedVideo", OPTV_BOOLEAN, {1}, FALSE}, { OPTION_DRI, "DRI", OPTV_BOOLEAN, {0}, FALSE}, { -1, NULL, OPTV_NONE, {0}, FALSE} }; @@ -376,8 +378,7 @@ TDFXIdentify(int flags) { xf86PrintChipsets(TDFX_NAME, "Driver for 3dfx Banshee/Voodoo3 chipsets", TDFXChipsets); } -static -OptionInfoPtr +static const OptionInfoRec * TDFXAvailableOptions(int chipid, int busid) { return TDFXOptions; @@ -393,6 +394,7 @@ TDFXProbeDDC(ScrnInfoPtr pScrn, int index) { pVbe = VBEInit(NULL,index); ConfiguredMonitor = vbeDoEDID(pVbe, NULL); + vbeFree(pVbe); } } @@ -465,12 +467,12 @@ TDFXProbe(DriverPtr drv, int flags) { static int TDFXCountRam(ScrnInfoPtr pScrn) { TDFXPtr pTDFX; - int memSize; - int memType=-1; /* SDRAM or SGRAM */ + int vmemSize; + int vmemType=-1; /* SDRAM or SGRAM */ pTDFX = TDFXPTR(pScrn); TDFXTRACE("TDFXCountRam start\n"); - memSize=0; + vmemSize=0; if (pTDFX->PIOBase[0]) { CARD32 partSize, /* size of SGRAM chips in Mbits */ @@ -482,10 +484,10 @@ TDFXCountRam(ScrnInfoPtr pScrn) { miscInit1; /* determine memory type: SDRAM or SGRAM */ - memType = MEM_TYPE_SGRAM; + vmemType = MEM_TYPE_SGRAM; dramInit1_strap = pTDFX->readLong(pTDFX, DRAMINIT1); dramInit1_strap &= SST_MCTL_TYPE_SDRAM; - if (dramInit1_strap) memType = MEM_TYPE_SDRAM; + if (dramInit1_strap) vmemType = MEM_TYPE_SDRAM; /* set memory interface delay values and enable refresh */ /* these apply to all RAM vendors */ @@ -505,8 +507,8 @@ TDFXCountRam(ScrnInfoPtr pScrn) { dramInit0_strap = pTDFX->readLong(pTDFX, DRAMINIT0); if (pTDFX->ChipType<=PCI_CHIP_VOODOO3) { /* Banshee/V3 */ - if (memType == MEM_TYPE_SDRAM) { - memSize = 16; + if (vmemType == MEM_TYPE_SDRAM) { + vmemSize = 16; } else { nChips = ((dramInit0_strap & SST_SGRAM_NUM_CHIPSETS) == 0) ? 4 : 8; @@ -519,22 +521,22 @@ TDFXCountRam(ScrnInfoPtr pScrn) { (dramInit0_strap & SST_SGRAM_TYPE) << SST_SGRAM_TYPE_SHIFT ); return 0; } - memSize = (nChips * partSize) / 8; /* in MBytes */ + vmemSize = (nChips * partSize) / 8; /* in MBytes */ } } else { /* V4, V5 */ nChips = ((dramInit0_strap & SST_SGRAM_NUM_CHIPSETS)==0) ? 4 : 8; partSize=1<<((dramInit0_strap&0x38000000)>>28); banks=((dramInit0_strap&BIT(30))==0) ? 2 : 4; - memSize=nChips*partSize*banks; + vmemSize=nChips*partSize*banks; } TDFXTRACEREG("dramInit0 = %x dramInit1 = %x\n", dramInit0_strap, dramInit1_strap); - TDFXTRACEREG("MemConfig %d chips %d size %d total\n", nChips, partSize, memSize); + TDFXTRACEREG("MemConfig %d chips %d size %d total\n", nChips, partSize, vmemSize); /* disable block writes for SDRAM */ miscInit1 = pTDFX->readLong(pTDFX, MISCINIT1); - if ( memType == MEM_TYPE_SDRAM ) { + if ( vmemType == MEM_TYPE_SDRAM ) { miscInit1 |= SST_DISABLE_2D_BLOCK_WRITE; } miscInit1|=1; @@ -542,7 +544,7 @@ TDFXCountRam(ScrnInfoPtr pScrn) { } /* return # of KBytes of board memory */ - return memSize*1024; + return vmemSize*1024; } #if 0 @@ -647,6 +649,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) int flags24; rgb defaultWeight = {0, 0, 0}; pciVideoPtr match; + int availableMem; TDFXTRACE("TDFXPreInit start\n"); if (pScrn->numEntities != 1) return FALSE; @@ -661,12 +664,14 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) pTDFX->initDone=FALSE; pTDFX->pEnt = xf86GetEntityInfo(pScrn->entityList[0]); -#if !defined(__powerpc__) if (flags & PROBE_DETECT) { +#if !defined(__powerpc__) TDFXProbeDDC(pScrn, pTDFX->pEnt->index); return TRUE; - } +#else + return FALSE; #endif + } if (pTDFX->pEnt->location.type != BUS_PCI) return FALSE; @@ -701,7 +706,7 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) match=pTDFX->PciInfo=xf86GetPciInfoForEntity(pTDFX->pEnt->index); TDFXFindChips(pScrn, match); - if (xf86RegisterResources(pTDFX->pEnt->index, 0, ResExclusive)) { + if (xf86RegisterResources(pTDFX->pEnt->index, NULL, ResExclusive)) { TDFXFreeRec(pScrn); return FALSE; } @@ -776,7 +781,10 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) /* Process the options */ xf86CollectOptions(pScrn, NULL); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, TDFXOptions); + if (!(pTDFX->Options = xalloc(sizeof(TDFXOptions)))) + return FALSE; + memcpy(pTDFX->Options, TDFXOptions, sizeof(TDFXOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTDFX->Options); /* * Set the Chipset and ChipRev, allowing config file entries to @@ -923,12 +931,19 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) clockRanges->interlaceAllowed = FALSE; clockRanges->doubleScanAllowed = TRUE; + /* + * Max memory available for the framebuffer is the total less the + * HW cursor space and FIFO space. + */ + availableMem = pScrn->videoRam - 4096 - + (((255 <= CMDFIFO_PAGES) ? 255 : CMDFIFO_PAGES) << 12); + i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, pScrn->display->modes, clockRanges, 0, 320, 2048, 16*pScrn->bitsPerPixel, - 200, 1536, - pScrn->virtualX, pScrn->virtualY, - pTDFX->FbMapSize, LOOKUP_BEST_REFRESH); + 200, 2047, + pScrn->display->virtualX, pScrn->display->virtualY, + availableMem, LOOKUP_BEST_REFRESH); if (i==-1) { TDFXFreeRec(pScrn); @@ -957,33 +972,32 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) } xf86LoaderReqSymbols("fbScreenInit", "fbPictureInit", NULL); - if (!xf86ReturnOptValBool(TDFXOptions, OPTION_NOACCEL, FALSE)) { + if (!xf86ReturnOptValBool(pTDFX->Options, OPTION_NOACCEL, FALSE)) { if (!xf86LoadSubModule(pScrn, "xaa")) { TDFXFreeRec(pScrn); return FALSE; } } - if (!xf86GetOptValBool(TDFXOptions, OPTION_SHOWCACHE, &(pTDFX->ShowCache))) { + if (!xf86GetOptValBool(pTDFX->Options, OPTION_SHOWCACHE, &(pTDFX->ShowCache))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShowCache %s\n", pTDFX->ShowCache ? "Enabled" : "Disabled"); } else { pTDFX->ShowCache = FALSE; } - if (xf86GetOptValInteger(TDFXOptions, OPTION_VIDEO_KEY, &(pTDFX->videoKey))) { + if (xf86GetOptValBool(pTDFX->Options, OPTION_TEXTURED_VIDEO, &(pTDFX->TextureXvideo))) { + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Texture Xvideo Adaptor %s\n", pTDFX->TextureXvideo ? "Enabled" : "Disabled"); + } else { + pTDFX->TextureXvideo = FALSE; + } + + if (xf86GetOptValInteger(pTDFX->Options, OPTION_VIDEO_KEY, &(pTDFX->videoKey))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n", pTDFX->videoKey); } else { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key default 0x%x\n", pTDFX->videoKey = 0x1E); } - if (xf86GetOptValInteger(TDFXOptions, OPTION_VIDEO_KEY, &(pTDFX->videoKey))) { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n", - pTDFX->videoKey); - } else - pTDFX->videoKey = 0x1E; - - - if (!xf86ReturnOptValBool(TDFXOptions, OPTION_SW_CURSOR, FALSE)) { + if (!xf86ReturnOptValBool(pTDFX->Options, OPTION_SW_CURSOR, FALSE)) { if (!xf86LoadSubModule(pScrn, "ramdac")) { TDFXFreeRec(pScrn); return FALSE; @@ -1003,12 +1017,14 @@ TDFXPreInit(ScrnInfoPtr pScrn, int flags) /* Initialize DDC1 if possible */ if (xf86LoadSubModule(pScrn, "vbe")) { xf86MonPtr pMon; - pMon = vbeDoEDID(VBEInit(NULL,pTDFX->pEnt->index), NULL); + vbeInfoPtr pVbe = VBEInit(NULL,pTDFX->pEnt->index); + pMon = vbeDoEDID(pVbe, NULL); + vbeFree(pVbe); xf86SetDDCproperties(pScrn,xf86PrintEDID(pMon)); } #endif - if (xf86ReturnOptValBool(TDFXOptions, OPTION_USE_PIO, FALSE)) { + if (xf86ReturnOptValBool(pTDFX->Options, OPTION_USE_PIO, FALSE)) { pTDFX->usePIO=TRUE; } @@ -1711,6 +1727,9 @@ calcBufferSize(int xres, int yres, Bool tiled, int cpp) static void allocateMemory(ScrnInfoPtr pScrn) { TDFXPtr pTDFX; int memRemaining, fifoSize, screenSizeInTiles, cursorSize; + int fbSize; + int verb; + char *str; pTDFX = TDFXPTR(pScrn); @@ -1723,6 +1742,14 @@ static void allocateMemory(ScrnInfoPtr pScrn) { screenSizeInTiles=calcBufferSize(pScrn->virtualX, pScrn->virtualY, TRUE, 4); } + + /* + * Layout is: + * cursor, fifo, fb, tex, bb, db + */ + + fbSize = (pScrn->virtualY + pTDFX->pixmapCacheLinesMin) * pTDFX->stride; + memRemaining=((pScrn->videoRam<<10) - 1) &~ 0xFFF; /* Note that a page is 4096 bytes, and a */ /* tile is 32 x 128 = 4096 bytes. So, */ @@ -1732,10 +1759,12 @@ static void allocateMemory(ScrnInfoPtr pScrn) { pTDFX->depthOffset = (memRemaining - screenSizeInTiles) &~ 0xFFF; if ((pTDFX->depthOffset & (0x1 << 12)) == 0) { #if 1 + if (pTDFX->depthOffset > 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Changing depth offset from 0x%08x to 0x%08x\n", pTDFX->depthOffset, pTDFX->depthOffset - (0x1 << 12)); + } #endif pTDFX->depthOffset -= (0x1 << 12); } @@ -1744,10 +1773,12 @@ static void allocateMemory(ScrnInfoPtr pScrn) { pTDFX->backOffset = (pTDFX->depthOffset - screenSizeInTiles) &~ 0xFFF; if (pTDFX->backOffset & (0x1 << 12)) { #if 1 + if (pTDFX->backOffset > 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Changing back offset from 0x%08x to 0x%08x\n", pTDFX->backOffset, pTDFX->backOffset - (0x1 << 12)); + } #endif pTDFX->backOffset -= (0x1 << 12); } @@ -1763,46 +1794,62 @@ static void allocateMemory(ScrnInfoPtr pScrn) { /* it to be on a page boundary too, just */ /* for giggles. */ pTDFX->fbOffset = pTDFX->fifoOffset + pTDFX->fifoSize; - pTDFX->texOffset = pTDFX->fbOffset + - ((pScrn->virtualY+pTDFX->pixmapCacheLinesMin)*pTDFX->stride); - pTDFX->texSize = pTDFX->backOffset - pTDFX->texOffset; - pTDFX->cursorOffset = 0; - if (pTDFX->texSize < 0) { - pTDFX->backOffset = -1; + pTDFX->texOffset = pTDFX->fbOffset + fbSize; + if (pTDFX->depthOffset <= pTDFX->texOffset || + pTDFX->backOffset <= pTDFX->texOffset) { + /* + * pTDFX->texSize < 0 means that the DRI is disabled. pTDFX->backOffset + * is used to calculate the maximum amount of memory available for + * 2D offscreen use. With DRI disabled, set this to the top of memory. + */ + + pTDFX->texSize = -1; + pTDFX->backOffset = pScrn->videoRam * 1024; pTDFX->depthOffset = -1; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No Texture Memory available, disabling DRI\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Not enough video memory available for textures and depth buffer\n" + "\tand/or back buffer. Disabling DRI. To use DRI try lower\n" + "\tresolution modes and/or a smaller virtual screen size\n"); } else { + pTDFX->texSize = pTDFX->backOffset - pTDFX->texOffset; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Textures Memory %0.02f MB\n", (float)pTDFX->texSize/1024.0/1024.0); } -#if 1 - xf86DrvMsg(pScrn->scrnIndex, X_INFO, +/* This could be set to 2 or 3 */ +#define OFFSET_VERB 1 + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, OFFSET_VERB, "Cursor Offset: [0x%08X,0x%08X)\n", pTDFX->cursorOffset, pTDFX->cursorOffset + cursorSize); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, OFFSET_VERB, "Fifo Offset: [0x%08X, 0x%08X)\n", pTDFX->fifoOffset, pTDFX->fifoOffset + pTDFX->fifoSize); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Texture Offset: [0x%08X, 0x%08X)\n", - pTDFX->texOffset, - pTDFX->texOffset + pTDFX->texSize); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, OFFSET_VERB, "Front Buffer Offset: [0x%08X, 0x%08X)\n", pTDFX->fbOffset, pTDFX->fbOffset + (pScrn->virtualY+pTDFX->pixmapCacheLinesMin)*pTDFX->stride); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "BackOffset: [0x%08X, 0x%08X)\n", + if (pTDFX->texSize > 0) { + verb = OFFSET_VERB; + str = ""; + } else { + verb = 3; + str = "(NOT USED) "; + } + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verb, + "%sTexture Offset: [0x%08X, 0x%08X)\n", str, + pTDFX->texOffset, + pTDFX->texOffset + pTDFX->texSize); + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verb, + "%sBackOffset: [0x%08X, 0x%08X)\n", str, pTDFX->backOffset, pTDFX->backOffset + screenSizeInTiles); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "DepthOffset: [0x%08X, 0x%08X)\n", + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verb, + "%sDepthOffset: [0x%08X, 0x%08X)\n", str, pTDFX->depthOffset, pTDFX->depthOffset + screenSizeInTiles); -#endif /* 0/1 */ } static Bool @@ -1813,6 +1860,7 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { VisualPtr visual; BoxRec MemBox; MessageType driFrom = X_DEFAULT; + int scanlines; TDFXTRACE("TDFXScreenInit start\n"); pScrn = xf86Screens[pScreen->myNum]; @@ -1829,13 +1877,14 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { pTDFX->stride = pScrn->displayWidth*pTDFX->cpp; /* enough to do DVD */ - pTDFX->pixmapCacheLinesMin = ((720*480*2) + pTDFX->stride - 1)/pTDFX->stride; + pTDFX->pixmapCacheLinesMin = ((720*480*pTDFX->cpp) + + pTDFX->stride - 1)/pTDFX->stride; allocateMemory(pScrn); #if 0 if (pTDFX->numChips>1) { - if (xf86ReturnOptValBool(TDFXOptions, OPTION_NO_SLI, FALSE)) { + if (xf86ReturnOptValBool(pTDFX->Options, OPTION_NO_SLI, FALSE)) { TDFXSetupSLI(pScrn, FALSE, 0); } else { TDFXSetupSLI(pScrn, TRUE, 0); @@ -1852,18 +1901,23 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { return FALSE; } - pTDFX->pixmapCacheLinesMax = (pTDFX->backOffset - pTDFX->fbOffset) / - pTDFX->stride; - + scanlines = (pTDFX->backOffset - pTDFX->fbOffset) / pTDFX->stride; if(pTDFX->ChipType < PCI_CHIP_VOODOO5) { - if(pTDFX->pixmapCacheLinesMax > 2048) - pTDFX->pixmapCacheLinesMax = 2048; + if (scanlines > 2047) + scanlines = 2047; } else { /* MaxClip seems to have only 12 bits => 0->4095 */ - if(pTDFX->pixmapCacheLinesMax > 4095) - pTDFX->pixmapCacheLinesMax = 4095; + if (scanlines > 4095) + scanlines = 4095; } + pTDFX->pixmapCacheLinesMax = scanlines - pScrn->virtualY; + + /* + * Note, pTDFX->pixmapCacheLinesMax may be smaller than + * pTDFX->pixmapCacheLinesMin when pTDFX->texSize < 0. DRI is disabled + * in that case, so pTDFX->pixmapCacheLinesMin isn't used when that's true. + */ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%i lines of offscreen memory available for 2D and video\n", pTDFX->pixmapCacheLinesMax); @@ -1871,7 +1925,7 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { MemBox.y1 = 0; MemBox.x1 = 0; MemBox.x2 = pScrn->displayWidth; - MemBox.y2 = pTDFX->pixmapCacheLinesMax; + MemBox.y2 = scanlines; pTDFX->maxClip = MemBox.x2 | (MemBox.y2 << 16); @@ -1888,17 +1942,17 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { miSetPixmapDepths (); - pTDFX->NoAccel=xf86ReturnOptValBool(TDFXOptions, OPTION_NOACCEL, FALSE); + pTDFX->NoAccel=xf86ReturnOptValBool(pTDFX->Options, 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 (!xf86ReturnOptValBool(TDFXOptions, OPTION_DRI, TRUE) || pTDFX->NoAccel) { + if (!xf86ReturnOptValBool(pTDFX->Options, OPTION_DRI, TRUE) || pTDFX->NoAccel) { pTDFX->directRenderingEnabled = FALSE; driFrom = X_CONFIG; - } else if ((pTDFX->backOffset == -1) || (pTDFX->depthOffset == -1)) { + } else if (pTDFX->texSize < 0) { pTDFX->directRenderingEnabled = FALSE; driFrom = X_PROBED; } else { @@ -1958,7 +2012,7 @@ TDFXScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); - if (!xf86ReturnOptValBool(TDFXOptions, OPTION_SW_CURSOR, FALSE)) { + if (!xf86ReturnOptValBool(pTDFX->Options, OPTION_SW_CURSOR, FALSE)) { if (!TDFXCursorInit(pScreen)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Hardware cursor initialization failed\n"); @@ -2128,12 +2182,12 @@ TDFXCloseScreen(int scrnIndex, ScreenPtr pScreen) if (pTDFX->scanlineColorExpandBuffers[1]) xfree(pTDFX->scanlineColorExpandBuffers[1]); pTDFX->scanlineColorExpandBuffers[1]=0; - - if (pTDFX->adaptor) { - xfree(pTDFX->adaptor->pPortPrivates[0].ptr); - xf86XVFreeVideoAdaptorRec(pTDFX->adaptor); - pTDFX->adaptor = NULL; - } + if (pTDFX->overlayAdaptor) + xfree(pTDFX->overlayAdaptor); + pTDFX->overlayAdaptor=0; + if (pTDFX->textureAdaptor) + xfree(pTDFX->textureAdaptor); + pTDFX->textureAdaptor=0; pScrn->vtSema=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 a90e130a5..847a0ee2e 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.15 2001/04/05 21:29:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.c,v 1.15.2.1 2001/05/22 21:25:45 dawes Exp $ */ #include "xf86.h" @@ -51,7 +51,7 @@ static void TDFXSendNOPFifo3D(ScrnInfoPtr pScrn) WRITE_FIFO(pTDFX, 0, 0); } -static void TDFXSendNOPFifo2D(ScrnInfoPtr pScrn) +void TDFXSendNOPFifo2D(ScrnInfoPtr pScrn) { TDFXPtr pTDFX; 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 1e533baa6..e56188ad9 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.9 2001/04/05 21:29:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_priv.h,v 1.9.2.1 2001/05/22 21:25:45 dawes Exp $ */ #ifndef _TDFX_FIFO_H_ @@ -82,6 +82,7 @@ typedef volatile struct _H3CmdFifo Bool TDFXInitFifo(ScreenPtr pScreen); void TDFXShutdownFifo(ScreenPtr pScreen); void TDFXAllocateSlots(TDFXPtr pTDFX, int slots); +void TDFXSendNOPFifo2D(ScrnInfoPtr pScreen); #define CHECK_FOR_ROOM(_n) \ if ((pTDFX->fifoSlots -= (_n)) < 0) \ 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 41f781c43..80a4e4205 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.10 2001/04/05 21:29:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_video.c,v 1.10.2.1 2001/05/22 21:25:45 dawes Exp $ */ #include "xf86.h" #include "tdfx.h" @@ -7,102 +7,76 @@ #include "Xv.h" #include "fourcc.h" -#define OFF_DELAY 250 /* milliseconds */ -#define FREE_DELAY 15000 - -#define OFF_TIMER 0x01 -#define FREE_TIMER 0x02 -#define CLIENT_VIDEO_ON 0x04 +static Atom xvColorKey, xvFilterQuality; -#define TIMER_MASK (OFF_TIMER | FREE_TIMER) +/* These should move into tdfxdefs.h with better names */ +#define YUV_Y_BASE 0xC00000 +#define YUV_U_BASE 0xD00000 +#define YUV_V_BASE 0xE00000 -#define VIDPROCCFGMASK 0xa2e3eb6c +#define SST_2D_FORMAT_YUYV 0x8 +#define SST_2D_FORMAT_UYVY 0x9 -#ifndef XvExtension -void TDFXInitVideo(ScreenPtr pScreen) {} -#else +#define YUVBASEADDR 0x80100 +#define YUVSTRIDE 0x80104 +#define VIDPROCCFGMASK 0xa2e3eb6c -static XF86VideoAdaptorPtr TDFXSetupImageVideo(ScreenPtr); -static int TDFXSetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer); -static int TDFXGetPortAttribute(ScrnInfoPtr, Atom ,INT32 *, pointer); -static void TDFXStopVideo(ScrnInfoPtr, pointer, Bool); -static void TDFXQueryBestSize(ScrnInfoPtr, Bool, short, short, short, short, - unsigned int *, unsigned int *, pointer); -static int TDFXPutImage(ScrnInfoPtr, short, short, short, short, short, - short, short, short, int, unsigned char*, short, - short, Bool, RegionPtr, pointer); -static int TDFXQueryImageAttributes(ScrnInfoPtr, int, unsigned short *, - unsigned short *, int *, int *); +#define OFF_DELAY 250 /* milliseconds */ +#define FREE_DELAY 15000 +#define OFF_TIMER 0x01 +#define FREE_TIMER 0x02 +#define CLIENT_VIDEO_ON 0x04 +#define TIMER_MASK (OFF_TIMER | FREE_TIMER) -static void TDFXResetVideo(ScrnInfoPtr); - -static void TDFXVideoTimerCallback(ScrnInfoPtr pScrn, Time time); +#define TDFX_MAX_OVERLAY_PORTS 1 +#define TDFX_MAX_TEXTURE_PORTS 32 +/* Doesn't matter what screen we use */ +#define DummyScreen screenInfo.screens[0] +/* Needed for attribute atoms */ #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) -static Atom xvColorKey, xvFilterQuality; - - -typedef struct { - RegionRec clip; - CARD32 colorKey; - int filterQuality; - CARD32 videoStatus; - Time offTime; - Time freeTime; -} TDFXPortPrivRec, *TDFXPortPrivPtr; +/* + * PROTOTYPES + */ -void TDFXInitVideo(ScreenPtr pScreen) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - TDFXPtr pTDFX = TDFXPTR(pScrn); - XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; - XF86VideoAdaptorPtr newAdaptor = NULL; - int num_adaptors; - - if(pTDFX->AccelInfoRec && pTDFX->AccelInfoRec->FillSolidRects) - newAdaptor = TDFXSetupImageVideo(pScreen); +static FBAreaPtr TDFXAllocateMemoryArea (ScrnInfoPtr pScrn, FBAreaPtr area, int width, int height); +static FBLinearPtr TDFXAllocateMemoryLinear (ScrnInfoPtr pScrn, FBLinearPtr linear, int size); +static void TDFXVideoTimerCallback(ScrnInfoPtr pScrn, Time time); - num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); +static XF86VideoAdaptorPtr TDFXSetupImageVideoTexture(ScreenPtr); +static int TDFXSetPortAttributeTexture(ScrnInfoPtr, Atom, INT32, pointer); +static int TDFXGetPortAttributeTexture(ScrnInfoPtr, Atom ,INT32 *, pointer); +static int TDFXPutImageTexture(ScrnInfoPtr, short, short, short, short, short, short, short, short, int, unsigned char*, short, short, Bool, RegionPtr, pointer); +static void TDFXStopVideoTexture(ScrnInfoPtr, pointer, Bool); - 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++; - } - } - } +static XF86VideoAdaptorPtr TDFXSetupImageVideoOverlay(ScreenPtr); +static int TDFXSetPortAttributeOverlay(ScrnInfoPtr, Atom, INT32, pointer); +static int TDFXGetPortAttributeOverlay(ScrnInfoPtr, Atom ,INT32 *, pointer); +static int TDFXPutImageOverlay(ScrnInfoPtr, short, short, short, short, short, short, short, short, int, unsigned char*, short, short, Bool, RegionPtr, pointer); +static void TDFXStopVideoOverlay(ScrnInfoPtr, pointer, Bool); +static void TDFXResetVideoOverlay(ScrnInfoPtr); - if(num_adaptors) - xf86XVScreenInit(pScreen, adaptors, num_adaptors); +static void TDFXQueryBestSize(ScrnInfoPtr, Bool, short, short, short, short, unsigned int *, unsigned int *, pointer); +static int TDFXQueryImageAttributes(ScrnInfoPtr, int, unsigned short *, unsigned short *, int *, int *); - if(newAdaptors) - xfree(newAdaptors); -} +/* + * ADAPTOR INFORMATION + */ -/* client libraries expect an encoding */ -static XF86VideoEncodingRec DummyEncoding = +static XF86VideoEncodingRec OverlayEncoding[] = { - 0, - "XV_IMAGE", - 2048, 2048, - {1, 1} + { 0, "XV_IMAGE", 2048, 2048, {1, 1} } }; -#define NUM_FORMATS 12 +static XF86VideoEncodingRec TextureEncoding[] = +{ + { 0, "XV_IMAGE", 1024, 1024, {1, 1} } +}; -static XF86VideoFormatRec Formats[NUM_FORMATS] = +static XF86VideoFormatRec OverlayFormats[] = { {8, TrueColor}, {8, DirectColor}, {8, PseudoColor}, {8, GrayScale}, {8, StaticGray}, {8, StaticColor}, @@ -110,54 +84,101 @@ static XF86VideoFormatRec Formats[NUM_FORMATS] = {15, DirectColor}, {16, DirectColor}, {24, DirectColor} }; +static XF86VideoFormatRec TextureFormats[] = +{ + {15, TrueColor}, {16, TrueColor}, {24, TrueColor} +}; -#define NUM_ATTRIBUTES 2 +static XF86AttributeRec OverlayAttributes[] = +{ + {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"}, + {XvSettable | XvGettable, 0, 1, "XV_FILTER_QUALITY"} +}; -static XF86AttributeRec Attributes[NUM_ATTRIBUTES] = +static XF86AttributeRec TextureAttributes[] = { {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"}, {XvSettable | XvGettable, 0, 1, "XV_FILTER_QUALITY"} }; -#define NUM_IMAGES 4 +static XF86ImageRec OverlayImages[] = +{ + XVIMAGE_YUY2, XVIMAGE_UYVY, XVIMAGE_YV12, XVIMAGE_I420 +}; -static XF86ImageRec Images[NUM_IMAGES] = +static XF86ImageRec TextureImages[] = { - XVIMAGE_YUY2, - XVIMAGE_UYVY, - XVIMAGE_YV12, - XVIMAGE_I420 + XVIMAGE_YV12, XVIMAGE_I420 }; -static void -TDFXResetVideo(ScrnInfoPtr pScrn) +/* + * COMMON SETUP FUNCTIONS + */ + +void TDFXInitVideo(ScreenPtr pScreen) { + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; + XF86VideoAdaptorPtr newAdaptor = NULL; TDFXPtr pTDFX = TDFXPTR(pScrn); - TDFXPortPrivPtr pPriv = pTDFX->adaptor->pPortPrivates[0].ptr; + int num_adaptors; - /* reset the video */ - pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK; - pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg); - pTDFX->writeLong(pTDFX, RGBMAXDELTA, 0x0080808); - pTDFX->writeLong(pTDFX, VIDCHROMAMIN, pPriv->colorKey); - pTDFX->writeLong(pTDFX, VIDCHROMAMAX, pPriv->colorKey); + /* The hardware can't convert YUV->8 bit color */ + if(pTDFX->cpp == 1) + return; + + /* Start with the generic adaptors */ + num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); + + if(!pTDFX->AccelInfoRec || !pTDFX->AccelInfoRec->FillSolidRects) + return; + + if (!pTDFX->TextureXvideo) { + /* Overlay adaptor */ + newAdaptor = TDFXSetupImageVideoOverlay(pScreen); + } else { + /* Texture adaptor */ + newAdaptor = TDFXSetupImageVideoTexture(pScreen); + } + + /* Add the adaptor to the list */ + if(newAdaptor) { + newAdaptors = xalloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr*)); + if(newAdaptors) { + if (num_adaptors) 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); +} + + +void TDFXCloseVideo (ScreenPtr pScreen) +{ } static XF86VideoAdaptorPtr -TDFXAllocAdaptor(ScrnInfoPtr pScrn) +TDFXAllocAdaptor(ScrnInfoPtr pScrn, int numberPorts) { XF86VideoAdaptorPtr adapt; TDFXPtr pTDFX = TDFXPTR(pScrn); TDFXPortPrivPtr pPriv; if(!(adapt = xf86XVAllocateVideoAdaptorRec(pScrn))) - return NULL; + return NULL; - if(!(pPriv = xcalloc(1, sizeof(TDFXPortPrivRec) + sizeof(DevUnion)))) + if(!(pPriv = xcalloc(1, sizeof(TDFXPortPrivRec) + (numberPorts * sizeof(DevUnion))))) { - xfree(adapt); - return NULL; + xfree(adapt); + return NULL; } adapt->pPortPrivates = (DevUnion*)(&pPriv[1]); @@ -169,95 +190,101 @@ TDFXAllocAdaptor(ScrnInfoPtr pScrn) pPriv->colorKey = pTDFX->videoKey; pPriv->videoStatus = 0; pPriv->filterQuality = 1; - + return adapt; } + static XF86VideoAdaptorPtr -TDFXSetupImageVideo(ScreenPtr pScreen) +TDFXSetupImageVideoOverlay(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; TDFXPtr pTDFX = TDFXPTR(pScrn); TDFXPortPrivPtr pPriv; XF86VideoAdaptorPtr adapt; - if(!(adapt = TDFXAllocAdaptor(pScrn))) - return NULL; + if(!(adapt = TDFXAllocAdaptor(pScrn, TDFX_MAX_OVERLAY_PORTS))) + return NULL; adapt->type = XvWindowMask | XvInputMask | XvImageMask; adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; adapt->name = "3dfx Video Overlay"; - adapt->nEncodings = 1; - adapt->pEncodings = &DummyEncoding; - adapt->nFormats = NUM_FORMATS; - adapt->pFormats = Formats; - adapt->nPorts = 1; - adapt->nAttributes = NUM_ATTRIBUTES; - adapt->pAttributes = Attributes; - adapt->nImages = NUM_IMAGES; - adapt->pImages = Images; + adapt->nPorts = TDFX_MAX_OVERLAY_PORTS; + adapt->nEncodings = sizeof(OverlayEncoding) / sizeof(XF86VideoEncodingRec); + adapt->pEncodings = OverlayEncoding; + adapt->nFormats = sizeof(OverlayFormats) / sizeof(XF86VideoFormatRec); + adapt->pFormats = OverlayFormats; + adapt->nAttributes = sizeof(OverlayAttributes) / sizeof(XF86AttributeRec); + adapt->pAttributes = OverlayAttributes; + adapt->nImages = sizeof(OverlayImages) / sizeof(XF86ImageRec); + adapt->pImages = OverlayImages; adapt->PutVideo = NULL; adapt->PutStill = NULL; adapt->GetVideo = NULL; adapt->GetStill = NULL; - adapt->StopVideo = TDFXStopVideo; - adapt->SetPortAttribute = TDFXSetPortAttribute; - adapt->GetPortAttribute = TDFXGetPortAttribute; + adapt->StopVideo = TDFXStopVideoOverlay; + adapt->SetPortAttribute = TDFXSetPortAttributeOverlay; + adapt->GetPortAttribute = TDFXGetPortAttributeOverlay; adapt->QueryBestSize = TDFXQueryBestSize; - adapt->PutImage = TDFXPutImage; + adapt->PutImage = TDFXPutImageOverlay; adapt->QueryImageAttributes = TDFXQueryImageAttributes; - pTDFX->adaptor = adapt; + pTDFX->overlayAdaptor = adapt; pPriv = (TDFXPortPrivPtr)(adapt->pPortPrivates[0].ptr); REGION_INIT(pScreen, &(pPriv->clip), NullBox, 0); - TDFXResetVideo(pScrn); + TDFXResetVideoOverlay(pScrn); return adapt; } -/* I really should stick this in miregion */ -static Bool -RegionsEqual(RegionPtr A, RegionPtr B) +static XF86VideoAdaptorPtr +TDFXSetupImageVideoTexture(ScreenPtr pScreen) { - int *dataA, *dataB; - int num; + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + TDFXPtr pTDFX = TDFXPTR(pScrn); + XF86VideoAdaptorPtr adapt; + int i; - num = REGION_NUM_RECTS(A); - if(num != REGION_NUM_RECTS(B)) - return FALSE; + if(!(adapt = TDFXAllocAdaptor(pScrn, TDFX_MAX_TEXTURE_PORTS))) + return NULL; - 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; + adapt->type = XvWindowMask | XvInputMask | XvImageMask; + adapt->flags = 0; + adapt->name = "3dfx Video Texture"; + adapt->nPorts = TDFX_MAX_TEXTURE_PORTS; + adapt->nEncodings = sizeof(TextureEncoding) / sizeof(XF86VideoEncodingRec); + adapt->pEncodings = TextureEncoding; + adapt->nFormats = sizeof(TextureFormats) / sizeof(XF86VideoFormatRec); + adapt->pFormats = TextureFormats; + adapt->nAttributes = sizeof(TextureAttributes) / sizeof(XF86AttributeRec); + adapt->pAttributes = TextureAttributes; + adapt->nImages = sizeof(TextureImages) / sizeof(XF86ImageRec); + adapt->pImages = TextureImages; + adapt->PutVideo = NULL; + adapt->PutStill = NULL; + adapt->GetVideo = NULL; + adapt->GetStill = NULL; + adapt->StopVideo = TDFXStopVideoTexture; + adapt->SetPortAttribute = TDFXSetPortAttributeTexture; + adapt->GetPortAttribute = TDFXGetPortAttributeTexture; + adapt->QueryBestSize = TDFXQueryBestSize; + adapt->PutImage = TDFXPutImageTexture; + adapt->QueryImageAttributes = TDFXQueryImageAttributes; - dataA = (int*)REGION_RECTS(A); - dataB = (int*)REGION_RECTS(B); + for(i = 0; i < TDFX_MAX_TEXTURE_PORTS; i++) + adapt->pPortPrivates[i].val = i; - while(num--) { - if((dataA[0] != dataB[0]) || (dataA[1] != dataB[1])) - return FALSE; - dataA += 2; - dataB += 2; - } + pTDFX->textureAdaptor = adapt; - return TRUE; + return adapt; } -/* TDFXClipVideo - - - 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] +/* + * MISCELLANEOUS ROUTINES + */ static Bool TDFXClipVideo( @@ -282,90 +309,107 @@ TDFXClipVideo( diff = extents->x1 - dst->x1; if(diff > 0) { - dst->x1 = extents->x1; - *xa += diff * hscale; + dst->x1 = extents->x1; + *xa += diff * hscale; } diff = dst->x2 - extents->x2; if(diff > 0) { - dst->x2 = extents->x2; - *xb -= diff * hscale; + dst->x2 = extents->x2; + *xb -= diff * hscale; } diff = extents->y1 - dst->y1; if(diff > 0) { - dst->y1 = extents->y1; - *ya += diff * vscale; + dst->y1 = extents->y1; + *ya += diff * vscale; } diff = dst->y2 - extents->y2; if(diff > 0) { - dst->y2 = extents->y2; - *yb -= diff * vscale; + dst->y2 = extents->y2; + *yb -= diff * vscale; } if(*xa < 0) { - diff = (- *xa + hscale - 1)/ hscale; - dst->x1 += diff; - *xa += diff * hscale; + 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; + 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; + 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; + 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); + RegionRec clipReg; + REGION_INIT(DummyScreen, &clipReg, dst, 1); + REGION_INTERSECT(DummyScreen, reg, reg, &clipReg); + REGION_UNINIT(DummyScreen, &clipReg); } return TRUE; } -static void -TDFXStopVideo(ScrnInfoPtr pScrn, pointer data, Bool cleanup) -{ - TDFXPtr pTDFX = TDFXPTR(pScrn); - TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data; +static int +TDFXQueryImageAttributes( + ScrnInfoPtr pScrn, + int id, + unsigned short *w, unsigned short *h, + int *pitches, int *offsets +){ + int size, tmp; - REGION_EMPTY(pScrn->pScreen, &pPriv->clip); + if(*w > 1024) *w = 1024; + if(*h > 1024) *h = 1024; - if(cleanup) { - if(pPriv->videoStatus & CLIENT_VIDEO_ON) { - pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK; - pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg); - } - if(pTDFX->videoScratch) { - xf86FreeOffscreenLinear(pTDFX->videoScratch); - pTDFX->videoScratch = NULL; - } - pPriv->videoStatus = 0; - } else { - if(pPriv->videoStatus & CLIENT_VIDEO_ON) { - pPriv->videoStatus |= OFF_TIMER; - pPriv->offTime = currentTime.milliseconds + OFF_DELAY; - } - } + *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; + 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; + case FOURCC_UYVY: + case FOURCC_YUY2: + default: + size = *w << 1; + if(pitches) pitches[0] = size; + size *= *h; + break; + } + + return size; } + static int -TDFXSetPortAttribute( +TDFXSetPortAttributeOverlay( ScrnInfoPtr pScrn, Atom attribute, INT32 value, @@ -376,22 +420,21 @@ TDFXSetPortAttribute( TDFXPtr pTDFX = TDFXPTR(pScrn); if(attribute == xvColorKey) { - pPriv->colorKey = value; - pTDFX->writeLong(pTDFX, VIDCHROMAMIN, pPriv->colorKey); - pTDFX->writeLong(pTDFX, VIDCHROMAMAX, pPriv->colorKey); - REGION_EMPTY(pScrn->pScreen, &pPriv->clip); - } else - if(attribute == xvFilterQuality) { - if((value < 0) || (value > 1)) + pPriv->colorKey = value; + pTDFX->writeLong(pTDFX, VIDCHROMAMIN, pPriv->colorKey); + pTDFX->writeLong(pTDFX, VIDCHROMAMAX, pPriv->colorKey); + REGION_EMPTY(pScrn->pScreen, &pPriv->clip); + } else if(attribute == xvFilterQuality) { + if((value < 0) || (value > 1)) return BadValue; - pPriv->filterQuality = value; + pPriv->filterQuality = value; } else return BadMatch; return Success; } static int -TDFXGetPortAttribute( +TDFXGetPortAttributeOverlay( ScrnInfoPtr pScrn, Atom attribute, INT32 *value, @@ -400,16 +443,37 @@ TDFXGetPortAttribute( TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data; if(attribute == xvColorKey) { - *value = pPriv->colorKey; - } else - if(attribute == xvFilterQuality) { - *value = pPriv->filterQuality; + *value = pPriv->colorKey; + } else if(attribute == xvFilterQuality) { + *value = pPriv->filterQuality; } else return BadMatch; return Success; } +static int +TDFXSetPortAttributeTexture( + ScrnInfoPtr pScrn, + Atom attribute, + INT32 value, + pointer data +) { + return Success; +} + + +static int +TDFXGetPortAttributeTexture( + ScrnInfoPtr pScrn, + Atom attribute, + INT32 *value, + pointer data +){ + return Success; +} + + static void TDFXQueryBestSize( ScrnInfoPtr pScrn, @@ -446,12 +510,12 @@ TDFXCopyData( dst += dstPitch; } #else - w <<= 1; - while(h--) { - memcpy(dst, src, w); - src += srcPitch; - dst += dstPitch; - } + w <<= 1; + while(h--) { + memcpy(dst, src, w); + src += srcPitch; + dst += dstPitch; + } #endif } @@ -474,10 +538,10 @@ TDFXCopyMungedData( w >>= 1; for(j = 0; j < h; j++) { - dst = (CARD32*)dst1; - s1 = src1; s2 = src2; s3 = src3; - i = w; - while(i > 4) { + dst = (CARD32*)dst1; + s1 = src1; s2 = src2; s3 = src3; + i = w; + while(i > 4) { dst[0] = BE_WSWAP32(s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24)); dst[1] = BE_WSWAP32(s1[2] | (s1[3] << 16) | (s3[1] << 8) | @@ -486,69 +550,287 @@ TDFXCopyMungedData( (s2[2] << 24)); dst[3] = BE_WSWAP32(s1[6] | (s1[7] << 16) | (s3[3] << 8) | (s2[3] << 24)); - dst += 4; s2 += 4; s3 += 4; s1 += 8; - i -= 4; - } - while(i--) { + dst += 4; s2 += 4; s3 += 4; s1 += 8; + i -= 4; + } + while(i--) { dst[0] = BE_WSWAP32(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; - } + dst++; s2++; s3++; + s1 += 2; + } + + dst1 += dstPitch; + src1 += srcPitch; + if(j & 1) { + src2 += srcPitch2; + src3 += srcPitch2; + } } } -static FBLinearPtr -TDFXAllocateMemory( - ScrnInfoPtr pScrn, - FBLinearPtr linear, - int size -){ - ScreenPtr pScreen; - FBLinearPtr new_linear; +/* + * TEXTURE DRAWING FUNCTIONS + */ - if(linear) { - if(linear->size >= size) - return linear; - if(xf86ResizeOffscreenLinear(linear, size)) - return linear; +static void +TDFXStopVideoTexture(ScrnInfoPtr pScrn, pointer data, Bool cleanup) +{ + TDFXPtr pTDFX = TDFXPTR(pScrn); + TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data; - xf86FreeOffscreenLinear(linear); - } + REGION_EMPTY(pScrn->pScreen, &pPriv->clip); - pScreen = screenInfo.screens[pScrn->scrnIndex]; + if (cleanup) { + if(pTDFX->textureBuffer) { + xf86FreeOffscreenArea(pTDFX->textureBuffer); + pTDFX->textureBuffer = NULL; + } + } +} - new_linear = xf86AllocateOffscreenLinear(pScreen, size, 4, - NULL, NULL, NULL); - if(!new_linear) { - int max_size; +static void +TDFXScreenToScreenYUVStretchBlit (ScrnInfoPtr pScrn, + short src_x1, short src_y1, + short src_x2, short src_y2, + short dst_x1, short dst_y1, + short dst_x2, short dst_y2) +{ + TDFXPtr pTDFX = TDFXPTR(pScrn); + /* reformulate the paramaters the way the hardware wants them */ + INT32 src_x = src_x1 & 0x1FFF; + INT32 src_y = src_y1 & 0x1FFF; + INT32 dst_x = dst_x1 & 0x1FFF; + INT32 dst_y = dst_y1 & 0x1FFF; + INT32 src_w = (src_x2 - src_x1) & 0x1FFF; + INT32 src_h = (src_y2 - src_y1) & 0x1FFF; + INT32 dst_w = (dst_x2 - dst_x1) & 0x1FFF; + INT32 dst_h = (dst_y2 - dst_y1) & 0x1FFF; + /* Setup for blit src and dest */ + TDFXMakeRoom(pTDFX, 4); + DECLARE(SSTCP_DSTSIZE|SSTCP_SRCSIZE|SSTCP_DSTXY|SSTCP_COMMAND/*|SSTCP_COMMANDEXTRA*/); + /* TDFXWriteLong(pTDFX, SST_2D_COMMANDEXTRA, SST_COMMANDEXTRA_VSYNC);*/ + TDFXWriteLong(pTDFX, SST_2D_SRCSIZE, src_w | (src_h<<16)); + TDFXWriteLong(pTDFX, SST_2D_DSTSIZE, dst_w | (dst_h<<16)); + TDFXWriteLong(pTDFX, SST_2D_DSTXY, dst_x | (dst_y<<16)); + TDFXWriteLong(pTDFX, SST_2D_COMMAND, SST_2D_SCRNTOSCRNSTRETCH | 0xCC000000); + /* Write to the launch area to start the blit */ + TDFXMakeRoom(pTDFX, 1); + DECLARE_LAUNCH(1, 0); + TDFXWriteLong(pTDFX, SST_2D_LAUNCH, (src_x<<1) | (src_y<<16)); + /* Wait for it to happen */ + TDFXSendNOPFifo2D(pScrn); +} - xf86QueryLargestOffscreenLinear(pScreen, &max_size, 4, - PRIORITY_EXTREME); - if(max_size < size) - return NULL; +static void +YUVPlanarToPacked (ScrnInfoPtr pScrn, + short src_x, short src_y, + short src_h, short src_w, + int id, unsigned char *buf, + short width, short height, + FBAreaPtr fbarea) +{ + TDFXPtr pTDFX = TDFXPTR(pScrn); + unsigned char *psrc, *pdst; + int count; + int baseaddr; + INT32 yuvBaseAddr, yuvStride; + + /* Save these registers so I can restore them when we are done. */ + yuvBaseAddr = TDFXReadLongMMIO(pTDFX, YUVBASEADDR); + yuvStride = TDFXReadLongMMIO(pTDFX, YUVSTRIDE); + + /* Set yuvBaseAddress and yuvStride. */ + baseaddr = pTDFX->fbOffset + pTDFX->cpp * fbarea->box.x1 + pTDFX->stride * fbarea->box.y1; + TDFXWriteLongMMIO(pTDFX, YUVSTRIDE, pTDFX->stride); + TDFXWriteLongMMIO(pTDFX, YUVBASEADDR, baseaddr); + + /* Copy Y plane (twice as much Y as U or V) */ + psrc = buf; + psrc += (src_x & ~0x1) + src_y * width; + pdst = pTDFX->MMIOBase[0] + YUV_Y_BASE; + TDFXCopyData(psrc, pdst, width, 1024, src_h, src_w + (src_x & 0x1)); + + /* Copy V plane */ + psrc = buf + width * height; + psrc += (src_x >> 1) + (src_y >> 1) * (width >> 1); + pdst = pTDFX->MMIOBase[0] + YUV_V_BASE; + TDFXCopyData(psrc, pdst, width >> 1, 1024, src_h >> 1, src_w >> 1); + + /* Copy U plane */ + psrc = buf + width * height + (width >> 1) * (height >> 1); + psrc += (src_x >> 1) + (src_y >> 1) * (width >> 1); + pdst = pTDFX->MMIOBase[0] + YUV_U_BASE; + TDFXCopyData(psrc, pdst, width >> 1, 1024, src_h >> 1, src_w >> 1); + + /* IDLE until the copy finished, timeout for safety */ + for (count = 0; count < 1000; count++) + if (!((TDFXReadLongMMIO(pTDFX, STATUS) & SST_BUSY))) + break; + + /* Restore trashed registers */ + TDFXWriteLongMMIO(pTDFX, YUVBASEADDR, yuvBaseAddr); + TDFXWriteLongMMIO(pTDFX, YUVSTRIDE, yuvStride); + + /* Wait for it to happen */ + TDFXSendNOPFifo2D(pScrn); +} - xf86PurgeUnlockedOffscreenAreas(pScreen); - new_linear = xf86AllocateOffscreenLinear(pScreen, size, 4, - NULL, NULL, NULL); + +static int +TDFXPutImageTexture( + 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 + ) +{ + TDFXPtr pTDFX = TDFXPTR(pScrn); + BoxPtr pbox; + int nbox; + int format; + + /* Check the source format */ + if (id == FOURCC_YV12) format = SST_2D_FORMAT_YUYV; + else if (id == FOURCC_UYVY) format = SST_2D_FORMAT_UYVY; + else return BadAlloc; + + /* Get a buffer to store the packed YUV data */ + if (!(pTDFX->textureBuffer = TDFXAllocateMemoryArea(pScrn, pTDFX->textureBuffer, src_w, src_h))) + return BadAlloc; + + /* Pack the YUV data in offscreen memory using YUV framebuffer (0x[CDE]0000) */ + YUVPlanarToPacked (pScrn, src_x, src_y, src_h, src_w, + id, buf, width, height, + pTDFX->textureBuffer); + + /* Setup source and destination pixel formats (yuv -> rgb) */ + TDFXMakeRoom(pTDFX, 2); + DECLARE(SSTCP_SRCFORMAT|SSTCP_DSTFORMAT); + TDFXWriteLong(pTDFX, SST_2D_DSTFORMAT, pTDFX->stride|((pTDFX->cpp+1)<<16)); + TDFXWriteLong(pTDFX, SST_2D_SRCFORMAT, pTDFX->stride|((format)<<16)); + + /* Blit packed YUV data from offscreen memory, respecting clips */ +#define SRC_X1 (pTDFX->textureBuffer->box.x1) +#define SRC_Y1 (pTDFX->textureBuffer->box.y1) +#define SCALEX(dx) ((int)(((dx) * src_w) / drw_w)) +#define SCALEY(dy) ((int)(((dy) * src_h) / drw_h)) + for (nbox = REGION_NUM_RECTS(clipBoxes), + pbox = REGION_RECTS(clipBoxes); nbox > 0; nbox--, pbox++) + { + TDFXScreenToScreenYUVStretchBlit (pScrn, + SRC_X1 + SCALEX(pbox->x1 - drw_x), + SRC_Y1 + SCALEY(pbox->y1 - drw_y), + SRC_X1 + SCALEX(pbox->x2 - drw_x), + SRC_Y1 + SCALEY(pbox->y2 - drw_y), + pbox->x1, pbox->y1, + pbox->x2, pbox->y2); } - return new_linear; + /* Restore the WAX registers we trashed */ + TDFXMakeRoom(pTDFX, 2); + DECLARE(SSTCP_SRCFORMAT|SSTCP_DSTFORMAT); + TDFXWriteLong(pTDFX, SST_2D_DSTFORMAT, pTDFX->sst2DDstFmtShadow); + TDFXWriteLong(pTDFX, SST_2D_SRCFORMAT, pTDFX->sst2DSrcFmtShadow); + + /* Wait for it to happen */ + TDFXSendNOPFifo2D(pScrn); + + return Success; +} + + +/* + * COMMON DRAWING FUNCTIONS + */ + +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; +} + +/* + * OVERLAY DRAWING FUNCTIONS + */ + + +static void +TDFXResetVideoOverlay(ScrnInfoPtr pScrn) +{ + TDFXPtr pTDFX = TDFXPTR(pScrn); + TDFXPortPrivPtr pPriv = pTDFX->overlayAdaptor->pPortPrivates[0].ptr; + + /* reset the video */ + pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK; + pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg); + pTDFX->writeLong(pTDFX, RGBMAXDELTA, 0x0080808); + pTDFX->writeLong(pTDFX, VIDCHROMAMIN, pPriv->colorKey); + pTDFX->writeLong(pTDFX, VIDCHROMAMAX, pPriv->colorKey); +} + + +static void +TDFXStopVideoOverlay(ScrnInfoPtr pScrn, pointer data, Bool cleanup) +{ + TDFXPtr pTDFX = TDFXPTR(pScrn); + TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data; + + REGION_EMPTY(pScrn->pScreen, &pPriv->clip); + + if(cleanup) { + if(pPriv->videoStatus & CLIENT_VIDEO_ON) { + pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK; + pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg); + } + if(pTDFX->overlayBuffer) { + xf86FreeOffscreenLinear(pTDFX->overlayBuffer); + pTDFX->overlayBuffer = NULL; + } + pPriv->videoStatus = 0; + } else { + if(pPriv->videoStatus & CLIENT_VIDEO_ON) { + pPriv->videoStatus |= OFF_TIMER; + pPriv->offTime = currentTime.milliseconds + OFF_DELAY; + } + } } + static void -TDFXDisplayVideo( +TDFXDisplayVideoOverlay( ScrnInfoPtr pScrn, int id, int offset, @@ -560,31 +842,30 @@ TDFXDisplayVideo( short drw_w, short drw_h ){ TDFXPtr pTDFX = TDFXPTR(pScrn); - TDFXPortPrivPtr pPriv = pTDFX->adaptor->pPortPrivates[0].ptr; + TDFXPortPrivPtr pPriv = pTDFX->overlayAdaptor->pPortPrivates[0].ptr; int dudx, dvdy; dudx = (src_w << 20) / drw_w; dvdy = (src_h << 20) / drw_h; offset += ((left >> 16) & ~1) << 1; - left = (left & 0x0001ffff) << 3; pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK; pTDFX->ModeReg.vidcfg |= 0x00000320; - if(drw_w != src_w) pTDFX->ModeReg.vidcfg |= (1 << 14); - if(drw_h != src_h) pTDFX->ModeReg.vidcfg |= (1 << 15); - if(id == FOURCC_UYVY) pTDFX->ModeReg.vidcfg |= (6 << 21); - else pTDFX->ModeReg.vidcfg |= (5 << 21); - if(pScrn->depth == 8) pTDFX->ModeReg.vidcfg |= (1 << 11); - if(pPriv->filterQuality) pTDFX->ModeReg.vidcfg |= (3 << 16); + if(drw_w != src_w) pTDFX->ModeReg.vidcfg |= (1 << 14); + if(drw_h != src_h) pTDFX->ModeReg.vidcfg |= (1 << 15); + if(id == FOURCC_UYVY) pTDFX->ModeReg.vidcfg |= (6 << 21); + else pTDFX->ModeReg.vidcfg |= (5 << 21); + if(pScrn->depth == 8) pTDFX->ModeReg.vidcfg |= (1 << 11); + /* can't do bilinear filtering when in 2X mode */ + if(pPriv->filterQuality && !(pTDFX->ModeReg.vidcfg & SST_VIDEO_2X_MODE_EN)) + pTDFX->ModeReg.vidcfg |= (3 << 16); pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg); - pTDFX->writeLong(pTDFX, VIDOVERLAYSTARTCOORDS, - dstBox->x1 | (dstBox->y1 << 12)); - pTDFX->writeLong(pTDFX, VIDOVERLAYENDSCREENCOORDS, - (dstBox->x2 - 1) | ((dstBox->y2 - 1) << 12)); + pTDFX->writeLong(pTDFX, VIDOVERLAYSTARTCOORDS, dstBox->x1 | (dstBox->y1 << 12)); + pTDFX->writeLong(pTDFX, VIDOVERLAYENDSCREENCOORDS, (dstBox->x2 - 1) | ((dstBox->y2 - 1) << 12)); pTDFX->writeLong(pTDFX, VIDOVERLAYDUDX, dudx); pTDFX->writeLong(pTDFX, VIDOVERLAYDUDXOFFSETSRCWIDTH, left | (src_w << 20)); pTDFX->writeLong(pTDFX, VIDOVERLAYDVDY, dvdy); @@ -599,7 +880,7 @@ TDFXDisplayVideo( static int -TDFXPutImage( +TDFXPutImageOverlay( ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, short drw_y, @@ -614,8 +895,10 @@ TDFXPutImage( TDFXPortPrivPtr pPriv = (TDFXPortPrivPtr)data; INT32 xa, xb, ya, yb; unsigned char *dst_start; - int pitch, new_size, offset, s2offset, s3offset; - int srcPitch, srcPitch2, dstPitch; + int pitch, new_size, offset; + int s2offset = 0, s3offset = 0; + int srcPitch = 0, srcPitch2 = 0; + int dstPitch; int top, left, npixels, nlines, bpp; BoxRec dstBox; CARD32 tmp; @@ -631,9 +914,6 @@ TDFXPutImage( * */ - /* make the compiler happy */ - s2offset = s3offset = srcPitch2 = 0; - if(src_w > drw_w) drw_w = src_w; if(src_h > drw_h) drw_h = src_h; @@ -649,7 +929,7 @@ TDFXPutImage( dstBox.y2 = drw_y + drw_h; if(!TDFXClipVideo(&dstBox, &xa, &xb, &ya, &yb, clipBoxes, width, height)) - return Success; + return Success; dstBox.x1 -= pScrn->frameX0; dstBox.x2 -= pScrn->frameX0; @@ -662,78 +942,71 @@ TDFXPutImage( switch(id) { case FOURCC_YV12: case FOURCC_I420: - dstPitch = ((width << 1) + 3) & ~3; - 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; + dstPitch = ((width << 1) + 3) & ~3; + 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) + 3) & ~3; - new_size = ((dstPitch * height) + bpp - 1) / bpp; - srcPitch = (width << 1); - break; + dstPitch = ((width << 1) + 3) & ~3; + new_size = ((dstPitch * height) + bpp - 1) / bpp; + srcPitch = (width << 1); + break; } - if(!(pTDFX->videoScratch = TDFXAllocateMemory(pScrn, pTDFX->videoScratch, - new_size))) - { - return BadAlloc; - } + if(!(pTDFX->overlayBuffer = TDFXAllocateMemoryLinear(pScrn, pTDFX->overlayBuffer, new_size))) + return BadAlloc; - /* copy data */ + /* copy data */ top = ya >> 16; left = (xa >> 16) & ~1; npixels = ((((xb + 0xffff) >> 16) + 1) & ~1) - left; - offset = (pTDFX->videoScratch->offset * bpp) + - (top * dstPitch) + pTDFX->fbOffset; + offset = (pTDFX->overlayBuffer->offset * bpp) + (top * dstPitch) + pTDFX->fbOffset; dst_start = pTDFX->FbBase + offset; switch(id) { case FOURCC_YV12: 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; - TDFXCopyMungedData(buf + (top * srcPitch) + left, buf + s2offset, - buf + s3offset, dst_start, srcPitch, srcPitch2, - dstPitch, nlines, npixels); - break; + 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; + TDFXCopyMungedData(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; - dst_start += left; - TDFXCopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels); - break; + left <<= 1; + buf += (top * srcPitch) + left; + nlines = ((yb + 0xffff) >> 16) - top; + dst_start += left; + TDFXCopyData(buf, dst_start, srcPitch, dstPitch, nlines, npixels << 1); + break; } - /* update cliplist */ if(!RegionsEqual(&pPriv->clip, clipBoxes)) { - REGION_COPY(pScreen, &pPriv->clip, clipBoxes); - /* draw these */ - (*pTDFX->AccelInfoRec->FillSolidRects)(pScrn, pPriv->colorKey, - GXcopy, ~0, - REGION_NUM_RECTS(clipBoxes), - REGION_RECTS(clipBoxes)); + REGION_COPY(pScreen, &pPriv->clip, clipBoxes); + (*pTDFX->AccelInfoRec->FillSolidRects)(pScrn, pPriv->colorKey, + GXcopy, ~0, + REGION_NUM_RECTS(clipBoxes), + REGION_RECTS(clipBoxes)); } - TDFXDisplayVideo(pScrn, id, offset, width, height, dstPitch, - xa, xb, ya, &dstBox, src_w, src_h, drw_w, drw_h); + TDFXDisplayVideoOverlay(pScrn, id, offset, width, height, dstPitch, xa, xb, ya, &dstBox, src_w, src_h, drw_w, drw_h); pPriv->videoStatus = CLIENT_VIDEO_ON; @@ -743,75 +1016,111 @@ TDFXPutImage( } -static int -TDFXQueryImageAttributes( - ScrnInfoPtr pScrn, - int id, - unsigned short *w, unsigned short *h, - int *pitches, int *offsets -){ - int size, tmp; - - 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; - 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; - case FOURCC_UYVY: - case FOURCC_YUY2: - default: - size = *w << 1; - if(pitches) pitches[0] = size; - size *= *h; - break; - } - - return size; -} - static void TDFXVideoTimerCallback(ScrnInfoPtr pScrn, Time time) { TDFXPtr pTDFX = TDFXPTR(pScrn); - TDFXPortPrivPtr pPriv = pTDFX->adaptor->pPortPrivates[0].ptr; + TDFXPortPrivPtr pPriv = pTDFX->overlayAdaptor->pPortPrivates[0].ptr; if(pPriv->videoStatus & TIMER_MASK) { - if(pPriv->videoStatus & OFF_TIMER) { - if(pPriv->offTime < time) { - pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK; - pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg); - pPriv->videoStatus = FREE_TIMER; - pPriv->freeTime = time + FREE_DELAY; - } - } else { /* FREE_TIMER */ - if(pPriv->freeTime < time) { - if(pTDFX->videoScratch) { - xf86FreeOffscreenLinear(pTDFX->videoScratch); - pTDFX->videoScratch = NULL; - } - pPriv->videoStatus = 0; - pTDFX->VideoTimerCallback = NULL; - } - } + if(pPriv->videoStatus & OFF_TIMER) { + if(pPriv->offTime < time) { + pTDFX->ModeReg.vidcfg &= ~VIDPROCCFGMASK; + pTDFX->writeLong(pTDFX, VIDPROCCFG, pTDFX->ModeReg.vidcfg); + pPriv->videoStatus = FREE_TIMER; + pPriv->freeTime = time + FREE_DELAY; + } + } else + if(pPriv->videoStatus & FREE_TIMER) { + if(pPriv->freeTime < time) { + if(pTDFX->overlayBuffer) { + xf86FreeOffscreenLinear(pTDFX->overlayBuffer); + pTDFX->overlayBuffer = NULL; + } + pPriv->videoStatus = 0; + pTDFX->VideoTimerCallback = NULL; + } + } } else /* shouldn't get here */ - pTDFX->VideoTimerCallback = NULL; + pTDFX->VideoTimerCallback = NULL; } -#endif /* !XvExtension */ +/* + * MEMORY MANAGEMENT + */ + + +static FBAreaPtr +TDFXAllocateMemoryArea (ScrnInfoPtr pScrn, FBAreaPtr area, int width, int height) +{ + TDFXPtr pTDFX = TDFXPTR(pScrn); + ScreenPtr pScreen; + FBAreaPtr new_area; + + if (area) { + if ((area->box.x2 - area->box.x1 >= width) && + (area->box.y2 - area->box.y1 >= height)) + return area; + + if (xf86ResizeOffscreenArea(area, width, height)) + return area; + + xf86FreeOffscreenArea(area); + } + + pScreen = screenInfo.screens[pScrn->scrnIndex]; + + new_area = xf86AllocateOffscreenArea(pScreen, width, height, pTDFX->cpp, NULL, NULL, NULL); + + if (!new_area) { + int max_width, max_height; + + xf86QueryLargestOffscreenArea(pScreen, &max_width, &max_height, pTDFX->cpp, 0, PRIORITY_EXTREME); + + if (max_width < width || max_height < height) + return NULL; + + xf86PurgeUnlockedOffscreenAreas(pScreen); + new_area = xf86AllocateOffscreenArea(pScreen, width, height, pTDFX->cpp, NULL, NULL, NULL); + } + + return new_area; +} + + +static FBLinearPtr +TDFXAllocateMemoryLinear (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, 4, NULL, NULL, NULL); + + if(!new_linear) { + int max_size; + + xf86QueryLargestOffscreenLinear(pScreen, &max_size, 4, PRIORITY_EXTREME); + + if(max_size < size) + return NULL; + + xf86PurgeUnlockedOffscreenAreas(pScreen); + new_linear = xf86AllocateOffscreenLinear(pScreen, size, 4, NULL, NULL, NULL); + } + + return new_linear; +} + diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h b/xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h index 38aa21288..f9e7e5111 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h @@ -21,7 +21,7 @@ * * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h,v 1.16 2001/02/15 11:03:58 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h,v 1.17 2001/05/04 19:05:47 dawes Exp $ */ #ifndef _TGA_H_ #define _TGA_H_ @@ -90,6 +90,7 @@ typedef struct { CARD16 line_pattern; /* for dashed lines */ int Bpp; /* bytes per pixel */ int depthflag; /* either BPP8PACKED or BPP24 */ + OptionInfoPtr Options; } TGARec, *TGAPtr; /* ?? this is a hack for initial TGA2 support */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c index b49eb7dc4..3f46b1592 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c @@ -22,7 +22,7 @@ * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> * Matthew Grossman, <mattg@oz.net> - acceleration and misc fixes */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c,v 1.53 2001/03/19 11:00:54 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c,v 1.54 2001/05/04 19:05:47 dawes Exp $ */ /* everybody includes these */ #include "xf86.h" @@ -74,7 +74,7 @@ #include "Xv.h" #endif -static OptionInfoPtr TGAAvailableOptions(int chipid, int busid); +static const OptionInfoRec * TGAAvailableOptions(int chipid, int busid); static void TGAIdentify(int flags); static Bool TGAProbe(DriverPtr drv, int flags); static Bool TGAPreInit(ScrnInfoPtr pScrn, int flags); @@ -158,7 +158,7 @@ typedef enum { OPTION_NOXAAPOLYSEGMENT } TGAOpts; -static OptionInfoRec TGAOptions[] = { +static const OptionInfoRec TGAOptions[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE }, @@ -273,8 +273,7 @@ TGAFreeRec(ScrnInfoPtr pScrn) return; } -static -OptionInfoPtr +static const OptionInfoRec * TGAAvailableOptions(int chipid, int busid) { return TGAOptions; @@ -535,23 +534,26 @@ TGAPreInit(ScrnInfoPtr pScrn, int flags) /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, TGAOptions); - if (xf86ReturnOptValBool(TGAOptions, OPTION_PCI_RETRY, FALSE)) { + if (!(pTga->Options = xalloc(sizeof(TGAOptions)))) + return FALSE; + memcpy(pTga->Options, TGAOptions, sizeof(TGAOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTga->Options); + if (xf86ReturnOptValBool(pTga->Options, OPTION_PCI_RETRY, FALSE)) { pTga->UsePCIRetry = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n"); } - if(xf86ReturnOptValBool(TGAOptions, OPTION_SYNC_ON_GREEN, FALSE)) { + if(xf86ReturnOptValBool(pTga->Options, OPTION_SYNC_ON_GREEN, FALSE)) { pTga->SyncOnGreen = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Sync-on-Green enabled\n"); } - if(xf86ReturnOptValBool(TGAOptions, OPTION_DAC_6_BIT, FALSE)) { + if(xf86ReturnOptValBool(pTga->Options, OPTION_DAC_6_BIT, FALSE)) { pTga->Dac6Bit = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "6 bit DAC enabled\n"); } - if(xf86ReturnOptValBool(TGAOptions, OPTION_NOXAAPOLYSEGMENT, FALSE)) { + if(xf86ReturnOptValBool(pTga->Options, OPTION_NOXAAPOLYSEGMENT, FALSE)) { pTga->NoXaaPolySegment = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "XAA PolySegment() disabled\n"); } @@ -610,9 +612,9 @@ TGAPreInit(ScrnInfoPtr pScrn, int flags) /* determine whether we use hardware or software cursor */ pTga->HWCursor = TRUE; - if (xf86GetOptValBool(TGAOptions, OPTION_HW_CURSOR, &pTga->HWCursor)) + if (xf86GetOptValBool(pTga->Options, OPTION_HW_CURSOR, &pTga->HWCursor)) from = X_CONFIG; - if (xf86ReturnOptValBool(TGAOptions, OPTION_SW_CURSOR, FALSE)) { + if (xf86ReturnOptValBool(pTga->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pTga->HWCursor = FALSE; } @@ -626,7 +628,7 @@ TGAPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", pTga->HWCursor ? "HW" : "SW"); - if (xf86ReturnOptValBool(TGAOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pTga->Options, OPTION_NOACCEL, FALSE)) { pTga->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } 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 c63039ad7..90bc93a6b 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.21 2000/12/12 09:07:45 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/image_accel.c,v 1.21.4.1 2001/05/24 09:37:41 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -144,11 +144,13 @@ ImageAccelInit(ScreenPtr pScreen) infoPtr->Sync = ImageSync; +#if 0 infoPtr->SetClippingRectangle = ImageSetClippingRectangle; infoPtr->DisableClipping = ImageDisableClipping; infoPtr->ClippingFlags = HARDWARE_CLIP_SOLID_FILL | HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY | HARDWARE_CLIP_MONO_8x8_FILL; +#endif #if 0 infoPtr->SolidLineFlags = NO_PLANEMASK; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h index 50bc6eff5..4b2809b7f 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h @@ -21,7 +21,7 @@ * * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h,v 1.38 2001/04/04 12:46:35 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident.h,v 1.40 2001/05/15 10:19:41 eich Exp $ */ #ifndef _TRIDENT_H_ #define _TRIDENT_H_ @@ -138,6 +138,7 @@ typedef struct { int hsync; int vsync; #endif + OptionInfoPtr Options; } TRIDENTRec, *TRIDENTPtr; typedef struct { @@ -186,6 +187,7 @@ Bool TridentHWCursorInit(ScreenPtr pScreen); int TridentFindMode(int xres, int yres, int depth); void TGUISetClock(ScrnInfoPtr pScrn, int clock, unsigned char *a, unsigned char *b); void TGUISetMCLK(ScrnInfoPtr pScrn, int clock, unsigned char *a, unsigned char *b); +void tridentSetModeBIOS(ScrnInfoPtr pScrn, DisplayModePtr mode); void TridentOutIndReg(ScrnInfoPtr pScrn, CARD32 reg, unsigned char mask, unsigned char data); unsigned char TridentInIndReg(ScrnInfoPtr pScrn, CARD32 reg); 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 95db63a9c..7d8d76131 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c @@ -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.42 2001/03/08 17:12:13 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_dac.c,v 1.45.2.1 2001/05/23 20:33:41 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -153,6 +153,7 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode) int clock = pTrident->currentClock; CARD8 protect; Bool fullSize = FALSE; + Bool isShadow = FALSE; vgaHWPtr hwp = VGAHWPTR(pScrn); vgaRegPtr regp = &hwp->ModeReg; @@ -285,6 +286,7 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode) || (pReg->tridentRegs3CE[VertStretch] & 1)); pReg->tridentRegs3CE[CyberControl] |= 0x81; xf86DrvMsgVerb(pScrn->scrnIndex,X_INFO,1,"Shadow on\n"); + isShadow = TRUE; } else { pReg->tridentRegs3CE[CyberControl] &= 0x7E; xf86DrvMsgVerb(pScrn->scrnIndex,X_INFO,1,"Shadow off\n"); @@ -293,6 +295,7 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode) if (pTrident->CyberShadow) { pReg->tridentRegs3CE[CyberControl] &= 0x7E; + isShadow = FALSE; xf86DrvMsgVerb(pScrn->scrnIndex,X_INFO,1,"Forcing Shadow off\n"); } @@ -362,8 +365,48 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode) } } + /* Calculate skew offsets for video overlay */ + { + int HTotal, HSyncStart; + int VTotal, VSyncStart; + int h_off = 0; + int v_off = 0; + + if (isShadow) { + HTotal = pReg->tridentRegs3x4[0] << 3; + VTotal = pReg->tridentRegs3x4[6] + | ((pReg->tridentRegs3x4[7] & (1<<0)) << 8) + | ((pReg->tridentRegs3x4[7] & (1<<5)) << 4); + HSyncStart = pReg->tridentRegs3x4[4] << 3; + VSyncStart = pReg->tridentRegs3x4[0x10] + | ((pReg->tridentRegs3x4[7] & (1<<2)) << 6) + | ((pReg->tridentRegs3x4[7] & (1<<7)) << 2); + if (pTrident->lcdMode != 0xff) { + h_off = (LCD[pTrident->lcdMode].display_x + - pScrn->currentMode->HDisplay) >> 1; + v_off = (LCD[pTrident->lcdMode].display_y + - pScrn->currentMode->VDisplay) >> 1; + } + } else { + HTotal = regp->CRTC[0] << 3; + VTotal = regp->CRTC[6] + | ((regp->CRTC[7] & (1<<0)) << 8) + | ((regp->CRTC[7] & (1<<5)) << 4); + HSyncStart = regp->CRTC[4] << 3;; + VSyncStart = regp->CRTC[0x10] + | ((regp->CRTC[7] & (1<<2)) << 6) + | ((regp->CRTC[7] & (1<<7)) << 2); + } + pTrident->hsync = (HTotal - HSyncStart) + 23 + h_off; + pTrident->vsync = (VTotal - VSyncStart) - 2 + v_off; + /* a little more skew for the Blade series */ + if (pTrident->Chipset >= BLADE3D) pTrident->hsync -= 6; + } + /* Enable Chipset specific options */ switch (pTrident->Chipset) { + case CYBERBLADEXP: + case CYBERBLADEXPm: case CYBERBLADEI7: case CYBERBLADEI7D: case CYBERBLADEI1: @@ -381,6 +424,7 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode) case CYBER9397: case IMAGE975: case IMAGE985: + case CYBER9388: if (pScrn->bitsPerPixel >= 8) pReg->tridentRegs3CE[MiscExtFunc] |= 0x10; if (!pReg->tridentRegs3x4[PreEndControl]) @@ -389,7 +433,6 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode) pReg->tridentRegs3x4[PreEndFetch] = 0xFF; /* Fall Through */ case PROVIDIA9685: - case CYBER9388: case CYBER9385: pReg->tridentRegs3x4[Enhancement0] = 0x40; /* Fall Through */ @@ -543,6 +586,12 @@ TridentInit(ScrnInfoPtr pScrn, DisplayModePtr mode) pReg->tridentRegs3x4[PCIReg] &= 0xF9; } } + + /* Video */ + pReg->tridentRegs3C4[SSetup] = 0x00; + pReg->tridentRegs3C4[SKey] = 0x00; + pReg->tridentRegs3C4[SPKey] = 0x00; + /* restore */ OUTB(0x3C4, 0x11); OUTB(0x3C5, protect); @@ -563,10 +612,9 @@ TridentRestore(ScrnInfoPtr pScrn, TRIDENTRegPtr tridentReg) OUTB(0x3C4, Protection); OUTB(0x3C5, 0x92); } -#ifdef NOTYET - if (pTrident->doInit) { +#if 0 + if (pTrident->doInit && pTrident->Int10) { OUTW_3CE(BiosReg); - } #endif /* Goto New Mode */ @@ -600,6 +648,9 @@ TridentRestore(ScrnInfoPtr pScrn, TRIDENTRegPtr tridentReg) OUTW_3CE(MiscIntContReg); OUTW_3CE(MiscExtFunc); OUTW_3x4(Offset); + OUTW_3C4(SSetup); + OUTW_3C4(SKey); + OUTW_3C4(SPKey); OUTW_3x4(PreEndControl); OUTW_3x4(PreEndFetch); if (pTrident->Chipset >= PROVIDIA9685) OUTW_3x4(Enhancement0); @@ -700,6 +751,9 @@ TridentSave(ScrnInfoPtr pScrn, TRIDENTRegPtr tridentReg) INB_3x4(GraphEngReg); INB_3x4(PCIReg); INB_3x4(PCIRetry); + INB_3C4(SSetup); + INB_3C4(SKey); + INB_3C4(SPKey); INB_3x4(PreEndControl); INB_3x4(PreEndFetch); if (pTrident->Chipset >= PROVIDIA9685) INB_3x4(Enhancement0); 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 8fead5426..9b10afab3 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c @@ -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.133 2001/04/26 15:07:44 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_driver.c,v 1.136 2001/05/15 10:19:41 eich Exp $ */ #include "xf1bpp.h" #include "xf4bpp.h" @@ -68,7 +68,7 @@ #include "xf86xv.h" #endif -static OptionInfoPtr TRIDENTAvailableOptions(int chipid, int busid); +static const OptionInfoRec * TRIDENTAvailableOptions(int chipid, int busid); static void TRIDENTIdentify(int flags); static Bool TRIDENTProbe(DriverPtr drv, int flags); static Bool TRIDENTPreInit(ScrnInfoPtr pScrn, int flags); @@ -218,7 +218,7 @@ typedef enum { OPTION_CYBER_STRETCH } TRIDENTOpts; -static OptionInfoRec TRIDENTOptions[] = { +static const OptionInfoRec TRIDENTOptions[] = { { OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_PCI_RETRY, "PciRetry", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, @@ -499,6 +499,7 @@ static const char *shadowSymbols[] = { static const char *vbeSymbols[] = { "VBEInit", "vbeDoEDID", + "vbeFree", NULL }; @@ -633,8 +634,7 @@ TRIDENTBlockHandler ( } } -static -OptionInfoPtr +static const OptionInfoRec * TRIDENTAvailableOptions(int chipid, int busid) { return TRIDENTOptions; @@ -1047,7 +1047,7 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) pTrident->Linear = FALSE; } } - + if (flags & PROBE_DETECT) { TRIDENTProbeDDC(pScrn, pTrident->pEnt->index); return TRUE; @@ -1124,13 +1124,6 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) vgaHWGetIOBase(VGAHWPTR(pScrn)); vgaIOBase = VGAHWPTR(pScrn)->IOBase; - if (!xf86IsPc98()) { - if (xf86LoadSubModule(pScrn, "int10")) { - xf86DrvMsg(pScrn->scrnIndex,X_INFO,"Initializing int10\n"); - pTrident->Int10 = xf86InitInt10(pTrident->pEnt->index); - } - } - xf86SetOperatingState(RES_SHARED_VGA, pTrident->pEnt->index, ResUnusedOpr); /* The ramdac module should be loaded here when needed */ @@ -1181,7 +1174,10 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, TRIDENTOptions); + if (!(pTrident->Options = xalloc(sizeof(TRIDENTOptions)))) + return FALSE; + memcpy(pTrident->Options, TRIDENTOptions, sizeof(TRIDENTOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTrident->Options); /* Set the bits per RGB for 8bpp mode */ if (pScrn->depth <= 8) { @@ -1189,7 +1185,7 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) /* Default to 8 */ pScrn->rgbBits = 6; #if 0 - if (xf86GetOptValInteger(TRIDENTOptions, OPTION_RGB_BITS, + if (xf86GetOptValInteger(pTrident->Options, OPTION_RGB_BITS, &pScrn->rgbBits)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Bits per RGB set to %d\n", pScrn->rgbBits); @@ -1198,26 +1194,24 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) } from = X_DEFAULT; pTrident->HWCursor = TRUE; - if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_SW_CURSOR, FALSE)) { + if (xf86ReturnOptValBool(pTrident->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pTrident->HWCursor = FALSE; } - xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", - pTrident->HWCursor ? "HW" : "SW"); - if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pTrident->Options, OPTION_NOACCEL, FALSE)) { pTrident->NoAccel = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } - if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_PCI_RETRY, FALSE)) { + if (xf86ReturnOptValBool(pTrident->Options, OPTION_PCI_RETRY, FALSE)) { pTrident->UsePCIRetry = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n"); } pTrident->UsePCIBurst = TRUE; - if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_NOPCIBURST, FALSE)) { + if (xf86ReturnOptValBool(pTrident->Options, OPTION_NOPCIBURST, FALSE)) { pTrident->UsePCIBurst = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI Burst disbled\n"); } - if(xf86GetOptValInteger(TRIDENTOptions, OPTION_VIDEO_KEY, + if(xf86GetOptValInteger(pTrident->Options, OPTION_VIDEO_KEY, &(pTrident->videoKey))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n", pTrident->videoKey); @@ -1227,11 +1221,11 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) (((pScrn->mask.blue >> pScrn->offset.blue) - 1) << pScrn->offset.blue); } - if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_NOMMIO, FALSE)) { + if (xf86ReturnOptValBool(pTrident->Options, OPTION_NOMMIO, FALSE)) { pTrident->NoMMIO = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MMIO Disabled\n"); } - if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_MMIO_ONLY, FALSE)) { + if (xf86ReturnOptValBool(pTrident->Options, OPTION_MMIO_ONLY, FALSE)) { if (pTrident->NoMMIO) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "MMIO only cannot be set" " with NoMMIO\n"); @@ -1240,22 +1234,22 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MMIO Disabled\n"); } } - if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_CYBER_SHADOW, FALSE)) { + if (xf86ReturnOptValBool(pTrident->Options, OPTION_CYBER_SHADOW, FALSE)) { pTrident->CyberShadow = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Cyber Shadow enabled\n"); } - if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_CYBER_STRETCH, FALSE)) { + if (xf86ReturnOptValBool(pTrident->Options, OPTION_CYBER_STRETCH, FALSE)) { pTrident->CyberStretch = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Cyber Stretch enabled\n"); } pTrident->MUXThreshold = 160000; /* 160MHz */ - if (xf86GetOptValInteger(TRIDENTOptions, OPTION_MUX_THRESHOLD, + if (xf86GetOptValInteger(pTrident->Options, OPTION_MUX_THRESHOLD, &pTrident->MUXThreshold)) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MUX Threshold set to %d\n", pTrident->MUXThreshold); } - if (xf86ReturnOptValBool(TRIDENTOptions, OPTION_SHADOW_FB, FALSE)) { + if (xf86ReturnOptValBool(pTrident->Options, OPTION_SHADOW_FB, FALSE)) { if (!pTrident->Linear) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Ignoring Option SHADOW_FB" " in non-Linear Mode\n"); @@ -1270,7 +1264,7 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) } } pTrident->Rotate = 0; - if ((s = xf86GetOptValString(TRIDENTOptions, OPTION_ROTATE))) { + if ((s = xf86GetOptValString(pTrident->Options, OPTION_ROTATE))) { if (!pTrident->Linear) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Ignoring Option ROTATE " "in non-Linear Mode\n"); @@ -1356,10 +1350,11 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) * PIO access will be blocked * when MMIO is turned on! */ + if (xf86LoadSubModule(pScrn, "vbe")) { xf86MonPtr pMon; vbeInfoPtr pVbe; - pVbe = VBEInit(pTrident->Int10, pTrident->pEnt->index); + pVbe = VBEInit(NULL,pTrident->pEnt->index); pMon = vbeDoEDID(pVbe, NULL); vbeFree(pVbe); if (pMon) { @@ -1720,6 +1715,7 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) ramtype = "SGRAM"; pTrident->HasSGRAM = TRUE; pTrident->NoAccel = TRUE; /* Disable acceleration */ + pTrident->HWCursor = FALSE; /* pTrident->IsCyber = TRUE; */ Support24bpp = TRUE; chipset = "Cyber/BladeXP"; @@ -1731,6 +1727,7 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) ramtype = "SGRAM"; pTrident->HasSGRAM = TRUE; pTrident->NoAccel = TRUE; /* Disable acceleration */ + pTrident->HWCursor = FALSE; pTrident->IsCyber = TRUE; Support24bpp = TRUE; chipset = "CyberBlade/XPm"; @@ -1738,6 +1735,8 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) pTrident->frequency = NTSC; break; } + xf86DrvMsg(pScrn->scrnIndex, from, "Using %s cursor\n", + pTrident->HWCursor ? "HW" : "SW"); if (!pScrn->progClock) { pScrn->numClocks = NoClocks; @@ -1844,11 +1843,11 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) OUTB(0x3CE, FPConfig); pTrident->lcdActive = (INB(0x3CF) & 0x10); } - + pTrident->MCLK = 0; mclk = CalculateMCLK(pScrn); xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Memory Clock is %3.2f MHz\n", mclk); - if (xf86GetOptValFreq(TRIDENTOptions, OPTION_SETMCLK, OPTUNITS_MHZ, + if (xf86GetOptValFreq(pTrident->Options, OPTION_SETMCLK, OPTUNITS_MHZ, &real)) { pTrident->MCLK = (int)(real * 1000.0); xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Setting new Memory Clock to %3.2f MHz\n", @@ -2112,6 +2111,7 @@ TRIDENTPreInit(ScrnInfoPtr pScrn, int flags) TRIDENTUnmapMem(pScrn); } + pTrident->FbMapSize = pScrn->videoRam * 1024; pScrn->racMemFlags = RAC_FB | RAC_COLORMAP | RAC_CURSOR | RAC_VIEWPORT; @@ -2279,26 +2279,17 @@ 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 */ if (!vgaHWInit(pScrn, mode)) return FALSE; pScrn->vtSema = TRUE; - - /* Program the registers */ - vgaHWProtect(pScrn, TRUE); - vgaReg = &hwp->ModeReg; - tridentReg = &pTrident->ModeReg; - - vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE); - /* - * TridentInit() has to modified registers + * We used to do this at a later time. + * Now since READOUT isn't defined any more + * we do it here. + * The original NOTE read: + * TridentInit() has to modify registers * that have already been set by vgaHWRestore(). * So we call it _after_ vgaHWRestore() has * programmed these registers. @@ -2311,6 +2302,13 @@ TRIDENTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) return FALSE; } + /* Program the registers */ + vgaHWProtect(pScrn, TRUE); + vgaReg = &hwp->ModeReg; + tridentReg = &pTrident->ModeReg; + + vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE); + if (pScrn->progClock) TridentRestore(pScrn, tridentReg); else @@ -2397,6 +2395,13 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (!TRIDENTMapMem(pScrn)) return FALSE; + if (!xf86IsPc98()) { + if (xf86LoadSubModule(pScrn, "int10")) { + xf86DrvMsg(pScrn->scrnIndex,X_INFO,"Initializing int10\n"); + pTrident->Int10 = xf86InitInt10(pTrident->pEnt->index); + } + } + hwp = VGAHWPTR(pScrn); if (IsPciCard && UseMMIO) { @@ -2418,7 +2423,7 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) */ if (IsPciCard && xf86IsPc98()) { PC98TRIDENTInit(pScrn); - } + } else tridentSetModeBIOS(pScrn,pScrn->currentMode); /* Initialise the first mode */ if (!TRIDENTModeInit(pScrn, pScrn->currentMode)) @@ -2449,8 +2454,10 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), - pScrn->rgbBits, pScrn->defaultVisual)) + pScrn->rgbBits, pScrn->defaultVisual)) { + xf86FreeInt10(pTrident->Int10); return FALSE; + } miSetPixmapDepths (); @@ -2509,9 +2516,10 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) ret = FALSE; break; } - if (!ret) + if (!ret) { + xf86FreeInt10(pTrident->Int10); return FALSE; - + } if (pScrn->bitsPerPixel > 8) { /* Fixup RGB ordering */ visual = pScreen->visuals + pScreen->numVisuals; @@ -2544,9 +2552,10 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Setup the vga banking variables */ pBankInfo = xnfcalloc(sizeof(miBankInfoRec),1); - if (pBankInfo == NULL) + if (pBankInfo == NULL) { + xf86FreeInt10(pTrident->Int10); return FALSE; - + } pBankInfo->pBankA = pTrident->FbBase; pBankInfo->pBankB = pTrident->FbBase; pBankInfo->BankSize = 0x10000; @@ -2562,6 +2571,7 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->displayWidth, pBankInfo)) { xfree(pBankInfo); pBankInfo = NULL; + xf86FreeInt10(pTrident->Int10); return FALSE; } } @@ -2599,13 +2609,15 @@ TRIDENTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } /* Initialise default colourmap */ - if (!miCreateDefColormap(pScreen)) + if (!miCreateDefColormap(pScreen)) { + xf86FreeInt10(pTrident->Int10); return FALSE; - + } if(!xf86HandleColormaps(pScreen, 256, 6, TridentLoadPalette, - TridentSetOverscan, CMAP_RELOAD_ON_MODE_SWITCH|CMAP_PALETTED_TRUECOLOR)) + TridentSetOverscan, CMAP_RELOAD_ON_MODE_SWITCH|CMAP_PALETTED_TRUECOLOR)) { + xf86FreeInt10(pTrident->Int10); return FALSE; - + } if(pTrident->ShadowFB) { if(pTrident->Rotate) { if (!pTrident->PointerMoved) { @@ -2811,6 +2823,7 @@ TRIDENTCloseScreen(int scrnIndex, ScreenPtr pScreen) if(pTrident->BlockHandler) pScreen->BlockHandler = pTrident->BlockHandler; + xf86FreeInt10(pTrident->Int10); pScreen->CloseScreen = pTrident->CloseScreen; return (*pScreen->CloseScreen)(scrnIndex, pScreen); } @@ -3163,3 +3176,38 @@ PC98TRIDENT96xxDisable(ScrnInfoPtr pScrn) outb(0x6A, 0x06); outb(0x68, 0x0F); } + + +/* + * This is a terrible hack! If we are on a notebook in a stretched + * mode and don't want full screen we use the BIOS to set an unstreched + * mode. + */ +void +tridentSetModeBIOS(ScrnInfoPtr pScrn, DisplayModePtr mode) +{ + TRIDENTPtr pTrident = TRIDENTPTR(pScrn); + if (pTrident->IsCyber && pTrident->lcdMode) { + int i = pTrident->lcdMode; + if ((pScrn->currentMode->HDisplay != LCD[i].display_x) /* !fullsize? */ + || (pScrn->currentMode->VDisplay != LCD[i].display_y)) { + if (pTrident->lcdActive) { /* LCD Active ?*/ + int h_str, v_str; + + OUTB(0x3CE,HorStretch); h_str = INB(0x3CF) & 0x01; + OUTB(0x3CE,VertStretch); v_str = INB(0x3CF) & 0x01; + if (h_str || v_str) { + OUTB(0x3C4, 0x11); OUTB(0x3C5, 0x92); + OUTW(0x3CE, BiosReg ); + pTrident->Int10->ax = 0x3; + pTrident->Int10->num = 0x10; + if (IsPciCard && UseMMIO) + TRIDENTDisableMMIO(pScrn); + xf86ExecX86int10(pTrident->Int10); + if (IsPciCard && UseMMIO) + TRIDENTEnableMMIO(pScrn); + } + } + } + } +} 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 7c07b73ff..d38082a01 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h @@ -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.18 2000/12/07 19:03:40 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_regs.h,v 1.19 2001/05/15 11:08:40 alanh Exp $ */ #define DEBUG 1 @@ -44,6 +44,9 @@ #define MCLKHigh 0x17 #define ClockLow 0x18 #define ClockHigh 0x19 +#define SSetup 0x20 +#define SKey 0x37 +#define SPKey 0x57 /* 3x4 */ #define Offset 0x13 diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c index 6c8e301fe..5b028de07 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c @@ -21,7 +21,7 @@ * * 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 $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c,v 1.4.2.2 2001/05/24 09:37:41 alanh Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -81,10 +81,11 @@ void TRIDENTInitVideo(ScreenPtr pScreen) TRIDENTPtr pTrident = TRIDENTPTR(pScrn); int num_adaptors; - if (!pTrident->NoAccel) { - newAdaptor = TRIDENTSetupImageVideo(pScreen); - TRIDENTInitOffscreenImages(pScreen); - } + if (pTrident->NoAccel || !pTrident->AccelInfoRec->SetupForSolidFill) + return; + + newAdaptor = TRIDENTSetupImageVideo(pScreen); + TRIDENTInitOffscreenImages(pScreen); num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); @@ -224,7 +225,7 @@ void TRIDENTResetVideo(ScrnInfoPtr pScrn) blue = (pPriv->colorKey & pScrn->mask.blue) >> pScrn->offset.blue; switch (pScrn->depth) { case 15: - tmp = (red << 11) | (green << 6) | (blue); + tmp = (red << 10) | (green << 5) | (blue); OUTW(0x3C4, (tmp & 0xff) << 8 | 0x50); OUTW(0x3C4, (tmp & 0xff00) | 0x51); OUTW(0x3C4, 0x0052); @@ -242,9 +243,9 @@ void TRIDENTResetVideo(ScrnInfoPtr pScrn) OUTW(0x3C4, 0x0056); break; case 24: - OUTW(0x3C4, (red<<8) | 0x50); + OUTW(0x3C4, (blue<<8) | 0x50); OUTW(0x3C4, (green<<8) | 0x51); - OUTW(0x3C4, (blue<<8) | 0x52); + OUTW(0x3C4, (red<<8) | 0x52); OUTW(0x3C4, 0xFF54); OUTW(0x3C4, 0xFF55); OUTW(0x3C4, 0xFF56); @@ -293,10 +294,7 @@ TRIDENTSetupImageVideo(ScreenPtr pScreen) adapt->PutImage = TRIDENTPutImage; adapt->QueryImageAttributes = TRIDENTQueryImageAttributes; - if ((pScrn->depth == 15) || (pScrn->depth == 24)) - pPriv->colorKey = 0; /* FIXME */ - else - pPriv->colorKey = pTrident->videoKey; + pPriv->colorKey = pTrident->videoKey & ((1 << pScrn->depth) - 1); pPriv->videoStatus = 0; /* gotta uninit this someplace */ @@ -455,6 +453,7 @@ TRIDENTStopVideo(ScrnInfoPtr pScrn, pointer data, Bool exit) if(pPriv->videoStatus & CLIENT_VIDEO_ON) { pPriv->videoStatus |= OFF_TIMER; pPriv->offTime = currentTime.milliseconds + OFF_DELAY; + pTrident->VideoTimerCallback = TRIDENTVideoTimerCallback; } } } @@ -485,7 +484,7 @@ TRIDENTSetPortAttribute( blue = (pPriv->colorKey & pScrn->mask.blue) >> pScrn->offset.blue; switch (pScrn->depth) { case 15: - tmp = (red << 11) | (green << 6) | (blue); + tmp = (red << 10) | (green << 5) | (blue); OUTW(0x3C4, (tmp&0xff)<<8 | 0x50); OUTW(0x3C4, (tmp&0xff00) | 0x51); OUTW(0x3C4, 0x0052); @@ -497,9 +496,9 @@ TRIDENTSetPortAttribute( OUTW(0x3C4, 0x0052); break; case 24: - OUTW(0x3C4, (red<<8) | 0x50); + OUTW(0x3C4, (blue<<8) | 0x50); OUTW(0x3C4, (green<<8) | 0x51); - OUTW(0x3C4, (blue<<8) | 0x52); + OUTW(0x3C4, (red<<8) | 0x52); break; } } @@ -660,15 +659,11 @@ TRIDENTDisplayVideo( 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); @@ -678,6 +673,8 @@ TRIDENTDisplayVideo( OUTW(vgaIOBase + 4, (ty2 & 0xff) <<8 | 0x8C); OUTW(vgaIOBase + 4, (ty2 & 0xff00) | 0x8D); + offset += (x1 >> 15) & ~0x01; + OUTW(vgaIOBase + 4, (((width<<1) & 0xff)<<8) | 0x90); OUTW(vgaIOBase + 4, ((width<<1) & 0xff00) | 0x91); OUTW(vgaIOBase + 4, ((offset>>3) & 0xff) << 8 | 0x92); @@ -690,8 +687,13 @@ TRIDENTDisplayVideo( 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; + float z; + if (pTrident->Chipset >= BLADE3D) + z = (float)src_w/(float)drw_w; + else + z = (float)drw_w/(float)src_w - 1; + zoomx1 = z; + zoomx2 = (z - (int)zoomx1 ) * 1024; OUTW(vgaIOBase + 4, (zoomx2&0xff)<<8 | 0x80); OUTW(vgaIOBase + 4, (zoomx1&0x0f)<<10 | (zoomx2&0x0300) | 0x81); } else { @@ -708,8 +710,13 @@ TRIDENTDisplayVideo( 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; + float z; + if (pTrident->Chipset >= BLADE3D) + z = (float)src_h/(float)drw_h; + else + z = (float)drw_h/(float)src_h - 1; + zoomy1 = z; + zoomy2 = (z - (int)zoomy1 ) * 1024; OUTW(vgaIOBase + 4, (zoomy2&0xff)<<8 | 0x82); OUTW(vgaIOBase + 4, (zoomy1&0x0f)<<10 | (zoomy2&0x0300) | 0x83); } else { @@ -780,7 +787,6 @@ TRIDENTPutImage( dstPitch = ((width << 1) + 15) & ~15; new_size = ((dstPitch * height) + bpp - 1) / bpp; - switch(id) { case FOURCC_YV12: case FOURCC_I420: @@ -849,8 +855,6 @@ TRIDENTPutImage( pPriv->videoStatus = CLIENT_VIDEO_ON; - pTrident->VideoTimerCallback = TRIDENTVideoTimerCallback; - return Success; } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c b/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c index e252f9757..35ef8732f 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c @@ -21,7 +21,7 @@ * * Author: Alan Hourihane, alanh@fairlite.demon.co.uk */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c,v 1.17 2001/02/15 17:59:07 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/trident/tridenthelper.c,v 1.18 2001/05/15 10:19:41 eich Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -334,3 +334,7 @@ TGUISetMCLK(ScrnInfoPtr pScrn, int clock, CARD8 *a, CARD8 *b) } } } + + + + diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h index 22b1d5649..c2959bb4d 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.35 2001/02/15 17:54:57 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h,v 1.36 2001/05/04 19:05:48 dawes Exp $ */ @@ -262,6 +262,7 @@ typedef struct { Bool DGAactive; DGAModePtr DGAModes; int DGAViewportStatus; + OptionInfoPtr Options; } TsengRec, *TsengPtr; #define TsengPTR(p) ((TsengPtr)((p)->driverPrivate)) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c index 03678251a..199082bf5 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c,v 1.16 2000/09/19 12:46:19 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c,v 1.17 2001/05/07 21:59:07 tsi Exp $ */ @@ -12,7 +12,6 @@ static void TsengSetCursorPosition(ScrnInfoPtr pScrn, int x, int y); static Bool TsengUseHWCursor(ScreenPtr pScreen, CursorPtr pCurs); static void TsengSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg); static void TsengLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *bits); -unsigned char *TsengRealizeCursor(xf86CursorInfoPtr infoPtr, CursorPtr pCurs); Bool TsengHWCursorInit(ScreenPtr pScreen) 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 7b14751eb..d61ce10ec 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.83 2001/04/06 16:51:19 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c,v 1.84 2001/05/04 19:05:48 dawes Exp $ * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -63,7 +63,7 @@ */ /* Mandatory functions */ -static OptionInfoPtr TsengAvailableOptions(int chipid, int busid); +static const OptionInfoRec * TsengAvailableOptions(int chipid, int busid); static void TsengIdentify(int flags); static Bool TsengProbe(DriverPtr drv, int flags); static Bool TsengPreInit(ScrnInfoPtr pScrn, int flags); @@ -181,7 +181,7 @@ typedef enum { OPTION_SET_MCLK } TsengOpts; -static OptionInfoRec TsengOptions[] = +static const OptionInfoRec TsengOptions[] = { {OPTION_HIBIT_HIGH, "hibit_high", OPTV_BOOLEAN, {0}, FALSE}, @@ -387,8 +387,7 @@ TsengPCI2Type(ScrnInfoPtr pScrn, int ChipID) return TRUE; } -static -OptionInfoPtr +static const OptionInfoRec * TsengAvailableOptions(int chipid, int busid) { return TsengOptions; @@ -1206,14 +1205,14 @@ TsengProcessHibit(ScrnInfoPtr pScrn) TsengPtr pTseng = TsengPTR(pScrn); PDEBUG(" TsengProcessHibit\n"); - if (xf86IsOptionSet(TsengOptions, OPTION_HIBIT_HIGH)) { - if (xf86IsOptionSet(TsengOptions, OPTION_HIBIT_LOW)) { + if (xf86IsOptionSet(pTseng->Options, OPTION_HIBIT_HIGH)) { + if (xf86IsOptionSet(pTseng->Options, OPTION_HIBIT_LOW)) { xf86Msg(X_ERROR, "\nOptions \"hibit_high\" and \"hibit_low\" are incompatible;\n"); xf86Msg(X_ERROR, " specify only one (not both) in XFree86 configuration file\n"); return FALSE; } pTseng->save_divide = 0x40; - } else if (xf86IsOptionSet(TsengOptions, OPTION_HIBIT_HIGH)) { + } else if (xf86IsOptionSet(pTseng->Options, OPTION_HIBIT_HIGH)) { pTseng->save_divide = 0; } else { from = X_PROBED; @@ -1249,13 +1248,16 @@ TsengProcessOptions(ScrnInfoPtr pScrn) xf86CollectOptions(pScrn, NULL); /* Process the options */ - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, TsengOptions); + if (!(pTseng->Options = xalloc(sizeof(TsengOptions)))) + return FALSE; + memcpy(pTseng->Options, TsengOptions, sizeof(TsengOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTseng->Options); from = X_DEFAULT; pTseng->HWCursor = FALSE; /* default */ - if (xf86GetOptValBool(TsengOptions, OPTION_HW_CURSOR, &pTseng->HWCursor)) + if (xf86GetOptValBool(pTseng->Options, OPTION_HW_CURSOR, &pTseng->HWCursor)) from = X_CONFIG; - if (xf86ReturnOptValBool(TsengOptions, OPTION_SW_CURSOR, FALSE)) { + if (xf86ReturnOptValBool(pTseng->Options, OPTION_SW_CURSOR, FALSE)) { from = X_CONFIG; pTseng->HWCursor = FALSE; } @@ -1271,7 +1273,7 @@ TsengProcessOptions(ScrnInfoPtr pScrn) if (pScrn->bitsPerPixel >= 8) { if (pTseng->ChipType != TYPE_ET4000) pTseng->UseAccel = TRUE; - if (xf86ReturnOptValBool(TsengOptions, OPTION_NOACCEL, FALSE)) { + if (xf86ReturnOptValBool(pTseng->Options, OPTION_NOACCEL, FALSE)) { pTseng->UseAccel = FALSE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Acceleration disabled\n"); } @@ -1279,30 +1281,30 @@ TsengProcessOptions(ScrnInfoPtr pScrn) pTseng->UseAccel = FALSE; /* 1bpp and 4bpp are always non-accelerated */ pTseng->SlowDram = FALSE; - if (xf86IsOptionSet(TsengOptions, OPTION_SLOW_DRAM)) { + if (xf86IsOptionSet(pTseng->Options, OPTION_SLOW_DRAM)) { pTseng->SlowDram = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using slow DRAM access\n"); } pTseng->MedDram = FALSE; - if (xf86IsOptionSet(TsengOptions, OPTION_MED_DRAM)) { + if (xf86IsOptionSet(pTseng->Options, OPTION_MED_DRAM)) { pTseng->MedDram = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using Medium-speed DRAM access\n"); } pTseng->FastDram = FALSE; - if (xf86IsOptionSet(TsengOptions, OPTION_FAST_DRAM)) { + if (xf86IsOptionSet(pTseng->Options, OPTION_FAST_DRAM)) { pTseng->FastDram = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using fast DRAM access\n"); } if ((pTseng->SetW32Interleave = - xf86GetOptValBool(TsengOptions, OPTION_W32_INTERLEAVE, &pTseng->W32Interleave)) ) + xf86GetOptValBool(pTseng->Options, OPTION_W32_INTERLEAVE, &pTseng->W32Interleave)) ) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forcing W32p memory interleave %s.\n", pTseng->W32Interleave ? "ON" : "OFF"); if ((pTseng->SetPCIBurst = - xf86GetOptValBool(TsengOptions, OPTION_PCI_BURST, &pTseng->PCIBurst)) ) + xf86GetOptValBool(pTseng->Options, OPTION_PCI_BURST, &pTseng->PCIBurst)) ) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Forcing PCI burst mode %s.\n", pTseng->PCIBurst ? "ON" : "OFF"); from = X_CONFIG; - if (xf86GetOptValBool(TsengOptions, OPTION_LINEAR, &pTseng->UseLinMem)) { + if (xf86GetOptValBool(pTseng->Options, OPTION_LINEAR, &pTseng->UseLinMem)) { /* check if linear mode is allowed */ if (pTseng->UseLinMem) { if (!CHIP_SUPPORTS_LINEAR) { @@ -1327,17 +1329,17 @@ TsengProcessOptions(ScrnInfoPtr pScrn) (pTseng->UseLinMem) ? "linear" : "banked"); pTseng->ShowCache = FALSE; - if (xf86ReturnOptValBool(TsengOptions, OPTION_SHOWCACHE, FALSE)) { + if (xf86ReturnOptValBool(pTseng->Options, OPTION_SHOWCACHE, FALSE)) { pTseng->ShowCache = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "(for debugging only:) Visible off-screen memory\n"); } pTseng->Legend = FALSE; - if (xf86ReturnOptValBool(TsengOptions, OPTION_LEGEND, FALSE)) { + if (xf86ReturnOptValBool(pTseng->Options, OPTION_LEGEND, FALSE)) { pTseng->Legend = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using Legend pixel clock selection.\n"); } pTseng->NoClockchip = FALSE; - if (xf86ReturnOptValBool(TsengOptions, OPTION_NOCLOCKCHIP, FALSE)) { + if (xf86ReturnOptValBool(pTseng->Options, OPTION_NOCLOCKCHIP, FALSE)) { pTseng->NoClockchip = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Disabling clockchip programming.\n"); } @@ -1349,12 +1351,12 @@ TsengProcessOptions(ScrnInfoPtr pScrn) pScrn->progClock = FALSE; pTseng->UsePCIRetry = FALSE; - if (xf86ReturnOptValBool(TsengOptions, OPTION_PCI_RETRY, FALSE)) { + if (xf86ReturnOptValBool(pTseng->Options, OPTION_PCI_RETRY, FALSE)) { pTseng->UsePCIRetry = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "PCI retry enabled\n"); } pTseng->MemClk = 0; - if (xf86GetOptValFreq(TsengOptions, OPTION_SET_MCLK, OPTUNITS_MHZ, &real)) + if (xf86GetOptValFreq(pTseng->Options, OPTION_SET_MCLK, OPTUNITS_MHZ, &real)) pTseng->MemClk = (int)(real * 1000.0); return TRUE; } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/v4l/README b/xc/programs/Xserver/hw/xfree86/drivers/v4l/README index a3c981265..a21e915fd 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/v4l/README +++ b/xc/programs/Xserver/hw/xfree86/drivers/v4l/README @@ -22,18 +22,16 @@ adaptors which are usable with any target device, and initialise them on its screens with xf86XVScreenInit() as follows... - #ifdef XvExtension - { - XF86VideoAdaptorPtr *ptr; + { + XF86VideoAdaptorPtr *ptr; - int xvexts = xf86XVListGenericAdaptors(&ptr); + int xvexts = xf86XVListGenericAdaptors(&ptr); - if (xvexts) { - xf86XVScreenInit(pScreen,ptr,v4l); - } - } - #endif + if (xvexts) { + xf86XVScreenInit(pScreen, ptr, xvexts); + } + } -$XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/README,v 1.1 1999/03/28 15:32:50 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/README,v 1.2 2001/05/07 21:59:07 tsi Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c b/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c index 5fdfd4b8d..47fa2a2eb 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c @@ -2,7 +2,7 @@ * video4linux Xv Driver * based on Michael Schimek's permedia 2 driver. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c,v 1.24 2001/04/26 21:27:53 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.c,v 1.25 2001/05/04 19:05:49 dawes Exp $ */ #include "videodev.h" #include "xf86.h" @@ -27,7 +27,7 @@ static void V4LIdentify(int flags); static Bool V4LProbe(DriverPtr drv, int flags); -static OptionInfoPtr V4LAvailableOptions(int chipid, int busid); +static const OptionInfoRec * V4LAvailableOptions(int chipid, int busid); DriverRec V4L = { 40000, @@ -663,8 +663,7 @@ V4lQueryBestSize(ScrnInfoPtr pScrn, Bool motion, pPPriv->cenc,drw_w,drw_h,*p_w,*p_h)); } -static -OptionInfoPtr +static const OptionInfoRec * V4LAvailableOptions(int chipid, int busid) { return NULL; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man b/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man index 1043783aa..0e8a9cb54 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man +++ b/xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man @@ -1,25 +1,34 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man,v 1.2 2001/01/27 18:20:55 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/v4l/v4l.man,v 1.2.2.1 2001/05/29 22:28:23 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH V4L __drivermansuffix__ __vendorversion__ .SH NAME -v4l \- Video 4 Linux driver +v4l \- video4linux driver .SH SYNOPSIS .nf -.B "Section \*qDevice\*q" -.BI " Identifier \*q" devname \*q -.B " Driver \*qv4l\*q" +.B "Section \*qModule\*q" \ \ ... +.B " Load \*qv4l\*q" .B EndSection .fi .SH DESCRIPTION .B v4l -is an XFree86 driver for Video 4 Linux. -THIS MAN PAGE NEEDS TO BE FILLED IN. +is an XFree86 driver for video4linux cards. It provides a Xvideo +extention port for video overlay. Just add the driver to the module +list within the module section of your XF86Config file if you want +to use it. There are no config options. +.P +Note that the the extmod module is also required for the Xvideo +support (and lots of other extentions too). .SH SUPPORTED HARDWARE The .B v4l -driver supports... +driver works with every piece of hardware which is supported by a +video4linux (kernel-) device driver and is able to handle video +overlay. +.P +bt848/bt878-based TV cards are the most popular hardware these +days. .SH CONFIGURATION DETAILS Please refer to XF86Config(__filemansuffix__) for general configuration details. This section only covers configuration details specific to this @@ -27,4 +36,4 @@ driver. .SH "SEE ALSO" XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__) .SH AUTHORS -Authors include: ... +Authors include: Gerd Knorr <kraxel@bytesex.org> diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c index 6b7750ef4..358589096 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c @@ -25,9 +25,9 @@ * dealings in this Software without prior written authorization from * Conectiva Linux. * - * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> + * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.15 2001/04/01 14:00:12 tsi Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.c,v 1.16.2.2 2001/05/28 21:36:43 paulo Exp $ */ #include "vesa.h" @@ -43,7 +43,7 @@ #include "xf86cmap.h" /* Mandatory functions */ -static OptionInfoPtr VESAAvailableOptions(int chipid, int busid); +static const OptionInfoRec * VESAAvailableOptions(int chipid, int busid); static void VESAIdentify(int flags); static Bool VESAProbe(DriverPtr drv, int flags); static Bool VESAPreInit(ScrnInfoPtr pScrn, int flags); @@ -60,6 +60,10 @@ static void VESAAdjustFrame(int scrnIndex, int x, int y, int flags); static void VESAFreeScreen(int scrnIndex, int flags); static void VESAFreeRec(ScrnInfoPtr pScrn); +static void +VESADisplayPowerManagementSet(ScrnInfoPtr pScrn, int mode, + int flags); + /* locally used functions */ static int VESAFindIsaDevice(GDevPtr dev); static Bool VESAMapVidMem(ScrnInfoPtr pScrn); @@ -124,7 +128,7 @@ typedef enum { OPTION_SHADOW_FB } VESAOpts; -static OptionInfoRec VESAOptions[] = { +static const OptionInfoRec VESAOptions[] = { { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; @@ -218,8 +222,7 @@ vesaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor) #endif -static -OptionInfoPtr +static const OptionInfoRec * VESAAvailableOptions(int chipid, int busid) { return (VESAOptions); @@ -363,7 +366,7 @@ VESAFreeRec(ScrnInfoPtr pScrn) { VESAPtr pVesa = VESAGetRec(pScrn); DisplayModePtr mode = pScrn->modes; - +#if 0 /* I am not sure if the modes will ever get freed. * Anyway, the data unknown to other modules is being freed here. */ @@ -382,6 +385,7 @@ VESAFreeRec(ScrnInfoPtr pScrn) mode = mode->next; } while (mode && mode != pScrn->modes); } +#endif xfree(pVesa->monitor); xfree(pVesa->vbeInfo); xfree(pVesa->pal); @@ -417,6 +421,11 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags) pVesa->pEnt = xf86GetEntityInfo(pScrn->entityList[0]); pVesa->device = xf86GetDevFromEntity(pScrn->entityList[0], pScrn->entityInstanceList[0]); + + /* Load vgahw module */ + if (!xf86LoadSubModule(pScrn, "vgahw")) + return (FALSE); + /* Load vbe module */ if ((pVbeModule = xf86LoadSubModule(pScrn, "vbe")) == NULL) return (FALSE); @@ -753,10 +762,13 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags) /* options */ xf86CollectOptions(pScrn, NULL); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, VESAOptions); + if (!(pVesa->Options = xalloc(sizeof(VESAOptions)))) + return FALSE; + memcpy(pVesa->Options, VESAOptions, sizeof(VESAOptions)); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pVesa->Options); /* Use shadow by default */ - if (xf86ReturnOptValBool(VESAOptions, OPTION_SHADOW_FB, TRUE)) + if (xf86ReturnOptValBool(pVesa->Options, OPTION_SHADOW_FB, TRUE)) pVesa->shadowFB = TRUE; mode = ((ModeInfoData*)pScrn->modes->Private)->data; @@ -1071,6 +1083,12 @@ VESAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScreen->CloseScreen = VESACloseScreen; pScreen->SaveScreen = VESASaveScreen; + xf86DPMSInit(pScreen, VESADisplayPowerManagementSet, 0); + + /* Report any unused options (only for the first generation) */ + if (serverGeneration == 1) + xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); + return (TRUE); } @@ -1093,17 +1111,20 @@ VESACloseScreen(int scrnIndex, ScreenPtr pScreen) ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; VESAPtr pVesa = VESAGetRec(pScrn); - VESASaveRestore(xf86Screens[scrnIndex], MODE_RESTORE); - VBESetGetPaletteData(pVesa->pVbe, TRUE, 0, 256, - pVesa->savedPal, FALSE, TRUE); - - VESAUnmapVidMem(pScrn); + if (pScrn->vtSema) { + VESASaveRestore(xf86Screens[scrnIndex], MODE_RESTORE); + VBESetGetPaletteData(pVesa->pVbe, TRUE, 0, 256, + pVesa->savedPal, FALSE, TRUE); + VESAUnmapVidMem(pScrn); + } if (pVesa->shadowPtr) { xfree(pVesa->shadowPtr); pVesa->shadowPtr = NULL; } - if (pVesa->pDGAMode) + if (pVesa->pDGAMode) { xfree(pVesa->pDGAMode); + pVesa->pDGAMode = NULL; + } pScrn->vtSema = FALSE; pScreen->CloseScreen = pVesa->CloseScreen; @@ -1627,6 +1648,15 @@ VESASaveRestore(ScrnInfoPtr pScrn, vbeSaveRestoreFunction function) return (TRUE); } +static void +VESADisplayPowerManagementSet(ScrnInfoPtr pScrn, int mode, + int flags) +{ + vgaHWDPMSSet(pScrn, mode, flags); +} + + + /*********************************************************************** * DGA stuff diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h index 1762da648..08b10a531 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h @@ -26,7 +26,7 @@ * * Authors: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.8 2001/03/22 03:10:58 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vesa/vesa.h,v 1.9 2001/05/04 19:05:49 dawes Exp $ */ #ifndef _VESA_H_ @@ -113,6 +113,7 @@ typedef struct _VESARec DGAModePtr pDGAMode; int nDGAMode; CloseScreenProcPtr CloseScreen; + OptionInfoPtr Options; } VESARec, *VESAPtr; typedef struct _ModeInfoData { diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile index 43907960f..25bcd13bb 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile @@ -4,7 +4,7 @@ XCOMM $XConsortium: Imakefile /main/6 1996/09/28 17:29:38 rws $ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile,v 1.11 2001/01/24 00:06:33 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/Imakefile,v 1.12 2001/05/16 06:48:11 keithp Exp $ @@ -19,8 +19,9 @@ OBJS = generic.o #if defined(XF86DriverSDK) INCLUDES = -I. -I../../include #else -INCLUDES = -I. -I$(SERVERSRC)/cfb -I$(XF86SRC)/xf4bpp -I$(XF86SRC)/xf1bpp \ +INCLUDES = -I. -I$(SERVERSRC)/fb -I$(XF86SRC)/xf4bpp -I$(XF86SRC)/xf1bpp \ -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi -I$(XF86SRC)/vgahw \ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render -I$(EXTINCSRC)\ -I$(XF86COMSRC) -I$(XF86OSSRC) \ -I$(SERVERSRC)/include -I$(FONTINCSRC) -I$(XINCLUDESRC)\ -I$(XF86SRC)/rac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c b/xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c index 0b579128d..327c9a0ff 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c,v 1.52 2001/02/16 01:45:46 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vga/generic.c,v 1.54 2001/05/16 06:48:11 keithp Exp $ */ /* * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. * @@ -43,10 +43,7 @@ #include "vgaHW.h" #include "xf86PciInfo.h" -#undef PSZ -#define PSZ 8 -#include "cfb.h" -#undef PSZ +#include "fb.h" #include "xf4bpp.h" #include "xf1bpp.h" @@ -74,7 +71,7 @@ /* Forward definitions */ -static OptionInfoPtr GenericAvailableOptions(int chipid, int busid); +static const OptionInfoRec * GenericAvailableOptions(int chipid, int busid); static void GenericIdentify(int); static Bool GenericProbe(DriverPtr, int); static Bool GenericPreInit(ScrnInfoPtr, int); @@ -108,7 +105,7 @@ typedef enum { OPTION_VGA_CLOCKS } GenericOpts; -static OptionInfoRec GenericOptions[] = { +static const OptionInfoRec GenericOptions[] = { { OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_VGA_CLOCKS, "VGAClocks", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } @@ -130,8 +127,10 @@ static const char *vgahwSymbols[] = { static const char *fbSymbols[] = { "xf1bppScreenInit", "xf4bppScreenInit", - "cfbScreenInit", - "mfbScreenInit", + "fbScreenInit", +#ifdef RENDER + "fbPictureInit", +#endif NULL }; @@ -218,8 +217,7 @@ GenericIdentify(int flags) GenericChipsets); } -static -OptionInfoPtr +static const OptionInfoRec * GenericAvailableOptions(int chipid, int busid) { return GenericOptions; @@ -380,6 +378,7 @@ typedef struct _GenericRec CARD8 * ShadowPtr; CARD32 ShadowPitch; CloseScreenProcPtr CloseScreen; + OptionInfoPtr Options; } GenericRec, *GenericPtr; @@ -493,13 +492,7 @@ GenericPreInit(ScrnInfoPtr pScreenInfo, int flags) { case 1: Module = "xf1bpp"; Sym = "xf1bppScreenInit"; break; case 4: Module = "xf4bpp"; Sym = "xf4bppScreenInit"; break; - case 8: Module = "cfb"; Sym = "cfbScreenInit"; break; - - default: - xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, - "Given depth (%d) is not supported by this driver.\n", - pScreenInfo->depth); - return FALSE; + default: Module = "fb"; Sym = "fbScreenInit"; break; } xf86PrintDepthBpp(pScreenInfo); @@ -579,6 +572,15 @@ GenericPreInit(ScrnInfoPtr pScreenInfo, int flags) pvgaHW->MapSize = 0x00010000; /* Standard 64kB VGA window */ vgaHWGetIOBase(pvgaHW); /* Get VGA I/O base */ + /* Deal with options */ + xf86CollectOptions(pScreenInfo, NULL); + + if (!(pGenericPriv->Options = xalloc(sizeof(GenericOptions)))) + return FALSE; + memcpy(pGenericPriv->Options, GenericOptions, sizeof(GenericOptions)); + xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options, + pGenericPriv->Options); + #ifndef __NOT_YET__ if (pScreenInfo->depth == 8) { @@ -588,11 +590,6 @@ GenericPreInit(ScrnInfoPtr pScreenInfo, int flags) } #endif - /* Deal with options */ - xf86CollectOptions(pScreenInfo, NULL); - xf86ProcessOptions(pScreenInfo->scrnIndex, pScreenInfo->options, - GenericOptions); - /* * Determine clocks. Limit them to the first four because that's all that * can be addressed. @@ -604,7 +601,7 @@ GenericPreInit(ScrnInfoPtr pScreenInfo, int flags) for (i = 0; i < pScreenInfo->numClocks; i++) pScreenInfo->clock[i] = pEnt->device->clock[i]; From = X_CONFIG; - } else if (xf86ReturnOptValBool(GenericOptions,OPTION_VGA_CLOCKS,FALSE)) { + } else if (xf86ReturnOptValBool(pGenericPriv->Options,OPTION_VGA_CLOCKS,FALSE)) { pScreenInfo->numClocks = 2; pScreenInfo->clock[0] = 25175; pScreenInfo->clock[1] = 28322; @@ -673,17 +670,14 @@ GenericPreInit(ScrnInfoPtr pScreenInfo, int flags) /* Set display resolution */ xf86SetDpi(pScreenInfo, 0, 0); - if (xf86ReturnOptValBool(GenericOptions,OPTION_SHADOW_FB,FALSE)) { + if (xf86ReturnOptValBool(pGenericPriv->Options,OPTION_SHADOW_FB,FALSE)) { pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; pGenericPriv->ShadowFB = TRUE; xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG, "Using \"Shadow Framebuffer\"\n"); - switch (pScreenInfo->depth) - { - case 1: Module = "mfb"; Sym = "mfbScreenInit"; break; - case 4: Module = "cfb"; Sym = "cfbScreenInit"; break; - } + Module = "fb"; + Sym = "fbScreenInit"; if (!xf86LoadSubModule(pScreenInfo, "shadowfb")) return FALSE; xf86LoaderReqSymLists(shadowfbSymbols, NULL); @@ -1077,6 +1071,8 @@ GenericScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScreenInfo->rgbBits, pScreenInfo->defaultVisual)) return FALSE; + miSetPixmapDepths (); + /* Initialise the framebuffer */ switch (pScreenInfo->depth) { @@ -1088,11 +1084,15 @@ GenericScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScreenInfo->virtualY); if(pGenericPriv->ShadowPtr == NULL) return FALSE; - Inited = mfbScreenInit(pScreen, pGenericPriv->ShadowPtr, - pScreenInfo->virtualX, - pScreenInfo->virtualY, - pScreenInfo->xDpi, pScreenInfo->yDpi, - pScreenInfo->displayWidth); + Inited = fbScreenInit(pScreen, pGenericPriv->ShadowPtr, + pScreenInfo->virtualX, + pScreenInfo->virtualY, + pScreenInfo->xDpi, pScreenInfo->yDpi, + pScreenInfo->displayWidth, + pScreenInfo->bitsPerPixel); +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif ShadowFBInit(pScreen, GenericRefreshArea1bpp); } else { Inited = xf1bppScreenInit(pScreen, pvgaHW->Base, @@ -1111,11 +1111,15 @@ GenericScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScreenInfo->virtualY); if(pGenericPriv->ShadowPtr == NULL) return FALSE; - Inited = cfbScreenInit(pScreen, pGenericPriv->ShadowPtr, - pScreenInfo->virtualX, - pScreenInfo->virtualY, - pScreenInfo->xDpi, pScreenInfo->yDpi, - pScreenInfo->displayWidth); + Inited = fbScreenInit(pScreen, pGenericPriv->ShadowPtr, + pScreenInfo->virtualX, + pScreenInfo->virtualY, + pScreenInfo->xDpi, pScreenInfo->yDpi, + pScreenInfo->displayWidth, + pScreenInfo->bitsPerPixel); +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif ShadowFBInit(pScreen, GenericRefreshArea4bpp); } else { Inited = xf4bppScreenInit(pScreen, pvgaHW->Base, @@ -1126,10 +1130,14 @@ GenericScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } break; case 8: - Inited = cfbScreenInit(pScreen, pvgaHW->Base, - pScreenInfo->virtualX, pScreenInfo->virtualY, - pScreenInfo->xDpi, pScreenInfo->yDpi, - pScreenInfo->displayWidth); + Inited = fbScreenInit(pScreen, pvgaHW->Base, + pScreenInfo->virtualX, pScreenInfo->virtualY, + pScreenInfo->xDpi, pScreenInfo->yDpi, + pScreenInfo->displayWidth, + pScreenInfo->bitsPerPixel); +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif break; } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile index df44030f8..0853a3bb5 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile @@ -1,4 +1,4 @@ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile,v 1.1 2001/04/05 19:29:43 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/Imakefile,v 1.2 2001/05/16 06:48:12 keithp Exp $ XCOMM XCOMM This is an Imakefile for the VMware virtual SVGA driver. XCOMM @@ -20,17 +20,17 @@ OBJS = vmware.o vmwaregc.o vmwarefs.o vmwarepolypnt.o vmwarepush.o \ INCLUDES = -I. -I../../include #else INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ - -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi -I$(XF86SRC)/int10 \ - -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \ + -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(XF86SRC)/int10 \ + -I$(XF86SRC)/xaa -I$(XF86SRC)/rac \ -I$(XF86SRC)/vgahw -I$(XF86SRC)/fbdevhw \ -I$(XF86SRC)/ramdac -I$(XF86SRC)/ddc -I$(XF86SRC)/i2c \ - -I$(SERVERSRC)/Xext -I$(XF86SRC)/xf8_32bpp\ + -I$(SERVERSRC)/Xext -I$(SERVERSRC)/render \ -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ - -I$(XF86SRC)/xf24_32bpp -I$(XF86SRC)/shadowfb -I$(EXTINCSRC) \ + -I$(XF86SRC)/shadowfb -I$(EXTINCSRC) \ -I$(XF86OSSRC)/vbe $(DRIINCLUDES) #endif -DEFINES = -DPSZ=8 $(DRIDEFINES) +DEFINES = $(DRIDEFINES) #if MakeHasPosixVariableSubstitutions SubdirLibraryRule($(OBJS)) diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c index 04ca7f8bf..f624d5af0 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c @@ -7,7 +7,7 @@ char rcsId_vmware[] = "Id: vmware.c,v 1.11 2001/02/23 02:10:39 yoel Exp $"; #endif -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c,v 1.1 2001/04/05 19:29:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.c,v 1.4 2001/05/16 06:48:12 keithp Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -23,12 +23,7 @@ char rcsId_vmware[] = #include "mibstore.h" /* backing store */ #include "micmap.h" /* mi color map */ #include "vgaHW.h" /* VGA hardware */ -#define PSZ 8 /* 8bpp */ -#include "cfb.h" -#undef PSZ -#include "cfb16.h" /* 16bpp */ -#include "cfb24.h" /* 24bpp */ -#include "cfb32.h" /* 32bpp */ +#include "fb.h" #include "xf86cmap.h" /* xf86HandleColormaps */ @@ -113,14 +108,12 @@ typedef enum { OPTION_NOACCEL } VMWAREOpts; -static OptionInfoRec VMWAREOptions[] = { +static const OptionInfoRec VMWAREOptions[] = { { OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; -#define nVMWAREOptions (sizeof(VMWAREOptions) / sizeof(VMWAREOptions[0])) - static Bool VMWAREGetRec(ScrnInfoPtr pScrn) { @@ -332,7 +325,7 @@ VMWAREIdentify(int flags) xf86PrintChipsets(VMWARE_NAME, "driver for VMware SVGA", VMWAREChipsets); } -static OptionInfoPtr +static const OptionInfoRec * VMWAREAvailableOptions(int chipid, int busid) { return VMWAREOptions; @@ -343,13 +336,16 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags) { MessageType from; VMWAREPtr pVMWARE; - OptionInfoRec options[nVMWAREOptions]; + OptionInfoPtr options; int bpp24flags; uint32 id; int i; - const char* mod; ClockRange* clockRanges; + if (flags & PROBE_DETECT) { + return FALSE; + } + if (pScrn->numEntities != 1) { return FALSE; } @@ -531,6 +527,8 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags) #endif xf86CollectOptions(pScrn, NULL); + if (!(options = xalloc(sizeof(VMWAREOptions)))) + return FALSE; memcpy(options, VMWAREOptions, sizeof(VMWAREOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); @@ -567,6 +565,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags) } pScrn->videoRam = pVMWARE->videoRam / 1024; pScrn->memPhysBase = pVMWARE->memPhysBase; + xfree(options); { Gamma zeros = { 0.0, 0.0, 0.0 }; @@ -614,17 +613,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags) pScrn->currentMode = pScrn->modes; xf86PrintModes(pScrn); xf86SetDpi(pScrn, 0, 0); - switch (pScrn->bitsPerPixel) { - case 8: mod = "cfb"; break; - case 16:mod = "cfb16"; break; - case 24:mod = "cfb24"; break; - case 32:mod = "cfb32"; break; - default: - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unexpected bpp (%d)\n", pScrn->bitsPerPixel); - VMWAREFreeRec(pScrn); - return FALSE; - } - if (mod && !xf86LoadSubModule(pScrn, mod)) { + if (!xf86LoadSubModule(pScrn, "fb")) { VMWAREFreeRec(pScrn); return FALSE; } @@ -883,68 +872,25 @@ VMWAREScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } } + miSetPixmapDepths (); + /* * Initialise the framebuffer. */ - switch (pScrn->bitsPerPixel) { -#if 0 - case 1: - ret = xf1bppScreenInit(pScreen, pVMWARE->FbBase, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth); - break; - case 4: - ret = xf4bppScreenInit(pScreen, pVMWARE->FbBase, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth); - break; -#endif - case 8: - /* - * In ScreenToPrivate, below, we register our own - * CopyPlane proc (via mfbRegisterCopyPlaneProc). - * But we can't handle all cases, so we have to stash - * away a pointer to someone who can. - */ - pVMWARE->pcfbCopyPlane = cfbCopyPlane; - ret = cfbScreenInit(pScreen, pVMWARE->FbBase + pVMWARE->fbOffset, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth); - break; - case 16: - pVMWARE->pcfbCopyPlane = cfb16CopyPlane; - ret = cfb16ScreenInit(pScreen, pVMWARE->FbBase + pVMWARE->fbOffset, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth); - break; - case 24: - pVMWARE->pcfbCopyPlane = cfb24CopyPlane; - ret = cfb24ScreenInit(pScreen, pVMWARE->FbBase + pVMWARE->fbOffset, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth); - break; - case 32: - pVMWARE->pcfbCopyPlane = cfb32CopyPlane; - ret = cfb32ScreenInit(pScreen, pVMWARE->FbBase + pVMWARE->fbOffset, - pScrn->virtualX, pScrn->virtualY, - pScrn->xDpi, pScrn->yDpi, - pScrn->displayWidth); - break; - default: - xf86DrvMsg(scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) in VMWAREScreenInit\n", - pScrn->bitsPerPixel); - ret = FALSE; - break; - } + ret = fbScreenInit (pScreen, pVMWARE->FbBase, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth, + pScrn->bitsPerPixel); + if (!ret) return FALSE; +#ifdef RENDER + fbPictureInit (pScreen, 0, 0); +#endif + /* Override the default mask/offset settings */ if (pScrn->bitsPerPixel > 8) { int i; @@ -993,23 +939,8 @@ VMWAREScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); } - /* Initialise the default colourmap */ - switch (pScrn->depth) { -#if 0 - case 1: - if (!xf1bppCreateDefColormap(pScreen)) - return FALSE; - break; - case 4: - if (!xf4bppCreateDefColormap(pScreen)) - return FALSE; - break; -#endif - default: - if (!cfbCreateDefColormap(pScreen)) - return FALSE; - break; - } + if (!fbCreateDefColormap(pScreen)) + return FALSE; if (!xf86HandleColormaps(pScreen, 256, 8, VMWARELoadPalette, NULL, @@ -1091,7 +1022,12 @@ VMWAREProbe(DriverPtr drv, int flags) numUsed = xf86MatchPciInstances(VMWARE_NAME, PCI_VENDOR_VMWARE, VMWAREChipsets, VMWAREPciChipsets, devSections, numDevSections, drv, &usedChips); - for (i = 0; i < numUsed; i++) { + xfree(devSections); + if (numUsed <= 0) + return FALSE; + if (flags & PROBE_DETECT) + foundScreen = TRUE; + else for (i = 0; i < numUsed; i++) { ScrnInfoPtr pScrn = NULL; VmwareLog(("Even some VMware SVGA PCI instances exists\n")); @@ -1115,11 +1051,8 @@ VMWAREProbe(DriverPtr drv, int flags) foundScreen = TRUE; } } - if (numUsed > 0) { - xfree(usedChips); - } + xfree(usedChips); } - xfree(devSections); return foundScreen; } @@ -1250,7 +1183,6 @@ ScreenToPrivate(ScreenPtr pScreen, ScrnInfoPtr pScrn) #endif - mfbRegisterCopyPlaneProc(pScreen, vmwareCopyPlane); pScreen->PaintWindowBackground = vmwarePaintWindow; pScreen->PaintWindowBorder = vmwarePaintWindow; pScreen->CopyWindow = vmwareCopyWindow; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h index ab42e10f1..7a169c728 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h @@ -3,7 +3,7 @@ * All Rights Reserved * Id: vmware.h,v 1.6 2001/01/30 18:13:47 bennett Exp $ * **********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h,v 1.1 2001/04/05 19:29:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmware.h,v 1.2 2001/05/16 06:48:12 keithp Exp $ */ #ifndef VMWARE_H #define VMWARE_H @@ -22,12 +22,7 @@ #include "mibstore.h" /* backing store */ #include "micmap.h" /* mi color map */ #include "vgaHW.h" /* VGA hardware */ -#define PSZ 8 /* 8bpp */ -#include "cfb.h" -#undef PSZ -#include "cfb16.h" /* 16bpp */ -#include "cfb24.h" /* 24bpp */ -#include "cfb32.h" /* 32bpp */ +#include "fb.h" #include "xf86cmap.h" /* xf86HandleColormaps */ @@ -95,9 +90,6 @@ typedef struct { uint16 indexReg, valueReg; - RegionPtr (*pcfbCopyPlane) (DrawablePtr, DrawablePtr, GCPtr, - int, int, int, int, int, int, - unsigned long); ScreenRec ScrnFuncs; /* ... */ } VMWARERec, *VMWAREPtr; @@ -631,12 +623,18 @@ void vmwarePutImage( #endif ); -void vmwareDoBitblt(DrawablePtr pSrc, -#if NeedFunctionPrototypes - DrawablePtr pDst, - int alu, RegionPtr prgnDst, DDXPointPtr pptSrc, unsigned long planemask, unsigned long bitplane -#endif - ); +void +vmwareDoBitblt(DrawablePtr pSrc, + DrawablePtr pDst, + GCPtr pGC, + BoxPtr pbox, + int nbox, + int dx, + int dy, + Bool reverse, + Bool upsidedown, + Pixel bitplane, + void *closure); RegionPtr vmwareCopyArea( #if NeedFunctionPrototypes diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwareblt.c b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwareblt.c index f081a3b31..de23b6c51 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwareblt.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwareblt.c @@ -7,76 +7,66 @@ char rcsId_vmwareblt[] = "Id: vmwareblt.c,v 1.4 2001/01/27 00:28:15 bennett Exp $"; #endif -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwareblt.c,v 1.1 2001/04/05 19:29:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwareblt.c,v 1.2 2001/05/16 06:48:12 keithp Exp $ */ #include "X.h" -#include "cfb.h" +#include "fb.h" #include "vmware.h" void -vmwareDoBitblt(DrawablePtr pSrc, - DrawablePtr pDst, - int alu, RegionPtr prgnDst, DDXPointPtr pptSrc, unsigned long planemask, unsigned long bitplane) +vmwareDoBitblt(DrawablePtr pSrc, + DrawablePtr pDst, + GCPtr pGC, + BoxPtr pbox, + int nbox, + int dx, + int dy, + Bool reverse, + Bool upsidedown, + Pixel bitplane, + void *closure) { - BoxPtr pbox; - int nbox; BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2; - DDXPointPtr pptTmp, pptNew1, pptNew2; VMWAREPtr pVMWARE; + CARD8 alu; pVMWARE = VMWAREPTR(infoFromScreen(pSrc->pScreen)); + if (pGC) + alu = pGC->alu; + else + alu = GXcopy; - pbox = REGION_RECTS(prgnDst); - nbox = REGION_NUM_RECTS(prgnDst); pboxNew1 = NULL; - pptNew1 = NULL; pboxNew2 = NULL; - pptNew2 = NULL; - if (pptSrc->y < pbox->y1) { + if (upsidedown) { if (nbox > 1) { /* keep ordering in each band, reverse order of bands */ pboxNew1 = (BoxPtr) ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); if (!pboxNew1) return; - pptNew1 = - (DDXPointPtr) ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); - if (!pptNew1) { - DEALLOCATE_LOCAL(pboxNew1); - return; - } pboxBase = pboxNext = pbox + nbox - 1; while (pboxBase >= pbox) { while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1)) pboxNext--; pboxTmp = pboxNext + 1; - pptTmp = pptSrc + (pboxTmp - pbox); while (pboxTmp <= pboxBase) { *pboxNew1++ = *pboxTmp++; - *pptNew1++ = *pptTmp++; } pboxBase = pboxNext; } pboxNew1 -= nbox; pbox = pboxNew1; - pptNew1 -= nbox; - pptSrc = pptNew1; } } - if (pptSrc->x < pbox->x1) { + if (reverse) { if (nbox > 1) { /* reverse order of rects in each band */ pboxNew2 = (BoxPtr) ALLOCATE_LOCAL(sizeof(BoxRec) * nbox); - pptNew2 = - (DDXPointPtr) ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox); - if (!pboxNew2 || !pptNew2) { - if (pptNew2) - DEALLOCATE_LOCAL(pptNew2); + if (!pboxNew2) { if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2); - if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); + if (pboxNew1) DEALLOCATE_LOCAL(pboxNew1); - } return; } pboxBase = pboxNext = pbox; @@ -84,38 +74,31 @@ vmwareDoBitblt(DrawablePtr pSrc, while ((pboxNext < pbox + nbox) && (pboxNext->y1 == pboxBase->y1)) pboxNext++; pboxTmp = pboxNext; - pptTmp = pptSrc + (pboxTmp - pbox); while (pboxTmp != pboxBase) { *pboxNew2++ = *--pboxTmp; - *pptNew2++ = *--pptTmp; } pboxBase = pboxNext; } pboxNew2 -= nbox; pbox = pboxNew2; - pptNew2 -= nbox; - pptSrc = pptNew2; } } /* Send the commands */ while (nbox--) { vmwareWriteWordToFIFO(pVMWARE, SVGA_CMD_RECT_ROP_COPY); - vmwareWriteWordToFIFO(pVMWARE, pptSrc->x); - vmwareWriteWordToFIFO(pVMWARE, pptSrc->y); + vmwareWriteWordToFIFO(pVMWARE, pbox->x1 + dx); + vmwareWriteWordToFIFO(pVMWARE, pbox->y1 + dy); vmwareWriteWordToFIFO(pVMWARE, pbox->x1); vmwareWriteWordToFIFO(pVMWARE, pbox->y1); vmwareWriteWordToFIFO(pVMWARE, pbox->x2 - pbox->x1); vmwareWriteWordToFIFO(pVMWARE, pbox->y2 - pbox->y1); - vmwareWriteWordToFIFO(pVMWARE, alu); - pptSrc++; + vmwareWriteWordToFIFO(pVMWARE, pGC->alu); pbox++; } if (pboxNew2) { - DEALLOCATE_LOCAL(pptNew2); DEALLOCATE_LOCAL(pboxNew2); } if (pboxNew1) { - DEALLOCATE_LOCAL(pptNew1); DEALLOCATE_LOCAL(pboxNew1); } } @@ -134,7 +117,7 @@ GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty) pSrcDrawable->type == DRAWABLE_WINDOW && pDstDrawable->type == DRAWABLE_WINDOW && (pGC->planemask & pVMWARE->Pmsk) == pVMWARE->Pmsk) { - void (*doBitBlt) (DrawablePtr, DrawablePtr, int, RegionPtr, DDXPointPtr, unsigned long, unsigned long); + fbCopyProc doBitBlt; BoxRec updateBB; BoxRec mouseBB; Bool hidden = pVMWARE->mouseHidden; @@ -151,9 +134,8 @@ GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty) if (!hidden) { HIDE_CURSOR_ACCEL(pVMWARE, mouseBB); } - prgn = - cfbBitBlt(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, - height, dstx, dsty, doBitBlt, 0L); + prgn = fbDoCopy (pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, + height, dstx, dsty, doBitBlt, 0, 0); if (!hidden) { SHOW_CURSOR(pVMWARE, mouseBB); } @@ -257,10 +239,9 @@ int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long bit HIDE_CURSOR(pVMWARE, mouseBB); vmwareWaitForFB(pVMWARE); pVMWARE->vmwareBBLevel++; - prgn = - pVMWARE->pcfbCopyPlane(pSrcDrawable, - pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, - bitPlane); + prgn = fbCopyPlane(pSrcDrawable, + pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, + bitPlane); pVMWARE->vmwareBBLevel--; if (pDstDrawable->type == DRAWABLE_WINDOW) { vmwareSendSVGACmdUpdate(pVMWARE, &updateBB); @@ -268,15 +249,13 @@ int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long bit SHOW_CURSOR(pVMWARE, mouseBB); } else { vmwareWaitForFB(pVMWARE); - prgn = - pVMWARE->pcfbCopyPlane(pSrcDrawable, - pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, - bitPlane); + prgn = fbCopyPlane(pSrcDrawable, + pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, + bitPlane); } } else { - prgn = - pVMWARE->pcfbCopyPlane(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); + prgn = fbCopyPlane(pSrcDrawable, pDstDrawable, + pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); } return prgn; } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwaregc.c b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwaregc.c index cad0109e6..ea23e10b0 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwaregc.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwaregc.c @@ -7,13 +7,10 @@ char rcsId_vmwaregc[] = "Id: vmwaregc.c,v 1.2 2001/01/26 23:32:16 yoel Exp $"; #endif -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwaregc.c,v 1.1 2001/04/05 19:29:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwaregc.c,v 1.2 2001/05/16 06:48:12 keithp Exp $ */ #include "X.h" -#include "cfb.h" -#include "cfb16.h" -#include "cfb24.h" -#include "cfb32.h" +#include "fb.h" #include "mi.h" #include "migc.h" #include "vmware.h" diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarerect.c b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarerect.c index 00a9517e7..1ae60ab36 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarerect.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarerect.c @@ -7,10 +7,10 @@ char rcsId_vmwarerect[] = "Id: vmwarerect.c,v 1.2 2001/01/26 23:32:16 yoel Exp $"; #endif -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarerect.c,v 1.1 2001/04/05 19:29:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarerect.c,v 1.2 2001/05/16 06:48:12 keithp Exp $ */ #include "X.h" -#include "cfb.h" +#include "fb.h" #include "vmware.h" static void @@ -93,13 +93,11 @@ accelPolyFillRect(VMWAREPtr pVMWARE, DrawablePtr pDrawable, BoxPtr pboxClippedBase; BoxPtr pextent; BoxRec stackRects[NUM_STACK_RECTS]; - cfbPrivGC *priv; int numRects; int n; int xorg, yorg; - priv = cfbGetGCPrivate(pGC); - prgnClip = cfbGetCompositeClip(pGC); + prgnClip = fbGetCompositeClip(pGC); prect = prectInit; xorg = pDrawable->x; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarewindow.c b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarewindow.c index 45bc3d75d..fee8b36ef 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarewindow.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarewindow.c @@ -7,19 +7,15 @@ char rcsId_vmwarewindow[] = "Id: vmwarewindow.c,v 1.4 2001/01/27 00:28:15 bennett Exp $"; #endif -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarewindow.c,v 1.1 2001/04/05 19:29:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/vmware/vmwarewindow.c,v 1.2 2001/05/16 06:48:12 keithp Exp $ */ #include "vmware.h" void vmwareCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) { - DDXPointPtr pptSrc; - register DDXPointPtr ppt; RegionRec rgnDst; - BoxPtr pbox; int dx, dy; - int i, nbox; WindowPtr pwinRoot; BoxPtr pBB; @@ -37,26 +33,15 @@ vmwareCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc); - pbox = REGION_RECTS(&rgnDst); - nbox = REGION_NUM_RECTS(&rgnDst); - if (!nbox || - !(pptSrc = - (DDXPointPtr) ALLOCATE_LOCAL(nbox * sizeof(DDXPointRec)))) { - REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); - return; - } - ppt = pptSrc; - for (i = nbox; --i >= 0; ppt++, pbox++) { - ppt->x = pbox->x1 + dx; - ppt->y = pbox->y1 + dy; - } pBB = REGION_EXTENTS(pWin->drawable.pScreen, &rgnDst); HIDE_CURSOR_ACCEL(pVMWARE, *pBB); - vmwareDoBitblt((DrawablePtr) pwinRoot, (DrawablePtr) pwinRoot, - GXcopy, &rgnDst, pptSrc, ~0L, 0); + + fbCopyRegion ((DrawablePtr) pwinRoot, (DrawablePtr) pwinRoot, + 0, + &rgnDst, dx, dy, vmwareDoBitblt, 0, 0); + SHOW_CURSOR(pVMWARE, *pBB); UPDATE_ACCEL_AREA(pVMWARE, *pBB); - DEALLOCATE_LOCAL(pptSrc); REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); } diff --git a/xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c b/xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c index 60c024c09..a16126842 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.2 2000/12/07 15:43:45 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/getvalidbios.c,v 1.3 2001/05/15 10:19:41 eich 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/dummylib/xf86opt.c b/xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c index 94f492200..dd00635b0 100644 --- a/xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c +++ b/xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c,v 1.1 2000/02/13 03:06:42 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86opt.c,v 1.2 2001/05/04 19:05:50 dawes Exp $ */ #include "X.h" #include "os.h" @@ -15,7 +15,7 @@ xf86ProcessOptions(int i, pointer p, OptionInfoPtr o) } Bool -xf86GetOptValBool(OptionInfoPtr o, int i, Bool *b) +xf86GetOptValBool(const OptionInfoRec *o, int i, Bool *b) { return FALSE; } diff --git a/xc/programs/Xserver/hw/xfree86/etc/Imakefile b/xc/programs/Xserver/hw/xfree86/etc/Imakefile index 842334b2d..f719acd6d 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/etc/Imakefile @@ -4,7 +4,7 @@ XCOMM $XConsortium: Imakefile /main/24 1996/10/28 04:24:12 kaleb $ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/etc/Imakefile,v 3.38 2001/03/21 17:36:47 dawes Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/etc/Imakefile,v 3.38.2.1 2001/05/29 14:41:54 dawes Exp $ #include <Server.tmpl> #if SystemV @@ -44,10 +44,8 @@ XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/etc/Imakefile,v 3.38 2001/03/21 1 #endif #if !BuildServersOnly && BuildClients -#ifdef SunArchitecture - TERMFILES = xterm.termcap xterm.terminfo -#else - TERMFILES = sun.termcap sun.terminfo xterm.termcap xterm.terminfo +#ifndef SunArchitecture + TERMFILES = sun.termcap sun.terminfo #endif #endif @@ -128,11 +126,6 @@ InstallNamedProg(svr4_patch,svr4_patch,$(LIBDIR)/etc) InstallNamedProg(svr4_rem_pch,svr4_patch_rem,$(LIBDIR)/etc) #endif -#if !BuildServersOnly && BuildClients -LinkFile(xterm.termcap,$(PROGRAMSRC)/xterm/termcap) -LinkFile(xterm.terminfo,$(PROGRAMSRC)/xterm/terminfo) -#endif - LinkFile(sun.termcap,sun.tcap) LinkFile(sun.terminfo,sun.tinfo) diff --git a/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh b/xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh index cce2b17a2..a8ff3fffb 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.20 2001/04/19 16:07:11 dawes Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh,v 1.20.2.4 2001/06/01 17:16:57 dawes Exp $ # # Copyright © 2000 by Precision Insight, Inc. -# Copyright © 2000 by VA Linux Systems, Inc. +# Copyright © 2000, 2001 by VA Linux Systems, Inc. # Portions Copyright © 1996-2000 by The XFree86 Project, Inc. # -# This script should be used to install XFree86 4.0.2. +# This script should be used to install XFree86 4.1.0. # # Parts of this script are based on the old preinst.sh and postinst.sh # scripts. @@ -17,23 +17,47 @@ # Authors: David Dawes <dawes@xfree86.org> # -VERSION=4.0.2 +# Fallbacks for when the bindist version can't be auto-detected. +# These should be updated for each release. -RUNDIR=/usr/X11R6 -ETCDIR=/etc/X11 -VARDIR=/var +FULLPREFIX=4.1 +PATCHLEVEL=0 +VERSION=$FULLPREFIX.$PATCHLEVEL +FULLVERSION=$FULLPREFIX.0 +SCRIPTVERSION=$VERSION + +BINDISTFULLPREFIX= +BINDISTPATCHLEVEL= +BINDISTVERSION= +BINDISTFULLVERSION= + +ROOTDIR= + +TESTROOT=/home1/test if [ X"$1" = "X-test" -o X"$XINST_TEST" != X ]; then - RUNDIR=/home1/test/X11R6 - ETCDIR=/home1/test/etcX11 - VARDIR=/home1/test/var + ROOTDIR=$TESTROOT if [ X"$1" = "X-test" ]; then shift fi + if [ ! -d $TESTROOT ]; then + echo "$TESTROOT doesn't exist (for test mode)" + exit 1 + fi + for i in usr etc var; do + if [ ! -d $TESTROOT/$i ]; then + echo "$TESTROOT/$i doesn't exist, creating it" + mkdir $TESTROOT/$i + fi + done echo "" echo "Running in test mode" fi +RUNDIR=$ROOTDIR/usr/X11R6 +ETCDIR=$ROOTDIR/etc/X11 +VARDIR=$ROOTDIR/var + OLDFILES="" OLDDIRS=" \ @@ -55,6 +79,12 @@ BASEDIST=" \ Xfenc.tgz \ " +UPDATEDIST=" \ + Xupdate.tgz \ + Xdrivers.tgz \ + Xdocupd.tgz \ + " + ETCDIST="Xetc.tgz" VARDIST="" @@ -97,15 +127,25 @@ ETCFLINKS=" \ " -XKBDIR="/etc/X11/xkb" +XKBDIR="$ETCDIR/xkb" +XKBDBDIR= FONTDIRS=" \ local \ misc " +XSERVERCMD="$RUNDIR/bin/XFree86" + +VERSIONFILE=".XFree86_Version" + WDIR=`pwd` +DOUPDATE= +DOBASE= + +OPTS="" + # Check how to suppress newlines with echo (from perl's Configure) ((echo "xxx\c"; echo " ") > .echotmp) 2> /dev/null if [ ! -f .echotmp ]; then @@ -187,6 +227,8 @@ Description() echo "Docs in PostScript";; Xaout*) echo "a.out compatibility libraries";; + Xquartz*) + echo "Mac OS X Quartz compatible X server";; *) echo "unknown";; esac @@ -356,16 +398,26 @@ FindDistName() case "$OsArch" in Power*) case "$OsVersion" in - 1.[2-9]) - DistName="Darwin" + 1.[2-9]*) + DistName="Darwin-ppc" + ;; + *) + Message="No Darwin/ppc binaries available for this OS version" + ;; + esac + ;; + x86*) + case "$OsVersion" in + 1.[3-9]*) + DistName="Darwin-ix86" ;; *) - Message="No Darwin binaries available for this OS version" + Message="No Darwin/ix86 binaries available for this OS version" ;; esac ;; *) - Message="Darwin binaries are only available for Power Mac platforms" + Message="Darwin binaries are not available for this architecture" ;; esac ;; @@ -587,6 +639,166 @@ FindDistName() fi } +GetBindistVersion() +{ + VERSTARBALL= + if [ X$DOBASE = XYES ]; then + if [ -f Xbin.tgz ]; then + VERSTARBALL=Xbin.tgz + fi + else + if [ X$DOUPDATE = XYES ]; then + if [ -f Xupdate.tgz ]; then + VERSTARBALL=Xupdate.tgz + fi + fi + fi + rm -f $VERSIONFILE + if [ X$VERSTARBALL != X ]; then + $TAR xzf $VERSTARBALL $VERSIONFILE + fi + if [ -f $VERSIONFILE ]; then + BINDISTVERSION=`cat $VERSIONFILE` + echo "Bindist version is $BINDISTVERSION" + BINDISTFULLPREFIX=`expr $BINDISTVERSION : '\([0-9]*\.[0-9]*\)\.'` + BINDISTPATCHLEVEL=`expr $BINDISTVERSION : '[0-9]*\.[0-9]*\.\([0-9]*\)'` + BINDISTFULLVERSION=$BINDISTFULLPREFIX.0 + else + echo "Warning: can't detect the bindist version" + fi + +} + +CheckInstallType() +{ + # Check for explicit options + + if [ X"$1" != X ]; then + case $1 in + -update) + DOUPDATE=YES + DOBASE=NO + OPTS="$OPTS $1" + shift + ;; + -base|-full) + DOBASE=YES + DOUPDATE=NO + OPTS="$OPTS $1" + shift + ;; + esac + fi + + # Auto-detect based on what files are present + + if [ X"$DOUPDATE" = X ]; then + for i in $BASEDIST; do + if [ -f $i ]; then + DOBASE=YES + fi + done + for i in $UPDATEDIST; do + if [ -f $i ]; then + DOUPDATE=YES + fi + done + if [ X"$DOBASE" = XYES -a X"$DOUPDATE" = XYES ]; then + echo "" + echo "You appear to have binaries in the current directory for" + echo "both a full release and an update release. The full release" + echo "must be installed before installing the update release." + echo "" + echo "The full release can be installed by re-running this script" + echo "with the '-base' option (sh $0 -base)." + echo "" + echo "The update release can be installed by re-running this script" + echo "with the '-update' option (sh $0 -update)." + echo "" + exit 1 + fi + fi + GetBindistVersion +} + +InstallUpdate() +{ + # Check that there's an existing installation. + + missingDir= + + for d in $RUNDIR $RUNDIR/lib $RUNDIR/lib/X11 $RUNDIR/bin; do + if [ ! -d $d ]; then + missingDir="$missingDir $d" + fi + done + + if [ X$missingDir != X ]; then + echo "" + echo "You don't appear to have an existing installation of XFree86." + echo "You must install the most recent full release ($FULLVERSION)" + echo "before installing this update release." + echo "" + exit 1 + fi + + if [ -f $XSERVERCMD ]; then + existingVer=`$XSERVERCMD -version 2>&1 | grep "XFree86 Version" | \ + awk '{print $3}'` + case $existingVer in + ${FULLPREFIX}.*) + ;; + *) + echo "" + echo "This update release should be installed on top of the most" + echo "recent full release ($FULLVERSION). Your current version" + echo "appears to be $existingVer. Please install $FULLVERSION" + echo "before installing this update release." + echo "" + exit 1 + esac + fi + + echo "" + echo "Installing the update binary distribution" + echo "" + for i in $UPDATEDIST $EXTRAUPDATE; do + (cd $RUNDIR; $EXTRACT $WDIR/$i) + done + + # Make sure that $RUNDIR/lib isn't group/other writable + chmod og-w $RUNDIR/lib + + # Need to run ldconfig on some OSs + case "$OsName" in + FreeBSD|NetBSD|OpenBSD) + echo "" + echo "Running ldconfig" + /sbin/ldconfig -m $RUNDIR/lib + ;; + Linux) + echo "" + echo "Running ldconfig" + /sbin/ldconfig $RUNDIR/lib + ;; + esac + + # Run mkfontdir in the local and misc directories to make sure that + # the fonts.dir files are up to date after the installation. + echo "" + for i in $FONTDIRS $EXTRAFONTDIRS; do + if [ -d $RUNDIR/lib/X11/fonts/$i ]; then + Echo "Updating the fonts.dir file in $RUNDIR/lib/X11/fonts/$i..." + $RUNDIR/bin/mkfontdir $RUNDIR/lib/X11/fonts/$i + echo "" + fi + done + + echo "" + echo "Update installation complete." +} + + if [ X"$1" = "X-check" ]; then GetOsInfo FindDistName @@ -594,14 +806,17 @@ if [ X"$1" = "X-check" ]; then fi echo "" -echo " Welcome to the XFree86 $VERSION installer" +echo " Welcome to the XFree86 $SCRIPTVERSION installer" echo "" echo "You are strongly advised to backup your existing XFree86 installation" -echo "before proceeding. This includes the /usr/X11R6 and /etc/X11" +echo "before proceeding. This includes the $ROOTDIR/usr/X11R6 and $ROOTDIR/etc/X11" echo "directories. The installation process will overwrite existing files" echo "in those directories, and this may include some configuration files" echo "that may have been customised." echo "" +echo "If you are installing a version different from $SCRIPTVERSION, you" +echo "may need an updated version of this installer script." +echo "" ContinueNo # Should check if uid is zero @@ -625,10 +840,12 @@ GetOsInfo case "$OsName" in Darwin) SERVDIST="Xxserv.tgz" + EXTRAOPTDIST="Xquartz.tgz" + UPDATEDIST="Xupdate.tgz Xdocupd.tgz" ;; FreeBSD|NetBSD|OpenBSD) VARDIST="Xvar.tgz" - XKBDIR="/var/db/xkb" + XKBDBDIR="$VARDIR/db/xkb" ;; Interactive) # Need the correct name for this EXTRADIST="Xbin1.tgz" @@ -636,22 +853,10 @@ Interactive) # Need the correct name for this ;; Linux) VARDIST="Xvar.tgz" - XKBDIR="/var/state/xkb" + XKBDBDIR="$VARDIR/lib/xkb" ;; esac -REQUIREDFILES=" \ - extract \ - $BASEDIST \ - $ETCDIST \ - $VARDIST \ - $SERVDIST \ - $EXTRADIST \ - " - -echo "Checking for required files ..." -Needed="" - # Check for extract and extract.exe, and check that they are usable. # # This test may not be fool-proof. A FreeBSD/ELF binary downloaded in @@ -711,12 +916,41 @@ if [ X"$ExtractOK" != XYES ]; then echo "and put it in this directory." fi echo "" - echo "When you have corrected the problem, please re-run 'sh $0'" + echo "When you have corrected the problem, please re-run 'sh $0$OPTS'" echo "to proceed with the installation." echo "" exit 1 fi +# Link extract to gnu-tar so it can also be used as a regular tar +rm -f gnu-tar +ln extract gnu-tar + +EXTRACT=$WDIR/extract +TAR=$WDIR/gnu-tar + +CheckInstallType "$@" + +if [ X"$DOUPDATE" = XYES ]; then + REQUIREDFILES=" \ + extract \ + $UPDATEDIST \ + $EXTRAUPDATE + " +else + REQUIREDFILES=" \ + extract \ + $BASEDIST \ + $ETCDIST \ + $VARDIST \ + $SERVDIST \ + $EXTRADIST \ + " +fi + +echo "Checking for required files ..." +Needed="" + for i in $REQUIREDFILES; do if [ ! -f $i ]; then Needed="$Needed $i" @@ -731,7 +965,7 @@ if [ X"$Needed" != X ]; then echo "must be present in the current directory to proceed with the" echo "installation. You should be able to find it at the same place" echo "you picked up the rest of the XFree86 binary distribution." - echo "Please re-run 'sh $0' to proceed with the installation when" + echo "Please re-run 'sh $0$OPTS' to proceed with the installation when" echo "you have them." echo "" exit 1 @@ -741,7 +975,7 @@ DoOsChecks if [ X"$NEEDSOMETHING" != X ]; then echo "" - echo "Please re-run 'sh $0' to proceed with the installation after you" + echo "Please re-run 'sh $0$OPTS' to proceed with the installation after you" echo "have made the required updates." echo "" exit 1 @@ -749,12 +983,25 @@ fi echo "" -# Link extract to gnu-tar so it can also be used as a regular tar -rm -f gnu-tar -ln extract gnu-tar +# Set version variables if the bindist version was successfully auto-detected. -EXTRACT=$WDIR/extract -TAR=$WDIR/gnu-tar +if [ X$BINDISTVERSION != X ]; then + VERSION=$BINDISTVERSION +fi +if [ X$BINDISTFULLVERSION != X ]; then + FULLVERSION=$BINDISTFULLVERSION +fi +if [ X$BINDISTPATCHLEVEL != X ]; then + PATCHLEVEL=$BINDISTPATCHLEVEL +fi +if [ X$BINDISTFULLPREFIX != X ]; then + FULLPREFIX=$BINDISTFULLPREFIX +fi + +if [ X"$DOUPDATE" = XYES ]; then + InstallUpdate + exit 0 +fi # Create $RUNDIR and $ETCDIR if they don't already exist @@ -936,12 +1183,13 @@ for i in $ETCFLINKS; do fi done if [ X"$XKBDIR" != X ]; then - rm -fr $RUNDIR/lib/X11/xkb/compiled if [ X"$NoSymLinks" = XYES ]; then XKBDIR=$RUNDIR/lib/X11/xkb/compiled fi if [ -d .etctmp/xkb ]; then - mkdir $XKBDIR + if [ ! -d $XKBDIR ]; then + mkdir $XKBDIR + fi $TAR -C .etctmp/xkb -c -f - . | \ $TAR -C $XKBDIR -v -x -p -U -f - fi @@ -958,9 +1206,10 @@ if [ X"$VARDIST" != X ]; then (cd $VARDIR; $EXTRACT $WDIR/$VARDIST) fi -if [ X"$XKBDIR" != X -a X"$XKBDIR" != X"$RUNDIR/lib/X11/xkb/compiled" ]; then +if [ X"$XKBDIR" != X -a X"$XKBDIR" != X"$RUNDIR/lib/X11/xkb/compiled" -a \ + X"$XKBDBDIR" != X ]; then rm -fr $RUNDIR/lib/X11/xkb/compiled - ln -s $XKBDIR $RUNDIR/lib/X11/xkb/compiled + ln -s $XKBDBDIR $RUNDIR/lib/X11/xkb/compiled fi echo "Checking for optional components to install ..." @@ -1005,8 +1254,8 @@ for i in $FONTDIRS $EXTRAFONTDIRS; do done # Check if the system has a termcap file -TERMCAP1DIR=/usr/share -TERMCAP2=/etc/termcap +TERMCAP1DIR=$ROOTDIR/usr/share +TERMCAP2=$ROOTDIR/etc/termcap if [ -d $TERMCAP1DIR ]; then TERMCAP1=`find $TERMCAP1DIR -type f -name termcap -print 2> /dev/null` if [ x"$TERMCAP1" != x ]; then @@ -1040,7 +1289,7 @@ if [ X"$TERMCAPFILE" != X ]; then fi # Check for terminfo, and update the xterm entry -TINFODIR=/usr/lib/terminfo +TINFODIR=$ROOTDIR/usr/lib/terminfo # Does this list need to be updated? OLDTINFO=" \ x/xterm \ @@ -1100,20 +1349,20 @@ fi if [ -f $RUNDIR/lib/libGL.so ]; then existing="" - if [ -f /usr/lib/libGL.so ]; then + if [ -f $ROOTDIR/usr/lib/libGL.so ]; then existing="$existing /usr/lib/libGL.so" fi - if [ -f /usr/lib/libGL.so.1 ]; then + if [ -f $ROOTDIR/usr/lib/libGL.so.1 ]; then existing="$existing /usr/lib/libGL.so.1" fi - if [ -d /usr/include/GL ]; then + if [ -d $ROOTDIR/usr/include/GL ]; then existing="$existing /usr/include/GL" fi echo "" echo "On some platforms (e.g., Linux), the OpenGL standard requires" echo "that the GL shared library and header files be visible from the" - echo "standard system lib and include directories (/usr/lib and" - echo "/usr/include). This can be done by installing links in those" + echo "standard system lib and include directories ($ROOTDIR/usr/lib and" + echo "$ROOTDIR/usr/include). This can be done by installing links in those" echo "directories to the files that have been installed under $RUNDIR." echo "" echo "NOTE: installing these links will overwrite existing files or" @@ -1129,29 +1378,37 @@ if [ -f $RUNDIR/lib/libGL.so ]; then read response case "$response" in [yY]*) - rm -f /usr/lib/libGL.so - if [ ! -f /usr/lib/libGL.so ]; then - echo "Creating link from $RUNDIR/lib/libGL.so to /usr/lib/libGL.so" - ln -s $RUNDIR/lib/libGL.so /usr/lib/libGL.so + if [ ! -d $ROOTDIR/usr/lib ]; then + echo "Creating $ROOTDIR/usr/lib" + mkdir $ROOTDIR/usr/lib + fi + if [ ! -d $ROOTDIR/usr/include ]; then + echo "Creating $ROOTDIR/usr/include" + mkdir $ROOTDIR/usr/include + fi + rm -f $ROOTDIR/usr/lib/libGL.so + if [ ! -f $ROOTDIR/usr/lib/libGL.so ]; then + echo "Creating link from $RUNDIR/lib/libGL.so to $ROOTDIR/usr/lib/libGL.so" + ln -s $RUNDIR/lib/libGL.so $ROOTDIR/usr/lib/libGL.so else - echo "Could not remove existing /usr/lib/libGL.so, so the new" + echo "Could not remove existing $ROOTDIR/usr/lib/libGL.so, so the new" echo "link has not been created." fi - rm -f /usr/lib/libGL.so.1 - if [ ! -f /usr/lib/libGL.so.1 ]; then - echo "Creating link from $RUNDIR/lib/libGL.so.1 to /usr/lib/libGL.so.1" - ln -s $RUNDIR/lib/libGL.so.1 /usr/lib/libGL.so.1 + rm -f $ROOTDIR/usr/lib/libGL.so.1 + if [ ! -f $ROOTDIR/usr/lib/libGL.so.1 ]; then + echo "Creating link from $RUNDIR/lib/libGL.so.1 to $ROOTDIR/usr/lib/libGL.so.1" + ln -s $RUNDIR/lib/libGL.so.1 $ROOTDIR/usr/lib/libGL.so.1 else - echo "Could not remove existing /usr/lib/libGL.so.1, so the new" + echo "Could not remove existing $ROOTDIR/usr/lib/libGL.so.1, so the new" echo "link has not been created." fi if [ -d $RUNDIR/include/GL ]; then - rm -f /usr/include/GL - if [ ! -d /usr/include/GL ]; then - echo "Creating link from $RUNDIR/include/GL to /usr/include/GL" - ln -s $RUNDIR/include/GL /usr/include/GL + rm -f $ROOTDIR/usr/include/GL + if [ ! -d $ROOTDIR/usr/include/GL ]; then + echo "Creating link from $RUNDIR/include/GL to $ROOTDIR/usr/include/GL" + ln -s $RUNDIR/include/GL $ROOTDIR/usr/include/GL else - echo "Could not remove existing /usr/include/GL, so the new" + echo "Could not remove existing $ROOTDIR/usr/include/GL, so the new" echo "link has not been created." fi fi @@ -1163,15 +1420,19 @@ if [ -f $RUNDIR/bin/rstartd ]; then echo "" echo "If you are going to use rstart and $RUNDIR/bin isn't in the" echo "default path for commands run remotely via rsh, you will need" - echo "a link to rstartd installed in /usr/bin." + echo "a link to rstartd installed in $ROOTDIR/usr/bin." echo "" Echo "Do you wish to have this link installed (y/n)? [n] " read response case "$response" in [yY]*) - echo "Creating link from $RUNDIR/bin/rstartd to /usr/bin/rstartd" - rm -f /usr/bin/rstartd - ln -s $RUNDIR/bin/rstartd /usr/bin/rstartd + if [ ! -d $ROOTDIR/usr/bin ]; then + echo "Creating $ROOTDIR/usr/bin" + mkdir $ROOTDIR/usr/bin + fi + echo "Creating link from $RUNDIR/bin/rstartd to $ROOTDIR/usr/bin/rstartd" + rm -f $ROOTDIR/usr/bin/rstartd + ln -s $RUNDIR/bin/rstartd $ROOTDIR/usr/bin/rstartd ;; esac fi diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/bin-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/bin-excl new file mode 100644 index 000000000..e9881d34e --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/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-ix86/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/bin-list new file mode 100644 index 000000000..e4f9f74ee --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/bin-list @@ -0,0 +1,2 @@ +.XFree86_Version +bin diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/dir b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/dir new file mode 100644 index 000000000..11c5b9da7 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/dir @@ -0,0 +1 @@ +usr/X11R6 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/etc-dir b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/etc-dir new file mode 100644 index 000000000..412cec0c3 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/etc-dir @@ -0,0 +1 @@ +etc/X11 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/etc-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/etc-list new file mode 100644 index 000000000..9c558e357 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/etc-list @@ -0,0 +1 @@ +. diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/fsrv-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/fsrv-list new file mode 100644 index 000000000..e4decc9eb --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/fsrv-list @@ -0,0 +1,2 @@ +bin/xfs +man/cat1/xfs.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/host.def new file mode 100644 index 000000000..f0f1368fd --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/host.def @@ -0,0 +1,10 @@ +/* + * Host.def for building Darwin/ix86 bindists + * + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/host.def,v 1.1.2.2 2001/05/31 22:20:25 dawes Exp $ + */ + +#define InstallEmptyHostDef +#define BuildBindist + +#define DarwinQuartzSupport NO diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/lib-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/lib-excl new file mode 100644 index 000000000..d7fb5cb03 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-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/Darwin-ix86/lib-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/lib-list new file mode 100644 index 000000000..9673fea05 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/lib-list @@ -0,0 +1,2 @@ +lib/X11 +include/X11/bitmaps diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/man-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/man-excl new file mode 100644 index 000000000..1ea82551a --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-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/Darwin-ix86/man-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/man-list new file mode 100644 index 000000000..2a3700c15 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/man-list @@ -0,0 +1 @@ +man diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/nest-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/nest-list new file mode 100644 index 000000000..eff754d76 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/nest-list @@ -0,0 +1 @@ +bin/Xnest diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prog-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prog-excl new file mode 100644 index 000000000..113d220ef --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-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/Darwin-ix86/prog-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prog-list new file mode 100644 index 000000000..059b71061 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prog-list @@ -0,0 +1,3 @@ +lib +include +lib/X11/config diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prt-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prt-list new file mode 100644 index 000000000..0646e7927 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/prt-list @@ -0,0 +1 @@ +bin/Xprt diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/update-upd new file mode 100644 index 000000000..b823f7d96 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/update-upd @@ -0,0 +1,30 @@ +bin/Xdarwin +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/darwin.cf +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libXaw.a +lib/libXfont.a +lib/libXft.a diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/vfb-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/vfb-list new file mode 100644 index 000000000..e2d161bbc --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/vfb-list @@ -0,0 +1 @@ +bin/Xvfb diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/xserv-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/xserv-list new file mode 100644 index 000000000..63c941ae0 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ix86/xserv-list @@ -0,0 +1,2 @@ +bin/XDarwin +bin/X diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-excl new file mode 100644 index 000000000..8344b81c3 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-excl @@ -0,0 +1,8 @@ +bin/Xnest +bin/Xprt +bin/Xvfb +bin/X +bin/xfs +bin/XDarwin +bin/XDarwinStartup +bin/XDarwinQuartz diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-list new file mode 100644 index 000000000..e4f9f74ee --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/bin-list @@ -0,0 +1,2 @@ +.XFree86_Version +bin diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/dir b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/dir new file mode 100644 index 000000000..11c5b9da7 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/dir @@ -0,0 +1 @@ +usr/X11R6 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-dir b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-dir new file mode 100644 index 000000000..412cec0c3 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-dir @@ -0,0 +1 @@ +etc/X11 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-list new file mode 100644 index 000000000..9c558e357 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/etc-list @@ -0,0 +1 @@ +. diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/fsrv-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/fsrv-list new file mode 100644 index 000000000..e4decc9eb --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/fsrv-list @@ -0,0 +1,2 @@ +bin/xfs +man/cat1/xfs.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/host.def new file mode 100644 index 000000000..7487f2319 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/host.def @@ -0,0 +1,9 @@ +/* + * Host.def for building Darwin/ppc bindists + * + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/host.def,v 1.1.2.2 2001/05/31 22:20:25 dawes Exp $ + */ + +#define InstallEmptyHostDef +#define BuildBindist + diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/lib-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/lib-excl new file mode 100644 index 000000000..d7fb5cb03 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/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-ppc/lib-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/lib-list new file mode 100644 index 000000000..9673fea05 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/lib-list @@ -0,0 +1,2 @@ +lib/X11 +include/X11/bitmaps diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/man-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/man-excl new file mode 100644 index 000000000..1ea82551a --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/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-ppc/man-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/man-list new file mode 100644 index 000000000..2a3700c15 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/man-list @@ -0,0 +1 @@ +man diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/nest-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/nest-list new file mode 100644 index 000000000..eff754d76 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/nest-list @@ -0,0 +1 @@ +bin/Xnest diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prog-excl b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prog-excl new file mode 100644 index 000000000..113d220ef --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/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-ppc/prog-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prog-list new file mode 100644 index 000000000..059b71061 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prog-list @@ -0,0 +1,3 @@ +lib +include +lib/X11/config diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prt-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prt-list new file mode 100644 index 000000000..0646e7927 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/prt-list @@ -0,0 +1 @@ +bin/Xprt diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/quartz-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/quartz-list new file mode 100644 index 000000000..f32a0d5f7 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/quartz-list @@ -0,0 +1,4 @@ +bin/X +bin/XDarwinStartup +bin/XDarwinQuartz +../../Applications/XDarwin.app diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/update-upd new file mode 100644 index 000000000..b823f7d96 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/update-upd @@ -0,0 +1,30 @@ +bin/Xdarwin +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/darwin.cf +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libXaw.a +lib/libXfont.a +lib/libXft.a diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/vfb-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/vfb-list new file mode 100644 index 000000000..e2d161bbc --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/vfb-list @@ -0,0 +1 @@ +bin/Xvfb diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/xserv-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/xserv-list new file mode 100644 index 000000000..63c941ae0 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Darwin-ppc/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 512a75054..6cb2911ac 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 @@ -1,5 +1,7 @@ +.XFree86_Version bin lib/libGL.so.1.2 +lib/libGLU.so.1.3 lib/libICE.so.6.3 lib/libPEX5.so.6.0 lib/libSM.so.6.0 @@ -13,6 +15,7 @@ lib/libXfont.so.1.3 lib/libXft.so.1.0 lib/libXi.so.6.0 lib/libXmu.so.6.2 +lib/libXmuu.so.1.0 lib/libXp.so.6.2 lib/libXpm.so.4.11 lib/libXrender.so.1.0 @@ -20,6 +23,7 @@ lib/libXt.so.6.0 lib/libXtst.so.6.1 lib/libdps.so.1.0 lib/libdpstk.so.1.0 +lib/libfreetype.so.6.0 lib/liboldX.so.6.0 lib/libpsres.so.1.0 lib/libxrx.so.6.3 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/drivers-upd new file mode 100644 index 000000000..002f614d9 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/drivers-upd @@ -0,0 +1,20 @@ +lib/modules/drivers/chips_drv.o +lib/modules/drivers/cyrix_drv.o +lib/modules/drivers/glint_drv.o +lib/modules/drivers/i810_drv.o +lib/modules/drivers/mga_drv.o +lib/modules/drivers/neomagic_drv.o +lib/modules/drivers/nv_drv.o +lib/modules/drivers/r128_drv.o +lib/modules/drivers/s3virge_drv.o +lib/modules/drivers/savage_drv.o +lib/modules/drivers/sis_drv.o +lib/modules/drivers/tdfx_drv.o +lib/modules/drivers/trident_drv.o +lib/modules/drivers/tseng_drv.o +lib/modules/drivers/vga_drv.o +lib/modules/extensions/libextmod.a +lib/modules/fonts/libfreetype.a +lib/modules/input/mouse_drv.o +lib/modules/libvgahw.a +lib/modules/libxf8_16bpp.a diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/host.def index 0f02f439b..70b3ad7be 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/host.def @@ -1,8 +1,9 @@ /* * Host.def for building FreeBSD/a.out bindists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/host.def,v 1.3 2000/03/07 14:47:32 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/host.def,v 1.3.4.1 2001/05/31 22:20:28 dawes Exp $ */ #define InstallEmptyHostDef +#define BuildBindist diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/update-upd new file mode 100644 index 000000000..dd36865f2 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD-aout/update-upd @@ -0,0 +1,42 @@ +bin/SuperProbe +bin/XFree86 +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xf86cfg +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/app-defaults/XF86Cfg +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libX11.so.6.2 +lib/libXaw.a +lib/libXaw.so.6.1 +lib/libXaw.so.7.0 +lib/libXfont.a +lib/libXfont.so.1.3 +lib/libXft.a +lib/libXft.so.1.0 +lib/libfreetype.a +lib/libfreetype.so.6.0 +man/man1/XFree86.1.gz +man/man4/nv.4.gz +man/man5/XF86Config.5.gz 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 85cbab2a5..e8d9165a2 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/bin-list @@ -1,7 +1,10 @@ +.XFree86_Version bin lib/aout lib/libGL.so.1 lib/libGL.so +lib/libGLU.so.1 +lib/libGLU.so lib/libICE.so.6 lib/libICE.so lib/libOSMesa.so.3 @@ -29,6 +32,8 @@ lib/libXi.so.6 lib/libXi.so lib/libXmu.so.6 lib/libXmu.so +lib/libXmuu.so.1 +lib/libXmuu.so lib/libXp.so.6 lib/libXp.so lib/libXpm.so.4 @@ -43,6 +48,8 @@ lib/libdps.so.1 lib/libdps.so lib/libdpstk.so.1 lib/libdpstk.so +lib/libfreetype.so.6 +lib/libfreetype.so lib/liboldX.so.6 lib/liboldX.so lib/libpsres.so.1 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/drivers-upd new file mode 100644 index 000000000..002f614d9 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/drivers-upd @@ -0,0 +1,20 @@ +lib/modules/drivers/chips_drv.o +lib/modules/drivers/cyrix_drv.o +lib/modules/drivers/glint_drv.o +lib/modules/drivers/i810_drv.o +lib/modules/drivers/mga_drv.o +lib/modules/drivers/neomagic_drv.o +lib/modules/drivers/nv_drv.o +lib/modules/drivers/r128_drv.o +lib/modules/drivers/s3virge_drv.o +lib/modules/drivers/savage_drv.o +lib/modules/drivers/sis_drv.o +lib/modules/drivers/tdfx_drv.o +lib/modules/drivers/trident_drv.o +lib/modules/drivers/tseng_drv.o +lib/modules/drivers/vga_drv.o +lib/modules/extensions/libextmod.a +lib/modules/fonts/libfreetype.a +lib/modules/input/mouse_drv.o +lib/modules/libvgahw.a +lib/modules/libxf8_16bpp.a diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/host.def index 9208cc595..f8a38459f 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/host.def @@ -1,8 +1,9 @@ /* * Host.def for building FreeBSD bindists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/host.def,v 1.3 2000/03/07 14:47:31 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/host.def,v 1.3.4.1 2001/05/31 22:20:27 dawes Exp $ */ #define InstallEmptyHostDef +#define BuildBindist diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/update-upd new file mode 100644 index 000000000..23efc6580 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/FreeBSD/update-upd @@ -0,0 +1,47 @@ +bin/SuperProbe +bin/XFree86 +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xf86cfg +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/app-defaults/XF86Cfg +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libX11.so +lib/libX11.so.6 +lib/libXaw.a +lib/libXaw.so +lib/libXaw.so.6 +lib/libXaw.so.7 +lib/libXfont.a +lib/libXfont.so +lib/libXfont.so.1 +lib/libXft.a +lib/libXft.so +lib/libXft.so.1 +lib/libfreetype.a +lib/libfreetype.so +lib/libfreetype.so.6 +man/man1/XFree86.1.gz +man/man4/nv.4.gz +man/man5/XF86Config.5.gz diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/bin-list index ba077a403..e4f9f74ee 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/bin-list @@ -1 +1,2 @@ +.XFree86_Version bin diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/drivers-upd new file mode 100644 index 000000000..002f614d9 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/drivers-upd @@ -0,0 +1,20 @@ +lib/modules/drivers/chips_drv.o +lib/modules/drivers/cyrix_drv.o +lib/modules/drivers/glint_drv.o +lib/modules/drivers/i810_drv.o +lib/modules/drivers/mga_drv.o +lib/modules/drivers/neomagic_drv.o +lib/modules/drivers/nv_drv.o +lib/modules/drivers/r128_drv.o +lib/modules/drivers/s3virge_drv.o +lib/modules/drivers/savage_drv.o +lib/modules/drivers/sis_drv.o +lib/modules/drivers/tdfx_drv.o +lib/modules/drivers/trident_drv.o +lib/modules/drivers/tseng_drv.o +lib/modules/drivers/vga_drv.o +lib/modules/extensions/libextmod.a +lib/modules/fonts/libfreetype.a +lib/modules/input/mouse_drv.o +lib/modules/libvgahw.a +lib/modules/libxf8_16bpp.a diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/update-upd new file mode 100644 index 000000000..8d91c6abd --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Interactive/update-upd @@ -0,0 +1,36 @@ +bin/SuperProbe +bin/XFree86 +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xf86cfg +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/app-defaults/XF86Cfg +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libXaw.a +lib/libXfont.a +lib/libXft.a +lib/libfreetype.a +man/man1/XFree86.1x.Z +man/man4/XF86Config.4.Z +man/man7/nv.7.Z 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 9f9e96aa1..0b402b073 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 @@ -1,7 +1,11 @@ +.XFree86_Version bin lib/libGL.so.1.2 lib/libGL.so.1 lib/libGL.so +lib/libGLU.so.1.3 +lib/libGLU.so.1 +lib/libGLU.so lib/libICE.so.6.3 lib/libICE.so.6 lib/libICE.so @@ -40,6 +44,9 @@ lib/libXi.so lib/libXmu.so.6.2 lib/libXmu.so.6 lib/libXmu.so +lib/libXmuu.so.1.0 +lib/libXmuu.so.1 +lib/libXmuu.so lib/libXp.so.6.2 lib/libXp.so.6 lib/libXp.so @@ -61,6 +68,9 @@ lib/libdps.so lib/libdpstk.so.1.0 lib/libdpstk.so.1 lib/libdpstk.so +lib/libfreetype.so.6.0 +lib/libfreetype.so.6 +lib/libfreetype.so lib/libpsres.so.1.0 lib/libpsres.so.1 lib/libpsres.so diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/drivers-upd new file mode 100644 index 000000000..11ea38365 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/drivers-upd @@ -0,0 +1,11 @@ +lib/modules/drivers/glint_drv.o +lib/modules/drivers/mga_drv.o +lib/modules/drivers/nv_drv.o +lib/modules/drivers/s3virge_drv.o +lib/modules/drivers/savage_drv.o +lib/modules/drivers/vga_drv.o +lib/modules/extensions/libextmod.a +lib/modules/fonts/libfreetype.a +lib/modules/input/mouse_drv.o +lib/modules/libvgahw.a +lib/modules/libxf8_16bpp.a 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 371566bc9..31a0c0aad 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,10 +1,11 @@ /* * Host.def for building Linux/alpha bindists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def,v 1.6 2001/03/17 18:41:32 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/host.def,v 1.6.2.1 2001/05/31 22:20:28 dawes Exp $ */ #define InstallEmptyHostDef +#define BuildBindist /* Need to have glide 3 installed, where available */ diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/update-upd new file mode 100644 index 000000000..7c3e2f477 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-axp/update-upd @@ -0,0 +1,53 @@ +bin/SuperProbe +bin/XFree86 +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xf86cfg +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/app-defaults/XF86Cfg +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libX11.so +lib/libX11.so.6 +lib/libX11.so.6.2 +lib/libXaw.a +lib/libXaw.so +lib/libXaw.so.6 +lib/libXaw.so.6.1 +lib/libXaw.so.7 +lib/libXaw.so.7.0 +lib/libXfont.a +lib/libXfont.so +lib/libXfont.so.1 +lib/libXfont.so.1.3 +lib/libXft.a +lib/libXft.so +lib/libXft.so.1 +lib/libXft.so.1.0 +lib/libfreetype.a +lib/libfreetype.so +lib/libfreetype.so.6 +lib/libfreetype.so.6.0 +man/man1/XFree86.1x +man/man4/nv.4 +man/man5/XF86Config.5x 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 9f9e96aa1..0b402b073 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 @@ -1,7 +1,11 @@ +.XFree86_Version bin lib/libGL.so.1.2 lib/libGL.so.1 lib/libGL.so +lib/libGLU.so.1.3 +lib/libGLU.so.1 +lib/libGLU.so lib/libICE.so.6.3 lib/libICE.so.6 lib/libICE.so @@ -40,6 +44,9 @@ lib/libXi.so lib/libXmu.so.6.2 lib/libXmu.so.6 lib/libXmu.so +lib/libXmuu.so.1.0 +lib/libXmuu.so.1 +lib/libXmuu.so lib/libXp.so.6.2 lib/libXp.so.6 lib/libXp.so @@ -61,6 +68,9 @@ lib/libdps.so lib/libdpstk.so.1.0 lib/libdpstk.so.1 lib/libdpstk.so +lib/libfreetype.so.6.0 +lib/libfreetype.so.6 +lib/libfreetype.so lib/libpsres.so.1.0 lib/libpsres.so.1 lib/libpsres.so diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/drivers-upd new file mode 100644 index 000000000..002f614d9 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/drivers-upd @@ -0,0 +1,20 @@ +lib/modules/drivers/chips_drv.o +lib/modules/drivers/cyrix_drv.o +lib/modules/drivers/glint_drv.o +lib/modules/drivers/i810_drv.o +lib/modules/drivers/mga_drv.o +lib/modules/drivers/neomagic_drv.o +lib/modules/drivers/nv_drv.o +lib/modules/drivers/r128_drv.o +lib/modules/drivers/s3virge_drv.o +lib/modules/drivers/savage_drv.o +lib/modules/drivers/sis_drv.o +lib/modules/drivers/tdfx_drv.o +lib/modules/drivers/trident_drv.o +lib/modules/drivers/tseng_drv.o +lib/modules/drivers/vga_drv.o +lib/modules/extensions/libextmod.a +lib/modules/fonts/libfreetype.a +lib/modules/input/mouse_drv.o +lib/modules/libvgahw.a +lib/modules/libxf8_16bpp.a diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/host.def index 6cb9eb81c..4f8964092 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/host.def @@ -1,10 +1,11 @@ /* * Host.def for building Linux/ix86 bindists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/host.def,v 1.7 2001/03/17 18:41:32 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/host.def,v 1.7.2.1 2001/05/31 22:20:29 dawes Exp $ */ #define InstallEmptyHostDef +#define BuildBindist /* Need to have glide 2 and glide 3 installed, where available */ diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/update-upd new file mode 100644 index 000000000..7c3e2f477 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ix86/update-upd @@ -0,0 +1,53 @@ +bin/SuperProbe +bin/XFree86 +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xf86cfg +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/app-defaults/XF86Cfg +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libX11.so +lib/libX11.so.6 +lib/libX11.so.6.2 +lib/libXaw.a +lib/libXaw.so +lib/libXaw.so.6 +lib/libXaw.so.6.1 +lib/libXaw.so.7 +lib/libXaw.so.7.0 +lib/libXfont.a +lib/libXfont.so +lib/libXfont.so.1 +lib/libXfont.so.1.3 +lib/libXft.a +lib/libXft.so +lib/libXft.so.1 +lib/libXft.so.1.0 +lib/libfreetype.a +lib/libfreetype.so +lib/libfreetype.so.6 +lib/libfreetype.so.6.0 +man/man1/XFree86.1x +man/man4/nv.4 +man/man5/XF86Config.5x 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 9f9e96aa1..0b402b073 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 @@ -1,7 +1,11 @@ +.XFree86_Version bin lib/libGL.so.1.2 lib/libGL.so.1 lib/libGL.so +lib/libGLU.so.1.3 +lib/libGLU.so.1 +lib/libGLU.so lib/libICE.so.6.3 lib/libICE.so.6 lib/libICE.so @@ -40,6 +44,9 @@ lib/libXi.so lib/libXmu.so.6.2 lib/libXmu.so.6 lib/libXmu.so +lib/libXmuu.so.1.0 +lib/libXmuu.so.1 +lib/libXmuu.so lib/libXp.so.6.2 lib/libXp.so.6 lib/libXp.so @@ -61,6 +68,9 @@ lib/libdps.so lib/libdpstk.so.1.0 lib/libdpstk.so.1 lib/libdpstk.so +lib/libfreetype.so.6.0 +lib/libfreetype.so.6 +lib/libfreetype.so lib/libpsres.so.1.0 lib/libpsres.so.1 lib/libpsres.so diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/host.def index 2c8e5a311..0b4a84ffe 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/host.def @@ -1,10 +1,11 @@ /* * Host.def for building Linux/m68k bindists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/host.def,v 1.5 2001/03/17 18:41:33 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-m68k/host.def,v 1.5.2.1 2001/05/31 22:20:31 dawes Exp $ */ #define InstallEmptyHostDef +#define BuildBindist #define ForceNormalLib YES 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 9f9e96aa1..0b402b073 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 @@ -1,7 +1,11 @@ +.XFree86_Version bin lib/libGL.so.1.2 lib/libGL.so.1 lib/libGL.so +lib/libGLU.so.1.3 +lib/libGLU.so.1 +lib/libGLU.so lib/libICE.so.6.3 lib/libICE.so.6 lib/libICE.so @@ -40,6 +44,9 @@ lib/libXi.so lib/libXmu.so.6.2 lib/libXmu.so.6 lib/libXmu.so +lib/libXmuu.so.1.0 +lib/libXmuu.so.1 +lib/libXmuu.so lib/libXp.so.6.2 lib/libXp.so.6 lib/libXp.so @@ -61,6 +68,9 @@ lib/libdps.so lib/libdpstk.so.1.0 lib/libdpstk.so.1 lib/libdpstk.so +lib/libfreetype.so.6.0 +lib/libfreetype.so.6 +lib/libfreetype.so lib/libpsres.so.1.0 lib/libpsres.so.1 lib/libpsres.so 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 9f9e96aa1..0b402b073 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 @@ -1,7 +1,11 @@ +.XFree86_Version bin lib/libGL.so.1.2 lib/libGL.so.1 lib/libGL.so +lib/libGLU.so.1.3 +lib/libGLU.so.1 +lib/libGLU.so lib/libICE.so.6.3 lib/libICE.so.6 lib/libICE.so @@ -40,6 +44,9 @@ lib/libXi.so lib/libXmu.so.6.2 lib/libXmu.so.6 lib/libXmu.so +lib/libXmuu.so.1.0 +lib/libXmuu.so.1 +lib/libXmuu.so lib/libXp.so.6.2 lib/libXp.so.6 lib/libXp.so @@ -61,6 +68,9 @@ lib/libdps.so lib/libdpstk.so.1.0 lib/libdpstk.so.1 lib/libdpstk.so +lib/libfreetype.so.6.0 +lib/libfreetype.so.6 +lib/libfreetype.so lib/libpsres.so.1.0 lib/libpsres.so.1 lib/libpsres.so diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/host.def index 03b7f5fa2..1c6753116 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/host.def @@ -1,10 +1,11 @@ /* * Host.def for building Linux/ppc bindists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/host.def,v 1.4 2001/03/17 18:41:33 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Linux-ppc/host.def,v 1.4.2.1 2001/05/31 22:20:31 dawes Exp $ */ #define InstallEmptyHostDef +#define BuildBindist #define ForceNormalLib YES diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/bin-list index ba077a403..e4f9f74ee 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/bin-list @@ -1 +1,2 @@ +.XFree86_Version bin diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/drivers-upd new file mode 100644 index 000000000..002f614d9 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/drivers-upd @@ -0,0 +1,20 @@ +lib/modules/drivers/chips_drv.o +lib/modules/drivers/cyrix_drv.o +lib/modules/drivers/glint_drv.o +lib/modules/drivers/i810_drv.o +lib/modules/drivers/mga_drv.o +lib/modules/drivers/neomagic_drv.o +lib/modules/drivers/nv_drv.o +lib/modules/drivers/r128_drv.o +lib/modules/drivers/s3virge_drv.o +lib/modules/drivers/savage_drv.o +lib/modules/drivers/sis_drv.o +lib/modules/drivers/tdfx_drv.o +lib/modules/drivers/trident_drv.o +lib/modules/drivers/tseng_drv.o +lib/modules/drivers/vga_drv.o +lib/modules/extensions/libextmod.a +lib/modules/fonts/libfreetype.a +lib/modules/input/mouse_drv.o +lib/modules/libvgahw.a +lib/modules/libxf8_16bpp.a diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/host.def index 03c9bc7ca..810c00bf2 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/host.def @@ -1,8 +1,11 @@ /* * host.def for building LynxOS binary dists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/host.def,v 1.3 2000/03/03 20:02:16 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/host.def,v 1.3.4.1 2001/05/31 22:20:31 dawes Exp $ */ +#define BuildBindist + #define HasLibCrypt YES #define HasMTRRSupport YES + diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/update-upd new file mode 100644 index 000000000..6d41a8fe5 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/LynxOS/update-upd @@ -0,0 +1,47 @@ +bin/SuperProbe +bin/XFree86 +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xf86cfg +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/app-defaults/XF86Cfg +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libX11.so +lib/libX11.so.6 +lib/libXaw.a +lib/libXaw.so +lib/libXaw.so.6 +lib/libXaw.so.7 +lib/libXfont.a +lib/libXfont.so +lib/libXfont.so.1 +lib/libXft.a +lib/libXft.so +lib/libXft.so.1 +lib/libfreetype.a +lib/libfreetype.so +lib/libfreetype.so.6 +man/cat1/XFree86.1 +man/cat4/nv.4 +man/cat5/XF86Config.5 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 index 3d7c2a6d6..804d63722 100644 --- 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 @@ -1,5 +1,7 @@ +.XFree86_Version bin lib/libGL.so.1.2 +lib/libGLU.so.1.3 lib/libICE.so.6.3 lib/libPEX5.so.6.0 lib/libSM.so.6.0 @@ -12,6 +14,7 @@ lib/libXfont.so.1.3 lib/libXft.so.1.0 lib/libXi.so.6.0 lib/libXmu.so.6.2 +lib/libXmuu.so.1.0 lib/libXp.so.6.2 lib/libXpm.so.4.11 lib/libXrender.so.1.0 @@ -19,5 +22,6 @@ lib/libXt.so.6.0 lib/libXtst.so.6.1 lib/libdps.so.1.0 lib/libdpstk.so.1.0 +lib/libfreetype.so.6.0 lib/liboldX.so.6.0 lib/libpsres.so.1.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/drivers-upd new file mode 100644 index 000000000..183468300 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/drivers-upd @@ -0,0 +1,19 @@ +lib/modules/drivers/chips_drv.o +lib/modules/drivers/cyrix_drv.o +lib/modules/drivers/glint_drv.o +lib/modules/drivers/mga_drv.o +lib/modules/drivers/neomagic_drv.o +lib/modules/drivers/nv_drv.o +lib/modules/drivers/r128_drv.o +lib/modules/drivers/s3virge_drv.o +lib/modules/drivers/savage_drv.o +lib/modules/drivers/sis_drv.o +lib/modules/drivers/tdfx_drv.o +lib/modules/drivers/trident_drv.o +lib/modules/drivers/tseng_drv.o +lib/modules/drivers/vga_drv.o +lib/modules/extensions/libextmod.a +lib/modules/fonts/libfreetype.a +lib/modules/input/mouse_drv.o +lib/modules/libvgahw.a +lib/modules/libxf8_16bpp.a 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 index e34b1b202..7c3d6c1f0 100644 --- 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 @@ -1,8 +1,9 @@ /* * 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 $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/host.def,v 1.1.4.1 2001/05/31 22:20:32 dawes Exp $ */ #define InstallEmptyHostDef +#define BuildBindist diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/update-upd new file mode 100644 index 000000000..b1fca057f --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-aout-ix86/update-upd @@ -0,0 +1,42 @@ +bin/SuperProbe +bin/XFree86 +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xf86cfg +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/app-defaults/XF86Cfg +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libX11.so.6.2 +lib/libXaw.a +lib/libXaw.so.6.1 +lib/libXaw.so.7.0 +lib/libXfont.a +lib/libXfont.so.1.3 +lib/libXft.a +lib/libXft.so.1.0 +lib/libfreetype.a +lib/libfreetype.so.6.0 +man/cat1/XFree86.0 +man/cat4/nv.0 +man/cat5/XF86Config.0 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 80b1f62b6..873b5a947 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,7 +1,11 @@ +.XFree86_Version bin lib/libGL.so lib/libGL.so.1 lib/libGL.so.1.2 +lib/libGLU.so +lib/libGLU.so.1 +lib/libGLU.so.1.3 lib/libICE.so lib/libICE.so.6 lib/libICE.so.6.3 @@ -37,6 +41,9 @@ lib/libXi.so.6.0 lib/libXmu.so lib/libXmu.so.6 lib/libXmu.so.6.2 +lib/libXmuu.so +lib/libXmuu.so.1 +lib/libXmuu.so.1.0 lib/libXp.so lib/libXp.so.6 lib/libXp.so.6.2 @@ -58,6 +65,9 @@ lib/libdps.so.1.0 lib/libdpstk.so lib/libdpstk.so.1 lib/libdpstk.so.1.0 +lib/libfreetype.so +lib/libfreetype.so.6 +lib/libfreetype.so.6.0 lib/liboldX.so lib/liboldX.so.6 lib/liboldX.so.6.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/drivers-upd new file mode 100644 index 000000000..183468300 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/drivers-upd @@ -0,0 +1,19 @@ +lib/modules/drivers/chips_drv.o +lib/modules/drivers/cyrix_drv.o +lib/modules/drivers/glint_drv.o +lib/modules/drivers/mga_drv.o +lib/modules/drivers/neomagic_drv.o +lib/modules/drivers/nv_drv.o +lib/modules/drivers/r128_drv.o +lib/modules/drivers/s3virge_drv.o +lib/modules/drivers/savage_drv.o +lib/modules/drivers/sis_drv.o +lib/modules/drivers/tdfx_drv.o +lib/modules/drivers/trident_drv.o +lib/modules/drivers/tseng_drv.o +lib/modules/drivers/vga_drv.o +lib/modules/extensions/libextmod.a +lib/modules/fonts/libfreetype.a +lib/modules/input/mouse_drv.o +lib/modules/libvgahw.a +lib/modules/libxf8_16bpp.a diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/host.def index a63db92a8..1a15feb97 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/host.def @@ -1,8 +1,9 @@ /* * Host.def for building NetBSD bindists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/host.def,v 1.3 2000/03/07 14:47:36 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/host.def,v 1.3.4.1 2001/05/31 22:20:32 dawes Exp $ */ #define InstallEmptyHostDef +#define BuildBindist diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/update-upd new file mode 100644 index 000000000..aabf54d7d --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/NetBSD-ix86/update-upd @@ -0,0 +1,53 @@ +bin/SuperProbe +bin/XFree86 +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xf86cfg +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/app-defaults/XF86Cfg +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libX11.so +lib/libX11.so.6 +lib/libX11.so.6.2 +lib/libXaw.a +lib/libXaw.so +lib/libXaw.so.6 +lib/libXaw.so.6.1 +lib/libXaw.so.7 +lib/libXaw.so.7.0 +lib/libXfont.a +lib/libXfont.so +lib/libXfont.so.1 +lib/libXfont.so.1.3 +lib/libXft.a +lib/libXft.so +lib/libXft.so.1 +lib/libXft.so.1.0 +lib/libfreetype.a +lib/libfreetype.so +lib/libfreetype.so.6 +lib/libfreetype.so.6.0 +man/cat1/XFree86.0 +man/cat4/nv.0 +man/cat5/XF86Config.0 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 75cc08f7e..40676c8bf 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 @@ -1,5 +1,7 @@ +.XFree86_Version bin lib/libGL.so.1.2 +lib/libGLU.so.1.3 lib/libICE.so.6.3 lib/libPEX5.so.6.0 lib/libSM.so.6.0 @@ -13,6 +15,7 @@ lib/libXfont.so.1.3 lib/libXft.so.1.0 lib/libXi.so.6.0 lib/libXmu.so.6.2 +lib/libXmuu.so.1.0 lib/libXp.so.6.2 lib/libXpm.so.4.11 lib/libXrender.so.1.0 @@ -20,5 +23,6 @@ lib/libXt.so.6.0 lib/libXtst.so.6.1 lib/libdps.so.1.0 lib/libdpstk.so.1.0 +lib/libfreetype.so.6.0 lib/liboldX.so.6.0 lib/libpsres.so.1.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/drivers-upd new file mode 100644 index 000000000..183468300 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/drivers-upd @@ -0,0 +1,19 @@ +lib/modules/drivers/chips_drv.o +lib/modules/drivers/cyrix_drv.o +lib/modules/drivers/glint_drv.o +lib/modules/drivers/mga_drv.o +lib/modules/drivers/neomagic_drv.o +lib/modules/drivers/nv_drv.o +lib/modules/drivers/r128_drv.o +lib/modules/drivers/s3virge_drv.o +lib/modules/drivers/savage_drv.o +lib/modules/drivers/sis_drv.o +lib/modules/drivers/tdfx_drv.o +lib/modules/drivers/trident_drv.o +lib/modules/drivers/tseng_drv.o +lib/modules/drivers/vga_drv.o +lib/modules/extensions/libextmod.a +lib/modules/fonts/libfreetype.a +lib/modules/input/mouse_drv.o +lib/modules/libvgahw.a +lib/modules/libxf8_16bpp.a diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/host.def index 1d3de627c..4c47461a4 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/host.def @@ -1,10 +1,11 @@ /* * Host.def for building OpenBSD/ix86 bindists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/host.def,v 1.3 2000/02/27 01:29:03 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/host.def,v 1.3.4.1 2001/05/31 22:20:33 dawes Exp $ */ #define InstallEmptyHostDef +#define BuildBindist #define ForceNormalLib YES diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/update-upd new file mode 100644 index 000000000..b1fca057f --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-ix86/update-upd @@ -0,0 +1,42 @@ +bin/SuperProbe +bin/XFree86 +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xf86cfg +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/app-defaults/XF86Cfg +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libX11.so.6.2 +lib/libXaw.a +lib/libXaw.so.6.1 +lib/libXaw.so.7.0 +lib/libXfont.a +lib/libXfont.so.1.3 +lib/libXft.a +lib/libXft.so.1.0 +lib/libfreetype.a +lib/libfreetype.so.6.0 +man/cat1/XFree86.0 +man/cat4/nv.0 +man/cat5/XF86Config.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/bin-list b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/bin-list index e5d1a9397..6451b6de6 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/bin-list @@ -1,3 +1,4 @@ +.XFree86_Version bin lib/libICE.so.6.3 lib/libPEX5.so.6.0 @@ -8,6 +9,7 @@ lib/libXaw.so.6.1 lib/libXext.so.6.3 lib/libXi.so.6.0 lib/libXmu.so.6.0 +lib/libXmuu.so.1.0 lib/libXp.so.6.2 lib/libXt.so.6.0 lib/libXtst.so.6.1 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/host.def index 11b7963e0..7b1a96939 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/host.def @@ -1,10 +1,11 @@ /* * Host.def for building OpenBSD/sparc bindists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/host.def,v 1.2 2000/02/27 01:39:18 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/OpenBSD-sparc/host.def,v 1.2.4.1 2001/05/31 22:20:34 dawes Exp $ */ #define InstallEmptyHostDef +#define BuildBindist #define ForceNormalLib YES 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 38a00bb51..38df3a2b1 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 @@ -1,6 +1,9 @@ +.XFree86_Version bin lib/libGL.so.1.2 lib/libGL.so +lib/libGLU.so.1.3 +lib/libGLU.so lib/libICE.so.6.3 lib/libICE.so lib/libPEX5.so.6.0 @@ -24,6 +27,8 @@ lib/libXi.so.6.0 lib/libXi.so lib/libXmu.so.6.2 lib/libXmu.so +lib/libXmuu.so.1.0 +lib/libXmuu.so lib/libXp.so.6.2 lib/libXp.so lib/libXpm.so.4.11 @@ -38,6 +43,8 @@ lib/libdps.so.1.0 lib/libdps.so lib/libdpstk.so.1.0 lib/libdpstk.so +lib/libfreetype.so.6.0 +lib/libfreetype.so lib/libpsres.so.1.0 lib/libpsres.so lib/liboldX.so.6.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/drivers-upd new file mode 100644 index 000000000..002f614d9 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/drivers-upd @@ -0,0 +1,20 @@ +lib/modules/drivers/chips_drv.o +lib/modules/drivers/cyrix_drv.o +lib/modules/drivers/glint_drv.o +lib/modules/drivers/i810_drv.o +lib/modules/drivers/mga_drv.o +lib/modules/drivers/neomagic_drv.o +lib/modules/drivers/nv_drv.o +lib/modules/drivers/r128_drv.o +lib/modules/drivers/s3virge_drv.o +lib/modules/drivers/savage_drv.o +lib/modules/drivers/sis_drv.o +lib/modules/drivers/tdfx_drv.o +lib/modules/drivers/trident_drv.o +lib/modules/drivers/tseng_drv.o +lib/modules/drivers/vga_drv.o +lib/modules/extensions/libextmod.a +lib/modules/fonts/libfreetype.a +lib/modules/input/mouse_drv.o +lib/modules/libvgahw.a +lib/modules/libxf8_16bpp.a diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/host.def index c89665d4b..de01db44a 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/host.def @@ -1,10 +1,11 @@ /* * Host.def for building SVR4.0 bindists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/host.def,v 1.4 2001/03/17 18:41:33 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/host.def,v 1.4.2.1 2001/05/31 22:20:35 dawes Exp $ */ #define InstallEmptyHostDef +#define BuildBindist #define ForceNormalLib YES diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/update-upd new file mode 100644 index 000000000..2265e0f4f --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/SVR4.0/update-upd @@ -0,0 +1,47 @@ +bin/SuperProbe +bin/XFree86 +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xf86cfg +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/app-defaults/XF86Cfg +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libX11.so +lib/libX11.so.6.2 +lib/libXaw.a +lib/libXaw.so +lib/libXaw.so.6.1 +lib/libXaw.so.7.0 +lib/libXfont.a +lib/libXfont.so +lib/libXfont.so.1.3 +lib/libXft.a +lib/libXft.so +lib/libXft.so.1.0 +lib/libfreetype.a +lib/libfreetype.so +lib/libfreetype.so.6.0 +man/man1/XFree86.1x +man/man4/XF86Config.4 +man/man7/nv.7 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 38a00bb51..38df3a2b1 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/bin-list @@ -1,6 +1,9 @@ +.XFree86_Version bin lib/libGL.so.1.2 lib/libGL.so +lib/libGLU.so.1.3 +lib/libGLU.so lib/libICE.so.6.3 lib/libICE.so lib/libPEX5.so.6.0 @@ -24,6 +27,8 @@ lib/libXi.so.6.0 lib/libXi.so lib/libXmu.so.6.2 lib/libXmu.so +lib/libXmuu.so.1.0 +lib/libXmuu.so lib/libXp.so.6.2 lib/libXp.so lib/libXpm.so.4.11 @@ -38,6 +43,8 @@ lib/libdps.so.1.0 lib/libdps.so lib/libdpstk.so.1.0 lib/libdpstk.so +lib/libfreetype.so.6.0 +lib/libfreetype.so lib/libpsres.so.1.0 lib/libpsres.so lib/liboldX.so.6.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/drivers-upd new file mode 100644 index 000000000..002f614d9 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/drivers-upd @@ -0,0 +1,20 @@ +lib/modules/drivers/chips_drv.o +lib/modules/drivers/cyrix_drv.o +lib/modules/drivers/glint_drv.o +lib/modules/drivers/i810_drv.o +lib/modules/drivers/mga_drv.o +lib/modules/drivers/neomagic_drv.o +lib/modules/drivers/nv_drv.o +lib/modules/drivers/r128_drv.o +lib/modules/drivers/s3virge_drv.o +lib/modules/drivers/savage_drv.o +lib/modules/drivers/sis_drv.o +lib/modules/drivers/tdfx_drv.o +lib/modules/drivers/trident_drv.o +lib/modules/drivers/tseng_drv.o +lib/modules/drivers/vga_drv.o +lib/modules/extensions/libextmod.a +lib/modules/fonts/libfreetype.a +lib/modules/input/mouse_drv.o +lib/modules/libvgahw.a +lib/modules/libxf8_16bpp.a diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/host.def index 4fba95ca7..24b6ca3ff 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/host.def @@ -1,10 +1,11 @@ /* * Host.def for building Solaris bindists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/host.def,v 1.4 2001/03/17 18:41:33 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/host.def,v 1.4.2.1 2001/05/31 22:20:35 dawes Exp $ */ #define InstallEmptyHostDef +#define BuildBindist #define ForceNormalLib YES diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/update-upd new file mode 100644 index 000000000..2265e0f4f --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/Solaris/update-upd @@ -0,0 +1,47 @@ +bin/SuperProbe +bin/XFree86 +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xf86cfg +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/app-defaults/XF86Cfg +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libX11.so +lib/libX11.so.6.2 +lib/libXaw.a +lib/libXaw.so +lib/libXaw.so.6.1 +lib/libXaw.so.7.0 +lib/libXfont.a +lib/libXfont.so +lib/libXfont.so.1.3 +lib/libXft.a +lib/libXft.so +lib/libXft.so.1.0 +lib/libfreetype.a +lib/libfreetype.so +lib/libfreetype.so.6.0 +man/man1/XFree86.1x +man/man4/XF86Config.4 +man/man7/nv.7 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 38a00bb51..38df3a2b1 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/bin-list +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/bin-list @@ -1,6 +1,9 @@ +.XFree86_Version bin lib/libGL.so.1.2 lib/libGL.so +lib/libGLU.so.1.3 +lib/libGLU.so lib/libICE.so.6.3 lib/libICE.so lib/libPEX5.so.6.0 @@ -24,6 +27,8 @@ lib/libXi.so.6.0 lib/libXi.so lib/libXmu.so.6.2 lib/libXmu.so +lib/libXmuu.so.1.0 +lib/libXmuu.so lib/libXp.so.6.2 lib/libXp.so lib/libXpm.so.4.11 @@ -38,6 +43,8 @@ lib/libdps.so.1.0 lib/libdps.so lib/libdpstk.so.1.0 lib/libdpstk.so +lib/libfreetype.so.6.0 +lib/libfreetype.so lib/libpsres.so.1.0 lib/libpsres.so lib/liboldX.so.6.0 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/drivers-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/drivers-upd new file mode 100644 index 000000000..002f614d9 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/drivers-upd @@ -0,0 +1,20 @@ +lib/modules/drivers/chips_drv.o +lib/modules/drivers/cyrix_drv.o +lib/modules/drivers/glint_drv.o +lib/modules/drivers/i810_drv.o +lib/modules/drivers/mga_drv.o +lib/modules/drivers/neomagic_drv.o +lib/modules/drivers/nv_drv.o +lib/modules/drivers/r128_drv.o +lib/modules/drivers/s3virge_drv.o +lib/modules/drivers/savage_drv.o +lib/modules/drivers/sis_drv.o +lib/modules/drivers/tdfx_drv.o +lib/modules/drivers/trident_drv.o +lib/modules/drivers/tseng_drv.o +lib/modules/drivers/vga_drv.o +lib/modules/extensions/libextmod.a +lib/modules/fonts/libfreetype.a +lib/modules/input/mouse_drv.o +lib/modules/libvgahw.a +lib/modules/libxf8_16bpp.a diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/host.def b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/host.def index 9bf96d029..b9324178c 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/host.def +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/host.def @@ -1,10 +1,11 @@ /* * Host.def for building UnixWare bindists * - * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/host.def,v 1.4 2001/03/17 18:41:33 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/host.def,v 1.4.2.1 2001/05/31 22:20:36 dawes Exp $ */ #define InstallEmptyHostDef +#define BuildBindist #define ForceNormalLib YES diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/update-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/update-upd new file mode 100644 index 000000000..2265e0f4f --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/UnixWare/update-upd @@ -0,0 +1,47 @@ +bin/SuperProbe +bin/XFree86 +bin/gccmakedep +bin/mkhtmlindex +bin/rman +bin/pswrap +bin/twm +bin/xedit +bin/xfs +bin/xf86cfg +bin/xman +bin/xterm +include/X11/Xos.h +include/X11/Xosdefs.h +include/X11/Xos_r.h +lib/X11/app-defaults/XF86Cfg +lib/X11/config/FreeBSD.cf +lib/X11/config/Imake.rules +lib/X11/config/Imake.tmpl +lib/X11/config/NetBSD.cf +lib/X11/config/OpenBSD.cf +lib/X11/config/X11.tmpl +lib/X11/config/gnu.cf +lib/X11/config/linux.cf +lib/X11/config/osf1.cf +lib/X11/config/xfree86.cf +lib/X11/xkb/rules/xfree86.lst +lib/X11/xkb/symbols/us +lib/libX11.a +lib/libX11.so +lib/libX11.so.6.2 +lib/libXaw.a +lib/libXaw.so +lib/libXaw.so.6.1 +lib/libXaw.so.7.0 +lib/libXfont.a +lib/libXfont.so +lib/libXfont.so.1.3 +lib/libXft.a +lib/libXft.so +lib/libXft.so.1.0 +lib/libfreetype.a +lib/libfreetype.so +lib/libfreetype.so.6.0 +man/man1/XFree86.1x +man/man4/XF86Config.4 +man/man7/nv.7 diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist b/xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist index e9def824a..f996b2165 100755 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist @@ -1,22 +1,39 @@ #!/bin/sh # -# $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist,v 1.4 2000/12/14 21:50:09 dawes Exp $ +# $XFree86: xc/programs/Xserver/hw/xfree86/etc/bindist/build-bindist,v 1.4.4.1 2001/05/31 22:20:25 dawes Exp $ # Usage() { - echo `basename $0` [-l] [prefix] from-dir to-dir + echo `basename $0` [-l] [-t type] [prefix] from-dir to-dir exit 1 } +args= createlist=NO +type=list -case $1 in +while [ $# != 0 ]; do + case $1 in -l) createlist=YES shift ;; -esac + -t) + shift + type=$1 + shift + ;; + *) + args="$args $1" + shift + ;; + esac +done + +if [ X"$args" != X ]; then + set - $args +fi case $# in 3) @@ -97,11 +114,11 @@ for d in $SUBDIRS; do # exit 3 else DEFPREFIX=`cat $DIRFILE` - for i in *-list; do - name=`basename $i -list` + for i in *-$type; do + name=`basename $i -$type` tarball=$PRE$name.tgz echo creating $tarball - lfile="-T $TODIR/$d/$i" + lfile="`cat $TODIR/$d/$i`" if [ -f $name-excl ]; then xfile="-X $TODIR/$d/$name-excl" else @@ -113,7 +130,7 @@ for d in $SUBDIRS; do PREFIX=$DEFPREFIX fi (cd $FROMDIR/$PREFIX - $TAR $TAROPTS -f $TODIR/$BINDIR/$tarball $lfile $xfile + $TAR $TAROPTS -f $TODIR/$BINDIR/$tarball $xfile $lfile ) done fi diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/docupd-upd b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/docupd-upd new file mode 100644 index 000000000..112c38314 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/docupd-upd @@ -0,0 +1,40 @@ +lib/X11/doc/BugReport +lib/X11/doc/DESIGN +lib/X11/doc/Install +lib/X11/doc/LICENSE +lib/X11/doc/README +lib/X11/doc/README.NetBSD +lib/X11/doc/README.OpenBSD +lib/X11/doc/README.fonts +lib/X11/doc/RELNOTES +lib/X11/doc/Status +lib/X11/doc/Versions +lib/X11/doc/PostScript/DESIGN.ps +lib/X11/doc/PostScript/Install.ps +lib/X11/doc/PostScript/LICENSE.ps +lib/X11/doc/PostScript/README.ps +lib/X11/doc/PostScript/NetBSD.ps +lib/X11/doc/PostScript/OpenBSD.ps +lib/X11/doc/PostScript/RELNOTES.ps +lib/X11/doc/PostScript/Status.ps +lib/X11/doc/PostScript/Versions.ps +lib/X11/doc/PostScript/fonts.ps +lib/X11/doc/html/DESIGN*.html +lib/X11/doc/html/Install*.html +lib/X11/doc/html/LICENSE*.html +lib/X11/doc/html/NetBSD*.html +lib/X11/doc/html/OpenBSD*.html +lib/X11/doc/html/README*.html +lib/X11/doc/html/RELNOTES*.html +lib/X11/doc/html/Status*.html +lib/X11/doc/html/Versions*.html +lib/X11/doc/html/XF86Config.5.html +lib/X11/doc/html/XFree86.1.html +lib/X11/doc/html/index.html +lib/X11/doc/html/fonts*.html +lib/X11/doc/html/manindex1.html +lib/X11/doc/html/manindex3.html +lib/X11/doc/html/manindex4.html +lib/X11/doc/html/manindex5.html +lib/X11/doc/html/manindex7.html +lib/X11/doc/html/nv.4.html diff --git a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/extras b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/extras index 41ca56c8c..f02d11aaa 100644 --- a/xc/programs/Xserver/hw/xfree86/etc/bindist/common/extras +++ b/xc/programs/Xserver/hw/xfree86/etc/bindist/common/extras @@ -1,5 +1,4 @@ lib/X11/doc/BugReport -lib/X11/doc/RELNOTES lib/X11/doc/README lib/X11/doc/Install lib/X11/etc/Xinstall.sh diff --git a/xc/programs/Xserver/hw/xfree86/input/digitaledge/DigitalEdge.c b/xc/programs/Xserver/hw/xfree86/input/digitaledge/DigitalEdge.c index d223c14f8..4656d6c33 100644 --- a/xc/programs/Xserver/hw/xfree86/input/digitaledge/DigitalEdge.c +++ b/xc/programs/Xserver/hw/xfree86/input/digitaledge/DigitalEdge.c @@ -30,7 +30,7 @@ * Probably buggy as hell, no idea what the initialisation strings are, * no idea how to ack it. If the tablet stops responding power cycle it. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/input/digitaledge/DigitalEdge.c,v 1.3 2001/04/01 14:00:12 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/input/digitaledge/DigitalEdge.c,v 1.4 2001/05/15 18:22:22 paulo Exp $ */ #include "xf86Version.h" @@ -1440,7 +1440,6 @@ InputDriverRec DIGITALEDGE = { static void xf86SumUnplug(pointer p) { - DBG(1, ErrorF("xf86SumUnplug\n")); } /* @@ -1454,8 +1453,6 @@ xf86SumPlug(pointer module, int *errmaj, int *errmin) { - DBG(1, ErrorF("xf86SumPlug\n")); - xf86AddInputDriver(&DIGITALEDGE, module, 0); return module; diff --git a/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c b/xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c index 224a0e350..09e65f9d6 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.41 2001/03/07 16:21:05 paulo Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/input/mouse/mouse.c,v 1.43 2001/05/18 20:22:30 tsi Exp $ */ /* * * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. @@ -63,6 +63,7 @@ #include "mousePriv.h" #include "mipointer.h" +static const OptionInfoRec *MouseAvailableOptions(void *unused); static InputInfoPtr MousePreInit(InputDriverPtr drv, IDevPtr dev, int flags); #if 0 static void MouseUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags); @@ -89,6 +90,65 @@ InputDriverRec MOUSE = { 0 }; +typedef enum { + OPTION_ALWAYS_CORE, + OPTION_SEND_CORE_EVENTS, + OPTION_CORE_POINTER, + OPTION_SEND_DRAG_EVENTS, + OPTION_HISTORY_SIZE, + OPTION_DEVICE, + OPTION_PROTOCOL, + OPTION_BUTTONS, + OPTION_EMULATE_3_BUTTONS, + OPTION_EMULATE_3_TIMEOUT, + OPTION_CHORD_MIDDLE, + OPTION_FLIP_XY, + OPTION_INV_X, + OPTION_INV_Y, + OPTION_Z_AXIS_MAPPING, + OPTION_SAMPLE_RATE, + OPTION_RESOLUTION, + OPTION_CLEAR_DTR, + OPTION_CLEAR_RTS, + OPTION_BAUD_RATE, + OPTION_DATA_BITS, + OPTION_STOP_BITS, + OPTION_PARITY, + OPTION_FLOW_CONTROL, + OPTION_VTIME, + OPTION_VMIN +} MouseOpts; + +static const OptionInfoRec MouseOptions[] = { + { OPTION_ALWAYS_CORE, "AlwaysCore", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_SEND_CORE_EVENTS, "SendCoreEvents", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_CORE_POINTER, "CorePointer", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_SEND_DRAG_EVENTS, "SendDragEvents", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_HISTORY_SIZE, "HistorySize", OPTV_INTEGER, {0}, FALSE }, + { OPTION_DEVICE, "Device", OPTV_STRING, {0}, FALSE }, + { OPTION_PROTOCOL, "Protocol", OPTV_STRING, {0}, FALSE }, + { OPTION_BUTTONS, "Buttons", OPTV_INTEGER, {0}, FALSE }, + { OPTION_EMULATE_3_BUTTONS, "Emulate3Buttons",OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_EMULATE_3_TIMEOUT, "Emulate3Timeout",OPTV_INTEGER, {0}, FALSE }, + { OPTION_CHORD_MIDDLE, "ChordMiddle", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_FLIP_XY, "FlipXY", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_INV_X, "InvX", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_INV_Y, "InvY", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_Z_AXIS_MAPPING, "ZAxisMapping", OPTV_STRING, {0}, FALSE }, + { OPTION_SAMPLE_RATE, "SampleRate", OPTV_INTEGER, {0}, FALSE }, + { OPTION_RESOLUTION, "Resolution", OPTV_INTEGER, {0}, FALSE }, + { OPTION_CLEAR_DTR, "ClearDTR", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_CLEAR_RTS, "ClearRTS", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_BAUD_RATE, "BaudRate", OPTV_INTEGER, {0}, FALSE }, + { OPTION_DATA_BITS, "DataBits", OPTV_INTEGER, {0}, FALSE }, + { OPTION_STOP_BITS, "StopBits", OPTV_INTEGER, {0}, FALSE }, + { OPTION_PARITY, "Parity", OPTV_STRING, {0}, FALSE }, + { OPTION_FLOW_CONTROL, "FlowControl", OPTV_STRING, {0}, FALSE }, + { OPTION_VTIME, "VTime", OPTV_INTEGER, {0}, FALSE }, + { OPTION_VMIN, "VMin", OPTV_INTEGER, {0}, FALSE }, + { -1, NULL, OPTV_NONE, {0}, FALSE } +}; + /* * Microsoft (all serial models), Logitech MouseMan, First Mouse, etc, * ALPS GlidePoint, Thinking Mouse. @@ -198,6 +258,13 @@ static MouseProtocolRec mouseProtocols[] = { { NULL, MSE_NONE, NULL, PROT_UNKNOWN } }; +/*ARGSUSED*/ +static const OptionInfoRec * +MouseAvailableOptions(void *unused) +{ + return (MouseOptions); +} + static MouseProtocolID ProtocolNameToID(const char *name) { @@ -1767,7 +1834,7 @@ buttonTimer(OsTimerPtr timer, CARD32 now, pointer arg) sigstate = xf86BlockSIGIO (); - if ((id = stateTab[pMse->emulateState][4][0]) != 0) {ErrorF("0\n"); + if ((id = stateTab[pMse->emulateState][4][0]) != 0) { xf86PostButtonEvent(pInfo->dev, 0, abs(id), (id >= 0), 0, 0); pMse->emulateState = stateTab[pMse->emulateState][4][2]; } else { @@ -1905,6 +1972,14 @@ MousePostEvent(InputInfoPtr pInfo, int buttons, int dx, int dy, int dz, int dw) } #ifdef XFree86LOADER +ModuleInfoRec MouseInfo = { + 1, + "MOUSE", + NULL, + 0, + MouseAvailableOptions, +}; + static void xf86MouseUnplug(pointer p) { @@ -1915,6 +1990,16 @@ xf86MousePlug(pointer module, int *errmaj, int *errmin) { + static Bool Initialised = FALSE; + + if (!Initialised) { + Initialised = TRUE; +#ifndef REMOVE_LOADER_CHECK_MODULE_INFO + if (xf86LoaderCheckSymbol("xf86AddModuleInfo")) +#endif + xf86AddModuleInfo(&MouseInfo, module); + } + xf86AddInputDriver(&MOUSE, module, 0); return module; diff --git a/xc/programs/Xserver/hw/xfree86/input/spaceorb/spaceorb.c b/xc/programs/Xserver/hw/xfree86/input/spaceorb/spaceorb.c index 8f7a88ec7..9be572756 100644 --- a/xc/programs/Xserver/hw/xfree86/input/spaceorb/spaceorb.c +++ b/xc/programs/Xserver/hw/xfree86/input/spaceorb/spaceorb.c @@ -24,7 +24,7 @@ * in this Software without prior written authorization from Metro Link. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/input/spaceorb/spaceorb.c,v 1.10 2000/08/11 19:10:47 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/input/spaceorb/spaceorb.c,v 1.11 2001/05/15 18:22:22 paulo Exp $ */ #define _SPACEORB_C_ /***************************************************************************** @@ -247,16 +247,19 @@ SpaceorbPreInit(InputDriverPtr drv, IDevPtr dev, int flags) static void TearDownProc( pointer p ) { - InputInfoPtr pInfo = (InputInfoPtr) p; - SPACEORBPrivatePtr priv = (SPACEORBPrivatePtr) pInfo->private; - - DeviceOff (pInfo->dev); + if (!xf86ServerIsOnlyDetecting()) { + + InputInfoPtr pInfo = (InputInfoPtr) p; + SPACEORBPrivatePtr priv = (SPACEORBPrivatePtr) pInfo->private; + + DeviceOff (pInfo->dev); - xf86CloseSerial (pInfo->fd); - XisbFree (priv->buffer); - xfree (priv); - xfree (pInfo->name); - xfree (pInfo); + xf86CloseSerial (pInfo->fd); + XisbFree (priv->buffer); + xfree (priv); + xfree (pInfo->name); + xfree (pInfo); + } } static Bool diff --git a/xc/programs/Xserver/hw/xfree86/input/summa/xf86Summa.c b/xc/programs/Xserver/hw/xfree86/input/summa/xf86Summa.c index 14a364218..9eb4bc8d3 100644 --- a/xc/programs/Xserver/hw/xfree86/input/summa/xf86Summa.c +++ b/xc/programs/Xserver/hw/xfree86/input/summa/xf86Summa.c @@ -24,7 +24,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/input/summa/xf86Summa.c,v 1.9 2001/04/23 16:17:11 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/input/summa/xf86Summa.c,v 1.10 2001/05/15 18:22:22 paulo Exp $ */ static const char identification[] = "$Identification: 18 $"; @@ -1614,7 +1614,6 @@ InputDriverRec SUMMA = { static void xf86SumUnplug(pointer p) { - DBG(2, ErrorF("xf86SumUnplug\n")); } /* @@ -1628,8 +1627,6 @@ xf86SumPlug(pointer module, int *errmaj, int *errmin) { - DBG(2, ErrorF("xf86SumPlug\n")); - xf86AddInputDriver(&SUMMA, module, 0); return module; diff --git a/xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c b/xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c index ed9aa453c..ec538f018 100644 --- a/xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c +++ b/xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c @@ -1,6 +1,6 @@ /* $XConsortium: xf86Wacom.c /main/20 1996/10/27 11:05:20 kaleb $ */ /* - * Copyright 1995-2000 by Frederic Lepied, France. <Lepied@XFree86.org> + * Copyright 1995-2001 by Frederic Lepied, France. <Lepied@XFree86.org> * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -22,7 +22,7 @@ * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c,v 1.26 2001/04/01 14:00:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/input/wacom/xf86Wacom.c,v 1.27 2001/05/18 23:35:33 dawes Exp $ */ /* * This driver is only able to handle the Wacom IV and Wacom V protocols. @@ -33,30 +33,16 @@ * Many thanks to Dave Fleck from Wacom for the help provided to * build this driver. * - * Modified for Linux USB by MATSUMURA Namihiko. + * Modified for Linux USB by MATSUMURA Namihiko, * Daniel Egger, Germany. <egger@suse.de>, - * Frederic Lepied <lepied@xfree86.org>. + * Frederic Lepied <lepied@xfree86.org>, * Brion Vibber <brion@pobox.com>, - * Aaron Optimizer Digulla <digulla@hepe.com> + * Aaron Optimizer Digulla <digulla@hepe.com>, + * Jonathan Layes <jonathan@layes.com>. * */ -/* - * Bugs fixed by Steve Day (Updated: Apr 5 1999) - * - * MaxX and MaxY values that the Wacom returns are now converted from - * 1270lpi to the actual X and Y resolutions that the tablet is using. - * - * Buffer bug fixed when reading X and Y resolutions from config - * string, now receives the true X and Y resolutions. This has the - * side effect of being more compatible with other models of Wacom - * that have varying lengths of headers. - * - * <steve@lineardesigns.co.uk> - * - */ - -static const char identification[] = "$Identification: 20 $"; +static const char identification[] = "$Identification: 23 $"; #include "xf86Version.h" @@ -68,6 +54,9 @@ static const char identification[] = "$Identification: 20 $"; #include <asm/types.h> #include <linux/input.h> +/* max number of input events to read in one read call */ +#define MAX_EVENTS 50 + /* keithp - a hack to avoid redefinitions of these in xf86str.h */ #ifdef BUS_PCI #undef BUS_PCI @@ -170,6 +159,7 @@ static InputDriverPtr wcmDrv; #include "xf86_Config.h" #include "xf86Xinput.h" #include "atKeynames.h" +#include "xf86Version.h" #endif #if !defined(sun) || defined(i386) @@ -270,7 +260,8 @@ typedef struct double factorY; /* Y factor */ unsigned int serial; /* device serial number */ int initNumber; /* magic number for the init phasis */ - + int screen_no; /* associated screen */ + struct _WacomCommonRec *common; /* common info pointer */ /* state fields */ @@ -344,6 +335,7 @@ typedef struct _WacomCommonRec #define RESOLUTION_Y 21 #define RESOLUTION_Z 22 #define USB 23 +#define SCREEN_NO 24 #if !defined(sun) || defined(i386) static SymTabRec WcmTab[] = { @@ -371,6 +363,7 @@ static SymTabRec WcmTab[] = { { RESOLUTION_Y, "resolutiony" }, { RESOLUTION_Z, "resolutionz" }, { USB, "usb" }, + { SCREEN_NO, "screenno" }, { -1, "" } }; @@ -523,6 +516,13 @@ static KeySymsRec wacom_keysyms = { /****************************************************************************** * external declarations *****************************************************************************/ + +#ifdef LINUX_INPUT +static void xf86WcmReadUSBInput(LocalDevicePtr); +static Bool xf86WcmUSBOpen(LocalDevicePtr); +#endif + + #ifndef XFREE86_V4 #if defined(sun) && !defined(i386) @@ -819,7 +819,7 @@ xf86WcmConfig(LocalDevicePtr *array, case USB: #ifdef LINUX_INPUT - local->read_input=xf86WcmReadUSBInput; + dev->read_input=xf86WcmReadUSBInput; common->wcmOpen=xf86WcmUSBOpen; ErrorF("%s Wacom reading USB link\n", XCONFIG_GIVEN); #else @@ -827,6 +827,15 @@ xf86WcmConfig(LocalDevicePtr *array, #endif break; + case SCREEN_NO: + if (xf86GetToken(NULL) != NUMBER) + xf86ConfigError("Option number expected"); + priv->screen_no = val->num; + if (xf86Verbose) + ErrorF("%s Wacom attached screen = %d\n", XCONFIG_GIVEN, + priv->screen_no); + break; + case EOF: FatalError("Unexpected EOF (missing EndSubSection)"); break; @@ -1163,16 +1172,25 @@ xf86WcmConvert(LocalDevicePtr local, int* y) { WacomDevicePtr priv = (WacomDevicePtr) local->private; - + int width, height; + DBG(6, ErrorF("xf86WcmConvert\n")); if (first != 0 || num == 1) return FALSE; #ifdef XFREE86_V4 - priv->factorX = ((double) miPointerCurrentScreen()->width) + if (priv->screen_no != -1) { + width = screenInfo.screens[priv->screen_no]->width; + height = screenInfo.screens[priv->screen_no]->height; + } else { + width = miPointerCurrentScreen()->width; + height = miPointerCurrentScreen()->height; + } + + priv->factorX = ((double) width) / (priv->bottomX - priv->topX); - priv->factorY = ((double) miPointerCurrentScreen()->height) + priv->factorY = ((double) height) / (priv->bottomY - priv->topY); #endif @@ -1181,7 +1199,11 @@ xf86WcmConvert(LocalDevicePtr local, DBG(6, ErrorF("Wacom converted v0=%d v1=%d to x=%d y=%d\n", v0, v1, *x, *y)); - +#ifdef XFREE86_V4 + if (priv->screen_no != -1) { + xf86XInputSetScreen(local, priv->screen_no, *x, *y); + } +#endif return TRUE; } @@ -2083,6 +2105,31 @@ xf86WcmReadInput(LocalDevicePtr local) /* *************************************************************************** * + * xf86WcmIsUSBLine -- + * Test if the attached device is a USB one. + * + *************************************************************************** + */ +static int +xf86WcmIsUSBLine(int fd) +{ + int version; + int err; + + SYSCALL(err = ioctl(fd, EVIOCGVERSION, &version)); + + if (!err) { + ErrorF("%s Wacom Kernel Input driver version is %d.%d.%d\n", XCONFIG_PROBED, + version >> 16, (version >> 8) & 0xff, version & 0xff); + return 1; + } else { + return 0; + } +} + +/* + *************************************************************************** + * * xf86WcmReadUSBInput -- * Read the new events from the device, and enqueue them. * @@ -2106,11 +2153,11 @@ xf86WcmReadUSBInput(LocalDevicePtr local) ssize_t len; int idx; struct input_event * event; - char eventbuf[BUFFER_SIZE]; + char eventbuf[sizeof(struct input_event) * MAX_EVENTS]; #define MOD_BUTTONS(bit, value) \ { int _b=bit, _v=value; buttons = (((_v) != 0) ? (buttons | _b) : (buttons & ~ _b)); } - SYSCALL(len = read(local->fd, eventbuf, BUFFER_SIZE)); + SYSCALL(len = read(local->fd, eventbuf, sizeof(eventbuf))); if (len <= 0) { ErrorF("Error reading wacom device : %s\n", strerror(errno)); @@ -2119,11 +2166,11 @@ xf86WcmReadUSBInput(LocalDevicePtr local) for (event=(struct input_event *)eventbuf; event<(struct input_event *)(eventbuf+len); event++) { - DBG(10, ErrorF("event->type=%d\n", event->type)); + DBG(10, ErrorF("xf86WcmReadUSBInput event->type=%d\n", event->type)); switch (event->type) { case EV_ABS: - DBG(10, ErrorF("event->code=%d\n", event->code)); + DBG(10, ErrorF("xf86WcmReadUSBInput event->code=%d\n", event->code)); switch (event->code) { case ABS_X: x = event->value; @@ -2134,6 +2181,7 @@ xf86WcmReadUSBInput(LocalDevicePtr local) break; case ABS_TILT_X: + case ABS_RZ: tilt_x = event->value; break; @@ -2143,11 +2191,23 @@ xf86WcmReadUSBInput(LocalDevicePtr local) case ABS_PRESSURE: pressure = event->value; + MOD_BUTTONS (1, event->value > common->wcmThreshold ? 1 : 0); break; case ABS_DISTANCE: /* This is not sent by the driver */ break; + + case ABS_MISC: + serial = event->value; + DBG(10, ErrorF("wacom tool serial id=%d\n", serial)); + break; + + case ABS_WHEEL: + case ABS_THROTTLE: + wheel = event->value; + break; + } break; /* EV_ABS */ @@ -2165,22 +2225,29 @@ xf86WcmReadUSBInput(LocalDevicePtr local) case EV_KEY: switch (event->code) { case BTN_TOOL_PEN: + case BTN_TOOL_PENCIL: + case BTN_TOOL_BRUSH: + case BTN_TOOL_AIRBRUSH: + DBG(10, ErrorF("USB Stylus detected %x\n", event->code)); common->wcmIndex = STYLUS_ID; is_proximity = (event->value != 0); break; case BTN_TOOL_RUBBER: + DBG(10, ErrorF("USB eraser detected %x\n", event->code)); common->wcmIndex = ERASER_ID; is_proximity = (event->value != 0); break; case BTN_TOOL_MOUSE: + case BTN_TOOL_LENS: + DBG(10, ErrorF("USB mouse detected %x\n", event->code)); common->wcmIndex = CURSOR_ID; is_proximity = (event->value != 0); break; case BTN_TOUCH: - MOD_BUTTONS (1, event->value); + /* we use the pressure to determine the button 1 */ break; case BTN_STYLUS: @@ -2195,17 +2262,30 @@ xf86WcmReadUSBInput(LocalDevicePtr local) MOD_BUTTONS (1, event->value); break; - case BTN_RIGHT: + case BTN_MIDDLE: MOD_BUTTONS (2, event->value); break; - case BTN_MIDDLE: + case BTN_RIGHT: MOD_BUTTONS (4, event->value); break; + + case BTN_SIDE: + MOD_BUTTONS (8, event->value); + break; + + case BTN_EXTRA: + MOD_BUTTONS (16, event->value); + break; } break; /* EV_KEY */ - } + } /* switch event->type */ + /* ABS_MISC is the event terminator */ + if (event->type != EV_ABS || event->code != ABS_MISC) { + continue; + } + if ((is_proximity == priv->oldProximity) && (buttons == priv->oldButtons) && (ABS(x - priv->oldX) <= common->wcmSuppress) && @@ -2255,12 +2335,23 @@ xf86WcmReadUSBInput(LocalDevicePtr local) * *************************************************************************** */ + +#define BITS_PER_LONG (sizeof(long) * 8) +#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) +#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1) +#define OFF(x) ((x)%BITS_PER_LONG) +#define LONG(x) ((x)/BITS_PER_LONG) + static Bool xf86WcmUSBOpen(LocalDevicePtr local) { int err = 0; WacomDevicePtr priv = (WacomDevicePtr)local->private; WacomCommonPtr common = priv->common; + char name[256] = "Unknown"; + int abs[5]; + unsigned long bit[EV_MAX][NBITS(KEY_MAX)]; + int i, j; #ifdef XFREE86_V4 local->fd = xf86OpenSerial(local->options); @@ -2272,6 +2363,42 @@ xf86WcmUSBOpen(LocalDevicePtr local) return !Success; } + ioctl(local->fd, EVIOCGNAME(sizeof(name)), name); + ErrorF("%s Wacom Kernel Input device name: \"%s\"\n", XCONFIG_PROBED, name); + + memset(bit, 0, sizeof(bit)); + ioctl(local->fd, EVIOCGBIT(0, EV_MAX), bit[0]); + + for (i = 0; i < EV_MAX; i++) + if (test_bit(i, bit[0])) { + ioctl(local->fd, EVIOCGBIT(i, KEY_MAX), bit[i]); + for (j = 0; j < KEY_MAX; j++) + if (test_bit(j, bit[i])) { + if (i == EV_ABS) { + ioctl(local->fd, EVIOCGABS(j), abs); + switch (j) { + case ABS_X: + if (common->wcmMaxX == 0) { + common->wcmMaxX = abs[2]; + } + break; + + case ABS_Y: + if (common->wcmMaxY == 0) { + common->wcmMaxY = abs[2]; + } + break; + + case ABS_Z: + if (common->wcmMaxZ == DEFAULT_MAXZ) { + common->wcmMaxZ = abs[2]; + } + break; + } + } + } + } + DBG(2, ErrorF("setup is max X=%d max Y=%d resol X=%d resol Y=%d\n", common->wcmMaxX, common->wcmMaxY, common->wcmResolX, common->wcmResolY)); @@ -2314,6 +2441,9 @@ xf86WcmUSBOpen(LocalDevicePtr local) return !Success; } + /* to have the button field handled as a bit field */ + common->wcmProtocolLevel = 5; + return Success; } @@ -2386,6 +2516,23 @@ xf86WcmOpen(LocalDevicePtr local) return !Success; } +#ifdef LINUX_INPUT + DBG(1, ErrorF("testing USB\n")); + + if (xf86WcmIsUSBLine(local->fd)) { + int loop; + + SYSCALL(close(local->fd)); + + for(loop=0; loop<common->wcmNumDevices; loop++) { + common->wcmDevices[loop]->read_input=xf86WcmReadUSBInput; + } + common->wcmOpen=xf86WcmUSBOpen; + + return xf86WcmUSBOpen(local); + } +#endif + DBG(1, ErrorF("initializing tablet\n")); /* Set the speed of the serial link to 38400 */ @@ -2782,6 +2929,7 @@ xf86WcmOpenDevice(DeviceIntPtr pWcm) double screenRatio, tabletRatio; int gap; int loop; + int screen_idx = 0; if (local->fd < 0) { if (common->wcmInitNumber > 2 || @@ -2840,12 +2988,24 @@ xf86WcmOpenDevice(DeviceIntPtr pWcm) priv->bottomY, common->wcmMaxY); priv->bottomY = common->wcmMaxY; } - + + if (priv->screen_no != -1 && + (priv->screen_no >= screenInfo.numScreens || + priv->screen_no < 0)) { + ErrorF("%s: invalid screen number %d, resetting to 0\n", + local->name, priv->screen_no); + priv->screen_no = 0; + } + /* Calculate the ratio according to KeepShape, TopX and TopY */ + if (priv->screen_no != -1) { + screen_idx = priv->screen_no; + } + if (priv->flags & KEEP_SHAPE_FLAG) { - screenRatio = ((double) screenInfo.screens[0]->width) - / screenInfo.screens[0]->height; + screenRatio = ((double) screenInfo.screens[screen_idx]->width) + / screenInfo.screens[screen_idx]->height; tabletRatio = ((double) (common->wcmMaxX - priv->topX)) / (common->wcmMaxY - priv->topY); @@ -3213,6 +3373,9 @@ xf86WcmAllocate(char * name, local->name = name; local->flags = 0; +#ifndef XFREE86_V4 + local->device_config = xf86WcmConfig; +#endif local->device_control = xf86WcmProc; local->read_input = xf86WcmReadInput; local->control_proc = xf86WcmChangeControl; @@ -3247,6 +3410,7 @@ xf86WcmAllocate(char * name, priv->oldProximity = 0; /* previous proximity */ priv->serial = 0; /* serial number */ priv->initNumber = 0; /* magic number for the init phasis */ + priv->screen_no = -1; /* associated screen */ common->wcmDevice = ""; /* device file name */ common->wcmSuppress = -1; /* transmit position if increment is superior */ @@ -3492,7 +3656,7 @@ xf86WcmInit(InputDriverPtr drv, while(localDevices) { if ((local != localDevices) && - (localDevices->read_input == xf86WcmReadInput) && + (localDevices->device_control == xf86WcmProc) && (strcmp(((WacomDevicePtr)localDevices->private)->common->wcmDevice, common->wcmDevice) == 0)) { DBG(2, ErrorF("xf86WcmConfig wacom port share between" @@ -3507,7 +3671,7 @@ xf86WcmInit(InputDriverPtr drv, sizeof(LocalDevicePtr) * common->wcmNumDevices); common->wcmDevices[common->wcmNumDevices - 1] = local; break; - } + } localDevices = localDevices->next; } @@ -3519,7 +3683,7 @@ xf86WcmInit(InputDriverPtr drv, xf86Msg(X_CONFIG, "%s serial device is %s\n", dev->identifier, common->wcmDevice); - debug_level = xf86SetIntOption(local->options, "DebugLevel", 0); + debug_level = xf86SetIntOption(local->options, "DebugLevel", debug_level); if (debug_level > 0) { xf86Msg(X_CONFIG, "WACOM: debug level set to %d\n", debug_level); } @@ -3539,26 +3703,33 @@ xf86WcmInit(InputDriverPtr drv, xf86Msg(X_CONFIG, "%s is in %s mode\n", local->name, (priv->flags & ABSOLUTE_FLAG) ? "absolute" : "relative"); - common->wcmSuppress = xf86SetIntOption(local->options, "Suppress", -1); + common->wcmSuppress = xf86SetIntOption(local->options, "Suppress", common->wcmSuppress); if (common->wcmSuppress != -1) { xf86Msg(X_CONFIG, "WACOM: suppress value is %d\n", XCONFIG_GIVEN, common->wcmSuppress); } - if (xf86SetBoolOption(local->options, "Tilt", 0)) { + if (xf86SetBoolOption(local->options, "Tilt", (common->wcmFlags & TILT_FLAG))) { common->wcmFlags |= TILT_FLAG; } - if (xf86SetBoolOption(local->options, "USB", 0)) { #ifdef LINUX_INPUT + if (xf86SetBoolOption(local->options, "USB", (common->wcmOpen == xf86WcmUSBOpen))) { local->read_input=xf86WcmReadUSBInput; common->wcmOpen=xf86WcmUSBOpen; xf86Msg(X_CONFIG, "%s: reading USB link\n", dev->identifier); #else + if (xf86SetBoolOption(local->options, "USB", 0)) { ErrorF("The USB version of the driver isn't available for your platform\n"); #endif } + priv->screen_no = xf86SetIntOption(local->options, "ScreenNo", -1); + if (priv->screen_no != -1) { + xf86Msg(X_CONFIG, "%s: attached screen number %d\n", dev->identifier, + priv->screen_no); + } + if (xf86SetBoolOption(local->options, "KeepShape", 0)) { priv->flags |= KEEP_SHAPE_FLAG; xf86Msg(X_CONFIG, "%s: keeps shape\n", dev->identifier); @@ -3587,37 +3758,37 @@ xf86WcmInit(InputDriverPtr drv, xf86Msg(X_CONFIG, "%s: serial number = %u\n", dev->identifier, priv->serial); } - common->wcmThreshold = xf86SetIntOption(local->options, "Threshold", INVALID_THRESHOLD); + common->wcmThreshold = xf86SetIntOption(local->options, "Threshold", common->wcmThreshold); if (common->wcmThreshold != INVALID_THRESHOLD) { xf86Msg(X_CONFIG, "%s: threshold = %d\n", dev->identifier, common->wcmThreshold); } - common->wcmMaxX = xf86SetIntOption(local->options, "MaxX", 0); + common->wcmMaxX = xf86SetIntOption(local->options, "MaxX", common->wcmMaxX); if (common->wcmMaxX != 0) { xf86Msg(X_CONFIG, "%s: max x = %d\n", dev->identifier, common->wcmMaxX); } - common->wcmMaxY = xf86SetIntOption(local->options, "MaxY", 0); + common->wcmMaxY = xf86SetIntOption(local->options, "MaxY", common->wcmMaxY); if (common->wcmMaxY != 0) { xf86Msg(X_CONFIG, "%s: max x = %d\n", dev->identifier, common->wcmMaxY); } - common->wcmMaxZ = xf86SetIntOption(local->options, "MaxZ", DEFAULT_MAXZ); + common->wcmMaxZ = xf86SetIntOption(local->options, "MaxZ", common->wcmMaxZ); if (common->wcmMaxZ != DEFAULT_MAXZ) { xf86Msg(X_CONFIG, "%s: max x = %d\n", dev->identifier, common->wcmMaxZ); } - common->wcmResolX = xf86SetIntOption(local->options, "ResolutionX", 0); + common->wcmResolX = xf86SetIntOption(local->options, "ResolutionX", common->wcmResolX); if (common->wcmResolX != 0) { xf86Msg(X_CONFIG, "%s: resol x = %d\n", dev->identifier, common->wcmResolX); } - common->wcmResolY = xf86SetIntOption(local->options, "ResolutionY", 0); + common->wcmResolY = xf86SetIntOption(local->options, "ResolutionY", common->wcmResolY); if (common->wcmResolY != 0) { xf86Msg(X_CONFIG, "%s: resol x = %d\n", dev->identifier, common->wcmResolY); } - common->wcmResolZ = xf86SetIntOption(local->options, "ResolutionZ", 0); + common->wcmResolZ = xf86SetIntOption(local->options, "ResolutionZ", common->wcmResolZ); if (common->wcmResolZ != 0) { xf86Msg(X_CONFIG, "%s: resol x = %d\n", dev->identifier, common->wcmResolZ); @@ -3704,8 +3875,8 @@ xf86WcmPlug(pointer module, int *errmaj, int *errmin) { - DBG(1, ErrorF("xf86WcmPlug\n")); - + xf86Msg(X_INFO, "Wacom driver level: %s\n", identification+strlen("$Identification: ")); + xf86AddInputDriver(&WACOM, module, 0); return module; diff --git a/xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO b/xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO index 4bd2f4356..bba0c774f 100644 --- a/xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO +++ b/xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO @@ -216,13 +216,13 @@ The struct vga is used to hold the state of the legacy VGA access registers if a legacy VGA device exists. xf86InitInt10() should return a pointer to the xf86Int10InfoRec allocated. -2. void MapCurrentInt10(xf86Int10InfoPtr pInt); +2. Bool MapCurrentInt10(xf86Int10InfoPtr pInt); In case a platform specific mapping has to be performed to map the memory allocated for the real mode memory environment into a specific location prior to executing the x86 real mode code a function - void MapCurrentInt10(xf86Int10InfoPtr pInt); + Bool MapCurrentInt10(xf86Int10InfoPtr pInt); has to be provided. It will be called by a helper function whenever the active entity changes. If the vm86 mode is used it is most likely @@ -341,4 +341,4 @@ XF86_AL,XF86_BL,XF86_CL,XF86_DL to access the lower byte of the AX,BX,CX and DX register. -$XFree86: xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO,v 1.2 2000/02/08 13:13:22 eich Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/int10/INT10.HOWTO,v 1.3 2001/04/30 14:34:57 tsi Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/int10/generic.c b/xc/programs/Xserver/hw/xfree86/int10/generic.c index 0cde994a1..f5f48601b 100644 --- a/xc/programs/Xserver/hw/xfree86/int10/generic.c +++ b/xc/programs/Xserver/hw/xfree86/int10/generic.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/generic.c,v 1.18 2001/04/09 09:38:58 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/generic.c,v 1.22.2.1 2001/05/28 14:23:39 eich Exp $ */ /* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment @@ -52,48 +52,29 @@ static void UnmapVRam(xf86Int10InfoPtr pInt); static void *sysMem = NULL; -typedef enum { - INT10OPT_NOINT10 -} INT10Opts; - -static OptionInfoRec INT10Options[] = { - { INT10OPT_NOINT10, "NoInt10", OPTV_BOOLEAN, {0}, FALSE }, - { -1, NULL, OPTV_NONE, {0}, FALSE }, -}; - -#define nINT10Options (sizeof(INT10Options) / sizeof(INT10Options[0])) - xf86Int10InfoPtr xf86InitInt10(int entityIndex) { xf86Int10InfoPtr pInt; - ScrnInfoPtr pScrn; int screen; void* base = 0; void* vbiosMem = 0; + void* options = NULL; legacyVGARec vga; + xf86int10BiosLocation bios; + #ifdef _PC CARD32 cs; #endif - /* Default Int10 enabled. */ - Bool noint10 = FALSE; - OptionInfoRec options[nINT10Options]; - - pScrn = (xf86FindScreenForEntity(entityIndex)); - - (void)memcpy(options, INT10Options, sizeof(INT10Options)); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); - - xf86GetOptValBool(options, INT10OPT_NOINT10, &noint10); - - if (noint10) - return NULL; - screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex; - if (int10skip(xf86Screens[screen],entityIndex)) + options = xf86HandleInt10Options(xf86Screens[screen],entityIndex); + + if (int10skip(options)) { + xfree(options); return NULL; - + } + pInt = (xf86Int10InfoPtr)xnfcalloc(1, sizeof(xf86Int10InfoRec)); pInt->entityIndex = entityIndex; if (!xf86Int10ExecSetup(pInt)) @@ -131,47 +112,107 @@ xf86InitInt10(int entityIndex) xf86DrvMsg(screen, X_WARNING, "Unable to retrieve all of segment 0x%06X.\n", cs); + xf86int10ParseBiosLocation(options,&bios); + if (xf86IsEntityPrimary(entityIndex) - && !(initPrimary(xf86Screens[screen],entityIndex))) { - cs = MEM_RW(pInt,((0x10<<2)+2)); + && !(initPrimary(options))) { - vbiosMem = (unsigned char *)base + (cs << 4); - if (!int10_check_bios(screen, cs, vbiosMem)) { - cs = MEM_RW(pInt, (0x42 << 2) + 2); + if (bios.bus == BUS_ISA && bios.location.legacy) { + xf86DrvMsg(screen, X_CONFIG, + "Overriding BIOS location: 0x%lx\n", + bios.location.legacy); + cs = bios.location.legacy >> 4; vbiosMem = (unsigned char *)base + (cs << 4); if (!int10_check_bios(screen, cs, vbiosMem)) { - cs = V_BIOS >> 4; + xf86DrvMsg(screen, X_ERROR, + "No V_BIOS at specified address 0x%x\n",cs << 4); + goto error1; + } + } else { + if (bios.bus == BUS_PCI) { + xf86DrvMsg(screen, X_WARNING, + "Option BiosLocation for primary device ignored: " + "It points to PCI.\n"); + xf86DrvMsg(screen, X_WARNING, + "You must set Option InitPrimary also\n"); + } + + cs = MEM_RW(pInt,((0x10<<2)+2)); + + vbiosMem = (unsigned char *)base + (cs << 4); + if (!int10_check_bios(screen, cs, vbiosMem)) { + cs = MEM_RW(pInt, (0x42 << 2) + 2); vbiosMem = (unsigned char *)base + (cs << 4); if (!int10_check_bios(screen, cs, vbiosMem)) { - xf86DrvMsg(screen, X_ERROR, "No V_BIOS found\n"); - goto error1; + cs = V_BIOS >> 4; + vbiosMem = (unsigned char *)base + (cs << 4); + if (!int10_check_bios(screen, cs, vbiosMem)) { + xf86DrvMsg(screen, X_ERROR, "No V_BIOS found\n"); + goto error1; + } } } } + xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%x\n", cs); set_return_trap(pInt); pInt->BIOSseg = cs; } else { + BusType location_type; + int bios_location = V_BIOS; + int pci_entity; + EntityInfoPtr pEnt = xf86GetEntityInfo(pInt->entityIndex); reset_int_vect(pInt); set_return_trap(pInt); - vbiosMem = (unsigned char *)base + V_BIOS; - switch (pEnt->location.type) { + + if (bios.bus != BUS_NONE) { + switch (location_type = bios.bus) { + case BUS_PCI: + xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: " + "PCI:%i:%i%i\n",bios.location.pci.bus, + bios.location.pci.dev,bios.location.pci.func); + break; + case BUS_ISA: + bios_location = bios.location.legacy; + if (bios.location.legacy) + xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: " + "Legacy:0x%x\n",bios.location.legacy); + else + xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: " + "Legacy\n"); + break; + default: + break; + } + } else + location_type = pEnt->location.type; + + vbiosMem = (unsigned char *)base + bios_location; + + switch (location_type) { case BUS_PCI: - if (!mapPciRom(pInt,(unsigned char *)(vbiosMem))) { - xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (3)\n"); - goto error1; + if (bios.bus == BUS_PCI) + pci_entity = xf86GetPciEntity(bios.location.pci.bus, + bios.location.pci.dev, + bios.location.pci.func); + else + pci_entity = pInt->entityIndex; + if (!mapPciRom(pci_entity,(unsigned char *)(vbiosMem))) { + xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (3)\n"); + goto error1; } break; - case BUS_ISA: + case BUS_ISA: #if 0 (void)memset(vbiosMem, 0, V_BIOS_SIZE); - if (xf86ReadBIOS(V_BIOS, 0, vbiosMem, V_BIOS_SIZE) < V_BIOS_SIZE) + if (xf86ReadBIOS(bios_location, 0, vbiosMem, V_BIOS_SIZE) + < V_BIOS_SIZE) xf86DrvMsg(screen, X_WARNING, - "Unable to retrieve all of segment 0x0C0000.\n"); + "Unable to retrieve all of segment 0x%x.\n",bios_location); #endif - if (!int10_check_bios(screen, V_BIOS >> 4, vbiosMem)) { + if (!int10_check_bios(screen, bios_location >> 4, vbiosMem)) { xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (4)\n"); goto error1; } @@ -214,12 +255,48 @@ xf86InitInt10(int entityIndex) * If this adapter is the primary, use its post-init BIOS (if we can find * it). */ - if (!xf86IsEntityPrimary(entityIndex) || - !int10_check_bios(screen, V_BIOS >> 4, vbiosMem)) { - if (!mapPciRom(pInt, vbiosMem)) { - xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (5)\n"); - goto error1; - } + xf86int10ParseBiosLocation(options,&bios); + + { + int bios_location = V_BIOS; + Bool done = FALSE; + vbiosMem = (unsigned char *)base + bios_location; + + if ((bios.bus == BUS_ISA) + || (bios.bus != BUS_PCI && xf86IsEntityPrimary(entityIndex))) { + if (bios.bus == BUS_ISA && bios.location.legacy) { + xf86DrvMsg(screen, X_CONFIG,"Looking for legacy V_BIOS " + "at 0x%x for %sprimary device\n", + bios.location.legacy, + xf86IsEntityPrimary(entityIndex) ? "" : "non-"); + bios_location = bios.location.legacy; + vbiosMem = (unsigned char *)base + bios_location; + } + if (int10_check_bios(screen, bios_location >> 4, vbiosMem)) + done = TRUE; + else + xf86DrvMsg(screen,X_INFO, + "No legacy BIOS found -- trying PCI\n"); + } + if (!done) { + int pci_entity; + + if (bios.bus == BUS_PCI) { + xf86DrvMsg(screen,X_CONFIG,"Looking for BIOS at PCI:%i%i%i\n", + bios.location.pci.bus,bios.location.pci.dev, + bios.location.pci.func); + pci_entity = xf86GetPciEntity(bios.location.pci.bus, + bios.location.pci.dev, + bios.location.pci.func); + } else + pci_entity = pInt->entityIndex; + + if (!mapPciRom(pci_entity, vbiosMem)) { + xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (5)\n"); + goto error1; + } + } + } pInt->BIOSseg = V_BIOS >> 4; @@ -228,6 +305,7 @@ xf86InitInt10(int entityIndex) xf86ExecX86int10(pInt); UnlockLegacyVGA(screen, &vga); #endif + xfree(options); return pInt; error1: @@ -237,7 +315,8 @@ xf86InitInt10(int entityIndex) xfree(pInt->private); error0: xfree(pInt); - + xfree(options); + return NULL; } @@ -261,10 +340,11 @@ UnmapVRam(xf86Int10InfoPtr pInt) xf86UnMapVidMem(screen, INTPriv(pInt)->vRam, size); } -void +Bool MapCurrentInt10(xf86Int10InfoPtr pInt) { - /* nothing to do here */ + /* nothing to do here */ + return TRUE; } void diff --git a/xc/programs/Xserver/hw/xfree86/int10/helper_exec.c b/xc/programs/Xserver/hw/xfree86/int10/helper_exec.c index edcfedb0e..496ea53c8 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.15 2001/03/25 05:32:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_exec.c,v 1.16 2001/04/30 14:34:57 tsi Exp $ */ /* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment @@ -34,7 +34,8 @@ int setup_int(xf86Int10InfoPtr pInt) { if (pInt != Int10Current) { - MapCurrentInt10(pInt); + if (!MapCurrentInt10(pInt)) + return -1; Int10Current = pInt; } X86_EAX = (CARD32) pInt->ax; diff --git a/xc/programs/Xserver/hw/xfree86/int10/helper_mem.c b/xc/programs/Xserver/hw/xfree86/int10/helper_mem.c index cd434bf9e..c8d6f689e 100644 --- a/xc/programs/Xserver/hw/xfree86/int10/helper_mem.c +++ b/xc/programs/Xserver/hw/xfree86/int10/helper_mem.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_mem.c,v 1.18 2001/03/03 22:46:32 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_mem.c,v 1.20.2.1 2001/05/22 16:26:46 tsi Exp $ */ /* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment @@ -17,17 +17,17 @@ typedef enum { OPT_NOINT10, - OPT_INIT_PRIMARY + OPT_INIT_PRIMARY, + OPT_BIOS_LOCATION } INT10Opts; -static OptionInfoRec INT10Options[] = { +static const OptionInfoRec INT10Options[] = { {OPT_NOINT10, "NoINT10", OPTV_BOOLEAN, {0}, FALSE }, {OPT_INIT_PRIMARY, "InitPrimary", OPTV_BOOLEAN, {0}, FALSE }, + {OPT_BIOS_LOCATION, "BiosLocation", OPTV_STRING, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE }, }; -#define nINT10Options (sizeof(INT10Options) / sizeof(INT10Options[0])) - #ifdef DEBUG void dprint(unsigned long start, unsigned long size) @@ -186,12 +186,12 @@ set_return_trap(xf86Int10InfoPtr pInt) xf86Int10AllocPages(pInt, 1, &pInt->stackseg); } -Bool -int10skip(ScrnInfoPtr pScrn, int entityIndex) +void * +xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex) { - Bool noint10 = FALSE; EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); - + OptionInfoPtr options = NULL; + if (pEnt->device) { pointer configOptions = NULL; @@ -203,18 +203,28 @@ int10skip(ScrnInfoPtr pScrn, int entityIndex) configOptions = pEnt->device->options; if (configOptions) { - OptionInfoRec options[nINT10Options]; - + if (!(options = (OptionInfoPtr) xalloc(sizeof(INT10Options)))) + return NULL; + (void)memcpy(options, INT10Options, sizeof(INT10Options)); xf86ProcessOptions(pScrn->scrnIndex, configOptions, options); - xf86GetOptValBool(options, OPT_NOINT10, &noint10); } } xfree(pEnt); - return noint10; + return options; } +Bool +int10skip(void* options) +{ + Bool noint10 = FALSE; + + if (!options) return FALSE; + + xf86GetOptValBool(options, OPT_NOINT10, &noint10); + return noint10; +} Bool int10_check_bios(int scrnIndex, int codeSeg, unsigned char* vbiosMem) @@ -244,19 +254,70 @@ int10_check_bios(int scrnIndex, int codeSeg, unsigned char* vbiosMem) } Bool -initPrimary(ScrnInfoPtr pScrn, int entityIndex) +initPrimary(void* options) { Bool initPrimary = FALSE; - EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); + + if (!options) return FALSE; - if (pEnt->device && pEnt->device->options) { - OptionInfoRec options[nINT10Options]; + xf86GetOptValBool(options, OPT_INIT_PRIMARY, &initPrimary); + return initPrimary; +} - (void)memcpy(options, INT10Options, sizeof(INT10Options)); - xf86ProcessOptions(pScrn->scrnIndex, pEnt->device->options, options); - xf86GetOptValBool(options, OPT_INIT_PRIMARY, &initPrimary); - } - xfree(pEnt); +void +xf86int10ParseBiosLocation(void* options, + xf86int10BiosLocationPtr bios) +{ + char *s; + char *p; + char *str = NULL; - return initPrimary; + if (options) + str = xf86GetOptValString(options,OPT_BIOS_LOCATION); + + bios->bus = BUS_NONE; + if (!str) + return; + + s = xstrdup(str); + p = strtok(s,":"); + if (xf86NameCmp(p,"pci")) bios->bus = BUS_PCI; + else + if (xf86NameCmp(p,"primary")) bios->bus = BUS_ISA; + + xfree(s); + + if (bios->bus == BUS_NONE) return; + + s = xstrdup(str); + p = strchr(s, ':'); + + switch (bios->bus) { + case BUS_ISA: + if (p) + bios->location.legacy = atoi(++p); + else + bios->location.legacy = 0; + break; + case BUS_PCI: + if (p) { + bios->location.pci.bus = atoi(++p); + if ((p = strchr(p, ':'))) { + bios->location.pci.dev = atoi(++p); + if ((p = strchr(p, ':'))) { + bios->location.pci.func = atoi(++p); + break; + } + } + } + /* fall through */ + bios->bus = BUS_NONE; + break; + default: + break; + } + xfree(s); } + + + diff --git a/xc/programs/Xserver/hw/xfree86/int10/pci.c b/xc/programs/Xserver/hw/xfree86/int10/pci.c index 9b523ae82..1f4899e78 100644 --- a/xc/programs/Xserver/hw/xfree86/int10/pci.c +++ b/xc/programs/Xserver/hw/xfree86/int10/pci.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/pci.c,v 1.6 2001/01/06 20:19:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/pci.c,v 1.8.2.2 2001/05/25 18:15:46 eich Exp $ */ /* * XFree86 int10 module @@ -12,14 +12,13 @@ #include "xf86int10.h" int -mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address) +mapPciRom(int pciEntity, unsigned char * address) { PCITAG tag; - unsigned long offset = 0; unsigned char *mem, *ptr; int length; - - pciVideoPtr pvp = xf86GetPciInfoForEntity(pInt->entityIndex); + + pciVideoPtr pvp = xf86GetPciInfoForEntity(pciEntity); if (pvp == NULL) { #ifdef DEBUG @@ -33,7 +32,7 @@ mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address) /* Read in entire PCI ROM */ mem = ptr = xnfcalloc(length, 1); - if (xf86ReadPciBIOS(offset, tag, -1, ptr, length) < length) { + if (xf86ReadPciBIOS(0, tag, -1, ptr, length) == 0) { xfree(mem); #ifdef DEBUG ErrorF("mapPciRom: cannot read BIOS\n"); @@ -41,6 +40,7 @@ mapPciRom(xf86Int10InfoPtr pInt, unsigned char * address) return 0; } + length = 0; while ((ptr[0] == 0x55) && (ptr[1] == 0xAA)) { unsigned short data_off = ptr[0x18] | (ptr[0x19] << 8); unsigned char *data = ptr + data_off; diff --git a/xc/programs/Xserver/hw/xfree86/int10/stub.c b/xc/programs/Xserver/hw/xfree86/int10/stub.c index c46160f5d..a6647ca29 100644 --- a/xc/programs/Xserver/hw/xfree86/int10/stub.c +++ b/xc/programs/Xserver/hw/xfree86/int10/stub.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/stub.c,v 1.2 2000/02/12 03:39:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/stub.c,v 1.3 2001/04/30 14:34:57 tsi Exp $ */ /* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment @@ -16,10 +16,10 @@ xf86InitInt10(int entityIndex) return NULL; } -void +Bool MapCurrentInt10(xf86Int10InfoPtr pInt) { - return; + return FALSE; } void diff --git a/xc/programs/Xserver/hw/xfree86/int10/xf86int10.h b/xc/programs/Xserver/hw/xfree86/int10/xf86int10.h index b2ffd420d..02fa446b2 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.19 2001/03/03 22:46:32 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.h,v 1.21 2001/05/15 10:19:41 eich Exp $ */ /* * XFree86 int10 module @@ -53,6 +53,18 @@ typedef struct { CARD8 save_46e8; } legacyVGARec, *legacyVGAPtr; +typedef struct { + BusType bus; + union { + struct { + int bus; + int dev; + int func; + } pci; + int legacy; + } location; +} xf86int10BiosLocation, *xf86int10BiosLocationPtr; + /* OS dependent functions */ xf86Int10InfoPtr xf86InitInt10(int entityIndex); void xf86FreeInt10(xf86Int10InfoPtr pInt); @@ -101,7 +113,7 @@ void xf86ExecX86int10(xf86Int10InfoPtr pInt); #define MEM_WL(name, addr, val) (*name->mem->wl)(name, addr, val) /* OS dependent functions */ -void MapCurrentInt10(xf86Int10InfoPtr pInt); +Bool MapCurrentInt10(xf86Int10InfoPtr pInt); /* x86 executor related functions */ Bool xf86Int10ExecSetup(xf86Int10InfoPtr pInt); @@ -154,15 +166,18 @@ void setup_int_vect(xf86Int10InfoPtr pInt); int setup_system_bios(void *base_addr); void reset_int_vect(xf86Int10InfoPtr pInt); void set_return_trap(xf86Int10InfoPtr pInt); -Bool int10skip(ScrnInfoPtr pScrn, int entityIndex); +void * xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex); +Bool int10skip(void* options); Bool int10_check_bios(int scrnIndex, int codeSeg, unsigned char* vbiosMem); -Bool initPrimary(ScrnInfoPtr pScrn, int entityIndex); +Bool initPrimary(void* options); +void xf86int10ParseBiosLocation(void* options, + xf86int10BiosLocationPtr bios); #ifdef DEBUG void dprint(unsigned long start, unsigned long size); #endif /* pci.c */ -int mapPciRom(xf86Int10InfoPtr pInt, unsigned char *address); +int mapPciRom(int pciEntity, unsigned char *address); #endif /* _INT10_PRIVATE */ #endif /* _XF86INT10_H */ diff --git a/xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c b/xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c index d98bf5a90..6d8011ab0 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.10 2001/01/06 20:19:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c,v 1.11 2001/04/30 14:34:58 tsi Exp $ */ /* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment @@ -32,6 +32,9 @@ xf86ExecX86int10(xf86Int10InfoPtr pInt) { int sig = setup_int(pInt); + if (sig < 0) + return; + if (int_handler(pInt)) { X86EMU_exec(); } diff --git a/xc/programs/Xserver/hw/xfree86/loader/elf.h b/xc/programs/Xserver/hw/xfree86/loader/elf.h index b5fbbc386..f7dd743da 100644 --- a/xc/programs/Xserver/hw/xfree86/loader/elf.h +++ b/xc/programs/Xserver/hw/xfree86/loader/elf.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elf.h,v 1.10 2001/01/06 20:19:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elf.h,v 1.11 2001/04/27 19:34:00 tsi Exp $ */ typedef unsigned int Elf32_Addr; @@ -166,19 +166,39 @@ extern Elf32_Dyn _DYNAMIC []; #define R_SPARC_JMP_SLOT 21 #define R_SPARC_RELATIVE 22 #define R_SPARC_UA32 23 -#define R_SPARC_PLT32 24 -#define R_SPARC_HIPLT22 25 -#define R_SPARC_LOPLT10 26 -#define R_SPARC_PCPLT32 27 -#define R_SPARC_PCPLT22 28 -#define R_SPARC_PCPLT10 29 -#define R_SPARC_10 30 -#define R_SPARC_11 31 -#define R_SPARC_WDISP16 40 -#define R_SPARC_WDISP19 41 -#define R_SPARC_7 43 -#define R_SPARC_5 44 -#define R_SPARC_6 45 +#define R_SPARC_PLT32 24 +#define R_SPARC_HIPLT22 25 +#define R_SPARC_LOPLT10 26 +#define R_SPARC_PCPLT32 27 +#define R_SPARC_PCPLT22 28 +#define R_SPARC_PCPLT10 29 +#define R_SPARC_10 30 +#define R_SPARC_11 31 +#define R_SPARC_64 32 +#define R_SPARC_OLO10 33 +#define R_SPARC_HH22 34 +#define R_SPARC_HM10 35 +#define R_SPARC_LM22 36 +#define R_SPARC_PC_HH22 37 +#define R_SPARC_PC_HM10 38 +#define R_SPARC_PC_LM22 39 +#define R_SPARC_WDISP16 40 +#define R_SPARC_WDISP19 41 +#define R_SPARC_GLOB_JMP 42 +#define R_SPARC_7 43 +#define R_SPARC_5 44 +#define R_SPARC_6 45 +#define R_SPARC_DISP64 46 +#define R_SPARC_PLT64 47 +#define R_SPARC_HIX22 48 +#define R_SPARC_LOX10 49 +#define R_SPARC_H44 50 +#define R_SPARC_M44 51 +#define R_SPARC_L44 52 +#define R_SPARC_REGISTER 53 +#define R_SPARC_UA64 54 +#define R_SPARC_UA16 55 +#define R_SPARC_NUM 56 /* m68k Relocation Types */ #define R_68K_NONE 0 /* No reloc */ diff --git a/xc/programs/Xserver/hw/xfree86/loader/elfloader.c b/xc/programs/Xserver/hw/xfree86/loader/elfloader.c index 773665b37..e3c0fc752 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.36 2001/04/01 14:00:14 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/elfloader.c,v 1.37 2001/04/27 19:34:00 tsi Exp $ */ /* * @@ -1774,97 +1774,102 @@ int force; #endif /* PowerMAX_OS */ #endif /* __powerpc__ */ #ifdef __sparc__ - case R_SPARC_RELATIVE: - dest32 = (unsigned int *)(secp + rel->r_offset); - *dest32 += (unsigned int)secp + rel->r_addend; - break; - - case R_SPARC_GLOB_DAT: - case R_SPARC_32: - dest32 = (unsigned int *)(secp + rel->r_offset); - symval += rel->r_addend; - *dest32 = symval; + case R_SPARC_NONE: /* 0 */ break; - case R_SPARC_JMP_SLOT: - dest32 = (unsigned int *)(secp + rel->r_offset); - /* Before we change it the PLT entry looks like: - * - * pltent: sethi %hi(rela_plt_offset), %g1 - * b,a PLT0 - * nop - * - * We change it into: - * - * pltent: sethi %hi(rela_plt_offset), %g1 - * sethi %hi(symval), %g1 - * jmp %g1 + %lo(symval), %g0 - */ - symval += rel->r_addend; - dest32[2] = 0x81c06000 | (symval & 0x3ff); - __asm __volatile("flush %0 + 0x8" : : "r" (dest32)); - dest32[1] = 0x03000000 | (symval >> 10); - __asm __volatile("flush %0 + 0x4" : : "r" (dest32)); - break; - - case R_SPARC_8: + case R_SPARC_8: /* 1 */ dest8 = (unsigned char *)(secp + rel->r_offset); symval += rel->r_addend; *dest8 = symval; break; - case R_SPARC_16: + case R_SPARC_16: /* 2 */ dest16 = (unsigned short *)(secp + rel->r_offset); symval += rel->r_addend; *dest16 = symval; break; - case R_SPARC_DISP8: + case R_SPARC_32: /* 3 */ + case R_SPARC_GLOB_DAT: /* 20 */ + case R_SPARC_UA32: /* 23 */ + dest32 = (unsigned int *)(secp + rel->r_offset); + symval += rel->r_addend; + ((unsigned char *)dest32)[0] = (unsigned char)(symval >> 24); + ((unsigned char *)dest32)[1] = (unsigned char)(symval >> 16); + ((unsigned char *)dest32)[2] = (unsigned char)(symval >> 8); + ((unsigned char *)dest32)[3] = (unsigned char)(symval ); + break; + + case R_SPARC_DISP8: /* 4 */ dest8 = (unsigned char *)(secp + rel->r_offset); symval += rel->r_addend; *dest8 = (symval - (Elf32_Addr) dest8); break; - case R_SPARC_DISP16: + case R_SPARC_DISP16: /* 5 */ dest16 = (unsigned short *)(secp + rel->r_offset); symval += rel->r_addend; *dest16 = (symval - (Elf32_Addr) dest16); break; - case R_SPARC_DISP32: + case R_SPARC_DISP32: /* 6 */ dest32 = (unsigned int *)(secp + rel->r_offset); symval += rel->r_addend; *dest32 = (symval - (Elf32_Addr) dest32); break; - case R_SPARC_LO10: - dest32 = (unsigned int *)(secp + rel->r_offset); - symval += rel->r_addend; - *dest32 = (*dest32 & ~0x3ff) | (symval & 0x3ff); - break; - - case R_SPARC_WDISP30: + case R_SPARC_WDISP30: /* 7 */ dest32 = (unsigned int *)(secp + rel->r_offset); symval += rel->r_addend; *dest32 = ((*dest32 & 0xc0000000) | ((symval - (Elf32_Addr) dest32) >> 2)); break; - case R_SPARC_HI22: + case R_SPARC_HI22: /* 9 */ dest32 = (unsigned int *)(secp + rel->r_offset); symval += rel->r_addend; *dest32 = (*dest32 & 0xffc00000) | (symval >> 10); break; - case R_SPARC_NONE: + case R_SPARC_LO10: /* 12 */ + dest32 = (unsigned int *)(secp + rel->r_offset); + symval += rel->r_addend; + *dest32 = (*dest32 & ~0x3ff) | (symval & 0x3ff); break; - case R_SPARC_COPY: + case R_SPARC_COPY: /* 19 */ /* Fix your code... I'd rather dish out an error here * so people will not link together PIC and non-PIC * code into a final driver object file. */ - ErrorF("Elf_RelocateEntry() Copy relocs not supported on Sparc.\n"); + ErrorF("Elf_RelocateEntry():" + " Copy relocs not supported on Sparc.\n"); + break; + + case R_SPARC_JMP_SLOT: /* 21 */ + dest32 = (unsigned int *)(secp + rel->r_offset); + /* Before we change it the PLT entry looks like: + * + * pltent: sethi %hi(rela_plt_offset), %g1 + * b,a PLT0 + * nop + * + * We change it into: + * + * pltent: sethi %hi(rela_plt_offset), %g1 + * sethi %hi(symval), %g1 + * jmp %g1 + %lo(symval), %g0 + */ + symval += rel->r_addend; + dest32[2] = 0x81c06000 | (symval & 0x3ff); + __asm __volatile("flush %0 + 0x8" : : "r" (dest32)); + dest32[1] = 0x03000000 | (symval >> 10); + __asm __volatile("flush %0 + 0x4" : : "r" (dest32)); + break; + + case R_SPARC_RELATIVE: /* 22 */ + dest32 = (unsigned int *)(secp + rel->r_offset); + *dest32 += (unsigned int)secp + rel->r_addend; break; #endif #ifdef __ia64__ diff --git a/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c b/xc/programs/Xserver/hw/xfree86/loader/xf86sym.c index 2be9e1c01..a36c48e3f 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.190 2001/04/05 17:42:34 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/xf86sym.c,v 1.193 2001/05/19 00:26:45 dawes Exp $ */ /* * @@ -208,7 +208,7 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(xf86UnbindGARTMemory) SYMFUNC(xf86EnableAGP) SYMFUNC(xf86SoundKbdBell) - + SYMFUNC(xf86GARTCloseScreen) #ifdef XINPUT /* XISB routines (Merged from Metrolink tree) */ SYMFUNC(XisbNew) @@ -409,6 +409,8 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(xf86IsScreenPrimary) SYMFUNC(xf86RegisterRootWindowProperty) SYMFUNC(xf86IsUnblank) + SYMFUNC(xf86AddModuleInfo) + SYMFUNC(xf86DeleteModuleInfo) #ifdef __sparc__ /* xf86sbusBus.c */ @@ -549,6 +551,9 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(VidModeGetModeValue) SYMFUNC(VidModeSetModeValue) SYMFUNC(VidModeGetMonitorValue) + SYMFUNC(VidModeSetGammaRamp) + SYMFUNC(VidModeGetGammaRamp) + SYMFUNC(VidModeGetGammaRampSize) #endif /* xf86MiscExt.c */ 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 c849eb7c5..ac503f679 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.45 2001/03/25 05:32:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c,v 1.48.2.1 2001/05/21 05:00:36 tsi Exp $ */ /* * Pci.c - New server PCI access functions * @@ -559,7 +559,7 @@ pciGetBaseSize(PCITAG tag, int index, Bool destructive, Bool *min) else mask1 = PCIGETIO(mask1); else - mask1 = PCIGETROM(mask1); + mask1 = PCIGETROM(mask1); if (mask1 == 0) return 0; bits = 0; @@ -568,7 +568,12 @@ pciGetBaseSize(PCITAG tag, int index, Bool destructive, Bool *min) mask1 >>= 1; } /* I/O maps can be no larger than 8 bits */ + +#if defined(Lynx) && defined(__powerpc__) + if (PCI_MAP_IS_IO(addr1) && bits > 8) +#else if ((index < 6) && PCI_MAP_IS_IO(addr1) && bits > 8) +#endif bits = 8; /* ROM maps can be no larger than 24 bits */ if (index == 6 && bits > 24) @@ -623,20 +628,20 @@ pciMfDev(int busnum, int devnum) PCITAG pciGenFindNext(void) { - unsigned long devid, tmp; - unsigned char base_class, sub_class, sec_bus, pri_bus; - Bool speculativeProbe = FALSE; + unsigned long devid, tmp; + unsigned char base_class, sub_class, sec_bus, pri_bus; + Bool speculativeProbe = FALSE; #ifdef DEBUGPCI -ErrorF("pciGenFindNext\n"); + ErrorF("pciGenFindNext\n"); #endif - for (;;) { + for (;;) { #ifdef DEBUGPCI -ErrorF("pciGenFindNext: pciBusNum %d\n", pciBusNum); + ErrorF("pciGenFindNext: pciBusNum %d\n", pciBusNum); #endif - if (pciBusNum == -1) { + if (pciBusNum == -1) { /* * Start at top of the order */ @@ -646,34 +651,32 @@ ErrorF("pciGenFindNext: pciBusNum %d\n", pciBusNum); pciBusNum = 0; pciFuncNum = 0; pciDevNum = 0; - } - else { + } else { #ifdef PCI_MFDEV_SUPPORT #ifdef DEBUGPCI -ErrorF("pciGenFindNext: pciFuncNum %d\n", pciFuncNum); + ErrorF("pciGenFindNext: pciFuncNum %d\n", pciFuncNum); #endif /* * Somewhere in middle of order. Determine who's * next up */ if (pciFuncNum == 0) { + /* + * Is current dev a multifunction device? + */ + if (pciMfDev(pciBusNum, pciDevNum)) + /* Probe for other functions */ + pciFuncNum = 1; + else /* - * Is current dev a multifunction device? + * No more functions this device. Next + * device please */ - if (pciMfDev(pciBusNum, pciDevNum)) - /* Probe for other functions */ - pciFuncNum = 1; - else - /* - * No more functions this device. Next - * device please - */ - pciDevNum ++; - } - else if (++pciFuncNum >= 8) { - /* No more functions for this device. Next device please */ - pciFuncNum = 0; pciDevNum ++; + } else if (++pciFuncNum >= 8) { + /* No more functions for this device. Next device please */ + pciFuncNum = 0; + pciDevNum ++; } #else pciDevNum ++; @@ -682,116 +685,113 @@ ErrorF("pciGenFindNext: pciFuncNum %d\n", pciFuncNum); !pciBusInfo[pciBusNum] || pciDevNum >= pciBusInfo[pciBusNum]->numDevices) { #ifdef DEBUGPCI -ErrorF("pciGenFindNext: next bus\n"); + ErrorF("pciGenFindNext: next bus\n"); #endif - /* - * No more devices for this bus. Next bus please - */ - if (speculativeProbe) { - xfree(pciBusInfo[pciBusNum]); - pciBusInfo[pciBusNum] = NULL; - } + /* + * No more devices for this bus. Next bus please + */ + if (speculativeProbe) { + xfree(pciBusInfo[pciBusNum]); + pciBusInfo[pciBusNum] = NULL; + } - if (++pciBusNum >= MAX_PCI_BUSES) { + if (++pciBusNum >= MAX_PCI_BUSES) { #ifdef DEBUGPCI -ErrorF("pciGenFindNext: out of buses\n"); + ErrorF("pciGenFindNext: out of buses\n"); #endif - /* No more buses. All done for now */ - return(PCI_NOT_FOUND); - } + /* No more buses. All done for now */ + return(PCI_NOT_FOUND); + } - pciDevNum = 0; + pciDevNum = 0; } - } + } #ifdef DEBUGPCI -ErrorF("pciGenFindNext: pciBusInfo[%d] = 0x%lx\n", pciBusNum, pciBusInfo[pciBusNum]); + ErrorF("pciGenFindNext: pciBusInfo[%d] = 0x%lx\n", pciBusNum, pciBusInfo[pciBusNum]); #endif - if (!pciBusInfo[pciBusNum]) { - pciBusInfo[pciBusNum] = xnfalloc(sizeof(pciBusInfo_t)); - *pciBusInfo[pciBusNum] = *pciBusInfo[0]; + if (!pciBusInfo[pciBusNum]) { + pciBusInfo[pciBusNum] = xnfalloc(sizeof(pciBusInfo_t)); + *pciBusInfo[pciBusNum] = *pciBusInfo[0]; - speculativeProbe = TRUE; - } + speculativeProbe = TRUE; + } - /* - * At this point, pciBusNum, pciDevNum, and pciFuncNum have been - * advanced to the next device. Compute the tag, and read the - * device/vendor ID field. - */ + /* + * At this point, pciBusNum, pciDevNum, and pciFuncNum have been + * advanced to the next device. Compute the tag, and read the + * device/vendor ID field. + */ #ifdef DEBUGPCI -ErrorF("pciGenFindNext: [%d, %d, %d]\n", pciBusNum, pciDevNum, pciFuncNum); + ErrorF("pciGenFindNext: [%d, %d, %d]\n", pciBusNum, pciDevNum, pciFuncNum); #endif - pciDeviceTag = PCI_MAKE_TAG(pciBusNum, pciDevNum, pciFuncNum); - inProbe = TRUE; - devid = pciReadLong(pciDeviceTag, 0); - inProbe = FALSE; + pciDeviceTag = PCI_MAKE_TAG(pciBusNum, pciDevNum, pciFuncNum); + inProbe = TRUE; + devid = pciReadLong(pciDeviceTag, 0); + inProbe = FALSE; #ifdef DEBUGPCI -ErrorF("pciGenFindNext: pciDeviceTag = 0x%lx, devid = 0x%lx\n", pciDeviceTag, devid); + ErrorF("pciGenFindNext: pciDeviceTag = 0x%lx, devid = 0x%lx\n", pciDeviceTag, devid); #endif - if (devid == 0xffffffff) + if (devid == 0xffffffff) continue; /* Nobody home. Next device please */ - if (speculativeProbe && (pciNumBuses <= pciBusNum)) - pciNumBuses = pciBusNum + 1; + if (speculativeProbe && (pciNumBuses <= pciBusNum)) + pciNumBuses = pciBusNum + 1; - speculativeProbe = FALSE; + speculativeProbe = FALSE; - /* - * Before checking for a specific devid, look for enabled - * PCI to PCI bridge devices. If one is found, create and - * initialize a bus info record (if one does not already exist). - */ + /* + * Before checking for a specific devid, look for enabled + * PCI to PCI bridge devices. If one is found, create and + * initialize a bus info record (if one does not already exist). + */ #ifdef PCI_BRIDGE_SUPPORT - tmp = pciReadLong(pciDeviceTag, PCI_CLASS_REG); - base_class = PCI_CLASS_EXTRACT(tmp); - sub_class = PCI_SUBCLASS_EXTRACT(tmp); - if (base_class == PCI_CLASS_BRIDGE) - if (sub_class == PCI_SUBCLASS_BRIDGE_PCI) { + tmp = pciReadLong(pciDeviceTag, PCI_CLASS_REG); + base_class = PCI_CLASS_EXTRACT(tmp); + sub_class = PCI_SUBCLASS_EXTRACT(tmp); + if ((base_class == PCI_CLASS_BRIDGE) && + (sub_class == PCI_SUBCLASS_BRIDGE_PCI)) { tmp = pciReadLong(pciDeviceTag, PCI_PCI_BRIDGE_BUS_REG); sec_bus = PCI_SECONDARY_BUS_EXTRACT(tmp); pri_bus = PCI_PRIMARY_BUS_EXTRACT(tmp); #ifdef DEBUGPCI -ErrorF("pciGenFindNext: pri_bus %d sec_bus %d\n", pri_bus, sec_bus); + ErrorF("pciGenFindNext: pri_bus %d sec_bus %d\n", pri_bus, sec_bus); #endif if (sec_bus > 0 && sec_bus < MAX_PCI_BUSES && pciBusInfo[pri_bus]) { - /* - * Found a secondary PCI bus - */ - if (!pciBusInfo[sec_bus]) { - pciBusInfo[sec_bus] = - xnfalloc(sizeof(pciBusInfo_t)); - - } - - /* Copy parents settings... */ - *pciBusInfo[sec_bus] = *pciBusInfo[pri_bus]; - - /* ...but not everything same as parent */ - pciBusInfo[sec_bus]->primary_bus = pri_bus; - pciBusInfo[sec_bus]->secondary = TRUE; - pciBusInfo[sec_bus]->numDevices = 32; - - if (pciNumBuses <= sec_bus) - pciNumBuses = sec_bus+1; + /* + * Found a secondary PCI bus + */ + if (!pciBusInfo[sec_bus]) + pciBusInfo[sec_bus] = xnfalloc(sizeof(pciBusInfo_t)); + + /* Copy parents settings... */ + *pciBusInfo[sec_bus] = *pciBusInfo[pri_bus]; + + /* ...but not everything same as parent */ + pciBusInfo[sec_bus]->primary_bus = pri_bus; + pciBusInfo[sec_bus]->secondary = TRUE; + pciBusInfo[sec_bus]->numDevices = 32; + + if (pciNumBuses <= sec_bus) + pciNumBuses = sec_bus+1; } - } + } #endif - /* - * Does this device match the requested devid after - * applying mask? - */ + /* + * Does this device match the requested devid after + * applying mask? + */ #ifdef DEBUGPCI -ErrorF("pciGenFindNext: pciDevidMask = 0x%lx, pciDevid = 0x%lx\n", pciDevidMask, pciDevid); + ErrorF("pciGenFindNext: pciDevidMask = 0x%lx, pciDevid = 0x%lx\n", pciDevidMask, pciDevid); #endif - if ((devid & pciDevidMask) == pciDevid) - /* Yes - Return it. Otherwise, next device */ - return(pciDeviceTag); /* got a match */ + if ((devid & pciDevidMask) == pciDevid) + /* Yes - Return it. Otherwise, next device */ + return(pciDeviceTag); /* got a match */ - } /* for */ - /*NOTREACHED*/ + } /* for */ + /*NOTREACHED*/ } PCITAG @@ -1053,12 +1053,122 @@ static int readPciBIOS(unsigned long Offset, PCITAG Tag, int basereg, unsigned char *Buf, int Len) { + CARD32 romsave = 0; + int i; + romBaseSource b_reg; + ADDRESS hostbase; + CARD8 tmp[64]; + CARD8 *image; + + unsigned long offset; + int ret, length, len, rlength; + + romsave = pciReadLong(Tag, PCI_MAP_ROM_REG); + + for (i = ROM_BASE_PRESET; i <= ROM_BASE_FIND; i++) { + memType savebase = 0, newbase, romaddr; + + if (i == ROM_BASE_PRESET) { + /* Does the driver have a preference? */ + if (basereg > ROM_BASE_PRESET && basereg <= ROM_BASE_FIND) + b_reg = basereg; + else + b_reg = ++i; + } else + b_reg = i; + + if (!(newbase = getValidBIOSBase(Tag, b_reg))) + continue; /* no valid address found */ + + romaddr = PCIGETROM(newbase); + + /* if we use a mem base save it and move it out of the way */ + if (b_reg >= 0 && b_reg <= 5) { + savebase = pciReadLong(Tag, PCI_MAP_REG_START+(basereg<<2)); + 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 + (b_reg << 2), + (CARD32)~0); + } + /* Set ROM base address and enable ROM address decoding */ + pciWriteLong(Tag, PCI_MAP_ROM_REG, romaddr + | PCI_MAP_ROM_DECODE_ENABLE); + + hostbase = pciBusAddrToHostAddr(Tag, PCI_MEM, PCIGETROM(romaddr)); + + if ((xf86ReadBIOS(hostbase, 0, tmp, sizeof(tmp)) != sizeof(tmp)) + || (tmp[0] != 0x55) + || (tmp[1] != 0xaa) + || !tmp[2] ) { + /* Restore the base register if it was changed. */ + if (savebase) pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2), + (CARD32) savebase); + /* No BIOS found: try another address */ + continue; + } + +#if 0 + /* + * Currently this is only good for PC style BIOSes. + * This code needs to be revistited after 4.1 is out. + * We need to pass an argument for the BIOS type to + * look for. Then we can pick the correct BIOS. + * Combine this with the code in int10/pci.c. + */ + if ((Offset) > (tmp[2] << 9)) { + xf86Msg(X_WARNING,"xf86ReadPciBios: requesting data past " + "end of BIOS %i > %i\n",(Offset) , (tmp[2] << 9)); + } else { + if ((Offset + Len) > (tmp[2] << 9)) { + Len = (tmp[2] << 9) - Offset; + xf86Msg(X_INFO,"Truncating PCI BIOS Length to %i\n",Len); + } + } +#endif + + /* Read BIOS in 64kB chunks */ + ret = 0; + offset = Offset; + image = Buf; + len = Len; + while ((length = len) > 0) { + if (length > 0x10000) length = 0x10000; + rlength = xf86ReadBIOS(hostbase, offset, image, length); + if (rlength < 0) { + ret = rlength; + break; + } + ret += rlength; + if (rlength < length) break; + offset += length; + image += length; + len -= length; + } + /* Restore the base register if it was changed. */ + if (savebase) pciWriteLong(Tag, PCI_MAP_REG_START + (b_reg << 2), + (CARD32) savebase); + /* Restore ROM address decoding */ + pciWriteLong(Tag, PCI_MAP_ROM_REG, romsave); + return ret; + + } + /* Restore ROM address decoding */ + pciWriteLong(Tag, PCI_MAP_ROM_REG, romsave); + return 0; +} + +#if 0 +static int +readPciBIOS(unsigned long Offset, PCITAG Tag, int basereg, + unsigned char *Buf, int Len) +{ ADDRESS hostbase; CARD8 *image = Buf; unsigned long offset; CARD32 romaddr, savebase = 0, romsave = 0, newbase = 0; - int ret, length, rlength, n; - + int ret, tmpLen, length, rlength, n; /* XXX This assumes that memory access is enabled */ /* @@ -1077,7 +1187,7 @@ RetryWithBase: if (!savebase) savebase = pciReadLong(Tag, PCI_MAP_REG_START+(basereg<<2)); if (PCIGETROM(savebase) == romaddr) { - xf86MsgVerb(X_INFO,5,"xf86ReadPciBios: modifying membase[%i]" + 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)); @@ -1099,31 +1209,38 @@ RetryWithBase: newbase); hostbase = pciBusAddrToHostAddr(Tag, PCI_MEM, PCIGETROM(romaddr)); -#ifdef DEBUG - ErrorF("ReadPciBIOS: base = 0x%x\n",romaddr); -#endif + xf86MsgVerb(X_INFO, 5, "ReadPciBIOS: base = 0x%x\n",romaddr); /* Enable ROM address decoding */ pciWriteLong(Tag, PCI_MAP_ROM_REG, romaddr | PCI_MAP_ROM_DECODE_ENABLE); - /* Read BIOS in 64kB chunks */ - ret = 0; - offset = Offset; - while ((length = Len) > 0) { - if (length > 0x10000) length = 0x10000; - rlength = xf86ReadBIOS(hostbase, offset, image, length); - if (rlength < 0) { - ret = rlength; - break; + /* Check to see if we really have a PCI BIOS image */ + rlength = xf86ReadBIOS(hostbase, 0, tmp_buf, sizeof(tmp_buf)); + if (rlength < 0) return rlength; + /* If we found a BIOS image we read the requested data */ + if ((rlength == sizeof(tmp_buf)) && (tmp_buf[0] == 0x55) + && (tmp_buf[1] == 0xaa) && tmp_buf[2] ) { + + /* Read BIOS in 64kB chunks */ + ret = 0; + offset = Offset; + tmpLen = Len; + image = Buf; + + while ((length = tmpLen) > 0) { + if (length > 0x10000) length = 0x10000; + rlength = xf86ReadBIOS(hostbase, offset, image, length); + if (rlength < 0) { + ret = rlength; + break; + } + ret += rlength; + if (rlength < length) break; + offset += length; + image += length; + tmpLen -= length; } - ret += rlength; - if (rlength < length) break; - offset += length; - image += length; - Len -= length; - } - - if ((ret != Len) || (Buf[0] != 0x55) || (Buf[1] != 0xaa) || !Buf[2] || - (Len < (Buf[2] << 9))) { + } else { + /* If we don't have a PCI BIOS image we look further */ n = 0; if ((basereg >= 0) && (basereg <= 5) && xf86PciVideoInfo) do { pciVideoPtr pvp; @@ -1145,6 +1262,7 @@ RetryWithBase: return ret; } +#endif typedef CARD32 (*ReadProcPtr)(PCITAG, int); typedef void (*WriteProcPtr)(PCITAG, int, CARD32); diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h b/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h index 0c006a55d..5accd7020 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v 1.17 2001/04/20 17:02:43 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v 1.18.2.1 2001/05/21 05:00:36 tsi Exp $ */ /* * Copyright 1998 by Concurrent Computer Corporation * @@ -85,7 +85,12 @@ */ #define MAX_PCI_DEVICES 64 /* Max number of devices accomodated */ /* by xf86scanpci */ +#if defined(i386) || defined(__i386) || defined(__i386__) +/* Q&D stopgap to deal with mainboards whose PCI space is smaller */ +#define MAX_PCI_BUSES 128 /* Max number of PCI buses */ +#else #define MAX_PCI_BUSES 256 /* Max number of PCI buses */ +#endif #define PCI_NOT_FOUND 0xffffffff diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c b/xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c index 130b0e1e4..cb629ab31 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c,v 1.3 1999/03/28 15:32:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c,v 1.3.6.1 2001/05/29 16:38:00 tsi Exp $ */ /* * Copyright 1998 by Concurrent Computer Corporation * @@ -80,21 +80,10 @@ pciBusInfo_t linuxPci0 = { }; #if X_BYTE_ORDER == X_BIG_ENDIAN -#ifdef __sparc__ -#ifndef ASI_PL -#define ASI_PL 0x88 -#endif -#define PCI_CPU(val) ({ \ -int __ret; \ -__asm__ __volatile__("lduwa [%1] %2, %0" : "=r" (__ret) : "r" (&val), "i" (ASI_PL)); \ -__ret; \ -}) -#else #define PCI_CPU(val) (((val >> 24) & 0x000000ff) | \ ((val >> 8) & 0x0000ff00) | \ ((val << 8) & 0x00ff0000) | \ ((val << 24) & 0xff000000)) -#endif #else #define PCI_CPU(val) (val) #endif diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c b/xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c index 25c1abcbe..46e0eacd3 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c,v 1.5 2000/02/08 13:13:29 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c,v 1.6 2001/05/11 08:16:55 alanh Exp $ */ /* * ppcPci.c - PowerPC PCI access functions * @@ -140,7 +140,13 @@ motoppcPciInit() } extern unsigned long motoPciMemBase = 0; + +#if defined(Lynx) && defined(__powerpc__) +extern unsigned long motoPciMemLen = 0x40000000; +#else extern unsigned long motoPciMemLen = 0x3f000000; +#endif + extern unsigned long motoPciMemBaseCPU = 0xc0000000; ADDRESS diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h b/xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h index ecdc009a6..51552a620 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h,v 1.26 2000/09/19 12:46:21 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h,v 1.27 2001/05/15 10:19:42 eich Exp $ */ /* * Copyright 1998 by Concurrent Computer Corporation * @@ -656,6 +656,18 @@ void xf86writepci(int, int, int, int, int, CARD32, CARD32); extern int pciNumBuses; +typedef enum { + ROM_BASE_PRESET = -2, + ROM_BASE_BIOS, + ROM_BASE_MEM0 = 0, + ROM_BASE_MEM1, + ROM_BASE_MEM2, + ROM_BASE_MEM3, + ROM_BASE_MEM4, + ROM_BASE_MEM5, + ROM_BASE_FIND +} romBaseSource; + #endif /* _XF86PCI_H */ diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux index 95044e6f8..cb48028fd 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux @@ -59,7 +59,7 @@ GAMMAOBJS = gamma_drv.o gamma_dma.o GAMMAHEADERS = gamma_drv.h $(DRMHEADERS) $(DRMTEMPLATES) TDFXOBJS = tdfx_drv.o -TDFXHEADERS = tdfx.h $(DRMHEADERS) +TDFXHEADERS = tdfx.h $(DRMHEADERS) $(DRMTEMPLATES) R128OBJS = r128_drv.o r128_cce.o r128_state.o R128HEADERS = r128.h r128_drv.h r128_drm.h $(DRMHEADERS) $(DRMTEMPLATES) @@ -175,8 +175,8 @@ ifeq ($(SIS),1) # file to see if we can, at least, compile the driver. MODS += sis.o -SISOBJS= sis_drv.o sis_context.o sis_ds.o sis_mm.o -SISHEADERS= sis_drv.h sis_ds.h sis_drm.h $(DRMHEADERS) +SISOBJS= sis_drv.o sis_mm.o sis_ds.o +SISHEADERS= sis_drv.h sis_drm.h $(DRMHEADERS) MODCFLAGS += -DCONFIG_DRM_SIS endif @@ -216,6 +216,9 @@ endif dristat: dristat.c $(CC) $(PRGCFLAGS) $< -o $@ +DRIsetup: DRIsetup.c + $(CC) $(PRGCFLAGS) $< -o $@ -L/usr/X11R6/lib -lGL -lm ../../../../parser/libxf86config.a ../libdrm.a + gamma_drv.o: gamma_drv.c $(CC) $(MODCFLAGS) -DEXPORT_SYMTAB -I$(TREE) -c $< -o $@ gamma.o: $(GAMMAOBJS) diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h index 3def97f74..9f5610226 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h @@ -44,8 +44,27 @@ #define DRM_IOCTL_NR(n) ((n) & 0xff) #endif +#define XFREE86_VERSION(major,minor,patch,snap) \ + ((major << 16) | (minor < 8) | patch) + +#ifndef CONFIG_XFREE86_VERSION +#define CONFIG_XFREE86_VERSION XFREE86_VERSION(4,1,0,0) +#endif + +#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0) +#define DRM_PROC_DEVICES "/proc/devices" +#define DRM_PROC_MISC "/proc/misc" +#define DRM_PROC_DRM "/proc/drm" +#define DRM_DEV_DRM "/dev/drm" +#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) +#define DRM_DEV_UID 0 +#define DRM_DEV_GID 0 +#endif + +#if CONFIG_XFREE86_VERSION >= XFREE86_VERSION(4,1,0,0) #define DRM_MAJOR 226 #define DRM_MAX_MINOR 15 +#endif #define DRM_NAME "drm" /* Name in kernel, /dev, and /proc */ #define DRM_MIN_ORDER 5 /* At least 2^5 bytes = 32 bytes */ #define DRM_MAX_ORDER 22 /* Up to 2^22 bytes = 4MB */ @@ -438,15 +457,15 @@ typedef struct drm_scatter_gather { #define DRM_IOCTL_R128_CCE_RESET DRM_IO( 0x43) #define DRM_IOCTL_R128_CCE_IDLE DRM_IO( 0x44) #define DRM_IOCTL_R128_RESET DRM_IO( 0x46) -#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( 0x47, drm_r128_fullscreen_t) -#define DRM_IOCTL_R128_SWAP DRM_IO( 0x48) -#define DRM_IOCTL_R128_CLEAR DRM_IOW( 0x49, drm_r128_clear_t) -#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x4a, drm_r128_vertex_t) -#define DRM_IOCTL_R128_INDICES DRM_IOW( 0x4b, drm_r128_indices_t) -#define DRM_IOCTL_R128_BLIT DRM_IOW( 0x4c, drm_r128_blit_t) -#define DRM_IOCTL_R128_DEPTH DRM_IOW( 0x4d, drm_r128_depth_t) -#define DRM_IOCTL_R128_STIPPLE DRM_IOW( 0x4e, drm_r128_stipple_t) +#define DRM_IOCTL_R128_SWAP DRM_IO( 0x47) +#define DRM_IOCTL_R128_CLEAR DRM_IOW( 0x48, drm_r128_clear_t) +#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x49, drm_r128_vertex_t) +#define DRM_IOCTL_R128_INDICES DRM_IOW( 0x4a, drm_r128_indices_t) +#define DRM_IOCTL_R128_BLIT DRM_IOW( 0x4b, drm_r128_blit_t) +#define DRM_IOCTL_R128_DEPTH DRM_IOW( 0x4c, drm_r128_depth_t) +#define DRM_IOCTL_R128_STIPPLE DRM_IOW( 0x4d, drm_r128_stipple_t) #define DRM_IOCTL_R128_INDIRECT DRM_IOWR(0x4f, drm_r128_indirect_t) +#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( 0x50, drm_r128_fullscreen_t) /* Radeon specific ioctls */ #define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( 0x40, drm_radeon_init_t) @@ -460,9 +479,9 @@ typedef struct drm_scatter_gather { #define DRM_IOCTL_RADEON_CLEAR DRM_IOW( 0x48, drm_radeon_clear_t) #define DRM_IOCTL_RADEON_VERTEX DRM_IOW( 0x49, drm_radeon_vertex_t) #define DRM_IOCTL_RADEON_INDICES DRM_IOW( 0x4a, drm_radeon_indices_t) -#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(0x4b, drm_radeon_texture_t) #define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( 0x4c, drm_radeon_stipple_t) #define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(0x4d, drm_radeon_indirect_t) +#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(0x4e, drm_radeon_texture_t) #ifdef CONFIG_DRM_SIS /* SiS specific ioctls */ diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h index 227ec35a3..b48d9b1fc 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h @@ -710,7 +710,11 @@ typedef struct drm_device { drm_agp_head_t *agp; #endif #ifdef __alpha__ +#if LINUX_VERSION_CODE < 0x020403 struct pci_controler *hose; +#else + struct pci_controller *hose; +#endif #endif drm_sg_mem_t *sg; /* Scatter gather memory */ unsigned long *ctx_bitmap; diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_drv.h index 5337646f7..87da59512 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_drv.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_drv.h @@ -138,8 +138,10 @@ static drm_ioctl_desc_t DRM(ioctls)[] = { [DRM_IOCTL_NR(DRM_IOCTL_ADD_MAP)] = { DRM(addmap), 1, 1 }, [DRM_IOCTL_NR(DRM_IOCTL_RM_MAP)] = { DRM(rmmap), 1, 0 }, +#if __HAVE_CTX_BITMAP [DRM_IOCTL_NR(DRM_IOCTL_SET_SAREA_CTX)] = { DRM(setsareactx), 1, 1 }, [DRM_IOCTL_NR(DRM_IOCTL_GET_SAREA_CTX)] = { DRM(getsareactx), 1, 0 }, +#endif [DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)] = { DRM(addctx), 1, 1 }, [DRM_IOCTL_NR(DRM_IOCTL_RM_CTX)] = { DRM(rmctx), 1, 1 }, diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_vm.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_vm.h index 771c11bd2..d17a13707 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_vm.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_vm.h @@ -377,6 +377,8 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) DRM_DEBUG("start = 0x%lx, end = 0x%lx, offset = 0x%lx\n", vma->vm_start, vma->vm_end, VM_OFFSET(vma)); + if ( !priv->authenticated ) return -EACCES; + if (!VM_OFFSET(vma)) return DRM(mmap_dma)(filp, vma); /* A sequential search of a linked list is diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c index d3a9414d7..7510e2b57 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/gamma_dma.c @@ -547,10 +547,6 @@ int gamma_dma(struct inode *inode, struct file *filp, unsigned int cmd, int retcode = 0; drm_dma_t d; -#if 0 - LOCK_TEST_WITH_RETURN( dev ); -#endif - if (copy_from_user(&d, (drm_dma_t *)arg, sizeof(d))) return -EFAULT; diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c index 4c90496a7..8a5503eaf 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_dma.c @@ -182,7 +182,11 @@ static int i810_map_buffer(drm_buf_t *buf, struct file *filp) if(buf_priv->currently_mapped == I810_BUF_MAPPED) return -EINVAL; if(VM_DONTCOPY != 0) { - down(¤t->mm->mmap_sem); +#if LINUX_VERSION_CODE <= 0x020402 + down( ¤t->mm->mmap_sem ); +#else + down_write( ¤t->mm->mmap_sem ); +#endif old_fops = filp->f_op; filp->f_op = &i810_buffer_fops; dev_priv->mmap_buffer = buf; @@ -198,7 +202,11 @@ static int i810_map_buffer(drm_buf_t *buf, struct file *filp) retcode = (signed int)buf_priv->virtual; buf_priv->virtual = 0; } - up(¤t->mm->mmap_sem); +#if LINUX_VERSION_CODE <= 0x020402 + up( ¤t->mm->mmap_sem ); +#else + up_write( ¤t->mm->mmap_sem ); +#endif } else { buf_priv->virtual = buf_priv->kernel_virtual; buf_priv->currently_mapped = I810_BUF_MAPPED; @@ -214,7 +222,11 @@ static int i810_unmap_buffer(drm_buf_t *buf) if(VM_DONTCOPY != 0) { if(buf_priv->currently_mapped != I810_BUF_MAPPED) return -EINVAL; - down(¤t->mm->mmap_sem); +#if LINUX_VERSION_CODE <= 0x020402 + down( ¤t->mm->mmap_sem ); +#else + down_write( ¤t->mm->mmap_sem ); +#endif #if LINUX_VERSION_CODE < 0x020399 retcode = do_munmap((unsigned long)buf_priv->virtual, (size_t) buf->total); @@ -223,7 +235,11 @@ static int i810_unmap_buffer(drm_buf_t *buf) (unsigned long)buf_priv->virtual, (size_t) buf->total); #endif - up(¤t->mm->mmap_sem); +#if LINUX_VERSION_CODE <= 0x020402 + up( ¤t->mm->mmap_sem ); +#else + up_write( ¤t->mm->mmap_sem ); +#endif } buf_priv->currently_mapped = I810_BUF_UNMAPPED; buf_priv->virtual = 0; diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drm.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drm.h index cee189b7b..5d47adda2 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drm.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/i810_drm.h @@ -98,8 +98,13 @@ typedef struct _drm_i810_init { I810_INIT_DMA = 0x01, I810_CLEANUP_DMA = 0x02 } func; +#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0) + int ring_map_idx; + int buffer_map_idx; +#else unsigned int mmio_offset; unsigned int buffers_offset; +#endif int sarea_priv_offset; unsigned int ring_start; unsigned int ring_end; 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 1ced05fe9..fbc5fabc0 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 @@ -131,7 +131,9 @@ static int r128_do_pixcache_flush( drm_r128_private_t *dev_priv ) udelay( 1 ); } +#if R128_FIFO_DEBUG DRM_ERROR( "%s failed!\n", __FUNCTION__ ); +#endif return -EBUSY; } @@ -145,7 +147,9 @@ static int r128_do_wait_for_fifo( drm_r128_private_t *dev_priv, int entries ) udelay( 1 ); } +#if R128_FIFO_DEBUG DRM_ERROR( "%s failed!\n", __FUNCTION__ ); +#endif return -EBUSY; } @@ -164,7 +168,9 @@ int r128_do_wait_for_idle( drm_r128_private_t *dev_priv ) udelay( 1 ); } +#if R128_FIFO_DEBUG DRM_ERROR( "%s failed!\n", __FUNCTION__ ); +#endif return -EBUSY; } 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 fc1261eae..0fc6a6cd1 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 @@ -175,7 +175,11 @@ typedef struct drm_r128_init { R128_INIT_CCE = 0x01, R128_CLEANUP_CCE = 0x02 } func; +#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0) + int sarea_priv_offset; +#else unsigned long sarea_priv_offset; +#endif int is_pci; int cce_mode; int cce_secure; @@ -189,12 +193,21 @@ typedef struct drm_r128_init { unsigned int depth_offset, depth_pitch; unsigned int span_offset; +#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0) + unsigned int fb_offset; + unsigned int mmio_offset; + unsigned int ring_offset; + unsigned int ring_rptr_offset; + unsigned int buffers_offset; + unsigned int agp_textures_offset; +#else unsigned long fb_offset; unsigned long mmio_offset; unsigned long ring_offset; unsigned long ring_rptr_offset; unsigned long buffers_offset; unsigned long agp_textures_offset; +#endif } drm_r128_init_t; typedef struct drm_r128_cce_stop { @@ -202,19 +215,17 @@ typedef struct drm_r128_cce_stop { int idle; } drm_r128_cce_stop_t; -typedef struct drm_r128_fullscreen { - enum { - R128_INIT_FULLSCREEN = 0x01, - R128_CLEANUP_FULLSCREEN = 0x02 - } func; -} drm_r128_fullscreen_t; - typedef struct drm_r128_clear { unsigned int flags; +#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0) + int x, y, w, h; +#endif unsigned int clear_color; unsigned int clear_depth; +#if CONFIG_XFREE86_VERSION >= XFREE86_VERSION(4,1,0,0) unsigned int color_mask; unsigned int depth_mask; +#endif } drm_r128_clear_t; typedef struct drm_r128_vertex { @@ -266,4 +277,11 @@ typedef struct drm_r128_indirect { int discard; } drm_r128_indirect_t; +typedef struct drm_r128_fullscreen { + enum { + R128_INIT_FULLSCREEN = 0x01, + R128_CLEANUP_FULLSCREEN = 0x02 + } func; +} drm_r128_fullscreen_t; + #endif diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_cp.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_cp.c index c255a3e05..d8b85949d 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_cp.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_cp.c @@ -38,6 +38,12 @@ #define RADEON_FIFO_DEBUG 0 +#if defined(__alpha__) +# define PCIGART_ENABLED +#else +# undef PCIGART_ENABLED +#endif + /* CP microcode (from ATI) */ static u32 radeon_cp_microcode[][2] = { @@ -520,8 +526,13 @@ static int radeon_do_engine_reset( drm_device_t *dev ) clock_cntl_index = RADEON_READ( RADEON_CLOCK_CNTL_INDEX ); mclk_cntl = RADEON_READ_PLL( dev, RADEON_MCLK_CNTL ); - /* FIXME: remove magic number here and in radeon ddx driver!!! */ - RADEON_WRITE_PLL( RADEON_MCLK_CNTL, mclk_cntl | 0x003f00000 ); + RADEON_WRITE_PLL( RADEON_MCLK_CNTL, ( mclk_cntl | + RADEON_FORCEON_MCLKA | + RADEON_FORCEON_MCLKB | + RADEON_FORCEON_YCLKA | + RADEON_FORCEON_YCLKB | + RADEON_FORCEON_MC | + RADEON_FORCEON_AIC ) ); rbbm_soft_reset = RADEON_READ( RADEON_RBBM_SOFT_RESET ); @@ -654,7 +665,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) dev_priv->is_pci = init->is_pci; -#if 1 +#if !defined(PCIGART_ENABLED) /* PCI support is not 100% working, so we disable it here. */ if ( dev_priv->is_pci ) { @@ -666,7 +677,6 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) #endif if ( dev_priv->is_pci && !dev->sg ) { - DRM_DEBUG( "PCI GART memory not allocated!\n" ); DRM_ERROR( "PCI GART memory not allocated!\n" ); DRM(free)( dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER ); dev->dev_private = NULL; @@ -873,7 +883,6 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) if ( dev_priv->is_pci ) { dev_priv->phys_pci_gart = DRM(ati_pcigart_init)( dev ); if ( !dev_priv->phys_pci_gart ) { - DRM_DEBUG( "failed to init PCI GART!\n" ); DRM_ERROR( "failed to init PCI GART!\n" ); DRM(free)( dev_priv, sizeof(*dev_priv), DRM_MEM_DRIVER ); @@ -899,7 +908,8 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) /* Turn off AGP aperture -- is this required for PCIGART? */ - RADEON_WRITE( RADEON_MC_AGP_LOCATION, 0 ); + RADEON_WRITE( RADEON_MC_AGP_LOCATION, 0xffffffc0 ); /* ?? */ + RADEON_WRITE( RADEON_AGP_COMMAND, 0 ); /* clear AGP_COMMAND */ } else { /* Turn off PCI GART */ diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drv.h index ee5e113b1..4217beee9 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drv.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drv.h @@ -181,6 +181,7 @@ extern int radeon_cp_indirect( struct inode *inode, struct file *filp, * for Radeon kernel driver. */ +#define RADEON_AGP_COMMAND 0x0f60 #define RADEON_AUX_SCISSOR_CNTL 0x26f0 # define RADEON_EXCLUSIVE_SCISSOR_0 (1 << 24) # define RADEON_EXCLUSIVE_SCISSOR_1 (1 << 25) @@ -254,6 +255,12 @@ extern int radeon_cp_indirect( struct inode *inode, struct file *filp, #define RADEON_MC_AGP_LOCATION 0x014c #define RADEON_MC_FB_LOCATION 0x0148 #define RADEON_MCLK_CNTL 0x0012 +# define RADEON_FORCEON_MCLKA (1 << 16) +# define RADEON_FORCEON_MCLKB (1 << 17) +# define RADEON_FORCEON_YCLKA (1 << 18) +# define RADEON_FORCEON_YCLKB (1 << 19) +# define RADEON_FORCEON_MC (1 << 20) +# define RADEON_FORCEON_AIC (1 << 21) #define RADEON_PP_BORDER_COLOR_0 0x1d40 #define RADEON_PP_BORDER_COLOR_1 0x1d44 diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis.h new file mode 100644 index 000000000..06f284ad7 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis.h @@ -0,0 +1,50 @@ +/* sis_drv.h -- Private header for sis driver -*- linux-c -*- + * + * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. + * 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 + * 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 NONINFRINGEMENT. IN NO EVENT SHALL + * PRECISION INSIGHT AND/OR ITS 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. + * + */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis.h,v 1.1.2.1 2001/05/22 21:54:54 dawes Exp $ */ + +#ifndef __SIS_H__ +#define __SIS_H__ + +/* This remains constant for all DRM template files. + * Name it sisdrv_##x as there's a conflict with sis_free/malloc in the kernel + * that's used for fb devices + */ +#define DRM(x) sisdrv_##x + +/* General customization: + */ +#define __HAVE_AGP 1 +#define __MUST_HAVE_AGP 0 +#define __HAVE_MTRR 1 +#define __HAVE_CTX_BITMAP 1 + +/* Buffer customization: + */ +#define DRIVER_AGP_BUFFERS_MAP( dev ) \ + ((drm_sis_private_t *)((dev)->dev_private))->buffers + +#endif diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drm.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drm.h index 299143f61..339ed5a00 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drm.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drm.h @@ -17,4 +17,20 @@ typedef struct { unsigned int left, right; } drm_sis_flip_t; +#ifdef __KERNEL__ + +int sis_fb_alloc(struct inode *inode, struct file *filp, unsigned int cmd, + unsigned long arg); +int sis_fb_free(struct inode *inode, struct file *filp, unsigned int cmd, + unsigned long arg); + +int sisp_agp_init(struct inode *inode, struct file *filp, unsigned int cmd, + unsigned long arg); +int sisp_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd, + unsigned long arg); +int sisp_agp_free(struct inode *inode, struct file *filp, unsigned int cmd, + unsigned long arg); + +#endif + #endif diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c index 92ec32ddd..3dd83fd7e 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.c @@ -26,669 +26,49 @@ */ #include <linux/config.h> +#include "sis.h" #include "drmP.h" #include "sis_drm.h" #include "sis_drv.h" -#define SIS_NAME "sis" -#define SIS_DESC "SIS 300/630/540" -#define SIS_DATE "20000831" -#define SIS_MAJOR 1 -#define SIS_MINOR 0 -#define SIS_PATCHLEVEL 0 - -static drm_device_t sis_device; -drm_ctx_t sis_res_ctx; - -static struct file_operations sis_fops = { -#if LINUX_VERSION_CODE >= 0x020400 - /* This started being used during 2.4.0-test */ - owner: THIS_MODULE, -#endif - open: sis_open, - flush: drm_flush, - release: sis_release, - ioctl: sis_ioctl, - mmap: drm_mmap, - read: drm_read, - fasync: drm_fasync, - poll: drm_poll, -}; - -static struct miscdevice sis_misc = { - minor: MISC_DYNAMIC_MINOR, - name: SIS_NAME, - fops: &sis_fops, -}; - -static drm_ioctl_desc_t sis_ioctls[] = { - [DRM_IOCTL_NR(DRM_IOCTL_VERSION)] = { sis_version, 0, 0 }, - [DRM_IOCTL_NR(DRM_IOCTL_GET_UNIQUE)] = { drm_getunique, 0, 0 }, - [DRM_IOCTL_NR(DRM_IOCTL_GET_MAGIC)] = { drm_getmagic, 0, 0 }, - [DRM_IOCTL_NR(DRM_IOCTL_IRQ_BUSID)] = { drm_irq_busid, 0, 1 }, - - [DRM_IOCTL_NR(DRM_IOCTL_SET_UNIQUE)] = { drm_setunique, 1, 1 }, - [DRM_IOCTL_NR(DRM_IOCTL_BLOCK)] = { drm_block, 1, 1 }, - [DRM_IOCTL_NR(DRM_IOCTL_UNBLOCK)] = { drm_unblock, 1, 1 }, - [DRM_IOCTL_NR(DRM_IOCTL_AUTH_MAGIC)] = { drm_authmagic, 1, 1 }, - [DRM_IOCTL_NR(DRM_IOCTL_ADD_MAP)] = { drm_addmap, 1, 1 }, - - [DRM_IOCTL_NR(DRM_IOCTL_ADD_CTX)] = { sis_addctx, 1, 1 }, - [DRM_IOCTL_NR(DRM_IOCTL_RM_CTX)] = { sis_rmctx, 1, 1 }, - [DRM_IOCTL_NR(DRM_IOCTL_MOD_CTX)] = { sis_modctx, 1, 1 }, - [DRM_IOCTL_NR(DRM_IOCTL_GET_CTX)] = { sis_getctx, 1, 0 }, - [DRM_IOCTL_NR(DRM_IOCTL_SWITCH_CTX)] = { sis_switchctx, 1, 1 }, - [DRM_IOCTL_NR(DRM_IOCTL_NEW_CTX)] = { sis_newctx, 1, 1 }, - [DRM_IOCTL_NR(DRM_IOCTL_RES_CTX)] = { sis_resctx, 1, 0 }, - [DRM_IOCTL_NR(DRM_IOCTL_ADD_DRAW)] = { drm_adddraw, 1, 1 }, - [DRM_IOCTL_NR(DRM_IOCTL_RM_DRAW)] = { drm_rmdraw, 1, 1 }, - [DRM_IOCTL_NR(DRM_IOCTL_LOCK)] = { sis_lock, 1, 0 }, - [DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)] = { sis_unlock, 1, 0 }, - [DRM_IOCTL_NR(DRM_IOCTL_FINISH)] = { drm_finish, 1, 0 }, -#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE) - [DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = {drm_agp_acquire, 1, 1}, - [DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = {drm_agp_release, 1, 1}, - [DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)] = {drm_agp_enable, 1, 1}, - [DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)] = {drm_agp_info, 1, 1}, - [DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)] = {drm_agp_alloc, 1, 1}, - [DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)] = {drm_agp_free, 1, 1}, - [DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)] = {drm_agp_bind, 1, 1}, - [DRM_IOCTL_NR(DRM_IOCTL_AGP_UNBIND)] = {drm_agp_unbind, 1, 1}, -#endif - /* FB Memory Management */ - [DRM_IOCTL_NR(SIS_IOCTL_FB_ALLOC)] = { sis_fb_alloc, 1, 1 }, - [DRM_IOCTL_NR(SIS_IOCTL_FB_FREE)] = { sis_fb_free, 1, 1 }, - - /* AGP Memory Management */ - [DRM_IOCTL_NR(SIS_IOCTL_AGP_INIT)] = { sis_agp_init, 1, 1 }, - [DRM_IOCTL_NR(SIS_IOCTL_AGP_ALLOC)] = { sis_agp_alloc, 1, 1 }, - [DRM_IOCTL_NR(SIS_IOCTL_AGP_FREE)] = { sis_agp_free, 1, 1 }, - -#if defined(SIS_STEREO) - [DRM_IOCTL_NR(DRM_IOCTL_CONTROL)] = { sis_control, 1, 1 }, - [DRM_IOCTL_NR(SIS_IOCTL_FLIP)] = { sis_flip, 1, 1 }, - [DRM_IOCTL_NR(SIS_IOCTL_FLIP_INIT)] = { sis_flip_init, 1, 1 }, - [DRM_IOCTL_NR(SIS_IOCTL_FLIP_FINAL)] = { sis_flip_final, 1, 1 }, -#endif -}; -#define SIS_IOCTL_COUNT DRM_ARRAY_SIZE(sis_ioctls) - -#ifdef MODULE -static char *sis = NULL; -#endif - -MODULE_AUTHOR("VA Linux Systems, Inc."); -MODULE_DESCRIPTION("sis"); -MODULE_PARM(sis, "s"); - -#ifndef MODULE -/* sis_options is called by the kernel to parse command-line options - * passed via the boot-loader (e.g., LILO). It calls the insmod option - * routine, drm_parse_drm. - */ - -static int __init sis_options(char *str) -{ - drm_parse_options(str); - return 1; -} - -__setup("sis=", sis_options); -#endif - -static int sis_setup(drm_device_t *dev) -{ - int i; - - atomic_set(&dev->ioctl_count, 0); - atomic_set(&dev->vma_count, 0); - dev->buf_use = 0; - atomic_set(&dev->buf_alloc, 0); - - atomic_set(&dev->total_open, 0); - atomic_set(&dev->total_close, 0); - atomic_set(&dev->total_ioctl, 0); - atomic_set(&dev->total_irq, 0); - atomic_set(&dev->total_ctx, 0); - atomic_set(&dev->total_locks, 0); - atomic_set(&dev->total_unlocks, 0); - atomic_set(&dev->total_contends, 0); - atomic_set(&dev->total_sleeps, 0); - - for (i = 0; i < DRM_HASH_SIZE; i++) { - dev->magiclist[i].head = NULL; - dev->magiclist[i].tail = NULL; - } - dev->maplist = NULL; - dev->map_count = 0; - dev->vmalist = NULL; - dev->lock.hw_lock = NULL; - init_waitqueue_head(&dev->lock.lock_queue); - dev->queue_count = 0; - dev->queue_reserved = 0; - dev->queue_slots = 0; - dev->queuelist = NULL; - dev->irq = 0; - dev->context_flag = 0; - dev->interrupt_flag = 0; - dev->dma = 0; - dev->dma_flag = 0; - dev->last_context = 0; - dev->last_switch = 0; - dev->last_checked = 0; - init_timer(&dev->timer); - init_waitqueue_head(&dev->context_wait); - - dev->ctx_start = 0; - dev->lck_start = 0; - - dev->buf_rp = dev->buf; - dev->buf_wp = dev->buf; - dev->buf_end = dev->buf + DRM_BSZ; - dev->buf_async = NULL; - init_waitqueue_head(&dev->buf_readers); - init_waitqueue_head(&dev->buf_writers); - - sis_res_ctx.handle=-1; - - DRM_DEBUG("\n"); - - /* The kernel's context could be created here, but is now created - in drm_dma_enqueue. This is more resource-efficient for - hardware that does not do DMA, but may mean that - drm_select_queue fails between the time the interrupt is - initialized and the time the queues are initialized. */ - - return 0; -} - - -static int sis_takedown(drm_device_t *dev) -{ - int i; - drm_magic_entry_t *pt, *next; - drm_map_t *map; - drm_vma_entry_t *vma, *vma_next; - - DRM_DEBUG("\n"); - -#if defined(SIS_STEREO) - if (dev->irq) sis_irq_uninstall(dev); -#endif - - down(&dev->struct_sem); - del_timer(&dev->timer); - - if (dev->devname) { - drm_free(dev->devname, strlen(dev->devname)+1, DRM_MEM_DRIVER); - dev->devname = NULL; - } - - if (dev->unique) { - drm_free(dev->unique, strlen(dev->unique)+1, DRM_MEM_DRIVER); - dev->unique = NULL; - dev->unique_len = 0; - } - /* Clear pid list */ - for (i = 0; i < DRM_HASH_SIZE; i++) { - for (pt = dev->magiclist[i].head; pt; pt = next) { - next = pt->next; - drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC); - } - dev->magiclist[i].head = dev->magiclist[i].tail = NULL; - } -#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE) - /* Clear AGP information */ - if (dev->agp) { - drm_agp_mem_t *temp; - drm_agp_mem_t *temp_next; - - temp = dev->agp->memory; - while(temp != NULL) { - temp_next = temp->next; - drm_free_agp(temp->memory, temp->pages); - drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS); - temp = temp_next; - } - if (dev->agp->acquired) _drm_agp_release(); - } -#endif - /* Clear vma list (only built for debugging) */ - if (dev->vmalist) { - for (vma = dev->vmalist; vma; vma = vma_next) { - vma_next = vma->next; - drm_free(vma, sizeof(*vma), DRM_MEM_VMAS); - } - dev->vmalist = NULL; - } - - /* Clear map area and mtrr information */ - if (dev->maplist) { - for (i = 0; i < dev->map_count; i++) { - map = dev->maplist[i]; - switch (map->type) { - case _DRM_REGISTERS: - case _DRM_FRAME_BUFFER: -#ifdef CONFIG_MTRR - if (map->mtrr >= 0) { - int retcode; - retcode = mtrr_del(map->mtrr, - map->offset, - map->size); - DRM_DEBUG("mtrr_del = %d\n", retcode); - } -#endif - drm_ioremapfree(map->handle, map->size); - break; - case _DRM_SHM: - drm_free_pages((unsigned long)map->handle, - drm_order(map->size) - - PAGE_SHIFT, - DRM_MEM_SAREA); - break; - case _DRM_AGP: - /* Do nothing here, because this is all - handled in the AGP/GART driver. */ - break; - } - drm_free(map, sizeof(*map), DRM_MEM_MAPS); - } - drm_free(dev->maplist, - dev->map_count * sizeof(*dev->maplist), - DRM_MEM_MAPS); - dev->maplist = NULL; - dev->map_count = 0; - } - - if (dev->lock.hw_lock) { - dev->lock.hw_lock = NULL; /* SHM removed */ - dev->lock.pid = 0; - wake_up_interruptible(&dev->lock.lock_queue); - } - up(&dev->struct_sem); - - return 0; -} - -/* sis_init is called via init_module at module load time, or via - * linux/init/main.c (this is not currently supported). */ - -static int sis_init(void) -{ - int retcode; - drm_device_t *dev = &sis_device; - - DRM_DEBUG("\n"); - - memset((void *)dev, 0, sizeof(*dev)); - dev->count_lock = SPIN_LOCK_UNLOCKED; - sema_init(&dev->struct_sem, 1); - -#ifdef MODULE - drm_parse_options(sis); -#endif - - if ((retcode = misc_register(&sis_misc))) { - DRM_ERROR("Cannot register \"%s\"\n", SIS_NAME); - return retcode; - } - dev->device = MKDEV(MISC_MAJOR, sis_misc.minor); - dev->name = SIS_NAME; - - drm_mem_init(); - drm_proc_init(dev); -#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE) - dev->agp = drm_agp_init(); -#endif - if((retcode = drm_ctxbitmap_init(dev))) { - DRM_ERROR("Cannot allocate memory for context bitmap.\n"); - drm_proc_cleanup(); - misc_deregister(&sis_misc); - sis_takedown(dev); - return retcode; - } - - DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", - SIS_NAME, - SIS_MAJOR, - SIS_MINOR, - SIS_PATCHLEVEL, - SIS_DATE, - sis_misc.minor); - - return 0; -} - -/* sis_cleanup is called via cleanup_module at module unload time. */ - -static void sis_cleanup(void) -{ - drm_device_t *dev = &sis_device; - - DRM_DEBUG("\n"); - - drm_proc_cleanup(); - if (misc_deregister(&sis_misc)) { - DRM_ERROR("Cannot unload module\n"); - } else { - DRM_INFO("Module unloaded\n"); - } - drm_ctxbitmap_cleanup(dev); - sis_takedown(dev); -#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE) - if (dev->agp) { - drm_agp_uninit(); - drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS); - dev->agp = NULL; - } -#endif -} - -module_init(sis_init); -module_exit(sis_cleanup); - - -int sis_version(struct inode *inode, struct file *filp, unsigned int cmd, - unsigned long arg) -{ - drm_version_t version; - int len; - - if (copy_from_user(&version, (drm_version_t *)arg, sizeof(version))) - return -EFAULT; - -#define DRM_COPY(name,value) \ - len = strlen(value); \ - if (len > name##_len) len = name##_len; \ - name##_len = strlen(value); \ - if (len && name) { \ - if (copy_to_user(name, value, len)) \ - return -EFAULT; \ - } - - version.version_major = SIS_MAJOR; - version.version_minor = SIS_MINOR; - version.version_patchlevel = SIS_PATCHLEVEL; - - DRM_COPY(version.name, SIS_NAME); - DRM_COPY(version.date, SIS_DATE); - DRM_COPY(version.desc, SIS_DESC); - - if (copy_to_user((drm_version_t *)arg, &version, sizeof(version))) - return -EFAULT; - return 0; -} - -int sis_open(struct inode *inode, struct file *filp) -{ - drm_device_t *dev = &sis_device; - int retcode = 0; - - DRM_DEBUG("open_count = %d\n", dev->open_count); - if (!(retcode = drm_open_helper(inode, filp, dev))) { -#if LINUX_VERSION_CODE < 0x020333 - MOD_INC_USE_COUNT; /* Needed before Linux 2.3.51 */ -#endif - atomic_inc(&dev->total_open); - spin_lock(&dev->count_lock); - if (!dev->open_count++) { - spin_unlock(&dev->count_lock); - return sis_setup(dev); - } - spin_unlock(&dev->count_lock); - } - return retcode; -} - -int sis_release(struct inode *inode, struct file *filp) -{ - drm_file_t *priv = filp->private_data; - drm_device_t *dev; - int retcode = 0; - - lock_kernel(); - dev = priv->dev; - - DRM_DEBUG("open_count = %d\n", dev->open_count); - if (!(retcode = drm_release(inode, filp))) { -#if LINUX_VERSION_CODE < 0x020333 - MOD_DEC_USE_COUNT; /* Needed before Linux 2.3.51 */ -#endif - atomic_inc(&dev->total_close); - spin_lock(&dev->count_lock); - if (!--dev->open_count) { - if (atomic_read(&dev->ioctl_count) || dev->blocked) { - DRM_ERROR("Device busy: %d %d\n", - atomic_read(&dev->ioctl_count), - dev->blocked); - spin_unlock(&dev->count_lock); - unlock_kernel(); - return -EBUSY; - } - spin_unlock(&dev->count_lock); - unlock_kernel(); - return sis_takedown(dev); - } - spin_unlock(&dev->count_lock); - } - - unlock_kernel(); - return retcode; -} - -/* sis_ioctl is called whenever a process performs an ioctl on /dev/drm. */ - -int sis_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, - unsigned long arg) -{ - int nr = DRM_IOCTL_NR(cmd); - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->dev; - int retcode = 0; - drm_ioctl_desc_t *ioctl; - drm_ioctl_t *func; - - atomic_inc(&dev->ioctl_count); - atomic_inc(&dev->total_ioctl); - ++priv->ioctl_count; - - DRM_DEBUG("pid = %d, cmd = 0x%02x, nr = 0x%02x, dev 0x%x, auth = %d\n", - current->pid, cmd, nr, dev->device, priv->authenticated); - - if (nr >= SIS_IOCTL_COUNT) { - retcode = -EINVAL; - } else { - ioctl = &sis_ioctls[nr]; - func = ioctl->func; - - if (!func) { - DRM_DEBUG("no function\n"); - retcode = -EINVAL; - } else if ((ioctl->root_only && !capable(CAP_SYS_ADMIN)) - || (ioctl->auth_needed && !priv->authenticated)) { - retcode = -EACCES; - } else { - retcode = (func)(inode, filp, cmd, arg); - } - } - - atomic_dec(&dev->ioctl_count); - return retcode; -} - -int sis_lock(struct inode *inode, struct file *filp, unsigned int cmd, - unsigned long arg) -{ - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->dev; - DECLARE_WAITQUEUE(entry, current); - int ret = 0; - drm_lock_t lock; -#if DRM_DMA_HISTOGRAM - cycles_t start; - - dev->lck_start = start = get_cycles(); -#endif - - if (copy_from_user(&lock, (drm_lock_t *)arg, sizeof(lock))) - return -EFAULT; - - if (lock.context == DRM_KERNEL_CONTEXT) { - DRM_ERROR("Process %d using kernel context %d\n", - current->pid, lock.context); - return -EINVAL; - } - - DRM_DEBUG("%d (pid %d) requests lock (0x%08x), flags = 0x%08x\n", - lock.context, current->pid, dev->lock.hw_lock->lock, - lock.flags); - -#if 0 - /* dev->queue_count == 0 right now for - sis. FIXME? */ - if (lock.context < 0 || lock.context >= dev->queue_count) - return -EINVAL; -#endif - - if (!ret) { -#if 0 - if (_DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock) - != lock.context) { - long j = jiffies - dev->lock.lock_time; - - if (lock.context == sis_res_ctx.handle && - j >= 0 && j < DRM_LOCK_SLICE) { - /* Can't take lock if we just had it and - there is contention. */ - DRM_DEBUG("%d (pid %d) delayed j=%d dev=%d jiffies=%d\n", - lock.context, current->pid, j, - dev->lock.lock_time, jiffies); - current->state = TASK_INTERRUPTIBLE; - current->policy |= SCHED_YIELD; - schedule_timeout(DRM_LOCK_SLICE-j); - DRM_DEBUG("jiffies=%d\n", jiffies); - } - } -#endif - add_wait_queue(&dev->lock.lock_queue, &entry); - for (;;) { - current->state = TASK_INTERRUPTIBLE; - if (!dev->lock.hw_lock) { - /* Device has been unregistered */ - ret = -EINTR; - break; - } - if (drm_lock_take(&dev->lock.hw_lock->lock, - lock.context)) { - dev->lock.pid = current->pid; - dev->lock.lock_time = jiffies; - atomic_inc(&dev->total_locks); - break; /* Got lock */ - } - - /* Contention */ - atomic_inc(&dev->total_sleeps); -#if 1 - current->policy |= SCHED_YIELD; -#endif - schedule(); - if (signal_pending(current)) { - ret = -ERESTARTSYS; - break; - } - } - current->state = TASK_RUNNING; - remove_wait_queue(&dev->lock.lock_queue, &entry); - } - -#if 0 - if (!ret && dev->last_context != lock.context && - lock.context != sis_res_ctx.handle && - dev->last_context != sis_res_ctx.handle) { - add_wait_queue(&dev->context_wait, &entry); - current->state = TASK_INTERRUPTIBLE; - /* PRE: dev->last_context != lock.context */ - sis_context_switch(dev, dev->last_context, lock.context); - /* POST: we will wait for the context - switch and will dispatch on a later call - when dev->last_context == lock.context - NOTE WE HOLD THE LOCK THROUGHOUT THIS - TIME! */ - current->policy |= SCHED_YIELD; - schedule(); - current->state = TASK_RUNNING; - remove_wait_queue(&dev->context_wait, &entry); - if (signal_pending(current)) { - ret = -EINTR; - } else if (dev->last_context != lock.context) { - DRM_ERROR("Context mismatch: %d %d\n", - dev->last_context, lock.context); - } - } -#endif - - if (!ret) { - sigemptyset(&dev->sigmask); - sigaddset(&dev->sigmask, SIGSTOP); - sigaddset(&dev->sigmask, SIGTSTP); - sigaddset(&dev->sigmask, SIGTTIN); - sigaddset(&dev->sigmask, SIGTTOU); - dev->sigdata.context = lock.context; - dev->sigdata.lock = dev->lock.hw_lock; - block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask); - - if (lock.flags & _DRM_LOCK_READY) { - /* Wait for space in DMA/FIFO */ - } - if (lock.flags & _DRM_LOCK_QUIESCENT) { - /* Make hardware quiescent */ -#if 0 - sis_quiescent(dev); -#endif - } - } - - DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock"); - -#if DRM_DMA_HISTOGRAM - atomic_inc(&dev->histo.lacq[drm_histogram_slot(get_cycles() - start)]); -#endif - - return ret; -} - - -int sis_unlock(struct inode *inode, struct file *filp, unsigned int cmd, - unsigned long arg) -{ - drm_file_t *priv = filp->private_data; - drm_device_t *dev = priv->dev; - drm_lock_t lock; - - if (copy_from_user(&lock, (drm_lock_t *)arg, sizeof(lock))) - return -EFAULT; - - if (lock.context == DRM_KERNEL_CONTEXT) { - DRM_ERROR("Process %d using kernel context %d\n", - current->pid, lock.context); - return -EINVAL; - } - - DRM_DEBUG("%d frees lock (%d holds)\n", - lock.context, - _DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock)); - atomic_inc(&dev->total_unlocks); - if (_DRM_LOCK_IS_CONT(dev->lock.hw_lock->lock)) - atomic_inc(&dev->total_contends); - drm_lock_transfer(dev, &dev->lock.hw_lock->lock, DRM_KERNEL_CONTEXT); - /* FIXME: Try to send data to card here */ - if (!dev->context_flag) { - if (drm_lock_free(dev, &dev->lock.hw_lock->lock, - DRM_KERNEL_CONTEXT)) { - DRM_ERROR("\n"); - } - } - - unblock_all_signals(); - return 0; -} +#define DRIVER_AUTHOR "SIS" +#define DRIVER_NAME "sis" +#define DRIVER_DESC "SIS 300/630/540" +#define DRIVER_DATE "20010503" +#define DRIVER_MAJOR 1 +#define DRIVER_MINOR 0 +#define DRIVER_PATCHLEVEL 0 + +#define DRIVER_IOCTLS \ + [DRM_IOCTL_NR(SIS_IOCTL_FB_ALLOC)] = { sis_fb_alloc, 1, 1 }, \ + [DRM_IOCTL_NR(SIS_IOCTL_FB_FREE)] = { sis_fb_free, 1, 1 }, \ + /* AGP Memory Management */ \ + [DRM_IOCTL_NR(SIS_IOCTL_AGP_INIT)] = { sisp_agp_init, 1, 1 }, \ + [DRM_IOCTL_NR(SIS_IOCTL_AGP_ALLOC)] = { sisp_agp_alloc, 1, 1 }, \ + [DRM_IOCTL_NR(SIS_IOCTL_AGP_FREE)] = { sisp_agp_free, 1, 1 } +#if 0 /* these don't appear to be defined */ + /* SIS Stereo */ + [DRM_IOCTL_NR(DRM_IOCTL_CONTROL)] = { sis_control, 1, 1 }, + [DRM_IOCTL_NR(SIS_IOCTL_FLIP)] = { sis_flip, 1, 1 }, + [DRM_IOCTL_NR(SIS_IOCTL_FLIP_INIT)] = { sis_flip_init, 1, 1 }, + [DRM_IOCTL_NR(SIS_IOCTL_FLIP_FINAL)] = { sis_flip_final, 1, 1 } +#endif + +#define __HAVE_COUNTERS 5 + +#include "drm_auth.h" +#include "drm_agpsupport.h" +#include "drm_bufs.h" +#include "drm_context.h" +#include "drm_dma.h" +#include "drm_drawable.h" +#include "drm_drv.h" +#include "drm_fops.h" +#include "drm_init.h" +#include "drm_ioctl.h" +#include "drm_lists.h" +#include "drm_lock.h" +#include "drm_memory.h" +#include "drm_proc.h" +#include "drm_vm.h" +#include "drm_stub.h" diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h index 8c4e29108..844e38b07 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_drv.h @@ -28,53 +28,11 @@ #ifndef _SIS_DRV_H_ #define _SIS_DRV_H_ - /* sis_drv.c */ -extern int sis_version(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); -extern int sis_open(struct inode *inode, struct file *filp); -extern int sis_release(struct inode *inode, struct file *filp); -extern int sis_ioctl(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); -extern int sis_irq_install(drm_device_t *dev, int irq); -extern int sis_irq_uninstall(drm_device_t *dev); -extern int sis_control(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); -extern int sis_lock(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); -extern int sis_unlock(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); +typedef struct drm_sis_private { + drm_map_t *buffers; +} drm_sis_private_t; - /* sis_context.c */ - -extern int sis_resctx(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); -extern int sis_addctx(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); -extern int sis_modctx(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); -extern int sis_getctx(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); -extern int sis_switchctx(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); -extern int sis_newctx(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); -extern int sis_rmctx(struct inode *inode, struct file *filp, - unsigned int cmd, unsigned long arg); - -extern int sis_context_switch(drm_device_t *dev, int old, int new); -extern int sis_context_switch_complete(drm_device_t *dev, int new); - -int sis_fb_alloc(struct inode *inode, struct file *filp, unsigned int cmd, - unsigned long arg); -int sis_fb_free(struct inode *inode, struct file *filp, unsigned int cmd, - unsigned long arg); - -int sis_agp_init(struct inode *inode, struct file *filp, unsigned int cmd, - unsigned long arg); -int sis_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd, - unsigned long arg); -int sis_agp_free(struct inode *inode, struct file *filp, unsigned int cmd, - unsigned long arg); +/* Stereo ? - this was never committed */ int sis_flip(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); @@ -83,8 +41,5 @@ int sis_flip_init(struct inode *inode, struct file *filp, unsigned int cmd, int sis_flip_final(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); void flip_final(void); - -int sis_init_context(int contexy); -int sis_final_context(int context); #endif diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c index 4c2b5a6c6..2c2e0d95a 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/sis_mm.c @@ -29,10 +29,12 @@ */ #define __NO_VERSION__ +#include "sis.h" +#include <linux/sisfb.h> #include "drmP.h" #include "sis_drm.h" -#include "sis_ds.h" #include "sis_drv.h" +#include "sis_ds.h" #define MAX_CONTEXT 100 #define VIDEO_TYPE 0 @@ -149,7 +151,7 @@ int sis_fb_free(struct inode *inode, struct file *filp, unsigned int cmd, static memHeap_t *AgpHeap = NULL; -int sis_agp_init(struct inode *inode, struct file *filp, unsigned int cmd, +int sisp_agp_init(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { drm_sis_agp_t agp; @@ -164,7 +166,7 @@ int sis_agp_init(struct inode *inode, struct file *filp, unsigned int cmd, return 0; } -int sis_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd, +int sisp_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { drm_sis_mem_t agp; @@ -201,7 +203,7 @@ int sis_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd, return retval; } -int sis_agp_free(struct inode *inode, struct file *filp, unsigned int cmd, +int sisp_agp_free(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { drm_sis_mem_t agp; @@ -277,7 +279,9 @@ int sis_final_context(int context) retval = setFirst(set, &item); while(retval){ DRM_DEBUG("free video memory 0x%x\n", item); +#if 0 sis_free(item); +#endif retval = setNext(set, &item); } setDestroy(set); diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c index ffc85d8cb..a04cf7ae6 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c @@ -27,7 +27,7 @@ * Authors: Rickard E. (Rik) Faith <faith@valinux.com> * Kevin E. Martin <martin@valinux.com> * - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.20 2001/04/18 18:44:39 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.22 2001/05/19 00:26:45 dawes Exp $ * */ @@ -67,10 +67,12 @@ extern int xf86RemoveSIGIOHandler(int fd); # endif #endif +/* No longer needed with CVS kernel modules on alpha #if defined(__alpha__) && defined(__linux__) extern unsigned long _bus_base(void); #define BUS_BASE _bus_base() #endif +*/ /* Not all systems have MAP_FAILED defined */ #ifndef MAP_FAILED @@ -169,11 +171,7 @@ static drmHashEntry *drmGetEntry(int fd) static int drmOpenDevice(long dev, int minor) { -#ifdef XFree86LOADER - struct xf86stat st; -#else - struct stat st; -#endif + stat_t st; char buf[64]; int fd; mode_t dirmode = DRM_DEV_DIRMODE; @@ -494,11 +492,12 @@ int drmAddMap(int fd, drm_map_t map; map.offset = offset; +/* No longer needed with CVS kernel modules on alpha #ifdef __alpha__ - /* Make sure we add the bus_base to all but shm */ if (type != DRM_SHM) map.offset += BUS_BASE; #endif +*/ map.size = size; map.handle = 0; map.type = type; 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 4a4cb98a6..a7f69d95a 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.9 2001/04/10 16:08:04 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmR128.c,v 1.9.2.1 2001/05/23 18:58:00 dawes Exp $ */ #ifdef XFree86Server # include "xf86.h" @@ -75,7 +75,7 @@ extern int xf86RemoveSIGIOHandler(int fd); #include "drm.h" #define R128_BUFFER_RETRY 32 -#define R128_IDLE_RETRY 16 +#define R128_IDLE_RETRY 32 int drmR128InitCCE( int fd, drmR128Init *info ) diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c index ef0ae01bd..fb36a2883 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c,v 1.5 2001/04/10 16:08:04 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmSiS.c,v 1.6.2.1 2001/05/22 21:25:46 dawes Exp $ */ #ifdef XFree86Server # include "xf86.h" 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 07451887b..51f680284 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.22 2001/03/03 23:54:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/int10/linux.c,v 1.24 2001/05/15 10:19:42 eich Exp $ */ /* * linux specific part of the int10 module * Copyright 1999 Egbert Eich @@ -24,6 +24,7 @@ #endif #define ALLOC_ENTRIES(x) ((V_RAM / x) - 1) #define REG pInt +#define SHMERRORPTR (pointer)(-1) static int counter = 0; @@ -61,15 +62,20 @@ xf86InitInt10(int entityIndex) int fd; static void* vidMem = NULL; static void* sysMem = NULL; + void *options = NULL; int low_mem; int high_mem; - char *base; - char *base_high; + char *base = SHMERRORPTR; + char *base_high = SHMERRORPTR; int pagesize, cs; legacyVGARec vga; - + xf86int10BiosLocation bios; + screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex; - if (int10skip(xf86Screens[screen], entityIndex)) + + options = xf86HandleInt10Options(xf86Screens[screen],entityIndex); + + if (int10skip(options)) return NULL; if ((!vidMem) || (!sysMem)) { @@ -139,8 +145,10 @@ xf86InitInt10(int entityIndex) ((linuxInt10Priv*)pInt->private)->lowMem = low_mem; base = shmat(low_mem, 0, 0); + if (base == SHMERRORPTR) goto error4; ((linuxInt10Priv *)pInt->private)->base = base; base_high = shmat(high_mem, 0, 0); + if (base_high == SHMERRORPTR) goto error4; ((linuxInt10Priv*)pInt->private)->base_high = base_high; MapCurrentInt10(pInt); @@ -164,52 +172,120 @@ xf86InitInt10(int entityIndex) if (xf86ReadBIOS(cs, 0, (pointer)cs, V_BIOS_SIZE) < V_BIOS_SIZE) xf86DrvMsg(screen, X_WARNING, "Unable to retrieve all of segment 0x%06X.\n", cs); - - if (xf86IsEntityPrimary(entityIndex) - && !(initPrimary(xf86Screens[screen],entityIndex))) { - cs = ((CARD16*)0)[(0x10<<1) + 1]; - bios_base = (unsigned char *)(cs << 4); + xf86int10ParseBiosLocation(options,&bios); - if (!int10_check_bios(screen, cs, bios_base)) { - cs = ((CARD16*)0)[(0x42 << 1) + 1]; + if (xf86IsEntityPrimary(entityIndex) + && !(initPrimary(options))) { + if (bios.bus == BUS_ISA && bios.location.legacy) { + xf86DrvMsg(screen, X_CONFIG, + "Overriding BIOS location: 0x%lx\n", + bios.location.legacy); + cs = bios.location.legacy >> 4; bios_base = (unsigned char *)(cs << 4); if (!int10_check_bios(screen, cs, bios_base)) { - cs = V_BIOS >> 4; + xf86DrvMsg(screen, X_ERROR, + "No V_BIOS at specified address 0x%x\n",cs << 4); + goto error3; + } + } else { + if (bios.bus == BUS_PCI) { + xf86DrvMsg(screen, X_WARNING, + "Option BiosLocation for primary device ignored: " + "It points to PCI.\n"); + xf86DrvMsg(screen, X_WARNING, + "You must set Option InitPrimary also\n"); + } + + cs = ((CARD16*)0)[(0x10<<1) + 1]; + + bios_base = (unsigned char *)(cs << 4); + + if (!int10_check_bios(screen, cs, bios_base)) { + cs = ((CARD16*)0)[(0x42 << 1) + 1]; bios_base = (unsigned char *)(cs << 4); if (!int10_check_bios(screen, cs, bios_base)) { - xf86DrvMsg(screen, X_ERROR, "No V_BIOS found\n"); - goto error3; + cs = V_BIOS >> 4; + bios_base = (unsigned char *)(cs << 4); + if (!int10_check_bios(screen, cs, bios_base)) { + xf86DrvMsg(screen, X_ERROR, "No V_BIOS found\n"); + goto error3; + } } } } + xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%x\n", cs); pInt->BIOSseg = cs; set_return_trap(pInt); } else { EntityInfoPtr pEnt = xf86GetEntityInfo(pInt->entityIndex); - switch (pEnt->location.type) { + BusType location_type; + + if (bios.bus != BUS_NONE) { + switch (location_type = bios.bus) { + case BUS_PCI: + xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: " + "PCI:%i:%i%i\n",bios.location.pci.bus, + bios.location.pci.dev,bios.location.pci.func); + break; + case BUS_ISA: + if (bios.location.legacy) + xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: " + "Legacy:0x%x\n",bios.location.legacy); + else + xf86DrvMsg(screen,X_CONFIG,"Overriding bios location: " + "Legacy\n"); + break; + default: + break; + } + } else + location_type = pEnt->location.type; + + switch (location_type) { case BUS_PCI: - if (!mapPciRom(pInt, (unsigned char *)(V_BIOS))) { + { + int pci_entity; + + if (bios.bus == BUS_PCI) + pci_entity = xf86GetPciEntity(bios.location.pci.bus, + bios.location.pci.dev, + bios.location.pci.func); + else + pci_entity = pInt->entityIndex; + + if (!mapPciRom(pci_entity, (unsigned char *)(V_BIOS))) { xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS\n"); goto error3; } pInt->BIOSseg = V_BIOS >> 4; break; + } case BUS_ISA: - cs = ((CARD16*)0)[(0x10<<1)+1]; - bios_base = (unsigned char *)(cs << 4); - - if (!int10_check_bios(screen, cs, bios_base)) { - cs = ((CARD16*)0)[(0x42<<1)+1]; + if (bios.bus == BUS_ISA && bios.location.legacy) { + cs = bios.location.legacy >> 4; bios_base = (unsigned char *)(cs << 4); if (!int10_check_bios(screen, cs, bios_base)) { - cs = V_BIOS >> 4; + xf86DrvMsg(screen,X_ERROR,"No V_BIOS found " + "on override address 0x%x\n",bios_base); + goto error3; + } + } else { + cs = ((CARD16*)0)[(0x10<<1)+1]; + bios_base = (unsigned char *)(cs << 4); + + if (!int10_check_bios(screen, cs, bios_base)) { + cs = ((CARD16*)0)[(0x42<<1)+1]; bios_base = (unsigned char *)(cs << 4); if (!int10_check_bios(screen, cs, bios_base)) { - xf86DrvMsg(screen,X_ERROR,"No V_BIOS found\n"); - goto error3; + cs = V_BIOS >> 4; + bios_base = (unsigned char *)(cs << 4); + if (!int10_check_bios(screen, cs, bios_base)) { + xf86DrvMsg(screen,X_ERROR,"No V_BIOS found\n"); + goto error3; + } } } } @@ -233,32 +309,45 @@ xf86InitInt10(int entityIndex) return pInt; - error3: +error4: + xf86DrvMsg(screen, X_ERROR, "shmat() call retruned errno %d\n", errno); +error3: shmdt(base_high); shmdt(base); shmdt(0); shmdt((char*)HIGH_MEM); shmctl(low_mem, IPC_RMID, NULL); Int10Current = NULL; - error2: +error2: shmctl(high_mem, IPC_RMID,NULL); - error1: +error1: xfree(((linuxInt10Priv*)pInt->private)->alloc); xfree(pInt->private); - error0: +error0: xfree(pInt); return NULL; } -void +Bool MapCurrentInt10(xf86Int10InfoPtr pInt) { + pointer addr; + if (Int10Current) { shmdt(0); shmdt((char*)HIGH_MEM); } - shmat(((linuxInt10Priv*)pInt->private)->lowMem, (char*)1, SHM_RND); - shmat(((linuxInt10Priv*)pInt->private)->highMem, (char*)HIGH_MEM, 0); + addr = shmat(((linuxInt10Priv*)pInt->private)->lowMem, (char*)1, SHM_RND); + if (addr == SHMERRORPTR) { + xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot shmat() low memory\n"); + return FALSE; + } + addr = shmat(((linuxInt10Priv*)pInt->private)->highMem, (char*)HIGH_MEM, 0); + if (addr == SHMERRORPTR) { + xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot shmat() high memory\n"); + return FALSE; + } + return TRUE; } void @@ -557,11 +646,9 @@ do_vm86(xf86Int10InfoPtr pInt) { int retval, signo; - xf86DisableIO(); /* So that all I/O can be trapped */ xf86InterceptSignals(&signo); retval = vm86_rep(VM86S); xf86InterceptSignals(NULL); - xf86EnableIO(); if (signo >= 0) { xf86DrvMsg(pInt->scrnIndex, X_ERROR, diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c index 3f22be0b7..b66bb0329 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c @@ -6,7 +6,7 @@ * Copyright © 2000 VA Linux Systems, Inc. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v 3.4 2000/08/28 18:12:56 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c,v 3.5 2001/05/19 00:26:45 dawes Exp $ */ #include "X.h" #include "xf86.h" @@ -34,15 +34,29 @@ static int gartFd = -1; static int acquiredScreen = -1; - +static Bool initDone = FALSE; /* - * Open /dev/agpgart. Keep it open until server exit. + * Close /dev/agpgart. This frees all associated memory allocated during + * this server generation. */ +Bool +xf86GARTCloseScreen(int screenNum) +{ + if(gartFd != -1) { + close(gartFd); + acquiredScreen = -1; + gartFd = -1; + initDone = FALSE; + } + return TRUE; +} +/* + * Open /dev/agpgart. Keep it open until xf86GARTCloseScreen is called. + */ static Bool GARTInit() { - static Bool initDone = FALSE; struct _agp_info agpinf; if (initDone) diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c index acbeaa187..2a4c958ef 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c,v 3.6 2001/04/03 17:05:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_pci.c,v 3.6.2.1 2001/06/01 20:03:52 dawes Exp $ */ #include <stdio.h> #include "X.h" @@ -9,6 +9,16 @@ #include "xf86_OSproc.h" #include "xf86Pci.h" +#ifdef __sparc__ +#define PCIADDR_TYPE long long +#define PCIADDR_IGNORE_FMT "%*llx" +#define PCIADDR_FMT "%llx" +#else +#define PCIADDR_TYPE long +#define PCIADDR_IGNORE_FMT "%*lx" +#define PCIADDR_FMT "%lx" +#endif + Bool xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits) { @@ -16,9 +26,9 @@ xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits) char c[0x200]; char *res; int bus, devfn, dev, fn; - unsigned int size[7]; + unsigned PCIADDR_TYPE size[7]; unsigned int num; - int Size; + signed PCIADDR_TYPE Size; if (index > 7) return FALSE; @@ -28,12 +38,28 @@ xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits) do { res = fgets(c,0x1ff,file); if (res) { - num = sscanf(res,"%02x%02x\t%*04x%*04x\t%*x" - "\t%*x\t%*x\t%*x\t%*x\t%*x\t%*x\t%*x" - "\t%x\t%x\t%x\t%x\t%x\t%x\t%x", + num = sscanf(res, + /*bus+dev vendorid deviceid irq */ + "%02x%02x\t%*04x%*04x\t%*x" + /* 7 PCI resource base addresses */ + "\t" PCIADDR_IGNORE_FMT + "\t" PCIADDR_IGNORE_FMT + "\t" PCIADDR_IGNORE_FMT + "\t" PCIADDR_IGNORE_FMT + "\t" PCIADDR_IGNORE_FMT + "\t" PCIADDR_IGNORE_FMT + "\t" PCIADDR_IGNORE_FMT + /* 7 PCI resource sizes, and then optionally a driver name */ + "\t" PCIADDR_FMT + "\t" PCIADDR_FMT + "\t" PCIADDR_FMT + "\t" PCIADDR_FMT + "\t" PCIADDR_FMT + "\t" PCIADDR_FMT + "\t" PCIADDR_FMT, &bus,&devfn,&size[0],&size[1],&size[2],&size[3], &size[4],&size[5],&size[6]); - if (num != 9) { /* apparently not 2.3 style */ + if (num != 9) { /* apparantly not 2.3 style */ fclose(file); return FALSE; } @@ -42,9 +68,9 @@ xf86GetPciSizeFromOS(PCITAG tag, int index, int* bits) if (tag == pciTag(bus,dev,fn)) { *bits = 0; if (size[index] != 0) { - Size = size[index] - 1; - while (Size & 0x01) { - Size = Size >> 1; + Size = size[index] - ((PCIADDR_TYPE) 1); + while (Size & ((PCIADDR_TYPE) 0x01)) { + Size = Size >> ((PCIADDR_TYPE) 1); (*bits)++; } } 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 6c8775c0e..8ed02faf5 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.50 2001/04/10 16:08:03 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c,v 3.51.2.3 2001/05/29 16:38:00 tsi Exp $ */ /* * Copyright 1992 by Orest Zborowski <obz@Kodak.com> * Copyright 1993 by David Wexelblat <dwex@goblin.org> @@ -248,11 +248,10 @@ mtrr_add_wc_region(int screenNum, unsigned long base, unsigned long size, * Splits up the write-combining region if it is not aligned on a * size boundary. */ - if (base % size) { struct mtrr_wc_region *wcrc = wcr; int rgs = 1; - int srem, sdiv, bcurr; + unsigned long srem, sdiv, bcurr; xf86DrvMsgVerb(screenNum, X_INFO, 2, "WC region has to be split (0x%lx,0x%lx)\n", base, size); @@ -261,9 +260,9 @@ mtrr_add_wc_region(int screenNum, unsigned long base, unsigned long size, srem = size; do { - for (sdiv = size; sdiv /= 2; sdiv) { + for (sdiv = (0x1 << 31); sdiv; sdiv = sdiv >> 1) { while(sdiv > srem) { - sdiv /= 2; + sdiv >>= 1; } if (!(bcurr % sdiv)) { mtrr_add_wc_region(screenNum, bcurr, @@ -398,7 +397,15 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) pVidMem->initialised = TRUE; } - +#ifdef __sparc__ +/* Basically, you simply cannot do this on Sparc. You have to do something portable + * like use /dev/fb* or mmap() on /proc/bus/pci/X/Y nodes. -DaveM + */ +static pointer mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) +{ + return NULL; +} +#else static pointer mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { @@ -453,6 +460,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) #endif return (char *)base + alignOff; } +#endif /* !(__sparc__) */ static void unmapVidMem(int ScreenNum, pointer Base, unsigned long Size) @@ -512,6 +520,10 @@ xf86EnableIO(void) #elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) if (ioperm(0, 1024, 1) || iopl(3)) FatalError("xf86EnableIOPorts: Failed to set IOPL for I/O\n"); +# if !defined(__alpha__) + ioperm(0x40,4,0); /* trap access to the timer chip */ + ioperm(0x60,4,0); /* trap access to the keyboard controller */ +# endif #endif ExtendedEnabled = TRUE; diff --git a/xc/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c b/xc/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c index 297ce45ea..5b738432a 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c,v 1.2 2000/07/13 21:31:40 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/os2/int10/os2.c,v 1.3 2001/04/30 14:34:58 tsi Exp $ */ /* * XFree86 int10 module * execute BIOS int 10h calls in x86 real mode environment @@ -210,10 +210,11 @@ UnmapVRam(xf86Int10InfoPtr pInt) xf86UnMapVidMem(screen,INTPriv(pInt)->vRam,size); } -void +Bool MapCurrentInt10(xf86Int10InfoPtr pInt) { - /* nothing to do here */ + /* nothing to do here */ + return TRUE; } void diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c index 4c5ec4b47..c1100e67b 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c @@ -3,7 +3,7 @@ * AGP GART support. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c,v 1.2 2000/08/25 01:19:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c,v 1.3 2001/05/19 00:26:46 dawes Exp $ */ #include "X.h" #include "xf86.h" @@ -12,6 +12,12 @@ #include "xf86OSpriv.h" Bool +xf86GARTCloseScreen(int screenNum) +{ + return FALSE; +} + +Bool xf86AgpGARTSupported() { return FALSE; diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c index e4ecfab59..d2e012045 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c,v 1.8 2000/11/19 16:38:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/bios_mmap.c,v 1.8.4.1 2001/05/23 14:47:45 alanh Exp $ */ /* * Copyright 1993 by David Wexelblat <dwex@goblin.org> * @@ -149,7 +149,8 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, return(-1); } - xf86SlowBCopyFromBus(base+JENSEN_SHIFT(Offset), Buf, Len); + xf86SlowBCopyFromBus((unsigned char *)(base+JENSEN_SHIFT(Offset)), + Buf, Len); munmap((caddr_t)JENSEN_SHIFT(base), JENSEN_SHIFT(mlen)); close(fd); diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h index 3def97f74..9f5610226 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/drm.h @@ -44,8 +44,27 @@ #define DRM_IOCTL_NR(n) ((n) & 0xff) #endif +#define XFREE86_VERSION(major,minor,patch,snap) \ + ((major << 16) | (minor < 8) | patch) + +#ifndef CONFIG_XFREE86_VERSION +#define CONFIG_XFREE86_VERSION XFREE86_VERSION(4,1,0,0) +#endif + +#if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0) +#define DRM_PROC_DEVICES "/proc/devices" +#define DRM_PROC_MISC "/proc/misc" +#define DRM_PROC_DRM "/proc/drm" +#define DRM_DEV_DRM "/dev/drm" +#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) +#define DRM_DEV_UID 0 +#define DRM_DEV_GID 0 +#endif + +#if CONFIG_XFREE86_VERSION >= XFREE86_VERSION(4,1,0,0) #define DRM_MAJOR 226 #define DRM_MAX_MINOR 15 +#endif #define DRM_NAME "drm" /* Name in kernel, /dev, and /proc */ #define DRM_MIN_ORDER 5 /* At least 2^5 bytes = 32 bytes */ #define DRM_MAX_ORDER 22 /* Up to 2^22 bytes = 4MB */ @@ -438,15 +457,15 @@ typedef struct drm_scatter_gather { #define DRM_IOCTL_R128_CCE_RESET DRM_IO( 0x43) #define DRM_IOCTL_R128_CCE_IDLE DRM_IO( 0x44) #define DRM_IOCTL_R128_RESET DRM_IO( 0x46) -#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( 0x47, drm_r128_fullscreen_t) -#define DRM_IOCTL_R128_SWAP DRM_IO( 0x48) -#define DRM_IOCTL_R128_CLEAR DRM_IOW( 0x49, drm_r128_clear_t) -#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x4a, drm_r128_vertex_t) -#define DRM_IOCTL_R128_INDICES DRM_IOW( 0x4b, drm_r128_indices_t) -#define DRM_IOCTL_R128_BLIT DRM_IOW( 0x4c, drm_r128_blit_t) -#define DRM_IOCTL_R128_DEPTH DRM_IOW( 0x4d, drm_r128_depth_t) -#define DRM_IOCTL_R128_STIPPLE DRM_IOW( 0x4e, drm_r128_stipple_t) +#define DRM_IOCTL_R128_SWAP DRM_IO( 0x47) +#define DRM_IOCTL_R128_CLEAR DRM_IOW( 0x48, drm_r128_clear_t) +#define DRM_IOCTL_R128_VERTEX DRM_IOW( 0x49, drm_r128_vertex_t) +#define DRM_IOCTL_R128_INDICES DRM_IOW( 0x4a, drm_r128_indices_t) +#define DRM_IOCTL_R128_BLIT DRM_IOW( 0x4b, drm_r128_blit_t) +#define DRM_IOCTL_R128_DEPTH DRM_IOW( 0x4c, drm_r128_depth_t) +#define DRM_IOCTL_R128_STIPPLE DRM_IOW( 0x4d, drm_r128_stipple_t) #define DRM_IOCTL_R128_INDIRECT DRM_IOWR(0x4f, drm_r128_indirect_t) +#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( 0x50, drm_r128_fullscreen_t) /* Radeon specific ioctls */ #define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( 0x40, drm_radeon_init_t) @@ -460,9 +479,9 @@ typedef struct drm_scatter_gather { #define DRM_IOCTL_RADEON_CLEAR DRM_IOW( 0x48, drm_radeon_clear_t) #define DRM_IOCTL_RADEON_VERTEX DRM_IOW( 0x49, drm_radeon_vertex_t) #define DRM_IOCTL_RADEON_INDICES DRM_IOW( 0x4a, drm_radeon_indices_t) -#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(0x4b, drm_radeon_texture_t) #define DRM_IOCTL_RADEON_STIPPLE DRM_IOW( 0x4c, drm_radeon_stipple_t) #define DRM_IOCTL_RADEON_INDIRECT DRM_IOWR(0x4d, drm_radeon_indirect_t) +#define DRM_IOCTL_RADEON_TEXTURE DRM_IOWR(0x4e, drm_radeon_texture_t) #ifdef CONFIG_DRM_SIS /* SiS specific ioctls */ 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 d11205b92..9ba4edf24 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.72 2001/02/12 01:34:53 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c,v 1.75 2001/05/18 20:22:30 tsi Exp $ */ /* * Copyright 1997 by The XFree86 Project, Inc. * @@ -859,12 +859,51 @@ xf86ftell(XF86FILE* f) return ftell(fp->filehnd); } +#define mapnum(e) case (xf86_##e): err = e; break; + char* xf86strerror(int n) { - return strerror(n); + int err; + + switch (n) + { + case 0: err = 0; break; + mapnum (EACCES); + mapnum (EAGAIN); + mapnum (EBADF); + mapnum (EEXIST); + mapnum (EFAULT); + mapnum (EINTR); + mapnum (EINVAL); + mapnum (EISDIR); + mapnum (ELOOP); /* not POSIX 1 */ + mapnum (EMFILE); + mapnum (ENAMETOOLONG); + mapnum (ENFILE); + mapnum (ENOENT); + mapnum (ENOMEM); + mapnum (ENOSPC); + mapnum (ENOTDIR); + mapnum (EPIPE); + mapnum (EROFS); +#ifndef __EMX__ + mapnum (ETXTBSY); /* not POSIX 1 */ +#endif + mapnum (ENOTTY); + mapnum (EBUSY); + mapnum (ENODEV); + mapnum (EIO); + + default: + err = 999; + } + return strerror(err); } +#undef mapnum + + /* required for portable fgetpos/fsetpos, * use as * XF86fpos_t* pos = xalloc(xf86fpossize()); @@ -1847,7 +1886,7 @@ xf86shmdt(char *addr) * for now only implement the rmid command. */ int -xf86shmctl(int id, int xf86cmd, pointer *buf) +xf86shmctl(int id, int xf86cmd, pointer buf) { int cmd; @@ -1859,7 +1898,7 @@ xf86shmctl(int id, int xf86cmd, pointer *buf) return 0; } - return shmctl(id, cmd, NULL); + return shmctl(id, cmd, buf); } #else @@ -1877,7 +1916,7 @@ xf86shmat(int id, char *addr, int xf86shmflg) } int -xf86shmctl(int id, int xf86cmd, pointer *buf) +xf86shmctl(int id, int xf86cmd, pointer buf) { return -1; } diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c index 69c485202..fb3b824be 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c +++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c,v 1.13 2000/10/28 01:42:28 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/vidmem.c,v 1.14 2001/05/04 19:05:51 dawes Exp $ */ /* * Copyright 1993-1999 by The XFree86 Project, Inc * @@ -112,25 +112,25 @@ removeMapping(VidMapPtr vp, MappingPtr mp) } enum { OPTION_MTRR }; -static OptionInfoRec opts[] = +static const OptionInfoRec opts[] = { { OPTION_MTRR, "mtrr", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; -#define nopts (sizeof(opts) / sizeof(opts[0])) - static void checkMtrrOption(VidMapPtr vp) { if (!vp->mtrrOptChecked && vp->pScrn && vp->pScrn->options != NULL) { - OptionInfoRec options[nopts]; + OptionInfoPtr options; + options = xnfalloc(sizeof(opts)); (void)memcpy(options, opts, sizeof(opts)); xf86ProcessOptions(vp->pScrn->scrnIndex, vp->pScrn->options, options); if (xf86GetOptValBool(options, OPTION_MTRR, &vp->mtrrEnabled)) vp->mtrrFrom = X_CONFIG; + xfree(options); vp->mtrrOptChecked = TRUE; } } 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 82eb25106..57f994856 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.15 2001/02/15 20:00:08 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/vbe/vbe.c,v 1.16 2001/05/04 19:05:51 dawes Exp $ */ /* * XFree86 vbe module @@ -215,13 +215,11 @@ typedef enum { VBEOPT_NOVBE } VBEOpts; -static OptionInfoRec VBEOptions[] = { +static const OptionInfoRec VBEOptions[] = { { VBEOPT_NOVBE, "NoVBE", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE }, }; -#define nVBEOptions (sizeof(VBEOptions) / sizeof(VBEOptions[0])) - static unsigned char * vbeReadEDID(vbeInfoPtr pVbe) { @@ -230,13 +228,15 @@ vbeReadEDID(vbeInfoPtr pVbe) unsigned char *tmp = NULL; Bool novbe = FALSE; int screen = pVbe->pInt10->scrnIndex; - OptionInfoRec options[nVBEOptions]; + OptionInfoPtr options; if (!page) return NULL; + options = xnfalloc(sizeof(VBEOptions)); (void)memcpy(options, VBEOptions, sizeof(VBEOptions)); xf86ProcessOptions(screen, xf86Screens[screen]->options, options); xf86GetOptValBool(options, VBEOPT_NOVBE, &novbe); + xfree(options); if (novbe) return NULL; if (!vbeProbeDDC(pVbe)) goto error; diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h index f4c78d3bd..eb38e5ad6 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h,v 3.80 2001/04/20 16:54:05 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSlib.h,v 3.81.2.1 2001/05/29 16:38:00 tsi Exp $ */ /* * Copyright 1990, 1991 by Thomas Roell, Dinkelscherben, Germany * Copyright 1992 by David Dawes <dawes@XFree86.org> @@ -108,7 +108,10 @@ extern int vsnprintf(char *str, size_t size, const char *format, va_list ap); /**************************************************************************/ /* SYSV386 (SVR3, SVR4) - But not Solaris8 */ /**************************************************************************/ -#if (defined(SYSV) || defined(SVR4)) && !defined(DGUX) && !defined(__SOL8__) +#if (defined(SYSV) || defined(SVR4)) && \ + !defined(DGUX) && \ + !defined(__SOL8__) && \ + (!defined(sun) || defined(i386)) # ifdef SCO325 # ifndef _SVID3 # define _SVID3 @@ -252,7 +255,7 @@ extern int vsnprintf(char *str, size_t size, const char *format, va_list ap); * Good ol' Solaris8, and its lack of VT support ***********/ -#ifdef __SOL8__ +#if defined(__SOL8__) || (defined(sun) && !defined(i386)) # include <sys/mman.h> # include <errno.h> # ifdef i386 @@ -374,10 +377,6 @@ extern int errno; # define POSIX_TTY -# ifdef __sparc__ -# define DEV_MEM "/dev/fb" -# endif - #endif /* linux */ /**************************************************************************/ 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 99d5aeda6..ebc19bf54 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.51 2001/04/16 15:02:13 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h,v 3.52 2001/05/19 00:26:45 dawes Exp $ */ #ifndef _XF86_OSPROC_H #define _XF86_OSPROC_H @@ -193,6 +193,7 @@ extern int xf86AllocateGARTMemory(int screenNum, unsigned long size, int type, extern Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset); extern Bool xf86UnbindGARTMemory(int screenNum, int key); extern Bool xf86EnableAGP(int screenNum, CARD32 mode); +extern Bool xf86GARTCloseScreen(int screenNum); /* These routines are in shared/sigio.c and are not loaded as part of the module. These routines are small, and the code if very POSIX-signal (or 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 03138c8d5..1756eacff 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.46 2001/04/10 16:08:03 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_ansic.h,v 3.47 2001/05/18 20:22:30 tsi Exp $ */ #ifndef _XF86_ANSIC_H #define _XF86_ANSIC_H @@ -303,7 +303,7 @@ unsigned int xf86sleep(unsigned int seconds); extern int xf86shmget(xf86key_t key, int size, int xf86shmflg); extern char * xf86shmat(int id, char *addr, int xf86shmflg); extern int xf86shmdt(char *addr); -extern int xf86shmctl(int id, int xf86cmd, pointer *buf); +extern int xf86shmctl(int id, int xf86cmd, pointer buf); extern int xf86setjmp(xf86jmp_buf env); extern void xf86longjmp(xf86jmp_buf env, int val); diff --git a/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h b/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h index 93764058a..6f726250a 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h @@ -26,7 +26,7 @@ * * Author: Rickard E. (Rik) Faith <faith@valinux.com> * - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h,v 1.14 2001/04/10 16:08:03 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h,v 1.14.2.1 2001/06/01 02:24:18 dawes Exp $ * */ @@ -341,7 +341,7 @@ do { register unsigned int __old __asm("o0"); \ #define DRM_CAS(lock,old,new,ret) do { ret=1; } while (0) /* FAST LOCK FAILS */ #endif -#ifdef __alpha__ +#if defined(__alpha__) || defined(__powerpc__) #define DRM_CAS_RESULT(_result) int _result #else #define DRM_CAS_RESULT(_result) char _result diff --git a/xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES b/xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES index 95749aafd..c1988c7f0 100644 --- a/xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES +++ b/xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES @@ -100,6 +100,22 @@ Flags they should be the pixel values from the current colormap. + /* Cursor data loading flags */ + + HARDWARE_CURSOR_SHOW_TRANSPARENT + + The HideCursor entry will normally be called instead of displaying a + completely transparent cursor. This flag prevents this behaviour, thus + causing the LoadCursorImage entry to be called with the transparent cursor + data. + + HARDWARE_CURSOR_UPDATE_UNHIDDEN + + This flag prevents the HideCursor call that would normally occur just before + the LoadCursorImage entry is to be called to load a new hardware cursor + image. + + /* Cursor data packing flags */ Hardware cursor data consists of two pieces, a source and a mask. @@ -169,4 +185,4 @@ Flags -$XFree86: xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES,v 1.3 1999/01/31 12:22:05 dawes Exp $ +$XFree86: xc/programs/Xserver/hw/xfree86/ramdac/CURSOR.NOTES,v 1.4 2001/05/09 03:12:06 tsi Exp $ diff --git a/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c b/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c index 31418fbdc..a9e7f3a09 100644 --- a/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c +++ b/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c @@ -1,20 +1,10 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c,v 1.8 2001/04/19 14:14:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.c,v 1.9 2001/05/18 20:22:31 tsi Exp $ */ -#include "misc.h" #include "xf86.h" #include "xf86_ansic.h" -#include "xf86_OSproc.h" -#include "xf86str.h" - -#include "X.h" -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "xf86str.h" -#include "cursorstr.h" +#include "xf86CursorPriv.h" #include "colormapst.h" -#include "mi.h" -#include "xf86Cursor.h" +#include "cursorstr.h" int xf86CursorScreenIndex = -1; static unsigned long xf86CursorGeneration = 0; @@ -211,9 +201,11 @@ xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags) ret = (*ScreenPriv->SwitchMode)(index, mode, flags); - if (ScreenPriv->CurrentCursor) - xf86CursorSetCursor(pScreen, ScreenPriv->CurrentCursor, - ScreenPriv->x, ScreenPriv->y); + /* + * Cannot restore cursor here because the new frame[XY][01] haven't been + * calculated yet. + */ + ScreenPriv->CursorToRestore = ScreenPriv->CurrentCursor; return ret; } @@ -313,6 +305,7 @@ xf86CursorSetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y) ScreenPriv->CurrentCursor = pCurs; ScreenPriv->x = x; ScreenPriv->y = y; + ScreenPriv->CursorToRestore = NULL; if (pCurs == NullCursor) { /* means we're supposed to remove the cursor */ if (ScreenPriv->SWCursor) @@ -367,7 +360,10 @@ xf86CursorMoveCursor(ScreenPtr pScreen, int x, int y) ScreenPriv->x = x; ScreenPriv->y = y; - if (ScreenPriv->SWCursor) + if (ScreenPriv->CursorToRestore) + xf86CursorSetCursor(pScreen, ScreenPriv->CursorToRestore, + ScreenPriv->x, ScreenPriv->y); + else if (ScreenPriv->SWCursor) (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y); else if (ScreenPriv->isUp) xf86MoveCursor(pScreen, x, y); diff --git a/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h b/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h index 17cb98e73..ab7d16209 100644 --- a/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h +++ b/xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h @@ -1,10 +1,10 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h,v 1.6 2001/04/19 14:14:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86Cursor.h,v 1.7 2001/05/18 20:22:31 tsi Exp $ */ #ifndef _XF86CURSOR_H #define _XF86CURSOR_H #include "xf86str.h" -#include "mipointrst.h" +#include "mipointer.h" typedef struct _xf86CursorInfoRec { ScrnInfoPtr pScrn; @@ -21,29 +21,6 @@ typedef struct _xf86CursorInfoRec { } xf86CursorInfoRec, *xf86CursorInfoPtr; -typedef struct { - Bool SWCursor; - Bool isUp; - Bool showTransparent; - short HotX; - short HotY; - short x; - short y; - CursorPtr CurrentCursor; - xf86CursorInfoPtr CursorInfoPtr; - CloseScreenProcPtr CloseScreen; - RecolorCursorProcPtr RecolorCursor; - InstallColormapProcPtr InstallColormap; - QueryBestSizeProcPtr QueryBestSize; - miPointerSpriteFuncPtr spriteFuncs; - Bool PalettedCursor; - ColormapPtr pInstalledMap; - Bool (*SwitchMode)(int, DisplayModePtr,int); - Bool (*EnterVT)(int, int); - void (*LeaveVT)(int, int); - int (*SetDGAMode)(int, int, DGADevicePtr); -} xf86CursorScreenRec, *xf86CursorScreenPtr; - Bool xf86InitCursor( ScreenPtr pScreen, xf86CursorInfoPtr infoPtr diff --git a/xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h b/xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h index 8a4ee8b01..c2d7b272c 100644 --- a/xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h +++ b/xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h @@ -1,8 +1,34 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h,v 1.1 1998/08/29 14:34:41 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86CursorPriv.h,v 1.2 2001/05/18 20:22:31 tsi Exp $ */ #ifndef _XF86CURSORPRIV_H #define _XF86CURSORPRIV_H +#include "xf86Cursor.h" +#include "mipointrst.h" + +typedef struct { + Bool SWCursor; + Bool isUp; + Bool showTransparent; + short HotX; + short HotY; + short x; + short y; + CursorPtr CurrentCursor, CursorToRestore; + xf86CursorInfoPtr CursorInfoPtr; + CloseScreenProcPtr CloseScreen; + RecolorCursorProcPtr RecolorCursor; + InstallColormapProcPtr InstallColormap; + QueryBestSizeProcPtr QueryBestSize; + miPointerSpriteFuncPtr spriteFuncs; + Bool PalettedCursor; + ColormapPtr pInstalledMap; + Bool (*SwitchMode)(int, DisplayModePtr,int); + Bool (*EnterVT)(int, int); + void (*LeaveVT)(int, int); + int (*SetDGAMode)(int, int, DGADevicePtr); +} xf86CursorScreenRec, *xf86CursorScreenPtr; + CARD32 xf86ReverseBitOrder(CARD32 data); #endif /* _XF86CURSORPRIV_H */ diff --git a/xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c b/xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c index 288fe7183..c689ebc0c 100644 --- a/xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c +++ b/xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c,v 1.7 2001/04/19 14:14:06 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/ramdac/xf86HWCurs.c,v 1.10 2001/05/18 20:22:31 tsi Exp $ */ #include "misc.h" #include "xf86.h" @@ -13,7 +13,6 @@ #include "cursorstr.h" #include "mi.h" #include "mipointer.h" -#include "xf86Cursor.h" #include "xf86CursorPriv.h" #include "servermd.h" @@ -229,22 +228,23 @@ RealizeCursorInterleave0(xf86CursorInfoPtr infoPtr, CursorPtr pCurs) tmp = DstS; DstS = DstM; DstM = tmp; } - for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM; - y--; - pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) { - for(x = 0; x < Pitch; x++) { - pSrc[x] = SrcS[x]; - pMsk[x] = SrcM[x]; - } - } - if (infoPtr->Flags & HARDWARE_CURSOR_AND_SOURCE_WITH_MASK) { - int count = words; - SCANLINE* pntr = DstS; - SCANLINE* pntr2 = DstM; - while (count--) { - *pntr &= *pntr2; - pntr++; pntr2++; + for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM; + y--; + pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) { + for(x = 0; x < Pitch; x++) { + pSrc[x] = SrcS[x] & SrcM[x]; + pMsk[x] = SrcM[x]; + } + } + } else { + for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM; + y--; + pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) { + for(x = 0; x < Pitch; x++) { + pSrc[x] = SrcS[x]; + pMsk[x] = SrcM[x]; + } } } diff --git a/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c b/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c index 3343459af..9e44494c1 100644 --- a/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c +++ b/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c,v 1.46 2001/02/15 18:31:22 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.c,v 1.50 2001/05/10 22:18:57 dbateman Exp $ */ /* * @@ -155,67 +155,67 @@ static CARD8 defaultDAC[768] = static void stdWriteCrtc(vgaHWPtr hwp, CARD8 index, CARD8 value) { - outb(hwp->IOBase + VGA_CRTC_INDEX_OFFSET, index); - outb(hwp->IOBase + VGA_CRTC_DATA_OFFSET, value); + outb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_INDEX_OFFSET, index); + outb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_DATA_OFFSET, value); } static CARD8 stdReadCrtc(vgaHWPtr hwp, CARD8 index) { - outb(hwp->IOBase + VGA_CRTC_INDEX_OFFSET, index); - return inb(hwp->IOBase + VGA_CRTC_DATA_OFFSET); + outb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_INDEX_OFFSET, index); + return inb(hwp->IOBase + hwp->PIOOffset + VGA_CRTC_DATA_OFFSET); } static void stdWriteGr(vgaHWPtr hwp, CARD8 index, CARD8 value) { - outb(VGA_GRAPH_INDEX, index); - outb(VGA_GRAPH_DATA, value); + outb(hwp->PIOOffset + VGA_GRAPH_INDEX, index); + outb(hwp->PIOOffset + VGA_GRAPH_DATA, value); } static CARD8 stdReadGr(vgaHWPtr hwp, CARD8 index) { - outb(VGA_GRAPH_INDEX, index); - return inb(VGA_GRAPH_DATA); + outb(hwp->PIOOffset + VGA_GRAPH_INDEX, index); + return inb(hwp->PIOOffset + VGA_GRAPH_DATA); } static void stdWriteSeq(vgaHWPtr hwp, CARD8 index, CARD8 value) { - outb(VGA_SEQ_INDEX, index); - outb(VGA_SEQ_DATA, value); + outb(hwp->PIOOffset + VGA_SEQ_INDEX, index); + outb(hwp->PIOOffset + VGA_SEQ_DATA, value); } static CARD8 stdReadSeq(vgaHWPtr hwp, CARD8 index) { - outb(VGA_SEQ_INDEX, index); - return inb(VGA_SEQ_DATA); + outb(hwp->PIOOffset + VGA_SEQ_INDEX, index); + return inb(hwp->PIOOffset + VGA_SEQ_DATA); } static CARD8 stdReadST00(vgaHWPtr hwp) { - return inb(VGA_IN_STAT_0); + return inb(hwp->PIOOffset + VGA_IN_STAT_0); } static CARD8 stdReadST01(vgaHWPtr hwp) { - return inb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); + return inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET); } static CARD8 stdReadFCR(vgaHWPtr hwp) { - return inb(VGA_FEATURE_R); + return inb(hwp->PIOOffset + VGA_FEATURE_R); } static void stdWriteFCR(vgaHWPtr hwp, CARD8 value) { - outb(hwp->IOBase + VGA_FEATURE_W_OFFSET,value); + outb(hwp->IOBase + hwp->PIOOffset + VGA_FEATURE_W_OFFSET,value); } static void @@ -228,9 +228,9 @@ stdWriteAttr(vgaHWPtr hwp, CARD8 index, CARD8 value) else index |= 0x20; - tmp = inb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); - outb(VGA_ATTR_INDEX, index); - outb(VGA_ATTR_DATA_W, value); + tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET); + outb(hwp->PIOOffset + VGA_ATTR_INDEX, index); + outb(hwp->PIOOffset + VGA_ATTR_DATA_W, value); } static CARD8 @@ -243,21 +243,21 @@ stdReadAttr(vgaHWPtr hwp, CARD8 index) else index |= 0x20; - tmp = inb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); - outb(VGA_ATTR_INDEX, index); - return inb(VGA_ATTR_DATA_R); + tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET); + outb(hwp->PIOOffset + VGA_ATTR_INDEX, index); + return inb(hwp->PIOOffset + VGA_ATTR_DATA_R); } static void stdWriteMiscOut(vgaHWPtr hwp, CARD8 value) { - outb(VGA_MISC_OUT_W, value); + outb(hwp->PIOOffset + VGA_MISC_OUT_W, value); } static CARD8 stdReadMiscOut(vgaHWPtr hwp) { - return inb(VGA_MISC_OUT_R); + return inb(hwp->PIOOffset + VGA_MISC_OUT_R); } static void @@ -265,8 +265,8 @@ stdEnablePalette(vgaHWPtr hwp) { CARD8 tmp; - tmp = inb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); - outb(VGA_ATTR_INDEX, 0x00); + tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET); + outb(hwp->PIOOffset + VGA_ATTR_INDEX, 0x00); hwp->paletteEnabled = TRUE; } @@ -275,45 +275,57 @@ stdDisablePalette(vgaHWPtr hwp) { CARD8 tmp; - tmp = inb(hwp->IOBase + VGA_IN_STAT_1_OFFSET); - outb(VGA_ATTR_INDEX, 0x20); + tmp = inb(hwp->IOBase + hwp->PIOOffset + VGA_IN_STAT_1_OFFSET); + outb(hwp->PIOOffset + VGA_ATTR_INDEX, 0x20); hwp->paletteEnabled = FALSE; } static void stdWriteDacMask(vgaHWPtr hwp, CARD8 value) { - outb(VGA_DAC_MASK, value); + outb(hwp->PIOOffset + VGA_DAC_MASK, value); } static CARD8 stdReadDacMask(vgaHWPtr hwp) { - return inb(VGA_DAC_MASK); + return inb(hwp->PIOOffset + VGA_DAC_MASK); } static void stdWriteDacReadAddr(vgaHWPtr hwp, CARD8 value) { - outb(VGA_DAC_READ_ADDR, value); + outb(hwp->PIOOffset + VGA_DAC_READ_ADDR, value); } static void stdWriteDacWriteAddr(vgaHWPtr hwp, CARD8 value) { - outb(VGA_DAC_WRITE_ADDR, value); + outb(hwp->PIOOffset + VGA_DAC_WRITE_ADDR, value); } static void stdWriteDacData(vgaHWPtr hwp, CARD8 value) { - outb(VGA_DAC_DATA, value); + outb(hwp->PIOOffset + VGA_DAC_DATA, value); } static CARD8 stdReadDacData(vgaHWPtr hwp) { - return inb(VGA_DAC_DATA); + return inb(hwp->PIOOffset + VGA_DAC_DATA); +} + +static CARD8 +stdReadEnable(vgaHWPtr hwp) +{ + return inb(hwp->PIOOffset + VGA_ENABLE); +} + +static void +stdWriteEnable(vgaHWPtr hwp, CARD8 value) +{ + outb(hwp->PIOOffset + VGA_ENABLE, value); } void @@ -341,6 +353,9 @@ vgaHWSetStdFuncs(vgaHWPtr hwp) hwp->writeDacReadAddr = stdWriteDacReadAddr; hwp->writeDacData = stdWriteDacData; hwp->readDacData = stdReadDacData; + hwp->PIOOffset = 0; + hwp->readEnable = stdReadEnable; + hwp->writeEnable = stdWriteEnable; } /* @@ -516,6 +531,18 @@ mmioReadDacData(vgaHWPtr hwp) return minb(VGA_DAC_DATA); } +static CARD8 +mmioReadEnable(vgaHWPtr hwp) +{ + return minb(VGA_ENABLE); +} + +static void +mmioWriteEnable(vgaHWPtr hwp, CARD8 value) +{ + moutb(VGA_ENABLE, value); +} + void vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset) { @@ -543,6 +570,8 @@ vgaHWSetMmioFuncs(vgaHWPtr hwp, CARD8 *base, int offset) hwp->readDacData = mmioReadDacData; hwp->MMIOBase = base; hwp->MMIOOffset = offset; + hwp->readEnable = mmioReadEnable; + hwp->writeEnable = mmioWriteEnable; } /* @@ -1391,7 +1420,7 @@ CARD32 vgaHWHBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits, unsigned int Flags) { - int nExtBits = (nBits > 6) ? 0 : nBits - 6; + int nExtBits = (nBits < 6) ? 0 : nBits - 6; CARD32 ExtBits; CARD32 ExtBitMask = ((1 << nExtBits) - 1) << 6; @@ -1431,7 +1460,7 @@ vgaHWVBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits, unsigned int Flags) { CARD32 ExtBits; - CARD32 nExtBits = (nBits > 8) ? 0 : (nBits - 8); + CARD32 nExtBits = (nBits < 8) ? 0 : (nBits - 8); CARD32 ExtBitMask = ((1 << nExtBits) - 1) << 8; /* If width is not known nBits should be 0. In this * case BitMask is set to 0 so we can check for it. */ @@ -1515,7 +1544,7 @@ vgaHWAllocRegs(vgaRegPtr regp) } -static Bool +Bool vgaHWAllocDefaultRegs(vgaRegPtr regp) { regp->numCRTC = VGA_NUM_CRTC; @@ -1807,6 +1836,20 @@ vgaHWUnlock(vgaHWPtr hwp) } +void +vgaHWEnable(vgaHWPtr hwp) +{ + hwp->writeEnable(hwp, hwp->readEnable(hwp) | 0x01); +} + + +void +vgaHWDisable(vgaHWPtr hwp) +{ + hwp->writeEnable(hwp, hwp->readEnable(hwp) & ~0x01); +} + + static void vgaHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, VisualPtr pVisual) diff --git a/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h b/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h index c633ce1f9..2d0cc63a4 100644 --- a/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h +++ b/xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h,v 1.26 2001/02/15 18:31:23 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/vgahw/vgaHW.h,v 1.28 2001/05/10 22:18:58 dbateman Exp $ */ /* @@ -152,6 +152,10 @@ typedef struct _vgaHWRec { vgaHWWriteProcPtr writeDacData; vgaHWReadProcPtr readDacData; pointer ddc; + int PIOOffset; /* offset + vgareg + = pioreg */ + vgaHWReadProcPtr readEnable; + vgaHWWriteProcPtr writeEnable; } vgaHWRec; /* Some macros that VGA drivers can use in their ChipProbe() function */ @@ -219,6 +223,8 @@ void vgaHWUnmapMem(ScrnInfoPtr scrp); void vgaHWGetIOBase(vgaHWPtr hwp); void vgaHWLock(vgaHWPtr hwp); void vgaHWUnlock(vgaHWPtr hwp); +void vgaHWEnable(vgaHWPtr hwp); +void vgaHWDisable(vgaHWPtr hwp); void vgaHWDPMSSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags); Bool vgaHWHandleColormaps(ScreenPtr pScreen); void vgaHWddc1SetSpeed(ScrnInfoPtr pScrn, xf86ddcSpeed speed); @@ -226,4 +232,5 @@ CARD32 vgaHWHBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits, unsigned int Flags); CARD32 vgaHWVBlankKGA(DisplayModePtr mode, vgaRegPtr regp, int nBits, unsigned int Flags); +Bool vgaHWAllocDefaultRegs(vgaRegPtr regp); #endif /* _VGAHW_H */ diff --git a/xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c b/xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c index 2904a7548..327599a30 100644 --- a/xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c +++ b/xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c @@ -1,14 +1,6 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c,v 1.6 2000/06/13 02:51:24 mvojkovi Exp $ */ - -#include "xf86.h" -#include "xf86_ansic.h" -#ifndef RAMDAC_MODULE -#include "xaa.h" -#include "xaalocal.h" -#else -#include "xf86CursorPriv.h" -#endif +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaBitOrder.c,v 1.7 2001/05/18 20:22:31 tsi Exp $ */ +#include "Xmd.h" CARD32 XAAReverseBitOrder(CARD32 v) diff --git a/xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c b/xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c index 0133e4203..89d735f1d 100644 --- a/xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c +++ b/xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c,v 1.32 2000/11/16 19:45:05 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaInit.c,v 1.33 2001/05/15 18:22:23 paulo Exp $ */ #include "misc.h" #include "xf86.h" @@ -48,29 +48,6 @@ static unsigned long XAAGeneration = 0; /* temp kludge */ static Bool SwitchedOut = FALSE; - -#ifdef XFree86LOADER - -static XF86ModuleVersionInfo xaaVersRec = -{ - "xaa", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XF86_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_VIDEODRV, /* requires the video driver ABI */ - ABI_VIDEODRV_VERSION, - MOD_CLASS_NONE, - {0,0,0,0} -}; - - -XF86ModuleData xaaModuleData = { &xaaVersRec, NULL, NULL }; - -#endif - - XAAInfoRecPtr XAACreateInfoRec() { diff --git a/xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c b/xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c index b0e5df048..13dd20e44 100644 --- a/xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c +++ b/xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c,v 1.29 2001/02/04 03:19:28 mvojkovi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xaa/xaaInitAccel.c,v 1.31 2001/05/15 18:22:23 paulo Exp $ */ #include "misc.h" #include "xf86.h" @@ -13,6 +13,7 @@ #include "xf86fbman.h" #include "servermd.h" +static const OptionInfoRec *XAAAvailableOptions(void *unused); /* * XAA Config options @@ -42,7 +43,7 @@ typedef enum { XAAOPT_OFFSCREEN_PIXMAPS } XAAOpts; -static OptionInfoRec XAAOptions[] = { +static const OptionInfoRec XAAOptions[] = { {XAAOPT_SCREEN_TO_SCREEN_COPY, "XaaNoScreenToScreenCopy", OPTV_BOOLEAN, {0}, FALSE }, {XAAOPT_SOLID_FILL_RECT, "XaaNoSolidFillRect", @@ -89,7 +90,57 @@ static OptionInfoRec XAAOptions[] = { OPTV_NONE, {0}, FALSE } }; -#define nXAAOptions (sizeof(XAAOptions) / sizeof(XAAOptions[0])) +#ifdef XFree86LOADER +static MODULESETUPPROTO(xaaSetup); + +static XF86ModuleVersionInfo xaaVersRec = +{ + "xaa", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + 1, 0, 0, + ABI_CLASS_VIDEODRV, /* requires the video driver ABI */ + ABI_VIDEODRV_VERSION, + MOD_CLASS_NONE, + {0,0,0,0} +}; + +XF86ModuleData xaaModuleData = { &xaaVersRec, xaaSetup, NULL }; + +ModuleInfoRec XAA = { + 1, + "XAA", + NULL, + 0, + XAAAvailableOptions, +}; + +/*ARGSUSED*/ +static pointer +xaaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor) +{ + static Bool Initialised = FALSE; + + if (!Initialised) { + Initialised = TRUE; +#ifndef REMOVE_LOADER_CHECK_MODULE_INFO + if (xf86LoaderCheckSymbol("xf86AddModuleInfo")) +#endif + xf86AddModuleInfo(&XAA, Module); + } + + return (pointer)TRUE; +} +#endif + +/*ARGSUSED*/ +static const OptionInfoRec * +XAAAvailableOptions(void *unused) +{ + return (XAAOptions); +} Bool XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec) @@ -113,10 +164,11 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec) Bool HaveImageWriteRect = FALSE; Bool HaveScanlineImageWriteRect = FALSE; Bool HaveScreenToScreenColorExpandFill = FALSE; - OptionInfoRec options[nXAAOptions]; + OptionInfoPtr options; int is_shared = 0; int i; + options = xnfalloc(sizeof(XAAOptions)); (void)memcpy(options, XAAOptions, sizeof(XAAOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); @@ -1431,6 +1483,8 @@ XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec) infoRec->CachePixelGranularity *= 2; } + xfree(options); + if(!infoRec->CacheTile && infoRec->WritePixmapToCache) infoRec->CacheTile = XAACacheTile; if(!infoRec->CacheMonoStipple && infoRec->WritePixmapToCache) diff --git a/xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c b/xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c index 25efff45f..c5b54be13 100644 --- a/xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c +++ b/xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c,v 1.5 2001/03/08 17:12:16 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf4bpp/mfbimggblt.c,v 1.6 2001/05/15 10:19:43 eich Exp $ */ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */ /*********************************************************** @@ -310,7 +310,6 @@ doImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase,infop) if ((xoff + w) <= 32) { - int i; /* glyph all in one longword */ maskpartialbits(xoff, w, startmask); diff --git a/xc/programs/Xserver/hw/xfree86/xf86Version.h b/xc/programs/Xserver/hw/xfree86/xf86Version.h index 03a02c070..502ed3eb8 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86Version.h +++ b/xc/programs/Xserver/hw/xfree86/xf86Version.h @@ -1,11 +1,11 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.470 2001/04/26 16:23:12 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.472.2.5 2001/06/02 15:27:52 dawes Exp $ */ #ifndef XF86_VERSION_CURRENT #define XF86_VERSION_MAJOR 4 -#define XF86_VERSION_MINOR 0 -#define XF86_VERSION_PATCH 99 -#define XF86_VERSION_SNAP 3 +#define XF86_VERSION_MINOR 1 +#define XF86_VERSION_PATCH 0 +#define XF86_VERSION_SNAP 0 /* This has five arguments for compatibilty reasons */ #define XF86_VERSION_NUMERIC(major,minor,patch,snap,dummy) \ @@ -24,7 +24,7 @@ 0) -#define XF86_DATE "26 April 2001" +#define XF86_DATE "2 June 2001" #endif diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad b/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad index 0a2ba49b6..871d7c227 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad @@ -26,7 +26,7 @@ !! !! Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> !! -!! $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad,v 1.12 2001/03/29 16:54:30 paulo Exp $ +!! $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/XF86Cfg.ad,v 1.13 2001/05/15 18:22:23 paulo Exp $ !! *Form.background: gray85 @@ -475,6 +475,8 @@ XF86Cfg.translations: #override \ <Message>WM_PROTOCOLS: testmode-cancel() .xf86cfg.Expert.translations: #override \ <Message>WM_PROTOCOLS: expert-close() +.xf86cfg.options.moduleOptions.translations: #override \ +<Message>WM_PROTOCOLS: module-options-close() !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -488,6 +490,7 @@ XF86Cfg.translations: #override \ *options*commands.remove.fromHoriz: add *options*commands.update.fromHoriz: remove +*options*commands.help.fromHoriz: update *options*commands.min: 30 *options*commands.max: 30 *options*commands.showGrip: False @@ -501,18 +504,18 @@ XF86Cfg.translations: #override \ *options*label3.fromHoriz: value *options*viewport.fromVert: name *options*Label.borderWidth: 0 -*options*Label.internalWidth: 0 -*options*Label.height: 21 -*options*Text.height: 19 -*options*Label.top: chainTop -*options*Text.top: chainTop -*options*Label.bottom: chainTop -*options*Text.bottom: chainTop -*options*Label.horizDistance: 0 -*options*Text.horizDistance: 0 -*options*Label.vertDistance: 8 -*options*Text.vertDistance: 8 -*options*Text.width: 147 +*options.pane.form.Label.internalWidth: 0 +*options.pane.form.Label.height: 21 +*options.pane.form.Text.height: 19 +*options.pane.form.Label.top: chainTop +*options.pane.form.Text.top: chainTop +*options.pane.form.Label.bottom: chainTop +*options.pane.form.Text.bottom: chainTop +*options.pane.form.Label.horizDistance: 0 +*options.pane.form.Text.horizDistance: 0 +*options.pane.form.Label.vertDistance: 8 +*options.pane.form.Text.vertDistance: 8 +*options.pane.form.Text.width: 147 *options*viewport.width: 390 *options*viewport.height: 50 @@ -522,7 +525,7 @@ XF86Cfg.translations: #override \ *options*viewport.right: chainRight *options*list.longest: 376 -*options*driverOpts.label: Options for driver\ +*options*driverOpts.label: Options for module\ *options*driverOpts.justify: left *options*driverOpts.width: 278 *options*popdown.label: Popdown dialog @@ -530,6 +533,40 @@ XF86Cfg.translations: #override \ o option name\n\ o option type +.xf86cfg*options.moduleOptions.geometry: 360x245 +.xf86cfg*options.moduleOptions.minWidth: 360 +.xf86cfg*options.moduleOptions.maxWidth: 360 +.xf86cfg*options.moduleOptions.minHeight: 245 +.xf86cfg*options.moduleOptions.maxHeight: 245 +*options.moduleOptions*descriptions*labelType.label: Select option +*options.moduleOptions*descriptions*labelType.width: 348 +*options.moduleOptions*descriptions*module.fromVert: labelType +*options.moduleOptions*descriptions*module.label: Module +*options.moduleOptions*descriptions*Label.horizDistance: 8 +*options.moduleOptions*descriptions*option.fromVert: labelType +*options.moduleOptions*descriptions*option.label: Option +*options.moduleOptions*descriptions*option.fromHoriz: viewM +*options.moduleOptions*descriptions*viewM.fromVert: module +*options.moduleOptions*descriptions*viewM.width: 120 +*options.moduleOptions*descriptions*viewM.height: 94 +*options.moduleOptions*descriptions*modL.longest: 100 +*options.moduleOptions*descriptions*viewO.fromHoriz: viewM +*options.moduleOptions*descriptions*viewO.fromVert: option +*options.moduleOptions*descriptions*viewO.width: 220 +*options.moduleOptions*descriptions*viewO.height: 94 +*options.moduleOptions*descriptions*optL.longest: 220 +*options.moduleOptions*descriptions*desc.horizDistance: 4 +*options.moduleOptions*descriptions*desc.fromVert: viewM +*options.moduleOptions*descriptions*desc.width: 348 +*options.moduleOptions*descriptions*desc.height: 62 +*options.moduleOptions*descriptions*desc.wrap: word +*options.moduleOptions*descriptions*desc.scrollVertical: Always +*options.moduleOptions*descriptions*desc.Scrollbar.foreground: rgb:a/5/5 +*options.moduleOptions*descriptions*desc.Scrollbar.borderWidth: 1 +*options.moduleOptions*descriptions*desc.Scrollbar.borderColor: gray60 +*options.moduleOptions*descriptions.showGrip: False +*options.moduleOptions*popdown.label: Popdown dialog + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! monitor !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -1300,11 +1337,16 @@ kbd?family=Courier&pixelsize=10,\ code?family=Courier&pixelsize=10,\ samp?family=Courier&pixelsize=10,\ tt?family=Courier&pixelsize=10 -*help*close.min: 18 -*help*close.max: 18 -*help*close.showGrip: False +*help*commands.min: 22 +*help*commands.max: 22 +*help*commands.showGrip:False *help*wrap: word +*help*commands.close.label: Close .xf86cfg.help.geometry: 320x369 +.xf86cfg.help.minWidth: 320 +.xf86cfg.help.maxWidth: 320 +.xf86cfg.help.minHeight: 369 +.xf86cfg.help.maxHeight: 369 .xf86cfg.help.translations: #override \ <Message>WM_PROTOCOLS: help-close() *help*text.translations:\ diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c index d2a708905..f50925dbc 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c,v 1.5 2001/03/24 01:17:20 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/card-cfg.c,v 1.6.2.2 2001/05/23 14:45:15 tsi Exp $ */ #include "xf86config.h" @@ -111,10 +111,11 @@ CardConfig(XtPointer config) XtSetArg(args[0], XtNstring, card->dev_busid); XtSetValues(busid, args, 1); #ifdef USE_MODULES - XtSetArg(args[0], XtNlabel, driver_str = XtNewString(card->dev_driver)); -#else - XtSetArg(args[0], XtNstring, card->dev_driver); + if (!nomodules) + XtSetArg(args[0], XtNlabel, driver_str = XtNewString(card->dev_driver)); + else #endif + XtSetArg(args[0], XtNstring, card->dev_driver); XtSetValues(driver, args, 1); } else { @@ -136,10 +137,11 @@ CardConfig(XtPointer config) XtSetArg(args[0], XtNstring, ""); XtSetValues(busid, args, 1); #ifdef USE_MODULES - XtSetArg(args[0], XtNlabel, driver_str = XtNewString("vga")); -#else - XtSetArg(args[0], XtNstring, "vga"); + if (!nomodules) + XtSetArg(args[0], XtNlabel, driver_str = XtNewString("vga")); + else #endif + XtSetArg(args[0], XtNstring, "vga"); XtSetValues(driver, args, 1); } @@ -152,14 +154,17 @@ CardConfig(XtPointer config) if (card == NULL) { card = (XF86ConfDevicePtr)XtCalloc(1, sizeof(XF86ConfDeviceRec)); card->dev_identifier = XtNewString(ident_string); - card->dev_driver = XtNewString(card_entry->driver); - card->dev_card = XtNewString(card_entry->name); - if (card_entry->chipset) - card->dev_chipset = XtNewString(card_entry->chipset); - if (card_entry->ramdac) - card->dev_ramdac = XtNewString(card_entry->ramdac); - if (card_entry->clockchip) - card->dev_clockchip = XtNewString(card_entry->clockchip); + if (card_entry) { + card->dev_driver = XtNewString(card_entry->driver); + card->dev_card = XtNewString(card_entry->name); + if (card_entry->chipset) + card->dev_chipset = XtNewString(card_entry->chipset); + if (card_entry->ramdac) + card->dev_ramdac = XtNewString(card_entry->ramdac); + if (card_entry->clockchip) + card->dev_clockchip = XtNewString(card_entry->clockchip); + } + /* else will fallback to "vga" */ } else if (card_entry != NULL) { XtFree(card->dev_driver); @@ -185,23 +190,28 @@ CardConfig(XtPointer config) card->dev_busid = XtNewString(bus); #ifdef USE_MODULES - drv_nam = driver_str; -#else - XtSetArg(args[0], XtNstring, &drv_nam); - XtGetValues(driver, args, 1); + if (!nomodules) + drv_nam = driver_str; + else #endif + { + XtSetArg(args[0], XtNstring, &drv_nam); + XtGetValues(driver, args, 1); + } XtFree(card->dev_driver); card->dev_driver = XtNewString(drv_nam); #ifdef USE_MODULES - XtFree(driver_str); + if (!nomodules) + XtFree(driver_str); #endif return ((XtPointer)card); } #ifdef USE_MODULES - XtFree(driver_str); + if (!nomodules) + XtFree(driver_str); #endif return (NULL); @@ -214,15 +224,22 @@ CardConfigCheck(void) char *drv_nam; #ifdef USE_MODULES - drv_nam = driver_str; -#else - Arg args[1]; - - XtSetArg(args[0], XtNstring, &drv_nam); - XtGetValues(driver, args, 1); + if (!nomodules) + drv_nam = driver_str; + else #endif + { + Arg args[1]; + + XtSetArg(args[0], XtNstring, &drv_nam); + XtGetValues(driver, args, 1); + } + if (ident_string == NULL || strlen(ident_string) == 0 || +#if 0 + /* not all available cards are in the Cards database */ (current_device == NULL && card_entry == NULL) || +#endif drv_nam == NULL || *drv_nam == '\0') return (False); @@ -258,9 +275,11 @@ CardModelCallback(Widget w, XtPointer user_data, XtPointer call_data) "Chipset: %s\n", card_entry->chipset); if (card_entry->driver != NULL) { #ifdef USE_MODULES - XtFree(driver_str); - driver_str = XtNewString(card_entry->driver); - XtVaSetValues(driver, XtNlabel, driver_str, NULL, 0); + if (!nomodules) { + XtFree(driver_str); + driver_str = XtNewString(card_entry->driver); + XtVaSetValues(driver, XtNlabel, driver_str, NULL, 0); + } #endif len += XmuSnprintf(tip + len, sizeof(tip) - len, "Driver: %s\n", card_entry->driver); @@ -288,8 +307,11 @@ CardModelCallback(Widget w, XtPointer user_data, XtPointer call_data) first = 0; #ifndef USE_MODULES - XtSetArg(args[0], XtNstring, card_entry->driver ? card_entry->driver : "vga"); - XtSetValues(driver, args, 1); + if (!nomodules) { + XtSetArg(args[0], XtNstring, + card_entry->driver ? card_entry->driver : "vga"); + XtSetValues(driver, args, 1); + } #endif str = XtNewString(tip); @@ -381,29 +403,34 @@ CardModel(XF86SetupInfo *info) (XtPointer)info); XtCreateManagedWidget("driverL", labelWidgetClass, model, NULL, 0); #ifdef USE_MODULES - driver = XtVaCreateManagedWidget("driver", menuButtonWidgetClass, - model, - XtNmenuName, "driverM", - NULL, 0); - { - Widget menu, sme; - xf86cfgDriverOptions *opts = video_driver_info; - - menu = XtCreatePopupShell("driverM", simpleMenuWidgetClass, - driver, NULL, 0); - while (opts) { - sme = XtCreateManagedWidget(opts->name, smeBSBObjectClass, - menu, NULL, 0); - XtAddCallback(sme, XtNcallback, DriverCallback, NULL); - opts = opts->next; + if (!nomodules) { + driver = XtVaCreateManagedWidget("driver", menuButtonWidgetClass, + model, + XtNmenuName, "driverM", + NULL, 0); + { + Widget menu, sme; + xf86cfgModuleOptions *opts = module_options; + + menu = XtCreatePopupShell("driverM", simpleMenuWidgetClass, + driver, NULL, 0); + while (opts) { + if (opts->type == VideoModule) { + sme = XtCreateManagedWidget(opts->name, smeBSBObjectClass, + menu, NULL, 0); + XtAddCallback(sme, XtNcallback, DriverCallback, NULL); + } + opts = opts->next; + } } } -#else - driver = XtVaCreateManagedWidget("driver", asciiTextWidgetClass, - model, - XtNeditType, XawtextEdit, - NULL, 0); + else #endif + driver = XtVaCreateManagedWidget("driver", asciiTextWidgetClass, + model, + XtNeditType, XawtextEdit, + NULL, 0); + XtCreateManagedWidget("busidL", labelWidgetClass, model, NULL, 0); busid = XtVaCreateManagedWidget("busid", asciiTextWidgetClass, model, diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/config.h b/xc/programs/Xserver/hw/xfree86/xf86cfg/config.h index 9d8a6a9e2..e7ef66767 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.10 2001/03/29 16:54:30 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/config.h,v 1.10.2.1 2001/05/21 22:24:02 paulo Exp $ */ #include <X11/IntrinsicP.h> @@ -217,5 +217,6 @@ extern xf86cfgComputer computer; extern Atom wm_delete_window; extern Display *DPY; extern Pixmap menuPixmap; +extern Bool nomodules; #endif /* _xf86cfg_config_h */ diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c index 1b13ae39f..e099ca804 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c,v 1.8 2001/04/01 14:00:15 tsi Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/expert.c,v 1.8.2.1 2001/05/21 22:24:02 paulo Exp $ */ #include "config.h" @@ -2407,6 +2407,10 @@ NewDeviceCallback(Widget w, XtPointer user_data, XtPointer call_data) DeleteNode(node); dev = (XF86ConfDevicePtr)XtCalloc(1, sizeof(XF86ConfDeviceRec)); dev->dev_identifier = XtNewString(label); + dev->dev_chipid = -1; + dev->dev_chiprev = -1; + dev->dev_irq = -1; + XF86Config->conf_device_lst = xf86addDevice(XF86Config->conf_device_lst, dev); diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/help.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/help.c index 8f53a52ed..1e98306ed 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/help.c +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/help.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/help.c,v 1.3 2000/10/20 14:59:05 alanh Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/help.c,v 1.4 2001/05/15 18:22:23 paulo Exp $ */ #include <X11/IntrinsicP.h> @@ -34,6 +34,7 @@ #include <X11/Shell.h> #include <X11/Xaw/AsciiText.h> #include <X11/Xaw/Command.h> +#include <X11/Xaw/Form.h> #include <X11/Xaw/Paned.h> #include <X11/Xaw/Text.h> @@ -46,6 +47,7 @@ #endif #include <ctype.h> #include "help.h" +#include "options.h" /* * Prototypes @@ -122,7 +124,7 @@ StartHelp(void) }; if (shell == NULL) { - Widget pane, close; + Widget pane, commands, close; char *props; XawTextPropertyList *propl; @@ -132,8 +134,10 @@ StartHelp(void) shell, NULL, 0); text = XtVaCreateManagedWidget("text", asciiTextWidgetClass, pane, XtNeditType, XawtextRead, NULL, 0); + commands = XtCreateManagedWidget("commands", formWidgetClass, pane, + NULL, 0); close = XtCreateManagedWidget("close", commandWidgetClass, - pane, NULL, 0); + commands, NULL, 0); XtAddCallback(close, XtNcallback, CloseCallback, NULL); XtRealizeWidget(shell); XSetWMProtocols(DPY, XtWindow(shell), &wm_delete_window, 1); diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c index 01518410b..3489f2a04 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.21 2001/04/01 14:00:15 tsi Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/interface.c,v 1.23.2.1 2001/05/21 22:24:02 paulo Exp $ */ #include <X11/IntrinsicP.h> @@ -130,7 +130,7 @@ static char XF86Config_path_static[1024]; static char XkbConfig_path_static[1024]; Bool xf86config_set = False; -Bool textmode = False; +Bool textmode = False, nomodules = False; xf86cfgComputer computer; xf86cfgDevice cpu_device; @@ -171,6 +171,9 @@ static XtActionsRec actions[] = { {"testmode-cancel", CancelTestModeAction}, {"help-close", HelpCancelAction}, {"expert-close", ExpertCloseAction}, +#ifdef USE_MODULES + {"module-options-close", ModuleOptionsCancelAction}, +#endif }; static char *device_names[] = { @@ -214,7 +217,7 @@ main(int argc, char *argv[]) XGCValues values; XF86ConfLayoutPtr lay; int i, startedx; - char *menuPixmapPath; + char *menuPixmapPath = NULL; XrmValue from, to; #ifdef USE_MODULES @@ -249,6 +252,8 @@ main(int argc, char *argv[]) else if (strcmp(argv[i], "-textmode") == 0) textmode = True; #endif + else if (strcmp(argv[i], "-nomodules") == 0) + nomodules = True; } #ifdef HAS_NCURSES @@ -259,8 +264,8 @@ main(int argc, char *argv[]) #endif startedx = startx(); -/* if (XF86Config_path == NULL) - XF86Config_path = "/etc/X11/XF86Config-4";*/ + if (XF86Config_path == NULL) + XF86Config_path = "XF86Config-4"; if (XkbConfig_path == NULL) XkbConfig_path = XkbConfigDir XkbConfigFile; toplevel = XtAppInitialize(&appcon, "XF86Cfg", @@ -271,9 +276,9 @@ main(int argc, char *argv[]) if (DPY == NULL) DPY = XtDisplay(toplevel); - if (strlen(menuPixmapPath)) { - XtGetApplicationResources(toplevel, (XtPointer)&menuPixmapPath, - appResources, XtNumber(appResources), NULL, 0); + XtGetApplicationResources(toplevel, (XtPointer)&menuPixmapPath, + appResources, XtNumber(appResources), NULL, 0); + if (menuPixmapPath && strlen(menuPixmapPath)) { from.size = strlen(menuPixmapPath); from.addr = menuPixmapPath; to.size = sizeof(Pixmap); @@ -479,6 +484,7 @@ main(int argc, char *argv[]) } #ifdef USE_MODULES + if (!nomodules) LoaderInitializeOptions(); #endif @@ -1419,7 +1425,7 @@ OptionsCallback(Widget w, XtPointer user_data, XtPointer call_data) int i; XF86OptionPtr *options; #ifdef USE_MODULES - xf86cfgDriverOptions *drv_opts = NULL; + xf86cfgModuleOptions *drv_opts = NULL; #endif if (config_mode == CONFIG_SCREEN) { @@ -1446,19 +1452,37 @@ OptionsCallback(Widget w, XtPointer user_data, XtPointer call_data) case KEYBOARD: options = (XF86OptionPtr*)&(((XF86ConfInputPtr) (computer.devices[i]->config))->inp_option_lst); +#ifdef USE_MODULES + if (!nomodules) { + char *drv = ((XF86ConfInputPtr) + (computer.devices[i]->config))->inp_driver; + + if (drv) { + drv_opts = module_options; + while (drv_opts) { + if (drv_opts->type == InputModule && + strcmp(drv_opts->name, drv) == 0) + break; + drv_opts = drv_opts->next; + } + } + } +#endif + break; case CARD: options = (XF86OptionPtr*)&(((XF86ConfDevicePtr) (computer.devices[i]->config))->dev_option_lst); #ifdef USE_MODULES - { + if (!nomodules) { char *drv = ((XF86ConfDevicePtr) (computer.devices[i]->config))->dev_driver; if (drv) { - drv_opts = video_driver_info; + drv_opts = module_options; while (drv_opts) { - if (strcmp(drv_opts->name, drv) == 0) + if (drv_opts->type == VideoModule && + strcmp(drv_opts->name, drv) == 0) break; drv_opts = drv_opts->next; } diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c index 8b811e6fb..fed6b8850 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c,v 1.3 2000/12/01 18:31:07 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.c,v 1.5.2.1 2001/05/28 21:36:44 paulo Exp $ */ #define LOADER_PRIVATE #include "loader.h" @@ -34,10 +34,16 @@ /* XXX beware (or fix it) libc functions called here are the xf86 ones */ #ifdef USE_MODULES +static void AddModuleOptions(char*, OptionInfoPtr); void xf86AddDriver(DriverPtr, void*, int); Bool xf86ServerIsOnlyDetecting(void); +void xf86AddInputDriver(InputDriverPtr, pointer, int); +void xf86AddModuleInfo(ModuleInfoPtr, void*); +Bool xf86LoaderCheckSymbol(const char*); +void xf86LoaderReqSymLists(const char **, ...); +void xf86Msg(int, const char*, ...); -xf86cfgDriverOptions *video_driver_info; +xf86cfgModuleOptions *module_options; int xf86ShowUnresolved = 1; @@ -231,10 +237,49 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(xf86AddDriver) SYMFUNC(xf86ServerIsOnlyDetecting) + SYMFUNC(xf86AddInputDriver) + SYMFUNC(xf86AddModuleInfo) + SYMFUNC(xf86LoaderCheckSymbol) + + SYMFUNC(xf86LoaderReqSymLists) + SYMFUNC(xf86Msg) + SYMFUNC(ErrorF) {0,0} }; static DriverPtr driver; +static ModuleInfoPtr info; +static ModuleType type = GenericModule; + +static void +AddModuleOptions(char *name, OptionInfoPtr option) +{ + xf86cfgModuleOptions *ptr; + OptionInfoPtr tmp; + + ptr = XtNew(xf86cfgModuleOptions); + ptr->name = XtNewString(name); + ptr->type = type; + if (option) { + int count; + + for (count = 0, tmp = option; tmp->name != NULL; tmp++, count++) + ; + ++count; + ptr->option = (XtPointer)XtCalloc(1, count * sizeof(OptionInfoRec)); + for (count = 0, tmp = option; tmp->name != NULL; count++, tmp++) { + memcpy(&ptr->option[count], tmp, sizeof(OptionInfoRec)); + ptr->option[count].name = XtNewString(tmp->name); + if (tmp->type == OPTV_STRING || tmp->type == OPTV_ANYSTR) + ptr->option[count].value.str = XtNewString(tmp->value.str); + } + } + else + ptr->option = NULL; + + ptr->next = module_options; + module_options = ptr; +} Bool LoaderInitializeOptions(void) @@ -257,7 +302,9 @@ LoaderInitializeOptions(void) if (path == NULL || strcmp(XF86Module_path, path)) { char **list, **l; const char *subdirs[] = { + ".", "drivers", + "input", NULL }; int errmaj, errmin; @@ -268,61 +315,32 @@ LoaderInitializeOptions(void) list = LoaderListDirs(subdirs, NULL); if (list) { - xf86cfgDriverOptions *prev, *ptr = video_driver_info; - +#if 0 if (ptr) { - while (video_driver_info) { - video_driver_info = video_driver_info->next; + while (module_options) { + module_options = module_options->next; XtFree(ptr->name); XtFree((XtPointer)ptr->option); XtFree((XtPointer)ptr); - ptr = video_driver_info; + ptr = module_options; } } +#endif for (l = list; *l; l++) { driver = NULL; + info = NULL; + type = GenericModule; xf86Verbose = 0; if ((module = LoadModule(*l, NULL, NULL, NULL, NULL, NULL, &errmaj, &errmin)) == NULL) LoaderErrorMsg(NULL, *l, errmaj, errmin); - else if (driver && driver->AvailableOptions) { - OptionInfoPtr tmp, - option = (*driver->AvailableOptions)(-1, -1); - - ptr = XtNew(xf86cfgDriverOptions); - ptr->name = XtNewString(*l); - if (option) { - int count; - - for (count = 0, tmp = option; tmp->name != NULL; tmp++, count++) - ; - ++count; - ptr->option = (XtPointer)XtCalloc(1, count * - sizeof(OptionInfoRec)); - for (count = 0, tmp = option; tmp->name != NULL; - count++, tmp++) { - memcpy(&ptr->option[count], tmp, - sizeof(OptionInfoRec)); - ptr->option[count].name = - XtNewString(tmp->name); - if (tmp->type == OPTV_STRING || - tmp->type == OPTV_ANYSTR) - ptr->option[count].value.str = - XtNewString(tmp->value.str); - } - } - else - ptr->option = NULL; - ptr->next = NULL; - if (video_driver_info == NULL) - video_driver_info = ptr; - else - prev->next = ptr; - prev = ptr; + else if (driver && driver->AvailableOptions) + AddModuleOptions(*l, (*driver->AvailableOptions)(-1, -1)); + else if (info && info->AvailableOptions) + AddModuleOptions(*l, (*info->AvailableOptions)(NULL)); - UnloadModule(module); - } + UnloadModule(module); xf86Verbose = saveVerbose; } LoaderFreeDirList(list); @@ -342,6 +360,7 @@ void xf86AddDriver(DriverPtr drv, void *module, int flags) { driver = drv; + type = VideoModule; } Bool @@ -349,4 +368,31 @@ xf86ServerIsOnlyDetecting(void) { return (True); } + +void +xf86AddInputDriver(InputDriverPtr inp, void *module, int flags) +{ + type = InputModule; +} + +void +xf86AddModuleInfo(ModuleInfoPtr inf, void *module) +{ + info = inf; +} + +Bool +xf86LoaderCheckSymbol(const char *symbol) +{ + return LoaderSymbol(symbol) != NULL; +} + +void +xf86LoaderReqSymLists(const char **list0, ...) +{ +} + +void xf86Msg(int type, const char *format, ...) +{ +} #endif diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h b/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h index 5d7b69863..d3d763cab 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h,v 1.1 2000/10/20 14:59:05 alanh Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/loader.h,v 1.4 2001/05/18 20:22:31 tsi Exp $ */ #ifdef USE_MODULES #include "config.h" @@ -149,15 +149,65 @@ typedef struct _DriverRec { void * module; int refCount; } DriverRec, *DriverPtr; + +typedef struct _InputDriverRec { + int driverVersion; + char * driverName; + void (*Identify)(int flags); + struct _LocalDeviceRec *(*PreInit)(struct _InputDriverRec *drv, + void *dev, int flags); + void (*UnInit)(struct _InputDriverRec *drv, + void *pInfo, + int flags); + pointer module; + int refCount; +} InputDriverRec, *InputDriverPtr; + +typedef struct _loader_item *itemPtr; +typedef struct _loader_item { + char *name ; + void *address ; + itemPtr next ; + int handle ; + int module ; + itemPtr exports; +#if defined(__powerpc__) + /* + * PowerPC file formats require special routines in some circumstances + * to assist in the linking process. See the specific loader for + * more details. + */ + union { + unsigned short plt[8]; /* ELF */ + unsigned short glink[14]; /* XCOFF */ + } code ; +#endif + } itemRec ; + +typedef struct _ModuleInfoRec { + int moduleVersion; + char * moduleName; + pointer module; + int refCount; + OptionInfoRec * (*AvailableOptions)(void *unused); + pointer unused[2]; /* leave some space for more fields */ +} ModuleInfoRec, *ModuleInfoPtr; #endif /* LOADER_PRIVATE */ -typedef struct _xf86cfgDriverOptions { +typedef enum { + VideoModule, + InputModule, + GenericModule +} ModuleType; + +typedef struct _xf86cfgModuleOptions { char *name; + ModuleType type; OptionInfoPtr option; - struct _xf86cfgDriverOptions *next; -} xf86cfgDriverOptions; + struct _xf86cfgModuleOptions *next; +} xf86cfgModuleOptions; -extern xf86cfgDriverOptions *video_driver_info; +extern xf86cfgModuleOptions *module_options; Bool LoaderInitializeOptions(void); #endif /* USE_MODULES */ diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/options.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/options.c index 792002001..8c6f6661c 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/options.c +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/options.c @@ -26,11 +26,12 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/options.c,v 1.4 2000/11/30 20:55:18 paulo Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/options.c,v 1.6.2.2 2001/05/25 21:45:01 paulo Exp $ */ #include "options.h" #include "xf86config.h" +#include <X11/Xresource.h> #include <X11/Shell.h> #include <X11/Xaw/AsciiText.h> #include <X11/Xaw/List.h> @@ -52,6 +53,9 @@ static void UpdateOption(Widget, XtPointer, XtPointer); static void UpdateOptionList(void); #ifdef USE_MODULES static void AddDriverOption(Widget, XtPointer, XtPointer); +static void SelectModuleCallback(Widget, XtPointer, XtPointer); +static void SelectModuleOptionCallback(Widget, XtPointer, XtPointer); +static void ModuleOptionsPopdown(Widget, XtPointer, XtPointer); #endif /* @@ -62,10 +66,153 @@ static XF86OptionPtr *options; static Widget add, remov, update, list, name, value; static char *option_str; static int option_index, popped = False; +static char *Options = "lib/X11/Options"; +static XrmDatabase xrm; +#ifdef USE_MODULES +static Widget modList, optList, desc, modOptionsShell, labelType; +static char *module_sel; +static char *types[] = { + "none", "integer", "(non null) string", "string", "real", + "boolean", "frequency", +}; +#endif /* * Implementation */ +#ifdef USE_MODULES +static int +qcmp_str(_Xconst void *a, _Xconst void *b) +{ + return (strcmp(*(char**)a, *(char**)b)); +} + +void +ModuleOptionsPopup(Widget w, XtPointer user_data, XtPointer call_data) +{ + xf86cfgModuleOptions *info = module_options; + + if (modOptionsShell == NULL) { + char **ops; + int nops; + Widget pane, form, viewport, bottom, popdown; + + modOptionsShell = XtCreatePopupShell("moduleOptions", + transientShellWidgetClass, + optionsShell, NULL, 0); + + pane = XtCreateManagedWidget("pane", panedWidgetClass, + modOptionsShell, NULL, 0); + + form = XtCreateManagedWidget("descriptions", formWidgetClass, + pane, NULL, 0); + labelType = XtCreateManagedWidget("labelType", labelWidgetClass, + form, NULL, 0); + XtCreateManagedWidget("module", labelWidgetClass, form, NULL, 0); + viewport = XtCreateManagedWidget("viewM", viewportWidgetClass, + form, NULL, 0); + ops = NULL; + nops = 0; + while (info) { + ++nops; + ops = (char**)XtRealloc((XtPointer)ops, sizeof(char*) * nops); + ops[nops - 1] = XtNewString(info->name); + info = info->next; + } + if (nops == 0) { + ops = (char**)XtMalloc(sizeof(char*)); + ops[0] = XtNewString(""); + nops = 1; + } + else + qsort(ops, nops, sizeof(char*), qcmp_str); + modList = XtVaCreateManagedWidget("modL", listWidgetClass, + viewport, XtNlist, ops, + XtNnumberStrings, nops, + NULL, 0); + XtAddCallback(modList, XtNcallback, SelectModuleCallback, NULL); + XtCreateManagedWidget("option", labelWidgetClass, form, NULL, 0); + viewport = XtCreateManagedWidget("viewO", viewportWidgetClass, + form, NULL, 0); + ops = (char**)XtMalloc(sizeof(char*)); + ops[0] = XtNewString(""); + optList = XtVaCreateManagedWidget("optL", listWidgetClass, + viewport, XtNlist, ops, + XtNnumberStrings, 1, NULL, 0); + XtAddCallback(optList, XtNcallback, SelectModuleOptionCallback, NULL); + desc = XtVaCreateManagedWidget("desc", asciiTextWidgetClass, + form, XtNeditType, XawtextRead, + NULL, 0); + + bottom = XtCreateManagedWidget("bottom", formWidgetClass, + pane, NULL, 0); + popdown = XtVaCreateManagedWidget("popdown", commandWidgetClass, + bottom, NULL, 0); + XtAddCallback(popdown, XtNcallback, ModuleOptionsPopdown, NULL); + XtRealizeWidget(modOptionsShell); + XSetWMProtocols(DPY, XtWindow(modOptionsShell), &wm_delete_window, 1); + + info = module_options; + } + + if (module_sel && *module_sel) { + XawListReturnStruct list; /* hack to call ballbacks */ + char **strs; + int nstrs, idx = 0; + + XtVaGetValues(modList, XtNlist, &strs, XtNnumberStrings, &nstrs, NULL); + for (idx = nstrs - 1; idx > 0; idx--) + if (strcmp(module_sel, strs[idx]) == 0) + break; + while (info) { + if (strcmp(module_sel, info->name) == 0) + break; + info = info->next; + } + if (info) { + list.string = info->name; + list.list_index = idx; + XawListHighlight(modList, idx); + SelectModuleCallback(modList, NULL, (XtPointer)&list); + } + if (option_str && *option_str) { + OptionInfoPtr opts = info->option; + + idx = 0; + while (opts && opts->name) { + if (strcmp(opts->name, option_str) == 0) + break; + ++idx; + ++opts; + } + + if (opts && opts->name) { + list.string = (char *)opts->name; + list.list_index = idx; + XawListHighlight(optList, idx); + SelectModuleOptionCallback(optList, NULL, (XtPointer)&list); + } + } + } + XtPopup(modOptionsShell, XtGrabNone); +} + +/*ARGSUSED*/ +static void +ModuleOptionsPopdown(Widget w, XtPointer user_data, XtPointer call_data) +{ + XtPopdown(modOptionsShell); +} + +/*ARGSUSED*/ +void +ModuleOptionsCancelAction(Widget w, XEvent *event, + String *params, Cardinal *num_params) +{ + ModuleOptionsPopdown(w, NULL, NULL); +} +#endif + void CreateOptionsShell(void) { @@ -95,7 +242,7 @@ OptionsPopup(XF86OptionPtr *opts) option_str = NULL; options = opts; if (first) { - Widget pane, form, viewport, bottom, popdown; + Widget pane, form, viewport, bottom, popdown, command; first = 0; @@ -103,6 +250,7 @@ OptionsPopup(XF86OptionPtr *opts) CreateOptionsShell(); pane = XtCreateManagedWidget("pane", panedWidgetClass, optionsShell, NULL, 0); + form = XtCreateManagedWidget("commands", formWidgetClass, pane, NULL, 0); add = XtCreateManagedWidget("add", commandWidgetClass, @@ -114,6 +262,13 @@ OptionsPopup(XF86OptionPtr *opts) update = XtCreateManagedWidget("update", commandWidgetClass, form, NULL, 0); XtAddCallback(update, XtNcallback, UpdateOption, NULL); +#ifdef USE_MODULES + if (!nomodules) { + command = XtCreateManagedWidget("help", commandWidgetClass, + form, NULL, 0); + XtAddCallback(command, XtNcallback, ModuleOptionsPopup, NULL); + } +#endif form = XtCreateManagedWidget("form", formWidgetClass, pane, NULL, 0); XtVaCreateManagedWidget("label1", labelWidgetClass, form, @@ -140,13 +295,15 @@ OptionsPopup(XF86OptionPtr *opts) bottom = XtCreateManagedWidget("bottom", formWidgetClass, pane, NULL, 0); #ifdef USE_MODULES - button = XtCreateManagedWidget("driverOpts", menuButtonWidgetClass, - bottom, NULL, 0); + if (!nomodules) + button = XtCreateManagedWidget("driverOpts", menuButtonWidgetClass, + bottom, NULL, 0); #endif popdown = XtVaCreateManagedWidget("popdown", commandWidgetClass, bottom, NULL, 0); #ifdef USE_MODULES - XtVaSetValues(popdown, XtNfromHoriz, button, NULL, 0); + if (!nomodules) + XtVaSetValues(popdown, XtNfromHoriz, button, NULL, 0); #endif XtAddCallback(popdown, XtNcallback, PopdownCallback, NULL); @@ -154,7 +311,7 @@ OptionsPopup(XF86OptionPtr *opts) XSetWMProtocols(DPY, XtWindow(optionsShell), &wm_delete_window, 1); #ifdef USE_MODULES - { + if (!nomodules) { char *str; XtSetArg(args[0], XtNlabel, &str); @@ -165,49 +322,57 @@ OptionsPopup(XF86OptionPtr *opts) } #ifdef USE_MODULES - if (menu) - XtDestroyWidget(menu); - XmuSnprintf(menuName, sizeof(buf), "optionM%d", menuN); - menuN = !menuN; - menu = XtCreatePopupShell(menuName, simpleMenuWidgetClass, button, - NULL, 0); - XtVaSetValues(button, XtNmenuName, menuName, NULL, 0); - if (drv_opts) { - int len, longest = 0; - char fmt[32]; - static char *types[] = { - "none", "integer", "(non null) string", "string", "real", - "boolean", "frequency", - }; - - for (i = 0; drv_opts[i].name != NULL; i++) { - len = strlen(drv_opts[i].name); - if (len > longest) - longest = len; + if (!nomodules) { + if (menu) + XtDestroyWidget(menu); + XmuSnprintf(menuName, sizeof(buf), "optionM%d", menuN); + menuN = !menuN; + menu = XtCreatePopupShell(menuName, simpleMenuWidgetClass, button, + NULL, 0); + XtVaSetValues(button, XtNmenuName, menuName, NULL, 0); + if (drv_opts) { + int len, longest = 0; + char fmt[32]; + + for (i = 0; drv_opts[i].name != NULL; i++) { + len = strlen(drv_opts[i].name); + if (len > longest) + longest = len; + } + XmuSnprintf(fmt, sizeof(fmt), "%c-%ds %%s", '%', longest); + for (; drv_opts->name != NULL; drv_opts++) { + char *type; + + if (drv_opts->type >= OPTV_NONE && drv_opts->type <= OPTV_FREQ) + type = types[drv_opts->type]; + else + type = "UNKNOWN"; + + XmuSnprintf(buf, sizeof(buf), fmt, drv_opts->name, type); + sme = XtVaCreateManagedWidget(drv_opts->name, smeBSBObjectClass, + menu, XtNlabel, buf, NULL, 0); + XtAddCallback(sme, XtNcallback, AddDriverOption, (XtPointer)drv_opts); + } } - XmuSnprintf(fmt, sizeof(fmt), "%c-%ds %%s", '%', longest); - for (; drv_opts->name != NULL; drv_opts++) { - char *type; - - if (drv_opts->type >= OPTV_NONE && drv_opts->type <= OPTV_FREQ) - type = types[drv_opts->type]; - else - type = "UNKNOWN"; - - XmuSnprintf(buf, sizeof(buf), fmt, drv_opts->name, type); - sme = XtVaCreateManagedWidget(drv_opts->name, smeBSBObjectClass, - menu, XtNlabel, buf, NULL, 0); - XtAddCallback(sme, XtNcallback, AddDriverOption, (XtPointer)drv_opts); + if (i) { + xf86cfgModuleOptions *mod = module_options; + + while (mod) { + if (strcmp(mod->name, driver) == 0) { + /* don't assign to driver, as it may be a temp string */ + module_sel = mod->name; + break; + } + mod = mod->next; + } + XmuSnprintf(buf, sizeof(buf), "%s%s", label, driver); + XtSetArg(args[0], XtNlabel, buf); + XtSetValues(button, args, 1); + XtMapWidget(button); } + else + XtUnmapWidget(button); } - if (i) { - XmuSnprintf(buf, sizeof(buf), "%s%s", label, driver); - XtSetArg(args[0], XtNlabel, buf); - XtSetValues(button, args, 1); - XtMapWidget(button); - } - else - XtUnmapWidget(button); #endif UpdateOptionList(); @@ -334,6 +499,7 @@ AddDriverOption(Widget w, XtPointer user_data, XtPointer call_data) OptionInfoPtr opt = (OptionInfoPtr)user_data; XF86OptionPtr option; + option_str = (char *)opt->name; XtSetArg(args[0], XtNstring, opt->name); XtSetValues(name, args, 1); if ((option = xf86findOption(*options, opt->name)) == NULL) @@ -342,6 +508,90 @@ AddDriverOption(Widget w, XtPointer user_data, XtPointer call_data) XtSetArg(args[0], XtNstring, option->opt_val); XtSetValues(value, args, 1); } + +/*ARGSUSED*/ +static void +SelectModuleCallback(Widget w, XtPointer user_data, XtPointer call_data) +{ + xf86cfgModuleOptions *mod = module_options; + XawListReturnStruct *info = (XawListReturnStruct *)call_data; + + while (mod) { + if (strcmp(mod->name, info->string) == 0) + break; + mod = mod->next; + } + + if (mod) { + Arg args[2]; + char **list = NULL, **old; + OptionInfoPtr opts = mod->option; + int num = 0, oldnum; + + module_sel = mod->name; + XtSetArg(args[0], XtNlist, &old); + XtSetArg(args[1], XtNnumberStrings, &oldnum); + XtGetValues(optList, args, 2); + while (opts && opts->name) { + ++num; + list = (char**)XtRealloc((XtPointer)list, sizeof(char*) * num); + list[num - 1] = XtNewString(opts->name); + ++opts; + } + if (num == 0) { + list = (char**)XtMalloc(sizeof(char*)); + list[0] = XtNewString(""); + num = 1; + } + XtSetArg(args[0], XtNlist, list); + XtSetArg(args[1], XtNnumberStrings, num); + XtSetValues(optList, args, 2); + while (--oldnum >= 0) + XtFree(old[oldnum]); + XtFree((XtPointer)old); + + XtVaSetValues(desc, XtNstring, "", NULL); + XawListUnhighlight(optList); + } +} + +static void +SelectModuleOptionCallback(Widget w, XtPointer user_data, XtPointer call_data) +{ + xf86cfgModuleOptions *mod = module_options; + XawListReturnStruct *info = (XawListReturnStruct *)call_data; + char *description = NULL, *type = "undefined"; + char label[256]; + + if (module_sel && info->string) + description = GetOptionDescription(module_sel, info->string); + if (description == NULL) + description = "** NO DESCRIPTION AVAILABLE **"; + + XtVaSetValues(desc, XtNstring, description, NULL); + + while (mod) { + if (strcmp(module_sel, mod->name) == 0) + break; + mod = mod->next; + } + if (mod) { + OptionInfoPtr opts = mod->option; + + while (opts && opts->name) { + if (strcmp(info->string, opts->name) == 0) + break; + ++opts; + } + if (opts && opts->name && opts->type >= OPTV_NONE && + opts->type <= OPTV_FREQ) + type = types[opts->type]; + } + + XmuSnprintf(label, sizeof(label), "%s.%s (%s)", module_sel, info->string, + type); + XtVaSetValues(labelType, XtNlabel, label, NULL); +} #endif /*ARGSUSED*/ @@ -393,3 +643,27 @@ UpdateOption(Widget w, XtPointer user_data, XtPointer call_data) XtSetSensitive(remov, True); XtSetSensitive(update, True); } + +char * +GetOptionDescription(char *module, char *option) +{ + static int first = 1; + char *type; + XrmValue value; + char query[256]; + + if (first) { + first = 0; + XrmInitialize(); + if ((xrm = XrmGetFileDatabase(Options)) == (XrmDatabase)0) { + fprintf(stderr, "Cannot open '%s' database.\n", Options); + return (NULL); + } + } + + XmuSnprintf(query, sizeof(query), "%s.%s", module, option); + if (XrmGetResource(xrm, query, "Module.Option", &type, &value)) + return ((char*)value.addr); + + return (NULL); +} diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/options.h b/xc/programs/Xserver/hw/xfree86/xf86cfg/options.h index eb5b4474a..6c754f86b 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/options.h +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/options.h @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/options.h,v 1.3 2000/10/20 14:59:07 alanh Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/options.h,v 1.4.2.1 2001/05/25 21:45:01 paulo Exp $ */ #include "config.h" @@ -39,7 +39,12 @@ */ #ifdef USE_MODULES void OptionsPopup(XF86OptionPtr*, char*, OptionInfoPtr); +void ModuleOptionsPopup(Widget, XtPointer, XtPointer); #else void OptionsPopup(XF86OptionPtr*); #endif void OptionsCancelAction(Widget, XEvent*, String*, Cardinal*); +void ModuleOptionsCancelAction(Widget, XEvent*, String*, Cardinal*); +char *GetOptionDescription(char *module, char *option); + +void CreateOptionsShell(void);
\ No newline at end of file diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c index e683bff12..7a166623d 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.7 2001/04/01 14:00:15 tsi Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/screen-cfg.c,v 1.8.2.1 2001/05/21 22:24:02 paulo Exp $ */ #include "xf86config.h" @@ -406,7 +406,7 @@ ScreenDialog(XF86SetupInfo *info) XF86ConfModeLinePtr mline = mon != NULL ? mon->mon_modeline_lst : NULL; int i; #ifdef USE_MODULES - xf86cfgDriverOptions *drv_opts = video_driver_info; + xf86cfgModuleOptions *drv_opts = module_options; Bool foundRotate = False; #endif @@ -486,31 +486,34 @@ ScreenDialog(XF86SetupInfo *info) } #ifdef USE_MODULES - while (drv_opts) { - if (strcmp(drv_opts->name, screen->scrn_device->dev_driver) == 0) { - OptionInfoPtr opts = drv_opts->option; - - while (opts->name) { - if (xf86nameCompare(opts->name, "Rotate") == 0) { - foundRotate = True; - break; + if (!nomodules) { + while (drv_opts) { + if (drv_opts->type == VideoModule && + strcmp(drv_opts->name, screen->scrn_device->dev_driver) == 0) { + OptionInfoPtr opts = drv_opts->option; + + while (opts->name) { + if (xf86nameCompare(opts->name, "Rotate") == 0) { + foundRotate = True; + break; + } + opts++; } - opts++; + break; } - break; + drv_opts = drv_opts->next; } - drv_opts = drv_opts->next; - } - if (!foundRotate) { - XtUnmapWidget(labelRotate); - XtUnmapWidget(cw); - XtUnmapWidget(ccw); - } - else { - XtMapWidget(labelRotate); - XtMapWidget(cw); - XtMapWidget(ccw); + if (!foundRotate) { + XtUnmapWidget(labelRotate); + XtUnmapWidget(cw); + XtUnmapWidget(ccw); + } + else { + XtMapWidget(labelRotate); + XtMapWidget(cw); + XtMapWidget(ccw); + } } #endif if (rotate == CW) { diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c b/xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c index bf50a62b2..0849deee5 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c @@ -26,7 +26,7 @@ * * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> * - * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c,v 1.10 2001/04/22 08:36:31 herrb Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/text-mode.c,v 1.10.2.1 2001/05/21 22:24:02 paulo Exp $ */ #include <stdio.h> @@ -1055,31 +1055,16 @@ CardConfig(void) char **list = NULL, *identifier = NULL, *driver, *busid, *tmp; int nlist, def; CardsEntry *entry = NULL; -#ifdef USE_MODULES static char **drivers; static int ndrivers; +#ifdef USE_MODULES 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[] = { +#endif + static char *xdrivers[] = { "apm", "ark", "ati", @@ -1107,8 +1092,30 @@ CardConfig(void) "vga", "vesa", }; - static int ndrivers = sizeof(drivers) / sizeof(drivers[0]); + +#ifdef USE_MODULES + if (!nomodules) { + 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 #endif + { + ndrivers = sizeof(xdrivers) / sizeof(xdrivers[0]); + drivers = xdrivers; + } nlist = 0; while (device) { diff --git a/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man b/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man index 103fc64d5..0a16cb385 100644 --- a/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man +++ b/xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man @@ -26,7 +26,7 @@ .\" .\" Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br> .\" -.\" $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man,v 1.6 2001/01/27 18:20:59 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/xf86cfg/xf86cfg.man,v 1.6.2.1 2001/05/21 22:24:02 paulo Exp $ .\" .TH xf86cfg 1 __vendorversion__ .SH NAME @@ -91,6 +91,10 @@ started by xf86cfg, if any. .I -textmode If xf86cfg was compiled with support to ncurses, this option makes xf86cfg enters a text mode interface. +.TP 8 +.I -nomodules +When built with support for loading modules, this options changes xf86cfg +behaviour, so that it will not load any modules, and thus start quickier. .SH ENVIRONMENT .TP 8 diff --git a/xc/programs/Xserver/hw/xwin/InitInput.c b/xc/programs/Xserver/hw/xwin/InitInput.c index 4d008b272..355315f86 100644 --- a/xc/programs/Xserver/hw/xwin/InitInput.c +++ b/xc/programs/Xserver/hw/xwin/InitInput.c @@ -22,17 +22,20 @@ from The Open Group. */ -/* $XFree86: xc/programs/Xserver/hw/xwin/InitInput.c,v 1.3 2001/04/18 17:14:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/InitInput.c,v 1.4 2001/05/02 00:45:26 alanh Exp $ */ #include "win.h" -/* Called from dix/devices.c */ -/* All of our keys generate up and down transition notifications, - so all of our keys can be used as modifiers. +CARD32 g_c32LastInputEventTime = 0; - An example of a modifier is mapping the A key to the Control key. - A has to be a legal modifier. I think. -*/ +/* Called from dix/devices.c */ +/* + * All of our keys generate up and down transition notifications, + * so all of our keys can be used as modifiers. + * + * An example of a modifier is mapping the A key to the Control key. + * A has to be a legal modifier. I think. + */ Bool LegalModifier (unsigned int uiKey, DevicePtr pDevice) { @@ -48,6 +51,14 @@ ProcessInputEvents (void) miPointerUpdate (); } +int +TimeSinceLastInputEvent () +{ + if (g_c32LastInputEventTime == 0) + g_c32LastInputEventTime = GetTickCount (); + return GetTickCount () - g_c32LastInputEventTime; +} + /* See Porting Layer Definition - p. 17 */ void InitInput (int argc, char *argv[]) diff --git a/xc/programs/Xserver/hw/xwin/InitOutput.c b/xc/programs/Xserver/hw/xwin/InitOutput.c index fe098dbb9..31c3cdee3 100644 --- a/xc/programs/Xserver/hw/xwin/InitOutput.c +++ b/xc/programs/Xserver/hw/xwin/InitOutput.c @@ -22,7 +22,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/hw/xwin/InitOutput.c,v 1.5 2001/04/18 17:14:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/InitOutput.c,v 1.8 2001/05/08 08:14:09 alanh Exp $ */ #include "win.h" @@ -30,7 +30,7 @@ int g_nNumScreens; winScreenInfo g_winScreens[MAXSCREENS]; int g_nLastScreen = -1; ColormapPtr g_cmInstalledMaps[MAXSCREENS]; -int g_fdMessageQueue = -1; +int g_fdMessageQueue = WIN_FD_INVALID; int g_winScreenPrivateIndex = -1; unsigned long g_winGeneration = 0; @@ -40,7 +40,7 @@ static PixmapFormatRec g_PixmapFormats[] = { { 8, 8, BITMAP_SCANLINE_PAD }, { 15, 16, BITMAP_SCANLINE_PAD }, { 16, 16, BITMAP_SCANLINE_PAD }, - { 24, 32, BITMAP_SCANLINE_PAD }, + { 24, 24, BITMAP_SCANLINE_PAD }, { 32, 32, BITMAP_SCANLINE_PAD } }; const int NUMFORMATS = sizeof (g_PixmapFormats) / sizeof (g_PixmapFormats[0]); @@ -60,6 +60,8 @@ winInitializeDefaultScreens (void) g_winScreens[i].pixelWhite = WIN_DEFAULT_WHITEPIXEL; g_winScreens[i].dwLineBias = WIN_DEFAULT_LINEBIAS; g_winScreens[i].pfb = NULL; + g_winScreens[i].fFullScreen = FALSE; + g_winScreens[i].iE3BTimeout = WIN_E3B_OFF; } g_nNumScreens = 1; } @@ -132,6 +134,8 @@ ddxUseMsg (void) "\t\tDirectDraw4 blitter\t4\n"); ErrorF ("-fullscreen\n" "\tRun the specified server engine in fullscreen mode\n"); + ErrorF ("-emulate3buttons [n]\n" + "\tEmulate 3 button mouse with timeout of n milliseconds\n"); } /* See Porting Layer Definition - p. 57 */ @@ -148,8 +152,8 @@ ddxProcessArgument (int argc, char *argv[], int i) } /* - Look for the '-screen n WxHxD' arugment - */ + * Look for the '-screen n WxHxD' arugment + */ if (strcmp (argv[i], "-screen") == 0) { int nScreenNum; @@ -163,17 +167,21 @@ ddxProcessArgument (int argc, char *argv[], int i) nScreenNum = atoi (argv[i+1]); + /* Validate the specified screen number */ if (nScreenNum < 0 || nScreenNum >= MAXSCREENS) { ErrorF ("Invalid screen number %d\n", nScreenNum); UseMsg (); return 0; } + + /* Grab the height, width, and depth parameters */ if (3 != sscanf (argv[i+2], "%dx%dx%d", (int*)&g_winScreens[nScreenNum].dwWidth, (int*)&g_winScreens[nScreenNum].dwHeight, (int*)&g_winScreens[nScreenNum].dwDepth)) { + /* I see no height, width, and depth here */ ErrorF ("Invalid screen configuration %s\n", argv[i+2]); UseMsg (); return 0; @@ -186,8 +194,8 @@ ddxProcessArgument (int argc, char *argv[], int i) } /* - Look for the '-blackpixel n' argument - */ + * Look for the '-blackpixel n' argument + */ if (strcmp (argv[i], "-blackpixel") == 0) /* -blackpixel n */ { Pixel pix; @@ -200,24 +208,29 @@ ddxProcessArgument (int argc, char *argv[], int i) } pix = atoi (argv[i]); + + /* Is this parameter attached to a screen or global? */ if (-1 == g_nLastScreen) { - int i; - for (i = 0; i < MAXSCREENS; i++) + int j; + + /* Parameter is for all screens */ + for (j = 0; j < MAXSCREENS; j++) { - g_winScreens[i].pixelBlack = pix; + g_winScreens[j].pixelBlack = pix; } } else { + /* Parameter is for a single screen */ g_winScreens[g_nLastScreen].pixelBlack = pix; } return 2; } /* - Look for the '-whitepixel n' argument - */ + * Look for the '-whitepixel n' argument + */ if (strcmp (argv[i], "-whitepixel") == 0) /* -whitepixel n */ { Pixel pix; @@ -230,24 +243,29 @@ ddxProcessArgument (int argc, char *argv[], int i) } pix = atoi (argv[i]); + + /* Is this parameter attached to a screen or global? */ if (-1 == g_nLastScreen) { - int i; - for (i = 0; i < MAXSCREENS; i++) + int j; + + /* Parameter is for all screens */ + for (j = 0; j < MAXSCREENS; j++) { - g_winScreens[i].pixelWhite = pix; + g_winScreens[j].pixelWhite = pix; } } else { + /* Parameter is for a single screen */ g_winScreens[g_nLastScreen].pixelWhite = pix; } return 2; } /* - Look for the '-linebias n' argument - */ + * Look for the '-linebias n' argument + */ if (strcmp (argv[i], "-linebias") == 0) { unsigned int uiLinebias; @@ -261,25 +279,28 @@ ddxProcessArgument (int argc, char *argv[], int i) uiLinebias = atoi (argv[i]); + /* Is this parameter attached to a screen or global? */ if (-1 == g_nLastScreen) { - int i; + int j; - for (i = 0; i < MAXSCREENS; i++) + /* Parameter is for all screens */ + for (j = 0; j < MAXSCREENS; j++) { - g_winScreens[i].dwLineBias = uiLinebias; + g_winScreens[j].dwLineBias = uiLinebias; } } else { + /* Parameter is for a single screen */ g_winScreens[g_nLastScreen].dwLineBias = uiLinebias; } return 2; } /* - Look for the '-engine n' argument - */ + * Look for the '-engine n' argument + */ if (strcmp (argv[i], "-engine") == 0) { DWORD dwEngine = 0; @@ -308,12 +329,12 @@ ddxProcessArgument (int argc, char *argv[], int i) /* Is this parameter attached to a screen or global? */ if (-1 == g_nLastScreen) { - int i; + int j; /* Parameter is for all screens */ - for (i = 0; i < MAXSCREENS; i++) + for (j = 0; j < MAXSCREENS; j++) { - g_winScreens[i].dwEnginePreferred = dwEngine; + g_winScreens[j].dwEnginePreferred = dwEngine; } } else @@ -326,18 +347,20 @@ ddxProcessArgument (int argc, char *argv[], int i) return 2; } - /* Look for the '-fullscreen' argument */ + /* + * Look for the '-fullscreen' argument + */ if (strcmp(argv[i], "-fullscreen") == 0) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_nLastScreen) { - int i; + int j; /* Parameter is for all screens */ - for (i = 0; i < MAXSCREENS; i++) + for (j = 0; j < MAXSCREENS; j++) { - g_winScreens[i].fFullScreen = TRUE; + g_winScreens[j].fFullScreen = TRUE; } } else @@ -350,6 +373,54 @@ ddxProcessArgument (int argc, char *argv[], int i) return 1; } + /* + * Look for the '-emulate3buttons' argument + */ + if (strcmp(argv[i], "-emulate3buttons") == 0) + { + int iArgsProcessed = 1; + int iE3BTimeout = WIN_DEFAULT_E3B_TIME; + + /* Grab the optional timeout value */ + if (i + 1 < argc + && 1 == sscanf (argv[i + 1], "%d", + &iE3BTimeout)) + { + /* Indicate that we have processed the next argument */ + iArgsProcessed++; + } + else + { + /* + * sscanf () won't modify iE3BTimeout if it doesn't find + * the specified format; however, I want to be explicit + * about setting the default timeout in such cases to + * prevent some programs (me) from getting confused. + */ + iE3BTimeout = WIN_DEFAULT_E3B_TIME; + } + + /* Is this parameter attached to a screen or is it global? */ + if (-1 == g_nLastScreen) + { + int j; + + /* Parameter is for all screens */ + for (j = 0; j < MAXSCREENS; j++) + { + g_winScreens[j].iE3BTimeout = iE3BTimeout; + } + } + else + { + /* Parameter is for a single screen */ + g_winScreens[g_nLastScreen].iE3BTimeout = TRUE; + } + + /* Indicate that we have processed this argument */ + return iArgsProcessed; + } + return 0; } diff --git a/xc/programs/Xserver/hw/xwin/win.h b/xc/programs/Xserver/hw/xwin/win.h index 691d8b908..0a380cb1e 100644 --- a/xc/programs/Xserver/hw/xwin/win.h +++ b/xc/programs/Xserver/hw/xwin/win.h @@ -30,7 +30,7 @@ * Peter Busch * Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/win.h,v 1.3 2001/04/19 12:56:03 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/win.h,v 1.6 2001/05/08 08:14:09 alanh Exp $ */ #ifndef _WIN_H_ #define _WIN_H_ @@ -72,9 +72,6 @@ #define DEBUGPROC_MSG #endif -/* We use xor this macro for detecting toggle key state changes */ -#define WIN_XOR(a,b) ((!(a) && (b)) || ((a) && !(b))) - /* Constant strings */ #define WINDOW_CLASS "cygwin/xfree86" #define WINDOW_TITLE "Cygwin/XFree86" @@ -89,7 +86,10 @@ #define WIN_DEFAULT_WHITEPIXEL 255 #define WIN_DEFAULT_BLACKPIXEL 0 #define WIN_DEFAULT_LINEBIAS 0 +#define WIN_DEFAULT_E3B_TIME 50 /* milliseconds */ +#define WIN_E3B_OFF -1 +#define WIN_E3B_TIMER_ID 1 #define WIN_FD_INVALID -1 #define WIN_SERVER_NONE 0x0L /* 0 */ @@ -104,6 +104,10 @@ #define KanaMapIndex Mod4MapIndex #define ScrollLockMapIndex Mod5MapIndex +#define WIN_24BPP_MASK_RED 0x00FF0000 +#define WIN_24BPP_MASK_GREEN 0x0000FF00 +#define WIN_24BPP_MASK_BLUE 0x000000FF + /* * We need symbols for the scan codes of keys. */ @@ -155,6 +159,7 @@ #include "fb.h" #ifdef RENDER +#include "mipict.h" #include "picturestr.h" #endif @@ -193,6 +198,10 @@ typedef void (*winCreateBoundingWindowProcPtr)(ScreenPtr); typedef Bool (*winFinishScreenInitProcPtr)(int, ScreenPtr, int, char **); +typedef Bool (*winBltExposedRegionsProcPtr)(ScreenPtr); + +typedef Bool (*winActivateAppProcPtr)(ScreenPtr); + /* * Privates structures */ @@ -228,6 +237,7 @@ typedef struct DWORD dwEnginePreferred; DWORD dwEnginesSupported; Bool fFullScreen; + int iE3BTimeout; } winScreenInfo, *winScreenInfoPtr; typedef struct @@ -250,6 +260,10 @@ typedef struct DWORD dwModeKeyStates; + /* 3 button emulation variables */ + int iE3BCachedPress; + Bool fE3BFakeButton2Sent; + /* Privates used by shadow fb GDI server */ HBITMAP hbmpShadow; HDC hdcScreen; @@ -286,6 +300,8 @@ typedef struct winAdjustVideoModeProcPtr pwinAdjustVideoMode; winCreateBoundingWindowProcPtr pwinCreateBoundingWindow; winFinishScreenInitProcPtr pwinFinishScreenInit; + winBltExposedRegionsProcPtr pwinBltExposedRegions; + winActivateAppProcPtr pwinActivateApp; } winPrivScreenRec, *winPrivScreenPtr; extern ColormapPtr g_cmInstalledMaps[]; @@ -296,6 +312,7 @@ extern DWORD g_dwEvents; extern int g_fdMessageQueue; extern int g_winScreenPrivateIndex; extern unsigned long g_winGeneration; +extern CARD32 g_c32LastInputEventTime; /* * Screen privates macros @@ -315,13 +332,17 @@ extern unsigned long g_winGeneration; (_pWin)->devPrivates[winWindowPrivateIndex].ptr) /* - FIXME: Windows mouse wheel macro; should be in Cygwin w32api headers -*/ + * FIXME: Windows mouse wheel macro; should be in Cygwin w32api headers. + * Has been fixed after May 05, 2001. Remove this section after the + * fixed headers are in distribution. + */ #ifndef GET_WHEEL_DELTA_WPARAM #define GET_WHEEL_DELTA_WPARAM(wparam) ((short)HIWORD (wparam)) #endif /* GET_WHEEL_DELTA_WPARAM */ -/* BEGIN DDX and DIX Function Prototypes */ +/* + * BEGIN DDX and DIX Function Prototypes + */ /* * InitOutput.c @@ -474,6 +495,7 @@ winGetSpansNativeGDI (DrawablePtr pDrawable, /* * winkeybd.c */ + void winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode); @@ -499,6 +521,9 @@ winStoreModeKeyStates (ScreenPtr pScreen); void winRestoreModeKeyStates (ScreenPtr pScreen); +Bool +winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam); + /* * winmisc.c */ @@ -523,6 +548,17 @@ winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl); int winMouseProc (DeviceIntPtr pDeviceInt, int iState); +int +winMouseWheel (ScreenPtr pScreen, int iDeltaZ); + +void +winMouseButtonsSendEvent (int iEventType, int iButton); + +int +winMouseButtonsHandle (ScreenPtr pScreen, + int iEventType, int iButton, + WPARAM wParam); + /* * winpfbddd.c */ @@ -540,6 +576,9 @@ Bool winAdjustVideoModePrimaryDD (ScreenPtr pScreen); Bool +winActivateAppPrimaryDD (ScreenPtr pScreen); + +Bool winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen); /* @@ -669,6 +708,12 @@ Bool winAdjustVideoModeShadowDD (ScreenPtr pScreen); Bool +winBltExposedRegionsShadowDD (ScreenPtr pScreen); + +Bool +winActivateAppShadowDD (ScreenPtr pScreen); + +Bool winSetEngineFunctionsShadowDD (ScreenPtr pScreen); /* @@ -707,6 +752,12 @@ Bool winAdjustVideoModeShadowDDNL (ScreenPtr pScreen); Bool +winBltExposedRegionsShadowDDNL (ScreenPtr pScreen); + +Bool +winActivateAppShadowDDNL (ScreenPtr pScreen); + +Bool winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen); /* @@ -745,6 +796,9 @@ Bool winAdjustVideoModeShadowGDI (ScreenPtr pScreen); Bool +winActivateAppShadowGDI (ScreenPtr pScreen); + +Bool winSetEngineFunctionsShadowGDI (ScreenPtr pScreen); /* @@ -794,7 +848,9 @@ winWindowProc (HWND hWnd, UINT message, void winRestoreModeKeyStates (ScreenPtr pScreen); -/* END DDX and DIX Function Prototypes */ +/* + * END DDX and DIX Function Prototypes + */ #endif /* _WIN_H_ */ diff --git a/xc/programs/Xserver/hw/xwin/winallpriv.c b/xc/programs/Xserver/hw/xwin/winallpriv.c index f0c033862..bc8700486 100644 --- a/xc/programs/Xserver/hw/xwin/winallpriv.c +++ b/xc/programs/Xserver/hw/xwin/winallpriv.c @@ -28,7 +28,7 @@ * Authors: Keith Packard, MIT X Consortium * Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/winallpriv.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/winallpriv.c,v 1.3 2001/05/14 16:52:33 alanh Exp $ */ #include "win.h" @@ -49,7 +49,10 @@ winAllocatePrivates (ScreenPtr pScreen) /* Allocate memory for our private structure */ pScreenPriv = (winPrivScreenPtr) xalloc (sizeof (*pScreenPriv)); if (!pScreenPriv) - return FALSE; + { + ErrorF ("winAllocatePrivates () - xalloc () failed\n"); + return FALSE; + } /* Initialize the memory of the private structure */ ZeroMemory (pScreenPriv, sizeof (winPrivScreenRec)); diff --git a/xc/programs/Xserver/hw/xwin/wincmap.c b/xc/programs/Xserver/hw/xwin/wincmap.c index b59da898d..bb728c595 100644 --- a/xc/programs/Xserver/hw/xwin/wincmap.c +++ b/xc/programs/Xserver/hw/xwin/wincmap.c @@ -30,7 +30,7 @@ * Peter Busch * Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/wincmap.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/wincmap.c,v 1.4 2001/05/14 16:52:33 alanh Exp $ */ #include "win.h" @@ -38,7 +38,8 @@ int winListInstalledColormapsNativeGDI (ScreenPtr pScreen, Colormap *pmaps) { - /* By the time we are processing requests, we can guarantee that there + /* + * By the time we are processing requests, we can guarantee that there * is always a colormap installed */ @@ -68,7 +69,9 @@ void winStoreColorsNativeGDI (ColormapPtr pmap, int ndef, xColorItem *pdefs) { ErrorF ("winStoreColors ()\n"); - //miStoreColors (pmap, ndef, pdefs); +#if 0 + miStoreColors (pmap, ndef, pdefs); +#endif } /* See Porting Layer Definition - p. 30 */ @@ -88,7 +91,10 @@ Bool winInitializeColormapNativeGDI (ColormapPtr pmap) { ErrorF ("\nwinInitializeColormap ()\n"); +#if 0 return miInitializeColormap (pmap); +#endif + return TRUE; } int @@ -102,61 +108,66 @@ winExpandDirectColorsNativeGDI (ColormapPtr pmap, int ndef, Bool winCreateDefColormapNativeGDI (ScreenPtr pScreen) { + winScreenPriv(pScreen); + Bool fReturn = TRUE; VisualPtr pVisual; ColormapPtr pcmap = NULL; - HBITMAP hbmp; - HDC hdc = GetDC (NULL); - BITMAPINFO *pbmi = xalloc (sizeof (BITMAPINFOHEADER) - + 256 * sizeof (RGBQUAD)); int i; Pixel pixel; unsigned short nRed, nGreen, nBlue; - - ErrorF ("winCreateDefColormap () - sizeof (*pbmi): %d\n", - sizeof (*pbmi)); + UINT uiSystemPaletteEntries; + PALETTEENTRY *ppeColors = NULL; /* Find the root visual */ for (pVisual = pScreen->visuals; pVisual->vid != pScreen->rootVisual; pVisual++); - hbmp = CreateCompatibleBitmap (hdc, 1, 1); + /* + * AllocNone for Dynamic visual classes, + * AllocAll for non-Dynamic visual classes. + */ - /* Allocate a colormap */ + /* Allocate an X colormap, owned by client 0 */ if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &pcmap, AllocNone, 0) != Success) - return FALSE; + { + ErrorF ("winCreateDefColormapNativeGDI () - CreateColormap failed\n"); + return FALSE; + } if (pcmap == NULL) { - FatalError ("winCreateDefColormap () - Colormap could not be created\n"); + ErrorF ("winCreateDefColormap () - Colormap could not be created\n"); + return FALSE; } - ErrorF ("winCreateDefColormap () - Created a colormap\n"); - /* Intialize memory of bitmap info header */ - ZeroMemory (pbmi, sizeof (*pbmi)); - pbmi->bmiHeader.biSize = sizeof (BITMAPINFOHEADER); - - /* Get the screen bitmap format and colormap */ - GetDIBits (hdc, hbmp, - 0, 0, - NULL, - pbmi, - DIB_RGB_COLORS); - - ErrorF ("winCreateDefColormap () - Got screen colormap %d %d\n", - pbmi->bmiHeader.biClrUsed, pbmi->bmiHeader.biClrImportant); + /* Get the number of entries in the system palette */ + uiSystemPaletteEntries = GetSystemPaletteEntries (pScreenPriv->hdcScreen, + 0, 0, NULL); + ErrorF ("winCreateDefColormap () - uiSystemPaletteEntries %d\n", + uiSystemPaletteEntries); + + /* Allocate palette entries structure */ + ppeColors = xalloc (uiSystemPaletteEntries * sizeof (PALETTEENTRY)); + + /* Get system palette entries */ + GetSystemPaletteEntries (pScreenPriv->hdcScreen, + 0, uiSystemPaletteEntries, ppeColors); - /* Allocate an X colormap entry for each of Windows' colormap entries */ - for (i = 0; i < 8; ++i) + /* Allocate an X colormap entry for every system palette entry */ + for (i = 0; i < uiSystemPaletteEntries; ++i) { pixel = i; - nRed = pbmi->bmiColors[i].rgbRed; - nGreen = pbmi->bmiColors[i].rgbGreen; - nBlue = pbmi->bmiColors[i].rgbBlue; + /* Extract the color values for current palette entry */ + nRed = ppeColors[i].peRed << 8; + nGreen = ppeColors[i].peGreen << 8; + nBlue = ppeColors[i].peBlue << 8; - ErrorF ("winCreateDefColormap () - Allocating a color: %d; %d %d %d\n", +#if 0 + ErrorF ("winCreateDefColormap () - Allocating a color: %d; "\ + "%d %d %d ", pixel, nRed, nGreen, nBlue); if (AllocColor (pcmap, &nRed, @@ -165,16 +176,31 @@ winCreateDefColormapNativeGDI (ScreenPtr pScreen) &pixel, 0) != Success) break; +#endif + + pcmap->red[i].co.local.red = nRed; + pcmap->red[i].co.local.green = nGreen; + pcmap->red[i].co.local.blue = nBlue; } - /* Free memory */ - ReleaseDC (NULL, hdc); - DeleteObject (hbmp); - xfree (pbmi); + if (uiSystemPaletteEntries == 0) + { + fbInitializeColormap (pcmap); + } + else + { + /* Set the black and white pixel indices */ + pScreen->whitePixel = uiSystemPaletteEntries - 1; + pScreen->blackPixel = 0; + } - ErrorF ("winCreateDefColormap () - Returning\n"); + /* Free colormap */ + free (ppeColors); - return TRUE; + /* Install the created colormap */ + (*pScreen->InstallColormap)(pcmap); + + return fReturn; } void @@ -221,10 +247,11 @@ winInitVisualsNativeGDI (ScreenPtr pScreen) pbmi->bmiHeader.biSize = sizeof (BITMAPINFOHEADER); /* Call GetDIBits for the first time; doesn't do much */ - /* NOTE: This doesn't actually return the bits, because our - data pointer is NULL; therefore, we don't have to free - memory later. - */ + /* + * NOTE: This doesn't actually return the bits, because our + * data pointer is NULL; therefore, we don't have to free + * memory later. + */ GetDIBits (hdc, hbmp, 0, 0, NULL, diff --git a/xc/programs/Xserver/hw/xwin/wincursor.c b/xc/programs/Xserver/hw/xwin/wincursor.c index f6baf40de..ed04f4b81 100644 --- a/xc/programs/Xserver/hw/xwin/wincursor.c +++ b/xc/programs/Xserver/hw/xwin/wincursor.c @@ -30,7 +30,7 @@ * Peter Busch * Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/wincursor.c,v 1.1 2001/04/05 20:13:49 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/wincursor.c,v 1.2 2001/05/14 16:52:33 alanh Exp $ */ #include "win.h" @@ -44,6 +44,7 @@ miPointerScreenFuncRec g_winPointerCursorFuncs = Bool winCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y) { + ErrorF ("winCursorOffScreen () - hmm...\n"); return FALSE; } diff --git a/xc/programs/Xserver/hw/xwin/winkeybd.c b/xc/programs/Xserver/hw/xwin/winkeybd.c index 5df741748..05b5bf5d6 100644 --- a/xc/programs/Xserver/hw/xwin/winkeybd.c +++ b/xc/programs/Xserver/hw/xwin/winkeybd.c @@ -30,7 +30,7 @@ * Peter Busch * Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/winkeybd.c,v 1.1 2001/04/18 17:14:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/winkeybd.c,v 1.2 2001/05/02 00:45:26 alanh Exp $ */ #include "win.h" @@ -66,9 +66,9 @@ winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode) } /* - Handle extended keys that weren't handled correctly as - non-extended keys. - */ + * Handle extended keys that weren't handled correctly as + * non-extended keys. + */ if (HIWORD (lParam) & KF_EXTENDED) { switch (wParam) @@ -235,7 +235,12 @@ void winKeybdBell (int iPercent, DeviceIntPtr pDeviceInt, pointer pCtrl, int iClass) { - + /* + * Window 95 and later ignore the parameters to Beep. + * Systems with sound cards will play the default sound event; + * systems without sound cards will play the standard system beep. + */ + Beep (0, 0); } /* Change some keyboard configuration parameters */ @@ -356,9 +361,9 @@ winInitializeModeKeyStates (void) } /* - We have to store the last state of each mode - key before we lose the keyboard focus. -*/ + * We have to store the last state of each mode + * key before we lose the keyboard focus. + */ void winStoreModeKeyStates (ScreenPtr pScreen) { @@ -381,10 +386,10 @@ winStoreModeKeyStates (ScreenPtr pScreen) } /* - Upon regaining the keyboard focus we must - resynchronize our internal mode key states - with the actual state of the keys. -*/ + * Upon regaining the keyboard focus we must + * resynchronize our internal mode key states + * with the actual state of the keys. + */ void winRestoreModeKeyStates (ScreenPtr pScreen) { @@ -393,8 +398,8 @@ winRestoreModeKeyStates (ScreenPtr pScreen) ZeroMemory (&xCurrentEvent, sizeof (xCurrentEvent)); /* Has the key state changed? */ - if (WIN_XOR(pScreenPriv->dwModeKeyStates & NumLockMask, - GetKeyState (VK_NUMLOCK) & 0x0001)) + if ((pScreenPriv->dwModeKeyStates & NumLockMask) + ^ (GetKeyState (VK_NUMLOCK) & 0x0001)) { xCurrentEvent.u.u.detail = KEY_NumLock + MIN_KEYCODE; @@ -410,8 +415,8 @@ winRestoreModeKeyStates (ScreenPtr pScreen) } /* Has the key state changed? */ - if (WIN_XOR(pScreenPriv->dwModeKeyStates & LockMask, - GetKeyState (VK_CAPITAL) & 0x0001)) + if ((pScreenPriv->dwModeKeyStates & LockMask) + ^ (GetKeyState (VK_CAPITAL) & 0x0001)) { xCurrentEvent.u.u.detail = KEY_CapsLock + MIN_KEYCODE; @@ -427,8 +432,8 @@ winRestoreModeKeyStates (ScreenPtr pScreen) } /* Has the key state changed? */ - if (WIN_XOR(pScreenPriv->dwModeKeyStates & ScrollLockMask, - GetKeyState (VK_SCROLL) & 0x0001)) + if ((pScreenPriv->dwModeKeyStates & ScrollLockMask) + ^ (GetKeyState (VK_SCROLL) & 0x0001)) { xCurrentEvent.u.u.detail = KEY_ScrollLock + MIN_KEYCODE; @@ -444,8 +449,8 @@ winRestoreModeKeyStates (ScreenPtr pScreen) } /* Has the key state changed? */ - if (WIN_XOR(pScreenPriv->dwModeKeyStates & KanaMask, - GetKeyState (VK_KANA) & 0x0001)) + if ((pScreenPriv->dwModeKeyStates & KanaMask) + ^ (GetKeyState (VK_KANA) & 0x0001)) { xCurrentEvent.u.u.detail = KEY_HKTG + MIN_KEYCODE; @@ -461,5 +466,86 @@ winRestoreModeKeyStates (ScreenPtr pScreen) } } +/* + * Look for the lovely fake Control_L press/release generated by Windows + * when AltGr is pressed/released on a non-U.S. keyboard. + */ +Bool +winIsFakeCtrl_L (UINT message, WPARAM wParam, LPARAM lParam) +{ + MSG msgNext; + LONG lTime; + Bool fReturn; + + /* + * Fake Ctrl_L presses will be followed by an Alt_R keypress + * with the same timestamp as the Ctrl_L press. + */ + if (message == WM_KEYDOWN + && wParam == VK_CONTROL + && (HIWORD (lParam) & KF_EXTENDED) == 0) + { + /* Got a Ctrl_L press */ + + /* Get time of current message */ + lTime = GetMessageTime (); + + /* Look for fake Ctrl_L preceeding an Alt_R press. */ + fReturn = PeekMessage (&msgNext, NULL, + WM_KEYDOWN, WM_KEYDOWN, + PM_NOREMOVE); + + /* Is next press an Alt_R with the same timestamp? */ + if (fReturn && msgNext.wParam == VK_MENU + && msgNext.time == lTime + && (HIWORD (msgNext.lParam) & KF_EXTENDED)) + { + /* + * Next key press is Alt_R with same timestamp as current + * Ctrl_L message. Therefore, this Ctrl_L press is a fake + * event, so discard it. + */ + return TRUE; + } + } + + /* + * Fake Ctrl_L releases will be followed by an Alt_R release + * with the same timestamp as the Ctrl_L press. + */ + if ((message == WM_KEYUP || message == WM_SYSKEYUP) + && wParam == VK_CONTROL + && (HIWORD (lParam) & KF_EXTENDED) == 0) + { + /* Got a Ctrl_L release */ + + /* Get time of current message */ + lTime = GetMessageTime (); + + /* Look for fake Ctrl_L release preceeding an Alt_R release. */ + fReturn = PeekMessage (&msgNext, NULL, + WM_KEYUP, WM_SYSKEYUP, + PM_NOREMOVE); + + /* Is next press an Alt_R with the same timestamp? */ + if (fReturn + && (msgNext.message == WM_KEYUP + || msgNext.message == WM_SYSKEYUP) + && msgNext.wParam == VK_MENU + && msgNext.time == lTime + && (HIWORD (msgNext.lParam) & KF_EXTENDED)) + { + /* + * Next key release is Alt_R with same timestamp as current + * Ctrl_L message. Therefore, this Ctrl_L release is a fake + * event, so discard it. + */ + return TRUE; + } + } + + /* Not a fake control left press/release */ + return FALSE; +} diff --git a/xc/programs/Xserver/hw/xwin/winmisc.c b/xc/programs/Xserver/hw/xwin/winmisc.c index 320458d5d..f730a3ce4 100644 --- a/xc/programs/Xserver/hw/xwin/winmisc.c +++ b/xc/programs/Xserver/hw/xwin/winmisc.c @@ -27,23 +27,25 @@ * * Authors: Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/winmisc.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/winmisc.c,v 1.3 2001/05/02 00:45:26 alanh Exp $ */ #include "win.h" /* See Porting Layer Definition - p. 33 */ -/* Called by clients, returns the best size for a cursor, tile, or - stipple, specified by class (sometimes called kind) */ +/* + * Called by clients, returns the best size for a cursor, tile, or + * stipple, specified by class (sometimes called kind) + */ void winQueryBestSizeNativeGDI (int class, unsigned short *pWidth, unsigned short *pHeight, ScreenPtr pScreen) { - fprintf (stderr, "winQueryBestSize()\n"); + ErrorF ("winQueryBestSize()\n"); } /* - Count the number of one bits in a color mask. -*/ + * Count the number of one bits in a color mask. + */ CARD8 winCountBits (DWORD dw) { diff --git a/xc/programs/Xserver/hw/xwin/winmouse.c b/xc/programs/Xserver/hw/xwin/winmouse.c index a75e3bb5e..f448f6111 100644 --- a/xc/programs/Xserver/hw/xwin/winmouse.c +++ b/xc/programs/Xserver/hw/xwin/winmouse.c @@ -30,17 +30,17 @@ * Peter Busch * Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/winmouse.c,v 1.1 2001/04/18 17:14:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/winmouse.c,v 1.3 2001/05/08 08:14:09 alanh Exp $ */ #include "win.h" void winMouseCtrl (DeviceIntPtr pDevice, PtrCtrl *pCtrl) { - } -/* See Porting Layer Definition - p. 18 +/* + * See Porting Layer Definition - p. 18 * This is known as a DeviceProc */ int @@ -76,3 +76,213 @@ winMouseProc (DeviceIntPtr pDeviceInt, int iState) } return Success; } + +/* Handle the mouse wheel */ +int +winMouseWheel (ScreenPtr pScreen, int iDeltaZ) +{ + winScreenPriv(pScreen); + xEvent xCurrentEvent; + + /* Button4 = WheelUp */ + /* Button5 = WheelDown */ + + /* Do we have any previous delta stored? */ + if ((pScreenPriv->iDeltaZ > 0 + && iDeltaZ > 0) + || (pScreenPriv->iDeltaZ < 0 + && iDeltaZ < 0)) + { + /* Previous delta and of same sign as current delta */ + iDeltaZ += pScreenPriv->iDeltaZ; + pScreenPriv->iDeltaZ = 0; + } + else + { + /* + * Previous delta of different sign, or zero. + * We will set it to zero for either case, + * as blindly setting takes just as much time + * as checking, then setting if necessary :) + */ + pScreenPriv->iDeltaZ = 0; + } + + /* + * Only process this message if the wheel has moved further than + * WHEEL_DELTA + */ + if (iDeltaZ >= WHEEL_DELTA || (-1 * iDeltaZ) >= WHEEL_DELTA) + { + pScreenPriv->iDeltaZ = 0; + + /* Figure out how many whole deltas of the wheel we have */ + iDeltaZ /= WHEEL_DELTA; + } + else + { + /* + * Wheel has not moved past WHEEL_DELTA threshold; + * we will store the wheel delta until the threshold + * has been reached. + */ + pScreenPriv->iDeltaZ = iDeltaZ; + return 0; + } + + /* Set the button to indicate up or down wheel delta */ + if (iDeltaZ > 0) + { + xCurrentEvent.u.u.detail = Button4; + } + else + { + xCurrentEvent.u.u.detail = Button5; + } + + /* + * Flip iDeltaZ to positive, if negative, + * because always need to generate a *positive* number of + * button clicks for the Z axis. + */ + if (iDeltaZ < 0) + { + iDeltaZ *= -1; + } + + /* Generate X input messages for each wheel delta we have seen */ + while (iDeltaZ--) + { + /* Push the wheel button */ + xCurrentEvent.u.u.type = ButtonPress; + xCurrentEvent.u.keyButtonPointer.time + = g_c32LastInputEventTime = GetTickCount (); + mieqEnqueue (&xCurrentEvent); + + /* Release the wheel button */ + xCurrentEvent.u.u.type = ButtonRelease; + xCurrentEvent.u.keyButtonPointer.time + = g_c32LastInputEventTime = GetTickCount (); + mieqEnqueue (&xCurrentEvent); + } + + return 0; +} + +/* + * Enqueue a mouse button event + */ +void +winMouseButtonsSendEvent (int iEventType, int iButton) +{ + xEvent xCurrentEvent; + + /* Load an xEvent and enqueue the event */ + xCurrentEvent.u.u.type = iEventType; + xCurrentEvent.u.u.detail = iButton; + xCurrentEvent.u.keyButtonPointer.time + = g_c32LastInputEventTime = GetTickCount (); + mieqEnqueue (&xCurrentEvent); +} + +/* + * Decide what to do with a Windows mouse message + */ +int +winMouseButtonsHandle (ScreenPtr pScreen, + int iEventType, int iButton, + WPARAM wParam) +{ + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + + /* Send button events right away if emulate 3 buttons is off */ + if (pScreenInfo->iE3BTimeout == WIN_E3B_OFF) + { + /* Emulate 3 buttons is off, send the button event */ + winMouseButtonsSendEvent (iEventType, iButton); + return 0; + } + + /* Emulate 3 buttons is on, let the fun begin */ + if (iEventType == ButtonPress + && pScreenPriv->iE3BCachedPress == 0 + && !pScreenPriv->fE3BFakeButton2Sent) + { + /* + * Button was pressed, no press is cached, + * and there is no fake button 2 release pending. + */ + + /* Store button press type */ + pScreenPriv->iE3BCachedPress = iButton; + + /* + * Set a timer to send this button press if the other button + * is not pressed within the timeout time. + */ + SetTimer (pScreenPriv->hwndScreen, + WIN_E3B_TIMER_ID, + pScreenInfo->iE3BTimeout, + NULL); + } + else if (iEventType == ButtonPress + && pScreenPriv->iE3BCachedPress != 0 + && pScreenPriv->iE3BCachedPress != iButton + && !pScreenPriv->fE3BFakeButton2Sent) + { + /* + * Button press is cached, other button was pressed, + * and there is no fake button 2 release pending. + */ + + /* Mouse button was cached and other button was pressed */ + KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID); + pScreenPriv->iE3BCachedPress = 0; + + /* Send fake middle button */ + winMouseButtonsSendEvent (ButtonPress, Button2); + + /* Indicate that a fake middle button event was sent */ + pScreenPriv->fE3BFakeButton2Sent = TRUE; + } + else if (iEventType == ButtonRelease + && pScreenPriv->iE3BCachedPress == iButton) + { + /* + * Cached button was released before timer ran out, + * and before the other mouse button was pressed. + */ + KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID); + pScreenPriv->iE3BCachedPress = 0; + + /* Send cached press, then send release */ + winMouseButtonsSendEvent (ButtonPress, iButton); + winMouseButtonsSendEvent (ButtonRelease, iButton); + } + else if (iEventType == ButtonRelease + && pScreenPriv->fE3BFakeButton2Sent + && !(wParam & MK_LBUTTON) + && !(wParam & MK_RBUTTON)) + { + /* + * Fake button 2 was sent and both mouse buttons have now been released + */ + pScreenPriv->fE3BFakeButton2Sent = FALSE; + + /* Send middle mouse button release */ + winMouseButtonsSendEvent (ButtonRelease, Button2); + } + else if (iEventType == ButtonRelease + && pScreenPriv->iE3BCachedPress == 0 + && !pScreenPriv->fE3BFakeButton2Sent) + { + /* + * Button was release, no button is cached, + * and there is no fake button 2 release is pending. + */ + winMouseButtonsSendEvent (ButtonRelease, iButton); + } + + return 0; +} diff --git a/xc/programs/Xserver/hw/xwin/winpfbdd.c b/xc/programs/Xserver/hw/xwin/winpfbdd.c index 44829b448..e020cb76f 100644 --- a/xc/programs/Xserver/hw/xwin/winpfbdd.c +++ b/xc/programs/Xserver/hw/xwin/winpfbdd.c @@ -30,13 +30,13 @@ * Peter Busch * Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/winpfbdd.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/winpfbdd.c,v 1.5 2001/05/14 16:52:33 alanh Exp $ */ #include "win.h" /* - Create a DirectDraw primary surface -*/ + * Create a DirectDraw primary surface + */ Bool winAllocateFBPrimaryDD (ScreenPtr pScreen) { @@ -122,13 +122,14 @@ winAllocateFBPrimaryDD (ScreenPtr pScreen) pddsdPrimary->dwSize = sizeof (*pddsdPrimary); /* Describe the offscreen surface to be created */ - /* NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface, - as drawing, locking, and unlocking take forever - with video memory surfaces. In addition, - video memory is a somewhat scarce resource, - so you shouldn't be allocating video memory when - you could use system memory instead. - */ + /* + * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface, + * as drawing, locking, and unlocking take forever + * with video memory surfaces. In addition, + * video memory is a somewhat scarce resource, + * so you shouldn't be allocating video memory when + * you have the option of using system memory instead. + */ ZeroMemory (&ddsd, sizeof (ddsd)); ddsd.dwSize = sizeof (ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; @@ -192,10 +193,10 @@ winAllocateFBPrimaryDD (ScreenPtr pScreen) } /* - Call the wrapped CloseScreen function. - - Free our resources and private structures. -*/ + * Call the wrapped CloseScreen function. + * + * Free our resources and private structures. + */ Bool winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen) { @@ -264,12 +265,12 @@ winCloseScreenPrimaryDD (int nIndex, ScreenPtr pScreen) } /* - Tell mi what sort of visuals we need. - - Generally we only need one visual, as our screen can only - handle one format at a time, I believe. You may want - to verify that last sentence. -*/ + * Tell mi what sort of visuals we need. + * + * Generally we only need one visual, as our screen can only + * handle one format at a time, I believe. You may want + * to verify that last sentence. + */ Bool winInitVisualsPrimaryDD (ScreenPtr pScreen) { @@ -311,12 +312,16 @@ winInitVisualsPrimaryDD (ScreenPtr pScreen) pScreenPriv->dwGreenMask, pScreenPriv->dwBlueMask)) { - FatalError ("winInitVisualsPrimaryDD () - miSetVisualTypesAndMasks failed\n"); + ErrorF ("winInitVisualsPrimaryDD () - " \ + "miSetVisualTypesAndMasks failed\n"); + return FALSE; } break; case 8: +#if CYGDEBUG ErrorF ("winInitVisuals () - Calling miSetVisualTypesAndMasks\n"); +#endif /* CYGDEBUG */ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, PseudoColorMask, pScreenPriv->dwBitsPerRGB, @@ -325,13 +330,19 @@ winInitVisualsPrimaryDD (ScreenPtr pScreen) pScreenPriv->dwGreenMask, pScreenPriv->dwBlueMask)) { - FatalError ("winInitVisualsPrimaryDD () - miSetVisualTypesAndMasks failed\n"); + ErrorF ("winInitVisualsPrimaryDD () - "\ + "miSetVisualTypesAndMasks failed\n"); + return FALSE; } - ErrorF ("winInitVisualsPrimaryDD () - Returned from miSetVisualTypesAndMasks\n"); +#if CYGDEBUG + ErrorF ("winInitVisualsPrimaryDD () - Returned from "\ + "miSetVisualTypesAndMasks\n"); +#endif /* CYGDEBUG */ break; default: - break; + ErrorF ("winInitVisualsPrimaryDD () - Unknown screen depth\n"); + return FALSE; } /* Set DPI info */ @@ -361,7 +372,10 @@ winAdjustVideoModePrimaryDD (ScreenPtr pScreen) /* We're in serious trouble if we can't get a DC */ hdc = GetDC (NULL); if (hdc == NULL) - return FALSE; + { + ErrorF ("winAdjustVideoModePrimaryDD () - GetDC failed\n"); + return FALSE; + } /* Query GDI for current display depth */ dwDepth = GetDeviceCaps (hdc, BITSPIXEL); @@ -378,7 +392,88 @@ winAdjustVideoModePrimaryDD (ScreenPtr pScreen) } /* Release our DC */ - ReleaseDC ((HDC) hdc, NULL); + ReleaseDC (NULL, hdc); + + return TRUE; +} + +Bool +winActivateAppPrimaryDD (ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + RECT rcSrc, rcClient; + HRESULT ddrval = DD_OK; + + /* + * We need to blit our offscreen fb to + * the screen when we are activated, and we need to point + * the fb code back to the primary surface memory. + */ + if (pScreenPriv != NULL + && pScreenPriv->pddsPrimary != NULL + && pScreenPriv->pddsOffscreen != NULL + && pScreenPriv->fActive) + { + /* We are activating */ + ddrval = IDirectDrawSurface_IsLost (pScreenPriv->pddsOffscreen); + if (ddrval == DD_OK) + { + IDirectDrawSurface_Unlock (pScreenPriv->pddsOffscreen, + NULL); + /* + * We don't check for an error from Unlock, because it + * doesn't matter if the Unlock failed. + */ + } + + /* Restore both surfaces, just cause I like it that way */ + IDirectDrawSurface_Restore (pScreenPriv->pddsOffscreen); + IDirectDrawSurface_Restore (pScreenPriv->pddsPrimary); + + /* Get client area in screen coords */ + GetClientRect (pScreenPriv->hwndScreen, &rcClient); + MapWindowPoints (pScreenPriv->hwndScreen, + HWND_DESKTOP, + (LPPOINT)&rcClient, 2); + + /* Setup a source rectangle */ + rcSrc.left = 0; + rcSrc.top = 0; + rcSrc.right = pScreenInfo->dwWidth; + rcSrc.bottom = pScreenInfo->dwHeight; + + ddrval = IDirectDrawSurface_Blt (pScreenPriv->pddsPrimary, + &rcClient, + pScreenPriv->pddsOffscreen, + &rcSrc, + DDBLT_WAIT, + NULL); + if (FAILED (ddrval)) + FatalError ("winWindowProc () - Failed blitting offscreen "\ + "surface to primary surface %08x\n", ddrval); + + /* Lock the primary surface */ + ddrval = IDirectDrawSurface_Lock (pScreenPriv->pddsPrimary, + &rcClient, + pScreenPriv->pddsdPrimary, + DDLOCK_WAIT, + NULL); + if (ddrval != DD_OK + || pScreenPriv->pddsdPrimary->lpSurface == NULL) + FatalError ("winWindowProc () - Could not lock "\ + "primary surface\n"); + + /* Notify FB of the new memory pointer */ + winUpdateFBPointer (pScreen, + pScreenPriv->pddsdPrimary->lpSurface); + + /* + * Register the Alt-Tab combo as a hotkey so we can copy + * the primary framebuffer before the display mode changes + */ + RegisterHotKey (pScreenPriv->hwndScreen, 1, MOD_ALT, 9); + } return TRUE; } @@ -404,6 +499,9 @@ winSetEngineFunctionsPrimaryDD (ScreenPtr pScreen) else pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed; pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB; + pScreenPriv->pwinBltExposedRegions + = (winBltExposedRegionsProcPtr) (void (*)())NoopDDA; + pScreenPriv->pwinActivateApp = winActivateAppPrimaryDD; return TRUE; } diff --git a/xc/programs/Xserver/hw/xwin/winpixmap.c b/xc/programs/Xserver/hw/xwin/winpixmap.c index 9b008a514..b753f3c1a 100644 --- a/xc/programs/Xserver/hw/xwin/winpixmap.c +++ b/xc/programs/Xserver/hw/xwin/winpixmap.c @@ -28,7 +28,7 @@ * Authors: drewry, september 1986 * Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/winpixmap.c,v 1.1 2001/04/05 20:13:50 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/winpixmap.c,v 1.3 2001/05/02 00:45:26 alanh Exp $ */ #include "win.h" @@ -116,7 +116,7 @@ winDestroyPixmapNativeGDI (PixmapPtr pPixmap) HBITMAP hBitmap; fprintf (stderr, "winDestroyPixmap - pPixmap->devPrivate.ptr: %08x\n", - pPixmap->devPrivate.ptr); + (UINT) pPixmap->devPrivate.ptr); /* Decrement reference count, and, if zero, free the pixmap */ --(pPixmap->refcnt); diff --git a/xc/programs/Xserver/hw/xwin/winscrinit.c b/xc/programs/Xserver/hw/xwin/winscrinit.c index b29de0ba4..32bc0de2f 100644 --- a/xc/programs/Xserver/hw/xwin/winscrinit.c +++ b/xc/programs/Xserver/hw/xwin/winscrinit.c @@ -30,7 +30,7 @@ * Peter Busch * Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/winscrinit.c,v 1.3 2001/04/22 19:52:36 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/winscrinit.c,v 1.7 2001/05/14 16:52:33 alanh Exp $ */ #include "win.h" @@ -65,18 +65,18 @@ winCreateBoundingWindowFullScreen (ScreenPtr pScreen) RegisterClass (&wc); /* Create the window */ - *phwnd = CreateWindowExA (WS_EX_TOPMOST, // Extended styles - WINDOW_CLASS, // Class name - WINDOW_TITLE, // Window name + *phwnd = CreateWindowExA (WS_EX_TOPMOST, /* Extended styles */ + WINDOW_CLASS, /* Class name */ + WINDOW_TITLE, /* Window name */ WS_POPUP, - 0, // Horizontal position - 0, // Vertical position - iWidth, // Right edge - iHeight, // Bottom edge - (HWND) NULL, // No parent or owner window - (HMENU) NULL, // No menu - GetModuleHandle (NULL),// Instance handle - pScreenPriv); // ScreenPrivates + 0, /* Horizontal position */ + 0, /* Vertical position */ + iWidth, /* Right edge */ + iHeight, /* Bottom edge */ + (HWND) NULL, /* No parent or owner window */ + (HMENU) NULL, /* No menu */ + GetModuleHandle (NULL),/* Instance handle */ + pScreenPriv); /* ScreenPrivates */ /* Branch on the server engine */ switch (pScreenInfo->dwEngine) @@ -151,13 +151,14 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) /* Trim window height to fit work area */ if (iHeight >= (rcWorkArea.bottom - rcWorkArea.top)) { - /* FIXME: Currently chopping 1 off the maximum height - to allow hidden start bars to pop up when the mouse - reaches the bottom of the screen. - - This only works if the start menu is at the bottom - of the screen. - */ + /* + * FIXME: Currently chopping 1 off the maximum height + * to allow hidden start bars to pop up when the mouse + * reaches the bottom of the screen. + * + * This only works if the start menu is at the bottom + * of the screen. + */ iHeight = rcWorkArea.bottom - rcWorkArea.top - 1; pScreenInfo->dwHeight = iHeight - 2 * GetSystemMetrics (SM_CYFIXEDFRAME) @@ -171,21 +172,21 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) #endif /* Create the window */ - *phwnd = CreateWindowExA (0, // Extended styles - WINDOW_CLASS, // Class name - WINDOW_TITLE, // Window name + *phwnd = CreateWindowExA (0, /* Extended styles */ + WINDOW_CLASS, /* Class name */ + WINDOW_TITLE, /* Window name */ WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU - | WS_MINIMIZEBOX, // Almost an OverlappedWindow - 0, // Horizontal position - 0, // Vertical position - iWidth, // Right edge - iHeight, // Bottom edge - (HWND) NULL, // No parent or owner window - (HMENU) NULL, // No menu - GetModuleHandle (NULL),// Instance handle - pScreenPriv); // ScreenPrivates + | WS_MINIMIZEBOX, /* Almost an OverlappedWindow */ + 0, /* Horizontal position */ + 0, /* Vertical position */ + iWidth, /* Right edge */ + iHeight, /* Bottom edge */ + (HWND) NULL, /* No parent or owner window */ + (HMENU) NULL, /* No menu */ + GetModuleHandle (NULL),/* Instance handle */ + pScreenPriv); /* ScreenPrivates */ /* Get the client area coordinates */ GetClientRect (*phwnd, &rcClient); @@ -204,10 +205,10 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) } /* - Determine what type of screen we are initializing - and call the appropriate procedure to intiailize - that type of screen. -*/ + * Determine what type of screen we are initializing + * and call the appropriate procedure to intiailize + * that type of screen. + */ Bool winScreenInit (int index, ScreenPtr pScreen, @@ -234,15 +235,24 @@ winScreenInit (int index, /* Determine which engine to use */ if (!winSetEngine (pScreen)) - return FALSE; + { + ErrorF ("winScreenInit () - winSetEngine () failed\n"); + return FALSE; + } /* Adjust the video mode for our engine type */ if (!(*pScreenPriv->pwinAdjustVideoMode) (pScreen)) - return FALSE; + { + ErrorF ("winScreenInit () - winAdjustVideoMode () failed\n"); + return FALSE; + } /* Call the engine dependent screen initialization procedure */ if (!((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv))) - return FALSE; + { + ErrorF ("winScreenInit () - winFinishScreenInit () failed\n"); + return FALSE; + } return TRUE; } @@ -293,7 +303,8 @@ winFinishScreenInitFB (int index, /* Setup a local variable to point to the framebuffer */ pbits = pScreenInfo->pfb; - + + /* Apparently we need this for the render extension */ miSetPixmapDepths (); /* Initialize the fb code */ @@ -337,11 +348,12 @@ winFinishScreenInitFB (int index, pScreenPriv->pwinShadowWindow); } - /* Register our block and wakeup handlers; these procedures - process messages in our Windows message queue; specifically, - they process mouse and keyboard input. - */ - RegisterBlockAndWakeupHandlers ((BlockHandlerProcPtr)NoopDDA, + /* + * Register our block and wakeup handlers; these procedures + * process messages in our Windows message queue; specifically, + * they process mouse and keyboard input. + */ + RegisterBlockAndWakeupHandlers (winBlockHandler, winWakeupHandler, pScreen); @@ -360,9 +372,10 @@ winFinishScreenInitFB (int index, return fReturn; } -/* Detect engines supported by current Windows version - DirectDraw version and hardware -*/ +/* + * Detect engines supported by current Windows version + * DirectDraw version and hardware + */ Bool winDetectSupportedEngines (ScreenPtr pScreen) { @@ -469,10 +482,11 @@ winDetectSupportedEngines (ScreenPtr pScreen) return TRUE; } -/* Set the engine type, depending on the engines - supported for this screen, and whether the user - suggested an engine type -*/ +/* + * Set the engine type, depending on the engines + * supported for this screen, and whether the user + * suggested an engine type + */ Bool winSetEngine (ScreenPtr pScreen) { @@ -578,14 +592,17 @@ winFinishScreenInitNativeGDI (int index, char *pbits = NULL; VisualPtr pVisuals = NULL; DepthPtr pDepths = NULL; - VisualID rootVisual; - int nVisuals, nDepths, nRootDepth = 0; + VisualID rootVisual = 0; + int nVisuals = 0, nDepths = 0, nRootDepth = 0; winPrivScreenPtr pScreenPriv = NULL; - fprintf (stderr, "winScreenInit ()\n"); + ErrorF ("winScreenInit ()\n"); if (!winAllocatePrivates (pScreen)) - return FALSE; + { + ErrorF ("winFinishScreenInitNativeGDI () winAllocatePrivates failed\n"); + return FALSE; + } /* Get a pointer to the privates structure that was allocated */ pScreenPriv = winGetScreenPriv (pScreen); @@ -728,9 +745,10 @@ winFinishScreenInitNativeGDI (int index, pScreen->MarkUnrealizedWindow = miMarkUnrealizedWindow; /* GC Handling Routines */ - /* All other GC handling routines are pointed to through - pScreen->gcfuncs - */ + /* + * All other GC handling routines are pointed to through + * pScreen->gcfuncs + */ /* See Porting Layer Definition pp. 43-46 */ pScreen->CreateGC = winCreateGCNativeGDI; @@ -771,7 +789,7 @@ winFinishScreenInitNativeGDI (int index, miPointerSetNewScreen (pScreenInfo->dwScreen, 0, 0); - fprintf (stderr, "winScreenInit () - calling miDCInitialize()\n"); + ErrorF ("winScreenInit () - calling miDCInitialize()\n"); if (!miDCInitialize (pScreen, &g_winPointerCursorFuncs)) { ErrorF ("winScreenInit () - miDCInitialize failed\n"); diff --git a/xc/programs/Xserver/hw/xwin/winshaddd.c b/xc/programs/Xserver/hw/xwin/winshaddd.c index dc4bed83a..9735d4e9f 100644 --- a/xc/programs/Xserver/hw/xwin/winshaddd.c +++ b/xc/programs/Xserver/hw/xwin/winshaddd.c @@ -30,17 +30,17 @@ * Peter Busch * Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/winshaddd.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/winshaddd.c,v 1.5 2001/05/14 16:52:33 alanh Exp $ */ #include "win.h" /* - Create a DirectDraw surface for the shadow framebuffer; also create - a primary surface object so we can blit to the display. - - Install a DirectDraw clipper on our primary surface object - that clips our blits to the unobscured client area of our display window. -*/ + * Create a DirectDraw surface for the shadow framebuffer; also create + * a primary surface object so we can blit to the display. + * + * Install a DirectDraw clipper on our primary surface object + * that clips our blits to the unobscured client area of our display window. + */ Bool winAllocateFBShadowDD (ScreenPtr pScreen) { @@ -157,6 +157,10 @@ winAllocateFBShadowDD (ScreenPtr pScreen) ErrorF ("winAllocateFBShadowDD () - Created primary\n"); #endif + /* + * Attach a clipper to the primary surface that will clip our blits to our + * display window. + */ ddrval = IDirectDrawSurface_SetClipper (pScreenPriv->pddsPrimary, pScreenPriv->pddcPrimary); if (FAILED (ddrval)) @@ -171,12 +175,12 @@ winAllocateFBShadowDD (ScreenPtr pScreen) /* Describe the shadow surface to be created */ /* NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface, - as drawing, locking, and unlocking take forever - with video memory surfaces. In addition, - video memory is a somewhat scarce resource, - so you shouldn't be allocating video memory when - you could use system memory instead. - */ + * as drawing, locking, and unlocking take forever + * with video memory surfaces. In addition, + * video memory is a somewhat scarce resource, + * so you shouldn't be allocating video memory when + * you have the option of using system memory instead. + */ ZeroMemory (&ddsd, sizeof (ddsd)); ddsd.dwSize = sizeof (ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; @@ -259,8 +263,8 @@ winAllocateFBShadowDD (ScreenPtr pScreen) } /* - Transfer the damaged regions of the shadow framebuffer to the display. -*/ + * Transfer the damaged regions of the shadow framebuffer to the display. + */ void winShadowUpdateDD (ScreenPtr pScreen, PixmapPtr pShadow, @@ -287,7 +291,7 @@ winShadowUpdateDD (ScreenPtr pScreen, if (FAILED (ddrval)) { ErrorF ("winShadowUpdateProcDD () - Unlock failed\n"); - return FALSE; + return; } /* Loop through all boxes in the damaged region */ @@ -326,7 +330,7 @@ winShadowUpdateDD (ScreenPtr pScreen, if (FAILED (ddrval)) { ErrorF ("winShadowUpdateProcDD () - Lock failed\n"); - return FALSE; + return; } /* Has our memory pointer changed? */ @@ -347,16 +351,16 @@ winShadowUpdateDD (ScreenPtr pScreen, { ErrorF ("winShadowUpdateProcDD () - Bits changed, could not "\ "notify fb.\n"); - return FALSE; + return; } } } /* - Return a pointer to some part of the shadow framebuffer. - - NOTE: I have not seen this function get called, yet. -*/ + * Return a pointer to some part of the shadow framebuffer. + * + * NOTE: I have not seen this function get called, yet. + */ void * winShadowSetWindowLinearDD (ScreenPtr pScreen, CARD32 dwRow, @@ -368,18 +372,20 @@ winShadowSetWindowLinearDD (ScreenPtr pScreen, winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; *pdwSize = pScreenInfo->dwPaddedWidth; - return (CARD8 *) pScreenInfo->pfb + dwRow * pScreenInfo->dwPaddedWidth + dwOffset; + + return (CARD8 *) pScreenInfo->pfb + + dwRow * pScreenInfo->dwPaddedWidth + dwOffset; } /* - Return a pointer to some part of the shadow framebuffer. - - NOTE: I have not seen this function get called, yet. - - We call winShadowSetWindowLinearDD because there could, - theoretically, be other framebuffer styles that - required a different calculation. -*/ + * Return a pointer to some part of the shadow framebuffer. + * + * NOTE: I have not seen this function get called, yet. + * + * We call winShadowSetWindowLinearDD because there could, + * theoretically, be other framebuffer styles that + * required a different calculation. + */ void * winShadowWindowDD (ScreenPtr pScreen, CARD32 row, @@ -391,10 +397,10 @@ winShadowWindowDD (ScreenPtr pScreen, } /* - Call the wrapped CloseScreen function. - - Free our resources and private structures. -*/ + * Call the wrapped CloseScreen function. + * + * Free our resources and private structures. + */ Bool winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen) { @@ -464,12 +470,12 @@ winCloseScreenShadowDD (int nIndex, ScreenPtr pScreen) } /* - Tell mi what sort of visuals we need. - - Generally we only need one visual, as our screen can only - handle one format at a time, I believe. You may want - to verify that last sentence. -*/ + * Tell mi what sort of visuals we need. + * + * Generally we only need one visual, as our screen can only + * handle one format at a time, I believe. You may want + * to verify that last sentence. + */ Bool winInitVisualsShadowDD (ScreenPtr pScreen) { @@ -518,7 +524,10 @@ winInitVisualsShadowDD (ScreenPtr pScreen) break; case 8: - ErrorF ("winInitVisuals () - Calling miSetVisualTypesAndMasks\n"); +#if CYGDEBUG + ErrorF ("winInitVisualsShadowDD () - Calling "\ + "miSetVisualTypesAndMasks\n"); +#endif /* CYGDEBUG */ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, PseudoColorMask, pScreenPriv->dwBitsPerRGB, @@ -531,11 +540,15 @@ winInitVisualsShadowDD (ScreenPtr pScreen) "failed\n"); return FALSE; } - ErrorF ("winInitVisualsShadowDD () - Returned from miSetVisualTypesAndMasks\n"); +#if CYGDEBUG + ErrorF ("winInitVisualsShadowDD () - Returned from "\ + "miSetVisualTypesAndMasks\n"); +#endif /* CYGDEBUG */ break; default: - break; + ErrorF ("winInitVisualsDD () - Unknown screen depth\n"); + return FALSE; } /* Set DPI info */ @@ -565,7 +578,10 @@ winAdjustVideoModeShadowDD (ScreenPtr pScreen) /* We're in serious trouble if we can't get a DC */ hdc = GetDC (NULL); if (hdc == NULL) - return FALSE; + { + ErrorF ("winAdjustVideoModeShadowDD () - GetDC () failed\n"); + return FALSE; + } /* Query GDI for current display depth */ dwDepth = GetDeviceCaps (hdc, BITSPIXEL); @@ -582,7 +598,96 @@ winAdjustVideoModeShadowDD (ScreenPtr pScreen) } /* Release our DC */ - ReleaseDC ((HDC) hdc, NULL); + ReleaseDC (NULL, hdc); + return TRUE; +} + +/* Blt exposed regions to the screen */ +Bool +winBltExposedRegionsShadowDD (ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + RECT rcClient, rcSrc; + HDC hdcUpdate = NULL; + PAINTSTRUCT ps; + HRESULT ddrval = DD_OK; + Bool fReturn = TRUE; + + /* BeginPaint gives us an hdc that clips to the invalidated region */ + hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps); + + /* Unlock the shadow surface, so we can blit */ + ddrval = IDirectDrawSurface_Unlock (pScreenPriv->pddsShadow, NULL); + if (FAILED (ddrval)) + { + fReturn = FALSE; + goto winBltExposedRegionsShadowDD_Exit; + } + + /* Get client area in screen coords */ + GetClientRect (pScreenPriv->hwndScreen, &rcClient); + MapWindowPoints (pScreenPriv->hwndScreen, + HWND_DESKTOP, + (LPPOINT)&rcClient, 2); + + /* Source can be enter shadow surface, as Blt should clip */ + rcSrc.left = 0; + rcSrc.top = 0; + rcSrc.right = pScreenInfo->dwWidth; + rcSrc.bottom = pScreenInfo->dwHeight; + + /* Our Blt should be clipped to the invalidated region */ + ddrval = IDirectDrawSurface_Blt (pScreenPriv->pddsPrimary, + &rcClient, + pScreenPriv->pddsShadow, + &rcSrc, + DDBLT_WAIT, + NULL); + + /* Relock the shadow surface */ + ddrval = IDirectDrawSurface_Lock (pScreenPriv->pddsShadow, + NULL, + pScreenPriv->pddsdShadow, + DDLOCK_WAIT, + NULL); + if (FAILED (ddrval)) + { + fReturn = FALSE; + goto winBltExposedRegionsShadowDD_Exit; + } + + /* Has our memory pointer changed? */ + if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface) + winUpdateFBPointer (pScreen, + pScreenPriv->pddsdShadow->lpSurface); + + winBltExposedRegionsShadowDD_Exit: + /* EndPaint frees the DC */ + if (hdcUpdate != NULL) + EndPaint (pScreenPriv->hwndScreen, &ps); + return fReturn; +} + +Bool +winActivateAppShadowDD (ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + + /* + * Do we have a surface? + * Are we active? + * Are we fullscreen? + */ + if (pScreenPriv != NULL + && pScreenPriv->pddsPrimary != NULL + && pScreenPriv->fActive + ) + { + /* Primary surface was lost, restore it */ + IDirectDrawSurface_Restore (pScreenPriv->pddsPrimary); + } + return TRUE; } @@ -605,6 +710,10 @@ winSetEngineFunctionsShadowDD (ScreenPtr pScreen) else pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed; pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB; + pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowDD; + pScreenPriv->pwinActivateApp = winActivateAppShadowDD; return TRUE; } + + diff --git a/xc/programs/Xserver/hw/xwin/winshadddnl.c b/xc/programs/Xserver/hw/xwin/winshadddnl.c index d78074654..3ef39252f 100644 --- a/xc/programs/Xserver/hw/xwin/winshadddnl.c +++ b/xc/programs/Xserver/hw/xwin/winshadddnl.c @@ -30,32 +30,34 @@ * Peter Busch * Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/winshadddnl.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/winshadddnl.c,v 1.5 2001/05/14 16:52:33 alanh Exp $ */ #include "win.h" -/* FIXME: Headers are broken, DEFINE_GUID doesn't work correctly, - so we have to redefine it here. -*/ +/* + * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly, + * so we have to redefine it here. + */ #ifdef DEFINE_GUID #undef DEFINE_GUID #define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) GUID_EXT const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} #endif /* DEFINE_GUID */ -/* FIXME: Headers are broken, IID_IDirectDraw4 has to be defined - here manually. Should be handled by ddraw.h -*/ +/* + * FIXME: Headers are broken, IID_IDirectDraw4 has to be defined + * here manually. Should be handled by ddraw.h + */ #ifndef IID_IDirectDraw4 DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 ); #endif /* IID_IDirectDraw4 */ /* - Create a DirectDraw surface for the shadow framebuffer; also create - a primary surface object so we can blit to the display. - - Install a DirectDraw clipper on our primary surface object - that clips our blits to the unobscured client area of our display window. -*/ + * Create a DirectDraw surface for the shadow framebuffer; also create + * a primary surface object so we can blit to the display. + * + * Install a DirectDraw clipper on our primary surface object + * that clips our blits to the unobscured client area of our display window. + */ Bool winAllocateFBShadowDDNL (ScreenPtr pScreen) { @@ -75,11 +77,15 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen) /* Allocate memory for our shadow surface */ lpSurface = xalloc (pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight); if (lpSurface == NULL) - FatalError ("winAllocateFBShadowDDNL () - Could not allocate bits\n"); - - /* Initialize the framebuffer memory so we don't get a - strange display at startup - */ + { + ErrorF ("winAllocateFBShadowDDNL () - Could not allocate bits\n"); + return FALSE; + } + + /* + * Initialize the framebuffer memory so we don't get a + * strange display at startup + */ ZeroMemory (lpSurface, pScreenInfo->dwPaddedWidth * pScreenInfo->dwHeight); /* Create a clipper */ @@ -113,7 +119,7 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen) /* Create a DirectDraw object, store the address at lpdd */ ddrval = DirectDrawCreate (NULL, - (void**) &pScreenPriv->pdd, + (LPDIRECTDRAW*) &pScreenPriv->pdd, NULL); if (ddrval != DD_OK) { @@ -186,7 +192,8 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen) /* Create the primary surface */ ddrval = IDirectDraw_CreateSurface (pScreenPriv->pdd4, - &ddsdPrimary, + (LPDDSURFACEDESC)&ddsdPrimary, + (LPDIRECTDRAWSURFACE*) &pScreenPriv->pddsPrimary4, NULL); if (FAILED (ddrval)) @@ -200,6 +207,7 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen) ErrorF ("winAllocateFBShadowDDNL () - Created primary\n"); #endif + /* Get primary surface's pixel format */ ZeroMemory (&ddpfPrimary, sizeof (ddpfPrimary)); ddpfPrimary.dwSize = sizeof (ddpfPrimary); ddrval = IDirectDrawSurface_GetPixelFormat (pScreenPriv->pddsPrimary4, @@ -236,13 +244,14 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen) #endif /* Describe the shadow surface to be created */ - /* NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface, - as drawing, locking, and unlocking take forever - with video memory surfaces. In addition, - video memory is a somewhat scarce resource, - so you shouldn't be allocating video memory when - you could use system memory instead. - */ + /* + * NOTE: Do not use a DDSCAPS_VIDEOMEMORY surface, + * as drawing, locking, and unlocking take forever + * with video memory surfaces. In addition, + * video memory is a somewhat scarce resource, + * so you shouldn't be allocating video memory when + * you have the option of using system memory instead. + */ ZeroMemory (&ddsdShadow, sizeof (ddsdShadow)); ddsdShadow.dwSize = sizeof (ddsdShadow); ddsdShadow.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH @@ -256,7 +265,8 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen) /* Create the shadow surface */ ddrval = IDirectDraw_CreateSurface (pScreenPriv->pdd4, - &ddsdShadow, + (LPDDSURFACEDESC)&ddsdShadow, + (LPDIRECTDRAWSURFACE*) &pScreenPriv->pddsShadow4, NULL); if (ddrval != DD_OK) @@ -291,8 +301,8 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen) } /* - Transfer the damaged regions of the shadow framebuffer to the display. -*/ + * Transfer the damaged regions of the shadow framebuffer to the display. + */ void winShadowUpdateDDNL (ScreenPtr pScreen, PixmapPtr pShadow, @@ -343,10 +353,10 @@ winShadowUpdateDDNL (ScreenPtr pScreen, } /* - Return a pointer to some part of the shadow framebuffer. - - NOTE: I have not seen this function get called, yet. -*/ + * Return a pointer to some part of the shadow framebuffer. + * + * NOTE: I have not seen this function get called, yet. + */ void * winShadowSetWindowLinearDDNL (ScreenPtr pScreen, CARD32 dwRow, @@ -358,19 +368,19 @@ winShadowSetWindowLinearDDNL (ScreenPtr pScreen, winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; *pdwSize = pScreenInfo->dwPaddedWidth; - return (CARD8 *) pScreenInfo->pfb + dwRow * pScreenInfo->dwPaddedWidth - + dwOffset; + return (CARD8 *) pScreenInfo->pfb + + dwRow * pScreenInfo->dwPaddedWidth + dwOffset; } /* - Return a pointer to some part of the shadow framebuffer. - - NOTE: I have not seen this function get called, yet. - - We call winShadowSetWindowLinearDD because there could, - theoretically, be other framebuffer styles that - required a different calculation. -*/ + * Return a pointer to some part of the shadow framebuffer. + * + * NOTE: I have not seen this function get called, yet. + * + * We call winShadowSetWindowLinearDD because there could, + * theoretically, be other framebuffer styles that + * required a different calculation. + */ void * winShadowWindowDDNL (ScreenPtr pScreen, CARD32 row, @@ -385,10 +395,10 @@ winShadowWindowDDNL (ScreenPtr pScreen, } /* - Call the wrapped CloseScreen function. - - Free our resources and private structures. -*/ + * Call the wrapped CloseScreen function. + * + * Free our resources and private structures. + */ Bool winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen) { @@ -463,12 +473,12 @@ winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen) } /* - Tell mi what sort of visuals we need. - - Generally we only need one visual, as our screen can only - handle one format at a time, I believe. You may want - to verify that last sentence. -*/ + * Tell mi what sort of visuals we need. + * + * Generally we only need one visual, as our screen can only + * handle one format at a time, I believe. You may want + * to verify that last sentence. + */ Bool winInitVisualsShadowDDNL (ScreenPtr pScreen) { @@ -518,8 +528,10 @@ winInitVisualsShadowDDNL (ScreenPtr pScreen) break; case 8: +#if CYGDEBUG ErrorF ("winInitVisualsShadowDDNL () - Calling "\ "miSetVisualTypesAndMasks\n"); +#endif /* CYGDEBUG */ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, PseudoColorMask, pScreenPriv->dwBitsPerRGB, @@ -535,7 +547,8 @@ winInitVisualsShadowDDNL (ScreenPtr pScreen) break; default: - break; + ErrorF ("winInitVisualsDDNL () - Unknown screen depth\n"); + return FALSE; } /* Set DPI info */ @@ -565,7 +578,10 @@ winAdjustVideoModeShadowDDNL (ScreenPtr pScreen) /* We're in serious trouble if we can't get a DC */ hdc = GetDC (NULL); if (hdc == NULL) - return FALSE; + { + ErrorF ("winAdjustVideoModeShadowDDNL () - GetDC () failed\n"); + return FALSE; + } /* Query GDI for current display depth */ dwDepth = GetDeviceCaps (hdc, BITSPIXEL); @@ -582,11 +598,72 @@ winAdjustVideoModeShadowDDNL (ScreenPtr pScreen) } /* Release our DC */ - ReleaseDC ((HDC) hdc, NULL); + ReleaseDC (NULL, hdc); return TRUE; } +/* Blt exposed regions to the screen */ +Bool +winBltExposedRegionsShadowDDNL (ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + RECT rcClient, rcSrc; + HDC hdcUpdate; + PAINTSTRUCT ps; + HRESULT ddrval = DD_OK; + + /* BeginPaint gives us an hdc that clips to the invalidated region */ + hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps); + + /* Get client area in screen coords */ + GetClientRect (pScreenPriv->hwndScreen, &rcClient); + MapWindowPoints (pScreenPriv->hwndScreen, + HWND_DESKTOP, + (LPPOINT)&rcClient, 2); + + /* Source can be enter shadow surface, as Blt should clip */ + rcSrc.left = 0; + rcSrc.top = 0; + rcSrc.right = pScreenInfo->dwWidth; + rcSrc.bottom = pScreenInfo->dwHeight; + + /* Our Blt should be clipped to the invalidated region */ + ddrval = IDirectDrawSurface_Blt (pScreenPriv->pddsPrimary4, + &rcClient, + pScreenPriv->pddsShadow4, + &rcSrc, + DDBLT_WAIT, + NULL); + + /* EndPaint frees the DC */ + EndPaint (pScreenPriv->hwndScreen, &ps); + + return TRUE; +} + +Bool +winActivateAppShadowDDNL (ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + + /* + * Do we have a surface? + * Are we active? + * Are we full screen? + */ + if (pScreenPriv != NULL + && pScreenPriv->pddsPrimary4 != NULL + && pScreenPriv->fActive + ) + { + /* Primary surface was lost, restore it */ + IDirectDrawSurface_Restore (pScreenPriv->pddsPrimary4); + } + + return TRUE; +} /* Set pointers to our engine specific functions */ Bool @@ -607,6 +684,10 @@ winSetEngineFunctionsShadowDDNL (ScreenPtr pScreen) else pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed; pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB; + pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowDDNL; + pScreenPriv->pwinActivateApp = winActivateAppShadowDDNL; return TRUE; } + + diff --git a/xc/programs/Xserver/hw/xwin/winshadgdi.c b/xc/programs/Xserver/hw/xwin/winshadgdi.c index f16ab1037..3aac70b3b 100644 --- a/xc/programs/Xserver/hw/xwin/winshadgdi.c +++ b/xc/programs/Xserver/hw/xwin/winshadgdi.c @@ -27,7 +27,7 @@ * * Authors: Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/winshadgdi.c,v 1.2 2001/04/18 17:14:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/winshadgdi.c,v 1.6 2001/05/14 16:52:33 alanh Exp $ */ #include "win.h" @@ -37,38 +37,61 @@ winQueryScreenDIBFormat (ScreenPtr pScreen, BITMAPINFOHEADER *pbmih) { winScreenPriv(pScreen); HBITMAP hbmp; - Bool fReturn = TRUE; +#if CYGDEBUG + LPDWORD pdw = NULL; +#endif /* Create a memory bitmap compatible with the screen */ hbmp = CreateCompatibleBitmap (pScreenPriv->hdcScreen, 1, 1); if (hbmp == NULL) - return FALSE; + { + ErrorF ("winQueryScreenDIBFormat () - CreateCompatibleBitmap failed\n"); + return FALSE; + } /* Initialize our bitmap info header */ ZeroMemory (pbmih, sizeof (BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD)); pbmih->biSize = sizeof (BITMAPINFOHEADER); /* Get the biBitCount */ - fReturn = GetDIBits (pScreenPriv->hdcScreen, - hbmp, - 0, 1, - NULL, - (BITMAPINFO*) pbmih, - DIB_RGB_COLORS); + if (!GetDIBits (pScreenPriv->hdcScreen, + hbmp, + 0, 1, + NULL, + (BITMAPINFO*) pbmih, + DIB_RGB_COLORS)) + { + ErrorF ("winQueryScreenDIBFormat () - First call to GetDIBits failed\n"); + DeleteObject (hbmp); + return FALSE; + } + +#if CYGDEBUG + /* Get a pointer to bitfields */ + pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER)); + + ErrorF ("winQueryScreenDIBFormat () - First call masks: %08x %08x %08x\n", + pdw[0], pdw[1], pdw[2]); +#endif /* Get optimal color table, or the optimal bitfields */ - if (fReturn) - fReturn = GetDIBits (pScreenPriv->hdcScreen, - hbmp, - 0, 1, - NULL, - (BITMAPINFO*)pbmih, - DIB_RGB_COLORS); + if (!GetDIBits (pScreenPriv->hdcScreen, + hbmp, + 0, 1, + NULL, + (BITMAPINFO*)pbmih, + DIB_RGB_COLORS)) + { + ErrorF ("winQueryScreenDIBFormat () - Second call to GetDIBits "\ + "failed\n"); + DeleteObject (hbmp); + return FALSE; + } /* Free memory */ DeleteObject (hbmp); - return fReturn; + return TRUE; } static @@ -79,19 +102,33 @@ winQueryRGBBitsAndMasks (ScreenPtr pScreen) BITMAPINFOHEADER *pbmih = NULL; Bool fReturn = TRUE; LPDWORD pdw = NULL; + DWORD dwRedBits, dwGreenBits, dwBlueBits; /* RGB BPP for 8 bit palletes is always 8 bits per pixel */ if (GetDeviceCaps (pScreenPriv->hdcScreen, RASTERCAPS) & RC_PALETTE) { + /* + * FIXME: 8bpp doesn't work. + */ pScreenPriv->dwBitsPerRGB = 8; + pScreenPriv->dwRedMask = 0x0L; + pScreenPriv->dwGreenMask = 0x0L; + pScreenPriv->dwBlueMask = 0x0L; return TRUE; } - /* 24bpp is easy */ + /* Color masks for 24 bpp are standardized */ if (GetDeviceCaps (pScreenPriv->hdcScreen, PLANES) * GetDeviceCaps (pScreenPriv->hdcScreen, BITSPIXEL) == 24) { + /* 8 bits per primary color */ pScreenPriv->dwBitsPerRGB = 8; + + /* Set screen privates masks */ + pScreenPriv->dwRedMask = WIN_24BPP_MASK_RED; + pScreenPriv->dwGreenMask = WIN_24BPP_MASK_GREEN; + pScreenPriv->dwBlueMask = WIN_24BPP_MASK_BLUE; + return TRUE; } @@ -99,16 +136,22 @@ winQueryRGBBitsAndMasks (ScreenPtr pScreen) pbmih = (BITMAPINFOHEADER*) xalloc (sizeof (BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD)); if (pbmih == NULL) - return FALSE; + { + ErrorF ("winQueryRGBBitsAndMasks () - xalloc failed\n"); + return FALSE; + } /* Get screen description */ if (winQueryScreenDIBFormat (pScreen, pbmih)) { - DWORD dwRedBits, dwGreenBits, dwBlueBits; - /* Get a pointer to bitfields */ pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER)); +#if CYGDEBUG + ErrorF ("winQueryRGBBitsAndMasks () - Masks: %08x %08x %08x\n", + pdw[0], pdw[1], pdw[2]); +#endif + /* Count the number of bits in each mask */ dwRedBits = winCountBits (pdw[0]); dwGreenBits = winCountBits (pdw[1]); @@ -129,6 +172,8 @@ winQueryRGBBitsAndMasks (ScreenPtr pScreen) } else { + ErrorF ("winQueryRGBBitsAndMasks () - winQueryScreenDIBFormat failed\n"); + xfree (pbmih); fReturn = FALSE; } @@ -156,7 +201,10 @@ winAllocateFBShadowGDI (ScreenPtr pScreen) pbmih = (BITMAPINFOHEADER*) xalloc (sizeof (BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD)); if (pbmih == NULL) - return FALSE; + { + ErrorF ("winAllocateFBShadowGDI - xalloc () failed\n"); + return FALSE; + } /* Query the screen format */ fReturn = winQueryScreenDIBFormat (pScreen, pbmih); @@ -173,7 +221,10 @@ winAllocateFBShadowGDI (ScreenPtr pScreen) NULL, 0); if (pScreenPriv->hbmpShadow == NULL || pScreenInfo->pfb == NULL) - return FALSE; + { + ErrorF ("winAllocateFBShadowGDI () - CreateDIBSection failed\n"); + return FALSE; + } else { #if CYGDEBUG @@ -199,16 +250,23 @@ winAllocateFBShadowGDI (ScreenPtr pScreen) ErrorF ("winAllocateFBShadowGDI () - Attempting a shadow blit\n"); #endif - BitBlt (pScreenPriv->hdcScreen, - 0, 0, - pScreenInfo->dwWidth, pScreenInfo->dwHeight, - pScreenPriv->hdcShadow, - 0, 0, - SRCCOPY); - + fReturn = BitBlt (pScreenPriv->hdcScreen, + 0, 0, + pScreenInfo->dwWidth, pScreenInfo->dwHeight, + pScreenPriv->hdcShadow, + 0, 0, + SRCCOPY); + if (fReturn) + { #if CYGDEBUG - ErrorF ("winAllocateFBShadowGDI () - Shadow blit success\n"); + ErrorF ("winAllocateFBShadowGDI () - Shadow blit success\n"); #endif + } + else + { + ErrorF ("winAllocateFBShadowGDI () - Shadow blit failure\n"); + return FALSE; + } /* Set screeninfo stride */ pScreenInfo->dwStrideBytes = pScreenInfo->dwPaddedWidth; @@ -267,7 +325,8 @@ winShadowSetWindowLinearGDI (ScreenPtr pScreen, winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; *pdwSize = pScreenInfo->dwPaddedWidth; - return (CARD8 *) pScreenInfo->pfb + dwRow * pScreenInfo->dwPaddedWidth + dwOffset; + return (CARD8 *) pScreenInfo->pfb + + dwRow * pScreenInfo->dwPaddedWidth + dwOffset; } void * @@ -380,7 +439,9 @@ winInitVisualsShadowGDI (ScreenPtr pScreen) break; case 8: +#if CYGDEBUG ErrorF ("winInitVisualsGDI () - Calling miSetVisualTypesAndMasks\n"); +#endif /* CYGDEBUG */ if (!miSetVisualTypesAndMasks (pScreenInfo->dwDepth, PseudoColorMask, pScreenPriv->dwBitsPerRGB, @@ -420,12 +481,17 @@ winAdjustVideoModeShadowGDI (ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; - HDC hdc = GetDC (NULL); + HDC hdc; DWORD dwDepth; + hdc = GetDC (NULL); + /* We're in serious trouble if we can't get a DC */ if (hdc == NULL) - return FALSE; + { + ErrorF ("winAdjustVideoModeShadowGDI () - GetDC () failed\n"); + return FALSE; + } /* Query GDI for current display depth */ dwDepth = GetDeviceCaps (hdc, BITSPIXEL); @@ -442,8 +508,73 @@ winAdjustVideoModeShadowGDI (ScreenPtr pScreen) } /* Release our DC */ - ReleaseDC (hdc, NULL); - + ReleaseDC (NULL, hdc); + + return TRUE; +} + +/* Blt exposed regions to the screen */ +Bool +winBltExposedRegionsShadowGDI (ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + HDC hdcUpdate; + PAINTSTRUCT ps; + + /* BeginPaint gives us an hdc that clips to the invalidated region */ + hdcUpdate = BeginPaint (pScreenPriv->hwndScreen, &ps); + + /* Our BitBlt will be clipped to the invalidated region */ + BitBlt (hdcUpdate, + 0, 0, + pScreenInfo->dwWidth, pScreenInfo->dwHeight, + pScreenPriv->hdcShadow, + 0, 0, + SRCCOPY); + + /* EndPaint frees the DC */ + EndPaint (pScreenPriv->hwndScreen, &ps); + + return TRUE; +} + +Bool +winActivateAppShadowGDI (ScreenPtr pScreen) +{ + winScreenPriv(pScreen); + winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; + + /* + * Are we active? + * Are we fullscreen? + */ + if (pScreenPriv != NULL + && pScreenPriv->fActive + && pScreenInfo->fFullScreen) + { + /* + * Activating, attempt to bring our window + * to the top of the display + */ + ShowWindow (pScreenPriv->hwndScreen, SW_RESTORE); + } + + /* + * Are we inactive? + * Are we fullscreen? + */ + if (pScreenPriv != NULL + && !pScreenPriv->fActive + && pScreenInfo->fFullScreen) + { + /* + * Deactivating, stuff our window onto the + * task bar. + */ + ShowWindow (pScreenPriv->hwndScreen, SW_MINIMIZE); + } + return TRUE; } @@ -466,6 +597,8 @@ winSetEngineFunctionsShadowGDI (ScreenPtr pScreen) else pScreenPriv->pwinCreateBoundingWindow = winCreateBoundingWindowWindowed; pScreenPriv->pwinFinishScreenInit = winFinishScreenInitFB; + pScreenPriv->pwinBltExposedRegions = winBltExposedRegionsShadowGDI; + pScreenPriv->pwinActivateApp = winActivateAppShadowGDI; return TRUE; } diff --git a/xc/programs/Xserver/hw/xwin/winwakeup.c b/xc/programs/Xserver/hw/xwin/winwakeup.c index b026f3bcb..09a264418 100644 --- a/xc/programs/Xserver/hw/xwin/winwakeup.c +++ b/xc/programs/Xserver/hw/xwin/winwakeup.c @@ -30,7 +30,7 @@ * Peter Busch * Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/winwakeup.c,v 1.2 2001/04/18 17:14:07 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/winwakeup.c,v 1.3 2001/05/02 00:45:26 alanh Exp $ */ #include "win.h" @@ -43,6 +43,7 @@ winWakeupHandler (pointer pWakeupData, winScreenPriv((ScreenPtr)pWakeupData); MSG msg; + /* Process all message on our queue */ while (PeekMessage (&msg, pScreenPriv->hwndScreen, 0, 0, PM_REMOVE)) { DispatchMessage (&msg); diff --git a/xc/programs/Xserver/hw/xwin/winwndproc.c b/xc/programs/Xserver/hw/xwin/winwndproc.c index 35fb5369c..2e7f31f0f 100644 --- a/xc/programs/Xserver/hw/xwin/winwndproc.c +++ b/xc/programs/Xserver/hw/xwin/winwndproc.c @@ -30,12 +30,13 @@ * Peter Busch * Harold L Hunt II */ -/* $XFree86: xc/programs/Xserver/hw/xwin/winwndproc.c,v 1.2 2001/04/18 17:14:07 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xwin/winwndproc.c,v 1.4 2001/05/08 08:14:09 alanh Exp $ */ #include "win.h" -/* Called by the WakeupHandler - * Processes and/or dispatches Windows messages +/* + * Called by winWakeupHandler + * Processes current Windows message */ LRESULT CALLBACK winWindowProc (HWND hWnd, UINT message, @@ -45,9 +46,6 @@ winWindowProc (HWND hWnd, UINT message, winScreenInfo *pScreenInfo = NULL; ScreenPtr pScreen = NULL; xEvent xCurrentEvent; - int iDeltaZ; - HDC hdcUpdate; - PAINTSTRUCT ps; LPCREATESTRUCT pcs; HRESULT ddrval; RECT rcClient, rcSrc; @@ -68,14 +66,15 @@ winWindowProc (HWND hWnd, UINT message, switch (message) { case WM_CREATE: - /* Add a property to our display window that references - this screens' privates. - - This allows the window procedure to refer to the - appropriate window DC and shadow DC for the window that - it is processing. We use this to repaint exposed - areas of our display window. - */ + /* + * Add a property to our display window that references + * this screens' privates. + * + * This allows the window procedure to refer to the + * appropriate window DC and shadow DC for the window that + * it is processing. We use this to repaint exposed + * areas of our display window. + */ pcs = (LPCREATESTRUCT) lParam; pScreenPriv = pcs->lpCreateParams; pScreen = pScreenPriv->pScreenInfo->pScreen; @@ -97,101 +96,8 @@ winWindowProc (HWND hWnd, UINT message, break; } - /* BeginPaint gives us an hdc that clips to the invalidated region */ - hdcUpdate = BeginPaint (hWnd, &ps); - - /* Branch on server style */ - switch (pScreenInfo->dwEngine) - { - case WIN_SERVER_SHADOW_GDI: - /* Our BitBlt will be clipped to the invalidated region */ - BitBlt (hdcUpdate, - 0, 0, - pScreenInfo->dwWidth, pScreenInfo->dwHeight, - pScreenPriv->hdcShadow, - 0, 0, - SRCCOPY); - break; - - case WIN_SERVER_SHADOW_DD: - /* Unlock the shadow surface, so we can blit */ - ddrval = IDirectDrawSurface_Unlock (pScreenPriv->pddsShadow, NULL); - if (FAILED (ddrval)) - FatalError ("winWindowProc () - DD unlock failed\n"); - - /* Get client area in screen coords */ - GetClientRect (pScreenPriv->hwndScreen, &rcClient); - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&rcClient, 2); - - /* Source can be enter shadow surface, as Blt should clip */ - rcSrc.left = 0; - rcSrc.top = 0; - rcSrc.right = pScreenInfo->dwWidth; - rcSrc.bottom = pScreenInfo->dwHeight; - - /* Our Blt should be clipped to the invalidated region */ - ddrval = IDirectDrawSurface_Blt (pScreenPriv->pddsPrimary, - &rcClient, - pScreenPriv->pddsShadow, - &rcSrc, - DDBLT_WAIT, - NULL); - - /* Relock the shadow surface */ - ddrval = IDirectDrawSurface_Lock (pScreenPriv->pddsShadow, - NULL, - pScreenPriv->pddsdShadow, - DDLOCK_WAIT, - NULL); - if (FAILED (ddrval)) - FatalError ("winWindowProc () - DD lock failed\n"); - - /* Has our memory pointer changed? */ - if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface) - winUpdateFBPointer (pScreen, - pScreenPriv->pddsdShadow->lpSurface); - break; - - case WIN_SERVER_SHADOW_DDNL: - /* Get client area in screen coords */ - GetClientRect (pScreenPriv->hwndScreen, &rcClient); - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&rcClient, 2); - - /* Source can be enter shadow surface, as Blt should clip */ - rcSrc.left = 0; - rcSrc.top = 0; - rcSrc.right = pScreenInfo->dwWidth; - rcSrc.bottom = pScreenInfo->dwHeight; - - /* Our Blt should be clipped to the invalidated region */ - ddrval = IDirectDrawSurface_Blt (pScreenPriv->pddsPrimary4, - &rcClient, - pScreenPriv->pddsShadow4, - &rcSrc, - DDBLT_WAIT, - NULL); - break; - - case WIN_SERVER_PRIMARY_DD: - /* FIXME: We only run in fullscreen mode with primary fb - DirectDraw server. - - We'll have to hand roll the clipping for windowed mode; - the performance of the primary fb server is so bad - that it probably wouldn't be worth the effort to write - the clipping code. - */ - break; - default: - FatalError ("winWindowProc () - WM_PAINT - Unknown engine type\n"); - } - - /* EndPaint frees the DC */ - EndPaint (hWnd, &ps); + /* Call the engine dependent repainter */ + (*pScreenPriv->pwinBltExposedRegions) (pScreen); return 0; case WM_MOUSEMOVE: @@ -218,7 +124,7 @@ winWindowProc (HWND hWnd, UINT message, /* Deliver absolute cursor position to X Server */ miPointerAbsoluteCursor (GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), - GetTickCount ()); + g_c32LastInputEventTime = GetTickCount ()); return 0; case WM_NCMOUSEMOVE: @@ -232,147 +138,66 @@ winWindowProc (HWND hWnd, UINT message, case WM_LBUTTONDBLCLK: case WM_LBUTTONDOWN: - xCurrentEvent.u.u.type = ButtonPress; - xCurrentEvent.u.u.detail = Button1; - xCurrentEvent.u.keyButtonPointer.time = GetTickCount (); - mieqEnqueue (&xCurrentEvent); - return 0; - + return winMouseButtonsHandle (pScreen, ButtonPress, Button1, wParam); + case WM_LBUTTONUP: - xCurrentEvent.u.u.type = ButtonRelease; - xCurrentEvent.u.u.detail = Button1; - xCurrentEvent.u.keyButtonPointer.time = GetTickCount (); - mieqEnqueue (&xCurrentEvent); - return 0; + return winMouseButtonsHandle (pScreen, ButtonRelease, Button1, wParam); case WM_MBUTTONDBLCLK: case WM_MBUTTONDOWN: - xCurrentEvent.u.u.type = ButtonPress; - xCurrentEvent.u.u.detail = Button2; - xCurrentEvent.u.keyButtonPointer.time = GetTickCount (); - mieqEnqueue (&xCurrentEvent); - return 0; - + return winMouseButtonsHandle (pScreen, ButtonPress, Button2, wParam); + case WM_MBUTTONUP: - xCurrentEvent.u.u.type = ButtonRelease; - xCurrentEvent.u.u.detail = Button2; - xCurrentEvent.u.keyButtonPointer.time = GetTickCount (); - mieqEnqueue (&xCurrentEvent); - return 0; - + return winMouseButtonsHandle (pScreen, ButtonRelease, Button2, wParam); + case WM_RBUTTONDBLCLK: case WM_RBUTTONDOWN: - xCurrentEvent.u.u.type = ButtonPress; - xCurrentEvent.u.u.detail = Button3; - xCurrentEvent.u.keyButtonPointer.time = GetTickCount (); - mieqEnqueue (&xCurrentEvent); - return 0; - + return winMouseButtonsHandle (pScreen, ButtonPress, Button3, wParam); + case WM_RBUTTONUP: - xCurrentEvent.u.u.type = ButtonRelease; - xCurrentEvent.u.u.detail = Button3; - xCurrentEvent.u.keyButtonPointer.time = GetTickCount (); - mieqEnqueue (&xCurrentEvent); - return 0; - - case WM_MOUSEWHEEL: - /* Button4 = WheelUp */ - /* Button5 = WheelDown */ - - /* Find out how far the wheel has moved */ - iDeltaZ = GET_WHEEL_DELTA_WPARAM(wParam); - - /* Do we have any previous delta stored? */ - if ((pScreenPriv->iDeltaZ > 0 - && iDeltaZ > 0) - || (pScreenPriv->iDeltaZ < 0 - && iDeltaZ < 0)) - { - /* Previous delta and of same sign as current delta */ - iDeltaZ += pScreenPriv->iDeltaZ; - pScreenPriv->iDeltaZ = 0; - } - else - { - /* Previous delta of different sign, or zero. - We will set it to zero for either case, - as blindly setting takes just as much time - as checking, then setting if necessary :) */ - pScreenPriv->iDeltaZ = 0; - } - - /* - Only process this message if the wheel has moved further than - WHEEL_DELTA - */ - if (iDeltaZ >= WHEEL_DELTA || (-1 * iDeltaZ) >= WHEEL_DELTA) - { - pScreenPriv->iDeltaZ = 0; - - /* Figure out how many whole deltas of the wheel we have */ - iDeltaZ /= WHEEL_DELTA; - } - else - { - /* - Wheel has not moved past WHEEL_DELTA threshold; - we will store the wheel delta until the threshold - has been reached. - */ - pScreenPriv->iDeltaZ = iDeltaZ; - return 0; - } + return winMouseButtonsHandle (pScreen, ButtonRelease, Button3, wParam); - /* Set the button to indicate up or down wheel delta */ - if (iDeltaZ > 0) + case WM_TIMER: + switch (wParam) { - xCurrentEvent.u.u.detail = Button4; - } - else - { - xCurrentEvent.u.u.detail = Button5; - } + case WIN_E3B_TIMER_ID: + /* Send delayed button press */ + winMouseButtonsSendEvent (ButtonPress, + pScreenPriv->iE3BCachedPress); - /* - Flip iDeltaZ to positive, if negative, - because always need to generate a *positive* number of - button clicks for the Z axis. - */ - if (iDeltaZ < 0) - { - iDeltaZ *= -1; - } + /* Kill this timer */ + KillTimer (pScreenPriv->hwndScreen, WIN_E3B_TIMER_ID); - /* Generate X input messages for each wheel delta we have seen */ - while (iDeltaZ--) - { - /* Push the wheel button */ - xCurrentEvent.u.u.type = ButtonPress; - xCurrentEvent.u.keyButtonPointer.time = GetTickCount (); - mieqEnqueue (&xCurrentEvent); - - /* Release the wheel button */ - xCurrentEvent.u.u.type = ButtonRelease; - xCurrentEvent.u.keyButtonPointer.time = GetTickCount (); - mieqEnqueue (&xCurrentEvent); + /* Clear screen privates flags */ + pScreenPriv->iE3BCachedPress = 0; + break; } return 0; + case WM_MOUSEWHEEL: + return winMouseWheel (pScreen, GET_WHEEL_DELTA_WPARAM(wParam)); + case WM_SYSKEYDOWN: case WM_KEYDOWN: + if (winIsFakeCtrl_L (message, wParam, lParam)) + return 0; winTranslateKey (wParam, lParam, &iScanCode); xCurrentEvent.u.u.type = KeyPress; xCurrentEvent.u.u.detail = iScanCode; - xCurrentEvent.u.keyButtonPointer.time = GetTickCount (); + xCurrentEvent.u.keyButtonPointer.time + = g_c32LastInputEventTime = GetTickCount (); mieqEnqueue (&xCurrentEvent); return 0; case WM_SYSKEYUP: case WM_KEYUP: + if (winIsFakeCtrl_L (message, wParam, lParam)) + return 0; winTranslateKey (wParam, lParam, &iScanCode); xCurrentEvent.u.u.type = KeyRelease; xCurrentEvent.u.u.detail = iScanCode; - xCurrentEvent.u.keyButtonPointer.time = GetTickCount (); + xCurrentEvent.u.keyButtonPointer.time + = g_c32LastInputEventTime = GetTickCount (); mieqEnqueue (&xCurrentEvent); return 0; @@ -387,10 +212,11 @@ winWindowProc (HWND hWnd, UINT message, /* Alt+Tab was pressed, we will lose focus very soon */ pScreenPriv->fActive = FALSE; - /* We need to save the primary fb to an offscreen fb when - we get deactivated, and point the fb code at the offscreen - fb for the duration of the deactivation. - */ + /* + * We need to save the primary fb to an offscreen fb when + * we get deactivated, and point the fb code at the offscreen + * fb for the duration of the deactivation. + */ if (pScreenPriv != NULL && pScreenPriv->pddsPrimary != NULL && pScreenPriv->pddsPrimary != NULL) @@ -473,15 +299,20 @@ winWindowProc (HWND hWnd, UINT message, break; case WM_ACTIVATE: - /* Focus is being changed to another window. - The other window may or may not belong to - our process. - */ + /* + * Focus is being changed to another window. + * The other window may or may not belong to + * our process. + */ /* We can't do anything if we don't have screen privates */ if (pScreenPriv == NULL) break; + /* Clear any lingering wheel delta */ + pScreenPriv->iDeltaZ = 0; + + /* Activating or deactivating? */ if (LOWORD (wParam) == WA_ACTIVE || LOWORD (wParam) == WA_CLICKACTIVE) { /* Restore the state of all mode keys */ @@ -492,9 +323,9 @@ winWindowProc (HWND hWnd, UINT message, && pScreen != miPointerCurrentScreen ()) { /* - Tell mi that we are changing the screen that receives - mouse input events. - */ + * Tell mi that we are changing the screen that receives + * mouse input events. + */ miPointerSetNewScreen (pScreenInfo->dwScreen, 0, 0); } @@ -547,147 +378,8 @@ winWindowProc (HWND hWnd, UINT message, ShowCursor (TRUE); } - /* Handle activation/deactivation for each engine */ - switch (pScreenInfo->dwEngine) - { - case WIN_SERVER_SHADOW_GDI: - /* - Are we active? - Are we fullscreen? - */ - if (pScreenPriv != NULL - && pScreenPriv->fActive - && pScreenInfo->fFullScreen) - { - /* - Activating, attempt to bring our window - to the top of the display - */ - ShowWindow (hWnd, SW_RESTORE); - } - - /* - Are we inactive? - Are we fullscreen? - */ - if (pScreenPriv != NULL - && !pScreenPriv->fActive - && pScreenInfo->fFullScreen) - { - /* Deactivating, stuff our window onto the - task bar. - */ - ShowWindow (hWnd, SW_MINIMIZE); - } - break; - - case WIN_SERVER_SHADOW_DD: - /* - Do we have a surface? - Are we active? - Are we fullscreen? - */ - if (pScreenPriv != NULL - && pScreenPriv->pddsPrimary != NULL - && pScreenPriv->fActive - //&& pScreenInfo->fFullScreen - ) - { - /* Primary surface was lost, restore it */ - IDirectDrawSurface_Restore (pScreenPriv->pddsPrimary); - } - break; - - case WIN_SERVER_SHADOW_DDNL: - /* - Do we have a surface? - Are we active? - Are we full screen? - */ - if (pScreenPriv != NULL - && pScreenPriv->pddsPrimary4 != NULL - && pScreenPriv->fActive - //&& pScreenInfo->fFullScreen - ) - { - /* Primary surface was lost, restore it */ - IDirectDrawSurface_Restore (pScreenPriv->pddsPrimary4); - } - break; - - case WIN_SERVER_PRIMARY_DD: - /* We need to blit our offscreen fb to - the screen when we are activated, and we need to point - the fb code back to the primary surface memory. - */ - if (pScreenPriv != NULL - && pScreenPriv->pddsPrimary != NULL - && pScreenPriv->pddsOffscreen != NULL - && pScreenPriv->fActive) - { - /* We are activating */ - ddrval = IDirectDrawSurface_IsLost (pScreenPriv->pddsOffscreen); - if (ddrval == DD_OK) - { - ddrval = IDirectDrawSurface_Unlock (pScreenPriv->pddsOffscreen, - NULL); -#if 0 - if (FAILED (ddrval)) - FatalError ("winWindowProc () - Failed unlocking "\ - "offscreen surface %08x\n", ddrval); -#endif - } - - /* Restore both surfaces, just cause I like it that way */ - IDirectDrawSurface_Restore (pScreenPriv->pddsOffscreen); - IDirectDrawSurface_Restore (pScreenPriv->pddsPrimary); - - /* Get client area in screen coords */ - GetClientRect (pScreenPriv->hwndScreen, &rcClient); - MapWindowPoints (pScreenPriv->hwndScreen, - HWND_DESKTOP, - (LPPOINT)&rcClient, 2); - - /* Setup a source rectangle */ - rcSrc.left = 0; - rcSrc.top = 0; - rcSrc.right = pScreenInfo->dwWidth; - rcSrc.bottom = pScreenInfo->dwHeight; - - ddrval = IDirectDrawSurface_Blt (pScreenPriv->pddsPrimary, - &rcClient, - pScreenPriv->pddsOffscreen, - &rcSrc, - DDBLT_WAIT, - NULL); - if (FAILED (ddrval)) - FatalError ("winWindowProc () - Failed blitting offscreen "\ - "surface to primary surface %08x\n", ddrval); - - /* Lock the primary surface */ - ddrval = IDirectDrawSurface_Lock (pScreenPriv->pddsPrimary, - &rcClient, - pScreenPriv->pddsdPrimary, - DDLOCK_WAIT, - NULL); - if (ddrval != DD_OK - || pScreenPriv->pddsdPrimary->lpSurface == NULL) - FatalError ("winWindowProc () - Could not lock "\ - "primary surface\n"); - - /* Notify FB of the new memory pointer */ - winUpdateFBPointer (pScreen, - pScreenPriv->pddsdPrimary->lpSurface); - - /* Register the Alt-Tab combo as a hotkey so we can copy - the primary framebuffer before the display mode changes - */ - RegisterHotKey (hWnd, 1, MOD_ALT, 9); - } - break; - default: - FatalError ("winWindowProc () - WM_ACTIVATEAPP - Unknown engine\n"); - } + /* Call engine specific screen activation/deactivation function */ + (*pScreenPriv->pwinActivateApp) (pScreen); return 0; case WM_CLOSE: diff --git a/xc/programs/Xserver/include/misc.h b/xc/programs/Xserver/include/misc.h index be72c472b..ba020ea9d 100644 --- a/xc/programs/Xserver/include/misc.h +++ b/xc/programs/Xserver/include/misc.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/include/misc.h,v 3.25 2001/01/17 22:36:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/include/misc.h,v 3.26 2001/05/06 06:28:46 alanh Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -182,11 +182,6 @@ typedef struct _xReq *xReqPtr; * #include'ing it later. */ -#ifdef __CYGWIN__ -/* needed to avoid INFINITY redeclarations from CYGWIN math.h */ -#define __STRICT_ANSI__ -#endif - #include <math.h> #endif #undef MAXSHORT diff --git a/xc/programs/Xserver/include/opaque.h b/xc/programs/Xserver/include/opaque.h index b4ac45a58..9b19bee67 100644 --- a/xc/programs/Xserver/include/opaque.h +++ b/xc/programs/Xserver/include/opaque.h @@ -22,7 +22,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/include/opaque.h,v 1.8 2001/01/17 22:36:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/include/opaque.h,v 1.9 2001/05/04 19:05:52 dawes Exp $ */ #ifndef OPAQUE_H #define OPAQUE_H @@ -70,9 +70,6 @@ extern int limitNoFile; #endif extern Bool permitOldBugs; extern Bool defeatAccessControl; -#ifdef SERVER_LOCK -static Bool nolock = FALSE; -#endif extern char* protNoListen; diff --git a/xc/programs/Xserver/lbx/lbxdix.c b/xc/programs/Xserver/lbx/lbxdix.c index a59959664..c22fe00ea 100644 --- a/xc/programs/Xserver/lbx/lbxdix.c +++ b/xc/programs/Xserver/lbx/lbxdix.c @@ -42,7 +42,7 @@ in this Software without prior written authorization from The Open Group. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/lbx/lbxdix.c,v 1.5 2001/01/17 22:36:59 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/lbx/lbxdix.c,v 1.6 2001/05/15 10:19:43 eich Exp $ */ /* various bits of DIX-level mangling */ @@ -72,8 +72,8 @@ in this Software without prior written authorization from The Open Group. #ifdef XAPPGROUP #include "Xagsrv.h" #endif +#include "swaprep.h" -extern ReplySwapPtr CopySwap32Write; extern int (*ProcVector[256]) (ClientPtr); extern int (*SwappedProcVector[256]) (ClientPtr); @@ -312,7 +312,7 @@ LbxGetKeyboardMapping(ClientPtr client) WriteToClient(client, sizeof(xLbxGetKeyboardMappingReply), (char *)&rep); if (send_data) { - client->pSwapReplyFunc = CopySwap32Write; + client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; WriteSwappedDataToClient(client, curKeySyms->mapWidth * stuff->count * sizeof(KeySym), &curKeySyms->map[(stuff->firstKeyCode - curKeySyms->minKeyCode) * diff --git a/xc/programs/Xserver/lbx/lbxprop.c b/xc/programs/Xserver/lbx/lbxprop.c index c72b0fed8..993359d90 100644 --- a/xc/programs/Xserver/lbx/lbxprop.c +++ b/xc/programs/Xserver/lbx/lbxprop.c @@ -42,7 +42,7 @@ in this Software without prior written authorization from The Open Group. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ -/* $XFree86: xc/programs/Xserver/lbx/lbxprop.c,v 1.3 2001/01/17 22:37:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/lbx/lbxprop.c,v 1.4 2001/05/15 10:19:43 eich Exp $ */ /* various bits of DIX-level mangling */ @@ -69,8 +69,7 @@ in this Software without prior written authorization from The Open Group. #define _SECURITY_SERVER #include "extensions/security.h" #endif - -extern ReplySwapPtr CopySwap16Write, CopySwap32Write, Swap32Write; +#include "swaprep.h" void LbxStallPropRequest(ClientPtr client, @@ -515,10 +514,10 @@ LbxGetProperty(ClientPtr client) if (len) { switch (reply.format) { case 32: - client->pSwapReplyFunc = CopySwap32Write; + client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; break; case 16: - client->pSwapReplyFunc = CopySwap16Write; + client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; break; default: client->pSwapReplyFunc = (ReplySwapPtr) WriteToClient; diff --git a/xc/programs/Xserver/mi/mi.h b/xc/programs/Xserver/mi/mi.h index ec6dc006f..042deead6 100644 --- a/xc/programs/Xserver/mi/mi.h +++ b/xc/programs/Xserver/mi/mi.h @@ -41,7 +41,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/mi/mi.h,v 3.7 2001/01/17 22:37:05 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/mi/mi.h,v 3.7.2.1 2001/05/25 18:50:12 dawes Exp $ */ #ifndef MI_H #define MI_H @@ -218,7 +218,7 @@ extern void mieqSwitchScreen( #endif ); -extern int mieqProcessInputEvents( +extern void mieqProcessInputEvents( #if NeedFunctionPrototypes void #endif diff --git a/xc/programs/Xserver/mi/micmap.c b/xc/programs/Xserver/mi/micmap.c index 603b76cb0..8d4332626 100644 --- a/xc/programs/Xserver/mi/micmap.c +++ b/xc/programs/Xserver/mi/micmap.c @@ -27,7 +27,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/mi/micmap.c,v 1.10 2000/09/20 00:09:14 keithp Exp $ */ +/* $XFree86: xc/programs/Xserver/mi/micmap.c,v 1.10.4.1 2001/05/29 22:28:23 dawes Exp $ */ /* * This is based on cfbcmap.c. The functions here are useful independently @@ -447,7 +447,7 @@ miGetDefaultVisualMask(int depth) return SMALL_VISUALS; } -Bool +static Bool miVisualTypesSet (int depth) { miVisualsPtr visuals; @@ -473,6 +473,7 @@ miSetPixmapDepths (void) return FALSE; } } + return TRUE; } Bool diff --git a/xc/programs/Xserver/mi/mieq.c b/xc/programs/Xserver/mi/mieq.c index e6a11d623..114a4df9e 100644 --- a/xc/programs/Xserver/mi/mieq.c +++ b/xc/programs/Xserver/mi/mieq.c @@ -21,6 +21,7 @@ in this Software without prior written authorization from The Open Group. * * Author: Keith Packard, MIT X Consortium */ +/* $XFree86: xc/programs/Xserver/mi/mieq.c,v 1.1.1.4.2.1 2001/05/25 18:50:12 dawes Exp $ */ /* * mieq.c @@ -85,7 +86,7 @@ void mieqEnqueue (e) xEvent *e; { - HWEventQueueType oldtail, newtail, prevtail; + HWEventQueueType oldtail, newtail; Bool isMotion; oldtail = miEventQueue.tail; @@ -135,7 +136,7 @@ mieqSwitchScreen (pScreen, fromDIX) * Call this from ProcessInputEvents() */ -mieqProcessInputEvents () +void mieqProcessInputEvents () { EventRec *e; int x, y; @@ -143,8 +144,6 @@ mieqProcessInputEvents () while (miEventQueue.head != miEventQueue.tail) { - extern int screenIsSaved; - if (screenIsSaved == SCREEN_SAVER_ON) SaveScreens (SCREEN_SAVER_OFF, ScreenSaverReset); diff --git a/xc/programs/Xserver/mi/miinitext.c b/xc/programs/Xserver/mi/miinitext.c index d7aadd91e..e5eea6fde 100644 --- a/xc/programs/Xserver/mi/miinitext.c +++ b/xc/programs/Xserver/mi/miinitext.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/mi/miinitext.c,v 3.56 2001/03/16 04:45:36 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/mi/miinitext.c,v 3.57 2001/05/10 10:17:39 alanh Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -476,8 +476,8 @@ InitExtensions(argc, argv) int argc; char *argv[]; { - int i, j, k, numExts, ii; - ExtensionModule *ext, *newList; + int i; + ExtensionModule *ext; static Bool listInitialised = FALSE; if (!listInitialised) { diff --git a/xc/programs/Xserver/os/osinit.c b/xc/programs/Xserver/os/osinit.c index 80144ef8b..c6d124982 100644 --- a/xc/programs/Xserver/os/osinit.c +++ b/xc/programs/Xserver/os/osinit.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/os/osinit.c,v 3.21 2001/01/17 22:37:11 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/os/osinit.c,v 3.22 2001/05/11 08:16:55 alanh Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -61,6 +61,10 @@ SOFTWARE. #endif #endif +#if defined(Lynx) +#include <sys/wait.h> +#endif + #if !defined(SYSV) && !defined(AMOEBA) && !defined(_MINIX) && !defined(WIN32) && !defined(Lynx) && !defined(QNX4) #include <sys/resource.h> #endif diff --git a/xc/programs/Xserver/os/utils.c b/xc/programs/Xserver/os/utils.c index 2a4fcf1f9..9dde7b6a4 100644 --- a/xc/programs/Xserver/os/utils.c +++ b/xc/programs/Xserver/os/utils.c @@ -45,7 +45,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/os/utils.c,v 3.68 2001/01/17 22:37:12 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/os/utils.c,v 3.69 2001/05/04 19:05:52 dawes Exp $ */ #ifdef __CYGWIN__ #include <stdlib.h> #include <signal.h> @@ -234,6 +234,7 @@ OsSignal(sig, handler) static Bool StillLocking = FALSE; static char LockFile[PATH_MAX]; +static Bool nolock = FALSE; /* * LockServer -- diff --git a/xc/programs/Xserver/os/xdmcp.c b/xc/programs/Xserver/os/xdmcp.c index b9d1e2caa..d9d5c3c89 100644 --- a/xc/programs/Xserver/os/xdmcp.c +++ b/xc/programs/Xserver/os/xdmcp.c @@ -13,7 +13,7 @@ * without express or implied warranty. * */ -/* $XFree86: xc/programs/Xserver/os/xdmcp.c,v 3.14 2001/01/17 22:37:13 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/os/xdmcp.c,v 3.15 2001/05/01 07:53:47 alanh Exp $ */ #ifdef WIN32 /* avoid conflicting definitions */ @@ -324,7 +324,6 @@ XdmcpOptions(int argc, char **argv, int i) return (i + 1); } if (strcmp(argv[i], "-class") == 0) { - ++i; if (++i == argc) { ErrorF("Xserver: missing class name in command line\n"); exit(1); diff --git a/xc/programs/Xserver/render/mipict.c b/xc/programs/Xserver/render/mipict.c index f5481b671..b85aec5da 100644 --- a/xc/programs/Xserver/render/mipict.c +++ b/xc/programs/Xserver/render/mipict.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/programs/Xserver/render/mipict.c,v 1.6 2001/01/29 15:08:09 keithp Exp $ + * $XFree86: xc/programs/Xserver/render/mipict.c,v 1.6.2.1 2001/06/01 01:06:35 dawes Exp $ * * Copyright © 1999 Keith Packard * @@ -30,6 +30,10 @@ #include "picturestr.h" #include "mipict.h" +#ifndef __GNUC__ +#define __inline +#endif + int miCreatePicture (PicturePtr pPicture) { |