XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks

This commit is contained in:
Kaleb Keithley 2003-11-25 19:29:01 +00:00
commit adc7f9a4eb
705 changed files with 30330 additions and 26603 deletions

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/atKeynames.h,v 3.18 2001/09/29 20:40:30 herrb Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/atKeynames.h,v 3.21 2003/10/09 11:43:59 pascal Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
@ -21,6 +21,33 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* Copyright (c) 1994-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XConsortium: atKeynames.h /main/11 1996/03/09 11:17:41 kaleb $ */
#ifndef _ATKEYNAMES_H
@ -199,6 +226,71 @@
#define KEY_NFER /* No Kanji Transfer 0x7b */ 123
#define KEY_Yen /* Yen 0x7d */ 125
#define KEY_Power /* Power Key 0x84 */ 132
#define KEY_Mute /* Audio Mute 0x85 */ 133
#define KEY_AudioLower /* Audio Lower 0x86 */ 134
#define KEY_AudioRaise /* Audio Raise 0x87 */ 135
#define KEY_Help /* Help 0x88 */ 136
#define KEY_L1 /* Stop 0x89 */ 137
#define KEY_L2 /* Again 0x8a */ 138
#define KEY_L3 /* Props 0x8b */ 139
#define KEY_L4 /* Undo 0x8c */ 140
#define KEY_L5 /* Front 0x8d */ 141
#define KEY_L6 /* Copy 0x8e */ 142
#define KEY_L7 /* Open 0x8f */ 143
#define KEY_L8 /* Paste 0x90 */ 144
#define KEY_L9 /* Find 0x91 */ 145
#define KEY_L10 /* Cut 0x92 */ 146
/*
* Fake 'scancodes' in the following ranges are generated for 2-byte
* codes not handled elsewhere. These correspond to most extended keys
* on so-called "Internet" keyboards:
*
* 0x79-0x93
* 0x96-0xa1
* 0xa3-0xac
* 0xb1-0xb4
* 0xba-0xbd
* 0xc2
* 0xcc-0xd2
* 0xd6-0xf7
*/
/*
* Remapped 'scancodes' are generated for single-byte codes in the range
* 0x59-0x5f,0x62-0x76. These are used for some extra keys on some keyboards.
*/
#define KEY_0x59 0x95
#define KEY_0x5A 0xA2
#define KEY_0x5B 0xAD
#define KEY_0x5C KEY_KP_EQUAL
#define KEY_0x5D 0xAE
#define KEY_0x5E 0xAF
#define KEY_0x5F 0xB0
#define KEY_0x62 0xB5
#define KEY_0x63 0xB6
#define KEY_0x64 0xB7
#define KEY_0x65 0xB8
#define KEY_0x66 0xB9
#define KEY_0x67 0xBE
#define KEY_0x68 0xBF
#define KEY_0x69 0xC0
#define KEY_0x6A 0xC1
#define KEY_0x6B 0xC3
#define KEY_0x6C 0xC4
#define KEY_0x6D 0xC5
#define KEY_0x6E 0xC6
#define KEY_0x6F 0xC7
#define KEY_0x70 0xC8
#define KEY_0x71 0xC9
#define KEY_0x72 0xCA
#define KEY_0x73 0xCB
#define KEY_0x74 0xD3
#define KEY_0x75 0xD4
#define KEY_0x76 0xD5
/* These are for "notused" and "unknown" entries in translation maps. */
#define KEY_NOTUSED 0
#define KEY_UNKNOWN 255

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.99 2003/01/29 15:23:20 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.104 2003/11/03 05:11:01 tsi Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
@ -21,6 +21,33 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* Copyright (c) 1994-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XConsortium: compiler.h /main/16 1996/10/25 15:38:34 kaleb $ */
#ifndef _COMPILER_H
@ -423,23 +450,37 @@ __ustw (unsigned long r5, unsigned short * r11)
# define stq_u(v,p) __ustq(v,p)
# define stl_u(v,p) __ustl(v,p)
# define stw_u(v,p) __ustw(v,p)
# define mem_barrier() __asm__ __volatile__ ("mf" ::: "memory")
# define write_mem_barrier() __asm__ __volatile__ ("mf" ::: "memory")
# ifndef __INTEL_COMPILER
# define mem_barrier() __asm__ __volatile__ ("mf" ::: "memory")
# define write_mem_barrier() __asm__ __volatile__ ("mf" ::: "memory")
# else
# include "ia64intrin.h"
# define mem_barrier() __mf()
# define write_mem_barrier() __mf()
# endif
/*
* This is overkill, but for different reasons depending on where it is used.
* This is thus general enough to be used everywhere cache flushes are needed.
* It doesn't handle memory access serialisation by other processors, though.
*/
# define ia64_flush_cache(Addr) \
# ifndef __INTEL_COMPILER
# define ia64_flush_cache(Addr) \
__asm__ __volatile__ ( \
"fc %0;;;" \
"sync.i;;;" \
"mf;;;" \
"srlz.i;;;" \
:: "r"(Addr) : "memory")
# else
# define ia64_flush_cache(Addr) { \
__fc(Addr);\
__synci();\
__mf();\
__isrlz();\
}
# endif
# undef outb
# undef outw
# undef outl
@ -448,7 +489,7 @@ __ustw (unsigned long r5, unsigned short * r11)
# define outw(a,b) _outw(b,a)
# define outl(a,b) _outl(b,a)
# elif defined(linux) && defined(__x86_64__)
# elif defined(linux) && defined(__AMD64__)
# include <inttypes.h>
@ -514,7 +555,7 @@ inl(unsigned short port)
return ret;
}
# elif (defined(linux) || defined(Lynx) || defined(sun) || defined(__OpenBSD__)) && defined(__sparc__)
# elif (defined(linux) || defined(Lynx) || defined(sun) || defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc__)
# if !defined(Lynx)
# ifndef ASI_PL
@ -1515,11 +1556,13 @@ extern void outl(unsigned int a, unsigned int l);
# include <sys/types.h>
# endif /* IN_MODULE */
# endif /* USL */
# ifndef sgi
# include <sys/inline.h>
# endif
# else
# include "scoasm.h"
# endif
# if !defined(__HIGHC__) && !defined(SCO325)
# if !defined(__HIGHC__) && !defined(SCO325) && !defined(sgi)
# pragma asm partial_optimization outl
# pragma asm partial_optimization outw
# pragma asm partial_optimization outb

View file

@ -1,4 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/fourcc.h,v 1.3 2001/12/03 22:13:24 mvojkovi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/fourcc.h,v 1.5 2003/08/24 17:36:48 dawes Exp $ */
/*
* Copyright (c) 2000-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
This header file contains listings of STANDARD guids for video formats.
@ -7,6 +34,9 @@
For an explanation of fourcc <-> guid mappings see RFC2361.
*/
#ifndef _XF86_FOURCC_H_
#define _XF86_FOURCC_H_ 1
#define FOURCC_YUY2 0x32595559
#define XVIMAGE_YUY2 \
{ \
@ -128,3 +158,4 @@
XvTopToBottom \
}
#endif /* _XF86_FOURCC_H_ */

View file

@ -8,9 +8,33 @@
# perl /modeline2c.pl < [modesfile] > xf86DefModes.c
#
# hackish perl - author Dirk Hohndel
# Copyright 1999-2001 by The XFree86 Project, Inc.
#
# $XFree86: xc/programs/Xserver/hw/xfree86/common/modeline2c.pl,v 1.8 2001/10/28 03:33:17 tsi Exp $
# Copyright 1999-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
# and author(s) 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 copyright holder(s) and author(s).
#
# $XFree86: xc/programs/Xserver/hw/xfree86/common/modeline2c.pl,v 1.11 2003/11/03 05:11:01 tsi Exp $
#my %flagshash;
$flagshash{""} = "0";
@ -32,17 +56,20 @@ $flagshash{"-hsync -vsync interlace"} = "V_NHSYNC | V_NVSYNC | V_INTERLACE";
# stop CVS from expanding the XFree86 Id here...
$proj = "XFree86";
printf("/* \$$proj: \$ */
printf("/* \$$proj\$ */
/* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at
* modeline2c.pl */
/*
* Copyright 1999 by The XFree86 Project, Inc.
* Copyright 1999-2003 by The XFree86 Project, Inc.
*
* Author: Dirk Hohndel <hohndel\@XFree86.Org>
*/
#ifdef __UNIXOS2__
#define I_NEED_OS2_H
#endif
#include \"xf86.h\"
#include \"xf86Config.h\"
#include \"xf86Priv.h\"
@ -50,7 +77,7 @@ printf("/* \$$proj: \$ */
#include \"globals.h\"
#define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DEFAULT
#define MODEPREFIX(name) NULL, NULL, name, MODE_OK, M_T_DEFAULT
#define MODESUFFIX 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0
DisplayModeRec xf86DefaultModes [] = {

View file

@ -1,4 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/scoasm.h,v 3.0 1996/10/03 08:34:06 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/scoasm.h,v 3.1 2003/08/24 17:36:49 dawes Exp $ */
/*
* Copyright (c) 1996 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
* scoasm.h - used to define inline versions of certain functions which

View file

@ -1,7 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.169 2003/02/13 10:49:38 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.172 2003/09/24 02:43:16 dawes Exp $ */
/*
* Copyright (c) 1997 by The XFree86 Project, Inc.
* Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
@ -203,6 +226,11 @@ void xf86ProcessActionEvent(ActionEvent action, void *arg);
/* xf86Helper.c */
#ifdef printf
#define printf_defined
#undef printf
#endif
void xf86AddDriver(DriverPtr driver, pointer module, int flags);
void xf86DeleteDriver(int drvIndex);
ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
@ -221,12 +249,14 @@ void xf86EnableDisableFBAccess(int scrnIndex, Bool enable);
void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
const char *format, va_list args);
void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
const char *format, ...);
void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...);
void xf86MsgVerb(MessageType type, int verb, const char *format, ...);
void xf86Msg(MessageType type, const char *format, ...);
void xf86ErrorFVerb(int verb, const char *format, ...);
void xf86ErrorF(const char *format, ...);
const char *format, ...) _printf_attribute(4,5);
void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
_printf_attribute(3,4);
void xf86MsgVerb(MessageType type, int verb, const char *format, ...)
_printf_attribute(3,4);
void xf86Msg(MessageType type, const char *format, ...) _printf_attribute(2,3);
void xf86ErrorFVerb(int verb, const char *format, ...) _printf_attribute(2,3);
void xf86ErrorF(const char *format, ...) _printf_attribute(1,2);
const char *xf86TokenToString(SymTabPtr table, int token);
int xf86StringToToken(SymTabPtr table, const char *string);
void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
@ -334,6 +364,11 @@ void xf86AddModuleInfo(ModuleInfoPtr info, pointer module);
void xf86DeleteModuleInfo(int idx);
#endif
#ifdef printf_defined
#define printf xf86printf
#undef printf_defined
#endif
/* xf86Debug.c */
#ifdef BUILDDEBUG
void xf86Break1(void);
@ -402,6 +437,12 @@ void xf86RandRSetInitialMode (ScreenPtr pScreen);
Bool VidModeExtensionInit(ScreenPtr pScreen);
/* xf86Versions.c */
CARD32 xf86GetBuiltinInterfaceVersion(BuiltinInterface iface, int flag);
Bool xf86RegisterBuiltinInterfaceVersion(BuiltinInterface iface,
CARD32 version, int flags);
#endif /* _NO_XF86_PROTOTYPES */
#endif /* _XF86_H */

View file

@ -1,7 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.76 2003/02/21 17:19:34 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.79 2003/11/03 05:11:01 tsi Exp $ */
/*
* Copyright (c) 1997-1999 by The XFree86 Project, Inc.
* Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#define REDUCER
/*
* This file contains the interfaces to the bus-specific code
@ -1280,14 +1304,14 @@ xf86PrintResList(int verb, resPtr list)
switch (list->res_type & ResExtMask) {
case ResBlock:
xf86ErrorFVerb(verb,
"\t[%d] %d\t%d\t0x%08lx - 0x%08lx (0x%lx)",
"\t[%d] %d\t%ld\t0x%08lx - 0x%08lx (0x%lx)",
i, list->entityIndex,
(list->res_type & ResDomain) >> 24,
list->block_begin, list->block_end,
list->block_end - list->block_begin + 1);
break;
case ResSparse:
xf86ErrorFVerb(verb, "\t[%d] %d\t%d\t0x%08lx - 0x%08lx ",
xf86ErrorFVerb(verb, "\t[%d] %d\t%ld\t0x%08lx - 0x%08lx ",
i, list->entityIndex,
(list->res_type & ResDomain) >> 24,
list->sparse_base,list->sparse_mask);
@ -1581,7 +1605,6 @@ xf86GetSparse(unsigned long type, memType fixed_bits,
memType new_mask;
memType mask1;
memType base;
memType bits;
memType counter = 0;
memType counter1;
memType max_counter = ~(memType)0;
@ -1653,7 +1676,6 @@ xf86GetSparse(unsigned long type, memType fixed_bits,
counter = 0;
while (1) {
bits = make_base(counter,new_mask) | fixed_bits;
counter1 = 0;
while (1) {
base = make_base(counter1,mask1);
@ -2134,7 +2156,7 @@ static void
resError(resList list)
{
FatalError("A driver tried to allocate the %s %sresource at \n"
"0x%x:0x%x which conflicted with another resource. Send the\n"
"0x%lx:0x%lx which conflicted with another resource. Send the\n"
"output of the server to %s. Please \n"
"specify your computer hardware as closely as possible.\n",
ResIsBlock(list)?"Block":"Sparse",

View file

@ -1,6 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.h,v 1.21 2002/11/25 14:04:56 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.h,v 1.23 2003/08/24 17:36:50 dawes Exp $ */
/*
* Copyright (c) 1997 by The XFree86 Project, Inc.
* Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
@ -98,7 +122,6 @@ typedef struct x_BusAccRec {
int primary_bus;
PCITAG acc;
pciBridgesSave save;
void (*func)(PCITAG,int,CARD32,CARD32);
} pci;
} busdep;
} BusAccRec, *BusAccPtr;

View file

@ -1,17 +1,48 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.269 2003/02/20 04:36:07 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.277 2003/10/15 22:51:48 dawes Exp $ */
/*
* Copyright 1991-2002 by The XFree86 Project, Inc.
* Copyright 1997 by Metro Link, Inc.
*
* Loosely based on code bearing the following copyright:
*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*/
/*
* Copyright 1992-2003 by The XFree86 Project, Inc.
* Copyright 1997 by Metro Link, Inc.
*
* <Put copyright message here>
* 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:
*
* Author: Dirk Hohndel <hohndel@XFree86.Org> and others.
* 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
*
* Authors:
* Dirk Hohndel <hohndel@XFree86.Org>
* David Dawes <dawes@XFree86.Org>
* Marc La France <tsi@XFree86.Org>
* Egbert Eich <eich@XFree86.Org>
* ... and others
*/
#ifdef XF86DRI
@ -19,6 +50,10 @@
#include <grp.h>
#endif
#ifdef __UNIXOS2__
#define I_NEED_OS2_H
#endif
#include "xf86.h"
#include "xf86Parser.h"
#include "xf86tokens.h"
@ -905,9 +940,11 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
if (!xf86NameCmp(s,"flush")) {
xf86Msg(X_CONFIG, "Flushing logfile enabled\n");
xf86Info.log = LogFlush;
LogSetParameter(XLOG_FLUSH, TRUE);
} else if (!xf86NameCmp(s,"sync")) {
xf86Msg(X_CONFIG, "Syncing logfile enabled\n");
xf86Info.log = LogSync;
LogSetParameter(XLOG_SYNC, TRUE);
} else {
xf86Msg(X_WARNING,"Unknown Log option\n");
}
@ -1142,6 +1179,11 @@ configInputKbd(IDevPtr inputp)
case WSKBD_TYPE_SUN:
xf86Msg(X_PROBED, "Keyboard type: Sun\n");
break;
#endif
#ifdef WSKBD_TYPE_SUN5
case WSKBD_TYPE_SUN5:
xf86Msg(X_PROBED, "Keyboard type: Sun5\n");
break;
#endif
default:
xf86ConfigError("Unsupported wskbd type \"%d\"",
@ -1314,105 +1356,297 @@ configInputKbd(IDevPtr inputp)
return TRUE;
}
/*
* Locate the core input devices. These can be specified/located in
* the following ways, in order of priority:
*
* 1. The InputDevices named by the -pointer and -keyboard command line
* options.
* 2. The "CorePointer" and "CoreKeyboard" InputDevices referred to by
* the active ServerLayout.
* 3. The first InputDevices marked as "CorePointer" and "CoreKeyboard".
* 4. The first InputDevices that use the 'mouse' and 'keyboard' or 'kbd'
* drivers.
* 5. Default devices with an empty (default) configuration. These defaults
* will reference the 'mouse' and 'keyboard' drivers.
*/
static Bool
checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
{
Bool havePointer = FALSE, haveKeyboard = FALSE;
IDevPtr corePointer = NULL, coreKeyboard = NULL;
Bool foundPointer = FALSE, foundKeyboard = FALSE;
const char *pointerMsg = NULL, *keyboardMsg = NULL;
IDevPtr indp;
IDevRec Pointer, Keyboard;
XF86ConfInputPtr confInput;
XF86ConfInputRec defPtr, defKbd;
int count = 0;
MessageType from = X_DEFAULT;
/* Check if a core pointer or core keyboard is needed. */
/*
* First check if a core pointer or core keyboard have been specified
* in the active ServerLayout. If more than one is specified for either,
* remove the core attribute from the later ones.
*/
for (indp = servlayoutp->inputs; indp->identifier; indp++) {
if ((indp->commonOptions &&
xf86FindOption(indp->commonOptions, "CorePointer")) ||
(indp->extraOptions &&
xf86FindOption(indp->extraOptions, "CorePointer"))) {
havePointer = TRUE;
pointer opt1 = NULL, opt2 = NULL;
if (indp->commonOptions &&
xf86CheckBoolOption(indp->commonOptions, "CorePointer", FALSE)) {
opt1 = indp->commonOptions;
}
if ((indp->commonOptions &&
xf86FindOption(indp->commonOptions, "CoreKeyboard")) ||
(indp->extraOptions &&
xf86FindOption(indp->extraOptions, "CoreKeyboard"))) {
haveKeyboard = TRUE;
if (indp->extraOptions &&
xf86CheckBoolOption(indp->extraOptions, "CorePointer", FALSE)) {
opt2 = indp->extraOptions;
}
if (opt1 || opt2) {
if (!corePointer) {
corePointer = indp;
} else {
if (opt1)
xf86ReplaceBoolOption(opt1, "CorePointer", FALSE);
if (opt2)
xf86ReplaceBoolOption(opt2, "CorePointer", FALSE);
xf86Msg(X_WARNING, "Duplicate core pointer devices. "
"Removing core pointer attribute from \"%s\"\n",
indp->identifier);
}
}
opt1 = opt2 = NULL;
if (indp->commonOptions &&
xf86CheckBoolOption(indp->commonOptions, "CoreKeyboard", FALSE)) {
opt1 = indp->commonOptions;
}
if (indp->extraOptions &&
xf86CheckBoolOption(indp->extraOptions, "CoreKeyboard", FALSE)) {
opt2 = indp->extraOptions;
}
if (opt1 || opt2) {
if (!coreKeyboard) {
coreKeyboard = indp;
} else {
if (opt1)
xf86ReplaceBoolOption(opt1, "CoreKeyboard", FALSE);
if (opt2)
xf86ReplaceBoolOption(opt2, "CoreKeyboard", FALSE);
xf86Msg(X_WARNING, "Duplicate core keyboard devices. "
"Removing core keyboard attribute from \"%s\"\n",
indp->identifier);
}
}
count++;
}
if (!havePointer) {
if (xf86PointerName) {
confInput = xf86findInput(xf86PointerName,
xf86configptr->conf_input_lst);
if (!confInput) {
xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n",
xf86PointerName);
return FALSE;
}
from = X_CMDLINE;
} else {
from = X_DEFAULT;
confInput = xf86findInput(CONF_IMPLICIT_POINTER,
xf86configptr->conf_input_lst);
if (!confInput && implicitLayout) {
confInput = xf86findInputByDriver("mouse",
xf86configptr->conf_input_lst);
confInput = NULL;
/* 1. Check for the -pointer command line option. */
if (xf86PointerName) {
confInput = xf86findInput(xf86PointerName,
xf86configptr->conf_input_lst);
if (!confInput) {
xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n",
xf86PointerName);
return FALSE;
}
from = X_CMDLINE;
/*
* If one was already specified in the ServerLayout, it needs to be
* removed.
*/
if (corePointer) {
for (indp = servlayoutp->inputs; indp->identifier; indp++)
if (indp == corePointer)
break;
for (; indp->identifier; indp++)
indp[0] = indp[1];
count--;
}
corePointer = NULL;
foundPointer = TRUE;
}
/* 2. ServerLayout-specified core pointer. */
if (corePointer) {
foundPointer = TRUE;
from = X_CONFIG;
}
/* 3. First core pointer device. */
if (!foundPointer) {
XF86ConfInputPtr p;
for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
if (p->inp_option_lst &&
xf86CheckBoolOption(p->inp_option_lst, "CorePointer", FALSE)) {
confInput = p;
foundPointer = TRUE;
from = X_DEFAULT;
pointerMsg = "first core pointer device";
break;
}
}
if (confInput)
foundPointer = configInput(&Pointer, confInput, from);
}
if (!haveKeyboard) {
if (xf86KeyboardName) {
confInput = xf86findInput(xf86KeyboardName,
xf86configptr->conf_input_lst);
if (!confInput) {
xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n",
xf86KeyboardName);
return FALSE;
}
from = X_CMDLINE;
} else {
from = X_DEFAULT;
confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
xf86configptr->conf_input_lst);
if (!confInput && implicitLayout) {
confInput = xf86findInputByDriver("keyboard",
xf86configptr->conf_input_lst);
}
/* 4. First pointer with 'mouse' as the driver. */
if (!foundPointer) {
confInput = xf86findInput(CONF_IMPLICIT_POINTER,
xf86configptr->conf_input_lst);
if (!confInput) {
confInput = xf86findInputByDriver("mouse",
xf86configptr->conf_input_lst);
}
if (confInput) {
foundPointer = TRUE;
from = X_DEFAULT;
pointerMsg = "first mouse device";
}
if (confInput)
foundKeyboard = configInput(&Keyboard, confInput, from);
}
if (foundPointer) {
count++;
indp = xnfrealloc(servlayoutp->inputs, (count + 1) * sizeof(IDevRec));
indp[count - 1] = Pointer;
indp[count - 1].extraOptions = xf86addNewOption(NULL, "CorePointer", NULL);
indp[count].identifier = NULL;
servlayoutp->inputs = indp;
} else if (!havePointer) {
if (implicitLayout)
xf86Msg(X_ERROR, "Unable to find a core pointer device\n");
else
xf86Msg(X_ERROR, "No core pointer device specified\n");
/* 5. Built-in default. */
if (!foundPointer) {
bzero(&defPtr, sizeof(defPtr));
defPtr.inp_identifier = "<default pointer>";
defPtr.inp_driver = "mouse";
confInput = &defPtr;
foundPointer = TRUE;
from = X_DEFAULT;
pointerMsg = "default mouse configuration";
}
/* Add the core pointer device to the layout, and set it to Core. */
if (foundPointer && confInput) {
foundPointer = configInput(&Pointer, confInput, from);
if (foundPointer) {
count++;
indp = xnfrealloc(servlayoutp->inputs,
(count + 1) * sizeof(IDevRec));
indp[count - 1] = Pointer;
indp[count - 1].extraOptions =
xf86addNewOption(NULL, "CorePointer", NULL);
indp[count].identifier = NULL;
servlayoutp->inputs = indp;
}
}
if (!foundPointer) {
/* This shouldn't happen. */
xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n");
return FALSE;
}
if (foundKeyboard) {
count++;
indp = xnfrealloc(servlayoutp->inputs, (count + 1) * sizeof(IDevRec));
indp[count - 1] = Keyboard;
indp[count - 1].extraOptions = xf86addNewOption(NULL, "CoreKeyboard", NULL);
indp[count].identifier = NULL;
servlayoutp->inputs = indp;
} else if (!haveKeyboard) {
if (implicitLayout)
xf86Msg(X_ERROR, "Unable to find a core keyboard device\n");
else
xf86Msg(X_ERROR, "No core keyboard device specified\n");
confInput = NULL;
/* 1. Check for the -keyboard command line option. */
if (xf86KeyboardName) {
confInput = xf86findInput(xf86KeyboardName,
xf86configptr->conf_input_lst);
if (!confInput) {
xf86Msg(X_ERROR, "No InputDevice section called \"%s\"\n",
xf86KeyboardName);
return FALSE;
}
from = X_CMDLINE;
/*
* If one was already specified in the ServerLayout, it needs to be
* removed.
*/
if (coreKeyboard) {
for (indp = servlayoutp->inputs; indp->identifier; indp++)
if (indp == coreKeyboard)
break;
for (; indp->identifier; indp++)
indp[0] = indp[1];
count--;
}
coreKeyboard = NULL;
foundKeyboard = TRUE;
}
/* 2. ServerLayout-specified core keyboard. */
if (coreKeyboard) {
foundKeyboard = TRUE;
from = X_CONFIG;
}
/* 3. First core keyboard device. */
if (!foundKeyboard) {
XF86ConfInputPtr p;
for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
if (p->inp_option_lst &&
xf86CheckBoolOption(p->inp_option_lst, "CoreKeyboard", FALSE)) {
confInput = p;
foundKeyboard = TRUE;
from = X_DEFAULT;
keyboardMsg = "first core keyboard device";
break;
}
}
}
/* 4. First keyboard with 'keyboard' or 'kbd' as the driver. */
if (!foundKeyboard) {
confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
xf86configptr->conf_input_lst);
if (!confInput) {
confInput = xf86findInputByDriver("keyboard",
xf86configptr->conf_input_lst);
}
if (!confInput) {
confInput = xf86findInputByDriver("kbd",
xf86configptr->conf_input_lst);
}
if (confInput) {
foundKeyboard = TRUE;
from = X_DEFAULT;
pointerMsg = "first keyboard device";
}
}
/* 5. Built-in default. */
if (!foundKeyboard) {
bzero(&defKbd, sizeof(defKbd));
defKbd.inp_identifier = "<default keyboard>";
defKbd.inp_driver = "keyboard";
confInput = &defKbd;
foundKeyboard = TRUE;
keyboardMsg = "default keyboard configuration";
from = X_DEFAULT;
}
/* Add the core keyboard device to the layout, and set it to Core. */
if (foundKeyboard && confInput) {
foundKeyboard = configInput(&Keyboard, confInput, from);
if (foundKeyboard) {
count++;
indp = xnfrealloc(servlayoutp->inputs,
(count + 1) * sizeof(IDevRec));
indp[count - 1] = Keyboard;
indp[count - 1].extraOptions =
xf86addNewOption(NULL, "CoreKeyboard", NULL);
indp[count].identifier = NULL;
servlayoutp->inputs = indp;
}
}
if (!foundKeyboard) {
/* This shouldn't happen. */
xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n");
return FALSE;
}
if (pointerMsg) {
xf86Msg(X_WARNING, "The core pointer device wasn't specified "
"explicitly in the layout.\n"
"\tUsing the %s.\n", pointerMsg);
}
if (keyboardMsg) {
xf86Msg(X_WARNING, "The core keyboard device wasn't specified "
"explicitly in the layout.\n"
"\tUsing the %s.\n", keyboardMsg);
}
return TRUE;
}
@ -1767,6 +2001,7 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
int count = 0;
XF86ConfDisplayPtr dispptr;
XF86ConfAdaptorLinkPtr conf_adaptor;
Bool defaultMonitor = FALSE;
xf86Msg(from, "|-->Screen \"%s\" (%d)\n", conf_screen->scrn_identifier,
scrnum);
@ -1779,8 +2014,29 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
screenp->defaultbpp = conf_screen->scrn_defaultbpp;
screenp->defaultfbbpp = conf_screen->scrn_defaultfbbpp;
screenp->monitor = xnfcalloc(1, sizeof(MonRec));
if (!configMonitor(screenp->monitor,conf_screen->scrn_monitor))
return FALSE;
/* If no monitor is specified, create a default one. */
if (!conf_screen->scrn_monitor) {
XF86ConfMonitorRec defMon;
bzero(&defMon, sizeof(defMon));
defMon.mon_identifier = "<default monitor>";
/*
* TARGET_REFRESH_RATE may be defined to effectively limit the
* default resolution to the largest that has a "good" refresh
* rate.
*/
#ifdef TARGET_REFRESH_RATE
defMon.mon_option_lst = xf86ReplaceRealOption(defMon.mon_option_lst,
"TargetRefresh",
TARGET_REFRESH_RATE);
#endif
if (!configMonitor(screenp->monitor, &defMon))
return FALSE;
defaultMonitor = TRUE;
} else {
if (!configMonitor(screenp->monitor,conf_screen->scrn_monitor))
return FALSE;
}
screenp->device = xnfcalloc(1, sizeof(GDevRec));
configDevice(screenp->device,conf_screen->scrn_device, TRUE);
screenp->device->myScreenSection = screenp;
@ -1822,6 +2078,10 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum,
conf_adaptor = (XF86ConfAdaptorLinkPtr)conf_adaptor->list.next;
}
if (defaultMonitor) {
xf86Msg(X_WARNING, "No monitor specified for screen \"%s\".\n"
"\tUsing a default monitor configuration.\n", screenp->id);
}
return TRUE;
}
@ -2149,7 +2409,7 @@ configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, MessageType from)
return TRUE;
}
static Bool
modeIsPresent(char * modename,MonPtr monitorp)
{
@ -2207,35 +2467,38 @@ addDefaultModes(MonPtr monitorp)
/*
* load the config file and fill the global data structure
*/
Bool
xf86HandleConfigFile(void)
ConfigStatus
xf86HandleConfigFile(Bool autoconfig)
{
const char *filename;
char *searchpath;
MessageType from = X_DEFAULT;
if (getuid() == 0)
searchpath = ROOT_CONFIGPATH;
else
searchpath = USER_CONFIGPATH;
if (!autoconfig) {
if (getuid() == 0)
searchpath = ROOT_CONFIGPATH;
else
searchpath = USER_CONFIGPATH;
if (xf86ConfigFile)
from = X_CMDLINE;
filename = xf86openConfigFile(searchpath, xf86ConfigFile, PROJECTROOT);
if (filename) {
xf86MsgVerb(from, 0, "Using config file: \"%s\"\n", filename);
xf86ConfigFile = xnfstrdup(filename);
} else {
xf86Msg(X_ERROR, "Unable to locate/open config file");
if (xf86ConfigFile)
xf86ErrorFVerb(0, ": \"%s\"", xf86ConfigFile);
xf86ErrorFVerb(0, "\n");
return FALSE;
from = X_CMDLINE;
filename = xf86openConfigFile(searchpath, xf86ConfigFile, PROJECTROOT);
if (filename) {
xf86MsgVerb(from, 0, "Using config file: \"%s\"\n", filename);
xf86ConfigFile = xnfstrdup(filename);
} else {
xf86Msg(X_ERROR, "Unable to locate/open config file");
if (xf86ConfigFile)
xf86ErrorFVerb(0, ": \"%s\"", xf86ConfigFile);
xf86ErrorFVerb(0, "\n");
return CONFIG_NOFILE;
}
}
if ((xf86configptr = xf86readConfigFile ()) == NULL) {
xf86Msg(X_ERROR, "Problem parsing the config file\n");
return FALSE;
return CONFIG_PARSE_ERROR;
}
xf86closeConfigFile ();
@ -2260,7 +2523,7 @@ xf86HandleConfigFile(void)
if (!configImpliedLayout(&xf86ConfigLayout,
xf86configptr->conf_screen_lst)) {
xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
return FALSE;
return CONFIG_PARSE_ERROR;
}
} else {
if (xf86configptr->conf_flags != NULL) {
@ -2272,13 +2535,13 @@ xf86HandleConfigFile(void)
if (!configLayout(&xf86ConfigLayout, xf86configptr->conf_layout_lst,
dfltlayout)) {
xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
return FALSE;
return CONFIG_PARSE_ERROR;
}
} else {
if (!configLayout(&xf86ConfigLayout, xf86configptr->conf_layout_lst,
NULL)) {
xf86Msg(X_ERROR, "Unable to determine the screen layout\n");
return FALSE;
return CONFIG_PARSE_ERROR;
}
}
}
@ -2293,7 +2556,7 @@ xf86HandleConfigFile(void)
#endif
) {
ErrorF ("Problem when converting the config data structures\n");
return FALSE;
return CONFIG_PARSE_ERROR;
}
/*
@ -2317,7 +2580,7 @@ xf86HandleConfigFile(void)
if (xf86AllowMouseOpenFail)
xf86Info.allowMouseOpenFail = TRUE;
return TRUE;
return CONFIG_OK;
}

View file

@ -1,6 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.h,v 1.5 2000/02/24 05:36:50 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.h,v 1.7 2003/10/08 14:58:27 dawes Exp $ */
/*
* Copyright 1997 by The XFree86 Project, Inc
* Copyright (c) 1997-2000 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#ifndef _xf86_config_h
@ -13,6 +37,12 @@
extern XF86ConfigPtr xf86configptr;
#endif
typedef enum _ConfigStatus {
CONFIG_OK = 0,
CONFIG_PARSE_ERROR,
CONFIG_NOFILE
} ConfigStatus;
/*
* prototypes
*/
@ -22,6 +52,8 @@ char ** xf86DriverlistFromCompile(void);
char ** xf86InputDriverlistFromConfig(void);
char ** xf86InputDriverlistFromCompile(void);
Bool xf86BuiltinInputDriver(const char *);
Bool xf86HandleConfigFile(void);
ConfigStatus xf86HandleConfigFile(Bool);
Bool xf86AutoConfig(void);
#endif /* _xf86_config_h */

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.78 2003/01/18 07:27:13 paulo Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.81 2003/10/29 04:17:21 dawes Exp $ */
/*
* Copyright 2000-2002 by Alan Hourihane, Flint Mountain, North Wales.
*
@ -46,7 +46,7 @@
#include "Configint.h"
#include "vbe.h"
#include "xf86DDC.h"
#ifdef __sparc__
#if defined(__sparc__) && !defined(__OpenBSD__)
#include "xf86Bus.h"
#include "xf86Sbus.h"
#endif
@ -55,7 +55,7 @@
typedef struct _DevToConfig {
GDevRec GDev;
pciVideoPtr pVideo;
#ifdef __sparc__
#if defined(__sparc__) && !defined(__OpenBSD__)
sbusDevicePtr sVideo;
#endif
int iDriver;
@ -280,6 +280,8 @@ configureInputSection (void)
DFLT_MOUSE_DEV = "/dev/wsmouse";
DFLT_MOUSE_PROTO = "wsmouse";
close(fd);
} else {
ErrorF("cannot open /dev/wsmouse\n");
}
#endif
@ -868,7 +870,7 @@ DoConfigure()
xf86DoConfigurePass1 = FALSE;
/* Try to get DDC information filled in */
xf86ConfigFile = filename;
if (!xf86HandleConfigFile()) {
if (xf86HandleConfigFile(FALSE) != CONFIG_OK) {
goto bail;
}
@ -990,7 +992,7 @@ DoConfigure()
ErrorF("To test the server, run 'XFree86 -xf86config %s'\n\n", filename);
bail:
OsCleanup();
OsCleanup(TRUE);
AbortDDX();
fflush(stderr);
exit(0);

View file

@ -1,4 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c,v 3.35 2003/02/13 10:49:38 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Cursor.c,v 3.37 2003/11/07 22:20:17 dawes Exp $ */
/*
* Copyright (c) 1994-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XConsortium: xf86Cursor.c /main/10 1996/10/19 17:58:23 kaleb $ */
#define NEED_EVENTS
@ -77,11 +104,16 @@ xf86InitViewport(ScrnInfoPtr pScr)
/*
* Compute the initial Viewport if necessary
*/
if (pScr->frameX0 < 0)
{
if (pScr->display) {
if (pScr->display->frameX0 < 0) {
pScr->frameX0 = (pScr->virtualX - pScr->modes->HDisplay) / 2;
pScr->frameY0 = (pScr->virtualY - pScr->modes->VDisplay) / 2;
} else {
pScr->frameX0 = pScr->display->frameX0;
pScr->frameY0 = pScr->display->frameY0;
}
}
pScr->frameX1 = pScr->frameX0 + pScr->modes->HDisplay - 1;
pScr->frameY1 = pScr->frameY0 + pScr->modes->VDisplay - 1;

View file

@ -1,9 +1,32 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DGA.c,v 1.47 2003/08/24 17:36:51 dawes Exp $ */
/*
Copyright (c) 1999 - The XFree86 Project, Inc.
Written by Mark Vojkovich
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DGA.c,v 1.46 2002/12/03 18:17:40 tsi Exp $ */
* Copyright (c) 1998-2002 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*
* Written by Mark Vojkovich
*/
#include "xf86.h"
#include "xf86str.h"

View file

@ -1,7 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.8 2003/02/13 02:41:09 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DPMS.c,v 1.11 2003/11/11 21:02:28 dawes Exp $ */
/*
* Copyright (c) 1997-1998 by The XFree86 Project, Inc.
* Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
@ -14,6 +37,8 @@
#include "xf86.h"
#include "xf86Priv.h"
#ifdef DPMSExtension
#define DPMS_SERVER
#include "extensions/dpms.h"
#include "dpmsproc.h"
#endif
@ -30,6 +55,7 @@ Bool
xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
{
#ifdef DPMSExtension
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
DPMSPtr pDPMS;
pointer DPMSOpt;
@ -45,13 +71,12 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
return FALSE;
pDPMS = (DPMSPtr)pScreen->devPrivates[DPMSIndex].ptr;
pDPMS->Set = set;
pScrn->DPMSSet = set;
pDPMS->Flags = flags;
DPMSOpt = xf86FindOption(xf86Screens[pScreen->myNum]->options, "dpms");
DPMSOpt = xf86FindOption(pScrn->options, "dpms");
if (DPMSOpt) {
if ((pDPMS->Enabled
= xf86SetBoolOption(xf86Screens[pScreen->myNum]->options,
"dpms",FALSE))
= xf86SetBoolOption(pScrn->options, "dpms", FALSE))
&& !DPMSDisabledSwitch)
DPMSEnabled = TRUE;
xf86MarkOptionUsed(DPMSOpt);
@ -111,18 +136,23 @@ DPMSSet(int level)
{
int i;
DPMSPtr pDPMS;
ScrnInfoPtr pScrn;
DPMSPowerLevel = level;
if (DPMSIndex < 0)
return;
if (level != DPMSModeOn)
SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverActive);
/* For each screen, set the DPMS level */
for (i = 0; i < xf86NumScreens; i++) {
pScrn = xf86Screens[i];
pDPMS = (DPMSPtr)screenInfo.screens[i]->devPrivates[DPMSIndex].ptr;
if (pDPMS && pDPMS->Set && pDPMS->Enabled && xf86Screens[i]->vtSema) {
xf86EnableAccess(xf86Screens[i]);
pDPMS->Set(xf86Screens[i], level, 0);
if (pDPMS && pScrn->DPMSSet && pDPMS->Enabled && pScrn->vtSema) {
xf86EnableAccess(pScrn);
pScrn->DPMSSet(pScrn, level, 0);
}
}
}
@ -137,6 +167,7 @@ DPMSSupported(void)
{
int i;
DPMSPtr pDPMS;
ScrnInfoPtr pScrn;
if (DPMSIndex < 0) {
return FALSE;
@ -144,8 +175,9 @@ DPMSSupported(void)
/* For each screen, check if DPMS is supported */
for (i = 0; i < xf86NumScreens; i++) {
pScrn = xf86Screens[i];
pDPMS = (DPMSPtr)screenInfo.screens[i]->devPrivates[DPMSIndex].ptr;
if (pDPMS && pDPMS->Set)
if (pDPMS && pScrn->DPMSSet)
return TRUE;
}
return FALSE;

View file

@ -1,7 +1,33 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.3.2.3 2003/05/10 01:10:10 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Date.h,v 1.52 2003/11/21 06:01:44 dawes Exp $ */
/*
* Copyright (c) 2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#ifndef XF86_DATE
#define XF86_DATE "9 May 2003"
#define XF86_DATE "20 November 2003"
#endif

View file

@ -1,4 +1,35 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Debug.c,v 1.4 2001/12/13 18:01:50 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Debug.c,v 1.7 2003/09/24 02:43:17 dawes Exp $ */
/*
* Copyright (c) 2000-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#ifdef __UNIXOS2__
#define I_NEED_OS2_H
#endif
#include <sys/time.h>
#include <unistd.h>
@ -154,7 +185,7 @@ xf86SPTimestamp(xf86TsPtr* timestamp, char *str)
else
diff = ((*timestamp)->sec - ts.tv_sec) * 1000
+(- ts.tv_usec + (*timestamp)->usec) / 1000;
ErrorF("%s Elapsed: %i\n",str,diff);
ErrorF("%s Elapsed: %li\n",str,diff);
} else {
*timestamp = xnfalloc(sizeof(xf86TsRec));
gettimeofday((struct timeval*)*timestamp,NULL);

View file

@ -1,14 +1,17 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DefModes.c,v 1.9 2002/11/11 04:24:40 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DefModes.c,v 1.10 2003/11/03 05:11:02 tsi Exp $ */
/* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at
* modeline2c.pl */
/*
* Copyright 1999 by The XFree86 Project, Inc.
* Copyright 1999-2003 by The XFree86 Project, Inc.
*
* Author: Dirk Hohndel <hohndel@XFree86.Org>
*/
#ifdef __UNIXOS2__
#define I_NEED_OS2_H
#endif
#include "xf86.h"
#include "xf86Config.h"
#include "xf86Priv.h"
@ -16,7 +19,7 @@
#include "globals.h"
#define MODEPREFIX(name) NULL, NULL, name, 0,M_T_DEFAULT
#define MODEPREFIX(name) NULL, NULL, name, MODE_OK, M_T_DEFAULT
#define MODESUFFIX 0,0, 0,0,0,0,0,0,0, 0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0
DisplayModeRec xf86DefaultModes [] = {

View file

@ -1,10 +1,34 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c,v 1.11 2002/07/02 02:00:03 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoProbe.c,v 1.14 2003/10/29 04:17:21 dawes Exp $ */
/*
* Copyright (c) 1999-2002 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
* finish setting up the server
* Load the driver modules and call their probe functions.
*
* Copyright 1999 by The XFree86 Project, Inc.
*
*/
#include <ctype.h>
@ -67,16 +91,14 @@ DoProbe()
/* If we have a result, then call driver's Identify function */
if (xf86DriverList[i]->Identify != NULL) {
int verbose = xf86Verbose;
xf86Verbose = 1;
int verbose = xf86SetVerbosity(1);
(*xf86DriverList[i]->Identify)(0);
xf86Verbose = verbose;
xf86SetVerbosity(verbose);
}
}
}
OsCleanup();
OsCleanup(TRUE);
AbortDDX();
fflush(stderr);
exit(0);

View file

@ -1,11 +1,34 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c,v 1.15 2003/09/23 06:43:46 dawes Exp $ */
/*
* Copyright (c) 1999-2002 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86DoScanPci.c,v 1.12 2002/07/15 20:46:01 dawes Exp $ */
/*
* Finish setting up the server.
* Call the functions from the scanpci module.
*
* Copyright 1999-2002 by The XFree86 Project, Inc.
*
*/
#include <ctype.h>
@ -38,11 +61,12 @@ void DoScanPci(int argc, char **argv, int i)
OsInit();
/*
* now we decrease verbosity and remember the value, in case a later
* -verbose on the command line increases it, because that is a
* verbose flag for scanpci...
* The old verbosity processing that was here isn't useful anymore, but
* for compatibility purposes, ignore verbosity changes after the -scanpci
* flag.
*/
globalVerbose = --xf86Verbose;
globalVerbose = xf86Verbose;
/*
* next we process the arguments that are remaining on the command line,
* so that things like the module path can be set there
@ -51,14 +75,19 @@ void DoScanPci(int argc, char **argv, int i)
if ((skip = ddxProcessArgument(argc, argv, j)))
j += (skip - 1);
}
/*
* was the verbosity level increased?
* Was the verbosity level increased? If so, set it back.
*/
if( (globalVerbose == 0) && (xf86Verbose > 0) )
scanpciVerbose = xf86Verbose - globalVerbose -1;
else
scanpciVerbose = xf86Verbose - globalVerbose;
xf86Verbose = globalVerbose;
if (xf86Verbose > globalVerbose)
xf86SetVerbosity(globalVerbose);
/*
* Setting scanpciVerbose to 0 will ensure that the output will go to
* stderr for all reasonable default stderr verbosity levels.
*/
scanpciVerbose = 0;
/*
* now get the loader set up and load the scanpci module
*/

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.146 2003/02/20 04:20:52 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.158 2003/11/03 05:11:02 tsi Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
@ -21,10 +21,41 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* Copyright (c) 1994-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XConsortium: xf86Events.c /main/46 1996/10/25 11:36:30 kaleb $ */
/* [JCH-96/01/21] Extended std reverse map to four buttons. */
#ifdef __UNIXOS2__
#define I_NEED_OS2_H
#endif
#include "X.h"
#include "Xpoll.h"
#include "Xproto.h"
@ -315,10 +346,14 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
CloseDownClient(server);
}
break;
#if !defined(__SOL8__) && (!defined(sun) || defined(i386))
#if !defined(__SOL8__) && !defined(__UNIXOS2__) && !defined(sgi) && \
(!defined(sun) || defined(i386))
case ACTION_SWITCHSCREEN:
if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) {
int vtno = *((int *) arg);
#ifdef SCO
vtno--;
#endif
#if defined(QNX4)
xf86Info.vtRequestsPending = vtno;
#else
@ -329,8 +364,12 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
break;
case ACTION_SWITCHSCREEN_NEXT:
if (VTSwitchEnabled && !xf86Info.dontVTSwitch) {
#if defined(SCO) /* Shouldn't this be true for (sun) && (i386) && (SVR4) ? */
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0)
#else
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno + 1) < 0)
#if defined(SCO) || (defined(sun) && defined (i386) && defined (SVR4))
#endif
#if defined (SCO) || (defined(sun) && defined (i386) && defined (SVR4))
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 0) < 0)
#else
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 1) < 0)
@ -339,12 +378,36 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
}
break;
case ACTION_SWITCHSCREEN_PREV:
if (VTSwitchEnabled && !xf86Info.dontVTSwitch) {
if (VTSwitchEnabled && !xf86Info.dontVTSwitch && xf86Info.vtno > 0) {
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno - 1) < 0)
ErrorF("Failed to switch consoles (%s)\n", strerror(errno));
}
break;
#endif
case ACTION_MESSAGE:
{
char *retstr, *message = (char *) arg;
ScrnInfoPtr pScr = XF86SCRNINFO(xf86Info.currentScreen);
#ifdef DEBUG
ErrorF("ActionMessage: '%s'\n", message);
#endif
/* Okay the message made it to the ddx. The common layer */
/* can check for relevant messages here and react to any */
/* that have a global effect. For example: */
/* */
/* if (!strcmp(message, "foo") { */
/* do_foo(); break */
/* } */
/* */
/* otherwise fallback to sending a key event message to */
/* the current screen's driver: */
if (*pScr->HandleMessage) {
(void) (*pScr->HandleMessage)(pScr->scrnIndex,
"KeyEventMessage", message, &retstr);
}
}
break;
default:
break;
}
@ -384,7 +447,7 @@ xf86PostKbdEvent(unsigned key)
#if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) || defined(WSCONS_SUPPORT)
static Bool first_time = TRUE;
#endif
#if defined(__sparc__)
#if defined(__sparc__) && defined(__linux__)
static int kbdSun = -1;
#endif
/* Disable any keyboard processing while in suspend */
@ -400,7 +463,7 @@ xf86PostKbdEvent(unsigned key)
}
#endif
#if defined (__sparc__)
#if defined (__sparc__) && defined(__linux__)
if (kbdSun == -1) {
if ((xf86Info.xkbmodel && !strcmp(xf86Info.xkbmodel, "sun"))
|| (xf86Info.xkbrules && !strcmp(xf86Info.xkbrules, "sun")))
@ -410,26 +473,7 @@ xf86PostKbdEvent(unsigned key)
}
if (kbdSun)
goto special;
#endif /* __sparc__ */
#if defined (i386) && defined (SVR4)
/*
* PANIX returns DICOP standards based keycodes in using 106jp
* keyboard. We need to remap some keys.
*/
if(xf86Info.panix106 == TRUE){
switch (scanCode) {
case 0x56: scanCode = KEY_BSlash2; break; /* Backslash */
case 0x5A: scanCode = KEY_NFER; break; /* No Kanji Transfer*/
case 0x5B: scanCode = KEY_XFER; break; /* Kanji Tranfer */
case 0x5C: scanCode = KEY_Yen; break; /* Yen curs pgup */
case 0x6B: scanCode = KEY_Left; break; /* Cur Left */
case 0x6F: scanCode = KEY_PgUp; break; /* Cur PageUp */
case 0x72: scanCode = KEY_AltLang; break; /* AltLang(right) */
case 0x73: scanCode = KEY_RCtrl; break; /* not needed */
}
}
#endif /* i386 && SVR4 */
#endif /* __sparc__ && __linux__ */
#ifdef __linux__
if (xf86Info.kbdCustomKeycodes) {
@ -461,6 +505,56 @@ xf86PostKbdEvent(unsigned key)
break;
#endif
}
#if defined (i386) && defined (SVR4)
/*
* PANIX returns DICOP standards based keycodes in using 106jp
* keyboard. We need to remap some keys.
*/
if(xf86Info.panix106 == TRUE){
switch (scanCode) {
case 0x56: scanCode = KEY_BSlash2; break; /* Backslash */
case 0x5A: scanCode = KEY_NFER; break; /* No Kanji Transfer*/
case 0x5B: scanCode = KEY_XFER; break; /* Kanji Tranfer */
case 0x5C: scanCode = KEY_Yen; break; /* Yen curs pgup */
case 0x6B: scanCode = KEY_Left; break; /* Cur Left */
case 0x6F: scanCode = KEY_PgUp; break; /* Cur PageUp */
case 0x72: scanCode = KEY_AltLang; break; /* AltLang(right) */
case 0x73: scanCode = KEY_RCtrl; break; /* not needed */
}
} else
#endif /* i386 && SVR4 */
{
switch (scanCode) {
case 0x59: scanCode = KEY_0x59; break;
case 0x5a: scanCode = KEY_0x5A; break;
case 0x5b: scanCode = KEY_0x5B; break;
case 0x5c: scanCode = KEY_KP_Equal; break; /* Keypad Equal */
case 0x5d: scanCode = KEY_0x5D; break;
case 0x5e: scanCode = KEY_0x5E; break;
case 0x5f: scanCode = KEY_0x5F; break;
case 0x62: scanCode = KEY_0x62; break;
case 0x63: scanCode = KEY_0x63; break;
case 0x64: scanCode = KEY_0x64; break;
case 0x65: scanCode = KEY_0x65; break;
case 0x66: scanCode = KEY_0x66; break;
case 0x67: scanCode = KEY_0x67; break;
case 0x68: scanCode = KEY_0x68; break;
case 0x69: scanCode = KEY_0x69; break;
case 0x6a: scanCode = KEY_0x6A; break;
case 0x6b: scanCode = KEY_0x6B; break;
case 0x6c: scanCode = KEY_0x6C; break;
case 0x6d: scanCode = KEY_0x6D; break;
case 0x6e: scanCode = KEY_0x6E; break;
case 0x6f: scanCode = KEY_0x6F; break;
case 0x70: scanCode = KEY_0x70; break;
case 0x71: scanCode = KEY_0x71; break;
case 0x72: scanCode = KEY_0x72; break;
case 0x73: scanCode = KEY_0x73; break;
case 0x74: scanCode = KEY_0x74; break;
case 0x75: scanCode = KEY_0x75; break;
case 0x76: scanCode = KEY_0x76; break;
}
}
}
else if (
@ -534,6 +628,19 @@ xf86PostKbdEvent(unsigned key)
scanCode = KEY_Pause; /* pause */
}
#ifndef __sparc64__
/*
* PC keyboards generate separate key codes for
* Alt+Print and Control+Pause but in the X keyboard model
* they need to get the same key code as the base key on the same
* physical keyboard key.
*/
if (scanCode == KEY_SysReqest)
scanCode = KEY_Print;
else if (scanCode == KEY_Break)
scanCode = KEY_Pause;
#endif
/*
* and now get some special keysequences
*/
@ -568,7 +675,7 @@ customkeycodes:
}
}
#endif
#if defined (__sparc__)
#if defined (__sparc__) && defined(__linux__)
special:
if (kbdSun) {
switch (scanCode) {
@ -602,7 +709,7 @@ special:
*/
scanCode--;
}
#endif /* defined (__sparc__) */
#endif /* defined (__sparc__) && defined(__linux__) */
#ifdef XKB
if ((xf86Info.ddxSpecialKeys == SKWhenNeeded &&
@ -692,9 +799,6 @@ special:
int vtno = specialkey - KEY_F1 + 1;
if (specialkey == KEY_F11 || specialkey == KEY_F12)
vtno = specialkey - KEY_F11 + 11;
#ifdef SCO325
vtno--;
#endif
if (down)
xf86ProcessActionEvent(ACTION_SWITCHSCREEN, (void *) &vtno);
return;
@ -828,17 +932,6 @@ special:
}
#endif
/*
* PC keyboards generate separate key codes for
* Alt+Print and Control+Pause but in the X keyboard model
* they need to get the same key code as the base key on the same
* physical keyboard key.
*/
if (scanCode == KEY_SysReqest)
scanCode = KEY_Print;
else if (scanCode == KEY_Break)
scanCode = KEY_Pause;
/*
* Now map the scancodes to real X-keycodes ...
*/
@ -1060,16 +1153,16 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
pInfo = xf86InputDevs;
while (pInfo) {
if (pInfo->read_input && pInfo->fd >= 0 &&
(FD_ISSET(pInfo->fd, ((fd_set *)pReadmask)) != 0)) {
(FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) {
int sigstate = xf86BlockSIGIO();
pInfo->read_input(pInfo);
xf86UnblockSIGIO(sigstate);
/*
* Must break here because more than one device may share
* the same file descriptor.
* Remove the descriptior from the set because more than one
* device may share the same file descriptor.
*/
break;
FD_CLR(pInfo->fd, &devicesWithInput);
}
pInfo = pInfo->next;
}

View file

@ -1,7 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.40 2003/02/20 04:05:14 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Globals.c,v 1.41 2003/08/24 17:36:52 dawes Exp $ */
/*
* Copyright (c) 1997 by The XFree86 Project, Inc.
* Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*

View file

@ -1,10 +1,36 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.128 2003/02/26 23:45:24 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.135 2003/10/08 14:58:27 dawes Exp $ */
/*
* Copyright (c) 1997-1998 by The XFree86 Project, Inc.
* Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
* Authors: Dirk Hohndel <hohndel@XFree86.Org>
* David Dawes <dawes@XFree86.Org>
* ... and others
*
* This file includes the helper functions that the server provides for
* different drivers.
@ -38,7 +64,6 @@
#endif
static int xf86ScrnInfoPrivateCount = 0;
static FILE *logfile = NULL;
#ifdef XFree86LOADER
@ -405,6 +430,14 @@ xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad)
/* Can the screen handle 24bpp pixmaps for 32bpp fb */
#define DO_PIX24FOR32(f) ((f & Support32bppFb) && (f & SupportConvert24to32))
#ifndef GLOBAL_DEFAULT_DEPTH
#define GLOBAL_DEFAULT_DEPTH 16
#endif
#ifndef GLOBAL_DEFAULT_FBBPP
#define GLOBAL_DEFAULT_FBBPP 16
#endif
Bool
xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
int depth24flags)
@ -449,6 +482,39 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
scrp->depth = scrp->confScreen->defaultdepth;
scrp->depthFrom = X_CONFIG;
}
if (scrp->confScreen->defaultfbbpp <= 0 &&
scrp->confScreen->defaultdepth <= 0) {
/*
* Check for DefaultDepth and DefaultFbBpp options in the
* Device sections.
*/
int i;
GDevPtr device;
Bool found = FALSE;
for (i = 0; i < scrp->numEntities; i++) {
device = xf86GetDevFromEntity(scrp->entityList[i],
scrp->entityInstanceList[i]);
if (device && device->options) {
if (xf86FindOption(device->options, "DefaultDepth")) {
scrp->depth = xf86SetIntOption(device->options,
"DefaultDepth", -1);
scrp->depthFrom = X_CONFIG;
found = TRUE;
}
if (xf86FindOption(device->options, "DefaultFbBpp")) {
scrp->bitsPerPixel = xf86SetIntOption(device->options,
"DefaultFbBpp",
-1);
scrp->bitsPerPixelFrom = X_CONFIG;
found = TRUE;
}
}
if (found)
break;
}
}
}
/* If none of these is set, pick a default */
@ -459,8 +525,8 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
if (depth > 0)
scrp->depth = depth;
} else {
scrp->bitsPerPixel = 8;
scrp->depth = 8;
scrp->bitsPerPixel = GLOBAL_DEFAULT_FBBPP;
scrp->depth = GLOBAL_DEFAULT_DEPTH;
}
}
@ -610,11 +676,46 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
break;
}
}
/*
* If an exact match can't be found, see if there is one with no
* depth or fbbpp specified.
*/
if (i == scrp->confScreen->numdisplays) {
xf86DrvMsg(scrp->scrnIndex, X_ERROR, "No Display subsection "
"in Screen section \"%s\" for depth/fbbpp %d/%d\n",
for (i = 0, disp = scrp->confScreen->displays;
i < scrp->confScreen->numdisplays; i++, disp++) {
if (disp->depth <= 0 && disp->fbbpp <= 0) {
scrp->display = disp;
break;
}
}
}
/*
* If all else fails, create a default one.
*/
if (i == scrp->confScreen->numdisplays) {
scrp->confScreen->numdisplays++;
scrp->confScreen->displays =
xnfrealloc(scrp->confScreen->displays,
scrp->confScreen->numdisplays * sizeof(DispRec));
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"Creating default Display subsection in Screen section\n"
"\t\"%s\" for depth/fbbpp %d/%d\n",
scrp->confScreen->id, scrp->depth, scrp->bitsPerPixel);
return FALSE;
memset(&scrp->confScreen->displays[i], 0, sizeof(DispRec));
scrp->confScreen->displays[i].blackColour.red = -1;
scrp->confScreen->displays[i].blackColour.green = -1;
scrp->confScreen->displays[i].blackColour.blue = -1;
scrp->confScreen->displays[i].whiteColour.red = -1;
scrp->confScreen->displays[i].whiteColour.green = -1;
scrp->confScreen->displays[i].whiteColour.blue = -1;
scrp->confScreen->displays[i].defaultVisual = -1;
scrp->confScreen->displays[i].modes = xnfalloc(sizeof(char *));
scrp->confScreen->displays[i].modes[0] = NULL;
scrp->confScreen->displays[i].depth = depth;
scrp->confScreen->displays[i].fbbpp = fbbpp;
scrp->display = &scrp->confScreen->displays[i];
}
/*
@ -720,15 +821,17 @@ xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask)
if (scrp->weight.red)
xf86DrvMsg(scrp->scrnIndex, weightFrom, "RGB weight %d%d%d\n",
scrp->weight.red, scrp->weight.green, scrp->weight.blue);
(int)scrp->weight.red, (int)scrp->weight.green,
(int)scrp->weight.blue);
if (scrp->depth > MAX_PSEUDO_DEPTH &&
(scrp->depth != scrp->weight.red + scrp->weight.green +
scrp->weight.blue)) {
xf86DrvMsg(scrp->scrnIndex, X_ERROR,
"Weight given (%d%d%d) is inconsistent with the "
"depth (%d)\n", scrp->weight.red, scrp->weight.green,
scrp->weight.blue, scrp->depth);
"depth (%d)\n",
(int)scrp->weight.red, (int)scrp->weight.green,
(int)scrp->weight.blue, scrp->depth);
return FALSE;
}
if (scrp->depth > MAX_PSEUDO_DEPTH && scrp->weight.red) {
@ -1194,123 +1297,36 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
}
}
/* Buffer to hold log data written before the log file is opened */
static char *saveBuffer = NULL;
static int size = 0, unused = 0, pos = 0;
/* These functions do the actual writes. */
static void
VWrite(int verb, const char *f, va_list args)
{
static char buffer[1024];
int len = 0;
/*
* Since a va_list can only be processed once, write the string to a
* buffer, and then write the buffer out to the appropriate output
* stream(s).
*/
if (verb < 0 || xf86LogVerbose >= verb || xf86Verbose >= verb) {
vsnprintf(buffer, sizeof(buffer), f, args);
len = strlen(buffer);
}
if ((verb < 0 || xf86Verbose >= verb) && len > 0)
fwrite(buffer, len, 1, stderr);
if ((verb < 0 || xf86LogVerbose >= verb) && len > 0) {
if (logfile) {
fwrite(buffer, len, 1, logfile);
if (xf86Info.log) {
fflush(logfile);
if (xf86Info.log == LogSync)
fsync(fileno(logfile));
}
} else {
/*
* Note, this code is used before OsInit() has been called, so
* xalloc and friends can't be used.
*/
if (len > unused) {
size += 1024;
unused += 1024;
saveBuffer = realloc(saveBuffer, size);
if (!saveBuffer)
FatalError("realloc() failed while saving log messages\n");
}
unused -= len;
memcpy(saveBuffer + pos, buffer, len);
pos += len;
}
}
}
static void
Write(int verb, const char *f, ...)
{
va_list args;
va_start(args, f);
VWrite(verb, f, args);
va_end(args);
}
/* Print driver messages in the standard format */
#undef PREFIX_SIZE
#define PREFIX_SIZE 14
void
xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format,
va_list args)
{
char *s = X_UNKNOWN_STRING;
/* Ignore verbosity for X_ERROR */
if (xf86Verbose >= verb || xf86LogVerbose >= verb || type == X_ERROR) {
switch (type) {
case X_PROBED:
s = X_PROBE_STRING;
break;
case X_CONFIG:
s = X_CONFIG_STRING;
break;
case X_DEFAULT:
s = X_DEFAULT_STRING;
break;
case X_CMDLINE:
s = X_CMDLINE_STRING;
break;
case X_NOTICE:
s = X_NOTICE_STRING;
break;
case X_ERROR:
s = X_ERROR_STRING;
if (verb > 0)
verb = 0;
break;
case X_WARNING:
s = X_WARNING_STRING;
break;
case X_INFO:
s = X_INFO_STRING;
break;
case X_NOT_IMPLEMENTED:
s = X_NOT_IMPLEMENTED_STRING;
break;
case X_NONE:
s = NULL;
break;
}
char *tmpFormat;
if (s != NULL)
Write(verb, "%s ", s);
if (scrnIndex >= 0 && scrnIndex < xf86NumScreens)
Write(verb, "%s(%d): ", xf86Screens[scrnIndex]->name, scrnIndex);
VWrite(verb, format, args);
#if 0
if (type == X_ERROR && xf86Verbose < xf86LogVerbose) {
fprintf(stderr, X_ERROR_STRING " Please check the log file \"%s\""
" >before<\n\treporting a problem.\n", xf86LogFile);
}
#endif
}
/* Prefix the scrnIndex name to the format string. */
if (scrnIndex >= 0 && scrnIndex < xf86NumScreens &&
xf86Screens[scrnIndex]->name) {
tmpFormat = xalloc(strlen(format) +
strlen(xf86Screens[scrnIndex]->name) +
PREFIX_SIZE + 1);
if (!tmpFormat)
return;
snprintf(tmpFormat, PREFIX_SIZE + 1, "%s(%d): ",
xf86Screens[scrnIndex]->name, scrnIndex);
strcat(tmpFormat, format);
LogVMessageVerb(type, verb, tmpFormat, args);
xfree(tmpFormat);
} else
LogVMessageVerb(type, verb, format, args);
}
#undef PREFIX_SIZE
/* Print driver messages, with verbose level specified directly */
void
@ -1365,7 +1381,7 @@ xf86ErrorFVerb(int verb, const char *format, ...)
va_start(ap, format);
if (xf86Verbose >= verb || xf86LogVerbose >= verb)
VWrite(verb, format, ap);
LogVWrite(verb, format, ap);
va_end(ap);
}
@ -1377,15 +1393,10 @@ xf86ErrorF(const char *format, ...)
va_start(ap, format);
if (xf86Verbose >= 1 || xf86LogVerbose >= 1)
VWrite(1, format, ap);
LogVWrite(1, format, ap);
va_end(ap);
}
void
OsVendorVErrorF(const char *f, va_list args)
{
VWrite(-1, f, args);
}
void
xf86LogInit()
@ -1398,59 +1409,28 @@ xf86LogInit()
/* Get the log file name */
if (xf86LogFileFrom == X_DEFAULT) {
/* Append the display number and ".log" */
lf = malloc(strlen(xf86LogFile) + strlen(display) +
lf = malloc(strlen(xf86LogFile) + strlen("%s") +
strlen(LOGSUFFIX) + 1);
if (!lf)
FatalError("Cannot allocate space for the log file name\n");
sprintf(lf, "%s%s" LOGSUFFIX, xf86LogFile, display);
sprintf(lf, "%s%%s" LOGSUFFIX, xf86LogFile);
xf86LogFile = lf;
}
{
struct stat buf;
if (!stat(xf86LogFile,&buf) && S_ISREG(buf.st_mode)) {
char *oldlog = (char *)malloc(strlen(xf86LogFile)
+ strlen(LOGOLDSUFFIX));
if (!oldlog)
FatalError("Cannot allocate space for the log file name\n");
sprintf(oldlog, "%s" LOGOLDSUFFIX, xf86LogFile);
if (rename(xf86LogFile,oldlog) == -1)
FatalError("Cannot move old logfile \"%s\"\n",oldlog);
free(oldlog);
}
}
if ((logfile = fopen(xf86LogFile, "w")) == NULL)
FatalError("Cannot open log file \"%s\"\n", xf86LogFile);
xf86LogFileWasOpened = TRUE;
setvbuf(logfile, NULL, _IONBF, 0);
#ifdef DDXOSVERRORF
if (!OsVendorVErrorFProc)
OsVendorVErrorFProc = OsVendorVErrorF;
#endif
/* Flush saved log information */
if (saveBuffer && size > 0) {
fwrite(saveBuffer, pos, 1, logfile);
if (xf86Info.log) {
fflush(logfile);
if (xf86Info.log == LogFlush)
fsync(fileno(logfile));
}
free(saveBuffer); /* Note, must be free(), not xfree() */
saveBuffer = 0;
size = 0;
}
xf86LogFile = LogInit(xf86LogFile, LOGOLDSUFFIX);
xf86LogFileWasOpened = TRUE;
xf86SetVerbosity(xf86Verbose);
xf86SetLogVerbosity(xf86LogVerbose);
#undef LOGSUFFIX
#undef LOGOLDSUFFIX
}
void
xf86CloseLog()
{
if (logfile) {
fclose(logfile);
logfile = NULL;
}
LogClose();
}
@ -1826,7 +1806,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
if (dev || devBus)
xf86MsgVerb(X_WARNING, 0,
"%s: More than one matching Device section "
"found: %s\n", devList[j]->identifier);
"found: %s\n", driverName, devList[j]->identifier);
else
dev = devList[j];
}
@ -2233,7 +2213,6 @@ xf86GetVerbosity()
return max(xf86Verbose, xf86LogVerbose);
}
Pix24Flags
xf86GetPix24()
{

View file

@ -1,4 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86InPriv.h,v 1.4 1999/05/17 13:17:14 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86InPriv.h,v 1.5 2003/08/24 17:36:52 dawes Exp $ */
/*
* Copyright (c) 1999 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#ifndef _xf86InPriv_h
#define _xf86InPriv_h

View file

@ -1,16 +1,49 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.198 2003/02/26 09:21:38 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.211 2003/11/01 00:47:01 dawes Exp $ */
/*
* Copyright 1991-1999 by The XFree86 Project, Inc.
*
* Loosely based on code bearing the following copyright:
*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*/
/*
* Copyright (c) 1992-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#include <stdlib.h>
#undef HAS_UTSNAME
#if !defined(WIN32) && !defined(__UNIXOS2__)
#define HAS_UTSNAME 1
#include <sys/utsname.h>
#endif
#define NEED_EVENTS
#ifdef __UNIXOS2__
#define I_NEED_OS2_H
#endif
#include "X.h"
#include "Xmd.h"
#include "Xproto.h"
@ -134,7 +167,8 @@ xf86CreateRootWindow(WindowPtr pWin)
/* Can't find hook we are hung on */
xf86DrvMsg(pScreen->myNum, X_WARNING /* X_ERROR */,
"xf86CreateRootWindow %p called when not in pScreen->CreateWindow %p n",
xf86CreateRootWindow, pScreen->CreateWindow );
(void *)xf86CreateRootWindow,
(void *)pScreen->CreateWindow );
}
/* Unhook this function ... */
@ -183,7 +217,8 @@ xf86CreateRootWindow(WindowPtr pWin)
xf86RegisteredPropertiesTable[pScreen->myNum] = NULL;
} else {
xf86Msg(X_ERROR, "xf86CreateRootWindow unexpectedly called with "
"non-root window %p (parent %p)\n", pWin, pWin->parent);
"non-root window %p (parent %p)\n",
(void *)pWin, (void *)pWin->parent);
ret = FALSE;
}
}
@ -202,6 +237,46 @@ xf86CreateRootWindow(WindowPtr pWin)
* collecting the pixmap formats.
*/
static void
PostConfigInit(void)
{
/*
* Install signal handler for unexpected signals
*/
xf86Info.caughtSignal=FALSE;
if (!xf86Info.notrapSignals) {
signal(SIGSEGV,xf86SigHandler);
signal(SIGILL,xf86SigHandler);
#ifdef SIGEMT
signal(SIGEMT,xf86SigHandler);
#endif
signal(SIGFPE,xf86SigHandler);
#ifdef SIGBUS
signal(SIGBUS,xf86SigHandler);
#endif
#ifdef SIGSYS
signal(SIGSYS,xf86SigHandler);
#endif
#ifdef SIGXCPU
signal(SIGXCPU,xf86SigHandler);
#endif
#ifdef SIGXFSZ
signal(SIGXFSZ,xf86SigHandler);
#endif
#ifdef MEMDEBUG
signal(SIGUSR2,xf86SigMemDebug);
#endif
}
xf86OSPMClose = xf86OSPMOpen();
/* Run an external VT Init program if specified in the config file */
xf86RunVtInit();
/* Do this after XF86Config is read (it's normally in OsInit()) */
OsInitColors();
}
void
InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
{
@ -215,6 +290,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
Pix24Flags screenpix24, pix24;
MessageType pix24From = X_DEFAULT;
Bool pix24Fail = FALSE;
Bool autoconfig = FALSE;
#ifdef __UNIXOS2__
os2ServerVideoAccess(); /* See if we have access to the screen before doing anything */
@ -257,51 +333,20 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
/* Read and parse the config file */
if (!xf86DoProbe && !xf86DoConfigure) {
if (!xf86HandleConfigFile()) {
xf86Msg(X_ERROR, "Error from xf86HandleConfigFile()\n");
switch (xf86HandleConfigFile(FALSE)) {
case CONFIG_OK:
break;
case CONFIG_PARSE_ERROR:
xf86Msg(X_ERROR, "Error parsing the config file\n");
return;
case CONFIG_NOFILE:
autoconfig = TRUE;
break;
}
}
/*
* Install signal handler for unexpected signals
*/
xf86Info.caughtSignal=FALSE;
if (!xf86Info.notrapSignals) {
signal(SIGSEGV,xf86SigHandler);
signal(SIGILL,xf86SigHandler);
#ifdef SIGEMT
signal(SIGEMT,xf86SigHandler);
#endif
signal(SIGFPE,xf86SigHandler);
#ifdef SIGBUS
signal(SIGBUS,xf86SigHandler);
#endif
#ifdef SIGSYS
signal(SIGSYS,xf86SigHandler);
#endif
#ifdef SIGXCPU
signal(SIGXCPU,xf86SigHandler);
#endif
#ifdef SIGXFSZ
signal(SIGXFSZ,xf86SigHandler);
#endif
#ifdef MEMDEBUG
signal(SIGUSR2,xf86SigMemDebug);
#endif
}
xf86OpenConsole();
xf86OSPMClose = xf86OSPMOpen();
/* Run an external VT Init program if specified in the config file */
xf86RunVtInit();
/* Do this after XF86Config is read (it's normally in OsInit()) */
OsInitColors();
/* Enable full I/O access */
xf86EnableIO();
if (!autoconfig)
PostConfigInit();
#ifdef XFree86LOADER
/* Initialise the loader */
@ -349,6 +394,11 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
#endif
xf86OpenConsole();
/* Enable full I/O access */
xf86EnableIO();
/* Do a general bus probe. This will be a PCI probe for x86 platforms */
xf86BusProbe();
@ -358,6 +408,14 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
if (xf86DoConfigure)
DoConfigure();
if (autoconfig) {
if (!xf86AutoConfig()) {
xf86Msg(X_ERROR, "Auto configuration failed\n");
return;
}
PostConfigInit();
}
/* Initialise the resource broker */
xf86ResourceBrokerInit();
@ -597,7 +655,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
/* XXX Should this be before or after loading dependent modules? */
if (xf86ProbeOnly)
{
OsCleanup();
OsCleanup(TRUE);
AbortDDX();
fflush(stderr);
exit(0);
@ -743,7 +801,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
if (xf86OSPMClose)
xf86OSPMClose();
if ((xf86OSPMClose = xf86OSPMOpen()) != NULL)
xf86MsgVerb(3,X_INFO,"APM registered successfully\n");
xf86MsgVerb(X_INFO, 3, "APM registered successfully\n");
/* Make sure full I/O access is enabled */
xf86EnableIO();
@ -825,6 +883,9 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
*/
xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess;
xf86Screens[i]->SetDGAMode = xf86SetDGAMode;
xf86Screens[i]->DPMSSet = NULL;
xf86Screens[i]->LoadPalette = NULL;
xf86Screens[i]->SetOverscan = NULL;
scr_index = AddScreen(xf86Screens[i]->ScreenInit, argc, argv);
if (scr_index == i) {
/*
@ -1198,6 +1259,26 @@ OsVendorFatalError()
ErrorF("\n");
}
int
xf86SetVerbosity(int verb)
{
int save = xf86Verbose;
xf86Verbose = verb;
LogSetParameter(XLOG_VERBOSITY, verb);
return save;
}
int
xf86SetLogVerbosity(int verb)
{
int save = xf86LogVerbose;
xf86LogVerbose = verb;
LogSetParameter(XLOG_FILE_VERBOSITY, verb);
return save;
}
/*
* ddxProcessArgument --
* Process device-dependent command line args. Returns 0 if argument is
@ -1217,19 +1298,6 @@ ddxProcessArgument(int argc, char **argv, int i)
* yet. Use malloc/free instead.
*/
#ifdef DDXOSVERRORF
static Bool beenHere = FALSE;
if (!beenHere) {
/*
* This initialises our hook into VErrorF() for catching log messages
* that are generated before OsInit() is called.
*/
OsVendorVErrorFProc = OsVendorVErrorF;
beenHere = TRUE;
}
#endif
/* First the options that are only allowed for root */
if (getuid() == 0)
{
@ -1346,11 +1414,11 @@ ddxProcessArgument(int argc, char **argv, int i)
val = strtol(argv[i], &end, 0);
if (*end == '\0')
{
xf86Verbose = val;
xf86SetVerbosity(val);
return 2;
}
}
xf86Verbose++;
xf86SetVerbosity(++xf86Verbose);
return 1;
}
if (!strcmp(argv[i],"-logverbose"))
@ -1362,16 +1430,16 @@ ddxProcessArgument(int argc, char **argv, int i)
val = strtol(argv[i], &end, 0);
if (*end == '\0')
{
xf86LogVerbose = val;
xf86SetLogVerbosity(val);
return 2;
}
}
xf86LogVerbose++;
xf86SetLogVerbosity(++xf86LogVerbose);
return 1;
}
if (!strcmp(argv[i],"-quiet"))
{
xf86Verbose = 0;
xf86SetVerbosity(0);
return 1;
}
if (!strcmp(argv[i],"-showconfig") || !strcmp(argv[i],"-version"))
@ -1659,7 +1727,17 @@ xf86PrintBanner()
ErrorF("X Protocol Version %d, Revision %d, %s\n",
X_PROTOCOL, X_PROTOCOL_REVISION, XORG_RELEASE );
ErrorF("Build Operating System:%s%s\n", OSNAME, OSVENDOR);
#ifdef BUILD_DATE
#ifdef HAS_UTSNAME
{
struct utsname name;
if (uname(&name) == 0) {
ErrorF("Current Operating System: %s %s %s %s %s\n",
name.sysname, name.nodename, name.release, name.version, name.machine);
}
}
#endif
#if defined(BUILD_DATE) && (BUILD_DATE > 19000000)
{
struct tm t;
char buf[100];
@ -1673,6 +1751,20 @@ xf86PrintBanner()
ErrorF("Build Date: %s\n", buf);
}
#endif
#if defined(CLOG_DATE) && (CLOG_DATE > 19000000)
{
struct tm t;
char buf[100];
bzero(&t, sizeof(t));
bzero(buf, sizeof(buf));
t.tm_mday = CLOG_DATE % 100;
t.tm_mon = (CLOG_DATE / 100) % 100 - 1;
t.tm_year = CLOG_DATE / 10000 - 1900;
if (strftime(buf, sizeof(buf), "%d %B %Y", &t))
ErrorF("Changelog Date: %s\n", buf);
}
#endif
#if defined(BUILDERSTRING)
ErrorF("%s \n",BUILDERSTRING);
#endif
@ -1686,17 +1778,7 @@ xf86PrintBanner()
static void
xf86PrintMarkers()
{
/* Show what the marker symbols mean */
ErrorF("Markers: " X_PROBE_STRING " probed, "
X_CONFIG_STRING " from config file, "
X_DEFAULT_STRING " default setting,\n"
" " X_CMDLINE_STRING " from command line, "
X_NOTICE_STRING " notice, "
X_INFO_STRING " informational,\n"
" " X_WARNING_STRING " warning, "
X_ERROR_STRING " error, "
X_NOT_IMPLEMENTED_STRING " not implemented, "
X_UNKNOWN_STRING " unknown.\n");
LogPrintMarkers();
}
static void

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Io.c,v 3.53 2003/01/15 03:29:05 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Io.c,v 3.56 2003/11/03 05:11:02 tsi Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
@ -21,6 +21,33 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* Copyright (c) 1992-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XConsortium: xf86Io.c /main/27 1996/10/19 17:58:55 kaleb $ */
#define NEED_EVENTS
@ -88,7 +115,7 @@ xf86KbdLeds ()
{
int leds, real_leds = 0;
#if defined (__sparc__)
#if defined (__sparc__) && defined(__linux__)
static int kbdSun = -1;
if (kbdSun == -1) {
if ((xf86Info.xkbmodel && !strcmp(xf86Info.xkbmodel, "sun")) ||
@ -122,7 +149,7 @@ xf86KbdLeds ()
#endif
#endif
xf86SetKbdLeds(real_leds);
return;
(void)leds;
}
/*
@ -264,6 +291,7 @@ Bool init;
#endif /* INHERIT_LOCK_STATE */
xf86SetKbdLeds(leds);
#endif /* LED_CAP */
(void)leds;
if (xf86Info.kbdDelay <= 375) rad = 0x00;
else if (xf86Info.kbdDelay <= 625) rad = 0x20;

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c,v 3.24 2002/05/31 18:45:58 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c,v 3.26 2003/08/24 17:36:53 dawes Exp $ */
/*
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
*
@ -21,8 +21,39 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* Copyright (c) 1992-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XConsortium: xf86Kbd.c /main/10 1996/02/21 17:38:32 kaleb $ */
#ifdef __UNIXOS2__
#define I_NEED_OS2_H
#endif
#include "X.h"
#include "Xmd.h"
#include "input.h"

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c,v 3.20 2002/05/22 21:38:27 herrb Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdBSD.c,v 3.22 2003/10/07 22:00:52 herrb Exp $ */
/*
* Derived from xf86Kbd.c by S_ren Schmidt (sos@login.dkuug.dk)
* which is Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
@ -22,6 +22,33 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Copyright (c) 1994-2002 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XConsortium: xf86KbdBSD.c /main/6 1996/10/23 13:12:27 kaleb $ */
#include "X.h"
@ -1057,6 +1084,8 @@ static CARD8 wsAdbMap[] = {
/* 223 */ KEY_NOTUSED,
};
#define WS_ADB_MAP_SIZE (sizeof(wsAdbMap)/sizeof(unsigned char))
static CARD8 wsSunMap[] = {
/* 0x00 */ KEY_NOTUSED,
/* 0x01 */ KEY_NOTUSED, /* stop */
@ -1190,9 +1219,6 @@ static CARD8 wsSunMap[] = {
#define WS_SUN_MAP_SIZE (sizeof(wsSunMap)/sizeof(unsigned char))
#define WS_ADB_MAP_SIZE (sizeof(wsAdbMap)/sizeof(unsigned char))
/*
* Translate raw wskbd keyboard event values to XFree86 standard keycodes
* (based on the AT keyboard scan codes using the tables above
@ -1210,7 +1236,7 @@ WSKbdToKeycode(int keycode)
return KEY_UNKNOWN;
else
return wsUsbMap[keycode];
#ifdef WSKBD_TYPE_ADB
#ifdef WSKBD_TYPE_ADB
case WSKBD_TYPE_ADB:
if (keycode < 0 || keycode >= WS_ADB_MAP_SIZE)
return KEY_UNKNOWN;
@ -1219,6 +1245,9 @@ WSKbdToKeycode(int keycode)
#endif
#ifdef WSKBD_TYPE_SUN
case WSKBD_TYPE_SUN:
#ifdef WSKBD_TYPE_SUN5
case WSKBD_TYPE_SUN5:
#endif
if (keycode < 0 || keycode >= WS_SUN_MAP_SIZE)
return KEY_UNKNOWN;
else

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c,v 3.16 2001/03/05 20:18:20 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86KbdLnx.c,v 3.17 2003/08/24 17:36:53 dawes Exp $ */
/*
* Linux version of keymapping setup. The kernel (since 0.99.14) has support
* for fully remapping the keyboard, but there are some differences between
@ -28,6 +28,33 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* Copyright (c) 1994-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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XConsortium: xf86KbdLnx.c /main/7 1996/10/19 17:59:00 kaleb $ */
#include "X.h"

View file

@ -1,4 +1,32 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h,v 3.19 2002/05/31 18:45:58 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h,v 3.20 2003/08/24 17:36:53 dawes Exp $ */
/*
* Copyright (c) 1994-2002 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
*
* For Scancodes see notes in atKeynames.h !!!!

View file

@ -1,13 +1,40 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c,v 1.16 2003/11/03 05:11:02 tsi Exp $ */
/*
* Copyright (c) 1999 by The XFree86 Project, Inc.
* Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86MiscExt.c,v 1.11 2002/11/20 04:04:57 dawes Exp $ */
/*
* This file contains the Pointer/Keyboard functions needed by the
* XFree86-Misc extension.
*/
#ifdef __UNIXOS2__
#define I_NEED_OS2_H
#endif
#include "X.h"
#include "os.h"
#include "xf86.h"
@ -62,31 +89,17 @@ typedef struct {
int serverNumLock; /* obsolete */
} kbdParamsRec, *kbdParamsPtr;
typedef enum {
TO_MISC,
FROM_MISC
} MseProtoMapDirection;
static void MiscExtClientStateCallback(pointer, pointer, pointer);
/*
Sigh...
The extension should probably be changed to use protocol
names instead of ID numbers
*/
struct mouse_map {
static struct mouse_map {
int mtype;
MouseProtocolID proto;
};
static int
MapMseProto(int proto, MseProtoMapDirection mapping)
} m_map[] =
{
int i;
static struct mouse_map m_map[] =
{
{ MTYPE_MICROSOFT, PROT_MS },
{ MTYPE_MOUSESYS, PROT_MSC },
{ MTYPE_MMSERIES, PROT_MM },
@ -109,17 +122,30 @@ MapMseProto(int proto, MseProtoMapDirection mapping)
{ MTYPE_AUTOMOUSE, PROT_AUTO },
{ MTYPE_SYSMOUSE, PROT_SYSMOUSE },
{ MTYPE_UNKNOWN, PROT_UNKNOWN }
};
};
static int
MapMseProtoToMisc(MouseProtocolID proto)
{
int i;
if (mapping == TO_MISC) {
for (i = 0; m_map[i].proto != PROT_UNKNOWN; i++)
if (proto == m_map[i].proto) return m_map[i].mtype;
if (proto == m_map[i].proto)
return m_map[i].mtype;
return MTYPE_UNKNOWN;
} else {
}
static MouseProtocolID
MapMseMiscToProto(int proto)
{
int i;
for (i = 0; m_map[i].mtype != MTYPE_UNKNOWN; i++)
if (proto == m_map[i].mtype) return m_map[i].proto;
if (proto == m_map[i].mtype)
return m_map[i].proto;
return PROT_UNKNOWN;
}
}
Bool
@ -140,7 +166,7 @@ MiscExtGetMouseSettings(pointer *mouse, char **devname)
*devname = xf86FindOptionValue(pInfo->options, "Device");
pMse = pInfo->private;
mseptr->type = MapMseProto(pMse->protocolID, TO_MISC);
mseptr->type = MapMseProtoToMisc(pMse->protocolID);
mseptr->baudrate = pMse->baudRate;
mseptr->samplerate = pMse->sampleRate;
mseptr->resolution = pMse->resolution;
@ -279,7 +305,8 @@ MiscExtSetKbdValue(pointer keyboard, MiscExtKbdValType valtype, int value)
}
static void
MiscExtClientStateCallback(pointer callbacks, pointer data, pointer args)
MiscExtClientStateCallback(CallbackListPtr *callbacks,
pointer data, pointer args)
{
NewClientInfoRec *clientinfo = (NewClientInfoRec*)args;
@ -287,8 +314,7 @@ MiscExtClientStateCallback(pointer callbacks, pointer data, pointer args)
clientinfo->client->clientState == ClientStateGone) {
xf86Info.grabInfo.override = NULL;
xf86Info.grabInfo.disabled = 0;
DeleteCallback(&ClientStateCallback,
(CallbackProcPtr)MiscExtClientStateCallback, NULL);
DeleteCallback(&ClientStateCallback, MiscExtClientStateCallback, NULL);
}
}
@ -307,13 +333,13 @@ MiscExtSetGrabKeysState(ClientPtr client, int state)
if (state == 0 && xf86Info.grabInfo.disabled == 0) {
xf86Info.grabInfo.disabled = 1;
AddCallback(&ClientStateCallback,
(CallbackProcPtr)MiscExtClientStateCallback, NULL);
MiscExtClientStateCallback, NULL);
xf86Info.grabInfo.override = client;
}
else if (state == 1 && xf86Info.grabInfo.disabled == 1) {
xf86Info.grabInfo.disabled = 0;
DeleteCallback(&ClientStateCallback,
(CallbackProcPtr)MiscExtClientStateCallback, NULL);
MiscExtClientStateCallback, NULL);
xf86Info.grabInfo.override = NULL;
}
else
@ -426,6 +452,7 @@ MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd)
Bool protoChanged = FALSE;
int oldflags;
Bool reopen = FALSE;
MouseProtocolID newProtocol;
mseParamsPtr mse = structure;
InputInfoPtr pInfo;
MouseDevPtr pMse;
@ -508,7 +535,8 @@ MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd)
pMse = pInfo->private;
oldflags = pMse->mouseFlags;
protoChanged = pMse->protocolID != MapMseProto(mse->type, FROM_MISC);
newProtocol = MapMseMiscToProto(mse->type);
protoChanged = pMse->protocolID != newProtocol;
if (protoChanged
|| pMse->baudRate != mse->baudrate
|| pMse->sampleRate != mse->samplerate
@ -522,7 +550,7 @@ MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd)
if (reopen)
(pMse->device->deviceProc)(pMse->device, DEVICE_CLOSE);
pMse->protocolID = MapMseProto(mse->type, FROM_MISC);
pMse->protocolID = newProtocol;
pMse->baudRate = mse->baudrate;
pMse->sampleRate = mse->samplerate;
pMse->resolution = mse->resolution;
@ -608,5 +636,18 @@ MiscExtGetFilePaths(const char **configfile, const char **modulepath,
return TRUE;
}
int
MiscExtPassMessage(int scrnIndex, const char *msgtype, const char *msgval,
char **retstr)
{
ScrnInfoPtr pScr = xf86Screens[scrnIndex];
DEBUG_P("MiscExtPassMessage");
if (*pScr->HandleMessage == NULL)
return BadImplementation;
return (*pScr->HandleMessage)(scrnIndex, msgtype, msgval, retstr);
}
#endif /* XF86MISC */

View file

@ -1,10 +1,36 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.63.2.1 2003/04/08 20:51:27 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Mode.c,v 1.69 2003/10/08 14:58:28 dawes Exp $ */
/*
* Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
* Copyright (c) 1997,1998 by The XFree86 Project, Inc.
*
* Authors: Dirk Hohndel <hohndel@XFree86.Org>
* David Dawes <dawes@XFree86.Org>
* Marc La France <tsi@XFree86.Org>
* ... and others
*
* This file includes helper functions for mode related things.
*/
@ -13,6 +39,7 @@
#include "os.h"
#include "servermd.h"
#include "mibank.h"
#include "globals.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86DDC.h"
@ -318,6 +345,25 @@ xf86HandleBuiltinMode(ScrnInfoPtr scrp,
return MODE_OK;
}
static double
ModeVRefresh(DisplayModePtr mode)
{
double refresh = 0.0;
if (mode->VRefresh > 0.0)
refresh = mode->VRefresh;
else if (mode->HTotal > 0 && mode->VTotal > 0) {
refresh = mode->Clock * 1000.0 / mode->HTotal / mode->VTotal;
if (mode->Flags & V_INTERLACE)
refresh *= 2.0;
if (mode->Flags & V_DBLSCAN)
refresh /= 2.0;
if (mode->VScan > 1)
refresh /= mode->VScan;
}
return refresh;
}
/*
* xf86LookupMode
*
@ -442,17 +488,7 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
ModePrivFlags = cp->PrivFlags;
break;
}
if (p->VRefresh > 0.0)
refresh = p->VRefresh;
else {
refresh = p->Clock * 1000.0 / p->HTotal / p->VTotal;
if (p->Flags & V_INTERLACE)
refresh *= 2.0;
if (p->Flags & V_DBLSCAN)
refresh /= 2.0;
if (p->VScan > 1)
refresh /= p->VScan;
}
refresh = ModeVRefresh(p);
if (p->Flags & V_INTERLACE)
refresh /= INTERLACE_REFRESH_WEIGHT;
if (refresh > bestRefresh) {
@ -491,17 +527,7 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
found = TRUE;
if (strategy == LOOKUP_BEST_REFRESH) {
if (p->VRefresh > 0.0)
refresh = p->VRefresh;
else {
refresh = p->Clock * 1000.0 / p->HTotal / p->VTotal;
if (p->Flags & V_INTERLACE)
refresh *= 2.0;
if (p->Flags & V_DBLSCAN)
refresh /= 2.0;
if (p->VScan > 1)
refresh /= p->VScan;
}
refresh = ModeVRefresh(p);
if (p->Flags & V_INTERLACE)
refresh /= INTERLACE_REFRESH_WEIGHT;
if (refresh > bestRefresh) {
@ -847,7 +873,7 @@ xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
int i, needDiv2;
/* Sanity checks */
if (!scrp || !mode /*|| !clockRanges*/) {
if (!scrp || !mode || !clockRanges) {
ErrorF("xf86InitialCheckModeForDriver: "
"called with invalid parameters\n");
return MODE_ERROR;
@ -1186,13 +1212,17 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
int linePitch = -1, virtX = 0, virtY = 0;
int newLinePitch, newVirtX, newVirtY;
int modeSize; /* in pixels */
Bool validateAllDefaultModes;
Bool validateAllDefaultModes = FALSE;
Bool userModes = FALSE;
int saveType;
PixmapFormatRec *BankFormat;
ClockRangePtr cp;
ClockRangesPtr storeClockRanges;
struct monitor_ranges *mon_range = NULL;
double targetRefresh = 0.0;
int numTimings = 0;
range hsync[MAX_HSYNC];
range vrefresh[MAX_VREFRESH];
#ifdef DEBUG
ErrorF("xf86ValidateModes(%p, %p, %p, %p,\n\t\t %p, %d, %d, %d, %d, %d, %d, %d, %d, 0x%x)\n",
@ -1222,58 +1252,164 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
return -1;
}
/* Probe monitor so that we can enforce/warn about its limits */
/*
* Probe monitor so that we can enforce/warn about its limits.
* If one or more DS_RANGES descriptions are present, use the parameters
* that they provide. Otherwise, deduce limits based on the modes that
* are shown as supported via standard and detailed timings.
*
* XXX The full potential of the DDC/EDID data still isn't being tapped.
*/
if (scrp->monitor->DDC) {
MonPtr monitor = scrp->monitor;
xf86MonPtr DDC = (xf86MonPtr)(scrp->monitor->DDC);
struct detailed_monitor_section* detMon;
int i;
int i, j;
float hmin = 1e6, hmax = 0.0, vmin = 1e6, vmax = 0.0;
float h;
struct std_timings *t;
struct detailed_timings *dt;
for (i = 0; i < 4; i++) {
detMon = &DDC->det_mon[i];
if(detMon->type == DS_RANGES) {
mon_range = &detMon->section.ranges;
numTimings = 0;
for (i = 0; i < DET_TIMINGS; i++) {
switch (DDC->det_mon[i].type) {
case DS_RANGES:
mon_range = &DDC->det_mon[i].section.ranges;
hsync[numTimings].lo = mon_range->min_h;
hsync[numTimings].hi = mon_range->max_h;
vrefresh[numTimings].lo = mon_range->min_v;
vrefresh[numTimings].hi = mon_range->max_v;
numTimings++;
break;
case DS_STD_TIMINGS:
t = DDC->det_mon[i].section.std_t;
for (j = 0; j < 5; j++) {
if (t[j].hsize > 256) { /* sanity check */
if (t[j].refresh < vmin)
vmin = t[i].refresh;
if (t[j].refresh > vmax)
vmax = t[i].refresh;
/*
* For typical modes this is a reasonable estimate
* of the horizontal sync rate.
*/
h = t[j].refresh * 1.07 * t[j].vsize / 1000.0;
if (h < hmin)
hmin = h;
if (h > hmax)
hmax = h;
}
}
break;
case DT:
dt = &DDC->det_mon[i].section.d_timings;
if (dt->clock > 15000000) { /* sanity check */
float v;
h = (float)dt->clock / (dt->h_active + dt->h_blanking);
v = h / (dt->v_active + dt->v_blanking);
h /= 1000.0;
if (dt->interlaced)
v /= 2.0;
if (v < vmin)
vmin = v;
if (v > vmax)
vmax = v;
if (h < hmin)
hmin = h;
if (h > hmax)
hmax = h;
}
break;
}
if (numTimings > MAX_HSYNC)
break;
}
if (numTimings == 0) {
t = DDC->timings2;
for (i = 0; i < STD_TIMINGS; i++) {
if (t[i].hsize > 256) { /* sanity check */
if (t[i].refresh < vmin)
vmin = t[i].refresh;
if (t[i].refresh > vmax)
vmax = t[i].refresh;
/*
* For typical modes this is a reasonable estimate
* of the horizontal sync rate.
*/
h = t[i].refresh * 1.07 * t[i].vsize / 1000.0;
if (h < hmin)
hmin = h;
if (h > hmax)
hmax = h;
}
}
if (hmax > 0.0) {
hsync[numTimings].lo = hmin;
hsync[numTimings].hi = hmax;
vrefresh[numTimings].lo = vmin;
vrefresh[numTimings].hi = vmax;
numTimings++;
}
}
if (mon_range) {
if (numTimings > 0) {
#ifdef DEBUG
ErrorF("DDC - Max clock %d, Hsync %d-%d kHz - Vrefresh %d-%d Hz\n",
mon_range->max_clock, mon_range->min_h, mon_range->max_h,
mon_range->min_v, mon_range->max_v );
for (i = 0; i < numTimings; i++) {
ErrorF("DDC - Hsync %.1f-%.1f kHz - Vrefresh %.1f-%.1f Hz\n",
hsync[i].lo, hsync[i].hi,
vrefresh[i].lo, vrefresh[i].hi);
}
#endif
#define DDC_SYNC_TOLERANCE SYNC_TOLERANCE
if (monitor->nHsync > 0) {
for (i = 0; i < monitor->nHsync; i++) {
if ((1.0 - DDC_SYNC_TOLERANCE) * mon_range->min_h >
monitor->hsync[i].lo ||
(1.0 + DDC_SYNC_TOLERANCE) * mon_range->max_h <
Bool good = FALSE;
for (j = 0; j < numTimings; j++) {
if ((1.0 - DDC_SYNC_TOLERANCE) * hsync[j].lo <=
monitor->hsync[i].lo &&
(1.0 + DDC_SYNC_TOLERANCE) * hsync[j].hi >=
monitor->hsync[i].hi) {
good = TRUE;
break;
}
}
if (!good) {
xf86DrvMsg(scrp->scrnIndex, X_WARNING,
"config file hsync range %g-%gkHz not within DDC "
"hsync range %d-%dkHz\n",
monitor->hsync[i].lo, monitor->hsync[i].hi,
mon_range->min_h, mon_range->max_h);
"hsync ranges.\n",
monitor->hsync[i].lo, monitor->hsync[i].hi);
}
}
}
if (monitor->nVrefresh > 0) {
for (i=0; i<monitor->nVrefresh; i++) {
if ((1.0 - DDC_SYNC_TOLERANCE) * mon_range->min_v >
monitor->vrefresh[0].lo ||
(1.0 + DDC_SYNC_TOLERANCE) * mon_range->max_v <
for (i = 0; i < monitor->nVrefresh; i++) {
Bool good = FALSE;
for (j = 0; j < numTimings; j++) {
if ((1.0 - DDC_SYNC_TOLERANCE) * vrefresh[j].lo <=
monitor->vrefresh[0].lo &&
(1.0 + DDC_SYNC_TOLERANCE) * vrefresh[j].hi >=
monitor->vrefresh[0].hi) {
good = TRUE;
break;
}
}
if (!good) {
xf86DrvMsg(scrp->scrnIndex, X_WARNING,
"config file vrefresh range %g-%gHz not within DDC "
"vrefresh range %d-%dHz\n",
monitor->vrefresh[i].lo, monitor->vrefresh[i].hi,
mon_range->min_v, mon_range->max_v);
"vrefresh ranges.\n",
monitor->vrefresh[i].lo, monitor->vrefresh[i].hi);
}
}
}
} /* if (mon_range) */
}
}
/*
@ -1283,58 +1419,61 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
if (strategy & LOOKUP_OPTIONAL_TOLERANCES) {
strategy &= ~LOOKUP_OPTIONAL_TOLERANCES;
} else {
const char *type = "";
if (scrp->monitor->nHsync <= 0) {
if (mon_range) {
scrp->monitor->hsync[0].lo = mon_range->min_h;
scrp->monitor->hsync[0].hi = mon_range->max_h;
if (numTimings > 0) {
scrp->monitor->nHsync = numTimings;
for (i = 0; i < numTimings; i++) {
scrp->monitor->hsync[i].lo = hsync[i].lo;
scrp->monitor->hsync[i].hi = hsync[i].hi;
}
} else {
scrp->monitor->hsync[0].lo = 28;
scrp->monitor->hsync[0].hi = 33;
scrp->monitor->nHsync = 1;
}
xf86DrvMsg(scrp->scrnIndex, X_WARNING,
"%s: Using default hsync range of %.2f-%.2fkHz\n",
scrp->monitor->id,
scrp->monitor->hsync[0].lo, scrp->monitor->hsync[0].hi);
scrp->monitor->nHsync = 1;
} else {
for (i = 0; i < scrp->monitor->nHsync; i++)
type = "default ";
}
for (i = 0; i < scrp->monitor->nHsync; i++) {
if (scrp->monitor->hsync[i].lo == scrp->monitor->hsync[i].hi)
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"%s: Using hsync value of %.2f kHz\n",
scrp->monitor->id,
"%s: Using %shsync value of %.2f kHz\n",
scrp->monitor->id, type,
scrp->monitor->hsync[i].lo);
else
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"%s: Using hsync range of %.2f-%.2f kHz\n",
scrp->monitor->id,
"%s: Using %shsync range of %.2f-%.2f kHz\n",
scrp->monitor->id, type,
scrp->monitor->hsync[i].lo,
scrp->monitor->hsync[i].hi);
}
type = "";
if (scrp->monitor->nVrefresh <= 0) {
if (mon_range) {
scrp->monitor->vrefresh[0].lo = mon_range->min_v;
scrp->monitor->vrefresh[0].hi = mon_range->max_v;
if (numTimings > 0) {
scrp->monitor->nVrefresh = numTimings;
for (i = 0; i < numTimings; i++) {
scrp->monitor->vrefresh[i].lo = vrefresh[i].lo;
scrp->monitor->vrefresh[i].hi = vrefresh[i].hi;
}
} else {
scrp->monitor->vrefresh[0].lo = 43;
scrp->monitor->vrefresh[0].hi = 72;
scrp->monitor->nVrefresh = 1;
}
xf86DrvMsg(scrp->scrnIndex, X_WARNING,
"%s: using default vrefresh range of %.2f-%.2fHz\n",
scrp->monitor->id,
scrp->monitor->vrefresh[0].lo,
scrp->monitor->vrefresh[0].hi);
scrp->monitor->nVrefresh = 1;
} else {
for (i = 0; i < scrp->monitor->nVrefresh; i++)
type = "default ";
}
for (i = 0; i < scrp->monitor->nVrefresh; i++) {
if (scrp->monitor->vrefresh[i].lo == scrp->monitor->vrefresh[i].hi)
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"%s: Using vrefresh value of %.2f Hz\n",
scrp->monitor->id,
"%s: Using %svrefresh value of %.2f Hz\n",
scrp->monitor->id, type,
scrp->monitor->vrefresh[i].lo);
else
xf86DrvMsg(scrp->scrnIndex, X_INFO,
"%s: Using vrefresh range of %.2f-%.2f Hz\n",
scrp->monitor->id,
"%s: Using %svrefresh range of %.2f-%.2f Hz\n",
scrp->monitor->id, type,
scrp->monitor->vrefresh[i].lo,
scrp->monitor->vrefresh[i].hi);
}
@ -1497,6 +1636,26 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
}
}
/*
* Go through the mode pool and see if any modes match the target
* refresh rate, (if specified). If no modes match, abandon the target.
*/
targetRefresh = xf86SetRealOption(scrp->options,
"TargetRefresh", 0.0);
if (targetRefresh > 0.0) {
for (p = scrp->modePool; p != NULL; p = p->next) {
if (ModeVRefresh(p) > targetRefresh * (1.0 - SYNC_TOLERANCE))
break;
}
if (!p)
targetRefresh = 0.0;
}
if (targetRefresh > 0.0) {
xf86DrvMsg(scrp->scrnIndex, X_CONFIG,
"Target refresh rate is %.1f Hz\n", targetRefresh);
}
/*
* Allocate one entry in scrp->modes for each named mode.
*/
@ -1520,7 +1679,15 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
}
/* Lookup each mode */
validateAllDefaultModes = TRUE;
#ifdef RANDR
if (!xf86Info.disableRandR
#ifdef PANORAMIX
&& noPanoramiXExtension
#endif
)
validateAllDefaultModes = TRUE;
#endif
for (p = scrp->modes; ; p = p->next) {
Bool repeat;
@ -1561,6 +1728,14 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
((double)q->HTotal / (double)q->HDisplay) < 1.15)
continue;
/*
* If there is a target refresh rate, skip modes that
* don't match up.
*/
if (ModeVRefresh(q) <
(1.0 - SYNC_TOLERANCE) * targetRefresh)
continue;
if (modeSize < (q->HDisplay * q->VDisplay)) {
r = q;
modeSize = q->HDisplay * q->VDisplay;
@ -1833,8 +2008,16 @@ xf86PruneDriverModes(ScrnInfoPtr scrp)
} while (p != NULL && p != first);
/* modePool is no longer needed, turf it */
while (scrp->modePool)
while (scrp->modePool) {
/*
* A modePool mode's prev field is used to hold a pointer to the
* member of the scrp->modes list for which a match was considered.
* Clear that pointer first, otherwise xf86DeleteMode might get
* confused
*/
scrp->modePool->prev = NULL;
xf86DeleteMode(&scrp->modePool, scrp->modePool);
}
}
@ -1946,22 +2129,16 @@ xf86PrintModes(ScrnInfoPtr scrp)
hsync = (float)p->Clock / (float)p->HTotal;
else
hsync = 0.0;
if (p->VTotal > 0)
refresh = hsync * 1000.0 / p->VTotal;
refresh = ModeVRefresh(p);
if (p->Flags & V_INTERLACE) {
refresh *= 2.0;
desc = " (I)";
}
if (p->Flags & V_DBLSCAN) {
refresh /= 2.0;
desc = " (D)";
}
if (p->VScan > 1) {
refresh /= p->VScan;
desc2 = " (VScan)";
}
if (p->VRefresh > 0.0)
refresh = p->VRefresh;
if (p->type & M_T_BUILTIN)
prefix = "Built-in mode";
else if (p->type & M_T_DEFAULT)

View file

@ -1,7 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Module.h,v 1.35 2002/12/22 02:03:25 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Module.h,v 1.37 2003/08/24 17:36:54 dawes Exp $ */
/*
* Copyright (c) 1997-2001 by The XFree86 Project, Inc.
* Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
@ -62,7 +85,7 @@ typedef enum {
* mask is 0xFFFF0000.
*/
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 2)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(0, 6)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(0, 7)
#define ABI_XINPUT_VERSION SET_ABI_VERSION(0, 4)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 2)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 4)

View file

@ -1,4 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.12 2001/05/04 19:05:30 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.15 2003/10/08 14:30:38 dawes Exp $ */
/*
* Copyright (c) 1998-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* Option handling things that ModuleSetup procs can use */
@ -46,7 +73,11 @@ int xf86SetIntOption(pointer optlist, const char *name, int deflt);
double xf86SetRealOption(pointer optlist, const char *name, double deflt);
char *xf86SetStrOption(pointer optlist, const char *name, char *deflt);
int xf86SetBoolOption(pointer list, const char *name, int deflt );
pointer xf86AddNewOption(pointer head, char *name, char *val );
int xf86CheckIntOption(pointer optlist, const char *name, int deflt);
double xf86CheckRealOption(pointer optlist, const char *name, double deflt);
char *xf86CheckStrOption(pointer optlist, const char *name, char *deflt);
int xf86CheckBoolOption(pointer list, const char *name, int deflt );
pointer xf86AddNewOption(pointer head, const char *name, const char *val );
pointer xf86NewOption(char *name, char *value );
pointer xf86NextOption(pointer list );
pointer xf86OptionListCreate(const char **options, int count, int used);
@ -76,7 +107,8 @@ 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);
pointer xf86ReplaceBoolOption(pointer optlist, char *name, Bool val);
pointer xf86ReplaceStrOption(pointer optlist, char *name, char* val);
pointer xf86ReplaceIntOption(pointer optlist, const char *name, const int val);
pointer xf86ReplaceRealOption(pointer optlist, const char *name, const double val);
pointer xf86ReplaceBoolOption(pointer optlist, const char *name, const Bool val);
pointer xf86ReplaceStrOption(pointer optlist, const char *name, const char* val);
#endif

View file

@ -1,11 +1,34 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.25 2002/09/10 17:39:28 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Option.c,v 1.29 2003/10/18 12:34:19 dawes Exp $ */
/*
* Copyright (c) 1998-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
* Copyright (c) 1998 by The XFree86 Project, Inc.
*
* Author: David Dawes <dawes@xfree86.org>
*
*
* This file includes public option handling functions.
*/
@ -17,7 +40,8 @@
#include "xf86Xinput.h"
#include "xf86Optrec.h"
static Bool ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p);
static Bool ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
Bool markUsed);
/*
* xf86CollectOptions collects the options from each of the config file
@ -140,42 +164,41 @@ xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
/* Created for new XInput stuff -- essentially extensions to the parser */
/* These xf86Set* functions are intended for use by non-screen specific code */
int
xf86SetIntOption(pointer optlist, const char *name, int deflt)
static int
LookupIntOption(pointer optlist, const char *name, int deflt, Bool markUsed)
{
OptionInfoRec o;
o.name = name;
o.type = OPTV_INTEGER;
if (ParseOptionValue(-1, optlist, &o))
if (ParseOptionValue(-1, optlist, &o, markUsed))
deflt = o.value.num;
return deflt;
}
double
xf86SetRealOption(pointer optlist, const char *name, double deflt)
static double
LookupRealOption(pointer optlist, const char *name, double deflt,
Bool markUsed)
{
OptionInfoRec o;
o.name = name;
o.type = OPTV_REAL;
if (ParseOptionValue(-1, optlist, &o))
if (ParseOptionValue(-1, optlist, &o, markUsed))
deflt = o.value.realnum;
return deflt;
}
char *
xf86SetStrOption(pointer optlist, const char *name, char *deflt)
static char *
LookupStrOption(pointer optlist, const char *name, char *deflt, Bool markUsed)
{
OptionInfoRec o;
o.name = name;
o.type = OPTV_STRING;
if (ParseOptionValue(-1, optlist, &o))
if (ParseOptionValue(-1, optlist, &o, markUsed))
deflt = o.value.str;
if (deflt)
return xstrdup(deflt);
@ -184,24 +207,84 @@ xf86SetStrOption(pointer optlist, const char *name, char *deflt)
}
int
xf86SetBoolOption(pointer optlist, const char *name, int deflt)
static int
LookupBoolOption(pointer optlist, const char *name, int deflt, Bool markUsed)
{
OptionInfoRec o;
o.name = name;
o.type = OPTV_BOOLEAN;
if (ParseOptionValue(-1, optlist, &o))
if (ParseOptionValue(-1, optlist, &o, markUsed))
deflt = o.value.bool;
return deflt;
}
/* These xf86Set* functions are intended for use by non-screen specific code */
int
xf86SetIntOption(pointer optlist, const char *name, int deflt)
{
return LookupIntOption(optlist, name, deflt, TRUE);
}
double
xf86SetRealOption(pointer optlist, const char *name, double deflt)
{
return LookupRealOption(optlist, name, deflt, TRUE);
}
char *
xf86SetStrOption(pointer optlist, const char *name, char *deflt)
{
return LookupStrOption(optlist, name, deflt, TRUE);
}
int
xf86SetBoolOption(pointer optlist, const char *name, int deflt)
{
return LookupBoolOption(optlist, name, deflt, TRUE);
}
/*
* These are like the Set*Option functions, but they don't mark the options
* as used.
*/
int
xf86CheckIntOption(pointer optlist, const char *name, int deflt)
{
return LookupIntOption(optlist, name, deflt, FALSE);
}
double
xf86CheckRealOption(pointer optlist, const char *name, double deflt)
{
return LookupRealOption(optlist, name, deflt, FALSE);
}
char *
xf86CheckStrOption(pointer optlist, const char *name, char *deflt)
{
return LookupStrOption(optlist, name, deflt, FALSE);
}
int
xf86CheckBoolOption(pointer optlist, const char *name, int deflt)
{
return LookupBoolOption(optlist, name, deflt, FALSE);
}
/*
* addNewOption() has the required property of replacing the option value
* it the option is alread present.
* if the option is already present.
*/
pointer
xf86ReplaceIntOption(pointer optlist, char *name, int val)
xf86ReplaceIntOption(pointer optlist, const char *name, const int val)
{
char *tmp = xnfalloc(16);
sprintf(tmp,"%i",val);
@ -209,20 +292,29 @@ xf86ReplaceIntOption(pointer optlist, char *name, int val)
}
pointer
xf86ReplaceBoolOption(pointer optlist, char *name, Bool val)
xf86ReplaceRealOption(pointer optlist, const char *name, const double val)
{
return xf86AddNewOption(optlist,name,(Bool)val?"True":"False");
char *tmp = xnfalloc(32);
snprintf(tmp,32,"%f",val);
return xf86AddNewOption(optlist,name,tmp);
}
pointer
xf86ReplaceStrOption(pointer optlist, char *name, char* val)
xf86ReplaceBoolOption(pointer optlist, const char *name, const Bool val)
{
return xf86AddNewOption(optlist,name,val?"True":"False");
}
pointer
xf86ReplaceStrOption(pointer optlist, const char *name, const char* val)
{
return xf86AddNewOption(optlist,name,val);
}
pointer
xf86AddNewOption(pointer head, char *name, char *val)
xf86AddNewOption(pointer head, const char *name, const char *val)
{
/* XXX These should actually be allocated in the parser library. */
char *tmp = strdup(val);
char *tmp_name = strdup(name);
@ -387,14 +479,17 @@ GetBoolValue(OptionInfoPtr p, const char *s)
}
static Bool
ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p)
ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p,
Bool markUsed)
{
char *s, *end;
Bool wasUsed;
Bool wasUsed = FALSE;
if ((s = xf86findOptionValue(options, p->name)) != NULL) {
wasUsed = xf86CheckIfOptionUsedByName(options, p->name);
xf86MarkOptionUsedByName(options, p->name);
if (markUsed) {
wasUsed = xf86CheckIfOptionUsedByName(options, p->name);
xf86MarkOptionUsedByName(options, p->name);
}
switch (p->type) {
case OPTV_INTEGER:
if (*s == '\0') {
@ -501,7 +596,7 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p)
p->found = FALSE;
break;
}
if (p->found) {
if (p->found && markUsed) {
int verb = 2;
if (wasUsed)
verb = 4;
@ -535,7 +630,8 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p)
newn = n;
}
if ((s = xf86findOptionValue(options, newn)) != NULL) {
xf86MarkOptionUsedByName(options, newn);
if (markUsed)
xf86MarkOptionUsedByName(options, newn);
if (GetBoolValue(&opt, s)) {
p->value.bool = !opt.value.bool;
p->found = TRUE;
@ -547,7 +643,7 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p)
} else {
p->found = FALSE;
}
if (p->found) {
if (p->found && markUsed) {
xf86DrvMsgVerb(scrnIndex, X_CONFIG, 2, "Option \"%s\"", newn);
if (*s != 0) {
xf86ErrorFVerb(2, " \"%s\"", s);
@ -568,7 +664,7 @@ xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo)
OptionInfoPtr p;
for (p = optinfo; p->name != NULL; p++) {
ParseOptionValue(scrnIndex, options, p);
ParseOptionValue(scrnIndex, options, p, TRUE);
}
}
@ -576,20 +672,27 @@ xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo)
OptionInfoPtr
xf86TokenToOptinfo(const OptionInfoRec *table, int token)
{
const OptionInfoRec *p;
const OptionInfoRec *p, *match = NULL, *set = NULL;
if (!table) {
ErrorF("xf86TokenToOptinfo: table is NULL\n");
return NULL;
}
for (p = table; p->token >= 0 && p->token != token; p++)
;
for (p = table; p->token >= 0; p++) {
if (p->token == token) {
match = p;
if (p->found)
set = p;
}
}
if (p->token < 0)
return NULL;
if (set)
return (OptionInfoPtr)set;
else if (match)
return (OptionInfoPtr)match;
else
return (OptionInfoPtr)p;
return NULL;
}

View file

@ -1,5 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.8 2002/09/29 23:54:34 keithp Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.9 2003/08/24 17:36:54 dawes Exp $ */
/*
* Copyright (c) 2000-2002 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#include "X.h"
#include "xf86.h"

View file

@ -1,7 +1,33 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.144 2003/02/07 20:41:11 martin Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.156 2003/10/30 15:26:33 tsi Exp $ */
/*
* Copyright 1995-2002 by The XFree86 Project, Inc.
* Copyright (c) 1995-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
* This file contains macros for the PCI Vendor and Device IDs for video
* cards plus a few other things that are needed in drivers or elsewhere.
* This information is used in several ways:
@ -57,12 +83,10 @@
#define PCI_VENDOR_SUN 0x108E
#define PCI_VENDOR_DIAMOND 0x1092
#define PCI_VENDOR_BROOKTREE 0x109E
#define PCI_VENDOR_ALI_2 0x10B9
#define PCI_VENDOR_NEOMAGIC 0x10C8
#define PCI_VENDOR_NVIDIA 0x10DE
#define PCI_VENDOR_IMS 0x10E0
#define PCI_VENDOR_INTEGRAPHICS 0x10EA
#define PCI_VENDOR_VIA 0x1106
#define PCI_VENDOR_ALLIANCE 0x1142
#define PCI_VENDOR_RENDITION 0x1163
#define PCI_VENDOR_3DFX 0x121A
@ -89,14 +113,31 @@
#define PCI_CHIP_QV1280 0x3033
/* ATI */
#define PCI_CHIP_RS100_4136 0x4136
#define PCI_CHIP_RS200_4137 0x4137
#define PCI_CHIP_R300_AD 0x4144
#define PCI_CHIP_R300_AE 0x4145
#define PCI_CHIP_R300_AF 0x4146
#define PCI_CHIP_R300_AG 0x4147
#define PCI_CHIP_R350_AH 0x4148
#define PCI_CHIP_R350_AI 0x4149
#define PCI_CHIP_R350_AJ 0x414A
#define PCI_CHIP_R350_AK 0x414B
#define PCI_CHIP_RV350_AP 0x4150
#define PCI_CHIP_RV350_AQ 0x4151
#define PCI_CHIP_RV360_AR 0x4152
#define PCI_CHIP_RV350_AS 0x4153
#define PCI_CHIP_RV350_AT 0x4154
#define PCI_CHIP_RV350_AV 0x4156
#define PCI_CHIP_MACH32 0x4158
#define PCI_CHIP_RS250_4237 0x4237
#define PCI_CHIP_R200_BB 0x4242
#define PCI_CHIP_R200_BC 0x4243
#define PCI_CHIP_RS100_4336 0x4336
#define PCI_CHIP_RS200_4337 0x4337
#define PCI_CHIP_MACH64CT 0x4354
#define PCI_CHIP_MACH64CX 0x4358
#define PCI_CHIP_RS250_4437 0x4437
#define PCI_CHIP_MACH64ET 0x4554
#define PCI_CHIP_MACH64GB 0x4742
#define PCI_CHIP_MACH64GD 0x4744
@ -140,12 +181,23 @@
#define PCI_CHIP_RV250_Le 0x4C65
#define PCI_CHIP_RV250_Lf 0x4C66
#define PCI_CHIP_RV250_Lg 0x4C67
#define PCI_CHIP_RV250_Ln 0x4C6E
#define PCI_CHIP_RAGE128MF 0x4D46
#define PCI_CHIP_RAGE128ML 0x4D4C
#define PCI_CHIP_R300_ND 0x4E44
#define PCI_CHIP_R300_NE 0x4E45
#define PCI_CHIP_R300_NF 0x4E46
#define PCI_CHIP_R300_NG 0x4E47
#define PCI_CHIP_R350_NH 0x4E48
#define PCI_CHIP_R350_NI 0x4E49
#define PCI_CHIP_R360_NJ 0x4E4A
#define PCI_CHIP_R350_NK 0x4E4B
#define PCI_CHIP_RV350_NP 0x4E50
#define PCI_CHIP_RV350_NQ 0x4E51
#define PCI_CHIP_RV350_NR 0x4E52
#define PCI_CHIP_RV350_NS 0x4E53
#define PCI_CHIP_RV350_NT 0x4E54
#define PCI_CHIP_RV350_NV 0x4E56
#define PCI_CHIP_RAGE128PA 0x5041
#define PCI_CHIP_RAGE128PB 0x5042
#define PCI_CHIP_RAGE128PC 0x5043
@ -186,11 +238,6 @@
#define PCI_CHIP_RV200_QX 0x5158
#define PCI_CHIP_RV100_QY 0x5159
#define PCI_CHIP_RV100_QZ 0x515A
#define PCI_CHIP_R200_Qh 0x5168
#define PCI_CHIP_R200_Qi 0x5169
#define PCI_CHIP_R200_Qj 0x516A
#define PCI_CHIP_R200_Qk 0x516B
#define PCI_CHIP_R200_Ql 0x516C /* Undocumented in all ATI manuals */
#define PCI_CHIP_RAGE128RE 0x5245
#define PCI_CHIP_RAGE128RF 0x5246
#define PCI_CHIP_RAGE128RG 0x5247
@ -213,6 +260,16 @@
#define PCI_CHIP_MACH64VT 0x5654
#define PCI_CHIP_MACH64VU 0x5655
#define PCI_CHIP_MACH64VV 0x5656
#define PCI_CHIP_RS300_5834 0x5834
#define PCI_CHIP_RS300_5835 0x5835
#define PCI_CHIP_RS300_5836 0x5836
#define PCI_CHIP_RS300_5837 0x5837
#define PCI_CHIP_RV280_5960 0x5960
#define PCI_CHIP_RV280_5961 0x5961
#define PCI_CHIP_RV280_5962 0x5962
#define PCI_CHIP_RV280_5964 0x5964
#define PCI_CHIP_RV280_5C61 0x5C61
#define PCI_CHIP_RV280_5C63 0x5C63
/* Avance Logic */
#define PCI_CHIP_ALG2064 0x2064
@ -259,6 +316,7 @@
#define PCI_CHIP_AMD761 0x700E
/* Trident */
#define PCI_CHIP_2100 0x2100
#define PCI_CHIP_8400 0x8400
#define PCI_CHIP_8420 0x8420
#define PCI_CHIP_8500 0x8500
@ -343,20 +401,21 @@
#define PCI_CHIP_SIS6326 0x6326
#define PCI_CHIP_SIS7001 0x7001
#define PCI_CHIP_SIS300 0x0300
#define PCI_CHIP_SIS315H 0x0310
#define PCI_CHIP_SIS315PRO 0x0325
#define PCI_CHIP_SIS330 0x0330
#define PCI_CHIP_SIS315H 0x0310
#define PCI_CHIP_SIS315PRO 0x0325
#define PCI_CHIP_SIS330 0x0330
#define PCI_CHIP_SIS630 0x6300
#define PCI_CHIP_SIS540 0x5300
#define PCI_CHIP_SIS550 0x5315
#define PCI_CHIP_SIS650 0x6325
#define PCI_CHIP_SIS730 0x7300
#define PCI_CHIP_SIS550 0x5315
#define PCI_CHIP_SIS650 0x6325
#define PCI_CHIP_SIS730 0x7300
/* Hewlett-Packard */
#define PCI_CHIP_ELROY 0x1054
#define PCI_CHIP_ZX1_SBA 0x1229
#define PCI_CHIP_ZX1_IOC 0x122A
#define PCI_CHIP_ZX1_LBA 0x122E /* a.k.a. Mercury */
#define PCI_CHIP_ZX1_AGP8 0x12B4 /* a.k.a. QuickSilver */
/* SGS */
#define PCI_CHIP_STG2000 0x0008
@ -389,9 +448,6 @@
#define PCI_CHIP_BT848 0x0350
#define PCI_CHIP_BT849 0x0351
/* Acer Laboratories Inc (ALI_2) */
#define PCI_CHIP_M1541 0x1541
/* NVIDIA */
#define PCI_CHIP_NV1 0x0008
#define PCI_CHIP_DAC64 0x0009
@ -442,10 +498,6 @@
#define PCI_CHIP_IMSTT128 0x9128
#define PCI_CHIP_IMSTT3D 0x9135
/* VIA Technologies */
#define PCI_CHIP_APOLLOVP1 0x0585
#define PCI_CHIP_APOLLOPRO133X 0x0691
/* Alliance Semiconductor */
#define PCI_CHIP_AP6410 0x3210
#define PCI_CHIP_AP6422 0x6422
@ -538,7 +590,6 @@
/* Intel */
#define PCI_CHIP_I815_BRIDGE 0x1130
#define PCI_CHIP_I815 0x1132
#define PCI_CHIP_430HX_BRIDGE 0x1250
#define PCI_CHIP_82801_P2P 0x244E
#define PCI_CHIP_845_G_BRIDGE 0x2560
#define PCI_CHIP_845_G 0x2562
@ -550,7 +601,6 @@
#define PCI_CHIP_I810_DC100 0x7123
#define PCI_CHIP_I810_E_BRIDGE 0x7124
#define PCI_CHIP_I810_E 0x7125
#define PCI_CHIP_440BX_BRIDGE 0x7190
#define PCI_CHIP_I740_AGP 0x7800
#define PCI_CHIP_460GX_PXB 0x84CB
#define PCI_CHIP_460GX_SAC 0x84E0
@ -565,6 +615,7 @@
#define PCI_CHIP_SMI710 0x0710
#define PCI_CHIP_SMI712 0x0712
#define PCI_CHIP_SMI720 0x0720
#define PCI_CHIP_SMI731 0x0730
/* VMware */
#define PCI_CHIP_VMWARE0405 0x0405

View file

@ -1,7 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.80 2002/12/12 18:29:10 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.82 2003/09/09 03:20:36 dawes Exp $ */
/*
* Copyright (c) 1997 by The XFree86 Project, Inc.
* Copyright (c) 1997-2002 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
@ -167,10 +190,11 @@ void xf86GrabServerCallback(CallbackListPtr *, pointer, pointer);
/* xf86Helper.c */
void xf86LogInit(void);
void xf86CloseLog(void);
void OsVendorVErrorF(const char *f, va_list args);
/* xf86Init.c */
Bool xf86LoadModules(char **list, pointer *optlist);
int xf86SetVerbosity(int verb);
int xf86SetLogVerbosity(int verb);
/* xf86Io.c */

View file

@ -1,7 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.37 2003/02/20 04:05:14 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.40 2003/10/17 20:02:12 alanh Exp $ */
/*
* Copyright (c) 1997,1998 by The XFree86 Project, Inc.
* Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
@ -159,7 +182,6 @@ typedef struct {
#ifdef DPMSExtension
/* Private info for DPMS */
typedef struct {
DPMSSetProcPtr Set;
CloseScreenProcPtr CloseScreen;
Bool Enabled;
int Flags;
@ -199,36 +221,4 @@ typedef struct {
#define WSCONS 32
#endif
/* Prefix strings for driver messages */
#ifndef X_UNKNOWN_STRING
#define X_UNKNOWN_STRING "(\?\?)"
#endif
#ifndef X_PROBE_STRING
#define X_PROBE_STRING "(--)"
#endif
#ifndef X_CONFIG_STRING
#define X_CONFIG_STRING "(**)"
#endif
#ifndef X_DEFAULT_STRING
#define X_DEFAULT_STRING "(==)"
#endif
#ifndef X_CMDLINE_STRING
#define X_CMDLINE_STRING "(++)"
#endif
#ifndef X_NOTICE_STRING
#define X_NOTICE_STRING "(!!)"
#endif
#ifndef X_ERROR_STRING
#define X_ERROR_STRING "(EE)"
#endif
#ifndef X_WARNING_STRING
#define X_WARNING_STRING "(WW)"
#endif
#ifndef X_INFO_STRING
#define X_INFO_STRING "(II)"
#endif
#ifndef X_NOT_IMPLEMENTED_STRING
#define X_NOT_IMPLEMENTED_STRING "(NI)"
#endif
#endif /* _XF86PRIVSTR_H */

View file

@ -1,5 +1,5 @@
/*
* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.4 2003/02/13 10:49:38 eich Exp $
* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.8 2003/11/10 16:42:13 tsi Exp $
*
* Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
*
@ -48,9 +48,9 @@ static int
xf86RandRModeRefresh (DisplayModePtr mode)
{
if (mode->VRefresh)
return (int) mode->VRefresh;
return (int) (mode->VRefresh + 0.5);
else
return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal);
return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal + 0.5);
}
static Bool
@ -60,7 +60,6 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
DisplayModePtr mode;
Bool reportVirtual = TRUE;
int refresh0 = 60;
*rotations = RR_Rotate_0;
@ -75,9 +74,6 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
pScreen->mmWidth, pScreen->mmHeight);
if (!pSize)
return FALSE;
if (mode->HDisplay == randrp->virtualX &&
mode->VDisplay == randrp->virtualY)
reportVirtual = FALSE;
RRRegisterRate (pScreen, pSize, refresh);
if (mode == scrp->currentMode &&
mode->HDisplay == pScreen->width && mode->VDisplay == pScreen->height)
@ -85,13 +81,14 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
if (mode->next == scrp->modes)
break;
}
if (reportVirtual)
if (scrp->currentMode->HDisplay != randrp->virtualX ||
scrp->currentMode->VDisplay != randrp->virtualY)
{
mode = scrp->modes;
pSize = RRRegisterSize (pScreen,
randrp->virtualX, randrp->virtualY,
pScreen->mmWidth * randrp->virtualX / mode->HDisplay,
pScreen->mmHeight * randrp->virtualY / mode->VDisplay);
pScreen->mmWidth * randrp->virtualX / scrp->currentMode->HDisplay,
pScreen->mmHeight * randrp->virtualY / scrp->currentMode->VDisplay);
if (!pSize)
return FALSE;
RRRegisterRate (pScreen, pSize, refresh0);
@ -202,17 +199,21 @@ xf86RandRSetConfig (ScreenPtr pScreen,
static Bool
xf86RandRCreateScreenResources (ScreenPtr pScreen)
{
ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
#if 0
ScrnInfoPtr scrp = XF86SCRNINFO(pScreen);
DisplayModePtr mode;
#endif
pScreen->CreateScreenResources = randrp->CreateScreenResources;
if (!(*pScreen->CreateScreenResources) (pScreen))
return FALSE;
#if 0
mode = scrp->currentMode;
if (mode)
xf86RandRSetMode (pScreen, mode, TRUE);
#endif
return TRUE;
}

View file

@ -1,4 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.14 2002/07/24 01:47:24 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Resources.h,v 1.15 2003/08/24 17:36:55 dawes Exp $ */
/*
* Copyright (c) 1999-2002 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#ifndef _XF86_RESOURCES_H

View file

@ -1,11 +1,38 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.543.2.1 2003/05/10 01:10:10 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/xf86Version.h,v 3.563 2003/11/21 06:01:44 dawes Exp $ */
/*
* Copyright (c) 1994-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#ifndef XF86_VERSION_CURRENT
#define XF86_VERSION_MAJOR 4
#define XF86_VERSION_MINOR 3
#define XF86_VERSION_PATCH 0
#define XF86_VERSION_SNAP 1
#define XF86_VERSION_PATCH 99
#define XF86_VERSION_SNAP 16
/* This has five arguments for compatibilty reasons */
#define XF86_VERSION_NUMERIC(major,minor,patch,snap,dummy) \

View file

@ -1,7 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.17 2003/08/24 17:36:55 dawes Exp $ */
/*
* Copyright (c) 1999 by The XFree86 Project, Inc.
* Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86VidMode.c,v 1.14 2003/01/28 20:52:28 tsi Exp $ */
/*
* This file contains the VidMode functions required by the extension.
@ -330,6 +353,8 @@ Bool
VidModeSwitchMode(int scrnIndex, pointer mode)
{
ScrnInfoPtr pScrn;
DisplayModePtr pTmpMode;
Bool retval;
DEBUG_P("VidModeSwitchMode");
@ -337,9 +362,15 @@ VidModeSwitchMode(int scrnIndex, pointer mode)
return FALSE;
pScrn = xf86Screens[scrnIndex];
/* save in case we fail */
pTmpMode = pScrn->currentMode;
/* Force a mode switch */
pScrn->currentMode = NULL;
return xf86SwitchMode(pScrn->pScreen, mode);
retval = xf86SwitchMode(pScrn->pScreen, mode);
/* we failed: restore it */
if (retval == FALSE)
pScrn->currentMode = pTmpMode;
return retval;
}
Bool
@ -440,10 +471,13 @@ VidModeAddModeline(int scrnIndex, pointer mode)
pScrn = xf86Screens[scrnIndex];
((DisplayModePtr)mode)->name = strdup(""); /* freed by deletemode */
((DisplayModePtr)mode)->status = MODE_OK;
((DisplayModePtr)mode)->next = pScrn->modes->next;
((DisplayModePtr)mode)->prev = pScrn->modes;
pScrn->modes->next = (DisplayModePtr)mode;
((DisplayModePtr)mode)->next->prev = (DisplayModePtr)mode;
if( ((DisplayModePtr)mode)->next != NULL )
((DisplayModePtr)mode)->next->prev = (DisplayModePtr)mode;
return TRUE;
}
@ -547,6 +581,7 @@ VidModeCreateMode(void)
mode = xalloc(sizeof(DisplayModeRec));
if (mode != NULL) {
mode->name = "";
mode->VScan = 1; /* divides refresh rate. default = 1 */
mode->Private = NULL;
mode->next = mode;
mode->prev = mode;

View file

@ -24,7 +24,34 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86XKB.c,v 3.11 2002/10/11 01:40:31 dawes Exp $ */
/*
* Copyright (c) 1994-2002 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86XKB.c,v 3.12 2003/08/24 17:36:55 dawes Exp $ */
#include <stdio.h>
#define NEED_EVENTS 1

View file

@ -1,4 +1,4 @@
/* $XConsortium: xf86Xinput.c /main/14 1996/10/27 11:05:25 kaleb $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c,v 3.70 2003/11/03 05:11:02 tsi Exp $ */
/*
* Copyright 1995-1999 by Frederic Lepied, France. <Lepied@XFree86.org>
*
@ -21,8 +21,33 @@
* PERFORMANCE OF THIS SOFTWARE.
*
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.c,v 3.68 2002/10/11 01:40:31 dawes Exp $ */
/*
* Copyright (c) 2000-2002 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XConsortium: xf86Xinput.c /main/14 1996/10/27 11:05:25 kaleb $ */
#include "Xfuncproto.h"
#include "Xmd.h"
@ -854,7 +879,6 @@ xf86PostMotionEvent(DeviceIntPtr device,
int valuator[6];
int oldaxis[6];
int *axisvals;
AxisInfoPtr axes;
int dx = 0, dy = 0;
float mult;
int x, y;
@ -883,7 +907,6 @@ xf86PostMotionEvent(DeviceIntPtr device,
}
axisvals = val->axisVal;
axes = val->axes;
va_start(var, num_valuators);

View file

@ -22,7 +22,34 @@
*
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h,v 3.35 2002/10/11 01:40:31 dawes Exp $ */
/*
* Copyright (c) 2000-2002 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Xinput.h,v 3.36 2003/08/24 17:36:55 dawes Exp $ */
#ifndef _xf86Xinput_h
#define _xf86Xinput_h

View file

@ -1,4 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.23 2001/11/16 16:47:55 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.c,v 1.25 2003/10/17 20:02:12 alanh Exp $ */
/*
* Copyright (c) 1998-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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#if defined(_XOPEN_SOURCE) || defined(__QNXNTO__)
#include <math.h>
@ -52,8 +78,6 @@ typedef struct {
DestroyColormapProcPtr DestroyColormap;
InstallColormapProcPtr InstallColormap;
StoreColorsProcPtr StoreColors;
LoadPaletteFuncPtr LoadPalette;
SetOverscanFuncPtr SetOverscan;
Bool (*EnterVT)(int, int);
Bool (*SwitchMode)(int, DisplayModePtr, int);
int (*SetDGAMode)(int, int, DGADevicePtr);
@ -103,8 +127,8 @@ Bool xf86HandleColormaps(
ScreenPtr pScreen,
int maxColors,
int sigRGBbits,
LoadPaletteFuncPtr loadPalette,
SetOverscanFuncPtr setOverscan,
xf86LoadPaletteProc *loadPalette,
xf86SetOverscanProc *setOverscan,
unsigned int flags
){
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
@ -155,8 +179,8 @@ Bool xf86HandleColormaps(
pScreen->StoreColors = CMapStoreColors;
pScreenPriv->pScrn = pScrn;
pScreenPriv->LoadPalette = loadPalette;
pScreenPriv->SetOverscan = setOverscan;
pScrn->LoadPalette = loadPalette;
pScrn->SetOverscan = setOverscan;
pScreenPriv->maxColors = maxColors;
pScreenPriv->sigRGBbits = sigRGBbits;
pScreenPriv->gammaElements = elements;
@ -483,6 +507,7 @@ CMapReinstallMap(ColormapPtr pmap)
(CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr;
CMapColormapPtr cmapPriv =
(CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
int i = cmapPriv->numColors;
int *indices = pScreenPriv->PreAllocIndices;
@ -492,13 +517,13 @@ CMapReinstallMap(ColormapPtr pmap)
if(cmapPriv->recalculate)
CMapRefreshColors(pmap, cmapPriv->numColors, indices);
else {
(*pScreenPriv->LoadPalette)(pScreenPriv->pScrn, cmapPriv->numColors,
(*pScrn->LoadPalette)(pScrn, cmapPriv->numColors,
indices, cmapPriv->colors, pmap->pVisual);
if (pScreenPriv->SetOverscan) {
if (pScrn->SetOverscan) {
#ifdef DEBUGOVERSCAN
ErrorF("SetOverscan() called from CMapReinstallMap\n");
#endif
pScreenPriv->SetOverscan(pScreenPriv->pScrn, cmapPriv->overscan);
pScrn->SetOverscan(pScrn, cmapPriv->overscan);
}
}
@ -514,6 +539,7 @@ CMapRefreshColors(ColormapPtr pmap, int defs, int* indices)
CMapColormapPtr pColPriv =
(CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
VisualPtr pVisual = pmap->pVisual;
ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
int numColors, i;
LOCO *gamma, *colors;
EntryPtr entry;
@ -616,10 +642,10 @@ CMapRefreshColors(ColormapPtr pmap, int defs, int* indices)
if(LOAD_PALETTE(pmap, pmap->pScreen->myNum))
(*pScreenPriv->LoadPalette)(pScreenPriv->pScrn, defs, indices,
(*pScrn->LoadPalette)(pScreenPriv->pScrn, defs, indices,
colors, pmap->pVisual);
if (pScreenPriv->SetOverscan)
if (pScrn->SetOverscan)
CMapSetOverscan(pmap, defs, indices);
}
@ -646,6 +672,7 @@ CMapSetOverscan(ColormapPtr pmap, int defs, int *indices)
(CMapScreenPtr) pmap->pScreen->devPrivates[CMapScreenIndex].ptr;
CMapColormapPtr pColPriv =
(CMapColormapPtr) pmap->devPrivates[CMapColormapIndex].ptr;
ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum];
VisualPtr pVisual = pmap->pVisual;
int i;
LOCO *colors;
@ -771,7 +798,7 @@ CMapSetOverscan(ColormapPtr pmap, int defs, int *indices)
#ifdef DEBUGOVERSCAN
ErrorF("SetOverscan() called from CmapSetOverscan\n");
#endif
pScreenPriv->SetOverscan(pScreenPriv->pScrn, overscan);
pScrn->SetOverscan(pScreenPriv->pScrn, overscan);
}
}
}

View file

@ -1,4 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.h,v 1.7 2001/05/06 00:49:12 mvojkovi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86cmap.h,v 1.9 2003/10/17 20:02:12 alanh Exp $ */
/*
* Copyright (c) 1998-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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#ifndef _XF86CMAP_H
#define _XF86CMAP_H
@ -10,25 +37,12 @@
#define CMAP_RELOAD_ON_MODE_SWITCH 0x0000002
#define CMAP_LOAD_EVEN_IF_OFFSCREEN 0x0000004
typedef void (*LoadPaletteFuncPtr)(
ScrnInfoPtr pScrn,
int numColors,
int *indicies,
LOCO *colors,
VisualPtr pVisual
);
typedef void (*SetOverscanFuncPtr)(
ScrnInfoPtr pScrn,
int Index
);
Bool xf86HandleColormaps(
ScreenPtr pScreen,
int maxCol,
int sigRGBbits,
LoadPaletteFuncPtr loadPalette,
SetOverscanFuncPtr setOverscan,
xf86LoadPaletteProc *loadPalette,
xf86SetOverscanProc *setOverscan,
unsigned int flags
);

View file

@ -1,7 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c,v 1.2 2001/10/28 03:33:19 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbBus.c,v 1.3 2003/08/24 17:36:55 dawes Exp $ */
/*
* Copyright (c) 2000 by The XFree86 Project, Inc.
* Copyright (c) 2000-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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*

View file

@ -1,4 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.24 2001/12/05 19:23:52 mvojkovi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.c,v 1.28 2003/11/03 05:11:03 tsi Exp $ */
/*
* Copyright (c) 1998-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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#include "misc.h"
#include "xf86.h"
@ -8,6 +35,10 @@
#include "regionstr.h"
#include "xf86fbman.h"
/*
#define DEBUG
*/
static int xf86FBMangerIndex = -1;
static unsigned long xf86ManagerGeneration = 0;
@ -118,19 +149,19 @@ xf86FreeOffscreenArea(FBAreaPtr area)
void
xf86FreeOffscreenLinear(FBLinearPtr area)
xf86FreeOffscreenLinear(FBLinearPtr linear)
{
FBManagerFuncsPtr funcs;
if(!area) return;
if(!linear) return;
if(xf86FBMangerIndex < 0)
return;
if(!(funcs =
(FBManagerFuncsPtr)area->pScreen->devPrivates[xf86FBMangerIndex].ptr))
(FBManagerFuncsPtr)linear->pScreen->devPrivates[xf86FBMangerIndex].ptr))
return;
(*funcs->FreeOffscreenLinear)(area);
(*funcs->FreeOffscreenLinear)(linear);
return;
}
@ -244,18 +275,19 @@ typedef struct _FBLink {
} FBLink, *FBLinkPtr;
typedef struct _FBLinearLink {
FBLinear linear;
FBAreaPtr area;
FBLinear linear;
int free; /* need to add free here as FBLinear is publicly accessible */
FBAreaPtr area; /* only used if allocation came from XY area */
struct _FBLinearLink *next;
} FBLinearLink, *FBLinearLinkPtr;
typedef struct {
ScreenPtr pScreen;
RegionPtr InitialBoxes;
RegionPtr FreeBoxes;
FBLinkPtr UsedAreas;
int NumUsedAreas;
ScreenPtr pScreen;
RegionPtr InitialBoxes;
RegionPtr FreeBoxes;
FBLinkPtr UsedAreas;
int NumUsedAreas;
FBLinearLinkPtr LinearAreas;
CloseScreenProcPtr CloseScreen;
int NumCallbacks;
@ -772,6 +804,97 @@ LinearRemoveCBWrapper(FBAreaPtr area)
xfree(pLink);
}
#ifdef DEBUG
static void
Dump(FBLinearLinkPtr pLink)
{
if (!pLink) ErrorF("MMmm, PLINK IS NULL!\n");
while (pLink) {
ErrorF(" Offset:%08x, Size:%08x, %s,%s\n",
pLink->linear.offset,
pLink->linear.size,
pLink->free ? "Free" : "Used",
pLink->area ? "Area" : "Linear");
pLink = pLink->next;
}
}
#endif
static FBLinearPtr
AllocateLinear(
FBManagerPtr offman,
int size,
int granularity,
pointer privData
){
ScreenPtr pScreen = offman->pScreen;
FBLinearLinkPtr linear = NULL;
FBLinearLinkPtr newlink = NULL;
int offset, end;
if(size <= 0) return NULL;
if (!offman->LinearAreas) return NULL;
linear = offman->LinearAreas;
while (linear) {
/* Make sure we get a free area that's not an XY fallback case */
if (!linear->area && linear->free) {
offset = (linear->linear.offset + granularity) & ~granularity;
end = offset+size;
if (end <= (linear->linear.offset + linear->linear.size))
break;
}
linear = linear->next;
}
if (!linear)
return NULL;
/* break left */
if (offset > linear->linear.offset) {
newlink = xalloc(sizeof(FBLinearLink));
if (!newlink)
return NULL;
newlink->area = NULL;
newlink->linear.offset = offset;
newlink->linear.size = linear->linear.size - (offset - linear->linear.offset);
newlink->free = 1;
newlink->next = linear->next;
linear->linear.size -= newlink->linear.size;
linear->next = newlink;
linear = newlink;
}
/* break right */
if (size < linear->linear.size) {
newlink = xalloc(sizeof(FBLinearLink));
if (!newlink)
return NULL;
newlink->area = NULL;
newlink->linear.offset = offset + size;
newlink->linear.size = linear->linear.size - size;
newlink->free = 1;
newlink->next = linear->next;
linear->linear.size = size;
linear->next = newlink;
}
/* p = middle block */
linear->linear.granularity = granularity;
linear->free = 0;
linear->linear.pScreen = pScreen;
linear->linear.MoveLinearCallback = NULL;
linear->linear.RemoveLinearCallback = NULL;
linear->linear.devPrivate.ptr = NULL;
#ifdef DEBUG
Dump(offman->LinearAreas);
#endif
return &(linear->linear);
}
static FBLinearPtr
localAllocateOffscreenLinear(
@ -791,28 +914,21 @@ localAllocateOffscreenLinear(
offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
/* Try to allocate from linear memory first...... */
#ifdef DEBUG
ErrorF("ALLOCATING LINEAR\n");
#endif
if ((linear = AllocateLinear(offman, length, gran, privData)))
return linear;
#ifdef DEBUG
ErrorF("NOPE, ALLOCATING AREA\n");
#endif
if(!(link = xalloc(sizeof(FBLinearLink))))
return NULL;
#if 0
if(we have linear heap space) {
if(able to allocate some) {
link->area = NULL;
link->next = offman->LinearAreas;
offman->LinearAreas = link;
linear = link->linear;
linear->pScreen = pScreen;
linear->size = length;
linear->offset = ????;
linear->granularity = gran;
linear->MoveLinearAreaCallback = moveCB;
linear->RemoveLinearAreaCallback = removeCB;
linear->devPrivate.ptr = privData;
return linear;
} /* else fallthrough */
}
#endif
/* No linear available, so try and pinch some from the XY areas */
extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
pitch = extents->x2 - extents->x1;
@ -836,6 +952,7 @@ localAllocateOffscreenLinear(
privData)))
{
link->area = area;
link->free = 0;
link->next = offman->LinearAreas;
offman->LinearAreas = link;
linear = &(link->linear);
@ -849,6 +966,10 @@ localAllocateOffscreenLinear(
} else
xfree(link);
#ifdef DEBUG
Dump(offman->LinearAreas);
#endif
return linear;
}
@ -861,7 +982,7 @@ localFreeOffscreenLinear(FBLinearPtr linear)
ScreenPtr pScreen = linear->pScreen;
offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
pLink = offman->LinearAreas;
if(!pLink) return;
@ -872,16 +993,42 @@ localFreeOffscreenLinear(FBLinearPtr linear)
}
if(pLink->area) { /* really an XY area */
localFreeOffscreenArea(pLink->area);
} else {
/* free the linear area */
#ifdef DEBUG
ErrorF("FREEING AREA\n");
#endif
localFreeOffscreenArea(pLink->area);
if(pLinkPrev)
pLinkPrev->next = pLink->next;
else offman->LinearAreas = pLink->next;
xfree(pLink);
#ifdef DEBUG
Dump(offman->LinearAreas);
#endif
return;
}
if(pLinkPrev)
pLinkPrev->next = pLink->next;
else offman->LinearAreas = pLink->next;
pLink->free = 1;
xfree(pLink);
if (pLink->next && pLink->next->free) {
FBLinearLinkPtr p = pLink->next;
pLink->linear.size += p->linear.size;
pLink->next = p->next;
free(p);
}
if(pLinkPrev) {
if (pLinkPrev->next && pLinkPrev->next->free && !pLinkPrev->area) {
FBLinearLinkPtr p = pLinkPrev->next;
pLinkPrev->linear.size += p->linear.size;
pLinkPrev->next = p->next;
free(p);
}
}
#ifdef DEBUG
ErrorF("FREEING LINEAR\n");
Dump(offman->LinearAreas);
#endif
}
@ -889,7 +1036,7 @@ static Bool
localResizeOffscreenLinear(FBLinearPtr resize, int length)
{
FBManagerPtr offman;
FBLinearLinkPtr pLink, pLinkPrev = NULL;
FBLinearLinkPtr pLink;
ScreenPtr pScreen = resize->pScreen;
offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
@ -898,7 +1045,6 @@ localResizeOffscreenLinear(FBLinearPtr resize, int length)
if(!pLink) return FALSE;
while(&(pLink->linear) != resize) {
pLinkPrev = pLink;
pLink = pLink->next;
if(!pLink) return FALSE;
}
@ -928,7 +1074,7 @@ localResizeOffscreenLinear(FBLinearPtr resize, int length)
return TRUE;
}
} else {
/* resize the linear area */
/* TODO!!!! resize the linear area */
}
return FALSE;
@ -943,22 +1089,45 @@ localQueryLargestOffscreenLinear(
int priority
)
{
int w, h;
FBManagerPtr offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
FBLinearLinkPtr pLink;
FBLinearLinkPtr pLinkRet;
*size = 0;
if (!offman->LinearAreas) return FALSE;
/* for now, we only look at XY space */
if(localQueryLargestOffscreenArea(pScreen, &w, &h, gran,
pLink = offman->LinearAreas;
pLinkRet = pLink;
if (!pLink->area) {
while (pLink) {
if (pLink->free) {
if (pLink->linear.size > pLinkRet->linear.size)
pLinkRet = pLink;
}
pLink = pLink->next;
}
if (pLinkRet->free) {
*size = pLinkRet->linear.size;
return TRUE;
}
} else {
int w, h;
if(localQueryLargestOffscreenArea(pScreen, &w, &h, gran,
FAVOR_WIDTH_THEN_AREA, priority))
{
FBManagerPtr offman;
BoxPtr extents;
{
FBManagerPtr offman;
BoxPtr extents;
offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
if((extents->x2 - extents->x1) == w)
*size = w * h;
return TRUE;
offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
if((extents->x2 - extents->x1) == w)
*size = w * h;
return TRUE;
}
}
return FALSE;
@ -1189,6 +1358,44 @@ xf86InitFBManagerRegion(
return TRUE;
}
Bool
xf86InitFBManagerLinear(
ScreenPtr pScreen,
int offset,
int size
){
FBManagerPtr offman;
FBLinearLinkPtr link;
FBLinearPtr linear;
if (size <= 0)
return FALSE;
/* we expect people to have called the Area setup first for pixmap cache */
if (!pScreen->devPrivates[xf86FBScreenIndex].ptr)
return FALSE;
offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
offman->LinearAreas = xalloc(sizeof(FBLinearLink));
if (!offman->LinearAreas)
return FALSE;
link = offman->LinearAreas;
link->area = NULL;
link->next = NULL;
link->free = 1;
linear = &(link->linear);
linear->pScreen = pScreen;
linear->size = size;
linear->offset = offset;
linear->granularity = 0;
linear->MoveLinearCallback = NULL;
linear->RemoveLinearCallback = NULL;
linear->devPrivate.ptr = NULL;
return TRUE;
}
/* This is an implementation specific function and should

View file

@ -1,4 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.h,v 1.12 2001/08/28 16:55:09 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86fbman.h,v 1.14 2003/10/09 12:40:54 alanh Exp $ */
/*
* Copyright (c) 1998-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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#ifndef _XF86FBMAN_H
#define _XF86FBMAN_H
@ -108,6 +135,13 @@ xf86InitFBManager(
BoxPtr FullBox
);
Bool
xf86InitFBManagerLinear(
ScreenPtr pScreen,
int offset,
int size
);
Bool
xf86FBManagerRunning(
ScreenPtr pScreen

View file

@ -1,9 +1,32 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c,v 3.5 2000/12/06 15:35:11 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86isaBus.c,v 3.6 2003/08/24 17:36:55 dawes Exp $ */
/*
* Copyright (c) 1997-1999 by The XFree86 Project, Inc.
* Copyright (c) 1997-2000 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
* This file contains the interfaces to the bus-specific code
*/

View file

@ -1,7 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86noBus.c,v 1.1 2002/09/18 08:54:55 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86noBus.c,v 1.2 2003/08/24 17:36:55 dawes Exp $ */
/*
* Copyright (c) 2000 by The XFree86 Project, Inc.
* Copyright (c) 2000-2002 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*

View file

@ -1,6 +1,29 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.68.2.1 2003/05/06 17:00:43 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v 3.77 2003/11/03 05:11:03 tsi Exp $ */
/*
* Copyright (c) 1997-2002 by The XFree86 Project, Inc.
* Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
@ -270,8 +293,8 @@ FindPCIVideoInfo(void)
}
/*
* 64-bit base addresses are checked for and avoided.
* XXX Should deal with them on platforms that support them.
* 64-bit base addresses are checked for and avoided on 32-bit
* platforms.
*/
if (pcrp->pci_base0) {
if (pcrp->pci_base0 & PCI_MAP_IO) {
@ -454,7 +477,7 @@ FindPCIVideoInfo(void)
memdone = TRUE;
} else
xf86ErrorF(", ");
xf86ErrorF("0x%08x/%d", info->memBase[i], info->size[i]);
xf86ErrorF("0x%08lx/%d", info->memBase[i], info->size[i]);
}
}
for (i = 0; i < 6; i++) {
@ -465,12 +488,12 @@ FindPCIVideoInfo(void)
iodone = TRUE;
} else
xf86ErrorF(", ");
xf86ErrorF("0x%04x/%d", info->ioBase[i], info->size[i]);
xf86ErrorF("0x%04lx/%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(", BIOS @ 0x%08lx/%d", info->biosBase, info->biosSize);
xf86ErrorF("\n");
}
}
@ -567,7 +590,7 @@ pciIoAccessEnable(void* arg)
ErrorF("pciIoAccessEnable: 0x%05lx\n", *(PCITAG *)arg);
#endif
pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE;
(*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
}
static void
@ -577,7 +600,7 @@ pciIoAccessDisable(void* arg)
ErrorF("pciIoAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
#endif
pArg->ctrl &= ~SETBITS;
(*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
}
#undef SETBITS
@ -589,7 +612,7 @@ pciIo_MemAccessEnable(void* arg)
ErrorF("pciIo_MemAccessEnable: 0x%05lx\n", *(PCITAG *)arg);
#endif
pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE;
(*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
}
static void
@ -599,7 +622,7 @@ pciIo_MemAccessDisable(void* arg)
ErrorF("pciIo_MemAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
#endif
pArg->ctrl &= ~SETBITS;
(*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
}
#undef SETBITS
@ -611,7 +634,7 @@ pciMemAccessEnable(void* arg)
ErrorF("pciMemAccessEnable: 0x%05lx\n", *(PCITAG *)arg);
#endif
pArg->ctrl |= SETBITS | PCI_CMD_MASTER_ENABLE;
(*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
}
static void
@ -621,38 +644,48 @@ pciMemAccessDisable(void* arg)
ErrorF("pciMemAccessDisable: 0x%05lx\n", *(PCITAG *)arg);
#endif
pArg->ctrl &= ~SETBITS;
(*pArg->func)(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
pciWriteLong(pArg->tag, PCI_CMD_STAT_REG, pArg->ctrl);
}
#undef SETBITS
#undef pArg
/* move to OS layer */
#define PCI_PCI_BRDG_CTRL_BASE (PCI_PCI_BRIDGE_CONTROL_REG & 0xFC)
#define SHIFT_BITS ((PCI_PCI_BRIDGE_CONTROL_REG & 0x3) << 3)
#define SETBITS (CARD32)((PCI_PCI_BRIDGE_VGA_EN) << SHIFT_BITS)
#define MASKBITS (PCI_PCI_BRIDGE_VGA_EN | PCI_PCI_BRIDGE_MASTER_ABORT_EN)
static void
pciBusAccessEnable(BusAccPtr ptr)
{
PCITAG tag = ptr->busdep.pci.acc;
CARD16 ctrl;
#ifdef DEBUG
ErrorF("pciBusAccessEnable: bus=%d\n", ptr->busdep.pci.bus);
#endif
(*ptr->busdep.pci.func)(ptr->busdep.pci.acc, PCI_PCI_BRDG_CTRL_BASE,
SETBITS, SETBITS);
ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG);
if ((ctrl & MASKBITS) != PCI_PCI_BRIDGE_VGA_EN) {
ctrl = (ctrl | PCI_PCI_BRIDGE_VGA_EN) &
~(PCI_PCI_BRIDGE_MASTER_ABORT_EN | PCI_PCI_BRIDGE_SECONDARY_RESET);
pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl);
}
}
/* move to OS layer */
static void
pciBusAccessDisable(BusAccPtr ptr)
{
PCITAG tag = ptr->busdep.pci.acc;
CARD16 ctrl;
#ifdef DEBUG
ErrorF("pciBusAccessDisable: bus=%d\n", ptr->busdep.pci.bus);
#endif
(*ptr->busdep.pci.func)(ptr->busdep.pci.acc, PCI_PCI_BRDG_CTRL_BASE,
SETBITS, 0);
ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG);
if (ctrl & MASKBITS) {
ctrl &= ~(MASKBITS | PCI_PCI_BRIDGE_SECONDARY_RESET);
pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl);
}
}
#undef SETBITS
#undef SHIFT_BITS
#undef MASKBITS
/* move to OS layer */
static void
@ -740,23 +773,34 @@ restorePciState(PCITAG tag, pciSavePtr ptr)
static void
savePciBusState(BusAccPtr ptr)
{
PCITAG tag = ptr->busdep.pci.acc;
ptr->busdep.pci.save.control =
pciReadWord(ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG) &
pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG) &
~PCI_PCI_BRIDGE_SECONDARY_RESET;
/* Allow master aborts to complete normally on non-root buses */
if (ptr->busdep.pci.save.control & PCI_PCI_BRIDGE_MASTER_ABORT_EN)
pciWriteWord(ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG,
ptr->busdep.pci.save.control
& ~PCI_PCI_BRIDGE_MASTER_ABORT_EN);
pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG,
ptr->busdep.pci.save.control & ~PCI_PCI_BRIDGE_MASTER_ABORT_EN);
}
/* move to OS layer */
#define MASKBITS (PCI_PCI_BRIDGE_VGA_EN | PCI_PCI_BRIDGE_MASTER_ABORT_EN)
static void
restorePciBusState(BusAccPtr ptr)
{
pciWriteWord(ptr->busdep.pci.acc, PCI_PCI_BRIDGE_CONTROL_REG,
ptr->busdep.pci.save.control);
PCITAG tag = ptr->busdep.pci.acc;
CARD16 ctrl;
/* Only restore the bits we've changed (and don't cause resets) */
ctrl = pciReadWord(tag, PCI_PCI_BRIDGE_CONTROL_REG);
if ((ctrl ^ ptr->busdep.pci.save.control) & MASKBITS) {
ctrl &= ~(MASKBITS | PCI_PCI_BRIDGE_SECONDARY_RESET);
ctrl |= ptr->busdep.pci.save.control & MASKBITS;
pciWriteWord(tag, PCI_PCI_BRIDGE_CONTROL_REG, ctrl);
}
}
#undef MASKBITS
/* move to OS layer */
static void
@ -828,12 +872,17 @@ correctPciSize(memType base, memType oldsize, memType newsize,
#if defined(LONG64) || defined(WORD64)
||
(B2M(pcrp->tag,PCIGETMEMORY64(basep[i])) == base)
#else
||
(!basep[i+1]
&& (B2M(pcrp->tag,PCIGETMEMORY(basep[i])) == base))
#endif
))) {
pcrp->basesize[i] = new_bits;
break; /* to next device */
}
}
if (PCI_MAP_IS64BITMEM(basep[i])) i++;
}
}
@ -883,7 +932,7 @@ removeOverlapsWithBridges(int busIndex, resPtr target)
target->block_end - target->block_begin,
target->res_type);
xf86MsgVerb(X_INFO, 3,
"PCI %s resource overlap reduced 0x%08x from 0x%08x to 0x%08x\n",
"PCI %s resource overlap reduced 0x%08lx from 0x%08lx to 0x%08lx\n",
((target->res_type & ResPhysMask) == ResMem) ? "Memory" : "I/O",
range.rBegin, range.rEnd, target->block_end);
}
@ -988,28 +1037,38 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
(subclass == PCI_SUBCLASS_BRIDGE_HOST))
resMisc |= ResOverlap;
if ((pcrp->pci_command & (PCI_CMD_IO_ENABLE | PCI_CMD_MEM_ENABLE)))
res = activeRes;
else
res = inactiveRes;
basep = &pcrp->pci_base0;
for (i = 0; i < 6; i++) {
if (basep[i]) {
if (PCI_MAP_IS_IO(basep[i]))
P_I_RANGE(range,pcrp->tag,PCIGETIO(basep[i]),
if (PCI_MAP_IS_IO(basep[i])) {
if (pcrp->pci_command & PCI_CMD_IO_ENABLE)
res = activeRes;
else
res = inactiveRes;
P_I_RANGE(range, pcrp->tag, PCIGETIO(basep[i]),
pcrp->basesize[i], ResExcIoBlock | resMisc)
else if (!PCI_MAP_IS64BITMEM(basep[i]))
P_M_RANGE(range,pcrp->tag,PCIGETMEMORY(basep[i]),
pcrp->basesize[i], ResExcMemBlock | resMisc)
else {
} else if (!PCI_MAP_IS64BITMEM(basep[i])) {
if (pcrp->pci_command & PCI_CMD_MEM_ENABLE)
res = activeRes;
else
res = inactiveRes;
P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i]),
pcrp->basesize[i], ResExcMemBlock | resMisc)
} else {
i++;
#if defined(LONG64) || defined(WORD64)
P_M_RANGE(range,pcrp->tag,PCIGETMEMORY64(basep[i-1]),
pcrp->basesize[i-1], ResExcMemBlock | resMisc)
P_M_RANGE(range,pcrp->tag,PCIGETMEMORY64(basep[i - 1]),
pcrp->basesize[i - 1], ResExcMemBlock | resMisc)
#else
if (basep[i])
continue;
P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i - 1]),
pcrp->basesize[i - 1], ResExcMemBlock | resMisc)
#endif
if (pcrp->pci_command & PCI_CMD_MEM_ENABLE)
res = activeRes;
else
res = inactiveRes;
}
if (range.rBegin) { /* catch cases where PCI base is unset */
tmp = xf86AddResToList(NULL, &range, -1);
@ -1018,15 +1077,16 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
}
}
}
/* Ignore disabled non-video ROMs */
if ((res == activeRes) &&
if ((pcrp->pci_command & PCI_CMD_MEM_ENABLE) &&
(pcrp->pci_baserom & PCI_MAP_ROM_DECODE_ENABLE)) {
P_M_RANGE(range,pcrp->tag,PCIGETROM(pcrp->pci_baserom),
pcrp->basesize[6], ResExcMemBlock | resMisc);
if (range.rBegin) {
tmp = xf86AddResToList(NULL, &range, -1);
removeOverlapsWithBridges(pcrp->busnum,tmp);
*res = xf86JoinResLists(tmp,*res);
removeOverlapsWithBridges(pcrp->busnum, tmp);
*activeRes = xf86JoinResLists(tmp, *activeRes);
}
}
}
@ -1063,8 +1123,8 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
pRes->block_end - pRes->block_begin,
pRes->res_type);
xf86MsgVerb(X_INFO, 3,
"PCI %s resource overlap reduced 0x%08x"
" from 0x%08x to 0x%08x\n",
"PCI %s resource overlap reduced 0x%08lx"
" from 0x%08lx to 0x%08lx\n",
((pRes->res_type & ResPhysMask) == ResMem) ?
"Memory" : "I/O",
range.rBegin, range.rEnd, pRes->block_end);
@ -1092,8 +1152,8 @@ xf86GetPciRes(resPtr *activeRes, resPtr *inactiveRes)
pRes->block_end - pRes->block_begin,
pRes->res_type);
xf86MsgVerb(X_INFO, 3,
"PCI %s resource overlap reduced 0x%08x"
" from 0x%08x to 0x%08x\n",
"PCI %s resource overlap reduced 0x%08lx"
" from 0x%08lx to 0x%08lx\n",
((pRes->res_type & ResPhysMask) == ResMem) ?
"Memory" : "I/O",
range.rBegin, range.rEnd, pRes->block_end);
@ -1760,8 +1820,8 @@ xf86GetPciBridgeInfo(void)
break;
}
if (pBusInfo && pBusInfo->funcs->pciGetBridgeBusses)
(*pBusInfo->funcs->pciGetBridgeBusses)(secondary,
if (pBusInfo && pBusInfo->funcs->pciGetBridgeBuses)
(*pBusInfo->funcs->pciGetBridgeBuses)(secondary,
&primary,
&secondary,
&subordinate);
@ -1899,8 +1959,8 @@ xf86GetPciBridgeInfo(void)
break;
}
if (pBusInfo && pBusInfo->funcs->pciGetBridgeBusses)
(*pBusInfo->funcs->pciGetBridgeBusses)(secondary,
if (pBusInfo && pBusInfo->funcs->pciGetBridgeBuses)
(*pBusInfo->funcs->pciGetBridgeBuses)(secondary,
&primary,
&secondary,
&subordinate);
@ -2087,8 +2147,8 @@ xf86GetPciBridgeInfo(void)
if (pBusInfo) {
PciBus->primary = PciBus->secondary = secondary;
if (pBusInfo->funcs->pciGetBridgeBusses)
(*pBusInfo->funcs->pciGetBridgeBusses)
if (pBusInfo->funcs->pciGetBridgeBuses)
(*pBusInfo->funcs->pciGetBridgeBuses)
(secondary,
&PciBus->primary,
&PciBus->secondary,
@ -2275,7 +2335,6 @@ ValidatePci(void)
pciConfigPtr pcrp, *pcrpp;
CARD32 *basep;
resPtr Sys;
resPtr Fix;
resRange range;
int n = 0, m, i;
@ -2286,6 +2345,7 @@ ValidatePci(void)
* the ones which have been assigned to a screen.
*/
Sys = xf86DupResList(osRes);
/* Only validate graphics devices in use */
for (i=0; i<xf86NumScreens; i++) {
for (m = 0; m < xf86Screens[i]->numEntities; m++)
if ((pvp = xf86GetPciInfoForEntity(xf86Screens[i]->entityList[m])))
@ -2328,6 +2388,7 @@ ValidatePci(void)
}
for (pcrpp = xf86PciInfo, pcrp = *pcrpp; pcrp; pcrp = *++(pcrpp)) {
/* These were handled above */
if (PCIINFOCLASSES(pcrp->pci_base_class, pcrp->pci_sub_class))
continue;
@ -2350,13 +2411,16 @@ ValidatePci(void)
pcrp->basesize[i], ResExcMemBlock)
} else {
i++;
#if defined(LONG64) || defined(WORD64)
if (!(pcrp->pci_command & PCI_CMD_MEM_ENABLE))
continue;
#if defined(LONG64) || defined(WORD64)
P_M_RANGE(range, pcrp->tag, PCIGETMEMORY64(basep[i-1]),
pcrp->basesize[i-1], ResExcMemBlock)
#else
continue;
if (basep[i])
continue;
P_M_RANGE(range, pcrp->tag, PCIGETMEMORY(basep[i-1]),
pcrp->basesize[i-1], ResExcMemBlock)
#endif
}
Sys = xf86AddResToList(Sys, &range, -1);
@ -2458,7 +2522,6 @@ ValidatePci(void)
xf86MsgVerb(X_INFO, 3,"MEM/IO:\n");
xf86PrintResList(3,res_m_io);
#endif
Fix = NULL;
for (i = 0; i < 6; i++) {
int j;
resPtr own = NULL;
@ -2596,8 +2659,6 @@ initPciState(void)
pcaccp->devnum = pvp->device;
pcaccp->funcnum = pvp->func;
pcaccp->arg.tag = pciTag(pvp->bus, pvp->device, pvp->func);
pcaccp->arg.func =
(WriteProcPtr)pciLongFunc(pcaccp->arg.tag,WRITE);
pcaccp->ioAccess.AccessDisable = pciIoAccessDisable;
pcaccp->ioAccess.AccessEnable = pciIoAccessEnable;
pcaccp->ioAccess.arg = &pcaccp->arg;
@ -2674,8 +2735,6 @@ initPciBusState(void)
pbap->enable_f = pciBusAccessEnable;
pbap->disable_f = pciBusAccessDisable;
pbap->busdep.pci.acc = pciTag(pbp->brbus,pbp->brdev,pbp->brfunc);
pbap->busdep.pci.func =
(SetBitsProcPtr)pciLongFunc(pbap->busdep.pci.acc,SET_BITS);
savePciBusState(pbap);
break;
case PCI_SUBCLASS_BRIDGE_ISA:

View file

@ -1,4 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h,v 3.8 2002/09/16 16:55:33 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86pciBus.h,v 3.10 2003/08/24 17:36:56 dawes Exp $ */
/*
* Copyright (c) 1999-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#ifndef _XF86_PCI_BUS_H
#define _XF86_PCI_BUS_H
@ -11,12 +38,8 @@ typedef struct {
CARD32 biosBase;
} pciSave, *pciSavePtr;
typedef void (*SetBitsProcPtr)(PCITAG, int, CARD32, CARD32);
typedef void (*WriteProcPtr)(PCITAG, int, CARD32);
typedef struct {
PCITAG tag;
WriteProcPtr func;
CARD32 ctrl;
} pciArg;

View file

@ -1,7 +1,30 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.90 2002/11/25 14:04:56 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.97 2003/10/30 17:36:56 tsi Exp $ */
/*
* Copyright (c) 1997-2000 by The XFree86 Project, Inc.
* Copyright (c) 1997-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
/*
@ -16,6 +39,7 @@
#include "input.h"
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "colormapst.h"
#include "xf86Module.h"
#include "xf86Opt.h"
#include "xf86Pci.h"
@ -452,24 +476,10 @@ typedef struct _confdrirec {
/* These values should be adjusted when new fields are added to ScrnInfoRec */
#define NUM_RESERVED_INTS 16
#define NUM_RESERVED_POINTERS 15
#define NUM_RESERVED_FUNCS 16
#define NUM_RESERVED_FUNCS 12
typedef pointer (*funcPointer)(void);
/* Flags for driver messages */
typedef enum {
X_PROBED, /* Value was probed */
X_CONFIG, /* Value was given in the config file */
X_DEFAULT, /* Value is a default */
X_CMDLINE, /* Value was given on the command line */
X_NOTICE, /* Notice */
X_ERROR, /* Error message */
X_WARNING, /* Warning message */
X_INFO, /* Informational message */
X_NONE, /* No prefix */
X_NOT_IMPLEMENTED /* Not implemented */
} MessageType;
/* flags for depth 24 pixmap options */
typedef enum {
Pix24DontCare = 0,
@ -747,12 +757,16 @@ typedef void xf86AdjustFrameProc (int, int, int, int);
typedef Bool xf86EnterVTProc (int, int);
typedef void xf86LeaveVTProc (int, int);
typedef void xf86FreeScreenProc (int, int);
typedef int xf86ValidModeProc (int, DisplayModePtr, Bool, int);
typedef ModeStatus xf86ValidModeProc (int, DisplayModePtr, Bool, int);
typedef void xf86EnableDisableFBAccessProc(int, Bool);
typedef int xf86SetDGAModeProc (int, int, DGADevicePtr);
typedef int xf86ChangeGammaProc (int, Gamma);
typedef void xf86PointerMovedProc (int, int, int);
typedef Bool xf86PMEventProc (int, pmEvent, Bool);
typedef int xf86HandleMessageProc (int, const char*, const char*, char**);
typedef void xf86DPMSSetProc (ScrnInfoPtr, int, int);
typedef void xf86LoadPaletteProc (ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
typedef void xf86SetOverscanProc (ScrnInfoPtr, int);
/*
* ScrnInfoRec
@ -903,6 +917,10 @@ typedef struct _ScrnInfoRec {
xf86ChangeGammaProc *ChangeGamma;
xf86PointerMovedProc *PointerMoved;
xf86PMEventProc *PMEvent;
xf86HandleMessageProc *HandleMessage;
xf86DPMSSetProc *DPMSSet;
xf86LoadPaletteProc *LoadPalette;
xf86SetOverscanProc *SetOverscan;
/*
* This can be used when the minor ABI version is incremented.
@ -1023,7 +1041,32 @@ typedef enum {
ACTION_CLOSECLIENT, /* Kill client holding grab */
ACTION_SWITCHSCREEN = 100, /* VT switch */
ACTION_SWITCHSCREEN_NEXT,
ACTION_SWITCHSCREEN_PREV
ACTION_SWITCHSCREEN_PREV,
ACTION_MESSAGE = 9999 /* Generic message passing */
} ActionEvent;
/* xf86Versions.c */
/*
* Never change existing values, and always assign values explicitly.
* NUM_BUILTIN_IFS must always be the last entry.
*/
typedef enum {
BUILTIN_IF_OSMOUSE = 0,
BUILTIN_IF_OSKBD = 1,
NUM_BUILTIN_IFS
} BuiltinInterface;
/*
* These are intentionally the same as the module version macros.
* It is possible to register a module as providing a specific interface,
* in which case the module's version is used. This feature isn't
* really ready for use yet though.
*/
#define BUILTIN_INTERFACE_VERSION_NUMERIC(maj, min, patch) \
((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF))
#define GET_BUILTIN_INTERFACE_MAJOR_VERSION(vers) (((vers) >> 24) & 0xFF)
#define GET_BUILTIN_INTERFACE_MINOR_VERSION(vers) (((vers) >> 16) & 0xFF)
#define GET_BUILTIN_INTERFACE_PATCH_VERSION(vers) ((vers) & 0xFFFF)
#endif /* _XF86STR_H */

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.23 2002/11/09 01:18:33 keithp Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.25 2003/08/24 17:36:56 dawes Exp $ */
/*
* Copyright (c) 1998-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#ifndef _XF86XV_H_
#define _XF86XV_H_
@ -218,55 +245,27 @@ xf86XVClipVideoHelper(
INT32 height
);
/*** These are DDX layer privates ***/
void
xf86XVCopyYUV12ToPacked(
const void *srcy,
const void *srcv,
const void *srcu,
void *dst,
int srcPitchy,
int srcPitchuv,
int dstPitch,
int h,
int w
);
extern int XF86XvScreenIndex;
typedef struct {
DestroyWindowProcPtr DestroyWindow;
ClipNotifyProcPtr ClipNotify;
WindowExposuresProcPtr WindowExposures;
void (*AdjustFrame)(int, int, int, int);
Bool (*EnterVT)(int, int);
void (*LeaveVT)(int, int);
GCPtr videoGC;
} XF86XVScreenRec, *XF86XVScreenPtr;
typedef struct {
int flags;
PutVideoFuncPtr PutVideo;
PutStillFuncPtr PutStill;
GetVideoFuncPtr GetVideo;
GetStillFuncPtr GetStill;
StopVideoFuncPtr StopVideo;
SetPortAttributeFuncPtr SetPortAttribute;
GetPortAttributeFuncPtr GetPortAttribute;
QueryBestSizeFuncPtr QueryBestSize;
PutImageFuncPtr PutImage;
ReputImageFuncPtr ReputImage;
QueryImageAttributesFuncPtr QueryImageAttributes;
} XvAdaptorRecPrivate, *XvAdaptorRecPrivatePtr;
typedef struct {
ScrnInfoPtr pScrn;
DrawablePtr pDraw;
unsigned char type;
unsigned int subWindowMode;
DDXPointRec clipOrg;
RegionPtr clientClip;
RegionPtr pCompositeClip;
Bool FreeCompositeClip;
XvAdaptorRecPrivatePtr AdaptorRec;
XvStatus isOn;
Bool moved;
int vid_x, vid_y, vid_w, vid_h;
int drw_x, drw_y, drw_w, drw_h;
DevUnion DevPriv;
} XvPortRecPrivate, *XvPortRecPrivatePtr;
typedef struct _XF86XVWindowRec{
XvPortRecPrivatePtr PortRec;
struct _XF86XVWindowRec *next;
} XF86XVWindowRec, *XF86XVWindowPtr;
void
xf86XVCopyPacked(
const void *src,
void *dst,
int srcPitch,
int dstPitch,
int h,
int w
);
#endif /* _XF86XV_H_ */

View file

@ -1,4 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c,v 1.3 2001/04/01 14:00:08 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.c,v 1.6 2003/10/08 22:31:59 mvojkovi Exp $ */
/*
* Copyright (c) 2001-2003 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#include "misc.h"
#include "xf86.h"
@ -14,6 +41,7 @@
#include "xvmodproc.h"
#endif
#include "xf86xvpriv.h"
#include "xf86xvmc.h"
#ifdef XFree86LOADER
@ -199,3 +227,13 @@ Bool xf86XvMCScreenInit(
return TRUE;
}
XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec (void)
{
return xcalloc(1, sizeof(XF86MCAdaptorRec));
}
void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor)
{
xfree(adaptor);
}

View file

@ -1,4 +1,31 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.h,v 1.5 2001/11/14 21:54:39 mvojkovi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xvmc.h,v 1.7 2003/10/08 22:31:59 mvojkovi Exp $ */
/*
* 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
* and author(s) 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 copyright holder(s) and author(s).
*/
#ifndef _XF86XVMC_H
#define _XF86XVMC_H
@ -131,4 +158,7 @@ Bool xf86XvMCScreenInit(
XF86MCAdaptorPtr *adaptors
);
XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec (void);
void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor);
#endif /* _XF86XVMC_H */

View file

@ -24,7 +24,7 @@
* in this Software without prior written authorization from Metro Link.
*
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xisb.c,v 1.5 2000/11/06 19:24:07 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xisb.c,v 1.6 2003/03/25 04:18:21 dawes Exp $ */
/*
X Input Serial Buffer routines for use in any XInput driver that accesses
@ -36,6 +36,10 @@
* Standard Headers
****************************************************************************/
#ifdef __UNIXOS2__
#define I_NEED_OS2_H
#endif
#include <misc.h>
#include <xf86.h>
#include <xf86Version.h>

View file

@ -3,7 +3,7 @@
*
* Copyright 1999 by Andrew C Aitchison <A.C.Aitchison@dpmms.cam.ac.uk>
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c,v 1.9 2001/10/28 03:33:21 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/ddcProperty.c,v 1.10 2003/11/03 05:11:04 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@ -100,10 +100,8 @@ xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC)
EDID1Atom, XA_INTEGER, 8,
128, (unsigned char *)EDID1rawdata
);
#ifdef DEBUG
if (ret != Success)
ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
#endif
}
if (makeEDID2prop) {
@ -127,9 +125,8 @@ xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC)
EDID2Atom, XA_INTEGER, 8,
256, (unsigned char *)EDID2rawdata
);
#ifdef DEBUG
if (ret != Success)
ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
#endif
}
if (DDC->vdif) {
@ -151,9 +148,8 @@ xf86SetDDCproperties(ScrnInfoPtr pScrnInfo, xf86MonPtr DDC)
strlen(VDIF_DUMMY_STRING),
VDIF_DUMMY_STRING
);
#ifdef DEBUG
if (ret != Success)
ErrorF("xf86RegisterRootWindowProperty returns %d\n", ret );
#endif
}
return TRUE;

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.15 2001/05/22 17:01:23 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_edid.c,v 1.16 2003/09/24 02:43:17 dawes Exp $ */
/* print_edid.c: print out all information retrieved from display device
*
@ -41,7 +41,7 @@ static void
print_vendor(int scrnIndex, struct vendor *c)
{
xf86DrvMsg(scrnIndex, X_INFO, "Manufacturer: %s Model: %x Serial#: %u\n",
&c->name, c->prod_id, c->serial);
(char *)&c->name, c->prod_id, c->serial);
xf86DrvMsg(scrnIndex, X_INFO, "Year: %u Week: %u\n", c->year, c->week);
}

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_vdif.c,v 1.3 2003/02/17 16:08:27 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/print_vdif.c,v 1.5 2003/11/06 18:37:58 tsi Exp $ */
#include "vdif.h"
#include "misc.h"

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.3 2000/04/14 12:16:04 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.5 2003/11/06 18:37:58 tsi Exp $ */
#ifndef _VDIF_H
#define _VDIF_H
@ -24,7 +24,8 @@
#include "Xmd.h"
#pragma pack(1)
#undef CARD32
#define CARD32 unsigned int /* ... on all supported platforms */
typedef struct _VDIF { /* Monitor Description: */
CARD8 VDIFId[4]; /* alway "VDIF" */
@ -169,6 +170,6 @@ typedef struct _vdif {
char * strings;
} xf86vdif, *xf86vdifPtr;
#pragma pack()
#undef CARD32
#endif

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.23 2003/02/17 16:08:27 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/xf86DDC.c,v 1.27 2003/10/30 17:48:19 tsi Exp $ */
/* xf86DDC.c
*
@ -19,6 +19,7 @@ const char *i2cSymbols[] = {
"xf86CreateI2CDevRec",
"xf86I2CDevInit",
"xf86I2CWriteRead",
"xf86I2CFindDev",
"xf86DestroyI2CDevRec",
NULL
};
@ -332,19 +333,22 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
int i;
xf86LoaderReqSymLists(i2cSymbols, NULL);
dev = xf86CreateI2CDevRec();
dev->DevName = "ddc2";
dev->SlaveAddr = 0xA0;
dev->ByteTimeout = 2200; /* VESA DDC spec 3 p. 43 (+10 %) */
dev->StartTimeout = 550;
dev->BitTimeout = 40;
dev->ByteTimeout = 40;
dev->AcknTimeout = 40;
dev->pI2CBus = pBus;
if (! xf86I2CDevInit(dev)) {
xf86DrvMsg(X_PROBED,scrnIndex,"No DDC2 device\n");
return NULL;
if (!(dev = xf86I2CFindDev(pBus, 0x00A0))) {
dev = xf86CreateI2CDevRec();
dev->DevName = "ddc2";
dev->SlaveAddr = 0xA0;
dev->ByteTimeout = 2200; /* VESA DDC spec 3 p. 43 (+10 %) */
dev->StartTimeout = 550;
dev->BitTimeout = 40;
dev->ByteTimeout = 40;
dev->AcknTimeout = 40;
dev->pI2CBus = pBus;
if (!xf86I2CDevInit(dev)) {
xf86DrvMsg(scrnIndex, X_PROBED, "No DDC2 device\n");
return NULL;
}
}
if (start < 0x100) {
w_bytes = 1;
@ -358,10 +362,9 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
* (len));
for (i=0; i<RETRIES; i++) {
if (xf86I2CWriteRead(dev, W_Buffer,w_bytes, R_Buffer,len)) {
if (!DDC_checksum(R_Buffer,len)) {
xf86DestroyI2CDevRec(dev,TRUE);
if (!DDC_checksum(R_Buffer,len))
return R_Buffer;
}
#ifdef DEBUG
else ErrorF("Checksum error in EDID block\n");
#endif
@ -375,5 +378,3 @@ DDCRead_DDC2(int scrnIndex, I2CBusPtr pBus, int start, int len)
xfree(R_Buffer);
return NULL;
}

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/Xext/dgaproc.h,v 1.21 2000/06/30 19:06:54 keithp Exp $ */
/* $XFree86: xc/programs/Xserver/Xext/dgaproc.h,v 1.22 2003/07/16 01:38:29 dawes Exp $ */
#ifndef __DGAPROC_H
#define __DGAPROC_H
@ -53,9 +53,6 @@ typedef struct {
int reserved2;
} XDGAModeRec, *XDGAModePtr;
void XFree86DGAExtensionInit(void);
/* DDX interface */
int

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.c,v 1.16 2002/03/06 21:12:33 mvojkovi Exp $ */
/* $XFree86: xc/programs/Xserver/Xext/extmod/modinit.c,v 1.17 2003/07/16 01:38:33 dawes Exp $ */
/*
*
@ -31,114 +31,10 @@
#include "Xproto.h"
#include "modinit.h"
static MODULESETUPPROTO(extmodSetup);
extern Bool noTestExtensions;
#ifdef SHAPE
extern void ShapeExtensionInit(INITARGS);
#define _SHAPE_SERVER_ /* don't want Xlib structures */
#include "shapestr.h"
#endif
#ifdef MULTIBUFFER
extern void MultibufferExtensionInit(INITARGS);
#define _MULTIBUF_SERVER_ /* don't want Xlib structures */
#include "multibufst.h"
#endif
#ifdef MITMISC
extern void MITMiscExtensionInit(INITARGS);
#define _MITMISC_SERVER_
#include "mitmiscstr.h"
#endif
#ifdef XTEST
extern void XTestExtensionInit(INITARGS);
#define _XTEST_SERVER_
#include "XTest.h"
#include "xteststr.h"
#endif
#ifdef BIGREQS
extern void BigReqExtensionInit(INITARGS);
#include "bigreqstr.h"
#endif
#ifdef XSYNC
extern void SyncExtensionInit(INITARGS);
#define _SYNC_SERVER
#include "sync.h"
#include "syncstr.h"
#endif
#ifdef SCREENSAVER
extern void ScreenSaverExtensionInit (INITARGS);
#include "saver.h"
#endif
#ifdef XCMISC
extern void XCMiscExtensionInit(INITARGS);
#include "xcmiscstr.h"
#endif
#ifdef XF86VIDMODE
extern void XFree86VidModeExtensionInit(INITARGS);
#define _XF86VIDMODE_SERVER_
#include "xf86vmstr.h"
#endif
#ifdef XF86MISC
extern void XFree86MiscExtensionInit(INITARGS);
#define _XF86MISC_SERVER_
#define _XF86MISC_SAVER_COMPAT_
#include "xf86mscstr.h"
#endif
#ifdef XFreeXDGA
extern void XFree86DGAExtensionInit(INITARGS);
extern void XFree86DGARegister(INITARGS);
#define _XF86DGA_SERVER_
#include "xf86dgastr.h"
#endif
#ifdef DPMSExtension
extern void DPMSExtensionInit(INITARGS);
#include "dpmsstr.h"
#endif
#ifdef FONTCACHE
extern void FontCacheExtensionInit(INITARGS);
#define _FONTCACHE_SERVER_
#include "fontcacheP.h"
#include "fontcachstr.h"
#endif
#ifdef TOGCUP
extern void XcupExtensionInit(INITARGS);
#define _XCUP_SERVER_
#include "Xcupstr.h"
#endif
#ifdef EVI
extern void EVIExtensionInit(INITARGS);
#define _XEVI_SERVER_
#include "XEVIstr.h"
#endif
#ifdef XV
extern void XvExtensionInit(INITARGS);
extern void XvMCExtensionInit(INITARGS);
extern void XvRegister(INITARGS);
#include "Xv.h"
#include "XvMC.h"
#endif
#ifdef RES
extern void ResExtensionInit(INITARGS);
#include "XResproto.h"
#endif
/*
* Array describing extensions to be initialized
*/

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/Xext/xf86dga.c,v 3.21 2000/06/30 19:06:54 keithp Exp $ */
/* $XFree86: xc/programs/Xserver/Xext/xf86dga.c,v 3.22 2003/07/16 01:38:30 dawes Exp $ */
/*
@ -24,6 +24,8 @@ Copyright (c) 1995, 1996, 1999 XFree86 Inc
#include "swaprep.h"
#include "dgaproc.h"
#include "xf86dgaext.h"
static DISPATCH_PROC(ProcXF86DGADirectVideo);
static DISPATCH_PROC(ProcXF86DGAGetVidPage);
@ -270,8 +272,7 @@ ProcXF86DGAViewPortChanged(ClientPtr client)
}
int
ProcXF86DGADispatch (client)
register ClientPtr client;
ProcXF86DGADispatch(register ClientPtr client)
{
REQUEST(xReq);

View file

@ -3,7 +3,7 @@
Written by Mark Vojkovich
*/
/* $XFree86: xc/programs/Xserver/Xext/xf86dga2.c,v 1.17 2001/10/28 03:32:51 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/Xext/xf86dga2.c,v 1.18 2003/07/16 01:38:30 dawes Exp $ */
#define NEED_REPLIES
@ -24,6 +24,7 @@
#include "xf86dgastr.h"
#include "swaprep.h"
#include "dgaproc.h"
#include "xf86dgaext.h"
#ifdef EXTMODULE
#include "xf86_ansic.h"
@ -31,6 +32,7 @@
#include <string.h>
#endif
#include "modinit.h"
static DISPATCH_PROC(ProcXDGADispatch);
static DISPATCH_PROC(SProcXDGADispatch);
@ -51,10 +53,6 @@ static DISPATCH_PROC(ProcXDGASetClientVersion);
static DISPATCH_PROC(ProcXDGAChangePixmapMode);
static DISPATCH_PROC(ProcXDGACreateColormap);
extern DISPATCH_PROC(ProcXF86DGADispatch);
static void XDGAResetProc(ExtensionEntry *extEntry);
static void DGAClientStateChange (CallbackListPtr*, pointer, pointer);
@ -78,7 +76,7 @@ typedef struct {
#define DGAPRIV(c) ((c)->devPrivates[DGAClientPrivateIndex].ptr)
void
XFree86DGAExtensionInit(void)
XFree86DGAExtensionInit(INITARGS)
{
ExtensionEntry* extEntry;
@ -766,7 +764,7 @@ ProcXDGADispatch (ClientPtr client)
#ifdef EXTMODULE
void
XFree86DGARegister()
XFree86DGARegister(INITARGS)
{
XDGAEventBase = &DGAEventBase;
}

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/Xext/xf86misc.c,v 3.37 2002/11/20 04:04:58 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/Xext/xf86misc.c,v 3.41 2003/11/17 22:20:27 dawes Exp $ */
/*
* Copyright (c) 1995, 1996 The XFree86 Project, Inc
@ -54,9 +54,7 @@ typedef struct {
#define MPRIV(c) ((c)->devPrivates[MiscClientPrivateIndex].ptr)
static void XF86MiscResetProc(
#if NeedFunctionPrototypes
ExtensionEntry* /* extEntry */
#endif
);
static void
@ -84,6 +82,7 @@ static DISPATCH_PROC(ProcXF86MiscSetMouseSettings);
static DISPATCH_PROC(ProcXF86MiscSetGrabKeysState);
static DISPATCH_PROC(ProcXF86MiscSetClientVersion);
static DISPATCH_PROC(ProcXF86MiscGetFilePaths);
static DISPATCH_PROC(ProcXF86MiscPassMessage);
#ifdef _XF86MISC_SAVER_COMPAT_
static DISPATCH_PROC(ProcXF86MiscGetSaver);
static DISPATCH_PROC(ProcXF86MiscSetSaver);
@ -97,12 +96,15 @@ static DISPATCH_PROC(SProcXF86MiscSetMouseSettings);
static DISPATCH_PROC(SProcXF86MiscSetGrabKeysState);
static DISPATCH_PROC(SProcXF86MiscSetClientVersion);
static DISPATCH_PROC(SProcXF86MiscGetFilePaths);
static DISPATCH_PROC(SProcXF86MiscPassMessage);
#ifdef _XF86MISC_SAVER_COMPAT_
static DISPATCH_PROC(SProcXF86MiscGetSaver);
static DISPATCH_PROC(SProcXF86MiscSetSaver);
#endif
#if 0
static unsigned char XF86MiscReqCode = 0;
#endif
#ifdef DEBUG
# define DEBUG_P(x) ErrorF(x"\n");
@ -148,7 +150,9 @@ XFree86MiscExtensionInit(void)
SProcXF86MiscDispatch,
XF86MiscResetProc,
StandardMinorOpcode))) {
#if 0
XF86MiscReqCode = (unsigned char)extEntry->base;
#endif
miscErrorBase = extEntry->errorBase;
}
}
@ -354,14 +358,13 @@ ProcXF86MiscSetMouseSettings(client)
if (xf86GetVerbosity() > 1) {
ErrorF("SetMouseSettings - type: %d brate: %d srate: %d chdmid: %d\n",
stuff->mousetype, stuff->baudrate,
stuff->samplerate, stuff->chordmiddle);
ErrorF(" em3but: %d em3tim: %d res: %d flags: %d\n",
stuff->emulate3buttons, stuff->emulate3timeout,
stuff->resolution, stuff->flags);
(int)stuff->mousetype, (int)stuff->baudrate,
(int)stuff->samplerate, stuff->chordmiddle);
ErrorF(" em3but: %d em3tim: %d res: %d flags: %ld\n",
stuff->emulate3buttons, (int)stuff->emulate3timeout,
(int)stuff->resolution, (unsigned long)stuff->flags);
}
if ((mouse = MiscExtCreateStruct(MISC_POINTER)) == (pointer) 0)
return BadAlloc;
@ -427,8 +430,8 @@ ProcXF86MiscSetKbdSettings(client)
if (xf86GetVerbosity() > 1)
ErrorF("SetKbdSettings - type: %d rate: %d delay: %d snumlk: %d\n",
stuff->kbdtype, stuff->rate,
stuff->delay, stuff->servnumlock);
(int)stuff->kbdtype, (int)stuff->rate,
(int)stuff->delay, stuff->servnumlock);
if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0)
return BadAlloc;
@ -554,6 +557,59 @@ ProcXF86MiscGetFilePaths(client)
return (client->noClientException);
}
static int
ProcXF86MiscPassMessage(client)
register ClientPtr client;
{
xXF86MiscPassMessageReply rep;
char *msgtype, *msgval, *retstr;
int retval, size;
register int n;
REQUEST(xXF86MiscPassMessageReq);
DEBUG_P("XF86MiscPassMessage");
REQUEST_AT_LEAST_SIZE(xXF86MiscPassMessageReq);
size = (sizeof(xXF86MiscPassMessageReq) + 3) >> 2;
size+= (stuff->typelen + 3) >> 2;
size+= (stuff->vallen + 3) >> 2;
if (client->req_len < size)
return BadLength;
if (stuff->typelen) {
if (!(msgtype = xalloc(stuff->typelen)))
return BadAlloc;
strncpy(msgtype,(char*)(&stuff[1]),stuff->typelen);
} else return BadValue;
if (stuff->vallen) {
if (!(msgval = xalloc(stuff->vallen)))
return BadAlloc;
strncpy(msgval,(char*)(&stuff[1] + ((stuff->typelen + 3) & ~3)),
stuff->vallen);
} else return BadValue;
if ((retval= MiscExtPassMessage(stuff->screen,msgtype,msgval,&retstr)) != 0)
return retval;
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.mesglen = (retstr? strlen(retstr): 0);
rep.length = (SIZEOF(xXF86MiscPassMessageReply) - SIZEOF(xGenericReply) +
((rep.mesglen + 3) & ~3)) >> 2;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.mesglen, n);
}
WriteToClient(client, SIZEOF(xXF86MiscPassMessageReply), (char *)&rep);
if (rep.mesglen)
WriteToClient(client, rep.mesglen, (char *)retstr);
return (client->noClientException);
}
static int
ProcXF86MiscDispatch (client)
register ClientPtr client;
@ -577,6 +633,8 @@ ProcXF86MiscDispatch (client)
return ProcXF86MiscSetClientVersion(client);
case X_XF86MiscGetFilePaths:
return ProcXF86MiscGetFilePaths(client);
case X_XF86MiscPassMessage:
return ProcXF86MiscPassMessage(client);
default:
if (!xf86GetModInDevEnabled())
return miscErrorBase + XF86MiscModInDevDisabled;
@ -723,6 +781,17 @@ SProcXF86MiscGetFilePaths(client)
return ProcXF86MiscGetFilePaths(client);
}
static int
SProcXF86MiscPassMessage(client)
ClientPtr client;
{
register int n;
REQUEST(xXF86MiscPassMessageReq);
swaps(&stuff->length, n);
REQUEST_SIZE_MATCH(xXF86MiscPassMessageReq);
return ProcXF86MiscPassMessage(client);
}
static int
SProcXF86MiscDispatch (client)
register ClientPtr client;
@ -746,6 +815,8 @@ SProcXF86MiscDispatch (client)
return SProcXF86MiscSetClientVersion(client);
case X_XF86MiscGetFilePaths:
return SProcXF86MiscGetFilePaths(client);
case X_XF86MiscPassMessage:
return SProcXF86MiscPassMessage(client);
default:
if (!xf86GetModInDevEnabled())
return miscErrorBase + XF86MiscModInDevDisabled;

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/Xext/xf86miscproc.h,v 1.5 2002/11/20 04:04:58 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/Xext/xf86miscproc.h,v 1.6 2003/04/03 16:15:47 dawes Exp $ */
/* Prototypes for Pointer/Keyboard functions that the DDX must provide */
@ -59,6 +59,8 @@ MiscExtReturn MiscExtApply(pointer structure, MiscExtStructType mse_or_kbd);
Bool MiscExtSetMouseDevice(pointer mouse, char* device);
Bool MiscExtGetFilePaths(const char **configfile, const char **modulepath,
const char **logfile);
int MiscExtPassMessage(int scrn, const char *msgtype, const char *msgval,
char **retstr);
#endif

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/Xext/xf86vmode.c,v 3.54 2002/12/22 00:46:51 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/Xext/xf86vmode.c,v 3.59 2003/11/17 22:20:27 dawes Exp $ */
/*
@ -64,9 +64,7 @@ typedef struct {
#define VMPRIV(c) ((c)->devPrivates[VidModeClientPrivateIndex].ptr)
static void XF86VidModeResetProc(
#if NeedFunctionPrototypes
ExtensionEntry* /* extEntry */
#endif
);
static DISPATCH_PROC(ProcXF86VidModeDispatch);
@ -112,8 +110,9 @@ static DISPATCH_PROC(SProcXF86VidModeGetGammaRamp);
static DISPATCH_PROC(SProcXF86VidModeSetGammaRamp);
static DISPATCH_PROC(SProcXF86VidModeGetGammaRampSize);
#if 0
static unsigned char XF86VidModeReqCode = 0;
#endif
/* The XF86VIDMODE_EVENTS code is far from complete */
@ -217,7 +216,9 @@ XFree86VidModeExtensionInit(void)
SProcXF86VidModeDispatch,
XF86VidModeResetProc,
StandardMinorOpcode))) {
#if 0
XF86VidModeReqCode = (unsigned char)extEntry->base;
#endif
VidModeErrorBase = extEntry->errorBase;
#ifdef XF86VIDMODE_EVENTS
XF86VidModeEventBase = extEntry->eventBase;
@ -467,14 +468,14 @@ ProcXF86VidModeGetModeLine(ClientPtr client)
rep.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
if (xf86GetVerbosity() > 1) {
ErrorF("GetModeLine - scrn: %d clock: %d\n",
stuff->screen, rep.dotclock);
ErrorF("GetModeLine - scrn: %d clock: %ld\n",
stuff->screen, (unsigned long)rep.dotclock);
ErrorF("GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
rep.hdisplay, rep.hsyncstart,
rep.hsyncend, rep.htotal);
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
rep.vdisplay, rep.vsyncstart, rep.vsyncend,
rep.vtotal, rep.flags);
rep.vtotal, (unsigned long)rep.flags);
}
/*
@ -675,22 +676,23 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
stuff->after_flags = oldstuff->after_flags;
}
if (xf86GetVerbosity() > 1) {
ErrorF("AddModeLine - scrn: %d clock: %d\n",
stuff->screen, stuff->dotclock);
ErrorF("AddModeLine - scrn: %d clock: %ld\n",
(int)stuff->screen, (unsigned long)stuff->dotclock);
ErrorF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
stuff->hdisplay, stuff->hsyncstart,
stuff->hsyncend, stuff->htotal);
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
stuff->vtotal, stuff->flags);
ErrorF(" after - scrn: %d clock: %d\n",
stuff->screen, stuff->after_dotclock);
stuff->vtotal, (unsigned long)stuff->flags);
ErrorF(" after - scrn: %d clock: %ld\n",
(int)stuff->screen, (unsigned long)stuff->after_dotclock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
stuff->after_hdisplay, stuff->after_hsyncstart,
stuff->after_hsyncend, stuff->after_htotal);
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
stuff->after_vdisplay, stuff->after_vsyncstart,
stuff->after_vsyncend, stuff->after_vtotal, stuff->after_flags);
stuff->after_vsyncend, stuff->after_vtotal,
(unsigned long)stuff->after_flags);
}
if (ver < 2) {
@ -742,6 +744,7 @@ ProcXF86VidModeAddModeLine(ClientPtr client)
if (mode == NULL)
return BadValue;
VidModeSetModeValue(mode, VIDMODE_CLOCK, stuff->dotclock);
VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay);
VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
VidModeSetModeValue(mode, VIDMODE_H_SYNCEND, stuff->hsyncend);
@ -821,14 +824,14 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
stuff->privsize = oldstuff->privsize;
}
if (xf86GetVerbosity() > 1) {
ErrorF("DeleteModeLine - scrn: %d clock: %d\n",
stuff->screen, stuff->dotclock, stuff->dotclock);
ErrorF("DeleteModeLine - scrn: %d clock: %ld\n",
(int)stuff->screen, (unsigned long)stuff->dotclock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
stuff->hdisplay, stuff->hsyncstart,
stuff->hsyncend, stuff->htotal);
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
stuff->vtotal, stuff->flags);
stuff->vtotal, (unsigned long)stuff->flags);
}
if (ver < 2) {
@ -840,8 +843,11 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client)
}
if (len != stuff->privsize) {
if (xf86GetVerbosity() > 1) {
ErrorF("req_len = %d, sizeof(Req) = %d, privsize = %d, len = %d, length = %d\n",
client->req_len, sizeof(xXF86VidModeDeleteModeLineReq)>>2, stuff->privsize, len, stuff->length);
ErrorF("req_len = %ld, sizeof(Req) = %d, privsize = %ld, "
"len = %d, length = %d\n",
(unsigned long)client->req_len,
(int)sizeof(xXF86VidModeDeleteModeLineReq)>>2,
(unsigned long)stuff->privsize, len, stuff->length);
}
return BadLength;
}
@ -935,11 +941,11 @@ ProcXF86VidModeModModeLine(ClientPtr client)
}
if (xf86GetVerbosity() > 1) {
ErrorF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n",
stuff->screen, stuff->hdisplay, stuff->hsyncstart,
(int)stuff->screen, stuff->hdisplay, stuff->hsyncstart,
stuff->hsyncend, stuff->htotal);
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
stuff->vtotal, stuff->flags);
stuff->vtotal, (unsigned long)stuff->flags);
}
if (ver < 2) {
@ -989,18 +995,23 @@ ProcXF86VidModeModModeLine(ClientPtr client)
break;
case MODE_HSYNC:
case MODE_H_ILLEGAL:
xfree(modetmp);
return VidModeErrorBase + XF86VidModeBadHTimings;
case MODE_VSYNC:
case MODE_V_ILLEGAL:
xfree(modetmp);
return VidModeErrorBase + XF86VidModeBadVTimings;
default:
xfree(modetmp);
return VidModeErrorBase + XF86VidModeModeUnsuitable;
}
/* Check that the driver is happy with the mode */
if (VidModeCheckModeForDriver(stuff->screen, modetmp) != MODE_OK) {
xfree(modetmp);
return VidModeErrorBase + XF86VidModeModeUnsuitable;
}
xfree(modetmp);
VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay);
VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
@ -1029,7 +1040,7 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
(xXF86OldVidModeValidateModeLineReq *)client->requestBuffer;
xXF86VidModeValidateModeLineReq newstuff;
xXF86VidModeValidateModeLineReply rep;
pointer mode, modetmp;
pointer mode, modetmp = NULL;
int len, status, dotClock;
int ver;
@ -1055,14 +1066,14 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
stuff->privsize = oldstuff->privsize;
}
if (xf86GetVerbosity() > 1) {
ErrorF("ValidateModeLine - scrn: %d clock: %d\n",
stuff->screen, stuff->dotclock);
ErrorF("ValidateModeLine - scrn: %d clock: %ld\n",
(int)stuff->screen, (unsigned long)stuff->dotclock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
stuff->hdisplay, stuff->hsyncstart,
stuff->hsyncend, stuff->htotal);
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
stuff->vtotal, stuff->flags);
stuff->vtotal, (unsigned long)stuff->flags);
}
if (ver < 2) {
@ -1119,6 +1130,9 @@ ProcXF86VidModeValidateModeLine(ClientPtr client)
status = VidModeCheckModeForDriver(stuff->screen, modetmp);
status_reply:
if(modetmp)
xfree(modetmp);
rep.type = X_Reply;
rep.length = (SIZEOF(xXF86VidModeValidateModeLineReply)
- SIZEOF(xGenericReply)) >> 2;
@ -1186,14 +1200,14 @@ ProcXF86VidModeSwitchToMode(ClientPtr client)
stuff->privsize = oldstuff->privsize;
}
if (xf86GetVerbosity() > 1) {
ErrorF("SwitchToMode - scrn: %d clock: %d\n",
stuff->screen, stuff->dotclock);
ErrorF("SwitchToMode - scrn: %d clock: %ld\n",
(int)stuff->screen, (unsigned long)stuff->dotclock);
ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
stuff->hdisplay, stuff->hsyncstart,
stuff->hsyncend, stuff->htotal);
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
stuff->vtotal, stuff->flags);
stuff->vtotal, (unsigned long)stuff->flags);
}
if (ver < 2) {

View file

@ -23,7 +23,7 @@
* dealings in this Software without prior written authorization from the
* XFree86 Project.
*/
/* $XFree86: xc/lib/font/FreeType/module/ftmodule.c,v 1.14 2003/02/13 03:01:45 dawes Exp $ */
/* $XFree86: xc/lib/font/FreeType/module/ftmodule.c,v 1.18 2003/11/02 04:30:57 dawes Exp $ */
#include "misc.h"
@ -40,11 +40,11 @@ static MODULESETUPPROTO(freetypeSetup);
static XF86ModuleVersionInfo VersRec =
{
"freetype",
MODULEVENDORSTRING,
MODULEVENDORSTRING " & the After X-TT Project",
MODINFOSTRING1,
MODINFOSTRING2,
XF86_VERSION_CURRENT,
2, 0, 2,
2, 1, 0,
ABI_CLASS_FONT, /* Font module */
ABI_FONT_VERSION,
MOD_CLASS_FONT,

View file

@ -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/GL/glxmodule.c,v 1.11 2001/06/15 21:22:38 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/GL/glxmodule.c,v 1.12 2003/09/28 20:15:40 alanh Exp $ */
/*
* Authors:
@ -104,6 +104,7 @@ static const char *glcoreSymbols[] = {
"__glLightiv_size",
"__glMaterialfv_size",
"__glMaterialiv_size",
"__glPointParameterfvARB_size",
"__glReadPixels_size",
"__glTexEnvfv_size",
"__glTexEnviv_size",
@ -146,6 +147,7 @@ static const char *glcoreSymbols[] = {
"__glXDestroyContext",
"__glXDestroyGLXPixmap",
"__glXDispSwap_Accum",
"__glXDispSwap_ActiveStencilFaceEXT",
"__glXDispSwap_ActiveTextureARB",
"__glXDispSwap_AlphaFunc",
"__glXDispSwap_AreTexturesResident",
@ -357,6 +359,8 @@ static const char *glcoreSymbols[] = {
"__glXDispSwap_PixelTransferf",
"__glXDispSwap_PixelTransferi",
"__glXDispSwap_PixelZoom",
"__glXDispSwap_PointParameterfARB",
"__glXDispSwap_PointParameterfvARB",
"__glXDispSwap_PointSize",
"__glXDispSwap_PolygonMode",
"__glXDispSwap_PolygonOffset",
@ -451,7 +455,9 @@ static const char *glcoreSymbols[] = {
"__glXDispSwap_Vertex4iv",
"__glXDispSwap_Vertex4sv",
"__glXDispSwap_Viewport",
"__glXDispSwap_WindowPos3fARB",
"__glXDisp_Accum",
"__glXDisp_ActiveStencilFaceEXT",
"__glXDisp_ActiveTextureARB",
"__glXDisp_AlphaFunc",
"__glXDisp_AreTexturesResident",
@ -663,6 +669,8 @@ static const char *glcoreSymbols[] = {
"__glXDisp_PixelTransferf",
"__glXDisp_PixelTransferi",
"__glXDisp_PixelZoom",
"__glXDisp_PointParameterfARB",
"__glXDisp_PointParameterfvARB",
"__glXDisp_PointSize",
"__glXDisp_PolygonMode",
"__glXDisp_PolygonOffset",
@ -757,6 +765,7 @@ static const char *glcoreSymbols[] = {
"__glXDisp_Vertex4iv",
"__glXDisp_Vertex4sv",
"__glXDisp_Viewport",
"__glXDisp_WindowPos3fARB",
"__glXDrawArraysSize",
"__glXDrawPixelsReqSize",
"__glXDrawableRes",
@ -886,6 +895,7 @@ static const char *glcoreSymbols[] = {
"__glXWaitX",
"__glXcombine_strings",
"glAccum",
"glActiveStencilFaceEXT",
"glActiveTextureARB",
"glAlphaFunc",
"glAreTexturesResident",
@ -1102,6 +1112,8 @@ static const char *glcoreSymbols[] = {
"glPixelTransferf",
"glPixelTransferi",
"glPixelZoom",
"glPointParameterfARB",
"glPointParameterfvARB",
"glPointSize",
"glPolygonMode",
"glPolygonOffset",
@ -1198,6 +1210,7 @@ static const char *glcoreSymbols[] = {
"glVertex4sv",
"glVertexPointer",
"glViewport",
"glWindowPos3fARB",
"glxSwapQueryExtensionsStringReply",
"glxSwapQueryServerStringReply",
NULL

View file

@ -1251,7 +1251,7 @@ demo programs is available from http://dri.sourceforge.net/res.phtml
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.29 2003/02/17 03:57:29 dawes Exp $
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRI.sgml,v 1.29 dawes Exp $
$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.21 2003/02/17 04:04:07 dawes Exp $
$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRI,v 1.22 2003/07/15 02:28:28 dawes Exp $

View file

@ -2,7 +2,7 @@
Juliusz Chroboczek, <jch@xfree86.org>
17 January 2003
17 November 2003
1. Introduction
@ -16,8 +16,8 @@ this document for background information.
1.1 Two font systems
XFree86 includes two font systems: the core X11 fonts system, which is pre-
sent in all implementations of X11, and the Xft fonts system, which is not
XFree86 includes two font systems: the core X11 fonts system, which is
present in all implementations of X11, and the Xft fonts system, which is not
currently distributed with implementations of X11 that are not based on
XFree86 but will hopefully be included by them in the future
@ -596,7 +596,7 @@ Please note: the X-TrueType (X-TT) backend does not use the fontenc layer,
but instead uses its own method for font reencoding. If you are only inter-
ested in X-TT you may want to skip to Using Symbol Fonts (section 4.1.5, page
1), as the intervening information does not apply to X-TT. X-TT itself is
described in more detail in X-TrueType (section 4.2.3, page 1).
described in more detail in X-TrueType (section 4.2.2, page 1).
In the fontenc layer, an encoding is defined by a name (such as iso8859-1),
possibly a number of aliases (alternate names), and an ordered collection of
@ -926,75 +926,111 @@ more precisely described in the mkfontdir(1) manual page.
4.2 Additional notes about scalable core fonts
The FreeType backend (module `freetype', formerly known as xfsft) is able to
deal with both TrueType and Type 1 fonts. This puts it in conflict with the
X-TT and Type 1 backends respectively.
The FreeType (libfreetype-xtt2) backend (module `freetype', formerly known as
xfsft) is able to deal with both TrueType and Type 1 fonts. This puts it in
conflict with the X-TT and Type 1 backends respectively.
If both the FreeType and the Type 1 backends are loaded, the FreeType backend
will be used for Type 1 fonts. If both the FreeType and X-TT backends are
loaded, X-TT will be used for TrueType fonts.
4.2.1 Delayed glyph rasterisation
4.2.1 About the FreeType backend
Both FreeType and X-TT delay glyph rasterisation up to the time at which a
glyph is first used. For this reason, they only provide an approximate value
for the ``average width'' font property.
Both backends also support an optimisation for character-cell fonts (fonts
with all glyph metrics equal, or terminal fonts). A font with an XLFD speci-
fying a character-cell spacing `c', as in
-misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
will not rasterise glyphs at metrics computation time, but instead trust the
font really to be a character-cell font. You are encouraged to make use of
this optimisation when useful, but be warned that not all monospaced fonts
are character-cell fonts.
4.2.2 About the FreeType backend
The FreeType backend (formerly xfsft) is a backend based on version 2 of the
FreeType library (see the FreeType web site <URL:http://www.freetype.org/>)
and has support for the ``fontenc'' style of internationalisation (see The
fontenc layer (section 4.1.1, page 1)). This backend supports TrueType font
files (`*.ttf'), OpenType font files (`*.otf'), TrueType Collections
(`*.ttc'), OpenType Collections (`*.otc') and Type 1 font files (`*.pfa' and
`*.pfb').
The FreeType (libfreetype-xtt2) backend (formerly xfsft) is a backend based
on version 2 of the FreeType library (see the FreeType web site
<URL:http://www.freetype.org/>) and has the X-TT functionalities for CJKV
support provided by the After X-TT Project (see the After X-TT Project web
site <URL:http://x-tt.sourceforge.jp/>). The FreeType module has support for
the ``fontenc'' style of internationalisation (see The fontenc layer (section
4.1.1, page 1)). This backend supports TrueType font files (`*.ttf'), Open-
Type font files (`*.otf'), TrueType Collections (`*.ttc'), OpenType Collec-
tions (`*.otc') and Type 1 font files (`*.pfa' and `*.pfb').
In order to access the faces in a TrueType Collection file, the face number
must be specified in the fonts.dir file before the filename within colons.
For example,
must be specified in the fonts.dir file before the filename, within a pair of
colons, or by setting the 'fn' TTCap option. For example,
:2:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
:1:mincho.ttc -misc-pmincho-medium-r-normal--0-0-0-0-p-0-jisx0208.1990-0
refers to face 2 in the `mincho.ttc' TrueType Collection file.
refers to face 1 in the `mincho.ttc' TrueType Collection file.
The new FreeType backend supports the extended `fonts.dir' syntax introduced
by X-TrueType with a number of options, collectively known as `TTCap'. A
`TTCap' entry follows the general syntax
option=value:
and should be specified before the filename. The new FreeType almost per-
fectly supports TTCap options that are compatible with X-TT 1.4. The Auto-
matic Italic (`ai'), Double Strike (`ds') and Bounding box Width (`bw')
options are indispensable in CJKV. For example,
mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
ds=y:mincho.ttc -misc-mincho-bold-r-normal--0-0-0-0-c-0-jisx0208.1990-0
ai=0.2:mincho.ttc -misc-mincho-medium-i-normal--0-0-0-0-c-0-jisx0208.1990-0
ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0208.1990-0
bw=0.5:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0201.1976-0
bw=0.5:ds=y:mincho.ttc -misc-mincho-bold-r-normal--0-0-0-0-c-0-jisx0201.1976-0
bw=0.5:ai=0.2:mincho.ttc -misc-mincho-medium-i-normal--0-0-0-0-c-0-jisx0201.1976-0
bw=0.5:ds=y:ai=0.2:mincho.ttc -misc-mincho-bold-i-normal--0-0-0-0-c-0-jisx0201.1976-0
setup the complete combination of jisx0208 and jisx0201 using mincho.ttc
only. More information on the TTCap syntax is found on the After X-TT
Project page <URL:http://x-tt.sourceforge.jp/>.
The FreeType backend uses the fontenc layer in order to support recoding of
fonts; this was described in The fontenc layer (section 4.1.1, page 1) and
especially FreeType-specific notes about fontenc (section 4.1.2.1, page 1)
earlier in this document.
4.2.3 About the X-TrueType TrueType backend
4.2.2 About the X-TrueType TrueType backend
The `X-TrueType' backend is a backend based on version 1 of the FreeType
library. X-TrueType doesn't use the `fontenc' layer for managing font encod-
ings, but instead uses its own database of encodings.
ings, but instead uses its own database of encodings. Since the functionali-
ties for CJKV support introduced by X-TT have been merged into the new
FreeType backend, the X-TT backend will be removed from XFree86's tree near
the future. Therefore, the use of FreeType backend is preferred over the X-
TT backend. General information on X-TrueType may be found at ."
X-TrueType extends the `fonts.dir' syntax with a number of options, collec-
tively known as `TTCap'. A `TTCap' entry follows the general syntax
4.2.3 Delayed glyph rasterisation
:option=value:
When loading a large character set, the old FreeType delayed glyph rasterisa-
tion until the time at which the glyph was first used. The new FreeType
(libfreetype-xtt2) has an improved `very lazy' metric calculation method to
speed up the process when loading TrueType or OpenType fonts. Although the
X-TT module also has this method, the "vl=y" TTCap option must be set if you
want to use it. This is the default method for FreeType when it loads multi-
byte fonts. Even if you use a unicode font which has tens of thousands of
glyphs, this delay will not be worrisome as long as you use the new FreeType
backend -- its `very lazy' method is super-fast.
and should be specified before the filename.
The maximum error of bitmap position using `very lazy' method is 1 pixel, and
is the same as that of a character-cell spacing. When the X-TT backend is
used with the `vl=y' option, a chipped bitmap is displayed with certain
fonts. However, the new FreeType backend has minimal problem with this,
since it corrects left- and right-side bearings using `italicAngle' in the
TrueType/OpenType post table, and does automatic correction of bitmap posi-
tions when rasterisation so that chipped bitmaps are not displayed. Never-
theless if you don't want to use the `very lazy' method when using multi-
bytes fonts, set `vl=n' in the TTCap option to disable it:
The most useful TTCap option is used to specify the face number to use with
TTCs; this is the `fn' TTCap option. For example, face 2 of font file `min-
cho.ttc' is specified using:
vl=n:luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso10646-1
:fn=2:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
Of course, both backends also support an optimisation for character-cell
fonts (fonts with all glyph metrics equal, or terminal fonts). A font with
an XLFD specifying a character-cell spacing `c', as in
More information on the TTCap syntax, and on X-TrueType in general, may be
found on the X-TrueType home page <URL:http://x-tt.dsl.gr.jp/>.
-misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
or
fs=c:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-p-0-jisx0208.1990-0
will not compute the metric for each glyph, but instead trust the font to be
a character-cell font. You are encouraged to make use of this optimisation
when useful, but be warned that not all monospaced fonts are character-cell
fonts.
5. Appendix: background and terminology
@ -1126,8 +1162,8 @@ The author's software pages <URL:http://www.pps.jussieu.fr/~jch/software/>
might or might not contain related scribbles and development versions of
software.
The documentation of X-TrueType is available from the X-TrueType home page
<URL:http://x-tt.dsl.gr.jp/>.
The documentation of X-TrueType is available from the After X-TT Project page
<URL:http://x-tt.sourceforge.jp/>.
A number of East-Asian CIDFonts are available from O'Reilly's FTP site
<URL:ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/adobe/>.
@ -1140,7 +1176,7 @@ The IANA RFC documents, available from a number of sites throughout the
world, often provide interesting information about character set issues; see
for example RFC 373.
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml,v 1.20 2003/01/20 03:43:07 dawes Exp $
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/fonts.sgml,v 1.22 dawes Exp $
$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.22 2003/01/20 04:10:01 dawes Exp $
$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.fonts,v 1.26 2003/11/19 01:44:58 dawes Exp $

File diff suppressed because it is too large Load diff

View file

@ -374,6 +374,13 @@ a 2.4.x kernel, you should add the following:
#define MesaUseSSE YES
If you want to build the DRM kernel modules as part of the full build pro-
cess, add the following:
#define BuildXF86DRM YES
Otherwise, you'll need to build them separately as described below.
8.3 Compilation
To compile the complete DRI tree:
@ -401,11 +408,21 @@ work with XFree86/DRI.
Using your text editor, examine world.log for errors by searching for the
pattern ***.
Verify that the DRI kernel module(s) for your system were built:
After fixing the errors, run make World again. Later, you might just compile
parts of the source tree but it's important that the whole tree will build
first.
If you edited your host.def file to enable automatic building of the DRI ker-
nel module(s), verify that they were built:
cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
ls
Otherwise, build them now by running
cd ~/DRI-CVS/build/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel
make -f Makefile.linux
For the 3dfx Voodoo, you should see tdfx.o. For the Matrox G200/G400, you
should see mga.o. For the ATI Rage 128, you should see r128.o. For the ATI
Radeon, you should see radeon.o. For the Intel i810, you should see i810.o.
@ -416,17 +433,14 @@ always supported.
If your build machine is running a different version of the kernel than your
target machine (i.e. 2.2.x vs. 2.4.x), make will select the wrong kernel
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,
source tree. This can be fixed by explicitly setting the value of LINUXDIR.
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.x/include
make -f Makefile.linux LINUXDIR=/usr/src/linux-2.4.x
or alternatively, edit Makefile to include this change.
After fixing the errors, run make World again. Later, you might just compile
parts of the source tree but it's important that the whole tree will build
first.
or alternatively, edit Makefile.linux to set LINUXDIR before the ifndef LIN-
UXDIR line.
8.5 DRI kernel module installation
@ -537,7 +551,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.19 2002/11/26 01:05:50 dawes Exp $
Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DRIcomp.sgml,v 1.20 dawes Exp $
$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.16 2002/11/26 02:24:01 dawes Exp $
$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.DRIcomp,v 3.17 2003/07/15 02:28:28 dawes Exp $

View file

@ -36,7 +36,7 @@
<ident>
$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.52 2003/02/25 19:31:00 dawes Exp $
$XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/DESIGN.sgml,v 1.53 2003/08/23 14:10:14 dawes Exp $
</ident>
@ -6784,11 +6784,13 @@ ZZZPreInit(ScrnInfoPtr pScrn, int flags)
*/
/*
* Set the depth/bpp. Our preferred default depth/bpp is 8, and
* we support both 24bpp and 32bpp framebuffer layouts.
* Set the depth/bpp. Use the globally preferred depth/bpp. If the
* driver has special default depth/bpp requirements, the defaults should
* be specified here explicitly.
* We support both 24bpp and 32bpp framebuffer layouts.
* This sets pScrn->display also.
*/
if (!xf86SetDepthBpp(pScrn, 8, 8, 8,
if (!xf86SetDepthBpp(pScrn, 0, 0, 0,
Support24bppFb | Support32bppFb)) {
return FALSE;
} else {

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.38 2002/11/20 18:10:24 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/GL/dri/dri.c,v 1.39 2003/11/10 18:21:41 tsi Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@ -1557,7 +1557,7 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
if(pDRIPriv->nrWindows > 0) {
RegionRec reg;
REGION_INIT(pScreen, &reg, NullBox, 0);
REGION_NULL(pScreen, &reg);
TraverseTree(pWin, DRITreeTraversal, (pointer)(&reg));
if(REGION_NOTEMPTY(pScreen, &reg)) {

View file

@ -1,40 +1,41 @@
/* $XFree86: xc/programs/Xserver/GL/dri/sarea.h,v 1.11 2002/10/30 12:52:03 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
Copyright 2000 VA Linux Systems, Inc.
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sub license, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice (including the
next paragraph) shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
IN NO EVENT SHALL 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/GL/dri/sarea.h,v 1.12 2003/09/28 20:15:41 alanh Exp $ */
/**
* \file sarea.h
* SAREA definitions.
*
* \author Kevin E. Martin <kevin@precisioninsight.com>
* \author Jens Owen <jens@tungstengraphics.com>
* \author Rickard E. (Rik) Faith <faith@valinux.com>
*/
/*
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
* Jens Owen <jens@tungstengraphics.com>
* Rickard E. (Rik) Faith <faith@valinux.com>
*
* Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
* Copyright 2000 VA Linux Systems, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL 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/GL/dri/sarea.h,v 1.12 2003/09/28 20:15:41 alanh Exp $ */
#ifndef _SAREA_H_
#define _SAREA_H_
@ -54,11 +55,21 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SAREA_DRAWABLE_CLAIMED_ENTRY 0x80000000
/**
* SAREA per drawable information.
*
* \sa _XF86DRISAREA.
*/
typedef struct _XF86DRISAREADrawable {
unsigned int stamp;
unsigned int flags;
} XF86DRISAREADrawableRec, *XF86DRISAREADrawablePtr;
/**
* SAREA frame information.
*
* \sa _XF86DRISAREA.
*/
typedef struct _XF86DRISAREAFrame {
unsigned int x;
unsigned int y;
@ -67,10 +78,13 @@ typedef struct _XF86DRISAREAFrame {
unsigned int fullscreen;
} XF86DRISAREAFrameRec, *XF86DRISAREAFramePtr;
/**
* SAREA definition.
*/
typedef struct _XF86DRISAREA {
/* first thing is always the drm locking structure */
/** first thing is always the DRM locking structure */
drmLock lock;
/* NOT_DONE: Use readers/writer lock for drawable_lock */
/** \todo Use readers/writer lock for drawable_lock */
drmLock drawable_lock;
XF86DRISAREADrawableRec drawableTable[SAREA_MAX_DRAWABLES];
XF86DRISAREAFrameRec frame;

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/GL/dri/xf86dri.c,v 1.12 2002/12/14 01:36:08 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/GL/dri/xf86dri.c,v 1.13 2003/09/24 02:43:12 dawes Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@ -241,7 +241,7 @@ ProcXF86DRIAuthConnection(
rep.authenticated = 1;
if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) {
ErrorF("Failed to authenticate %u\n", stuff->magic);
ErrorF("Failed to authenticate %lu\n", (unsigned long)stuff->magic);
rep.authenticated = 0;
}
WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *)&rep);

View file

@ -1,8 +1,6 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/dummylib.h,v 1.1 2000/02/13 03:06:38 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/dummylib.h,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
#ifndef _DUMMY_LIB_H
#define _DUMMY_LIB_H
extern void VErrorFVerb(int verb, const char *format, va_list ap);
#endif /* _DUMMY_LIB_H */

View file

@ -1,10 +1,9 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsg.c,v 1.1 2000/02/13 03:06:40 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsg.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
#include "X.h"
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "dummylib.h"
/*
* Utility functions required by libxf86_os.
@ -16,7 +15,7 @@ xf86DrvMsg(int i, MessageType type, const char *format, ...)
va_list ap;
va_start(ap, format);
VErrorFVerb(1, format, ap);
LogVWrite(1, format, ap);
va_end(ap);
}

View file

@ -1,10 +1,9 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsgverb.c,v 1.1 2000/02/13 03:06:40 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86drvmsgverb.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
#include "X.h"
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "dummylib.h"
/*
* Utility functions required by libxf86_os.
@ -16,7 +15,7 @@ xf86DrvMsgVerb(int i, MessageType type, int verb, const char *format, ...)
va_list ap;
va_start(ap, format);
VErrorFVerb(verb, format, ap);
LogVWrite(verb, format, ap);
va_end(ap);
}

View file

@ -1,10 +1,9 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorf.c,v 1.2 2000/05/31 07:15:05 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorf.c,v 1.3 2003/09/09 03:20:38 dawes Exp $ */
#include "X.h"
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "dummylib.h"
/*
* Utility functions required by libxf86_os.
@ -16,7 +15,7 @@ xf86ErrorF(const char *format, ...)
va_list ap;
va_start(ap, format);
VErrorFVerb(1, format, ap);
LogVWrite(1, format, ap);
va_end(ap);
}
@ -26,6 +25,6 @@ ErrorF(const char *format, ...)
va_list ap;
va_start(ap, format);
VErrorFVerb(1, format, ap);
LogVWrite(1, format, ap);
va_end(ap);
}

View file

@ -1,10 +1,9 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorfverb.c,v 1.1 2000/02/13 03:06:41 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86errorfverb.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
#include "X.h"
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "dummylib.h"
/*
* Utility functions required by libxf86_os.
@ -16,7 +15,7 @@ xf86ErrorFVerb(int verb, const char *format, ...)
va_list ap;
va_start(ap, format);
VErrorFVerb(verb, format, ap);
LogVWrite(verb, format, ap);
va_end(ap);
}

View file

@ -1,10 +1,9 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msg.c,v 1.1 2000/02/13 03:06:42 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msg.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
#include "X.h"
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "dummylib.h"
/*
* Utility functions required by libxf86_os.
@ -16,7 +15,7 @@ xf86Msg(MessageType type, const char *format, ...)
va_list ap;
va_start(ap, format);
VErrorFVerb(1, format, ap);
LogVWrite(1, format, ap);
va_end(ap);
}

View file

@ -1,10 +1,9 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msgverb.c,v 1.1 2000/02/13 03:06:42 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/dummylib/xf86msgverb.c,v 1.2 2003/09/09 03:20:38 dawes Exp $ */
#include "X.h"
#include "os.h"
#include "xf86.h"
#include "xf86Priv.h"
#include "dummylib.h"
/*
* Utility functions required by libxf86_os.
@ -16,7 +15,7 @@ xf86MsgVerb(MessageType type, int verb, const char *format, ...)
va_list ap;
va_start(ap, format);
VErrorFVerb(verb, format, ap);
LogVWrite(verb, format, ap);
va_end(ap);
}

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.c,v 1.30 2002/11/25 14:05:00 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.c,v 1.33 2003/10/30 17:37:16 tsi Exp $ */
/* all driver need this */
#include "xf86.h"
@ -462,7 +462,7 @@ fbdevHWSetVideoModes(ScrnInfoPtr pScrn)
int virtY = pScrn->display->virtualY;
struct fb_var_screeninfo var;
char **modename;
DisplayModePtr mode,this,last = NULL;
DisplayModePtr mode,this,last = pScrn->modes;
TRACE_ENTER("VerifyModes");
if (NULL == pScrn->display->modes)
@ -542,7 +542,7 @@ fbdevHWUseBuildinMode(ScrnInfoPtr pScrn)
/* -------------------------------------------------------------------- */
void
static void
calculateFbmem_len(fbdevHWPtr fPtr)
{
fPtr->fboff = (unsigned long) fPtr->fix.smem_start & ~PAGE_MASK;
@ -747,7 +747,7 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
/* -------------------------------------------------------------------- */
/* these can be hooked directly into ScrnInfoRec */
int
ModeStatus
fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
@ -789,6 +789,11 @@ fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags)
fbdevHWPtr fPtr = FBDEVHWPTR(pScrn);
TRACE_ENTER("AdjustFrame");
if ( x < 0 || x + fPtr->var.xres > fPtr->var.xres_virtual ||
y < 0 || y + fPtr->var.yres > fPtr->var.yres_virtual )
return;
fPtr->var.xoffset = x;
fPtr->var.yoffset = y;
if (-1 == ioctl(fPtr->fd,FBIOPAN_DISPLAY,(void*)&fPtr->var))

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.h,v 1.11 2001/10/01 13:44:12 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhw.h,v 1.12 2003/10/30 17:37:16 tsi Exp $ */
#ifndef _FBDEVHW_H_
#define _FBDEVHW_H_
@ -40,7 +40,7 @@ void fbdevHWRestore(ScrnInfoPtr pScrn);
void fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
LOCO *colors, VisualPtr pVisual);
int fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags);
ModeStatus fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags);
Bool fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
void fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags);
Bool fbdevHWEnterVT(int scrnIndex, int flags);

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhwstub.c,v 1.12 2001/10/28 03:33:55 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/fbdevhw/fbdevhwstub.c,v 1.13 2003/10/30 17:37:16 tsi Exp $ */
#include "xf86.h"
#include "xf86cmap.h"
@ -130,7 +130,7 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
{
}
int
ModeStatus
fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
{
return MODE_ERROR;

View file

@ -6,7 +6,7 @@
* (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de>
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.c,v 1.13 2002/09/16 18:06:07 eich Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.c,v 1.15 2003/08/29 21:08:06 tsi Exp $ */
#if 1
#include "misc.h"
@ -750,7 +750,7 @@ xf86DestroyI2CBusRec(I2CBusPtr b, Bool unalloc, Bool devs_too)
if (b) {
I2CBusPtr *p;
/* Remove this from the list of active I2C busses. */
/* Remove this from the list of active I2C buses */
for (p = &I2CBusList; *p != NULL; p = &(*p)->NextBus)
if (*p == b) {
@ -794,7 +794,7 @@ xf86DestroyI2CBusRec(I2CBusPtr b, Bool unalloc, Bool devs_too)
Bool
xf86I2CBusInit(I2CBusPtr b)
{
/* I2C busses must be identified by a unique scrnIndex
/* I2C buses must be identified by a unique scrnIndex
* and name. If scrnIndex is unspecified (a negative value),
* then the name must be unique throughout the server.
*/
@ -861,3 +861,32 @@ xf86I2CFindBus(int scrnIndex, char *name)
return NULL;
}
/*
* Return an array of I2CBusPtr's related to a screen. The caller is
* responsible for freeing the array.
*/
int
xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus)
{
I2CBusPtr pI2CBus;
int n = 0;
if (pppI2CBus)
*pppI2CBus = NULL;
for (pI2CBus = I2CBusList; pI2CBus; pI2CBus = pI2CBus->NextBus) {
if ((pI2CBus->scrnIndex >= 0) && (pI2CBus->scrnIndex != scrnIndex))
continue;
n++;
if (!pppI2CBus)
continue;
*pppI2CBus = xnfrealloc(*pppI2CBus, n * sizeof(I2CBusPtr));
*pppI2CBus[n - 1] = pI2CBus;
}
return n;
}

View file

@ -2,11 +2,11 @@
* Copyright (C) 1998 Itai Nahshon, Michael Schimek
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.h,v 1.8 2001/07/19 14:19:40 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/i2c/xf86i2c.h,v 1.11 2003/08/29 21:08:06 tsi Exp $ */
#ifndef _XF86I2C_H
#define _XF86I2C_H
#include "miscstruct.h"
#include "regionstr.h"
typedef unsigned char I2CByte;
typedef unsigned short I2CSlaveAddr;
@ -52,6 +52,8 @@ I2CBusPtr xf86CreateI2CBusRec(void);
void xf86DestroyI2CBusRec(I2CBusPtr pI2CBus, Bool unalloc, Bool devs_too);
Bool xf86I2CBusInit(I2CBusPtr pI2CBus);
I2CBusPtr xf86I2CFindBus(int scrnIndex, char *name);
int xf86I2CGetScreenBuses(int scrnIndex, I2CBusPtr **pppI2CBus);
/* I2C slave devices */

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/generic.c,v 1.25.2.1 2003/03/20 15:14:25 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/generic.c,v 1.29 2003/09/24 02:43:33 dawes Exp $ */
/*
* XFree86 int10 module
* execute BIOS int 10h calls in x86 real mode environment
@ -139,20 +139,22 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
if (bios.bus == BUS_ISA && bios.location.legacy) {
xf86DrvMsg(screen, X_CONFIG,
"Overriding BIOS location: 0x%lx\n",
"Overriding BIOS location: 0x%x\n",
bios.location.legacy);
cs = bios.location.legacy >> 4;
#define CHECK_V_SEGMENT_RANGE(x) \
if ((x << 4) < V_BIOS) {\
if (((x) << 4) < V_BIOS) {\
xf86DrvMsg(screen, X_ERROR, \
"V_BIOS address 0x%x out of range\n",x << 4); \
"V_BIOS address 0x%lx out of range\n", \
(unsigned long)(x) << 4); \
goto error1; \
}
CHECK_V_SEGMENT_RANGE(cs);
vbiosMem = (unsigned char *)sysMem - V_BIOS + (cs << 4);
if (!int10_check_bios(screen, cs, vbiosMem)) {
xf86DrvMsg(screen, X_ERROR,
"No V_BIOS at specified address 0x%x\n",cs << 4);
"No V_BIOS at specified address 0x%lx\n",
(unsigned long)cs << 4);
goto error1;
}
} else {
@ -182,7 +184,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags)
}
}
xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%x\n", cs);
xf86DrvMsg(screen, X_INFO, "Primary V_BIOS segment is: 0x%lx\n",
(unsigned long)cs);
set_return_trap(pInt);
pInt->BIOSseg = cs;

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_exec.c,v 1.24 2002/11/25 21:05:49 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/helper_exec.c,v 1.26 2003/11/06 18:38:12 tsi Exp $ */
/*
* XFree86 int10 module
* execute BIOS int 10h calls in x86 real mode environment
@ -145,7 +145,7 @@ void
dump_code(xf86Int10InfoPtr pInt)
{
int i;
CARD32 lina = SEG_ADR((CARD32), X86_CS, IP);
unsigned long lina = SEG_ADR((CARD32), X86_CS, IP);
xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8lx:\n", lina);
for (i=0; i<0x10; i++)
@ -160,25 +160,28 @@ void
dump_registers(xf86Int10InfoPtr pInt)
{
xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
"EAX=0x%8.8x, EBX=0x%8.8x, ECX=0x%8.8x, EDX=0x%8.8x\n",
X86_EAX, X86_EBX, X86_ECX, X86_EDX);
"EAX=0x%8.8lx, EBX=0x%8.8lx, ECX=0x%8.8lx, EDX=0x%8.8lx\n",
(unsigned long)X86_EAX, (unsigned long)X86_EBX,
(unsigned long)X86_ECX, (unsigned long)X86_EDX);
xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
"ESP=0x%8.8x, EBP=0x%8.8x, ESI=0x%8.8x, EDI=0x%8.8x\n",
X86_ESP, X86_EBP, X86_ESI, X86_EDI);
"ESP=0x%8.8lx, EBP=0x%8.8lx, ESI=0x%8.8lx, EDI=0x%8.8lx\n",
(unsigned long)X86_ESP, (unsigned long)X86_EBP,
(unsigned long)X86_ESI, (unsigned long)X86_EDI);
xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
"CS=0x%4.4x, SS=0x%4.4x,"
" DS=0x%4.4x, ES=0x%4.4x, FS=0x%4.4x, GS=0x%4.4x\n",
X86_CS, X86_SS, X86_DS, X86_ES, X86_FS, X86_GS);
xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
"EIP=0x%8.8x, EFLAGS=0x%8.8x\n", X86_EIP, X86_EFLAGS);
"EIP=0x%8.8lx, EFLAGS=0x%8.8lx\n",
(unsigned long)X86_EIP, (unsigned long)X86_EFLAGS);
}
void
stack_trace(xf86Int10InfoPtr pInt)
{
int i = 0;
CARD32 stack = SEG_ADR((CARD32), X86_SS, SP);
CARD32 tail = (CARD32)((X86_SS << 4) + 0x1000);
unsigned long stack = SEG_ADR((CARD32), X86_SS, SP);
unsigned long tail = (CARD32)((X86_SS << 4) + 0x1000);
if (stack >= tail) return;

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.c,v 1.10.2.1 2003/03/21 22:29:59 tsi Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86int10.c,v 1.11 2003/03/21 22:26:11 tsi Exp $ */
/*
* XFree86 int10 module
* execute BIOS int 10h calls in x86 real mode environment

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aout.h,v 1.7 2002/05/31 18:46:00 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aout.h,v 1.8 2003/10/15 16:29:02 dawes Exp $ */
/*
* Borrowed from NetBSD's exec_aout.h
@ -41,8 +41,8 @@
#include <ctype.h>
/* OS/2 EMX has ntohl in this file */
#ifdef __UNIXOS2__
#include <sys/param.h>
#ifdef __UNIXOS2__
#include <sys/param.h>
#endif
#define __LDPGSZ 4096U
@ -54,44 +54,44 @@
* a.out header
*/
typedef struct AOUT_exec {
unsigned long a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */
unsigned long a_text; /* text segment size */
unsigned long a_data; /* initialized data size */
unsigned long a_bss; /* uninitialized data size */
unsigned long a_syms; /* symbol table size */
unsigned long a_entry; /* entry point */
unsigned long a_trsize; /* text relocation size */
unsigned long a_drsize; /* data relocation size */
unsigned long a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */
unsigned long a_text; /* text segment size */
unsigned long a_data; /* initialized data size */
unsigned long a_bss; /* uninitialized data size */
unsigned long a_syms; /* symbol table size */
unsigned long a_entry; /* entry point */
unsigned long a_trsize; /* text relocation size */
unsigned long a_drsize; /* data relocation size */
} AOUTHDR;
/* a_magic */
#define OMAGIC 0407 /* old impure format */
#define NMAGIC 0410 /* read-only text */
#define ZMAGIC 0413 /* demand load format */
#define QMAGIC 0314 /* "compact" demand load format; deprecated */
#define OMAGIC 0407 /* old impure format */
#define NMAGIC 0410 /* read-only text */
#define ZMAGIC 0413 /* demand load format */
#define QMAGIC 0314 /* "compact" demand load format; deprecated */
/*
* a_mid - keep sorted in numerical order for sanity's sake
* ensure that: 0 < mid < 0x3ff
*/
#define MID_ZERO 0 /* unknown - implementation dependent */
#define MID_SUN010 1 /* sun 68010/68020 binary */
#define MID_SUN020 2 /* sun 68020-only binary */
#define MID_PC386 100 /* 386 PC binary. (so quoth BFD) */
#define MID_HP200 200 /* hp200 (68010) BSD binary */
#define MID_I386 134 /* i386 BSD binary */
#define MID_M68K 135 /* m68k BSD binary with 8K page sizes */
#define MID_M68K4K 136 /* m68k BSD binary with 4K page sizes */
#define MID_NS32532 137 /* ns32532 */
#define MID_SPARC 138 /* sparc */
#define MID_PMAX 139 /* pmax */
#define MID_VAX 140 /* vax */
#define MID_ALPHA 141 /* Alpha BSD binary */
#define MID_MIPS 142 /* big-endian MIPS */
#define MID_ARM6 143 /* ARM6 */
#define MID_HP300 300 /* hp300 (68020+68881) BSD binary */
#define MID_HPUX 0x20C /* hp200/300 HP-UX binary */
#define MID_HPUX800 0x20B /* hp800 HP-UX binary */
#define MID_ZERO 0 /* unknown - implementation dependent */
#define MID_SUN010 1 /* sun 68010/68020 binary */
#define MID_SUN020 2 /* sun 68020-only binary */
#define MID_PC386 100 /* 386 PC binary. (so quoth BFD) */
#define MID_HP200 200 /* hp200 (68010) BSD binary */
#define MID_I386 134 /* i386 BSD binary */
#define MID_M68K 135 /* m68k BSD binary with 8K page sizes */
#define MID_M68K4K 136 /* m68k BSD binary with 4K page sizes */
#define MID_NS32532 137 /* ns32532 */
#define MID_SPARC 138 /* sparc */
#define MID_PMAX 139 /* pmax */
#define MID_VAX 140 /* vax */
#define MID_ALPHA 141 /* Alpha BSD binary */
#define MID_MIPS 142 /* big-endian MIPS */
#define MID_ARM6 143 /* ARM6 */
#define MID_HP300 300 /* hp300 (68020+68881) BSD binary */
#define MID_HPUX 0x20C /* hp200/300 HP-UX binary */
#define MID_HPUX800 0x20B /* hp800 HP-UX binary */
/*
* a_flags
@ -179,19 +179,19 @@ typedef struct AOUT_exec {
#define AOUT_STROFF(ex) \
(AOUT_SYMOFF(ex) + (ex)->a_syms)
/* Relocation format. */
struct relocation_info_i386 {
int r_address; /* offset in text or data segment */
unsigned int r_symbolnum : 24, /* ordinal number of add symbol */
r_pcrel : 1, /* 1 if value should be pc-relative */
r_length : 2, /* log base 2 of value's width */
r_extern : 1, /* 1 if need to add symbol to value */
r_baserel : 1, /* linkage table relative */
r_jmptable : 1, /* relocate to jump table */
r_relative : 1, /* load address relative */
r_copy : 1; /* run time copy */
int r_address; /* offset in text or data segment */
unsigned int r_symbolnum:24, /* ordinal number of add symbol */
r_pcrel:1, /* 1 if value should be pc-relative */
r_length:2, /* log base 2 of value's width */
r_extern:1, /* 1 if need to add symbol to value */
r_baserel:1, /* linkage table relative */
r_jmptable:1, /* relocate to jump table */
r_relative:1, /* load address relative */
r_copy:1; /* run time copy */
};
#define relocation_info relocation_info_i386
/*
@ -200,33 +200,32 @@ struct relocation_info_i386 {
*/
typedef struct AOUT_nlist {
union {
char *n_name; /* symbol name (in memory) */
long n_strx; /* file string table offset (on disk) */
char *n_name; /* symbol name (in memory) */
long n_strx; /* file string table offset (on disk) */
} n_un;
#define AOUT_UNDF 0x00 /* undefined */
#define AOUT_ABS 0x02 /* absolute address */
#define AOUT_TEXT 0x04 /* text segment */
#define AOUT_DATA 0x06 /* data segment */
#define AOUT_BSS 0x08 /* bss segment */
#define AOUT_INDR 0x0a /* alias definition */
#define AOUT_SIZE 0x0c /* pseudo type, defines a symbol's size */
#define AOUT_COMM 0x12 /* common reference */
#define AOUT_FN 0x1e /* file name (AOUT_EXT on) */
#define AOUT_WARN 0x1e /* warning message (AOUT_EXT off) */
#define AOUT_UNDF 0x00 /* undefined */
#define AOUT_ABS 0x02 /* absolute address */
#define AOUT_TEXT 0x04 /* text segment */
#define AOUT_DATA 0x06 /* data segment */
#define AOUT_BSS 0x08 /* bss segment */
#define AOUT_INDR 0x0a /* alias definition */
#define AOUT_SIZE 0x0c /* pseudo type, defines a symbol's size */
#define AOUT_COMM 0x12 /* common reference */
#define AOUT_FN 0x1e /* file name (AOUT_EXT on) */
#define AOUT_WARN 0x1e /* warning message (AOUT_EXT off) */
#define AOUT_EXT 0x01 /* external (global) bit, OR'ed in */
#define AOUT_TYPE 0x1e /* mask for all the type bits */
unsigned char n_type; /* type defines */
#define AOUT_EXT 0x01 /* external (global) bit, OR'ed in */
#define AOUT_TYPE 0x1e /* mask for all the type bits */
unsigned char n_type; /* type defines */
char n_other; /* spare */
#define n_hash n_desc /* used internally by ld(1); XXX */
short n_desc; /* used by stab entries */
unsigned long n_value; /* address/value of the symbol */
char n_other; /* spare */
#define n_hash n_desc /* used internally by ld(1); XXX */
short n_desc; /* used by stab entries */
unsigned long n_value; /* address/value of the symbol */
} AOUT_nlist;
#define AOUT_FORMAT "%08x" /* namelist value format; XXX */
#define AOUT_STAB 0x0e0 /* mask for debugger symbols -- stab(5) */
#define AOUT_FORMAT "%08x" /* namelist value format; XXX */
#define AOUT_STAB 0x0e0 /* mask for debugger symbols -- stab(5) */
#endif

View file

@ -1,4 +1,4 @@
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.c,v 1.17 2001/11/16 16:47:55 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.c,v 1.20 2003/10/15 17:46:00 dawes Exp $ */
/*
*
@ -52,10 +52,13 @@
#include "loader.h"
#include "aoutloader.h"
/*
#define AOUTDEBUG ErrorF
*/
#ifndef LOADERDEBUG
#define LOADERDEBUG 0
#endif
#if LOADERDEBUG
#define AOUTDEBUG ErrorF
#endif
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
@ -67,22 +70,22 @@
*/
typedef struct {
int handle;
int module;
int fd;
loader_funcs *funcs;
AOUTHDR *header;/* file header */
unsigned char *text; /* Start address of the text section */
unsigned int textsize; /* Size of the text section */
unsigned char *data; /* Start address of the data section */
unsigned int datasize; /* Size of the data section */
unsigned char *bss; /* Start address of the bss data */
unsigned int bsssize; /* Size of the bss section */
struct relocation_info *txtrel; /* Start address of the text relocation table */
struct relocation_info *datarel; /* Start address of the data relocation table */
AOUT_nlist *symtab; /* Start address of the symbol table */
unsigned char *strings; /* Start address of the string table */
unsigned long strsize; /* size of string table */
int handle;
int module;
int fd;
loader_funcs *funcs;
AOUTHDR *header; /* file header */
unsigned char *text; /* Start address of the text section */
unsigned int textsize; /* Size of the text section */
unsigned char *data; /* Start address of the data section */
unsigned int datasize; /* Size of the data section */
unsigned char *bss; /* Start address of the bss data */
unsigned int bsssize; /* Size of the bss section */
struct relocation_info *txtrel; /* Start address of the text relocation table */
struct relocation_info *datarel; /* Start address of the data relocation table */
AOUT_nlist *symtab; /* Start address of the symbol table */
unsigned char *strings; /* Start address of the string table */
unsigned long strsize; /* size of string table */
unsigned char *common; /* Start address of the common data */
unsigned long comsize; /* size of common data */
} AOUTModuleRec, *AOUTModulePtr;
@ -121,10 +124,12 @@ static void *AOUTGetSymbolValue(AOUTModulePtr, int);
static AOUTCommonPtr AOUTAddCommon(struct AOUT_nlist *, int);
static LOOKUP *AOUTCreateCommon(AOUTModulePtr);
static LOOKUP *AOUT_GetSymbols(AOUTModulePtr);
static AOUTRelocPtr AOUTDelayRelocation(AOUTModulePtr, int, struct relocation_info_i386 *);
static AOUTRelocPtr AOUTDelayRelocation(AOUTModulePtr, int,
struct relocation_info_i386 *);
static AOUTRelocPtr AOUTCollectRelocations(AOUTModulePtr);
static void AOUT_Relocate(unsigned long *, unsigned long, int);
static AOUTRelocPtr AOUT_RelocateEntry(AOUTModulePtr, int, struct relocation_info_i386 *);
static AOUTRelocPtr AOUT_RelocateEntry(AOUTModulePtr, int,
struct relocation_info_i386 *);
/*
* Return 1 if the symbol in item belongs to aoutfile
@ -133,6 +138,7 @@ static int
AOUTHashCleanOut(void *voidptr, itemPtr item)
{
AOUTModulePtr aoutfile = (AOUTModulePtr) voidptr;
return (aoutfile->handle == item->handle);
}
@ -140,8 +146,8 @@ AOUTHashCleanOut(void *voidptr, itemPtr item)
* Manage listResolv
*/
static AOUTRelocPtr
AOUTDelayRelocation(AOUTModulePtr aoutfile, int type,
struct relocation_info *rel)
AOUTDelayRelocation(AOUTModulePtr aoutfile, int type,
struct relocation_info *rel)
{
AOUTRelocPtr reloc;
@ -158,8 +164,6 @@ AOUTDelayRelocation(AOUTModulePtr aoutfile, int type,
reloc->next = 0;
return reloc;
}
/*
* Manage listCOMMON
@ -170,8 +174,8 @@ AOUTAddCommon(struct AOUT_nlist *sym, int index)
{
AOUTCommonPtr common;
if ((common = xf86loadermalloc(sizeof (AOUTCommonRec))) == NULL) {
ErrorF( "AOUTAddCommon() Unable to allocate memory\n" );
if ((common = xf86loadermalloc(sizeof(AOUTCommonRec))) == NULL) {
ErrorF("AOUTAddCommon() Unable to allocate memory\n");
return 0;
}
common->sym = sym;
@ -183,8 +187,8 @@ AOUTAddCommon(struct AOUT_nlist *sym, int index)
static LOOKUP *
AOUTCreateCommon(AOUTModulePtr aoutfile)
{
int numsyms = 0, size = 0, l = 0;
int offset = 0;
int numsyms = 0, size = 0, l = 0;
int offset = 0;
AOUTCommonPtr common;
LOOKUP *lookup;
@ -194,46 +198,47 @@ AOUTCreateCommon(AOUTModulePtr aoutfile)
common = listCOMMON;
for (common = listCOMMON; common; common = common->next) {
/* Ensure long word alignment */
if( (common->sym->n_value & (sizeof(long)-1)) != 0 )
common->sym->n_value = (common->sym->n_value + (sizeof(long)-1))
& ~(sizeof(long)-1);
if ((common->sym->n_value & (sizeof(long) - 1)) != 0)
common->sym->n_value = (common->sym->n_value + (sizeof(long) - 1))
& ~(sizeof(long) - 1);
/* accumulate the sizes */
size += common->sym->n_value;
numsyms++;
} /* while */
} /* while */
#ifdef AOUTDEBUG
AOUTDEBUG("AOUTCreateCommon() %d entries (%d bytes) of COMMON data\n",
numsyms, size );
numsyms, size);
#endif
if ((lookup = xf86loadermalloc((numsyms+1)*sizeof(LOOKUP))) == NULL) {
ErrorF( "AOUTCreateCommon() Unable to allocate memory\n" );
return NULL;
if ((lookup = xf86loadermalloc((numsyms + 1) * sizeof(LOOKUP))) == NULL) {
ErrorF("AOUTCreateCommon() Unable to allocate memory\n");
return NULL;
}
aoutfile->comsize = size;
if ((aoutfile->common = xf86loadercalloc(1,size)) == NULL) {
ErrorF( "AOUTCreateCommon() Unable to allocate memory\n" );
return NULL;
if ((aoutfile->common = xf86loadercalloc(1, size)) == NULL) {
ErrorF("AOUTCreateCommon() Unable to allocate memory\n");
return NULL;
}
while (listCOMMON) {
common = listCOMMON;
lookup[l].symName= AOUTGetSymbolName(aoutfile, common->sym);
lookup[l].offset = (funcptr)(aoutfile->common+offset);
common = listCOMMON;
lookup[l].symName = AOUTGetSymbolName(aoutfile, common->sym);
lookup[l].offset = (funcptr) (aoutfile->common + offset);
#ifdef AOUTDEBUG
AOUTDEBUG("Adding %x %s\n", lookup[l].offset, lookup[l].symName );
AOUTDEBUG("Adding %p %s\n", (void *)lookup[l].offset,
lookup[l].symName);
#endif
listCOMMON = common->next;
offset += common->sym->n_value;
xf86loaderfree(common);
l++;
} /* while */
listCOMMON = common->next;
offset += common->sym->n_value;
xf86loaderfree(common);
l++;
} /* while */
/* listCOMMON == NULL */
lookup[l].symName=NULL; /* Terminate the list */
lookup[l].symName = NULL; /* Terminate the list */
return lookup;
}
@ -244,7 +249,7 @@ AOUTCreateCommon(AOUTModulePtr aoutfile)
static char *
AOUTGetString(AOUTModulePtr aoutfile, int index)
{
char *symname = (char *) &(aoutfile->strings[index]);
char *symname = (char *)&(aoutfile->strings[index]);
if (symname[0] == '_') {
symname++;
@ -252,20 +257,21 @@ AOUTGetString(AOUTModulePtr aoutfile, int index)
return symname;
}
/*
* Return the name of a symbol
*/
static char *
AOUTGetSymbolName(AOUTModulePtr aoutfile, struct AOUT_nlist *sym)
{
char *symname = AOUTGetString(aoutfile,sym->n_un.n_strx);
char *symname = AOUTGetString(aoutfile, sym->n_un.n_strx);
char *name;
name=xf86loadermalloc(strlen(symname)+1);
name = xf86loadermalloc(strlen(symname) + 1);
if (!name)
FatalError("AOUTGetSymbolName: Out of memory\n");
strcpy(name,symname);
strcpy(name, symname);
return name;
}
@ -276,13 +282,13 @@ AOUTGetSymbolName(AOUTModulePtr aoutfile, struct AOUT_nlist *sym)
static void *
AOUTGetSymbolValue(AOUTModulePtr aoutfile, int index)
{
void *symval = NULL; /* value of the indicated symbol */
itemPtr symbol = NULL; /* name/value of symbol */
void *symval = NULL; /* value of the indicated symbol */
itemPtr symbol = NULL; /* name/value of symbol */
char *name = NULL;
name = AOUTGetSymbolName(aoutfile, aoutfile->symtab + index);
if( name )
if (name)
symbol = LoaderHashFind(name);
if (symbol)
@ -292,7 +298,6 @@ AOUTGetSymbolValue(AOUTModulePtr aoutfile, int index)
return symval;
}
/*
* Perform the actual relocation
*/
@ -300,28 +305,27 @@ static void
AOUT_Relocate(unsigned long *destl, unsigned long val, int pcrel)
{
#ifdef AOUTDEBUG
AOUTDEBUG("AOUT_Relocate %p : %08x %s",
destl, *destl, pcrel == 1 ? "rel" : "abs");
AOUTDEBUG("AOUT_Relocate %p : %08lx %s",
(void *)destl, *destl, pcrel == 1 ? "rel" : "abs");
#endif
if (pcrel) {
/* relative to PC */
*destl = val - ((unsigned long)destl + sizeof(long));
*destl = val - ((unsigned long)destl + sizeof(long));
} else {
*destl += val;
}
#ifdef AOUTDEBUG
AOUTDEBUG(" -> %08x\n", *destl);
AOUTDEBUG(" -> %08lx\n", *destl);
#endif
}
/*
* Fix the relocation for text or data section
*/
static AOUTRelocPtr
AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type,
struct relocation_info *rel)
struct relocation_info *rel)
{
AOUTHDR *header = aoutfile->header;
AOUT_nlist *symtab = aoutfile->symtab;
@ -330,22 +334,23 @@ AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type,
unsigned long *destl; /* address of the location to be modified */
symnum = rel->r_symbolnum;
#ifdef AOUTDEBUG
#ifdef AOUTDEBUG
{
char *name;
if (rel->r_extern) {
AOUTDEBUG("AOUT_RelocateEntry: extern %s\n",
name=AOUTGetSymbolName(aoutfile, symtab+symnum));
xf86loaderfree(name);
} else {
AOUTDEBUG("AOUT_RelocateEntry: intern\n");
}
AOUTDEBUG(" pcrel: %d", rel->r_pcrel);
AOUTDEBUG(" length: %d", rel->r_length);
AOUTDEBUG(" baserel: %d", rel->r_baserel);
AOUTDEBUG(" jmptable: %d", rel->r_jmptable);
AOUTDEBUG(" relative: %d", rel->r_relative);
AOUTDEBUG(" copy: %d\n", rel->r_copy);
char *name;
if (rel->r_extern) {
AOUTDEBUG("AOUT_RelocateEntry: extern %s\n",
name = AOUTGetSymbolName(aoutfile, symtab + symnum));
xf86loaderfree(name);
} else {
AOUTDEBUG("AOUT_RelocateEntry: intern\n");
}
AOUTDEBUG(" pcrel: %d", rel->r_pcrel);
AOUTDEBUG(" length: %d", rel->r_length);
AOUTDEBUG(" baserel: %d", rel->r_baserel);
AOUTDEBUG(" jmptable: %d", rel->r_jmptable);
AOUTDEBUG(" relative: %d", rel->r_relative);
AOUTDEBUG(" copy: %d\n", rel->r_copy);
}
#endif /* AOUTDEBUG */
@ -356,15 +361,15 @@ AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type,
* First find the address to modify
*/
switch (type) {
case AOUT_TEXT:
case AOUT_TEXT:
/* Check that the relocation offset is in the text segment */
if (rel->r_address > header->a_text) {
ErrorF("AOUT_RelocateEntry(): "
"text relocation out of text section\n");
}
}
destl = (unsigned long *)(aoutfile->text + rel->r_address);
break;
case AOUT_DATA:
case AOUT_DATA:
/* Check that the relocation offset is in the data segment */
if (rel->r_address > header->a_data) {
ErrorF("AOUT_RelocateEntry():"
@ -372,10 +377,10 @@ AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type,
}
destl = (unsigned long *)(aoutfile->data + rel->r_address);
break;
default:
default:
ErrorF("AOUT_RelocateEntry(): unknown section type %d\n", type);
return 0;
} /* switch */
} /* switch */
/*
* Now handle the relocation
@ -385,70 +390,70 @@ AOUT_RelocateEntry(AOUTModulePtr aoutfile, int type,
symval = AOUTGetSymbolValue(aoutfile, symnum);
if (symval != 0) {
/* we've got the value */
AOUT_Relocate(destl, (unsigned long) symval, rel->r_pcrel);
AOUT_Relocate(destl, (unsigned long)symval, rel->r_pcrel);
return 0;
} else {
/* The symbol should be undefined */
switch (symtab[symnum].n_type & AOUT_TYPE) {
case AOUT_UNDF:
case AOUT_UNDF:
#ifdef AOUTDEBUG
AOUTDEBUG(" extern AOUT_UNDEF\n");
#endif
/* Add this relocation back to the global list */
return AOUTDelayRelocation(aoutfile,type,rel);
return AOUTDelayRelocation(aoutfile, type, rel);
default:
default:
ErrorF("AOUT_RelocateEntry():"
" impossible intern relocation type: %d\n",
" impossible intern relocation type: %d\n",
symtab[symnum].n_type);
return 0;
} /* switch */
} /* switch */
}
} else {
/* intern */
switch (rel->r_symbolnum) {
case AOUT_TEXT:
case AOUT_TEXT:
#ifdef AOUTDEBUG
AOUTDEBUG(" AOUT_TEXT\n");
#endif
/* Only absolute intern text relocations need to be handled */
if (rel->r_pcrel == 0)
AOUT_Relocate(destl, (unsigned long)aoutfile->text,
if (rel->r_pcrel == 0)
AOUT_Relocate(destl, (unsigned long)aoutfile->text,
rel->r_pcrel);
return 0;
case AOUT_DATA:
case AOUT_DATA:
#ifdef AOUTDEBUG
AOUTDEBUG(" AOUT_DATA\n");
#endif
if (rel->r_pcrel == 0)
if (rel->r_pcrel == 0)
AOUT_Relocate(destl, (unsigned long)aoutfile->data
- header->a_text, rel->r_pcrel);
else
ErrorF("AOUT_RelocateEntry(): "
"don't know how to handle data pc-relative reloc\n");
return 0;
case AOUT_BSS:
case AOUT_BSS:
#ifdef AOUTDEBUG
AOUTDEBUG(" AOUT_BSS\n");
#endif
if (rel->r_pcrel == 0)
AOUT_Relocate(destl, (unsigned long)aoutfile->bss
- header->a_text - header->a_data,
- header->a_text - header->a_data,
rel->r_pcrel);
else
ErrorF("AOUT_RelocateEntry(): "
"don't know how to handle bss pc-relative reloc\n");
return 0;
default:
default:
ErrorF("AOUT_RelocateEntry():"
" unknown intern relocation type: %d\n", rel->r_symbolnum);
return 0;
} /* switch */
} /* switch */
}
} /* AOUT_RelocateEntry */
} /* AOUT_RelocateEntry */
static AOUTRelocPtr
AOUTCollectRelocations(AOUTModulePtr aoutfile)
{
@ -460,7 +465,7 @@ AOUTCollectRelocations(AOUTModulePtr aoutfile)
/* Text relocations */
if (aoutfile->text != NULL && aoutfile->txtrel != NULL) {
nreloc = header->a_trsize/sizeof(struct relocation_info);
nreloc = header->a_trsize / sizeof(struct relocation_info);
for (i = 0; i < nreloc; i++) {
rel = aoutfile->txtrel + i;
@ -469,28 +474,28 @@ AOUTCollectRelocations(AOUTModulePtr aoutfile)
tmp->next = reloc_head;
reloc_head = tmp;
}
} /* for */
} /* for */
}
/* Data relocations */
if (aoutfile->data != NULL && aoutfile->datarel != NULL) {
nreloc = header->a_drsize/sizeof(struct relocation_info);
nreloc = header->a_drsize / sizeof(struct relocation_info);
for (i = 0; i < nreloc; i++) {
rel = aoutfile->datarel + i;
tmp = AOUTDelayRelocation(aoutfile, AOUT_DATA, rel);
tmp->next = reloc_head;
reloc_head = tmp;
} /* for */
} /* for */
}
return reloc_head;
} /* AOUTCollectRelocations */
} /* AOUTCollectRelocations */
/*
* AOUT_GetSymbols()
*
* add the symbols to the loader's symbol table
*/
static LOOKUP *
static LOOKUP *
AOUT_GetSymbols(AOUTModulePtr aoutfile)
{
int fd = aoutfile->fd;
@ -501,11 +506,11 @@ AOUT_GetSymbols(AOUTModulePtr aoutfile)
LOOKUP *lookup, *lookup_common;
AOUTCommonPtr tmp;
aoutfile->symtab = (AOUT_nlist *)_LoaderFileToMem(fd,
AOUT_SYMOFF(header),
header->a_syms,
"symbols");
nsyms = header->a_syms/sizeof(AOUT_nlist);
aoutfile->symtab = (AOUT_nlist *) _LoaderFileToMem(fd,
AOUT_SYMOFF(header),
header->a_syms,
"symbols");
nsyms = header->a_syms / sizeof(AOUT_nlist);
lookup = xf86loadermalloc(nsyms * sizeof(LOOKUP));
if (lookup == NULL) {
ErrorF("AOUT_GetSymbols(): can't allocate memory\n");
@ -513,17 +518,16 @@ AOUT_GetSymbols(AOUTModulePtr aoutfile)
}
for (i = 0, l = 0; i < nsyms; i++) {
s = aoutfile->symtab + i;
soff=s->n_un.n_strx;
if (soff == 0 || (s->n_type & AOUT_STAB) != 0)
soff = s->n_un.n_strx;
if (soff == 0 || (s->n_type & AOUT_STAB) != 0)
continue;
symname=AOUTGetSymbolName(aoutfile,s);
symname = AOUTGetSymbolName(aoutfile, s);
#ifdef AOUTDEBUG
AOUTDEBUG("AOUT_GetSymbols(): %s %02x %02x %08x\n",
symname, s->n_type,
s->n_other, s->n_value);
AOUTDEBUG("AOUT_GetSymbols(): %s %02x %02x %08lx\n",
symname, s->n_type, s->n_other, s->n_value);
#endif
switch (s->n_type & AOUT_TYPE) {
case AOUT_UNDF:
case AOUT_UNDF:
if (s->n_value != 0) {
if (!LoaderHashFind(symname)) {
#ifdef AOUTDEBUG
@ -542,51 +546,54 @@ AOUT_GetSymbols(AOUTModulePtr aoutfile)
}
xf86loaderfree(symname);
break;
case AOUT_TEXT:
case AOUT_TEXT:
if (s->n_type & AOUT_EXT) {
lookup[l].symName = symname;
/* text symbols start at 0 */
lookup[l].offset = (funcptr)(aoutfile->text + s->n_value);
lookup[l].offset = (funcptr) (aoutfile->text + s->n_value);
#ifdef AOUTDEBUG
AOUTDEBUG("Adding text %s %08x\n", symname, lookup[l].offset);
AOUTDEBUG("Adding text %s %p\n", symname,
(void *)lookup[l].offset);
#endif
l++;
} else {
xf86loaderfree(symname);
}
break;
case AOUT_DATA :
case AOUT_DATA:
if (s->n_type & AOUT_EXT) {
lookup[l].symName = symname;
/* data symbols are following text */
lookup[l].offset = (funcptr)(aoutfile->data +
s->n_value - header->a_text);
lookup[l].offset = (funcptr) (aoutfile->data +
s->n_value - header->a_text);
#ifdef AOUTDEBUG
AOUTDEBUG("Adding data %s %08x\n", symname, lookup[l].offset);
AOUTDEBUG("Adding data %s %p\n", symname,
(void *)lookup[l].offset);
#endif
l++;
} else {
xf86loaderfree(symname);
}
break;
case AOUT_BSS:
case AOUT_BSS:
if (s->n_type & AOUT_EXT) {
lookup[l].symName = symname;
/* bss symbols follow both text and data */
lookup[l].offset = (funcptr)(aoutfile->bss + s->n_value
- (header->a_data
+ header->a_text));
lookup[l].offset = (funcptr) (aoutfile->bss + s->n_value
- (header->a_data
+ header->a_text));
#ifdef AOUTDEBUG
AOUTDEBUG("Adding bss %s %08x\n", symname, lookup[l].offset);
AOUTDEBUG("Adding bss %s %p\n", symname,
(void *)lookup[l].offset);
#endif
l++;
} else {
xf86loaderfree(symname);
}
break;
case AOUT_FN:
case AOUT_FN:
#ifdef AOUTDEBUG
if (n->n_type& AOUT_EXT) {
if (s->n_type & AOUT_EXT) {
AOUTDEBUG("Ignoring AOUT_FN %s\n", symname);
} else {
AOUTDEBUG("Ignoring AOUT_WARN %s\n", symname);
@ -594,68 +601,66 @@ AOUT_GetSymbols(AOUTModulePtr aoutfile)
#endif
xf86loaderfree(symname);
break;
default:
ErrorF("Unknown symbol type %x\n", s->n_type & AOUT_TYPE);
xf86loaderfree(symname);
} /* switch */
} /* for */
default:
ErrorF("Unknown symbol type %x\n", s->n_type & AOUT_TYPE);
xf86loaderfree(symname);
} /* switch */
} /* for */
lookup[l].symName = NULL;
lookup_common = AOUTCreateCommon(aoutfile);
if (lookup_common) {
LOOKUP *p;
for (i = 0, p = lookup_common; p->symName; i++, p++)
;
memcpy(&(lookup[l]), lookup_common, i * sizeof (LOOKUP));
for (i = 0, p = lookup_common; p->symName; i++, p++) ;
memcpy(&(lookup[l]), lookup_common, i * sizeof(LOOKUP));
xf86loaderfree(lookup_common);
l += i;
lookup[l].symName = NULL;
}
return lookup;
} /* AOUT_GetSymbols */
} /* AOUT_GetSymbols */
/*
* Public API for the a.out implementation of the loader
*/
void *
AOUTLoadModule(loaderPtr modrec,
int aoutfd,
LOOKUP **ppLookup)
AOUTLoadModule(loaderPtr modrec, int aoutfd, LOOKUP ** ppLookup)
{
AOUTModulePtr aoutfile = NULL;
AOUTHDR *header;
AOUTRelocPtr reloc, tail;
void *v;
void *v;
#ifdef AOUTDEBUG
AOUTDEBUG("AOUTLoadModule(%s, %d, %d)\n",
modrec->name, modrec->handle, aoutfd);
#endif
if ((aoutfile=xf86loadercalloc(1,sizeof(AOUTModuleRec))) == NULL ) {
ErrorF( "Unable to allocate AOUTModuleRec\n" );
if ((aoutfile = xf86loadercalloc(1, sizeof(AOUTModuleRec))) == NULL) {
ErrorF("Unable to allocate AOUTModuleRec\n");
return NULL;
}
aoutfile->handle=modrec->handle;
aoutfile->module=modrec->module;
aoutfile->fd=aoutfd;
v=aoutfile->funcs=modrec->funcs;
aoutfile->handle = modrec->handle;
aoutfile->module = modrec->module;
aoutfile->fd = aoutfd;
v = aoutfile->funcs = modrec->funcs;
/*
* Get the a.out header
*/
aoutfile->header=(AOUTHDR *)_LoaderFileToMem(aoutfd,0,sizeof(AOUTHDR),
"header");
header= (AOUTHDR *)aoutfile->header;
aoutfile->header =
(AOUTHDR *) _LoaderFileToMem(aoutfd, 0, sizeof(AOUTHDR),
"header");
header = (AOUTHDR *) aoutfile->header;
/*
* Load the 6 other sections
*/
/* text */
if (header->a_text != 0) {
aoutfile->text = _LoaderFileToMem(aoutfile->fd,
aoutfile->text = _LoaderFileToMem(aoutfile->fd,
AOUT_TXTOFF(header),
header->a_text, "text");
aoutfile->textsize = header->a_text;
@ -689,13 +694,13 @@ AOUTLoadModule(loaderPtr modrec,
/* Data Relocations */
if (header->a_drsize != 0) {
aoutfile->datarel = _LoaderFileToMem(aoutfile->fd,
AOUT_DRELOFF(header),
header->a_drsize, "datarel");
AOUT_DRELOFF(header),
header->a_drsize, "datarel");
} else {
aoutfile->datarel = NULL;
}
/* String table */
_LoaderFileRead(aoutfile->fd, AOUT_STROFF(header),
_LoaderFileRead(aoutfile->fd, AOUT_STROFF(header),
&(aoutfile->strsize), sizeof(int));
if (aoutfile->strsize != 0) {
aoutfile->strings = _LoaderFileToMem(aoutfile->fd,
@ -711,8 +716,7 @@ AOUTLoadModule(loaderPtr modrec,
reloc = AOUTCollectRelocations(aoutfile);
if (reloc) {
for (tail = reloc; tail->next; tail = tail->next)
;
for (tail = reloc; tail->next; tail = tail->next) ;
tail->next = _LoaderGetRelocations(v)->aout_reloc;
_LoaderGetRelocations(v)->aout_reloc = reloc;
}
@ -721,8 +725,7 @@ AOUTLoadModule(loaderPtr modrec,
}
void
AOUTResolveSymbols(mod)
void *mod;
AOUTResolveSymbols(void *mod)
{
AOUTRelocPtr newlist, p, tmp;
@ -731,7 +734,7 @@ void *mod;
#endif
newlist = 0;
for (p = _LoaderGetRelocations(mod)->aout_reloc; p; ) {
for (p = _LoaderGetRelocations(mod)->aout_reloc; p;) {
tmp = AOUT_RelocateEntry(p->file, p->type, p->rel);
if (tmp) {
/* Failed to relocate. Keep it in the list. */
@ -743,11 +746,10 @@ void *mod;
xf86loaderfree(tmp);
}
_LoaderGetRelocations(mod)->aout_reloc = newlist;
} /* AOUTResolveSymbols */
} /* AOUTResolveSymbols */
int
AOUTCheckForUnresolved(mod)
void *mod;
AOUTCheckForUnresolved(void *mod)
{
int symnum;
AOUTRelocPtr crel;
@ -763,18 +765,20 @@ void *mod;
while (crel) {
if (crel->type == AOUT_TEXT) {
/* Attempt to make unresolved text references
point to a default function */
AOUT_Relocate((unsigned long *)(crel->file->text
+ crel->rel->r_address) ,
(unsigned long)LoaderDefaultFunc,
* point to a default function */
AOUT_Relocate((unsigned long *)(crel->file->text
+ crel->rel->r_address),
(unsigned long)LoaderDefaultFunc,
crel->rel->r_pcrel);
}
symnum = crel->rel->r_symbolnum;
name=AOUTGetSymbolName(crel->file, crel->file->symtab + symnum);
flag = _LoaderHandleUnresolved(name,
_LoaderHandleToName(crel->file->handle));
name = AOUTGetSymbolName(crel->file, crel->file->symtab + symnum);
flag = _LoaderHandleUnresolved(name,
_LoaderHandleToName(crel->file->
handle));
xf86loaderfree(name);
if (flag) fatalsym = 1;
if (flag)
fatalsym = 1;
crel = crel->next;
}
return fatalsym;
@ -783,8 +787,9 @@ void *mod;
void
AOUTUnloadModule(void *modptr)
{
AOUTModulePtr aoutfile = (AOUTModulePtr)modptr;
AOUTModulePtr aoutfile = (AOUTModulePtr) modptr;
AOUTRelocPtr relptr, *prevptr;
#ifdef AOUTDEBUG
AOUTDEBUG("AOUTUnLoadModule(0x%p)\n", modptr);
#endif
@ -793,8 +798,8 @@ AOUTUnloadModule(void *modptr)
* Delete any unresolved relocations
*/
relptr=_LoaderGetRelocations(aoutfile->funcs)->aout_reloc;
prevptr=&(_LoaderGetRelocations(aoutfile->funcs)->aout_reloc);
relptr = _LoaderGetRelocations(aoutfile->funcs)->aout_reloc;
prevptr = &(_LoaderGetRelocations(aoutfile->funcs)->aout_reloc);
while (relptr) {
if (relptr->file == aoutfile) {
@ -805,19 +810,19 @@ AOUTUnloadModule(void *modptr)
prevptr = &(relptr->next);
relptr = relptr->next;
}
} /* while */
} /* while */
/* clean the symbols table */
LoaderHashTraverse((void *)aoutfile, AOUTHashCleanOut);
#define CheckandFree(ptr,size) if(ptr) _LoaderFreeFileMem((ptr),(size))
CheckandFree(aoutfile->strings,aoutfile->strsize);
CheckandFree(aoutfile->symtab,aoutfile->header->a_syms);
CheckandFree(aoutfile->datarel,aoutfile->header->a_drsize);
CheckandFree(aoutfile->txtrel,aoutfile->header->a_trsize);
CheckandFree(aoutfile->data,aoutfile->header->a_data);
CheckandFree(aoutfile->text,aoutfile->header->a_text);
CheckandFree(aoutfile->strings, aoutfile->strsize);
CheckandFree(aoutfile->symtab, aoutfile->header->a_syms);
CheckandFree(aoutfile->datarel, aoutfile->header->a_drsize);
CheckandFree(aoutfile->txtrel, aoutfile->header->a_trsize);
CheckandFree(aoutfile->data, aoutfile->header->a_data);
CheckandFree(aoutfile->text, aoutfile->header->a_text);
/* Free allocated sections */
if (aoutfile->bss != NULL) {
xf86loaderfree(aoutfile->bss);
@ -838,21 +843,20 @@ AOUTUnloadModule(void *modptr)
char *
AOUTAddressToSection(void *modptr, unsigned long address)
{
AOUTModulePtr aoutfile = (AOUTModulePtr)modptr;
AOUTModulePtr aoutfile = (AOUTModulePtr) modptr;
if( address >= (unsigned long)aoutfile->text &&
address <= (unsigned long)aoutfile->text+aoutfile->textsize ) {
return "text";
}
if( address >= (unsigned long)aoutfile->data &&
address <= (unsigned long)aoutfile->data+aoutfile->datasize ) {
return "data";
}
if( address >= (unsigned long)aoutfile->bss &&
address <= (unsigned long)aoutfile->bss+aoutfile->bsssize ) {
return "bss";
}
if (address >= (unsigned long)aoutfile->text &&
address <= (unsigned long)aoutfile->text + aoutfile->textsize) {
return "text";
}
if (address >= (unsigned long)aoutfile->data &&
address <= (unsigned long)aoutfile->data + aoutfile->datasize) {
return "data";
}
if (address >= (unsigned long)aoutfile->bss &&
address <= (unsigned long)aoutfile->bss + aoutfile->bsssize) {
return "bss";
}
return NULL;
}

View file

@ -19,13 +19,13 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.h,v 1.3 1998/09/20 14:41:03 dawes Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/aoutloader.h,v 1.4 2003/10/15 16:29:02 dawes Exp $ */
#ifndef _AOUTLOADER_H
#define _AOUTLOADER_H
extern void *AOUTLoadModule(loaderPtr, int, LOOKUP **);
extern void AOUTResolveSymbols(void *);
extern int AOUTCheckForUnresolved(void *);
extern char *AOUTAddressToSection(void *,unsigned long);
extern char *AOUTAddressToSection(void *, unsigned long);
extern void AOUTUnloadModule(void *);
#endif

Some files were not shown because too many files have changed in this diff Show more