summaryrefslogtreecommitdiff
path: root/hw/xfree86
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:01 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-25 19:29:01 +0000
commitadc7f9a4ebdfe11d4cd6de9388b63dfe36450b39 (patch)
tree23eb7becc5360b2cbe16aa8d45529880067f3989 /hw/xfree86
parent90f1536dd315cd265bfc7ef35058761a65a01734 (diff)
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16
Diffstat (limited to 'hw/xfree86')
-rw-r--r--hw/xfree86/common/atKeynames.h94
-rw-r--r--hw/xfree86/common/compiler.h61
-rw-r--r--hw/xfree86/common/fourcc.h33
-rw-r--r--hw/xfree86/common/modeline2c.pl37
-rw-r--r--hw/xfree86/common/scoasm.h29
-rw-r--r--hw/xfree86/common/xf86.h57
-rw-r--r--hw/xfree86/common/xf86Bus.c36
-rw-r--r--hw/xfree86/common/xf86Bus.h29
-rw-r--r--hw/xfree86/common/xf86Config.c477
-rw-r--r--hw/xfree86/common/xf86Config.h38
-rw-r--r--hw/xfree86/common/xf86Configure.c12
-rw-r--r--hw/xfree86/common/xf86Cursor.c38
-rw-r--r--hw/xfree86/common/xf86DGA.c33
-rw-r--r--hw/xfree86/common/xf86DPMS.c52
-rw-r--r--hw/xfree86/common/xf86Date.h30
-rw-r--r--hw/xfree86/common/xf86Debug.c35
-rw-r--r--hw/xfree86/common/xf86DefModes.c9
-rw-r--r--hw/xfree86/common/xf86DoProbe.c40
-rw-r--r--hw/xfree86/common/xf86DoScanPci.c57
-rw-r--r--hw/xfree86/common/xf86Events.c185
-rw-r--r--hw/xfree86/common/xf86Globals.c27
-rw-r--r--hw/xfree86/common/xf86Helper.c315
-rw-r--r--hw/xfree86/common/xf86InPriv.h29
-rw-r--r--hw/xfree86/common/xf86Init.c238
-rw-r--r--hw/xfree86/common/xf86Io.c34
-rw-r--r--hw/xfree86/common/xf86Kbd.c33
-rw-r--r--hw/xfree86/common/xf86KbdBSD.c39
-rw-r--r--hw/xfree86/common/xf86KbdLnx.c29
-rw-r--r--hw/xfree86/common/xf86Keymap.h30
-rw-r--r--hw/xfree86/common/xf86MiscExt.c105
-rw-r--r--hw/xfree86/common/xf86Mode.c357
-rw-r--r--hw/xfree86/common/xf86Module.h29
-rw-r--r--hw/xfree86/common/xf86Opt.h42
-rw-r--r--hw/xfree86/common/xf86Option.c181
-rw-r--r--hw/xfree86/common/xf86PM.c29
-rw-r--r--hw/xfree86/common/xf86PciInfo.h99
-rw-r--r--hw/xfree86/common/xf86Priv.h30
-rw-r--r--hw/xfree86/common/xf86Privstr.h60
-rw-r--r--hw/xfree86/common/xf86RandR.c23
-rw-r--r--hw/xfree86/common/xf86Resources.h29
-rw-r--r--hw/xfree86/common/xf86Version.h33
-rw-r--r--hw/xfree86/common/xf86VidMode.c43
-rw-r--r--hw/xfree86/common/xf86XKB.c29
-rw-r--r--hw/xfree86/common/xf86Xinput.c33
-rw-r--r--hw/xfree86/common/xf86Xinput.h29
-rw-r--r--hw/xfree86/common/xf86cmap.c53
-rw-r--r--hw/xfree86/common/xf86cmap.h46
-rw-r--r--hw/xfree86/common/xf86fbBus.c27
-rw-r--r--hw/xfree86/common/xf86fbman.c315
-rw-r--r--hw/xfree86/common/xf86fbman.h36
-rw-r--r--hw/xfree86/common/xf86isaBus.c29
-rw-r--r--hw/xfree86/common/xf86noBus.c27
-rw-r--r--hw/xfree86/common/xf86pciBus.c185
-rw-r--r--hw/xfree86/common/xf86pciBus.h33
-rw-r--r--hw/xfree86/common/xf86str.h81
-rw-r--r--hw/xfree86/common/xf86xv.c769
-rw-r--r--hw/xfree86/common/xf86xv.h99
-rw-r--r--hw/xfree86/common/xf86xvmc.c40
-rw-r--r--hw/xfree86/common/xf86xvmc.h32
-rw-r--r--hw/xfree86/common/xisb.c6
-rw-r--r--hw/xfree86/ddc/ddcProperty.c12
-rw-r--r--hw/xfree86/ddc/print_edid.c4
-rw-r--r--hw/xfree86/ddc/print_vdif.c2
-rw-r--r--hw/xfree86/ddc/vdif.h7
-rw-r--r--hw/xfree86/ddc/xf86DDC.c39
-rw-r--r--hw/xfree86/dixmods/extmod/dgaproc.h5
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.c110
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dga.c7
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dga2.c12
-rw-r--r--hw/xfree86/dixmods/extmod/xf86misc.c93
-rw-r--r--hw/xfree86/dixmods/extmod/xf86miscproc.h4
-rw-r--r--hw/xfree86/dixmods/extmod/xf86vmode.c82
-rw-r--r--hw/xfree86/dixmods/ftmodule.c6
-rw-r--r--hw/xfree86/dixmods/glxmodule.c15
-rw-r--r--hw/xfree86/doc/README.DRI4
-rw-r--r--hw/xfree86/doc/README.fonts136
-rw-r--r--hw/xfree86/doc/changelogs/CHANGELOG1716
-rw-r--r--hw/xfree86/doc/devel/README.DRIcomp36
-rw-r--r--hw/xfree86/doc/sgml/DESIGN.sgml10
-rw-r--r--hw/xfree86/dri/dri.c4
-rw-r--r--hw/xfree86/dri/sarea.h84
-rw-r--r--hw/xfree86/dri/xf86dri.c4
-rw-r--r--hw/xfree86/dummylib/dummylib.h4
-rw-r--r--hw/xfree86/dummylib/xf86drvmsg.c5
-rw-r--r--hw/xfree86/dummylib/xf86drvmsgverb.c5
-rw-r--r--hw/xfree86/dummylib/xf86errorf.c7
-rw-r--r--hw/xfree86/dummylib/xf86errorfverb.c5
-rw-r--r--hw/xfree86/dummylib/xf86msg.c5
-rw-r--r--hw/xfree86/dummylib/xf86msgverb.c5
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.c13
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.h4
-rw-r--r--hw/xfree86/fbdevhw/fbdevhwstub.c4
-rw-r--r--hw/xfree86/i2c/xf86i2c.c35
-rw-r--r--hw/xfree86/i2c/xf86i2c.h6
-rw-r--r--hw/xfree86/int10/generic.c15
-rw-r--r--hw/xfree86/int10/helper_exec.c21
-rw-r--r--hw/xfree86/int10/xf86int10.c2
-rw-r--r--hw/xfree86/loader/aout.h133
-rw-r--r--hw/xfree86/loader/aoutloader.c422
-rw-r--r--hw/xfree86/loader/aoutloader.h4
-rw-r--r--hw/xfree86/loader/ar.h62
-rw-r--r--hw/xfree86/loader/coff.h181
-rw-r--r--hw/xfree86/loader/coffloader.c1459
-rw-r--r--hw/xfree86/loader/coffloader.h4
-rw-r--r--hw/xfree86/loader/dixsym.c585
-rw-r--r--hw/xfree86/loader/dlloader.c21
-rw-r--r--hw/xfree86/loader/elf.h313
-rw-r--r--hw/xfree86/loader/elfloader.c3117
-rw-r--r--hw/xfree86/loader/elfloader.h4
-rw-r--r--hw/xfree86/loader/extsym.c39
-rw-r--r--hw/xfree86/loader/fontsym.c137
-rw-r--r--hw/xfree86/loader/hash.c321
-rw-r--r--hw/xfree86/loader/loader.c1001
-rw-r--r--hw/xfree86/loader/loader.h177
-rw-r--r--hw/xfree86/loader/loaderProcs.h75
-rw-r--r--hw/xfree86/loader/loadext.c558
-rw-r--r--hw/xfree86/loader/loadfont.c84
-rw-r--r--hw/xfree86/loader/loadmod.c1904
-rw-r--r--hw/xfree86/loader/misym.c281
-rw-r--r--hw/xfree86/loader/os.c39
-rw-r--r--hw/xfree86/loader/sym.h8
-rw-r--r--hw/xfree86/loader/xf86sym.c1723
-rw-r--r--hw/xfree86/os-support/assyntax.h29
-rw-r--r--hw/xfree86/os-support/bsd/alpha_video.c20
-rw-r--r--hw/xfree86/os-support/bsd/arm_video.c26
-rw-r--r--hw/xfree86/os-support/bsd/bsdResource.c4
-rw-r--r--hw/xfree86/os-support/bsd/bsd_axp.c6
-rw-r--r--hw/xfree86/os-support/bsd/bsd_init.c46
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kbd.c8
-rw-r--r--hw/xfree86/os-support/bsd/bsd_mouse.c144
-rw-r--r--hw/xfree86/os-support/bsd/i386_video.c42
-rw-r--r--hw/xfree86/os-support/bsd/ppc_video.c17
-rw-r--r--hw/xfree86/os-support/bsd/sparc64_video.c9
-rw-r--r--hw/xfree86/os-support/bus/460gxPCI.c21
-rw-r--r--hw/xfree86/os-support/bus/Pci.c126
-rw-r--r--hw/xfree86/os-support/bus/Pci.h56
-rw-r--r--hw/xfree86/os-support/bus/Sbus.c23
-rw-r--r--hw/xfree86/os-support/bus/e8870PCI.c4
-rw-r--r--hw/xfree86/os-support/bus/freebsdPci.c4
-rw-r--r--hw/xfree86/os-support/bus/ix86Pci.c80
-rw-r--r--hw/xfree86/os-support/bus/netbsdPci.c13
-rw-r--r--hw/xfree86/os-support/bus/sparcPci.c8
-rw-r--r--hw/xfree86/os-support/bus/xf86Pci.h36
-rw-r--r--hw/xfree86/os-support/bus/xf86Sbus.h8
-rw-r--r--hw/xfree86/os-support/bus/zx1PCI.c39
-rw-r--r--hw/xfree86/os-support/int10Defines.h28
-rw-r--r--hw/xfree86/os-support/linux/int10/linux.c16
-rw-r--r--hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c4
-rw-r--r--hw/xfree86/os-support/linux/lnx_agp.c14
-rw-r--r--hw/xfree86/os-support/linux/lnx_io.c8
-rw-r--r--hw/xfree86/os-support/linux/lnx_kbd.c18
-rw-r--r--hw/xfree86/os-support/linux/lnx_mouse.c175
-rw-r--r--hw/xfree86/os-support/linux/lnx_video.c55
-rw-r--r--hw/xfree86/os-support/misc/Delay.c5
-rw-r--r--hw/xfree86/os-support/misc/SlowBcopy.c5
-rw-r--r--hw/xfree86/os-support/sco/VTsw_sco.c5
-rw-r--r--hw/xfree86/os-support/sco/sco_video.c9
-rw-r--r--hw/xfree86/os-support/shared/agp_noop.c33
-rw-r--r--hw/xfree86/os-support/shared/at_scancode.c56
-rw-r--r--hw/xfree86/os-support/shared/kbd.c28
-rw-r--r--hw/xfree86/os-support/shared/kmod_noop.c27
-rw-r--r--hw/xfree86/os-support/shared/libc_wrapper.c53
-rw-r--r--hw/xfree86/os-support/shared/pm_noop.c28
-rw-r--r--hw/xfree86/os-support/shared/posix_tty.c9
-rw-r--r--hw/xfree86/os-support/shared/sigio.c31
-rw-r--r--hw/xfree86/os-support/shared/sigiostubs.c31
-rw-r--r--hw/xfree86/os-support/shared/stdPci.c31
-rw-r--r--hw/xfree86/os-support/shared/stdResource.c34
-rw-r--r--hw/xfree86/os-support/shared/vidmem.c30
-rw-r--r--hw/xfree86/os-support/shared/xf86Axp.c28
-rw-r--r--hw/xfree86/os-support/solaris/sun_bios.c6
-rw-r--r--hw/xfree86/os-support/solaris/sun_kbd.c7
-rw-r--r--hw/xfree86/os-support/solaris/sun_kbdEv.c256
-rw-r--r--hw/xfree86/os-support/sysv/sysv_video.c11
-rw-r--r--hw/xfree86/os-support/xf86OSKbd.h49
-rw-r--r--hw/xfree86/os-support/xf86OSmouse.h124
-rw-r--r--hw/xfree86/os-support/xf86OSpriv.h28
-rw-r--r--hw/xfree86/os-support/xf86_OSlib.h31
-rw-r--r--hw/xfree86/os-support/xf86_OSproc.h5
-rw-r--r--hw/xfree86/os-support/xf86_ansic.h7
-rw-r--r--hw/xfree86/os-support/xf86_libc.h44
-rw-r--r--hw/xfree86/parser/Configint.h29
-rw-r--r--hw/xfree86/parser/Device.c29
-rw-r--r--hw/xfree86/parser/Files.c29
-rw-r--r--hw/xfree86/parser/Flags.c29
-rw-r--r--hw/xfree86/parser/Input.c29
-rw-r--r--hw/xfree86/parser/Keyboard.c35
-rw-r--r--hw/xfree86/parser/Layout.c29
-rw-r--r--hw/xfree86/parser/Module.c29
-rw-r--r--hw/xfree86/parser/Monitor.c29
-rw-r--r--hw/xfree86/parser/Pointer.c29
-rw-r--r--hw/xfree86/parser/Screen.c65
-rw-r--r--hw/xfree86/parser/Vendor.c29
-rw-r--r--hw/xfree86/parser/Video.c28
-rw-r--r--hw/xfree86/parser/configProcs.h28
-rw-r--r--hw/xfree86/parser/read.c29
-rw-r--r--hw/xfree86/parser/scan.c281
-rw-r--r--hw/xfree86/parser/write.c29
-rw-r--r--hw/xfree86/parser/xf86Optrec.h29
-rw-r--r--hw/xfree86/parser/xf86Parser.h31
-rw-r--r--hw/xfree86/parser/xf86tokens.h29
-rw-r--r--hw/xfree86/ramdac/BT.c4
-rw-r--r--hw/xfree86/ramdac/IBM.c4
-rw-r--r--hw/xfree86/ramdac/TI.c4
-rw-r--r--hw/xfree86/ramdac/xf86HWCurs.c9
-rw-r--r--hw/xfree86/ramdac/xf86RamDac.c14
-rw-r--r--hw/xfree86/scanpci/extrapci.ids15
-rw-r--r--hw/xfree86/scanpci/pci.ids239
-rw-r--r--hw/xfree86/scanpci/pciid2c.pl27
-rw-r--r--hw/xfree86/scanpci/xf86PciData.h29
-rw-r--r--hw/xfree86/scanpci/xf86PciStdIds.h1819
-rw-r--r--hw/xfree86/scanpci/xf86PciStr.h30
-rw-r--r--hw/xfree86/scanpci/xf86ScanPci.c34
-rw-r--r--hw/xfree86/scanpci/xf86ScanPci.h30
-rw-r--r--hw/xfree86/shadowfb/shadow.c26
-rw-r--r--hw/xfree86/utils/kbd_mode/sun-kbd_mode.c10
-rw-r--r--hw/xfree86/utils/pcitweak/pcitweak.c31
-rw-r--r--hw/xfree86/utils/pcitweak/pcitweak.man.pre4
-rw-r--r--hw/xfree86/utils/xorgcfg/card-cfg.c6
-rw-r--r--hw/xfree86/utils/xorgcfg/config.c10
-rw-r--r--hw/xfree86/utils/xorgcfg/config.h23
-rw-r--r--hw/xfree86/utils/xorgcfg/expert.c28
-rw-r--r--hw/xfree86/utils/xorgcfg/help.c12
-rw-r--r--hw/xfree86/utils/xorgcfg/loadmod.c30
-rw-r--r--hw/xfree86/utils/xorgcfg/monitor-cfg.c10
-rw-r--r--hw/xfree86/utils/xorgcfg/mouse-cfg.c11
-rw-r--r--hw/xfree86/utils/xorgcfg/screen-cfg.c6
-rw-r--r--hw/xfree86/utils/xorgcfg/stubs.c7
-rw-r--r--hw/xfree86/utils/xorgcfg/text-mode.c34
-rw-r--r--hw/xfree86/utils/xorgcfg/vidmode.c22
-rw-r--r--hw/xfree86/utils/xorgcfg/xf86config.c5
-rw-r--r--hw/xfree86/vbe/vbe.c17
-rw-r--r--hw/xfree86/vbe/vbe.h16
-rw-r--r--hw/xfree86/vbe/vbeModes.c12
-rw-r--r--hw/xfree86/vgahw/vgaHW.c34
-rw-r--r--hw/xfree86/x86emu/fpu.c47
-rw-r--r--hw/xfree86/x86emu/ops.c12
-rw-r--r--hw/xfree86/x86emu/ops2.c4
-rw-r--r--hw/xfree86/x86emu/x86emu/fpu_regs.h5
-rw-r--r--hw/xfree86/x86emu/x86emu/regs.h6
-rw-r--r--hw/xfree86/x86emu/x86emu/types.h7
-rw-r--r--hw/xfree86/xaa/xaaBitBlt.c4
-rw-r--r--hw/xfree86/xaa/xaaCpyPlane.c4
-rw-r--r--hw/xfree86/xaa/xaaCpyWin.c4
-rw-r--r--hw/xfree86/xaa/xaaFillPoly.c8
-rw-r--r--hw/xfree86/xaa/xaaFillRect.c6
-rw-r--r--hw/xfree86/xaa/xaaImage.c5
-rw-r--r--hw/xfree86/xaa/xaaNonTEText.c2
-rw-r--r--hw/xfree86/xaa/xaaOverlay.c4
-rw-r--r--hw/xfree86/xaa/xaaOverlayDF.c6
-rw-r--r--hw/xfree86/xaa/xaaPCache.c14
-rw-r--r--hw/xfree86/xaa/xaaPict.c12
-rw-r--r--hw/xfree86/xaa/xaaStateChange.c5
-rw-r--r--hw/xfree86/xaa/xaaStipple.c66
-rw-r--r--hw/xfree86/xaa/xaaWideLine.c4
-rw-r--r--hw/xfree86/xaa/xaalocal.h4
-rw-r--r--hw/xfree86/xf4bpp/emulTile.c4
-rw-r--r--hw/xfree86/xf4bpp/mfbfillarc.c6
-rw-r--r--hw/xfree86/xf4bpp/mfbimggblt.c8
-rw-r--r--hw/xfree86/xf4bpp/mfbline.c18
-rw-r--r--hw/xfree86/xf4bpp/ppcCpArea.c34
-rw-r--r--hw/xfree86/xf4bpp/ppcFillRct.c10
-rw-r--r--hw/xfree86/xf4bpp/ppcGCstr.h6
-rw-r--r--hw/xfree86/xf4bpp/ppcIO.c4
-rw-r--r--hw/xfree86/xf4bpp/ppcPixFS.c22
-rw-r--r--hw/xfree86/xf4bpp/ppcPntWin.c6
-rw-r--r--hw/xfree86/xf4bpp/ppcWinFS.c22
-rw-r--r--hw/xfree86/xf4bpp/vgaBitBlt.c15
-rw-r--r--hw/xfree86/xf4bpp/vgaImages.c11
-rw-r--r--hw/xfree86/xf4bpp/vgaSolid.c8
-rw-r--r--hw/xfree86/xf4bpp/vgaStipple.c5
-rw-r--r--hw/xfree86/xf4bpp/xf4bpp.h154
-rw-r--r--hw/xfree86/xf8_16bpp/cfbwindow.c6
-rw-r--r--hw/xfree86/xf8_32bpp/cfb8_32.h14
-rw-r--r--hw/xfree86/xf8_32bpp/cfbbstore.c6
-rw-r--r--hw/xfree86/xf8_32bpp/cfbcpyarea.c24
-rw-r--r--hw/xfree86/xf8_32bpp/cfbgcunder.c9
-rw-r--r--hw/xfree86/xf8_32bpp/cfbimage.c4
-rw-r--r--hw/xfree86/xf8_32bpp/cfbscrinit.c20
-rw-r--r--hw/xfree86/xf8_32bpp/cfbwindow.c8
-rw-r--r--hw/xfree86/xf8_32wid/cfbwindow.c8
281 files changed, 17322 insertions, 9188 deletions
diff --git a/hw/xfree86/common/atKeynames.h b/hw/xfree86/common/atKeynames.h
index 23760db5e..17bb21f4d 100644
--- a/hw/xfree86/common/atKeynames.h
+++ b/hw/xfree86/common/atKeynames.h
@@ -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
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index 4dda2f6c6..bf9fbeee2 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -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
diff --git a/hw/xfree86/common/fourcc.h b/hw/xfree86/common/fourcc.h
index 61f403679..e60aa4e83 100644
--- a/hw/xfree86/common/fourcc.h
+++ b/hw/xfree86/common/fourcc.h
@@ -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_ */
diff --git a/hw/xfree86/common/modeline2c.pl b/hw/xfree86/common/modeline2c.pl
index fb76789d6..e31fe28e1 100644
--- a/hw/xfree86/common/modeline2c.pl
+++ b/hw/xfree86/common/modeline2c.pl
@@ -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 [] = {
diff --git a/hw/xfree86/common/scoasm.h b/hw/xfree86/common/scoasm.h
index 12fe46693..dbf8c8f86 100644
--- a/hw/xfree86/common/scoasm.h
+++ b/hw/xfree86/common/scoasm.h
@@ -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
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 119adc5a6..e189e81d2 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -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 */
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index fd9e3c3d1..2ffbfa964 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -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",
diff --git a/hw/xfree86/common/xf86Bus.h b/hw/xfree86/common/xf86Bus.h
index 6a129ad56..fbeca7f9c 100644
--- a/hw/xfree86/common/xf86Bus.h
+++ b/hw/xfree86/common/xf86Bus.h
@@ -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;
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 1738222f5..8f6dd2803 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -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.
+ *
+ * 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:
*
- * <Put copyright message here>
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
*
- * Author: Dirk Hohndel <hohndel@XFree86.Org> and others.
+ * 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");
}
@@ -1143,6 +1180,11 @@ configInputKbd(IDevPtr inputp)
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\"",
xf86Info.wsKbdType);
@@ -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->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->commonOptions &&
- xf86FindOption(indp->commonOptions, "CoreKeyboard")) ||
- (indp->extraOptions &&
- xf86FindOption(indp->extraOptions, "CoreKeyboard"))) {
- haveKeyboard = TRUE;
+ 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;
+
+ 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;
}
- from = X_CMDLINE;
- } else {
+ }
+ }
+
+ /* 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;
- confInput = xf86findInput(CONF_IMPLICIT_POINTER,
- xf86configptr->conf_input_lst);
- if (!confInput && implicitLayout) {
- confInput = xf86findInputByDriver("mouse",
- xf86configptr->conf_input_lst);
- }
+ pointerMsg = "first mouse device";
+ }
+ }
+
+ /* 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 (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;
+ }
+
+ if (!foundPointer) {
+ /* This shouldn't happen. */
+ xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n");
+ return FALSE;
+ }
+
+ 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;
}
- from = X_CMDLINE;
- } else {
+ }
+ }
+
+ /* 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;
- confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
- xf86configptr->conf_input_lst);
- if (!confInput && implicitLayout) {
- confInput = xf86findInputByDriver("keyboard",
- xf86configptr->conf_input_lst);
- }
+ pointerMsg = "first keyboard 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");
- return FALSE;
+
+ /* 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;
}
- 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");
+
+ /* 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 (xf86ConfigFile)
- from = X_CMDLINE;
+ if (!autoconfig) {
+ if (getuid() == 0)
+ searchpath = ROOT_CONFIGPATH;
+ else
+ searchpath = USER_CONFIGPATH;
- 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;
}
diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h
index 6a24df0e0..e54da3d09 100644
--- a/hw/xfree86/common/xf86Config.h
+++ b/hw/xfree86/common/xf86Config.h
@@ -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 */
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 687730ea5..3dde4ba7d 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -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);
diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c
index 1a214c4ad..22b7b00e6 100644
--- a/hw/xfree86/common/xf86Cursor.c
+++ b/hw/xfree86/common/xf86Cursor.c
@@ -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;
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index 1ad8b42ff..5e4bc29b6 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -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"
diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c
index 0de054ff3..df968797c 100644
--- a/hw/xfree86/common/xf86DPMS.c
+++ b/hw/xfree86/common/xf86DPMS.c
@@ -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;
diff --git a/hw/xfree86/common/xf86Date.h b/hw/xfree86/common/xf86Date.h
index 506e05370..754e20d18 100644
--- a/hw/xfree86/common/xf86Date.h
+++ b/hw/xfree86/common/xf86Date.h
@@ -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
diff --git a/hw/xfree86/common/xf86Debug.c b/hw/xfree86/common/xf86Debug.c
index b069743a1..3bf21689f 100644
--- a/hw/xfree86/common/xf86Debug.c
+++ b/hw/xfree86/common/xf86Debug.c
@@ -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);
diff --git a/hw/xfree86/common/xf86DefModes.c b/hw/xfree86/common/xf86DefModes.c
index abef13110..7257b204b 100644
--- a/hw/xfree86/common/xf86DefModes.c
+++ b/hw/xfree86/common/xf86DefModes.c
@@ -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 [] = {
diff --git a/hw/xfree86/common/xf86DoProbe.c b/hw/xfree86/common/xf86DoProbe.c
index 518f67214..eece97719 100644
--- a/hw/xfree86/common/xf86DoProbe.c
+++ b/hw/xfree86/common/xf86DoProbe.c
@@ -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 $ */
/*
- * finish setting up the server
- * Load the driver modules and call their probe functions.
+ * 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:
*
- * Copyright 1999 by The XFree86 Project, Inc.
+ * 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.
*/
#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);
diff --git a/hw/xfree86/common/xf86DoScanPci.c b/hw/xfree86/common/xf86DoScanPci.c
index 2328d2b05..8938c1d96 100644
--- a/hw/xfree86/common/xf86DoScanPci.c
+++ b/hw/xfree86/common/xf86DoScanPci.c
@@ -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
*/
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 4d0efbcb9..1c3f3a34f 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -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;
@@ -829,17 +933,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 ...
*/
keycode = scanCode + MIN_KEYCODE;
@@ -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;
}
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 99c53fb0b..c6dee3731 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -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).
*/
/*
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 73050eab7..713e7861a 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -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) {
+ 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) {
- xf86DrvMsg(scrp->scrnIndex, X_ERROR, "No Display subsection "
- "in Screen section \"%s\" for depth/fbbpp %d/%d\n",
+ 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);
+
+ xf86LogFile = LogInit(xf86LogFile, LOGOLDSUFFIX);
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;
- }
+ 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()
{
diff --git a/hw/xfree86/common/xf86InPriv.h b/hw/xfree86/common/xf86InPriv.h
index 5cd66d882..32e3c8e1d 100644
--- a/hw/xfree86/common/xf86InPriv.h
+++ b/hw/xfree86/common/xf86InPriv.h
@@ -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
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 7c65ce888..ce8817096 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -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
diff --git a/hw/xfree86/common/xf86Io.c b/hw/xfree86/common/xf86Io.c
index 06819bccf..bd44bdeb5 100644
--- a/hw/xfree86/common/xf86Io.c
+++ b/hw/xfree86/common/xf86Io.c
@@ -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;
diff --git a/hw/xfree86/common/xf86Kbd.c b/hw/xfree86/common/xf86Kbd.c
index c1ad79778..3c7ed7a69 100644
--- a/hw/xfree86/common/xf86Kbd.c
+++ b/hw/xfree86/common/xf86Kbd.c
@@ -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"
diff --git a/hw/xfree86/common/xf86KbdBSD.c b/hw/xfree86/common/xf86KbdBSD.c
index a606b14fb..2621e2a81 100644
--- a/hw/xfree86/common/xf86KbdBSD.c
+++ b/hw/xfree86/common/xf86KbdBSD.c
@@ -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
diff --git a/hw/xfree86/common/xf86KbdLnx.c b/hw/xfree86/common/xf86KbdLnx.c
index 1f97c0b15..b023acfbd 100644
--- a/hw/xfree86/common/xf86KbdLnx.c
+++ b/hw/xfree86/common/xf86KbdLnx.c
@@ -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"
diff --git a/hw/xfree86/common/xf86Keymap.h b/hw/xfree86/common/xf86Keymap.h
index 45f4dd104..82ea52eef 100644
--- a/hw/xfree86/common/xf86Keymap.h
+++ b/hw/xfree86/common/xf86Keymap.h
@@ -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 !!!!
diff --git a/hw/xfree86/common/xf86MiscExt.c b/hw/xfree86/common/xf86MiscExt.c
index f04a0b8d8..a36ca52f2 100644
--- a/hw/xfree86/common/xf86MiscExt.c
+++ b/hw/xfree86/common/xf86MiscExt.c
@@ -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 */
diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index ba73921e4..fd2ff4a22 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -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,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>
+ * 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;
+
+ 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;
- for (i = 0; i < 4; i++) {
- detMon = &DDC->det_mon[i];
- if(detMon->type == DS_RANGES) {
- mon_range = &detMon->section.ranges;
+ 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 (mon_range) {
+
+ 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 (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);
}
@@ -1498,6 +1637,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.
*/
while (scrp->modes)
@@ -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)
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index 21b9aa590..bd18e895f 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -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)
diff --git a/hw/xfree86/common/xf86Opt.h b/hw/xfree86/common/xf86Opt.h
index dc5c2ca67..718732353 100644
--- a/hw/xfree86/common/xf86Opt.h
+++ b/hw/xfree86/common/xf86Opt.h
@@ -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
diff --git a/hw/xfree86/common/xf86Option.c b/hw/xfree86/common/xf86Option.c
index 6ca1590e4..0ba09b507 100644
--- a/hw/xfree86/common/xf86Option.c
+++ b/hw/xfree86/common/xf86Option.c
@@ -1,10 +1,33 @@
-/* $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 by The XFree86 Project, Inc.
+ * Copyright (c) 1998-2003 by The XFree86 Project, Inc.
*
- * Author: David Dawes <dawes@xfree86.org>
+ * 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).
+ */
+
+/*
+ * 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)
+{
+ char *tmp = xnfalloc(32);
+ snprintf(tmp,32,"%f",val);
+ return xf86AddNewOption(optlist,name,tmp);
+}
+
+pointer
+xf86ReplaceBoolOption(pointer optlist, const char *name, const Bool val)
{
- return xf86AddNewOption(optlist,name,(Bool)val?"True":"False");
+ return xf86AddNewOption(optlist,name,val?"True":"False");
}
pointer
-xf86ReplaceStrOption(pointer optlist, char *name, char* val)
+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;
}
diff --git a/hw/xfree86/common/xf86PM.c b/hw/xfree86/common/xf86PM.c
index 03f5bdec1..eb56fb614 100644
--- a/hw/xfree86/common/xf86PM.c
+++ b/hw/xfree86/common/xf86PM.c
@@ -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"
diff --git a/hw/xfree86/common/xf86PciInfo.h b/hw/xfree86/common/xf86PciInfo.h
index 14f86cf89..19cc009dd 100644
--- a/hw/xfree86/common/xf86PciInfo.h
+++ b/hw/xfree86/common/xf86PciInfo.h
@@ -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
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index 308e7a72c..a46bfc39b 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -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 */
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index ff704b912..8b0a0f4ce 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -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 */
diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c
index c2dbcc170..546c909ff 100644
--- a/hw/xfree86/common/xf86RandR.c
+++ b/hw/xfree86/common/xf86RandR.c
@@ -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;
}
diff --git a/hw/xfree86/common/xf86Resources.h b/hw/xfree86/common/xf86Resources.h
index 6ed3015ec..ce2c62bb3 100644
--- a/hw/xfree86/common/xf86Resources.h
+++ b/hw/xfree86/common/xf86Resources.h
@@ -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
diff --git a/hw/xfree86/common/xf86Version.h b/hw/xfree86/common/xf86Version.h
index e548b0437..07253bace 100644
--- a/hw/xfree86/common/xf86Version.h
+++ b/hw/xfree86/common/xf86Version.h
@@ -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) \
diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c
index f766f899e..467270e10 100644
--- a/hw/xfree86/common/xf86VidMode.c
+++ b/hw/xfree86/common/xf86VidMode.c
@@ -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;
diff --git a/hw/xfree86/common/xf86XKB.c b/hw/xfree86/common/xf86XKB.c
index ddd3055ab..e1755de1e 100644
--- a/hw/xfree86/common/xf86XKB.c
+++ b/hw/xfree86/common/xf86XKB.c
@@ -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
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 53fa1b3ff..eb871a40d 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -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);
diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h
index 1e9694402..9a0393447 100644
--- a/hw/xfree86/common/xf86Xinput.h
+++ b/hw/xfree86/common/xf86Xinput.h
@@ -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
diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c
index 531a83c08..f7cb065a4 100644
--- a/hw/xfree86/common/xf86cmap.c
+++ b/hw/xfree86/common/xf86cmap.c
@@ -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);
}
}
}
diff --git a/hw/xfree86/common/xf86cmap.h b/hw/xfree86/common/xf86cmap.h
index b871d6762..4291b971a 100644
--- a/hw/xfree86/common/xf86cmap.h
+++ b/hw/xfree86/common/xf86cmap.h
@@ -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
);
diff --git a/hw/xfree86/common/xf86fbBus.c b/hw/xfree86/common/xf86fbBus.c
index 8fcf9b817..8a807624f 100644
--- a/hw/xfree86/common/xf86fbBus.c
+++ b/hw/xfree86/common/xf86fbBus.c
@@ -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).
*/
/*
diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c
index 7f4cffaae..b7c4afa1c 100644
--- a/hw/xfree86/common/xf86fbman.c
+++ b/hw/xfree86/common/xf86fbman.c
@@ -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;
- if(!(link = xalloc(sizeof(FBLinearLink))))
- return NULL;
+ /* Try to allocate from linear memory first...... */
+#ifdef DEBUG
+ ErrorF("ALLOCATING LINEAR\n");
+#endif
+ if ((linear = AllocateLinear(offman, length, gran, privData)))
+ return linear;
-#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 */
- }
+#ifdef DEBUG
+ ErrorF("NOPE, ALLOCATING AREA\n");
#endif
+ if(!(link = xalloc(sizeof(FBLinearLink))))
+ return NULL;
+
+ /* 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,
- FAVOR_WIDTH_THEN_AREA, priority))
- {
- FBManagerPtr offman;
- BoxPtr extents;
+ pLink = offman->LinearAreas;
+ pLinkRet = pLink;
- offman = pScreen->devPrivates[xf86FBScreenIndex].ptr;
- extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
- if((extents->x2 - extents->x1) == w)
- *size = w * h;
- return TRUE;
+ 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;
+
+ 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
diff --git a/hw/xfree86/common/xf86fbman.h b/hw/xfree86/common/xf86fbman.h
index 673c7bc33..adb26a1f1 100644
--- a/hw/xfree86/common/xf86fbman.h
+++ b/hw/xfree86/common/xf86fbman.h
@@ -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
diff --git a/hw/xfree86/common/xf86isaBus.c b/hw/xfree86/common/xf86isaBus.c
index cfe6ed000..1b9890d5e 100644
--- a/hw/xfree86/common/xf86isaBus.c
+++ b/hw/xfree86/common/xf86isaBus.c
@@ -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
*/
diff --git a/hw/xfree86/common/xf86noBus.c b/hw/xfree86/common/xf86noBus.c
index a9efcdbc4..2d79ab476 100644
--- a/hw/xfree86/common/xf86noBus.c
+++ b/hw/xfree86/common/xf86noBus.c
@@ -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).
*/
/*
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index c40fc1016..641d1c919 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -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:
diff --git a/hw/xfree86/common/xf86pciBus.h b/hw/xfree86/common/xf86pciBus.h
index fbe3fbe62..fbb733ae7 100644
--- a/hw/xfree86/common/xf86pciBus.h
+++ b/hw/xfree86/common/xf86pciBus.h
@@ -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;
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 2b6deed33..367cb19a9 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -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 */
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index c6a09121b..90289057b 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1,12 +1,34 @@
-/*
-
- XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com)
-
- Copyright (C) 1998, 1999 - The XFree86 Project Inc.
-
-*/
-
-/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.c,v 1.33 2002/11/09 01:18:11 keithp Exp $ */
+/*
+ * XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com)
+ */
+/*
+ * 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).
+ */
+
+/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.c,v 1.37 2003/11/10 18:22:15 tsi Exp $ */
#include "misc.h"
#include "xf86.h"
@@ -31,7 +53,7 @@
#include "xvmodproc.h"
#endif
-#include "xf86xv.h"
+#include "xf86xvpriv.h"
/* XvScreenRec fields */
@@ -44,29 +66,29 @@ static int xf86XVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *);
static int xf86XVAllocatePort(unsigned long, XvPortPtr, XvPortPtr*);
static int xf86XVFreePort(XvPortPtr);
static int xf86XVPutVideo(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
+ INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
static int xf86XVPutStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
+ INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
static int xf86XVGetVideo(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
+ INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
static int xf86XVGetStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
+ INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16);
static int xf86XVStopVideo(ClientPtr, XvPortPtr, DrawablePtr);
static int xf86XVSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32);
static int xf86XVGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32*);
static int xf86XVQueryBestSize(ClientPtr, XvPortPtr, CARD8,
- CARD16, CARD16,CARD16, CARD16,
+ CARD16, CARD16,CARD16, CARD16,
unsigned int*, unsigned int*);
static int xf86XVPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
- INT16, INT16, CARD16, CARD16,
+ INT16, INT16, CARD16, CARD16,
INT16, INT16, CARD16, CARD16,
XvImagePtr, unsigned char*, Bool,
CARD16, CARD16);
-static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr,
+static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr,
CARD16*, CARD16*, int*, int*);
@@ -107,7 +129,7 @@ int (*XvScreenInitProc)(ScreenPtr) = XvScreenInit;
((XvScreenPtr)((pScreen)->devPrivates[XF86XvScreenIndex].ptr))
#define GET_XF86XV_SCREEN(pScreen) \
- ((XF86XVScreenPtr)(GET_XV_SCREEN(pScreen)->devPriv.ptr))
+ ((XF86XVScreenPtr)(GET_XV_SCREEN(pScreen)->devPriv.ptr))
#define GET_XF86XV_WINDOW(pWin) \
((XF86XVWindowPtr)((pWin)->devPrivates[XF86XVWindowIndex].ptr))
@@ -121,12 +143,12 @@ xf86XVRegisterGenericAdaptorDriver(
){
xf86XVInitGenericAdaptorPtr *newdrivers;
- newdrivers = xrealloc(GenDrivers, sizeof(xf86XVInitGenericAdaptorPtr) *
+ newdrivers = xrealloc(GenDrivers, sizeof(xf86XVInitGenericAdaptorPtr) *
(1 + NumGenDrivers));
if (!newdrivers)
return 0;
GenDrivers = newdrivers;
-
+
GenDrivers[NumGenDrivers++] = InitFunc;
return 1;
@@ -134,7 +156,7 @@ xf86XVRegisterGenericAdaptorDriver(
int
xf86XVListGenericAdaptors(
- ScrnInfoPtr pScrn,
+ ScrnInfoPtr pScrn,
XF86VideoAdaptorPtr **adaptors
){
int i,j,n,num;
@@ -142,8 +164,13 @@ xf86XVListGenericAdaptors(
num = 0;
*adaptors = NULL;
- for (i = 0; i < NumGenDrivers; i++) {
- n = GenDrivers[i](pScrn,&DrivAdap);
+ /*
+ * The v4l driver registers itself first, but can use surfaces registered
+ * by other drivers. So, call the v4l driver last.
+ */
+ for (i = NumGenDrivers; --i >= 0; ) {
+ DrivAdap = NULL;
+ n = (*GenDrivers[i])(pScrn, &DrivAdap);
if (0 == n)
continue;
new = xrealloc(*adaptors, sizeof(XF86VideoAdaptorPtr) * (num+n));
@@ -156,6 +183,38 @@ xf86XVListGenericAdaptors(
return num;
}
+
+/**************** Offscreen surface stuff *******************/
+
+typedef struct {
+ XF86OffscreenImagePtr images;
+ int num;
+} OffscreenImageRec;
+
+static OffscreenImageRec OffscreenImages[MAXSCREENS];
+
+Bool
+xf86XVRegisterOffscreenImages(
+ ScreenPtr pScreen,
+ XF86OffscreenImagePtr images,
+ int num
+){
+ OffscreenImages[pScreen->myNum].num = num;
+ OffscreenImages[pScreen->myNum].images = images;
+
+ return TRUE;
+}
+
+XF86OffscreenImagePtr
+xf86XVQueryOffscreenImages(
+ ScreenPtr pScreen,
+ int *num
+){
+ *num = OffscreenImages[pScreen->myNum].num;
+ return OffscreenImages[pScreen->myNum].images;
+}
+
+
XF86VideoAdaptorPtr
xf86XVAllocateVideoAdaptorRec(ScrnInfoPtr pScrn)
{
@@ -171,7 +230,7 @@ xf86XVFreeVideoAdaptorRec(XF86VideoAdaptorPtr ptr)
Bool
xf86XVScreenInit(
- ScreenPtr pScreen,
+ ScreenPtr pScreen,
XF86VideoAdaptorPtr *adaptors,
int num
){
@@ -181,7 +240,7 @@ xf86XVScreenInit(
if(num <= 0 ||
!XvGetScreenIndexProc || !XvGetRTPortProc || !XvScreenInitProc)
- return FALSE;
+ return FALSE;
if(XF86XVGeneration != serverGeneration) {
if((XF86XVWindowIndex = AllocateWindowPrivateIndex()) < 0)
@@ -190,7 +249,7 @@ xf86XVScreenInit(
}
if(!AllocateWindowPrivate(pScreen,XF86XVWindowIndex,0))
- return FALSE;
+ return FALSE;
if(Success != (*XvScreenInitProc)(pScreen)) return FALSE;
@@ -245,31 +304,28 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor)
{
int i;
- if(pAdaptor->name)
- xfree(pAdaptor->name);
+ xfree(pAdaptor->name);
if(pAdaptor->pEncodings) {
XvEncodingPtr pEncode = pAdaptor->pEncodings;
- for(i = 0; i < pAdaptor->nEncodings; i++, pEncode++) {
- if(pEncode->name) xfree(pEncode->name);
- }
+ for(i = 0; i < pAdaptor->nEncodings; i++, pEncode++)
+ xfree(pEncode->name);
xfree(pAdaptor->pEncodings);
}
- if(pAdaptor->pFormats)
- xfree(pAdaptor->pFormats);
+ xfree(pAdaptor->pFormats);
if(pAdaptor->pPorts) {
XvPortPtr pPort = pAdaptor->pPorts;
XvPortRecPrivatePtr pPriv;
for(i = 0; i < pAdaptor->nPorts; i++, pPort++) {
- pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
+ pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
if(pPriv) {
- if(pPriv->clientClip)
+ if(pPriv->clientClip)
REGION_DESTROY(pAdaptor->pScreen, pPriv->clientClip);
- if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
+ if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
REGION_DESTROY(pAdaptor->pScreen, pPriv->pCompositeClip);
xfree(pPriv);
}
@@ -280,23 +336,18 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor)
if(pAdaptor->nAttributes) {
XvAttributePtr pAttribute = pAdaptor->pAttributes;
- for(i = 0; i < pAdaptor->nAttributes; i++, pAttribute++) {
- if(pAttribute->name) xfree(pAttribute->name);
- }
-
+ for(i = 0; i < pAdaptor->nAttributes; i++, pAttribute++)
+ xfree(pAttribute->name);
xfree(pAdaptor->pAttributes);
}
- if(pAdaptor->nImages)
- xfree(pAdaptor->pImages);
-
- if(pAdaptor->devPriv.ptr)
- xfree(pAdaptor->devPriv.ptr);
+ xfree(pAdaptor->pImages);
+ xfree(pAdaptor->devPriv.ptr);
}
static Bool
xf86XVInitAdaptors(
- ScreenPtr pScreen,
+ ScreenPtr pScreen,
XF86VideoAdaptorPtr *infoPtr,
int number
) {
@@ -325,7 +376,7 @@ xf86XVInitAdaptors(
pxvs->nAdaptors = 0;
pxvs->pAdaptors = NULL;
- if(!(pAdaptor = xcalloc(number, sizeof(XvAdaptorRec))))
+ if(!(pAdaptor = xcalloc(number, sizeof(XvAdaptorRec))))
return FALSE;
for(pa = pAdaptor, na = 0, numAdaptor = 0; na < number; na++, adaptorPtr++) {
@@ -339,7 +390,7 @@ xf86XVInitAdaptors(
if(!adaptorPtr->nEncodings || !adaptorPtr->pEncodings)
continue;
- pa->type = adaptorPtr->type;
+ pa->type = adaptorPtr->type;
if(!adaptorPtr->PutVideo && !adaptorPtr->GetVideo)
pa->type &= ~XvVideoMask;
@@ -350,19 +401,19 @@ xf86XVInitAdaptors(
if(!adaptorPtr->PutImage || !adaptorPtr->QueryImageAttributes)
pa->type &= ~XvImageMask;
- if(!adaptorPtr->PutVideo && !adaptorPtr->PutImage &&
+ if(!adaptorPtr->PutVideo && !adaptorPtr->PutImage &&
!adaptorPtr->PutStill)
pa->type &= ~XvInputMask;
if(!adaptorPtr->GetVideo && !adaptorPtr->GetStill)
pa->type &= ~XvOutputMask;
-
- if(!(adaptorPtr->type & (XvPixmapMask | XvWindowMask)))
+
+ if(!(adaptorPtr->type & (XvPixmapMask | XvWindowMask)))
continue;
- if(!(adaptorPtr->type & (XvImageMask | XvVideoMask | XvStillMask)))
+ if(!(adaptorPtr->type & (XvImageMask | XvVideoMask | XvStillMask)))
continue;
- pa->pScreen = pScreen;
+ pa->pScreen = pScreen;
pa->ddAllocatePort = xf86XVAllocatePort;
pa->ddFreePort = xf86XVFreePort;
pa->ddPutVideo = xf86XVPutVideo;
@@ -376,33 +427,33 @@ xf86XVInitAdaptors(
pa->ddQueryBestSize = xf86XVQueryBestSize;
pa->ddQueryImageAttributes = xf86XVQueryImageAttributes;
if((pa->name = xalloc(strlen(adaptorPtr->name) + 1)))
- strcpy(pa->name, adaptorPtr->name);
+ strcpy(pa->name, adaptorPtr->name);
if(adaptorPtr->nEncodings &&
(pEncode = xcalloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) {
- for(pe = pEncode, encodingPtr = adaptorPtr->pEncodings, i = 0;
- i < adaptorPtr->nEncodings; pe++, i++, encodingPtr++)
- {
+ for(pe = pEncode, encodingPtr = adaptorPtr->pEncodings, i = 0;
+ i < adaptorPtr->nEncodings; pe++, i++, encodingPtr++)
+ {
pe->id = encodingPtr->id;
pe->pScreen = pScreen;
if((pe->name = xalloc(strlen(encodingPtr->name) + 1)))
- strcpy(pe->name, encodingPtr->name);
+ strcpy(pe->name, encodingPtr->name);
pe->width = encodingPtr->width;
pe->height = encodingPtr->height;
pe->rate.numerator = encodingPtr->rate.numerator;
pe->rate.denominator = encodingPtr->rate.denominator;
}
pa->nEncodings = adaptorPtr->nEncodings;
- pa->pEncodings = pEncode;
- }
+ pa->pEncodings = pEncode;
+ }
if(adaptorPtr->nImages &&
- (pImage = xcalloc(adaptorPtr->nImages, sizeof(XvImageRec)))) {
+ (pImage = xcalloc(adaptorPtr->nImages, sizeof(XvImageRec)))) {
- for(i = 0, pi = pImage, imagePtr = adaptorPtr->pImages;
- i < adaptorPtr->nImages; i++, pi++, imagePtr++)
- {
+ for(i = 0, pi = pImage, imagePtr = adaptorPtr->pImages;
+ i < adaptorPtr->nImages; i++, pi++, imagePtr++)
+ {
pi->id = imagePtr->id;
pi->type = imagePtr->type;
pi->byte_order = imagePtr->byte_order;
@@ -425,7 +476,7 @@ xf86XVInitAdaptors(
pi->vert_v_period = imagePtr->vert_v_period;
memcpy(pi->component_order, imagePtr->component_order, 32);
pi->scanline_order = imagePtr->scanline_order;
- }
+ }
pa->nImages = adaptorPtr->nImages;
pa->pImages = pImage;
}
@@ -433,65 +484,65 @@ xf86XVInitAdaptors(
if(adaptorPtr->nAttributes &&
(pAttribute = xcalloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec))))
{
- for(pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = 0;
- i < adaptorPtr->nAttributes; pat++, i++, attributePtr++)
- {
+ for(pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = 0;
+ i < adaptorPtr->nAttributes; pat++, i++, attributePtr++)
+ {
pat->flags = attributePtr->flags;
pat->min_value = attributePtr->min_value;
pat->max_value = attributePtr->max_value;
if((pat->name = xalloc(strlen(attributePtr->name) + 1)))
- strcpy(pat->name, attributePtr->name);
+ strcpy(pat->name, attributePtr->name);
}
pa->nAttributes = adaptorPtr->nAttributes;
- pa->pAttributes = pAttribute;
- }
+ pa->pAttributes = pAttribute;
+ }
totFormat = adaptorPtr->nFormats;
if(!(pFormat = xcalloc(totFormat, sizeof(XvFormatRec)))) {
- xf86XVFreeAdaptor(pa);
- continue;
+ xf86XVFreeAdaptor(pa);
+ continue;
}
- for(pf = pFormat, i = 0, numFormat = 0, formatPtr = adaptorPtr->pFormats;
- i < adaptorPtr->nFormats; i++, formatPtr++)
+ for(pf = pFormat, i = 0, numFormat = 0, formatPtr = adaptorPtr->pFormats;
+ i < adaptorPtr->nFormats; i++, formatPtr++)
{
numVisuals = pScreen->numVisuals;
- pVisual = pScreen->visuals;
+ pVisual = pScreen->visuals;
- while(numVisuals--) {
- if((pVisual->class == formatPtr->class) &&
- (pVisual->nplanes == formatPtr->depth)) {
+ while(numVisuals--) {
+ if((pVisual->class == formatPtr->class) &&
+ (pVisual->nplanes == formatPtr->depth)) {
if(numFormat >= totFormat) {
- void *moreSpace;
+ void *moreSpace;
totFormat *= 2;
- moreSpace = xrealloc(pFormat,
+ moreSpace = xrealloc(pFormat,
totFormat * sizeof(XvFormatRec));
if(!moreSpace) break;
pFormat = moreSpace;
pf = pFormat + numFormat;
}
- pf->visual = pVisual->vid;
+ pf->visual = pVisual->vid;
pf->depth = formatPtr->depth;
pf++;
numFormat++;
- }
- pVisual++;
- }
+ }
+ pVisual++;
+ }
}
pa->nFormats = numFormat;
- pa->pFormats = pFormat;
+ pa->pFormats = pFormat;
if(!numFormat) {
- xf86XVFreeAdaptor(pa);
- continue;
+ xf86XVFreeAdaptor(pa);
+ continue;
}
if(!(adaptorPriv = xcalloc(1, sizeof(XvAdaptorRecPrivate)))) {
- xf86XVFreeAdaptor(pa);
- continue;
+ xf86XVFreeAdaptor(pa);
+ continue;
}
adaptorPriv->flags = adaptorPtr->flags;
@@ -510,47 +561,47 @@ xf86XVInitAdaptors(
pa->devPriv.ptr = (pointer)adaptorPriv;
if(!(pPort = xcalloc(adaptorPtr->nPorts, sizeof(XvPortRec)))) {
- xf86XVFreeAdaptor(pa);
- continue;
+ xf86XVFreeAdaptor(pa);
+ continue;
}
- for(pp = pPort, i = 0, numPort = 0;
+ for(pp = pPort, i = 0, numPort = 0;
i < adaptorPtr->nPorts; i++) {
- if(!(pp->id = FakeClientID(0)))
+ if(!(pp->id = FakeClientID(0)))
continue;
- if(!(portPriv = xcalloc(1, sizeof(XvPortRecPrivate))))
+ if(!(portPriv = xcalloc(1, sizeof(XvPortRecPrivate))))
continue;
-
+
if(!AddResource(pp->id, PortResource, pp)) {
xfree(portPriv);
continue;
}
- pp->pAdaptor = pa;
- pp->pNotify = (XvPortNotifyPtr)NULL;
- pp->pDraw = (DrawablePtr)NULL;
- pp->client = (ClientPtr)NULL;
- pp->grab.client = (ClientPtr)NULL;
- pp->time = currentTime;
- pp->devPriv.ptr = portPriv;
+ pp->pAdaptor = pa;
+ pp->pNotify = (XvPortNotifyPtr)NULL;
+ pp->pDraw = (DrawablePtr)NULL;
+ pp->client = (ClientPtr)NULL;
+ pp->grab.client = (ClientPtr)NULL;
+ pp->time = currentTime;
+ pp->devPriv.ptr = portPriv;
portPriv->pScrn = pScrn;
portPriv->AdaptorRec = adaptorPriv;
- portPriv->DevPriv.ptr = adaptorPtr->pPortPrivates[i].ptr;
-
- pp++;
- numPort++;
+ portPriv->DevPriv.ptr = adaptorPtr->pPortPrivates[i].ptr;
+
+ pp++;
+ numPort++;
}
pa->nPorts = numPort;
pa->pPorts = pPort;
if(!numPort) {
- xf86XVFreeAdaptor(pa);
- continue;
+ xf86XVFreeAdaptor(pa);
+ continue;
}
pa->base_id = pPort->id;
-
+
pa++;
numAdaptor++;
}
@@ -576,23 +627,25 @@ xf86XVInitAdaptors(
the GC and used it's clip list when they needed to reclip the window,
even if the client clip was different from the one the video was
initialized with. If the original GC was destroyed, they had to stop
- the video. I like the new method better (MArk).
+ the video. I like the new method better (MArk).
This function only works for windows. Will need to rewrite when
(if) we support pixmap rendering.
*/
-static void
+static void
xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
{
RegionPtr pregWin, pCompositeClip;
WindowPtr pWin;
- Bool freeCompClip = FALSE;
+ ScreenPtr pScreen;
+ Bool freeCompClip = FALSE;
if(portPriv->pCompositeClip)
return;
pWin = (WindowPtr)portPriv->pDraw;
+ pScreen = pWin->drawable.pScreen;
/* get window clip list */
if(portPriv->subWindowMode == IncludeInferiors) {
@@ -607,19 +660,19 @@ xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
return;
}
- pCompositeClip = REGION_CREATE(pWin->pScreen, NullBox, 1);
- REGION_COPY(pWin->pScreen, pCompositeClip, portPriv->clientClip);
- REGION_TRANSLATE(pWin->pScreen, pCompositeClip,
+ pCompositeClip = REGION_CREATE(pScreen, NullBox, 1);
+ REGION_COPY(pScreen, pCompositeClip, portPriv->clientClip);
+ REGION_TRANSLATE(pScreen, pCompositeClip,
portPriv->pDraw->x + portPriv->clipOrg.x,
portPriv->pDraw->y + portPriv->clipOrg.y);
- REGION_INTERSECT(pWin->pScreen, pCompositeClip, pregWin, pCompositeClip);
+ REGION_INTERSECT(pScreen, pCompositeClip, pregWin, pCompositeClip);
portPriv->pCompositeClip = pCompositeClip;
portPriv->FreeCompositeClip = TRUE;
if(freeCompClip) {
- REGION_DESTROY(pWin->pScreen, pregWin);
- }
+ REGION_DESTROY(pScreen, pregWin);
+ }
}
/* Save the current clientClip and update the CompositeClip whenever
@@ -627,23 +680,25 @@ xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
static void
xf86XVCopyClip(
- XvPortRecPrivatePtr portPriv,
+ XvPortRecPrivatePtr portPriv,
GCPtr pGC
){
+ ScreenPtr pScreen = pGC->pScreen;
+
/* copy the new clip if it exists */
if((pGC->clientClipType == CT_REGION) && pGC->clientClip) {
if(!portPriv->clientClip)
- portPriv->clientClip = REGION_CREATE(pGC->pScreen, NullBox, 1);
+ portPriv->clientClip = REGION_CREATE(pScreen, NullBox, 1);
/* Note: this is in window coordinates */
- REGION_COPY(pGC->pScreen, portPriv->clientClip, pGC->clientClip);
+ REGION_COPY(pScreen, portPriv->clientClip, pGC->clientClip);
} else if(portPriv->clientClip) { /* free the old clientClip */
- REGION_DESTROY(pGC->pScreen, portPriv->clientClip);
+ REGION_DESTROY(pScreen, portPriv->clientClip);
portPriv->clientClip = NULL;
}
/* get rid of the old clip list */
if(portPriv->pCompositeClip && portPriv->FreeCompositeClip) {
- REGION_DESTROY(pWin->pScreen, portPriv->pCompositeClip);
+ REGION_DESTROY(pScreen, portPriv->pCompositeClip);
}
portPriv->clipOrg = pGC->clipOrg;
@@ -670,12 +725,12 @@ xf86XVRegetVideo(XvPortRecPrivatePtr portPriv)
WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
WinBox.x2 = WinBox.x1 + portPriv->drw_w;
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
-
+
/* clip to the window composite clip */
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
- REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
- REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
-
+ REGION_NULL(pScreen, &ClipRegion);
+ REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
+
/* that's all if it's totally obscured */
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
clippedAway = TRUE;
@@ -686,11 +741,11 @@ xf86XVRegetVideo(XvPortRecPrivatePtr portPriv)
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
}
- ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->pScrn,
- portPriv->vid_x, portPriv->vid_y,
- WinBox.x1, WinBox.y1,
- portPriv->vid_w, portPriv->vid_h,
- portPriv->drw_w, portPriv->drw_h,
+ ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->pScrn,
+ portPriv->vid_x, portPriv->vid_y,
+ WinBox.x1, WinBox.y1,
+ portPriv->vid_w, portPriv->vid_h,
+ portPriv->drw_w, portPriv->drw_h,
&ClipRegion, portPriv->DevPriv.ptr);
if(ret == Success)
@@ -734,27 +789,27 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
WinBox.x2 = WinBox.x1 + portPriv->drw_w;
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
-
+
/* clip to the window composite clip */
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
- REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
- REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
+ REGION_NULL(pScreen, &ClipRegion);
+ REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
/* clip and translate to the viewport */
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
RegionRec VPReg;
BoxRec VPBox;
- VPBox.x1 = portPriv->pScrn->frameX0;
+ VPBox.x1 = portPriv->pScrn->frameX0;
VPBox.y1 = portPriv->pScrn->frameY0;
- VPBox.x2 = portPriv->pScrn->frameX1;
+ VPBox.x2 = portPriv->pScrn->frameX1;
VPBox.y2 = portPriv->pScrn->frameY1;
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
- REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
+ REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
REGION_UNINIT(pScreen, &VPReg);
}
-
+
/* that's all if it's totally obscured */
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
clippedAway = TRUE;
@@ -765,8 +820,8 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
- (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
- (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
+ (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
+ (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
{
clippedAway = TRUE;
goto CLIP_VIDEO_BAILOUT;
@@ -777,11 +832,11 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
}
- ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->pScrn,
- portPriv->vid_x, portPriv->vid_y,
+ ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->pScrn,
+ portPriv->vid_x, portPriv->vid_y,
WinBox.x1, WinBox.y1,
- portPriv->vid_w, portPriv->vid_h,
- portPriv->drw_w, portPriv->drw_h,
+ portPriv->vid_w, portPriv->vid_h,
+ portPriv->drw_w, portPriv->drw_h,
&ClipRegion, portPriv->DevPriv.ptr);
if(ret == Success) portPriv->isOn = XV_ON;
@@ -823,27 +878,27 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv)
WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
WinBox.x2 = WinBox.x1 + portPriv->drw_w;
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
-
+
/* clip to the window composite clip */
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
- REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
- REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
+ REGION_NULL(pScreen, &ClipRegion);
+ REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
/* clip and translate to the viewport */
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
RegionRec VPReg;
BoxRec VPBox;
- VPBox.x1 = portPriv->pScrn->frameX0;
+ VPBox.x1 = portPriv->pScrn->frameX0;
VPBox.y1 = portPriv->pScrn->frameY0;
- VPBox.x2 = portPriv->pScrn->frameX1;
+ VPBox.x2 = portPriv->pScrn->frameX1;
VPBox.y2 = portPriv->pScrn->frameY1;
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
- REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
+ REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
REGION_UNINIT(pScreen, &VPReg);
}
-
+
/* that's all if it's totally obscured */
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
clippedAway = TRUE;
@@ -854,8 +909,8 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv)
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
- (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
- (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
+ (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
+ (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
{
clippedAway = TRUE;
goto CLIP_VIDEO_BAILOUT;
@@ -866,7 +921,7 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv)
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
}
- ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->pScrn,
+ ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->pScrn,
WinBox.x1, WinBox.y1,
&ClipRegion, portPriv->DevPriv.ptr);
@@ -910,7 +965,7 @@ xf86XVReputAllVideo(WindowPtr pWin, pointer data)
static int
xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
{
- XF86XVWindowPtr winPriv, PrivRoot;
+ XF86XVWindowPtr winPriv, PrivRoot;
winPriv = PrivRoot = GET_XF86XV_WINDOW(pWin);
@@ -927,7 +982,7 @@ xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
winPriv->PortRec = portPriv;
winPriv->next = PrivRoot;
pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv;
- }
+ }
return Success;
}
@@ -941,15 +996,15 @@ xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
while(winPriv) {
if(winPriv->PortRec == portPriv) {
- if(prevPriv)
+ if(prevPriv)
prevPriv->next = winPriv->next;
- else
- pWin->devPrivates[XF86XVWindowIndex].ptr =
+ else
+ pWin->devPrivates[XF86XVWindowIndex].ptr =
(pointer)winPriv->next;
xfree(winPriv);
break;
}
- prevPriv = winPriv;
+ prevPriv = winPriv;
winPriv = winPriv->next;
}
portPriv->pDraw = NULL;
@@ -1008,7 +1063,7 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
/* filter out XClearWindow/Area */
if (!pWin->valdata) return;
-
+
pPrev = NULL;
while(WinPriv) {
@@ -1019,10 +1074,10 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
switch(pPriv->type) {
case XvInputMask:
xf86XVReputVideo(pPriv);
- break;
+ break;
case XvOutputMask:
- xf86XVRegetVideo(pPriv);
- break;
+ xf86XVRegetVideo(pPriv);
+ break;
default: /* overlaid still/image*/
if (pPriv->AdaptorRec->ReputImage)
xf86XVReputImage(pPriv);
@@ -1036,8 +1091,8 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
}
pPriv->pDraw = NULL;
- if(!pPrev)
- pWin->devPrivates[XF86XVWindowIndex].ptr =
+ if(!pPrev)
+ pWin->devPrivates[XF86XVWindowIndex].ptr =
(pointer)(WinPriv->next);
else
pPrev->next = WinPriv->next;
@@ -1054,7 +1109,7 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
}
-static void
+static void
xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
@@ -1073,7 +1128,7 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
pPriv->pCompositeClip = NULL;
- /* Stop everything except images, but stop them too if the
+ /* Stop everything except images, but stop them too if the
window isn't visible. But we only remove the images. */
if(pPriv->type || !visible) {
@@ -1086,8 +1141,8 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
if(!pPriv->type) { /* overlaid still/image */
pPriv->pDraw = NULL;
- if(!pPrev)
- pWin->devPrivates[XF86XVWindowIndex].ptr =
+ if(!pPrev)
+ pWin->devPrivates[XF86XVWindowIndex].ptr =
(pointer)(WinPriv->next);
else
pPrev->next = WinPriv->next;
@@ -1122,6 +1177,9 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen)
XvAdaptorPtr pa;
int c;
+ /* Clear offscreen images */
+ (void)memset(&OffscreenImages[pScreen->myNum], 0, sizeof(OffscreenImages[0]));
+
if(!ScreenPriv) return TRUE;
if(ScreenPriv->videoGC) {
@@ -1133,20 +1191,16 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen)
pScreen->WindowExposures = ScreenPriv->WindowExposures;
pScreen->ClipNotify = ScreenPriv->ClipNotify;
- pScrn->EnterVT = ScreenPriv->EnterVT;
- pScrn->LeaveVT = ScreenPriv->LeaveVT;
+ pScrn->EnterVT = ScreenPriv->EnterVT;
+ pScrn->LeaveVT = ScreenPriv->LeaveVT;
pScrn->AdjustFrame = ScreenPriv->AdjustFrame;
- for(c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) {
+ for(c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) {
xf86XVFreeAdaptor(pa);
}
- if(pxvs->pAdaptors)
- xfree(pxvs->pAdaptors);
-
+ xfree(pxvs->pAdaptors);
xfree(ScreenPriv);
-
-
return TRUE;
}
@@ -1168,7 +1222,7 @@ xf86XVQueryAdaptors(
/**** ScrnInfoRec fields ****/
-static Bool
+static Bool
xf86XVEnterVT(int index, int flags)
{
ScreenPtr pScreen = screenInfo.screens[index];
@@ -1177,12 +1231,12 @@ xf86XVEnterVT(int index, int flags)
ret = (*ScreenPriv->EnterVT)(index, flags);
- if(ret) WalkTree(pScreen, xf86XVReputAllVideo, 0);
-
+ if(ret) WalkTree(pScreen, xf86XVReputAllVideo, 0);
+
return ret;
}
-static void
+static void
xf86XVLeaveVT(int index, int flags)
{
ScreenPtr pScreen = screenInfo.screens[index];
@@ -1229,14 +1283,14 @@ xf86XVAdjustFrame(int index, int x, int y, int flags)
WindowPtr pWin;
XvAdaptorPtr pa;
int c, i;
-
+
if(ScreenPriv->AdjustFrame) {
pScrn->AdjustFrame = ScreenPriv->AdjustFrame;
(*pScrn->AdjustFrame)(index, x, y, flags);
pScrn->AdjustFrame = xf86XVAdjustFrame;
}
-
- for(c = pxvs->nAdaptors, pa = pxvs->pAdaptors; c > 0; c--, pa++) {
+
+ for(c = pxvs->nAdaptors, pa = pxvs->pAdaptors; c > 0; c--, pa++) {
XvPortPtr pPort = pa->pPorts;
XvPortRecPrivatePtr pPriv;
@@ -1254,7 +1308,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags)
if ((pPriv->AdaptorRec->ReputImage) &&
((pWin->visibility == VisibilityUnobscured) ||
- (pWin->visibility == VisibilityPartiallyObscured)))
+ (pWin->visibility == VisibilityPartiallyObscured)))
{
xf86XVReputImage(pPriv);
} else {
@@ -1297,8 +1351,8 @@ xf86XVPutVideo(
DrawablePtr pDraw,
XvPortPtr pPort,
GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
+ INT16 vid_x, INT16 vid_y,
+ CARD16 vid_w, CARD16 vid_h,
INT16 drw_x, INT16 drw_y,
CARD16 drw_w, CARD16 drw_h
){
@@ -1310,7 +1364,7 @@ xf86XVPutVideo(
pPort->pDraw = (DrawablePtr)NULL;
return BadAlloc;
}
-
+
/* If we are changing windows, unregister our port in the old window */
if(portPriv->pDraw && (portPriv->pDraw != pDraw))
xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
@@ -1333,7 +1387,7 @@ xf86XVPutVideo(
/* To indicate to the DI layer that we were successful */
pPort->pDraw = pDraw;
-
+
if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
return(xf86XVReputVideo(portPriv));
@@ -1345,8 +1399,8 @@ xf86XVPutStill(
DrawablePtr pDraw,
XvPortPtr pPort,
GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
+ INT16 vid_x, INT16 vid_y,
+ CARD16 vid_w, CARD16 vid_h,
INT16 drw_x, INT16 drw_y,
CARD16 drw_w, CARD16 drw_h
){
@@ -1369,22 +1423,22 @@ xf86XVPutStill(
WinBox.y1 = pDraw->y + drw_y;
WinBox.x2 = WinBox.x1 + drw_w;
WinBox.y2 = WinBox.y1 + drw_h;
-
+
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
- REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
- REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
+ REGION_NULL(pScreen, &ClipRegion);
+ REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
RegionRec VPReg;
BoxRec VPBox;
- VPBox.x1 = portPriv->pScrn->frameX0;
+ VPBox.x1 = portPriv->pScrn->frameX0;
VPBox.y1 = portPriv->pScrn->frameY0;
- VPBox.x2 = portPriv->pScrn->frameX1;
+ VPBox.x2 = portPriv->pScrn->frameX1;
VPBox.y2 = portPriv->pScrn->frameY1;
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
- REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
+ REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
REGION_UNINIT(pScreen, &VPReg);
}
@@ -1400,11 +1454,11 @@ xf86XVPutStill(
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
- (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
+ (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
{
clippedAway = TRUE;
- goto PUT_STILL_BAILOUT;
+ goto PUT_STILL_BAILOUT;
}
}
@@ -1412,7 +1466,7 @@ xf86XVPutStill(
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
}
- ret = (*portPriv->AdaptorRec->PutStill)(portPriv->pScrn,
+ ret = (*portPriv->AdaptorRec->PutStill)(portPriv->pScrn,
vid_x, vid_y, WinBox.x1, WinBox.y1,
vid_w, vid_h, drw_w, drw_h,
&ClipRegion, portPriv->DevPriv.ptr);
@@ -1433,9 +1487,9 @@ xf86XVPutStill(
PUT_STILL_BAILOUT:
if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
- (*portPriv->AdaptorRec->StopVideo)(
- portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
- portPriv->isOn = XV_PENDING;
+ (*portPriv->AdaptorRec->StopVideo)(
+ portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
+ portPriv->isOn = XV_PENDING;
}
REGION_UNINIT(pScreen, &WinRegion);
@@ -1450,8 +1504,8 @@ xf86XVGetVideo(
DrawablePtr pDraw,
XvPortPtr pPort,
GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
+ INT16 vid_x, INT16 vid_y,
+ CARD16 vid_w, CARD16 vid_h,
INT16 drw_x, INT16 drw_y,
CARD16 drw_w, CARD16 drw_h
){
@@ -1463,7 +1517,7 @@ xf86XVGetVideo(
pPort->pDraw = (DrawablePtr)NULL;
return BadAlloc;
}
-
+
/* If we are changing windows, unregister our port in the old window */
if(portPriv->pDraw && (portPriv->pDraw != pDraw))
xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
@@ -1486,7 +1540,7 @@ xf86XVGetVideo(
/* To indicate to the DI layer that we were successful */
pPort->pDraw = pDraw;
-
+
if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
return(xf86XVRegetVideo(portPriv));
@@ -1498,8 +1552,8 @@ xf86XVGetStill(
DrawablePtr pDraw,
XvPortPtr pPort,
GCPtr pGC,
- INT16 vid_x, INT16 vid_y,
- CARD16 vid_w, CARD16 vid_h,
+ INT16 vid_x, INT16 vid_y,
+ CARD16 vid_w, CARD16 vid_h,
INT16 drw_x, INT16 drw_y,
CARD16 drw_w, CARD16 drw_h
){
@@ -1522,10 +1576,10 @@ xf86XVGetStill(
WinBox.y1 = pDraw->y + drw_y;
WinBox.x2 = WinBox.x1 + drw_w;
WinBox.y2 = WinBox.y1 + drw_h;
-
+
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
- REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
- REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
+ REGION_NULL(pScreen, &ClipRegion);
+ REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
if(portPriv->pDraw) {
xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
@@ -1548,9 +1602,9 @@ xf86XVGetStill(
GET_STILL_BAILOUT:
if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
- (*portPriv->AdaptorRec->StopVideo)(
- portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
- portPriv->isOn = XV_PENDING;
+ (*portPriv->AdaptorRec->StopVideo)(
+ portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
+ portPriv->isOn = XV_PENDING;
}
REGION_UNINIT(pScreen, &WinRegion);
@@ -1559,7 +1613,7 @@ GET_STILL_BAILOUT:
return ret;
}
-
+
static int
xf86XVStopVideo(
@@ -1571,7 +1625,7 @@ xf86XVStopVideo(
if(pDraw->type != DRAWABLE_WINDOW)
return BadAlloc;
-
+
xf86XVRemovePortFromWindow((WindowPtr)pDraw, portPriv);
if(!portPriv->pScrn->vtSema) return Success; /* Success ? */
@@ -1595,8 +1649,8 @@ xf86XVSetPortAttribute(
INT32 value
){
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-
- return((*portPriv->AdaptorRec->SetPortAttribute)(portPriv->pScrn,
+
+ return((*portPriv->AdaptorRec->SetPortAttribute)(portPriv->pScrn,
attribute, value, portPriv->DevPriv.ptr));
}
@@ -1609,8 +1663,8 @@ xf86XVGetPortAttribute(
INT32 *p_value
){
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-
- return((*portPriv->AdaptorRec->GetPortAttribute)(portPriv->pScrn,
+
+ return((*portPriv->AdaptorRec->GetPortAttribute)(portPriv->pScrn,
attribute, p_value, portPriv->DevPriv.ptr));
}
@@ -1626,8 +1680,8 @@ xf86XVQueryBestSize(
unsigned int *p_w, unsigned int *p_h
){
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
-
- (*portPriv->AdaptorRec->QueryBestSize)(portPriv->pScrn,
+
+ (*portPriv->AdaptorRec->QueryBestSize)(portPriv->pScrn,
(Bool)motion, vid_w, vid_h, drw_w, drw_h,
p_w, p_h, portPriv->DevPriv.ptr);
@@ -1635,14 +1689,14 @@ xf86XVQueryBestSize(
}
-static int
+static int
xf86XVPutImage(
- ClientPtr client,
- DrawablePtr pDraw,
- XvPortPtr pPort,
+ ClientPtr client,
+ DrawablePtr pDraw,
+ XvPortPtr pPort,
GCPtr pGC,
- INT16 src_x, INT16 src_y,
- CARD16 src_w, CARD16 src_h,
+ INT16 src_x, INT16 src_y,
+ CARD16 src_w, CARD16 src_h,
INT16 drw_x, INT16 drw_y,
CARD16 drw_w, CARD16 drw_h,
XvImagePtr format,
@@ -1669,22 +1723,22 @@ xf86XVPutImage(
WinBox.y1 = pDraw->y + drw_y;
WinBox.x2 = WinBox.x1 + drw_w;
WinBox.y2 = WinBox.y1 + drw_h;
-
+
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
- REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
- REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
+ REGION_NULL(pScreen, &ClipRegion);
+ REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
RegionRec VPReg;
BoxRec VPBox;
- VPBox.x1 = portPriv->pScrn->frameX0;
+ VPBox.x1 = portPriv->pScrn->frameX0;
VPBox.y1 = portPriv->pScrn->frameY0;
- VPBox.x2 = portPriv->pScrn->frameX1 + 1;
+ VPBox.x2 = portPriv->pScrn->frameX1 + 1;
VPBox.y2 = portPriv->pScrn->frameY1 + 1;
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
- REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
+ REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
REGION_UNINIT(pScreen, &VPReg);
}
@@ -1700,11 +1754,11 @@ xf86XVPutImage(
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
- (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
+ (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
{
clippedAway = TRUE;
- goto PUT_IMAGE_BAILOUT;
+ goto PUT_IMAGE_BAILOUT;
}
}
@@ -1712,7 +1766,7 @@ xf86XVPutImage(
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
}
- ret = (*portPriv->AdaptorRec->PutImage)(portPriv->pScrn,
+ ret = (*portPriv->AdaptorRec->PutImage)(portPriv->pScrn,
src_x, src_y, WinBox.x1, WinBox.y1,
src_w, src_h, drw_w, drw_h, format->id, data, width, height,
sync, &ClipRegion, portPriv->DevPriv.ptr);
@@ -1733,9 +1787,9 @@ xf86XVPutImage(
PUT_IMAGE_BAILOUT:
if((clippedAway || (ret != Success)) && (portPriv->isOn == XV_ON)) {
- (*portPriv->AdaptorRec->StopVideo)(
- portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
- portPriv->isOn = XV_PENDING;
+ (*portPriv->AdaptorRec->StopVideo)(
+ portPriv->pScrn, portPriv->DevPriv.ptr, FALSE);
+ portPriv->isOn = XV_PENDING;
}
REGION_UNINIT(pScreen, &WinRegion);
@@ -1745,19 +1799,19 @@ PUT_IMAGE_BAILOUT:
}
-static int
+static int
xf86XVQueryImageAttributes(
- ClientPtr client,
+ ClientPtr client,
XvPortPtr pPort,
- XvImagePtr format,
- CARD16 *width,
- CARD16 *height,
+ XvImagePtr format,
+ CARD16 *width,
+ CARD16 *height,
int *pitches,
int *offsets
){
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
- return (*portPriv->AdaptorRec->QueryImageAttributes)(portPriv->pScrn,
+ return (*portPriv->AdaptorRec->QueryImageAttributes)(portPriv->pScrn,
format->id, width, height, pitches, offsets);
}
@@ -1778,7 +1832,7 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
pval[0] = key;
pval[1] = IncludeInferiors;
ScreenPriv->videoGC = CreateGC(root, GCForeground | GCSubwindowMode,
- pval, &status);
+ pval, &status);
if(!ScreenPriv->videoGC) return;
ValidateGC(root, ScreenPriv->videoGC);
} else if (key != ScreenPriv->videoGC->fgPixel){
@@ -1795,20 +1849,20 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
rects[i].width = pbox->x2 - pbox->x1;
rects[i].height = pbox->y2 - pbox->y1;
}
-
+
(*ScreenPriv->videoGC->ops->PolyFillRect)(
- root, ScreenPriv->videoGC, nbox, rects);
+ root, ScreenPriv->videoGC, nbox, rects);
DEALLOCATE_LOCAL(rects);
}
-/* xf86XVClipVideoHelper -
+/* xf86XVClipVideoHelper -
Takes the dst box in standard X BoxRec form (top and left
edges inclusive, bottom and right exclusive). The new dst
- box is returned. The source boundaries are given (x1, y1
- inclusive, x2, y2 exclusive) and returned are the new source
- boundaries in 16.16 fixed point.
+ box is returned. The source boundaries are given (x1, y1
+ inclusive, x2, y2 exclusive) and returned are the new source
+ boundaries in 16.16 fixed point.
*/
#define DummyScreen screenInfo.screens[0]
@@ -1824,112 +1878,169 @@ xf86XVClipVideoHelper(
INT32 width,
INT32 height
){
- INT32 vscale, hscale, delta;
+ double xsw, xdw, ysw, ydw;
+ INT32 delta;
BoxPtr extents = REGION_EXTENTS(DummyScreen, reg);
int diff;
- hscale = ((*xb - *xa) << 16) / (dst->x2 - dst->x1);
- vscale = ((*yb - *ya) << 16) / (dst->y2 - dst->y1);
+ xsw = (*xb - *xa) << 16;
+ xdw = dst->x2 - dst->x1;
+ ysw = (*yb - *ya) << 16;
+ ydw = dst->y2 - dst->y1;
*xa <<= 16; *xb <<= 16;
*ya <<= 16; *yb <<= 16;
diff = extents->x1 - dst->x1;
- if(diff > 0) {
- dst->x1 = extents->x1;
- *xa += diff * hscale;
+ if (diff > 0) {
+ dst->x1 = extents->x1;
+ *xa += (diff * xsw) / xdw;
}
diff = dst->x2 - extents->x2;
- if(diff > 0) {
- dst->x2 = extents->x2;
- *xb -= diff * hscale;
+ if (diff > 0) {
+ dst->x2 = extents->x2;
+ *xb -= (diff * xsw) / xdw;
}
diff = extents->y1 - dst->y1;
- if(diff > 0) {
- dst->y1 = extents->y1;
- *ya += diff * vscale;
+ if (diff > 0) {
+ dst->y1 = extents->y1;
+ *ya += (diff * ysw) / ydw;
}
diff = dst->y2 - extents->y2;
- if(diff > 0) {
- dst->y2 = extents->y2;
- *yb -= diff * vscale;
+ if (diff > 0) {
+ dst->y2 = extents->y2;
+ *yb -= (diff * ysw) / ydw;
}
- if(*xa < 0) {
- diff = (- *xa + hscale - 1)/ hscale;
- dst->x1 += diff;
- *xa += diff * hscale;
+ if (*xa < 0) {
+ diff = (((-*xa) * xdw) + xsw - 1) / xsw;
+ dst->x1 += diff;
+ *xa += (diff * xsw) / xdw;
}
delta = *xb - (width << 16);
- if(delta > 0) {
- diff = (delta + hscale - 1)/ hscale;
- dst->x2 -= diff;
- *xb -= diff * hscale;
+ if (delta > 0) {
+ diff = ((delta * xdw) + xsw - 1) / xsw;
+ dst->x2 -= diff;
+ *xb -= (diff * xsw) / xdw;
}
- if(*xa >= *xb) return FALSE;
+ if (*xa >= *xb) return FALSE;
- if(*ya < 0) {
- diff = (- *ya + vscale - 1)/ vscale;
- dst->y1 += diff;
- *ya += diff * vscale;
+ if (*ya < 0) {
+ diff = (((-*ya) * ydw) + ysw - 1) / ysw;
+ dst->y1 += diff;
+ *ya += (diff * ysw) / ydw;
}
delta = *yb - (height << 16);
- if(delta > 0) {
- diff = (delta + vscale - 1)/ vscale;
- dst->y2 -= diff;
- *yb -= diff * vscale;
+ if (delta > 0) {
+ diff = ((delta * ydw) + ysw - 1) / ysw;
+ dst->y2 -= diff;
+ *yb -= (diff * ysw) / ydw;
}
- if(*ya >= *yb) return FALSE;
+ if (*ya >= *yb) return FALSE;
- if((dst->x1 != extents->x1) || (dst->x2 != extents->x2) ||
- (dst->y1 != extents->y1) || (dst->y2 != extents->y2))
+ if ((dst->x1 > extents->x1) || (dst->x2 < extents->x2) ||
+ (dst->y1 > extents->y1) || (dst->y2 < extents->y2))
{
- RegionRec clipReg;
- REGION_INIT(DummyScreen, &clipReg, dst, 1);
- REGION_INTERSECT(DummyScreen, reg, reg, &clipReg);
- REGION_UNINIT(DummyScreen, &clipReg);
+ RegionRec clipReg;
+ REGION_INIT(DummyScreen, &clipReg, dst, 1);
+ REGION_INTERSECT(DummyScreen, reg, reg, &clipReg);
+ REGION_UNINIT(DummyScreen, &clipReg);
}
return TRUE;
}
+void
+xf86XVCopyYUV12ToPacked(
+ const void *srcy,
+ const void *srcv,
+ const void *srcu,
+ void *dst,
+ int srcPitchy,
+ int srcPitchuv,
+ int dstPitch,
+ int h,
+ int w
+){
+ CARD32 *Dst;
+ const CARD8 *Y, *U, *V;
+ int i, j;
-/**************** Offscreen surface stuff *******************/
-
-typedef struct {
- XF86OffscreenImagePtr images;
- int num;
-} OffscreenImageRec;
+ w >>= 1;
+
+ for (j = 0; j < h; j++) {
+ Dst = dst;
+ Y = srcy; V = srcv; U = srcu;
+ i = w;
+ while (i >= 4) {
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ Dst[0] = Y[0] | (Y[1] << 16) | (U[0] << 8) | (V[0] << 24);
+ Dst[1] = Y[2] | (Y[3] << 16) | (U[1] << 8) | (V[1] << 24);
+ Dst[2] = Y[4] | (Y[5] << 16) | (U[2] << 8) | (V[2] << 24);
+ Dst[3] = Y[6] | (Y[7] << 16) | (U[3] << 8) | (V[3] << 24);
+#else
+ /* This assumes a little-endian framebuffer */
+ Dst[0] = (Y[0] << 24) | (Y[1] << 8) | (U[0] << 16) | Y[0];
+ Dst[1] = (Y[2] << 24) | (Y[3] << 8) | (U[1] << 16) | Y[1];
+ Dst[2] = (Y[4] << 24) | (Y[5] << 8) | (U[2] << 16) | Y[2];
+ Dst[3] = (Y[6] << 24) | (Y[7] << 8) | (U[3] << 16) | Y[3];
+#endif
+ Dst += 4; Y += 8; V += 4; U += 4;
+ i -= 4;
+ }
-static OffscreenImageRec OffscreenImages[MAXSCREENS];
-static Bool offscreenInited = FALSE;
+ while (i--) {
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ Dst[0] = Y[0] | (Y[1] << 16) | (U[0] << 8) | (V[0] << 24);
+#else
+ /* This assumes a little-endian framebuffer */
+ Dst[0] = (Y[0] << 24) | (Y[1] << 8) | (U[0] << 16) | Y[0];
+#endif
+ Dst++; Y += 2; V++; U++;
+ }
-Bool
-xf86XVRegisterOffscreenImages(
- ScreenPtr pScreen,
- XF86OffscreenImagePtr images,
- int num
-){
- if(!offscreenInited) {
- bzero(OffscreenImages, sizeof(OffscreenImages[MAXSCREENS]));
- offscreenInited = TRUE;
+ dst = (CARD8 *)dst + dstPitch;
+ srcy = (const CARD8 *)srcy + srcPitchy;
+ if (j & 1) {
+ srcu = (const CARD8 *)srcu + srcPitchuv;
+ srcv = (const CARD8 *)srcv + srcPitchuv;
+ }
}
-
- OffscreenImages[pScreen->myNum].num = num;
- OffscreenImages[pScreen->myNum].images = images;
-
- return TRUE;
}
-XF86OffscreenImagePtr
-xf86XVQueryOffscreenImages(
- ScreenPtr pScreen,
- int *num
+void
+xf86XVCopyPacked(
+ const void *src,
+ void *dst,
+ int srcPitch,
+ int dstPitch,
+ int h,
+ int w
){
- if(!offscreenInited) {
- *num = 0;
- return NULL;
- }
-
- *num = OffscreenImages[pScreen->myNum].num;
- return OffscreenImages[pScreen->myNum].images;
+ const CARD32 *Src;
+ CARD32 *Dst;
+ int i;
+
+ w >>= 1;
+ while (--h >= 0) {
+ do {
+ Dst = dst; Src = src;
+ i = w;
+ while (i >= 4) {
+ Dst[0] = Src[0];
+ Dst[1] = Src[1];
+ Dst[2] = Src[2];
+ Dst[3] = Src[3];
+ Dst += 4; Src += 4; i -= 4;
+ }
+ if (!i) break;
+ Dst[0] = Src[0];
+ if (i == 1) break;
+ Dst[1] = Src[1];
+ if (i == 2) break;
+ Dst[2] = Src[2];
+ } while (0);
+
+ src = (const CARD8 *)src + srcPitch;
+ dst = (CARD8 *)dst + dstPitch;
+ }
}
diff --git a/hw/xfree86/common/xf86xv.h b/hw/xfree86/common/xf86xv.h
index 9fd6b4edf..316d6c9e5 100644
--- a/hw/xfree86/common/xf86xv.h
+++ b/hw/xfree86/common/xf86xv.h
@@ -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 ***/
-
-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;
+void
+xf86XVCopyYUV12ToPacked(
+ const void *srcy,
+ const void *srcv,
+ const void *srcu,
+ void *dst,
+ int srcPitchy,
+ int srcPitchuv,
+ int dstPitch,
+ int h,
+ int w
+);
-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_ */
diff --git a/hw/xfree86/common/xf86xvmc.c b/hw/xfree86/common/xf86xvmc.c
index 4559359ec..832861ea4 100644
--- a/hw/xfree86/common/xf86xvmc.c
+++ b/hw/xfree86/common/xf86xvmc.c
@@ -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);
+}
diff --git a/hw/xfree86/common/xf86xvmc.h b/hw/xfree86/common/xf86xvmc.h
index 074edbebe..0b073aac8 100644
--- a/hw/xfree86/common/xf86xvmc.h
+++ b/hw/xfree86/common/xf86xvmc.h
@@ -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 */
diff --git a/hw/xfree86/common/xisb.c b/hw/xfree86/common/xisb.c
index 4132c7abf..facc27842 100644
--- a/hw/xfree86/common/xisb.c
+++ b/hw/xfree86/common/xisb.c
@@ -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>
diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c
index d779834c2..666dfc632 100644
--- a/hw/xfree86/ddc/ddcProperty.c
+++ b/hw/xfree86/ddc/ddcProperty.c
@@ -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;
diff --git a/hw/xfree86/ddc/print_edid.c b/hw/xfree86/ddc/print_edid.c
index 3451e52f6..064533800 100644
--- a/hw/xfree86/ddc/print_edid.c
+++ b/hw/xfree86/ddc/print_edid.c
@@ -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);
}
diff --git a/hw/xfree86/ddc/print_vdif.c b/hw/xfree86/ddc/print_vdif.c
index c65d1a0c9..fbb540e1d 100644
--- a/hw/xfree86/ddc/print_vdif.c
+++ b/hw/xfree86/ddc/print_vdif.c
@@ -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"
diff --git a/hw/xfree86/ddc/vdif.h b/hw/xfree86/ddc/vdif.h
index 38026e56a..8d358613e 100644
--- a/hw/xfree86/ddc/vdif.h
+++ b/hw/xfree86/ddc/vdif.h
@@ -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
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
index 736fb741b..496f3573f 100644
--- a/hw/xfree86/ddc/xf86DDC.c
+++ b/hw/xfree86/ddc/xf86DDC.c
@@ -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;
}
-
-
diff --git a/hw/xfree86/dixmods/extmod/dgaproc.h b/hw/xfree86/dixmods/extmod/dgaproc.h
index 2b0118f15..a0108053c 100644
--- a/hw/xfree86/dixmods/extmod/dgaproc.h
+++ b/hw/xfree86/dixmods/extmod/dgaproc.h
@@ -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
diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c
index d97b88fa4..dc76cbf21 100644
--- a/hw/xfree86/dixmods/extmod/modinit.c
+++ b/hw/xfree86/dixmods/extmod/modinit.c
@@ -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,113 +31,9 @@
#include "Xproto.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
+#include "modinit.h"
-#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
+static MODULESETUPPROTO(extmodSetup);
/*
* Array describing extensions to be initialized
diff --git a/hw/xfree86/dixmods/extmod/xf86dga.c b/hw/xfree86/dixmods/extmod/xf86dga.c
index 9593c4a40..973f54e23 100644
--- a/hw/xfree86/dixmods/extmod/xf86dga.c
+++ b/hw/xfree86/dixmods/extmod/xf86dga.c
@@ -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);
diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c
index c0d51b809..2556743bb 100644
--- a/hw/xfree86/dixmods/extmod/xf86dga2.c
+++ b/hw/xfree86/dixmods/extmod/xf86dga2.c
@@ -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;
}
diff --git a/hw/xfree86/dixmods/extmod/xf86misc.c b/hw/xfree86/dixmods/extmod/xf86misc.c
index bc8e94b45..620761742 100644
--- a/hw/xfree86/dixmods/extmod/xf86misc.c
+++ b/hw/xfree86/dixmods/extmod/xf86misc.c
@@ -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;
@@ -555,6 +558,59 @@ ProcXF86MiscGetFilePaths(client)
}
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;
@@ -724,6 +782,17 @@ SProcXF86MiscGetFilePaths(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;
diff --git a/hw/xfree86/dixmods/extmod/xf86miscproc.h b/hw/xfree86/dixmods/extmod/xf86miscproc.h
index 63db938d1..208260947 100644
--- a/hw/xfree86/dixmods/extmod/xf86miscproc.h
+++ b/hw/xfree86/dixmods/extmod/xf86miscproc.h
@@ -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
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index f9882f2f1..f4751a1c7 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -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) {
diff --git a/hw/xfree86/dixmods/ftmodule.c b/hw/xfree86/dixmods/ftmodule.c
index e44c94984..ceb5485c0 100644
--- a/hw/xfree86/dixmods/ftmodule.c
+++ b/hw/xfree86/dixmods/ftmodule.c
@@ -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,
diff --git a/hw/xfree86/dixmods/glxmodule.c b/hw/xfree86/dixmods/glxmodule.c
index 513bb7647..f449d55ec 100644
--- a/hw/xfree86/dixmods/glxmodule.c
+++ b/hw/xfree86/dixmods/glxmodule.c
@@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
-/* $XFree86: xc/programs/Xserver/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
diff --git a/hw/xfree86/doc/README.DRI b/hw/xfree86/doc/README.DRI
index 66a5a5ff8..e663f2928 100644
--- a/hw/xfree86/doc/README.DRI
+++ b/hw/xfree86/doc/README.DRI
@@ -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 $
diff --git a/hw/xfree86/doc/README.fonts b/hw/xfree86/doc/README.fonts
index fb1c1f5fb..7563c1c56 100644
--- a/hw/xfree86/doc/README.fonts
+++ b/hw/xfree86/doc/README.fonts
@@ -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.
+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').
-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
+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 a pair of
+colons, or by setting the 'fn' TTCap option. For example,
- -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
-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.
+refers to face 1 in the `mincho.ttc' TrueType Collection file.
-4.2.2 About the FreeType backend
+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
-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').
+ option=value:
-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,
+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,
- :2:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
+ 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
-refers to face 2 in the `mincho.ttc' TrueType Collection file.
+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.
-
-X-TrueType extends the `fonts.dir' syntax with a number of options, collec-
-tively known as `TTCap'. A `TTCap' entry follows the general syntax
+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 ."
+
+4.2.3 Delayed glyph rasterisation
+
+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.
+
+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:
+
+ vl=n:luxirr.ttf -b&h-Luxi Serif-medium-r-normal--0-0-0-0-p-0-iso10646-1
+
+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
- :option=value:
-
-and should be specified before the filename.
+ -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
-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:
+or
- :fn=2:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-c-0-jisx0208.1990-0
+ fs=c:mincho.ttc -misc-mincho-medium-r-normal--0-0-0-0-p-0-jisx0208.1990-0
-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/>.
+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 $
diff --git a/hw/xfree86/doc/changelogs/CHANGELOG b/hw/xfree86/doc/changelogs/CHANGELOG
index 732330eec..78f7f2e84 100644
--- a/hw/xfree86/doc/changelogs/CHANGELOG
+++ b/hw/xfree86/doc/changelogs/CHANGELOG
@@ -1,46 +1,1696 @@
-XFree86 4.3.0.2 (xx May 2003)
+XFree86 4.3.99.17 (xx November 2003)
+
+XFree86 4.3.99.16 (20 November 2003)
+ 609. Fix 'constype' for modern framebuffers on Solaris (Bugzilla #890,
+ Alan Coopersmith).
+ 608. Fix a thread deadlock problem in libXp (Bugzilla #887, Roland Mainz).
+ 607. Fix event buffer overrun in the wacom driver (Bugzilla #882, David Dawes,
+ reported by Jonathan Hough).
+ 606. Add unmapping code to DGAUnmapPhysical() for most systems that use
+ mmap(). Without this lots of map/unmap calls would result in running
+ out of address space and/or file handles (Bugzilla #880, David Dawes,
+ reported by Eckhard Neber).
+ 605. Restore the Windows keycodes in the 'xfree86' XKB keycodes map,
+ and add the Solaris-compatible tokens as aliases (reported by
+ Panagiotis Papadakos).
+ 604. Fix some problems building against external installations of
+ freetype2 (David Dawes).
+ 603. Add font bounds checking to the X server side of the font server
+ interface (Chisato Yamauchi, David Dawes).
+ 602. Fix ForcePCIMode option to work as advertised in Radeon driver
+ (Bugzilla #850, Kevin Martin).
+ 601. Update the fonts document for the FreeType backend changes
+ (Chisato Yamauchi, Reiko Nakajima, After X-TT Project).
+ 600. Don't allow the lack of "SUPERSCRIPT TWO" to prevent Adobe Standard
+ Cyrillic encoded fonts from being accepted as "koi8" capable
+ (Michail Vidiassov).
+ 599. Xvfb didn't have enough pixmap formats for Render (David Dawes).
+ 598. Fix the processing of xdm/config/Xres.cpp, which is broken with
+ gcc 3.3.2 (reported by Chisato Yamauchi).
+ 597. Fix two problems with Xvfb:
+ - Too much memory was allocated because of a confusion between
+ bytes and pixels.
+ - The XWD header was corrupted at server reset.
+ (David Dawes).
+ 596. Fix several problems xwud has displaying TrueColor dumps (extreme
+ slowness displaying on TrueColor visuals, and incorrectness displaying
+ on DirectColor visuals) (David Dawes).
+ 595. Rank TrueColor above DirectColor in xwud. This avoids colourmap flashing
+ by default when running on a server with both visuals available
+ (David Dawes).
+ 594. Build with Xplugin support by default on Panther (Torrey T. Lyons).
+ 593. On Mac OS X, allow "X -version" to work without connecting to
+ CoreGraphics (Torrey T. Lyons, reported by Benjamin Reed).
+ 592. Don't optimize away window restacks in rootless mode (John Harper).
+ 591. Fix problems preventing mesa-based GLX from working with Xnest, even
+ though it is linked in and advertised (David Dawes).
+ 590. Fix typing in XDarwin Preference panel going to X11 (Torrey T. Lyons).
+ 589. Fix rootless build after REGION_* macro rework (Torrey T. Lyons).
+ 588. Fix broken GLX indirect rendering (David Dawes).
+ 587. Fix the XKB definitions for the "Hiragana_Katakana" key, and fix
+ some incorrect definitions in symbols/jp (Chisato Yamauchi).
+ 586. Change the mkfontdir wrapper script to invoke mkfontscale via its full
+ path name (Chisato Yamauchi).
+ 585. Modify xf86config and xf86cfg to enable loading the "freetype" module
+ (Chisato Yamauchi).
+ 584. Wrap ucs2any with ProgramTargetName in dependencies, as needed for
+ OS/2, and note that OS/2 doesn't have basename(3) (Bugzilla #871,
+ Frank Giessler).
+ 583. Fix atimisc's decoding of the mode on input for large panels
+ (Marc La France).
+ 582. Fix SEGV when ATIPreinit() fails (Marc La France).
+ 581. In rootless XDarwin, don't send ButtonPress events when clicking in
+ non-X11 windows (Torrey T. Lyons, John Harper).
+ 580. AppleWM compatibility fixes:
+ - Disable XDarwin handling cut and paste if AppleWM-aware cut and
+ paste manager is available.
+ - Set _NATIVE_SCREEN_ORIGIN property on root window.
+ (John Harper, Torrey T. Lyons).
+ 579. Change ProjectRoot from /XFree86 to /usr/X11R6 on OS/2 (Bugzilla #865,
+ Frank Giessler).
+ 578. Fix building of new Mesa on OS/2 (Bugzilla #865, Frank Giessler).
+ 577. Change the way how libraries with long file names are handed on
+ OS/2 (Bugzilla #865, Frank Giessler).
+ 576. Force screen blanking when entering DPMS states (Bugzilla #866,
+ David Dawes, reported by Ed Fardos).
+ 575. XDarwin fixes/cleanups:
+ - Handle X11 executables opened from the Finder.
+ - Use xcodebuild instead of pbxbuild on Panther.
+ - Clean up Darwin specific imake #defines.
+ - Fix compiler warnings on Panther.
+ (Torrey T. Lyons).
+ 574. A workaround for platforms (like *BSD) where IPv6 sockets don't accept
+ IPv4 connections: disable IPv6 XDMCP code by default. This allows IPv4
+ XDMCP to work on such platforms (David Dawes).
+ 573. Rework REGION_* macros to eliminate NEED_SCREEN_REGIONS build failures
+ (Marc La France).
+ 572. Fix an old bug in the X server and xfs related to usage of
+ c->savedName (Bugzilla #818, Owen Taylor).
+ 571. Fix FontFileListOneFontWithInfo() so that it handles aliases in the
+ same was as FontFileOpenFont() (Bugzilla #818, Owen Taylor).
+ 570. Respect USE_SSE_ASM for the .S files in the r200 and radeon 3D drivers.
+ This should fix the reported OpenBSD build problem (David Dawes).
+ 569. Some missing FreeBSD AMD64/Sparc64 patches (Bugzilla #786, Eric Anholt).
+ 568. The call to xf86RandRSetMode() from xf86RandRCreateScreenResources()
+ doesn't appear to be necessary. Removing it restores the documented
+ ViewPort behaviour when RandR is enabled (David Dawes).
+ 567. Make the vesa driver blank the screen during initialisation for
+ cosmetic reasons (David Dawes).
+ 566. Make the cirrus driver blank the screen during initialisation for
+ cosmetic reaons (most other drivers do this) (Bugzilla #781,
+ Nicholas Miell).
+ 565. The vesa driver wasn't setting the viewport correctly either at
+ ScreenInit or EnterVT (David Dawes).
+ 564. Fix the viewport initialisation. The ViewPort parameters from the
+ XF86Config file were being ignored, and the default was a 0,0 viewport
+ rather than centred on the virtual screen as documented. When RandR
+ is enabled, it undoes all of this though... (David Dawes).
+ 563. Fix an off-by-one bug in libXcursor that can result in segfaulting
+ applications (David Dawes, reported by Agustin Gianni).
+ 562. Fix RandR initialization problem when default screen resolution is
+ different from the virtual resolution. (Bugzilla #853, Bob Paauwe).
+ 561. Fix an Xv problem with the via driver where updating a portion of the
+ overlay causes excessive CPU usage (Bugzilla #821, Neil Terry).
+ 560. Fix an Xnest hang on OS/2 (Bugzilla #852, Frank Giessler).
+ 559. OS/2 update for the recent move to building most libraries shared,
+ and add some functions to the export lists for freetype and Xt for
+ compatibility with older applications (Bugzilla #852, Frank Giessler).
+ 558. Fix the installation location of the XRes and Xss manpage aliases
+ (Bugzilla #848, ISHIKAWA Mutsumi).
+ 557. Include backwards compatibility API for renamed stream functions in
+ Freetype2 library (Torrey T. Lyons).
+ 556. Fix acecad driver to call xf86DeleteInput() (Bugzilla #855, S. Voltz).
+ 555. Register to handle X11 executables on Panther (John Harper).
+ 554. Fixes for GLX on Mac OS X:
+ - Make libGL not export libGLU symbols.
+ - Fix uninitialized mutex for threaded direct GLX.
+ (John Harper).
+ 553. Fix "Non-aligned pointer being freed" warnings on XDarwin startup
+ (Torrey T. Lyons).
+ 552. Miscellaneous fixes for Panther:
+ - Fix spurious #pragma getting inserted by cpp (Martin Costabel).
+ - Fix startup failure due to bad keymapping file (Torrey T. Lyons).
+ - Fix startup warning about missing semicolons (Torrey T. Lyons).
+ 551. Mesa X86 asm build fix for Solaris (David Dawes).
+ 550. Fix building libOSMesa on Darwin (Torrey T. Lyons).
+ 549. Get backlight working on Apple's GeForce4 powerbooks (Guido Guenther).
+
+XFree86 4.3.99.15 ( 1 November 2003)
+ 548. Update libfreetype-xtt2 to version 1.1:
+ - Improved the very lazy method. To prevent displaying chipped bitmap
+ when having italic angle, the lsb and rsb are adjusted by using
+ italicAngle in post table.
+ - Added automatic correction of bitmap position for preventing
+ displaying chipped bitmap when using charcell or very lazy method.
+ - Set DEFAULT_VERY_LAZY macro. If post table is available, the very
+ lazy method is used as default when handling multi-bytes fonts.
+ - Added additional glyphs(0x2d21-0x2d7c) to jisx0208.1990-0.enc.
+ (Chisato Yamauchi, After X-TT Project).
+ 547. Set the pixel clock limit above which hzoom is enabled for the video
+ overlay for G450 and G550 cards to 234MHz. This fixes a problem with
+ the Xv support having half horizontal resolution (Michel Lespinasse).
+ 546. Add support on Mac OS X for building keymap using Carbon Keyboard
+ Layout API (John Harper).
+ 545. Map holes in kdrive VESA driver (#5436, Juliusz Chroboczek).
+ 544. Add option to Radeon driver to allow minimum dot clock to be
+ overridden (Bugzilla #831, Nils Philippsen).
+ 543. Add shared libraries run-path information to pkg-config datafiles
+ provided for some libraries. (Bugzilla #832, Frederick Bruckman,
+ Matthieu Herrb).
+ 542. Fix buglets detected by SGI compiler in neomagic, sis and tseng drivers
+ (Marc La France).
+ 541. Fix I/O alignment in mga and via drivers (Marc La France).
+ 540. Improve xkbcomp's key types auto-recognition (Ivan Pascal).
+ 539. Add support for multi-threaded direct GLX rendering with AppleDRI
+ (John Harper).
+ 538. Fix a problem in Xlib that was cause by the ANSI prototype cleanups
+ (Bugzilla #839, Owen Taylor).
+ 537. Limit the rate of duplicate audit messages in the X server. (Matthieu
+ Herrb, David Dawes).
+ 536. Fix ChipValidMode() return type (Marc La France).
+ 535. Fix for AGP8x support on HP zx1-based systems (Marc La France).
+ 534. Workaround for mysterious segfault related to mkfontscale's use of
+ memcmp() (Marc La France).
+ 533. Support the new Linear allocator in the trident driver and make the
+ hardware cursor use it. Xv automagically uses it. (Alan Hourihane).
+ 532. Fix acecad input driver build and re-enable it
+ (Bugzilla #816, Alan Hourihane).
+ 531. Fix DRM_CAS on ia64 as used by the DRI (Bugzilla #778, John Dennis).
+ 530. Call OsCleanup() at the end of each server generation, and add an
+ argument to indicate when the server is terminating. This allows
+ misc end-of-generation cleanups to be added to OsCleanup() (David Dawes).
+ 529. Explicitly free the DPMS and ScreenSaver timer resources at the end
+ of each server generation (David Dawes).
+ 528. Cygwin configuration updates and install script updates (Bugzilla #799,
+ 805, Harold L Hunt II, Alexander Gottwald)
+ 527. Build shared libraries for Xt and Xaw on Cygwin. (Bugzilla #804,
+ Ralf Habacker).
+ 526. Xterm patches #180, 181 (Thomas Dickey).
+ 525. Update libfreetype-xtt2 to version 1.0d:
+ - Fixed server crash caused by loading fonts for which encoding file
+ does not exist.
+ - Some fixes for minor bugs when handling errors.
+ - Some minor cleanups.
+ (Chisato Yamauchi, After X-TT Project).
+ 524. Export strl{cat,cpy} functions to the server modules and provide
+ an implementation for the systems that don't have them. (Matthieu
+ Herrb).
+ 523. Fixes and updates for XKB keyboard maps:
+ - Update Serbian layouts (Bugzilla #92, Danilo Segan).
+ - Add 'MS Windows like' US International variant for 'us' keymap (Ivan
+ Pascal).
+ - Change CapsLock default behavior to 'Caps acts as locking Shift,
+ Shift cancels Caps'. Add new type for four-level keys (Ivan Pascal).
+ 522. Fix generic rootless code bug which tests CopyWindow instead of CopyBytes
+ (Kensuke Matsuzaki).
+ 521. Update libfreetype-xtt2 to version 1.0c. This consists of some minor
+ fixes and cleanups (Chisato Yamauchi, After X-TT Project).
+ 520. Add accelerated rootless drawing support and fix bug in rootless
+ FillSpans (Torrey T. Lyons and John Harper).
+ 519. Update SiS driver:
+ - Merge 661/741/760 support
+ - Clean up
+ - Fix Xv problems after swsuspend
+ - Fix LCD-via-CRT1 on various machines
+ 518. Prevent some compilers from optimising out Mesa's X11 error interface
+ (Marc La France).
+ 517. Add rules to generate post-processed and assembler source from C++ files
+ (Marc La France).
+ 516. Change `make World` so that well it interrupts itself to build a utility
+ (makedepend, pswrap, etc), it only builds that utility. Some things were
+ being built too early (Marc La France).
+ 515. When the i830 driver's checks for sufficient memory for tiled mode
+ fail, don't later try to allocate with tiling enabled (David Dawes).
+ 514. Enable I845G_VBE_WORKAROUND in the i830 driver for all platforms, since
+ this reportedly fixes VT switching problems on hardware other than the
+ 845G.
+ 513. Updated README.SiS (Thomas Winischhofer).
+ 512. Add the After X-TT Project's libfreetype-xtt2 1.0b fixes and
+ enhancements to the "freetype" module (Chisato Yamauchi,
+ After X-TT Project). This should make it possible to deprecate the
+ "xtt" module in a future release. Fixes and enhancements include:
+ - Fixed crash caused by using fonts which have OS2 sfnt table.
+ - Corrected metrics calculation error. Although the original code uses
+ size->metrics, the FT_Size_Metrics does not have exact values when
+ handling the outline. So the codes for metrics calculation were
+ drastically rewritten.
+ - Fixed some problems with FreeTypeRasteriseGlyph():
+ + Made "only metrics is required" distinct from "both metrics and
+ rasterised bitmap are required" to improve performance when
+ loading large charset.
+ + Fixed the erroneous usage of freetype2 API. To get valid metrics,
+ FT_Outline_Get_BBox() or FT_Outline_Get_CBox() is used for outline.
+ + Took the strange code for raster copying and rewrote it.
+ - Fixed UNDERLINE_POSITION so that it counts downwards.
+ - Fixed a risky calculational method for info->maxbound and
+ info->minbound when spacing is not charcell. All glyphs' metrics are
+ calculated and valid info->maxbounds and info->minbounds are set
+ without cutting any corners.
+ - Added TTCap option "fn","ai","ds","fs","vl","cr","bw","eb","hi",
+ "fc" and "fm" which are compatible with X-TT 1.4.
+ - Supported character width for vertical layouts.
+ 511. Encoding file updates (After X-TT Project):
+ - Removed jisx0208.1983-0.enc and added 'ALIAS jisx0208.1983-0' to
+ jisx0208.1990-0.enc.
+ - Added Windows ucs2 cmap(3,1) to jisx0208.1990-0.enc and
+ jisx0201.1976-0.enc.
+ - Added files for GB18030-0 and GB18030-1 (James Su).
+ 510. Update X-TrueType (X-TT) to version 1.4.2 (Chisato Yamauchi,
+ After X-TT Project):
+ - Fixed several bugs of make_up_italic_bitmap() function.
+ - Changed the order of priority of mapIDRelations in JISX0208 and
+ JISX0201 code converter. The windows ucs2 is given the highest
+ priority for kochi-substitute Japanese fonts.
+ - Fixed code relation in cc_jisx0208_to_std_ucs2() function
+ (not 0x215d -> 0x00b1 but 0x215d -> 0x2212)
+ - Added minor improvements.
+ 509. Fixes and updates for HTML and PDF versions of spec docs for
+ installation and inclusion in the online docs (David Dawes).
+ 508. Implement SharedLibtoolLibraryTarget, etc for bsdLib/ELF, including
+ creating links for older but compatible revisions of such
+ libraries (David Dawes).
+ 507. Allow a simple form of option name aliasing for options handled
+ via OptionInfoRec (David Dawes).
+ 506. Add optimized code for RENDER with rootless XDarwin (John Harper,
+ Torrey T. Lyons).
+ 505. Declare LoadPalette, SetOverscan and DPMSSet as public functions through
+ the XFree86's ScrnInfoRec, so these functions can be wrapped.
+ (Alan Hourihane).
+ 504. XDarwin improvements:
+ - Add complete server side support for AppleWM with xpr.
+ - Allow Aqua and X11 windows to interleave when AppleWM-aware window
+ manager is present.
+ - Fix hang on server reset.
+ (Torrey T. Lyons, John Harper).
+ 503. Fix double-free at server regeneration in the screensave/DPMS timer
+ code (David Dawes).
+ 502. Build most libraries as shared by default. (Matthieu Herrb,
+ David Dawes).
+ 501. Add missing symbol definition files for libraries (Matthieu Herrb).
+ 500. Add 'inet' keymaps for two Logitec keyboard models (Bugzilla #762,
+ Eric Mountain; Bugzilla #766, Chris Hornbaker) and cleanup Logitec
+ keymaps (Ivan Pascal).
+ 499. Add missing SetScreenSaverTimer() to ProcSetScreenSaver (Ivan Pascal).
+ 498. Fix building on Mac OS X after DRI merge (Torrey T. Lyons).
+
+XFree86 4.3.99.14 (10 October 2003)
+ 497. Add an xf86InitFBManagerLinear() function and implement the Linear
+ allocation routines. These still fallback to XY area allocation if
+ no (or the lack of) linear space is available. It assumes the driver
+ has already called one of the init routines to the FBManager for Areas
+ before this new setup can be used (Alan Hourihane).
+ 496. Added USB keyboard support for Solaris/x86 platform (Bugzilla #352,
+ Daniel Rock).
+ 495. i830/i810 driver:
+ * Added Christian Ziez's code to tweak BIOS image to convince chipset of
+ resized video RAM.
+ * Fixed viewport/video overlay window alignment issues.
+ * Fixed calculation of video overlay memory size.
+ * Fixed video overlay on TV out (Bugzilla #213). (Egbert Eich).
+ 494. Fixed mode setting in trident driver: use mode passed in function
+ argument, not value in currentMode (Bugzilla #197, Egbert Eich).
+ 493. Added delay when writing to Glint PM2 ramdac to avoid lockups
+ (Egbert Eich).
+ 492. Fixed bug in Glint Bresenham line fallback code that caused line be drawn
+ beyond framebuffer boundaries (Bugzilla #624, Egbert Eich).
+ 490. Force sane pallette when entering DGA mode in Matrox driver
+ (Egbert Eich).
+ 489. ATI Rage128: Wait with modifying FP video mode according to BIOS values
+ until final call of ValidMode() to prevent modes from being rejected
+ (Bugzilla #661, Egbert Eich).
+ 488. Some Savage BIOSes turn on clock doubling on non-doubled modes.
+ Added code that catches and fixes this situation (Egbert Eich).
+ 487. Tdfx driver: Fixed order of initialization/deinitialization in
+ ScreenInit()/ CloseScreen().
+ Fixed texture video support, removed artefacts in last line of overlay
+ video support (Bugzilla #299). (Egbert Eich).
+ 486. Add "automatic configuration" support for the XFree86 server, allowing
+ it to be started in a useful way without an XF86Config file.
+ - Add support to the config file parser for processing internally
+ supplied configuration data.
+ - Modify the algorithm for finding core input devices to maximise the
+ likelihood that they will be found.
+ - Add a FindDevice function to the OSMouse interface, allowing
+ an OS-specific function to be called to find the mouse device when
+ none is specified in the configuration. Implementations included for
+ Linux and FreeBSD.
+ - Add a GuessProtocol function to the OSMouse interface, allowing
+ an OS-specific function to be called as a fallback when the mouse
+ protocol can't otherwise be detected. Implementation included for
+ Linux.
+ - Bump the OSMouse interface version to 1.1 with the addition of the
+ above two functions.
+ - An interface for calling an external utility "getconfig" to generate
+ some configuration data. Implementation of getconfig included.
+ - Generate a default internal configuration, autodetecting as much
+ as possible, with reasonable fallbacks.
+ - Recognise "DefaultDepth" and "DefaultFbbpp" options in the Device
+ section.
+ - Add a "TargetRefreshRate" option to help prevent modes with too
+ high a resolution (and poor refresh rate) being used as the default.
+ - Use DDC-probed mode timings to estimate the monitor parameters when
+ the DDC-probed information doesn't include a DS_RANGES property.
+ This should improve the reliability of monitor auto-detection.
+ (David Dawes, X-Oz Technologies).
+ 485. Add functions for checking option values without marking them as "used"
+ (David Dawes).
+ 484. Add missing xf86ReplaceRealOption() function (David Dawes).
+ 483. Added support for Siliconmotion Cougar3DR chip (Bugzilla #754,
+ Chris Edgington).
+ 482. Cygwin:
+ * Added another German keyboard layout.
+ * Added Japanese keyboard layout to the list of defaults as jp.
+ * Added a new default keyboard layout for Portuguese (Brazil, ABNT2).
+ * Print the layout number in hexadecimal.
+ * Display the argument to the -query option in the window title.
+ (Bugzilla #763, Alexander Gottwald)
+ 481. Add processing for WM_WINDOWPOSCHANGED to cause window to repaint when
+ using TweakUI's focus-follows-mouse behavior. (Bugzilla #763,
+ Harold L Hunt II)
+ 480. Added runtime detection of SHM support by checking the return value of
+ shmget to the SHM and xf86BIGFONT extension to support SHM on Cygwin
+ (Bugzilla #764, Harold L Hunt II).
+ 479. Adding O_BINARY flag when opening an xkm file if this flag is defined
+ (Bugzilla #768, Alexander Gottwald).
+ 478. Radeon driver fixes (Hui Yu@ATI)
+ - 9200 DVI fix and TMDS_PLL initialization for all chips
+ - New chips support (9800XT/SE, 9600XT/SE, M11, T2/X2 etc.)
+ - Cleanup unused/secondary chip ids
+ - Autodetect PCI cards
+ - Add BusType to override PCI card autodetect
+ - Add display bandwidth calculation routine to fix flickering/tearing
+ display problem
+ - Workaround for corrupted BIOS image causing incorrect panel size
+ - Fix the LCD table reading loop
+ - Various small changes (including improving DDC reliability and
+ CRTC_MORE_CNTL initialization)
+ 477. Fix XAA Color8x8 cache bug:
+ Pattern was expanded from source instead of destination
+ (Thomas Winischhofer)
+ 476. Fixes and updates for XKB keyboard maps:
+ - Add 'United Kingdom w/deadkeys' gb(intl) keymap (Bugzilla #744,
+ Phil Jones).
+ - Add multi_layout compliant 'us_intl' keymap (Ivan Pascal).
+ - Fix 'macintosh' geometry file (Bugzilla #753, Simon Vallet).
+ 475. APM driver:
+ . improved clock parameter calculation.
+ . Fixed order of initialization of cursor.
+ . Fixed restauration of graphical text mode.
+ . Added YUY2 video format.
+ . Corrected accel framebuffer pitches and max screen height
+ (Bugzilla #528, Egbert Eich).
+ 474. Moved DisableMMIO() out of the unmap() function, added call to
+ EnableMMIO() to EnterVT() to work around lockup problems when
+ switching between two Xserver (Bugzilla #748, Egbert Eich).
+ 473. Fixed problem with text widget in Xaw when widget has a different
+ depth than the default visual (Bugzilla #745, Wolfram Gloger).
+ 472. Fixed Sig11 when calling X -query with no ipv6 support in kernel
+ (Bugzilla #737, Egbert Eich).
+ 471. Added support for Sparc64 and AMD64 on FreeBSD.
+ This patch also disables warnings from system headers, fixes some elf
+ relocations also relevant for other platforms and disables translation of
+ KEY_SysReqest and KEY_Break on sparc64. (Bugzilla #739, Eric Anholt).
+ 470. Switched VIA video driver to fillkey helper function (Bugzilla #525,
+ Alan Cox).
+ 469. Fixed CRT modes > FP panel size for siliconmotion (Bugzilla #727,
+ Hugues Fournier).
+ 468. Fixed xedit coredumps: update counter of free objects when getting an
+ object from the list (Bugzilla #722, Egbert Eich).
+ 467. Fixed definition of UseInstalledOnCrossCompile so that it never is
+ undefined (Harlod L. Hunt II).
+ 466. Add the 'b' flag to fopen() when opening binary xkm files. This is
+ irrelevant for *nix OSes, but required for Cygwin. (Bugzilla #689,
+ Harold L Hunt II).
+ 465. Cygwin:
+ * MultiWindow Mode: Automatically validate the size of windows that are
+ being resized. (Earle F. Philhower III)
+ * Safely shutdown the MultiWindow Mode and Clipboard Manager threads on
+ server shutdown. (Earle F. Philhower III)
+ * MultiWindow Mode - Fix a crash from a string copy bug.
+ (Earle F. Philhower III)
+ * Add lots of defaults for keyboardlayout. (Alexander Gottwald)
+ * Add a system tha allows arbitrary commands to be added to the tray menu
+ icon. (Earle F. Philhower III)
+ * Print the name of the keyboardlayout to aid in adding more layouts.
+ (Alexander Gottwald)
+ * Stop printing the IDirectDrawSurface4_Blt() failure messages after 10
+ times. (Harold L Hunt II)
+ * Disable check for pc105 keyboard and just assume that it is present.
+ This check was causing problems with certain keyboard drivers that
+ failed to report that a pc105 keyboard was present.
+ (Alexander Gottwald)
+ * MultiWindow Mode - Add handling for WM_CHANGE_STATE IconicState
+ messages;
+ minimize the associated Windows window when these messages are
+ received. (Harold L Hunt II).
+ Submitted: (Bugzilla #704, Harold L. Hunt).
+ 464. cygwin.cf:
+ * removed BuildDPS flag.
+ * Changed Alloca flag as Cygwin 1.5.x supports alloca, now.
+ * Use external expat package by default.
+ * Changed XawI18nDefines to utilize improved wide char support in
+ Cygwin 1.5.x. (Bugzilla #699, Harold L. Hunt II).
+ 463. Fixed C&T panel register setting (Akira Taniguchi, Egbert Eich).
+ 462. Fixing crash on ia64 because of wrong setjmp buffer alignment (Bugzilla
+ #596, John Dennis).
+ 461. Changing ImPS/2 mouse Z-axis range to -8 to 7 (Bugzilla #691,
+ Matthew W. S. Bell, Egbert Eich).
+ 460. Making sure the compiled xkb config file is found by Xnest if
+ ProjectRoot is modified (Bugzilla #688, Frank Giessler).
+ 459. Fixing build of machine code .S files on OS/2 (Bugzilla #689,
+ Frank Giessler).
+ 458. Import Mesa 5.0.2 (Alan Hourihane).
+ 457. DRI merge (DRI Project)
+ * details to follow..........
+ 456. Fixes and updates for XKB keyboard maps:
+ - Update xkb geometry files (Alexander Pohoyda).
+ - Fix German-Romanian maps (Manfred Pohler).
+ - Cleanup Hungarian layout (Bugzilla #730, Egmont Koblinger).
+ 455. Change the order of the timeouts processing and the input devices
+ reading in WaitForSomething() which caused unneeded keyboard autorepat
+ events (Ivan Pascal).
+
+XFree86 4.3.99.13 (25 September 2003)
+ 454. Add support for chip ID 5964 (Radeon 9200 SE) to the radeon driver, and
+ fix detection of IDs 5962 and 5963 with Driver "ati" (Bugzilla #732,
+ Michel Daenzer)
+ 453. Add gcc format checking for the X server's message and logging
+ functions, and fix lots of associated warnings (David Dawes).
+ 452. Replace the perl version of ucs2any with a C version ( Ben Collver and
+ other NetBSD developers, Matthieu Herrb).
+ 451. For drivers that support 'Option "dri"' have the driver request
+ loading the dri module when this option is true. This brings
+ it in to line with how other things are handled. Other drivers
+ that have DRI support need to have the "dri" option added (David Dawes).
+ 450. Fix libGL bug that could cause deadlock when switching contexts
+ (John Harper).
+ 449. Improve the contrast of the whiteglass xterm cursor, and fix the
+ hotspot of the whiteglass right_ptr cursor and add transparency
+ to it (#5867, René Rebe).
+ 448. Fix a problem with the "pl2" (Polish qwertz) map where the order in
+ which the Alt_R and Shift keys are pressed affects the results
+ (Tom Pala).
+ 447. In xdm, use better pseudo-random number generators to generate
+ magic cookies. Add support for EGD and other compatible entropy
+ gathering daemons. (Oswald Buddenhagen from KDE, Matthieu Herrb).
+ 446. Fix IMPS/2 mouse wheel on platforms where char defaults to unsigned
+ (Rene Rebe).
+ 445. Fix rare xterm crash on Darwin due to dyld deadlock when a signal comes
+ in while dyld is looking up a symbol (Rob Braun).
+ 444. XDarwin cleanup and improvements:
+ - Load bundle at runtime for chosen Quartz mode: xpr, cr, or fullscreen.
+ - AppleWM extension has been generalized to work with any Quartz mode.
+ Currently only the xpr implementation is complete.
+ - Wrote a man page for AppleWM.
+ - Moved hw/darwin/quartz/aqua* files that contained code to protect
+ the alpha channel to miext/rootless/safeAlpha.
+ (Torrey T. Lyons).
+ 443. Remove lots of redundant redeclarations (David Dawes).
+ 442. VIA driver:
+ Fixed video memory detection. (Bugzilla #525, Alan Cox).
+ Fixed TV and FP initialization problems (Bugzilla #525, Frederic Crozat,
+ Alan Cox).
+ Removed remaining globals (Egbert Eich).
+ 441. Fixed memory leaks in the loader (Bugzilla #682 and #683, Juergen Keil).
+ 440. Fixed erroneous freeing of DisplayModeRec in xf86DeleteMode() when
+ deleting the modePool in xf86PruneDriverModes() the 'prev' member has
+ a different meaning for modePool modes than for ScrnInfoPtr->modes modes
+ where it creates a doubly linked list (Bugzilla #678, Juergen Keil).
+ 439. Fixed SDK for VIA driver (Bugzilla #674, Bernhard Rosenkraenzer).
+ 438. Extended list of monitor ranges and modes in xf86cfg (Egbert Eich).
+
+XFree86 4.3.99.12 (10 September 2003)
+ 437. Move the X server log file handling from the XFree86 DDX to the DIX,
+ allowing the more descriptive logging to be used throughout the server,
+ and the log messages to be more uniform in formatting (David Dawes).
+ 436. Added support for the Compaq Evo keyboard (Stanislav Brabec).
+ 435. Fixed writes past end of array in via_bios.c (Bugzilla #662,
+ Egbert Eich).
+ 434. Let luit copy the termios settings from the calling terminal (Bugzilla
+ #641, Juliusz Chroboczek).
+ 433. Add _ADOBE_POSTSCRIPT_FONTNAME to the list of font properties xlsfonts
+ that are atoms and should be converted to strings when run with the
+ -ll flag. Also fixed the lenght problems that may arise (Bugzilla # 659,
+ Alan Coopersmith).
+ 432. Backing out 321.: sysMem gets initialized once during server lifetime
+ (Egbert Eich).
+ 431. Fixing X11.tmpl to set XFTINCLUDES after defining a non-standard path
+ to fontconfig, adding FONTCONFIGINCLUDES to the build rules for fontconfig
+ (Kevin P. Fleming).
+ 430. Added support for the hp5181 inet keyboard (Bugzilla #648, Alan Strohm).
+ 429. Added support for Apple Laptop keyboards, added level3/group switching to
+ KP_Enter, modified layout so keyboards acts the same way as under Mac OS
+ (Bugzilla #642, Frank Murphy).
+ 428. Adding ANGKHANKHU (U+0E5A) character to level 3 of keycode <AD09> on
+ th_tis keymap (Theppitak Karoonboonyanan).
+ 427. Fixes and updates for XKB keyboard maps:
+ - Add 'Romanian keymap for German keyboard' and 'Romanian keymap with
+ access to German umlauts' (Manfred Pohler).
+ - Update xfree86.dtd file (Sergey V. Oudaltsov).
+ - Add an XkbOption that makes a keyboard map without special keysyms
+ on Ctrl+Alt+smth for those who use such combinations for another
+ purposes (Ivan Pascal).
+ 426. Reverse patch #423 because it causes compile problems (Ivan Pascal).
+ 425. Disable the bytecode interpreter by default in FreeType 1, bringing it
+ into line with the default for FreeType 2. Document how to enable
+ it in xf86site.def for those with no legal impediment to doing so
+ (David Dawes).
+ 424. Improvement of Xlib's keysym compose module:
+ - Allow to figure out a mulibyte string if it is omitted in Compose file.
+ - Add 'include' instruction with some substitutions.
+ - Add a searching of Compose file as a value of XCOMPOSEFILE environment
+ variable and as a $HOME/.XCompose file. (Ivan Pascal).
+ 423. Add a writing of some Xserver XKB module error messages into a servers
+ log file (Ivan Pascal).
+ 422. Add Trident CyberBladeXP4 support, but acceleration is currently
+ disabled. (Alan Hourihane).
+ 421. Xinstall.sh updates to reduce its reliance on external utilities and
+ provide better diagnostics when required external utilities don't exist.
+ (David Dawes).
+ 420. Fixes and updates for XKB keyboard maps:
+ - Fix unneeded BKSL redefinition in Ukrainian 'winkeys' keyboard map
+ (Andriy Rysin).
+ - Fix some keycodes for jp106 keyboard model (Bugzilla #657,
+ Stephen J. Turnbull).
+ - Update xfree86.xml registry file (Andriy Rysin, Sergey V. Oudaltsov).
+ 419. Add a missing xf86UnblockSIGIO() call to xf86InstallSIGIOHandler()
+ (#5839, NetBSD PR xsrc/22668, Yorick Hardy).
+ 418. Fix a problem with the "pl" map where the order in which the Alt_R and
+ Shift keys are pressed affects the results (#5832, Tom Pala).
+ 417. Fix the warning generated by the ONE_LEVEL <RALT> definition in
+ the "level3" map (#5832, Tom Pala).
+ 416. Remove the unnecessary dependence of RandR on RENDER (David Dawes).
+ 415. Remove some static variables that should be per-screen (David Dawes).
+ 414. SiS driver update:
+ - Add 8x8 Color Pattern Fill (315/330 series)
+ - Add transparency support for 8x8 Mono Pattern (300/315/330 series)
+ - Fix Xv "insufficency" triggered by MPlayer (315 series)
+ 413. Add missing REQUEST_SIZE_MATCH() to xSyncSetCounter protocol request
+ (noticed by Ruben Nunez Francisco).
+ 412. Allow building libOSMesa during non-XFree86 builds (Marc La France).
+ 411. Rip out incorrect limits on the number of PCI buses an ix86 chipset can
+ handle and implement an improved solution for avoiding "phantom" PCI
+ buses (Marc La France, Bugzilla #604).
+ 410. Fixes for potential integer overflows in font libraries. (blexim,
+ Matthieu Herrb).
+ 409. SiS driver: Add RENDER hardware acceleration
+ 408. Add a Fopen() function to open the Xauthority file without spawning
+ a shell (Bugzilla #255, Aidan Kehoe, Matthieu Herrb).
+ 407. Fix a bug introduced with #397 that results in the core pointer and
+ keyboard devices specified in a ServerLayout section being ignored
+ (David Dawes).
+ 406. Added big5hkscs encoding to font encoding files (Bugzilla #575,
+ Jungshik Shin).
+ 405. Don't call FBIOPAN_DISPLAY ioctl with arguments that will cause a
+ confusing if harmless error; make an fbdevhw internal function static to
+ fix a warning. (Michel Dänzer)
+ 404. Passing correct virtual screen size to xf86ValidateModes() in VIA driver
+ (Luc Verhaegen).
+ 403. Added RGB overlays to i810 driver (Bugzilla# 625, Alastair M. Robinson).
+ 402. Fixed mode switching and mode comparison for xf86VidMode extension for S3
+ driver (Bugzilla #613, Alexey Baj, Egbert Eich).
+ 401. Via driver: Fixed remaining globals, some formatting issues, out of
+ memory handling in Xv overlay code and a couple of small glitches caused
+ by the fixes (Bugzilla# 525, Alan Cox)
+ Fixed some missing globals and static build (Egbert Eich).
+ A handful globals still remain.
+ 400. Update the Xserver(1), XFree86(1) and XF86Config(5) man pages to
+ clarify how XFree86 configuration/run-time parameters are specified
+ and their order of precedence (David Dawes).
+
+XFree86 4.3.99.11 (25 August 2003)
+ 399. Try to make the state of libXfont more consistent. It shouldn't depend
+ on whether a static or loadable XFree86 server is being built, so it
+ now always has a dependency on the FreeType2 library (when FreeType
+ support is enabled) (David Dawes).
+ 398. Make the specification of a Monitor in the Screen sections of the
+ XF86Config file optional. Some drivers may need changes (coming later)
+ to maximise the utility of this (David Dawes).
+ 397. When a core keyboard or core pointer cannot be found in the
+ configuration, create default ones. The pointer part of this
+ requires some changes to the mouse driver (coming later) before
+ the default core pointer configuration will be useful on most
+ platforms (David Dawes).
+ 396. Add a facility for assigning version numbers to builtin XFree86 server
+ interfaces and allowing modules to query them. Assign versions for
+ the os-mouse and os-kbd interfaces (David Dawes).
+ 395. Include uname(2) information in the server's banner messages
+ (Marc La France).
+ 394. Fix bug in detection of multi-function PCI devices (Marc La France, in
+ partial resolution of Bugzilla #574).
+ 393. Change the XFree86 server's global default depth to 16, and change most
+ drivers that support the three common depths (8, 16, 24) to defer to
+ the global default rather than specifying their own (David Dawes).
+ 392. Fixed a crash when _XIMProtoOpenIM(), hich is called through XOpenIM()
+ API when protocol IM is being set up, fails (Bugzilla #618,
+ Hisashi MIYASHITA).
+ 391. Fixed a possible source of Sig11 in Jamstudio driver (Bugzilla #617,
+ Jonathan Hough, Egbert Eich).
+ 390. Fixed building without RENDER support (Bugzilla #306, Matthieu Herrb,
+ Egbert Eich).
+ 389. Pass pointer obtained by Xalloc() to Xfree() not the one that may be
+ manipulated in the mean time (Bugzilla #614, Alan Coopersmith).
+ 388. Added reverse mapping of keysyms to keycodes (XKeysymToKeycode())
+ to xev to detect situations where this maps to a different keycode than
+ the one of the key pressed (Egbert Eich).
+ 387. Made xauth called by startx quiet (Bugzilla #597, Stas Sergeev).
+ 386. Added missing operand size override handling to PUSH imm8 in x86emu
+ (Bugzilla #590, Boris Weissman).
+ 385. Fixed compile glitch with NetBSD in xdm/genauth.c (Bugzilla #587,
+ Nicolas JOLY)
+ 384. Fix bugs in Xlib's EUC string converters that cause incorrect work of
+ _Xmblen. Fix _Xmblen usage in imCallbk.c when Xlib is built with
+ X_LOCALE (Etsushi Kato).
+ 383. Update xev program for print the result of XmbLookupString call
+ (Bugzilla #582, Noah Levitt, Ivan Pascal)
+ 382. Fixes and updates for XKB keyboard maps:
+ - Fix for Uzbek keyboard map (Bugzilla #595, Mashrab Kuvatov).
+ - Fix for the problem with Alt+Tab combinations in some window mangers
+ (Bugzilla #580,616): window chooser menu doesn't disappear after
+ Alt key release (Egbert Eich, Ivan Pascal).
+ 381. Allow a Display subsection with no depth or fbbpp specified to match
+ any depth/fbbpp, and make Display subsections optional, creating one
+ with default parameters when no suitable one can be found (David Dawes).
+ 380. Include <sys/param.h> to get the BSD macro for luit (ITO Tsuyoshi).
+ 379. DRM resync from the DRI trunk...
+ - Lots of misc fixes/cleanups, and some resyncs with 2.4 and 2.6
+ kernels.
+ - Fix maplist entries being used after they were freed; thanks to
+ Benjamin Herrenschmidt for tracking this down (Michel Daenzer).
+ - FreeBSD updates (Eric Anholt).
+ - Fail in DRM(agp_acquire) if the AGP aperture can't be used, such
+ that the X server falls back to PCI GART or disables the DRI
+ gracefully (Michel Daenzer).
+ - Possibly fix stanford checker complaints about sarea for radeon
+ (Keith Whitwell).
+ - Restore i830 texture age waiting when swapping in new textures
+ (Keith Whitwell).
+ - Fix texture rectangle support for r100 (Keith Whitwell).
+ - Add i810 add page flipping support to the DRM (Dave Airlie).
+ - Merged DRM documentation (Jose Fonseca).
+ - r128 MESA_ycbcr_texture (Ian Romanick, Leif Delgass).
+ 378. Linux drm module build fixes for newish kernels from the DRI
+ repository (Michel Daenzer, Linus Torvalds, Leif Delgass). This
+ addresses Bugzilla #603, 605 (Calum Mackay).
+ 377. Fix the test for 2.5.x with x < 52 Linux kernels for the drm module
+ build (Bugzilla #601, Callum Mackay).
+ 376. Fix an XAA pixmap cache server crash that can happen in some cases
+ when the off-screen memory is heavily fragmented (David Dawes, based
+ on #5752, Koike Kazuhiko, Chisato Yamauchi).
+ 375. Fix for the Brazilian ABNT2 keyboard extra key that now translates to
+ a different keycode value. Patch suggested by Ivan Pascal.
+ 374. Fixed XDarwin fullscreen crash in some screen sizes (Torrey T. Lyons).
+ 373. Be a little more precise about differentiating between active and
+ inactive non-video PCI resources (Marc La France).
+ 372. Added Apple-WM extension and library (John Harper, Torrey T. Lyons).
+ 371. Fixed indirect GLX on Mac OS X when the client can not make a
+ connection to the CoreGraphics window server (John Harper).
+ 370. Fixed support for 64bit PCI bus on 32bit systems (Egbert Eich).
+ 369. Added support for using aliases in the -nolisten option. '-nolisten tcp'
+ aliases to IPv4 and IPv6 (Matthieu Herrb, Egbert Eich).
+ 368. Added fallback Xlib transport layer if IPv6 socket cannot be openend
+ (Egbert Eich).
+ 367. Added missing symbol to the vbeSymbols table in i740 driver (Bugzilla
+ #583, Egbert Eich).
+ 366. Changed scripts containing 'head -1' which is not supported by
+ POSIX 1003.1-2001 any more (Bugzilla #570, #569, Paul Eggert,
+ Egbert Eich).
+ 365. Changed POSIX 1003.1-2001 non-conformant 'sort +2' to 'sort -k 3' with
+ backward compatibility (Bugzilla #568, Paul Eggert).
+ 364. Add Microsoft Pro OEM model to XKB inet map (Bugzilla #458,
+ maxim@wzzrd.com)
+ 363. Extract the CHANGELOG's commit date and include it in the XFree86
+ server log/version information (David Dawes).
+ 362. Change the way xf86Build.h is created so that it doesn't cause its
+ dependencies to be rebuilt when its contents are not changed
+ (David Dawes).
-XFree86 4.3.0.1 (9 May 2003)
- 987. Fix a FreeBSD/alpha build problem (#5679, Fred Clift).
- 986. Fix SiliconMotion driver for mode switching and SEGV problem when
- initializing Xv functionality (Bugzilla #50, Alan Hourihane).
- 985. Fix a SEGV that can happen with Riva128 cards (Mark Vojkovich).
- 984. Prevent a SIGFPE with the glint/pm3 driver when attempting to display
+XFree86 4.3.99.10 (10 August 2003)
+ 361. Fixes and updates for XKB keyboard maps:
+ - Added numpad:microsoft XKB option (Bugzilla #558, Will Styles).
+ - Fixed inconsistence in indicator names (Bugzilla #577, Noah Levitt).
+ - Added type6 model of Sun keyboard (Warren Turkal).
+ 360. Add UK (gb) layout to the dvorak XKB map (#5739, Mike Sulivan).
+ 359. More work on the NativeGDI server for Cygwin/XFree86. The span routines
+ are nearing completion (albeit they run slowly until the higher
+ level X primitive functions are implemented). The obvious issue with
+ the current code is the problems surrounding 1-bit DIBsections which
+ have msb/lsb issues compared to the other types of DIBsections.
+ This work was done quite some time ago in the Cygwin/XFree86 CVS.
+ (Alan Hourihane).
+ 358. SiS driver update:
+ - Added pseudo-Xinerama extension for MergedFB mode
+ - Fixes for Clevo L285/L287 (1024x768)
+ 357. Include Xmd.h in Xpm/lib/XpmI.h to get definitions of LONG64
+ (Bugzilla #562, John Dennis).
+ 356. Moved Meta_L/R keys and added Super_L/R keys on macintosh keyboard.
+ This makes the layout more compatible to the PC keyboard layout
+ (Bugzilla #565, Frank Murphy).
+ 355. Add check for Xmalloc() return value in XGetErrorDatabaseText() to avoid
+ Sig11 (Bugzilla #563, Alan Coopersmith).
+ 354. Separated build of libglx.a module and normal libglx.a library
+ (Bugzilla #541, Frank Giessler).
+ 353. Fixed build of Xnest, Xprt and Xvfb for OS/2 by linking with the linker
+ definition files (Bugzilla #541, Frank Giessler).
+ 352. Fixed freeing of properties form xkb_geomerty block (Bugzilla #550,
+ Alexander Pohoyda).
+ 351. Fixed string octal number parsing and string to int conversion for "\00"
+ in xkbcomp (Bugzilla #553, Egbert Eich).
+ 350. Removed stale definition from XftCompat.h (Bugzilla #543, Egbert Eich).
+ 349. Added XLC_LOCALE file for zh_CN.UTF-8, moved iso10646 encoding to the end
+ in ja_JP, ko_KR and zh_TW UTF-8 XLC_LOCALE files
+ (Bugzilla #544, Akira TAGOH).
+ 348. Fixed typo in #if conditional in cfb code (Bugzilla #556, Dave Love).
+ 347. Fixed ValidMode() in C&T driver to work with option 'FixPanelSize'
+ (Egbert Eich).
+ 346. Fixed Meta_R key on us layout Macintosh keyboard (Bugzilla #539,
+ Frank Murphy).
+ 345. Add new charset sequence for CText at the end of list. This way the
+ sequence of a charsets that were added earlier will be picked if two
+ sequences for the same charset are registered (Bugzilla #228,
+ Egbert Eich).
+ 344. Use return value sysconf (_SC_OPEN_MAX) instead of the fixed number 256
+ for allowed number of open files on POSIX.1 conformant systems
+ (Egbert Eich).
+ 343. Added missing exported functions in libfreetype to compile mkfontscale,
+ made mkfontsdir script install on platforms that use extensions (Bugzilla
+ 536, Frank Giessler).
+ 342, Fixed a sig11 in Xaw that may appear on the rare condition that no font
+ can be found (Bugzilla #482, Egbert Eich).
+ 341. Added KP_Separator to symbols that can generate decimal() in xcalc
+ (Egbert Eich).
+ 340. Disabled Color8x8PatternFill() in savage driver (Egbert Eich).
+ 339. Fixed a sig11 in twm when used with a session manager (Egbert Eich).
+ 338. Fixed rounding of refresh rate in RandR, updated Xrandr man page
+ (Bugzilla #527, Egbert Eich).
+ 337. Added MenuBorderWidth and MenuBorderColor options to twm (Bugzilla #529,
+ Alexander Pohoyda)
+ 336. Update for VIA driver:
+ - DGA no longer hangs (eg freedroidRPG now runs reliably)
+ - Starting two copies of Xine no longer aborts the X server
+ - Added support for KM400/K8M400
+ - Improved video overlay support.
+ - Fixed video overlay clipping when the image cliprects change but
+ not the size.
+ - TV tuner support via XV interface for two overlay ports.
+ - DRI support (the client side library is not yet fully ported to 4.3).
+ - Disable Xv in modes with insufficient bandwidth (1600c1200x16).
+ - Updated documentation
+ It differs from the base VIA codedrop.
+ - Several of the fixes were done by me on top of it (the dual Xine fix,
+ and bandwidth)
+ - Various system types have been turned to CARD32 to make the code
+ portable
+ - The hybrid Video4Linux/XV glue was racy and has been removed
+ (the XV layer is more than sufficient anyway)
+ - DRI library client code is not included (porting not yet finished)
+ - Additional debugging
+ (Bugzilla #525, VIA, Alan Cox) .
+ - Cleaning up namespace pollution, removing dependency on via_drm.h
+ removing some global symbols from driver (Egbert Eich).
+ Please note: there are more global symbols yet to be removed.
+ 335. Remove the 'xc/xkbcomp/geometry/HP' directory from the CVS repository.
+ 334. Substantial rewrite of the "nv" driver (Mark Vojkovich).
+ 333. Resync with Cygwin/XFree86 changes up to Test92 (#5721, Harold Hunt and
+ the Cygwin/XFree86 project).
+ 332. Add a clean target for Cygwin's ResourceObjectRule() rule (#5720,
+ Harold Hunt).
+ 331. Fix xman's formatting/displaying of manual pages on Darwin, where
+ 'groff' defaults to PostScript formatting (#5719, T. M. Pederson).
+ 330. SiS driver update:
+ - Fixed SiS 620 support
+ - Added interface for sisctrl utility
+ (Thomas Winischhofer)
+ 329. Fixes for regressions in xauth and xhost with IPv6 code
+ (Matthieu Herrb, Hideki ONO).
+ 328. Update X-TrueType (X-TT) to version 1.4.1 (Chisato Yamauchi,
+ After X-TT Project):
+ - Extension of code converter modules for ARABIC, ARMSCII8,
+ BIG5HKSCS, GB18030, ISO8859.*, etc. (Pablo Saratxaga, James Su)
+ - Try to use TT_Load_Glyph_Bitmap() in get_metrics() when `bs'
+ option is not set.
+ - Use Embedded Bitmap with the option `eb=y' when Auto Italic is set.
+ - Enhancements for `ds', `eb' and `bw' options.
+ - New options for TTCap, `fc' and `fm': they enable the *extremely*
+ fast loading of big Japanese or unicode fonts with `-p-' in the XLFD.
+ - Performance improvement of FreeTypeGetMetrics() function.
+ - Improved performance based on the solution to the buffer
+ overflow problem, caused by exceeding the range of
+ maxbounds.ascent/maxbounds.descent. This problem occurred only
+ when `-m-' spacing was used.
+ - Improved fix to crashes caused when certain fonts (e.g. verdana.ttf)
+ are used; solution based on investigating the true nature of the
+ problem.
+ - Added patch for mktcapdir-0.5.4 and some ttfconf files suitable for
+ X-TT 1.4.0.
+ - Preparation for extending the encoding field of XLFD. X-TT permits
+ the following additional XLFD format:
+ "-foo-foo-medium-r-normal--0-0-0-0-c-0-foo.2000-0.0"
+ "-foo-foo-medium-r-normal--0-0-0-0-c-0-foo.2000-0.1"
+ The last number can be used to indicate the plane number of a huge
+ character set.
+ - Support for reverse `fc' specification. `fc=0xaa00-0xa0ff' means
+ specifying the ranges 0x0000-0xa0ff and 0xaa00-0xffff. This is
+ useful for GB18030 proportional fonts.
+ - Improved fix for server crash that appears on Linux/PPC.
+ - Added ksc5601.*-3 and ksx1001.*-3 to KSCJOHAB/main.c (Jungshik Shin).
+ - Added U+20AC and U+00AE characters to KSCJOHABtoUCS2.c and
+ KSC5601toUCS2.c (Jungshik Shin).
+ - Fixed an X server crash when using LucidaSansRegular.ttf
+ (reported by Koike Kazuhiko).
+ - Improved fix to prevent NULL dereference when the font cache
+ becomes full; solution by allocation of a dummy area for bitmap.
+ - Fixed an X server crash because of an inconsistency problem between
+ XFree86 and X-TT (reported by Koike Kazuhiko).
+ - Numerous minor improvements.
+
+XFree86 4.3.99.9 (25 July 2003)
+ 327. Add Mach64 I2C framework. Derived from GATOS project (Marc La France).
+ 326. Removed ru_yawerty xkb symbols file as it is misleading as suggested
+ by Ivan Pasacal (Bugzilla #516, Ivan Pascal).
+ 325. Fixed two bounds errors in rman
+ (Bugzilla #505, Dan Nelson, Bugzilla #506, Eric Anholt).
+ 324. Cleaned up MMIO map/unmap in RADEONPreInit(), unmapped MMIO in
+ CloseScreen() even when server is switched away (Bugzilla #504,
+ Hui Yu, Egbert Eich).
+ 323. Modified transport code so that a bind to an IPv4 socket fails silently
+ when the bind to an IPv6 socket for the same port was successful.
+ This works around a problem in theIPv6 implementation on some OSes
+ that also handle IPv4 calls over IPv6 sockets (Egbert Eich).
+ 322. Simplified handling of the -nolisten option as suggested by
+ Alan Coopersmith. This option can now be issued multiple times.
+ 321. Added code to unmap sysMem when freeing int10 (Bugzilla #504,
+ Frank Giessler).
+ 320. Fix generic rootless crash while resizing when CopyBytes is not defined
+ by the implementation (Torrey T. Lyons).
+ 319. Fix XDarwin Cocoa rootless crash when unshaping a shaped window
+ (Torrey T. Lyons).
+ 318. More IPv6 changes from Alan Coopersmith as follows:
+ - Add support for IPv6 bracketed numeric addresses, similar to RFC 2732
+ syntax to a number of areas.
+ - Fix some issues with colon parsing and determining which addresses are
+ DECnet (two colons between hostname and display number) and which are
+ non-bracketed IPv6 numeric addresses ending in two colons, followed by
+ another colon and the display number (three colons in a row).
+ - Fix additional places Fabio forgot to change the string length when
+ switching "inetv6" to "inet6".
+ - Use MAXHOSTNAMELEN if it is defined for MAXHOSTNAME in xrdb. (Perhaps
+ NI_MAXHOST should be used as well on platforms that support it.)
+ - Make #include <sys/socket.h> in Xtrans.h look like the other places
+ it's included in the tree, with checks for Lynx & Win32
+ 317. IPv6: 2003.07.11 update to X.Org's response to comment #13; i.e.
+ s/FamilyInternetV6/FamilyInternet6/g (Marc La France).
+ 316. IPv6 build fixes for older Linux systems; Many of these are derived from
+ a suggestion by Alan Coopersmith (Marc La France).
+ 315. Change DEVID macro to work around glitch in SCO's C compiler
+ (Marc La France).
+ 314. Fixed Radeon driver so that clone modes survive server reset
+ (Bugzilla #487, Egbert Eich).
+ 313. Changed behavior of FreeType and Type1 renderer: when no encoding file
+ is found fail with BadFontName instead of using an iso8859-1 encoding
+ (Bugzilla #479, Roland Mainz, Juliusz Chroboczek, Egbert Eich).
+ 312. Fixed screen switching problem on SCO where VT was off by one
+ (Bugzilla #470, Kean Johnston).
+ 311. S3 driver:
+ . allow only specific displayWidths when acceleration is enabled
+ . added double_scan support (Egbert Eich).
+ 310. Removed build rules for hp Xserver that was recently removed from
+ Xserver/Imakefile (Egbert Eich).
+ 309. Fixes for C&T driver:
+ . switch to SW mouse in doublescan modes.
+ . centered video correctly for all interlaced modes (docs were
+ misleading).
+ . fixed README (Egbert Eich).
+ 308. Fixed a typo in mkfontscale (Bugzilla #491, Juliusz Chroboczek).
+ 307. A lot of X server prototype cleanups, including fixing an
+ inconsistency between the cfbBitBlt and CopyPlane functions
+ exposed by the prototyping (#A.1859, Alexander Stohr).
+ 306. Fix missing newline in Message -> MessageF transition in dri_glx.c
+ (#A.1833, Alexander Stohr).
+ 305. Fill out the sunleo man page (#A.1783, Arnaud Quette).
+ 304. Fix a typo in the XSetWMProtocols(3) man page (#5697, Alexander Pohoyda).
+ 303. Fix for a few Xlib charset converters (Bruno Haible).
+ 302. Fix calculation of CRTC2 frame offset with page flipping in radeon driver
+ (Michel Daenzer)
+ 301. Xinerama-fy the XTest extension (Rik Faith).
+
+XFree86 4.3.99.8 (10 July 2003)
+ 300. X.Org IPv6 changes (Bugzilla #227, Alan Coopersmith, Marc La France).
+ See http://www.x.org/IPV6_Specific_Changes.html for details. This has
+ been further modified as follows.
+ - Deal with small memory leaks in xdm & xauth.
+ - Fix a number of compilation issues.
+ - Where supported, use SIOCGLIFCONF to query network interfaces on more
+ than only Solaris.
+ - Incorporate X.Org responses to comments #'s 1, 2, 4, 5, 7, 10, 11, 12,
+ 13, 14 and 15 (taken from an X.Org-internal document dated 2003.06.17).
+ - Replace HasIPv6 imake symbol with BuildIPv6, defaulting it to YES, and
+ build in IPv6 support whenever BuildIPv6 is asserted _and_ the OS
+ #define's AF_INET6. This is to maximise IPv6 code exposure and
+ eliminate <OS>.cf file changes to support IPv6.
+ 299. On Solaris, don't allow remote root xdm logins if CONSOLE is set in
+ /etc/default/login (Bugzilla #227, Alan Coopersmith).
+ 298. Fix SEGV in fstobdf when font server is not specified and FSServerName()
+ returns NULL (Bugzilla #227, Alan Coopersmith).
+ 297. Fix XDMCP bug that could cause local host entries in /etc/X0.hosts to be
+ lost (Bugzilla #227, Alan Coopersmith).
+ 296. Make certain xtrans static variable volatile to avoid optimisation issues
+ that occur when they are modified by SIGALRM handlers
+ (Bugzilla #227, Alan Coopersmith).
+ 295. Use %p instead of %x to print pointer values in xtrans debug messages to
+ avoid overflow on platforms with 32-bit ints & 64-bit pointers
+ (Bugzilla #227, Alan Coopersmith).
+ 294. Change SUN-RPC code to use authdes_seccreate() call rather than the
+ deprecated authdes_create() (Bugzilla #227, Alan Coopersmith).
+ 293. Add xdm /dev/random handling for Solaris
+ (Bugzilla #227, Alan Coopersmith).
+ 292. Solaris compile fixes (Bugzilla #227, Alan Coopersmith).
+ 291. Update X.Org version numbers to X11R6.6 or X11R6.7 and replace old
+ references to X Consortium with X.Org (Bugzilla #227, Alan Coopersmith).
+ 290. Update the usage of DRM AGP handles so that valid handles aren't
+ mis-interpreted as invalid handles (based on Bugzilla #484, Dave Airlie).
+ 289. Twisting fontfile.c and fontdir.c to be able to pass all fonts (bitmap
+ and scaleable) to the scalable renderer as this one can deal with
+ XLFD names (Bugzilla #475, Juliusz Chroboczek). PLEASE TEST!
+ 288. Changing PS/2 mouse resolution to 8 counts/mm as some broken mice have
+ problems with other values (W. uses 8) (Egbert Eich).
+ 287. Fixing mode setting by BIOS. Wrong clock selection in MiscOut register
+ caused screen to stay blank (Egbert Eich).
+ 286. Added description for -dumpSched and -schedInterval to the usage
+ message (Egbert Eich)
+ 285. Update the SCO OpenServer port, fixing these specific problems:
+ . Fixed the Imake template so i[3456]86 and friends arent defined
+ . Fixed bad preprocessor stuff in X11.tmpl that was producing warnings
+ . Updated default GCC flags to more aggresively optimize
+ . Fixed keyboard LED handling
+ . Enable SCO function keys in xterm
+ . Make Delete key send DEL by default on SCO in xterm
+ . Fix to make fonttosfnt compile (Bugzilla #470, Kean Johnston).
+ 284. Added missing ro2 symbols file to list of files to install
+ (Bugzilla #476, Egbert Eich).
+ 283. Corrected precedence problem in test in xc/lib/X11/XKBUse.c:
+ XkbUseExtension(). This avoids an extra round trip during application
+ startup (Bugzilla #473, Owen Taylor).
+ 282. Fixing deadlock in libXi - when is called _XLockDisplay() twice - when
+ calling a Xi function that calls XGetExtensionVersion() (Bugzilla #260,
+ Bastien Nocera, Owen Taylor).
+ 281. Adding support for video modes <320x240 to S3 driver by changing the
+ minimal clock frequency to 15.6 MHz (Bugzilla #472, Alexey Baj).
+ 280. Made mkfontscale behavior and options compatible to mkfontdir, fixed
+ bugs in output format (Bugzilla #425, Juliusz Chroboczek, Kean Johnston).
+ 279. Changed xclock hands back to black (antialiased) , created XClk-col.ad
+ to set colored hands instead, added missing documentation for missing
+ resources. This follows the behavior of the other X applications more
+ closely (Bugzilla #437, Joerg Wunsch).
+ 278. Added support for Trio64UV+ and Trio64V2/DX/GX to S3 driver (backport
+ from 3.x) (Bugzilla #465, Alexej Baj).
+ 277. Increased Xlib default buffer size to 16k (was 2048), made size
+ configurable thru environment variable XLIBBUFFERSIZE (minimum 2048)
+ (Bugzilla #466, Roland Mainz).
+ 276. Increased maximum BIGREQUEST size to 4Mb and made it configurable thru
+ a command line option. This increases performance of certain
+ applications considerably (Bugzilla #460, Roland Mainz).
+ 275. VIA driver: initialized screen parameters in PreInit() instead of
+ AccelInit() so that they are set even when acceleration is disabled
+ (Egbert Eich).
+ 274. Do not drop H&V sync during screen blanking for Radeon
+ (Bugzilla #320, Michael Breuer, Hui Yu@ATI).
+ 273. Let out-of-limit pixel clocks only use the frequency below pll output
+ lower limit for Radeons (Bugzilla #262, John Vickers, Hui Yu@ATI).
+ 272. Add support for Radeon cards with DAC/TMDS wire up in different ways
+ from what the driver was originally programmed to; includes support
+ for dual DVI cards (Hui Yu@ATI).
+ 271. Add Radeon DPMS handling for flat panels (Bugzilla #26, Hui Yu@ATI).
+ 270. Decreased the retry loops in DDC probing so that Radeon startup
+ time won't be too long in the worst case (Hui Yu@ATI).
+ 269. Fix Radeon Asic bug in RMX unit of IGP chips (Hui Yu@ATI).
+ 268. Fix Radeon register initialization for RGB offset to fix the
+ "milky-screen" problem (Bugzilla #351, Hui Yu@ATI).
+ 267. Add support for new Radeon chips: R350(9800), RV350(9600,M10),
+ RS250(IGP7000), RS300(IGP9000), RV280(9200) (Hui Yu@ATI).
+ 266. Fix a lockup with the trident driver when stopping/starting Xv
+ applications (Alan Hourihane).
+ 265. Fix initialisation in xauth (Martin Birgmeier).
+ 264. Calling RADEONSaveFPRegisters() regardless of display type to catch
+ register restauration problems (Bugzilla #193, Hui Yu).
+ 263. Fixed order of name and filename in encodings.dir files generated by
+ mkfontscale (Roland Mainz).
+ 262. Changed resource registration in TDFX driver: VGA mem resources
+ are unused during OPERATING state, RAC isn't required for memory
+ resources (Bugzilla #357, Egbert Eich).
+ 261. Attempt to fix VIA driver lockups when moving windows:
+ assumed bug compatibility to previous S3 products
+ (Bugzilla #435, Egbert Eich).
+ 260. Disabled mode writeback to client program from MGA driver (Egbert Eich).
+ 259. #ifdef'ed variables in os-support/bsd in cases they are not needed
+ (Bugzilla #430, Jason L. Wright).
+ 258. Fixes and updates for XKB keyboard maps:
+ - add Faroese keyboard map (Bugzilla #401, Roi a Torkilsheyggi)
+ - add missing KPPT key to ABNT2 keycodes list (Bugzilla #431, Christian
+ Tosta)
+ - fix geometry/pc file (Alexander Pohoyda).
+ 257. Don't sleep on Darwin for directory owner/mode problems (John Harper).
+ 256. Limit 430TX and 430VX to 128 and 32 PCI buses respectively
+ (Marc La France).
+ 255. Add direct GLX rendering on Mac OS X and Apple-DRI extension
+ (John Harper).
+ 254. Replaced inline asms with compier intrinsics for Intel compiler
+ (Bugzilla #427, Slava Sysoltsev).
+ 253. Partly fixed build problems caused by mkfontdir replacement
+ (Bugzilla #425, Egbert Eich).
+ 252. SiS driver update:
+ Fixed Xabre support
+ (Final) fix for Compaq 3045US
+ Customized timing for 848x480 parallel panels
+ 251. Replaced mkfontdir by simple shell script that calls mkfontscale
+ (see #233) (Bugzilla #388, Juliusz Chroboczek).
+ 250. Added encoding files for Arabic (iso8859-6.16 and iso8859-6.8x)
+ (Bugzilla #420, Roland Mainz).
+ 249. Removed O_SYNC from open call for /dev/mem for all Linux platforms.
+ This hopefully takes care of the speed problem
+ (Bugzilla #419, #414, Egbert Eich).
+ 248. Fixed fontstosfnt to build on OS/2 (Bugzilla #415, Frank Giessler
+ Juliusz Chroboczek).
+ 247. Fixed DMC touchscreen driver: button press events are properly
+ recognized now, made sure device is still recognized after a restart,
+ fixed misleading error messages (Bugzilla #418, Andreas Kies).
+ 246. Added PanoramiX supprt for the RENDER requests: Trapezoids, Triangles,
+ TriStrip, TriFan, SetPictureTransform and SetPictureFilter
+ (Bugzilla #138, Egbert Eich).
+ 245. Fixed SW/Theme cursor drawing glitches in i740 driver (Bugzilla #21,
+ Egbert Eich).
+ 244. Added input driver for Aiptek tablet (Bugzilla: #393, (list #5686),
+ Bryan W. Headley).
+
+XFree86 4.3.99.7 (25 June 2003)
+ 243. Added 'BitKeeper' to the directories that get excluded by lndir
+ (Bugzilla #408, H.J.Lu).
+ 242. Fixed gcc warnings in xdmauth.c (Bugzilla #410, Jason L. Wright).
+ 241. Updated Citron touchscreen driver: set 'block duration time'
+ to one second to avoid timeouts, added user strings to inform about
+ HW version (Peter Kunzmann).
+ 240. Fixed wraparound bug in TimerSet() (Peter Osterlund).
+ 239. Fixed X*LookupString() in imDevLkup.c to return status
+ XBufferOverflow and the required size as required
+ (Bugzilla #397, Kusanagi Kouichi).
+ Dto. for imLcLkup.c (Egbert Eich).
+ 238. Removed unused function QualifyName, Exit() from Xprint
+ and CountBits(), matchVisuals() from GLX
+ (Bugzilla #395, #400, #394 Jason L. Wright).
+ 237. Fixed type warning when building sunffb driver on 64bit
+ (Bugzilla #404, Jason L. Wright).
+ 236. Fixed warnings when building Palmex touchscreen driver statically
+ (Bugzilla #405, Jason L. Wright).
+ 235. Fixes and updates for XKB keyboard maps:
+ - add programmers variant to the Turkish keyboard map (Nilgün Belma
+ Bugüner)
+ - add a variant of the Romanian keyboard map for German keyboard
+ (Manfred Pohler)
+ - add layout for BTC 9001AH keyboard (Nick Kurshev)
+ - add Uzbek keymap description (Bugzilla #391, Mashrab Kuvatov)
+ - update geometry files (Alexander Pohoyda)
+ 234. Added fonttosfnt, a utility that generates bitmap-only TTFs. It is
+ capable of reading most font formats (Bugzilla #389,
+ Juliusz Chroboczek).
+ 233. Added functionalities to mkfontscale so mkfontscale performs every
+ functionality mkfontdir does (Bugzilla #387, Juliusz Chroboczek).
+ 232. Removed absolute path from cpp for Linux as /usr/bin/ should be
+ in the default search patch (Egbert Eich).
+ 231. Fix regression of Xvideo not working with some videos on the
+ CyberBladeXP/Ai1 chips (Bugzilla #251, Stephane Voltz).
+ 230. Added early failure and warning message when not sufficient memory
+ available for DRI in i8xx driver (Egbert Eich).
+ 229. Fix bug in original patch which added support for two new relocation
+ types for IA64 (Bugzilla #195, John Dennis).
+ 228. Fix scaling calculus in savage driver (Bugzilla #274, Emmanuel).
+ 227. Clarifying if conditions, fixing memory leaks in error path, removing
+ useless code in savage driver (Bugzilla #278+279, Emmanuel).
+ 226. Adding message to R128 driver which informs about modified modes for LCD
+ according to VBIOS (Bugzilla #23, Egbert Eich).
+ 225. Fixed chipset ID for v2100/v2200 for overrides (Egbert Eich).
+ 224. Added interlaced support for Voodoo 3,4,5 to TDFX driver (Bugzilla #383,
+ Jakub Bogusz).
+ 223. Fixed typo in getPciBiosTypes() (Bugzilla #382, Jakub Bogusz).
+ 222. Restore previous mode if mode switch fails (Bugzilla #381, Jakub Bogusz).
+ 221. Fixed typo that prevented lubB19 fonts with different maps from being
+ generated (Bugzilla #380, Jakub Bogusz).
+ 220. Sync entrypoints for OS/2 with recent changes in fontconfig and Xft
+ (Bugzilla #374, Frank Giessler).
+ 219. Added detection of 2Mb memory for CLGD7548, fixed a possible memory
+ leak and did minor cleanups (Bugzilla #369, Lucas Correia Villa Real).
+ (PLEASE TEST!)
+ 218. Recode single-byte keyboard scancodes that clash with recoded
+ double-byte scancodes (David Dawes).
+ 217. Fixes and updates for XKB keyboard maps:
+ - add more EuroSign to "us_intl" keyboard map (Paul Bolle)
+ - update geometry files (Alexander Pohoyda)
+ - add AudioMute key to inet(hpxe3gc) (Bugzilla #350, Paul Pacheco)
+ - add option for replacing RCtrl key with Right Alt (Bugzilla #343,
+ Adam Tlalka)
+ - add Uzbek keyboard map (Bugzilla #372, Mashrab Kuvatov)
+ 216. (Re-)fix portability of gccmakedep and generate ccmakedep on all
+ platforms (Marc La France).
+ 215. Fix i810/i815 problem with interlaced modes where only the top half
+ of the screen gets displayed (Paul Stewart).
+ 214. Changed any occurance of x86_64 to AMD64, the official name of the
+ architecture (Egbert Eich).
+ 213. Removed Copyright sign from man pages as this causes some formatters
+ to choke (Egbert Eich).
+ 212. Export SysV IPC functions to modules in Net and OpenBSD
+ (Bugzilla #355, Quentin Garnier).
+ 211. Fix rootless bug when reordering windows behind others (Torrey T Lyons).
+ 210. Fix page size issues that prevented the mmap()'ing of SBUS devices
+ (Marc La France).
+ 209. Fixes for the following problems on OS/2:
+ - long startup delay of xinit
+ - recovery from hard-error popups
+ - text-mode version of xf86cfg
+ - xf86cfg unable to find default config file
+ - installation of static libraries
+ - missing exported functions in X11.dll
+ - typo in xf86pathIsAbsolute()
+ (Bugzilla #267, Frank Giessler).
+ 208. SiS driver update:
+ Fixed 1280x960 and 1280x1024 LCD support (SiS 30x)
+ Added Chroma-Keying support to Xv part
+ Added support for Barco iQ R and G series projectors
+
+XFree86 4.3.99.6 (10 June 2003)
+ 207. Add support for the Mac's KP_Equal key (untested) (David Dawes).
+ 206. Import fontconfig 2.1.0 as an external package, and update the build
+ to use this version (David Dawes).
+ 205. New version of the FreeType backend. (Bugzilla #325, Juliusz Chroboczek).
+ 204. Rework XDarwin's Cocoa rootless implementation to use new generic
+ rootless code in miext/rootless (Torrey T. Lyons).
+ 203. Fix repeated image problem when using a vesa video mode before starting
+ the Xserver on the S3 Trio3D cards (Alan Hourihane).
+ 202. Import zlib 1.1.4 for systems that don't provide it (Matthieu Herrb).
+ 201. Improve fonts width and weight detection (Bugzilla #265-266,
+ Juliusz Chroboczek).
+ 200. Fix library dependencies for xlibi18n modules (Bugzilla #82, Joe Kelsey,
+ Matthieu Herrb).
+ 199. Fix manual pages typos (Bugzilla #316, Jens Schweikhardt).
+ 198. Fix bug (Bugzilla #315) in _XTextPropertyToTextList() that causes
+ an application crash in some circumstances (Ivan Pascal).
+ 197. Fixes and updates for XKB keyboard maps:
+ - add asciitilde to Swedish 'nodeadkeys' map (Bugzilla #291).
+ - add map for true Romanian keyboard (Bugzilla #300, Manfred Pohler).
+ - add EuroSign to "us_intl" keyboard map (Bugzilla #309, Paul Bolle).
+ - fix some keys in Armenian 'phonetic' layout (Bugzilla #313, Ani).
+ - add some geometry files (Alexander Pohoyda).
+ - some cosmetic changes.
+ 196. Import FreeType 2.1.4, and do initial merge for config/build
+ (David Dawes).
+ 195. Remove unnecessary links of libm (Marc La France).
+ 194. IRIX 6.5 build fixes and noise reductions (Marc La France).
+ 193. Clean up confusion in Imakefiles between XONLYLIB and XLIBONLY (and
+ between DEPXONLYLIB and the previously non-existent DEPXLIBONLY)
+ (Marc La France).
+ 192. Do not unnecessarily link libXmu, libXt and/or libXext into executables
+ (Marc La France).
+ 191. Fix makedepend for IRIX 6.5 (Marc La France).
+ 190. Make the handling of X_BYTE_ORDER in Imakefiles more portable
+ (Marc La France).
+ 189. Allow building of a libXfont without font cache support (Marc La France).
+ 188. When using cpp to generate scripts and data files, change XCOMM to pound
+ signs even when preceeded by only whitespace, and provide a means to
+ generate output lines with trailing backslashes. Change `startx` script
+ accordingly (Marc La France).
+
+XFree86 4.3.99.5 (25 May 2003)
+ 187. Fix XDMCP queries in xdm on systems using getifaddrs().
+ (Bugzilla #277, Joel Ray Holveck).
+ 186. Initial imake/config support for more closely (and more
+ automatically) emulating how libtool handles shared library revisions.
+ Implmemented for Linux only so far (David Dawes).
+ 185. Fix libexpat shared lib revision on platforms that use minor version
+ numbers (David Dawes).
+ 184. Update Tamil keyboard map (Thuraiappah Vaseeharan).
+ 183. Add missing xfs reply to GetEventMask requests (Marc La France).
+ 182. Change the ELF loader to ignore .debug* sections (Marc La France).
+ 181. Simplify internal interfaces in the PCI code and remove the Xserver's
+ interference with normal PCMCIA operation (Marc La France).
+ 180. i810/815 depth buffer needs to be a multiple of the tile size. This
+ fixes 3D corruption near the bottom of the screen at 800x600@16bpp
+ (Bugzilla #283, Dave Airlie).
+ 179. SiS driver update
+ - Allow Modelines for LCD and secondary VGA on 301B
+ - Support plasma panels natively (including a small
+ database for some known panels since some panels
+ report wrong timing data via DDC)
+ 178. DRM resync from the DRI trunk...
+ - Lots of fixes/cleanups/resyncs for the BSD DRM drivers (Eric Anholt).
+ - Fix potential oops and memory leaks when allocations fail in
+ addbufs_agp/pci (Leif Delgass).
+ - Add support for buffer private structs with PCI DMA buffers
+ (Leif Delgass).
+ - Disable MTRRS on FreeBSD-stable (Eric Anholt).
+ - Remove some unused code (Keith Whitwell).
+ - Move prototypes for gamma functions to gamma_drv.h (Keith Whitwell).
+ - 2.5.x resync (Linus Torvalds).
+ - Ensure driver has been initialized before installing irq handler,
+ and modify all drivers to ensure irq handler is removed before
+ cleanup, and cleanup is called at takedown (Leif Delgass).
+ - Check for lock on init/cleanup in all drivers except i810/i830
+ (Leif Delgass).
+ - Put back __HAVE_KERNEL_CTX_SWITCH for the sparc drm driver
+ (Keith Whitwell).
+ - Only free original pagelist in addbufs_pci if one already exists
+ (fixes oops) (Leif Delgass).
+ - texmem-0-0-1 branch merge (Ian Romanick).
+ - Fix warning on machines where sizeof(drm_addr_t) != 4 (Randy Dunlap).
+ - Support AGP bridges where the AGP aperture can't be accessed directly
+ by the CPU (David Mosberger, Benjamin Herrenschmidt, Michel Daenzer,
+ Paul Mackerras, Jeff Wiedemeier).
+ 177. Fix another xedit compile problem (Marc La France).
+ 176. Small fix for Italian keyboard map (Sebastiano Vigna).
+ 175. Don't ship xf86Bus.h and xf86pciBus.h with the SDK (Marc La France).
+ 174. Restore VGA driver's checking for depths 1, 4 & 8 (Marc La France).
+ 173. Fix a problem with savage driver when UseBIOS is off, such that the
+ performance drops dramatically. Now the performance matches or
+ exceeds that of the option UseBIOS (Alan Hourihane).
+ 172. Add workaround for problems that arise when in multi-layout map
+ different modifier keysyms share the same key (Ivan Pascal).
+ 171. Fix bug that causes XGetKeyboardMapping produce incorrect map when keys
+ have more then two keysyms. Also add a map columns duplication for better
+ compatibility with core protocol keyboard maps (Ivan Pascal).
+ 170. Fix XKB bug (Bugzilla #253) that causes an Xserver crash when XKB action
+ RedirectKey is used (Ivan Pascal).
+ 169. Add missing letters to Ukrainian phonetic keyboard map (Andriy Rysin).
+
+XFree86 4.3.99.4 (10 May 2003)
+ 168. Prevent a SIGFPE with the glint/pm3 driver when attempting to display
an XVideo image less than 8 pixels wide (Måns Rullgård).
- 983. Fix double free bug when a Mac-specific font fails to load with
+ 167. Support for building a DRI enabled server on OpenBSD (Wilbern Cobb,
+ Matthieu Herrb).
+ 166. Fix double free bug when a Mac-specific font fails to load with
Freetype (Torrey T. Lyons).
- 982. Check for NULL tObj in the i830 3D driver's TexEnv function. This
+ 165. Check for NULL tObj in the i830 3D driver's TexEnv function. This
fixes a FlightGear crash (Keith Whitwell).
- 981. Fix lockup on server reset in radeon driver
- (Michel Dänzer, Keith Whitwell).
- 980. Set Mesa hooks to flush vertices on state changes in Radeon 3D drivers
+ 164. Set Mesa hooks to flush vertices on state changes in Radeon 3D drivers
(Keith Whitwell).
- 979. Fix to prevent PCI and CardBus resets when switching out of the server's
+ 163. Add an entry to the i2c module that drivers can call to retrieve an array
+ of all I2C buses associated with a screen (Marc La France).
+ 162. Fix to prevent PCI and CardBus resets when switching out of the server's
virtual console (Marc La France).
- 978. Fix infinite loop that occurs on systems whose PCI configuration space
+ 161. Change the /dev/ file used on some *BSD's to mmap the framebuffer in DGA
+ clients to match the /dev/ file used by the server (Marc La France).
+ 160. SiS driver fixes:
+ - Added MergedFB mode (including HWCursor and Xv)
+ - Xv enhancements and fixes for all chipsets
+ - New Xv properties (SWITCHCRT, TVPOSITION, etc)
+ - Added support for custom LCD resolutions (via DDC)
+ - Fixed DVI output (DVI-D and DVI-A), automatic detection
+ - Numerous bugfixes and enhancements
+ (Thomas Winischhofer)
+ 159. Make freetype-config more useful on NetBSD (#5693, Thomas Klausner).
+ 158. Small fixes in keyboard maps:
+ - add an explicit type declaration in level3(ralt_switch)
+ (Bugzilla #225, Séamus Ó Ciardhuáin);
+ - fix wrong group number in Russian keyboard map (Ivan Pascal).
+ 157. Add rootless implementation for XDarwin using Apple's Xplugin API
+ (John Harper, Torrey T. Lyons).
+ 156. Fix precision problems in xf86XVClipVideoHelper and in Mach64 XVideo
+ support (Marc La France).
+ 155. Add missing symbols when DRI is disabled to glint driver
+ (Bugzilla #203, Mike Harris).
+ 154. Fix a memory leak caused by the data allocated in XGetDefault() never
+ being freed (Jim Radford).
+ 153. Update keysym capitalization rules in XConvertCase() with unicode
+ keysyms and some missed charsets (Bugzilla #209, Séamus Ó Ciardhuáin).
+ 152. Use C89 style function prototypes in manual pages (Bugzilla #208,
+ Aidan Kehoe).
+ 151. Fix small memory leaks in XvQueryAdaptors() and __driUtilCreateScreen()
+ (Jim Radford).
+ 150. Updated Wacom driver to support ntuos 2 2D mouse and a few styli,
+ TabletPC with ISD V4 protocol, intiq 15X and Cintiq 18SX
+ (Wacom).
+ 149. Fix programming error in ix86 motherboard chipset determination
+ (Marc La France).
+ 148. Ansi prototypes cleanup in Xserver/include and Xserver/os
+ (Matthieu Herrb).
+ 147. Fix shared libXp dependencies on *BSD and Darwin (Dale Rahn).
+ 146. Fix infinite loop that occurs on systems whose PCI configuration space
doesn't advertise a host bridge (Marc La France).
- 977. Workaround for broken devices that don't implement the header type field
+ 145. Workaround for broken devices that don't implement the header type field
in their PCI configuration space (Marc La France).
- 976. Fix programming error in ix86 motherboard chipset determination
+ 144. Portability changes for older Sun compilers (Alan Coopersmith).
+
+XFree86 4.3.99.3 (25 April 2003)
+ 143. Fix building of the dristat and drmstat utilities (David Dawes).
+ 142. From the DRI trunk...
+ - Remove more dead code from the BSD DRM (Eric Anholt).
+ - Remove some #if 0'd code and unused string functions from the Linux
+ DRM (Keith Whitwell).
+ - Move debug versions of the DRM memory functions to a new file
+ (Keith Whitwell).
+ - drm_memory cleanup (Leif Delgass).
+ - dristat and drmstat cleanups (Leif Delgass).
+ - Remove unused dev->map_count (Leif Delgass).
+ - For the i830 DRM driver, pass the dma handle from pci_alloc_consistent
+ to the card for status page rather than using virt_to_bus on
+ the virtual address (Leif Delgass).
+ - Cleanup the style of the linux-compat code in the BSD DRM, and use
+ ioctl directly rather than reimplementing it (Eric Anholt).
+ 141. Remove old XF86Setup source code. (Matthieu Herrb).
+ 140. Only add all default modes to mode list when RandR is enabled and
+ active (Egbert Eich).
+ 139. MGA driver: vertical blanking can generate interrupt (2D driver part)
+ (Ville Syrjala Bugz.: 199).
+ 138. Fix mmapw SEGV (Marc La France).
+ 137. From the DRI trunk...
+ - Install dummy/noop read & poll fops unless the driver has
+ replacements (Keith Whitwell).
+ - Remove gamma-specific stuff from the BSD DRM (Eric Anholt).
+ - Remove DRM_DMA_HISTOGRAM and associated code from the BSD DRM
+ (Eric Anholt).
+ - Remove BSD DRM's unused drm_init.h (Eric Anholt).
+ - Handle read() failures in the drm X server module (Michel Daenzer).
+ - Set DRM device major for NetBSD.
+ 136. Fix bug that prevented fbman from using the last partial scanline of a
+ Mach64 framebuffer (Marc La France).
+ 135. Make ATI Mach64 FIFO cache integrity testing optional (Marc La France).
+ 134. Export ATI Mach64 hardware overlay as an XVideo adaptor (derived from
+ GATOS project, Egbert Eich, Marc La France).
+ 133. Reorganise ATI Mach64 support into separate source files
(Marc La France).
- 975. Fix bug in mode validation that occurs when the XF86Config doesn't
+ 132. Refine atimisc's decoding of the panel mode on server entry in an attempt
+ to reduce the effect of atyfb bugs (Marc La France).
+ 131. Make Rage128 and Radeon XVideo available even when 2D acceleration is
+ disabled (Marc La France).
+ 130. There is no longer any need to require hardware cursors during Rage128
+ and Radeon XVideo displays (Marc La France).
+ 129. Initialise v4l's XVideo adaptors last (Marc La France).
+ 128. Reduce cut&paste effects by adding more helpers to Xv
+ (derived from #5645, Björn Augustsson, Marc La France).
+ 127. Centralise a region comparison primitive into 'mi' and use it instead of
+ local definitions throughout the server (Marc La France).
+ 126. DPMSExtension & XvExtension driver cleanups (Marc La France).
+ 125. Add missing tests for vtSema to xaa 'Picture' functions.
+ These missing checks caused strange behavior with some drivers
+ when RENDER extension requests were made while X was switched away.
+ (Egbert Eich).
+ 124. i810 driver: call drmCtlUninstHandler() on CloseScreen()
+ (David Airlie).
+ 123. Savage driver updated to 1.1.1.27: several fixes for video glitches
+ (Tim Roberts).
+ 122. Put back the DRM part of Charl Botha's Radeon suspend/resume support
+ that was inadvertently backed out in the DRI resync last week.
+ 121. Resync the Linux drm modules with the DRI trunk. Includes:
+ - Check for NULL map before calling DRM(ioremapfree) on cleanup
+ (Leif Delgass).
+ - Remove DRM read, poll and write_string (Keith Whitwell).
+ - Add more get_param queries for embedded project (Keith Whitwell).
+ - Move a bunch of gamma-specific code into a gamma-specific file,
+ and restore the kooky DRM(write_string) code for gamma
+ (Keith Whitwell).
+ - Remove unused DMA histogram code (Keith Whitwell).
+ - Remove unused 'DRM_FLAG_NOCTX' option (Keith Whitwell).
+ - Remove unused __HAVE_KERNEL_CTX_SWITCH code (Keith Whitwell).
+ - Fix templates so the i8x0 drivers don't have to define
+ __HAVE_DMA_WAITLIST (Keith Whitwell).
+ - Gamma drm updates (Alan Hourihane).
+ - Only mga, i810, i830 require AGP (Leif Delgass).
+ - Remove PCIGART_ENABLED define for radeon, pcigart support now
+ included for any arch (Leif Delgass).
+ - Get rid of superfluous fields in struct drm_radeon_ring_buffer
+ (Michel Daenzer).
+ - Use correct address for radeon ring read pointer writeback
+ (Michel Daenzer).
+ 120. Fix a potential bug in ZX1 support (Marc La France).
+ 119. Fix a buffer overflow in xkbprint (Ivan Pascal).
+ 118. Fix a bug in Xlib that prevents a vertical text drawing with
+ X[mb|wc]DrawString (bugzilla #178, OSAME Ken-ichiro).
+ 117. Added missing files to the SDK so it can actually be used (Sven Luther).
+ 116. mkfontscale enhancements (bugzilla #166, Julius Chroboczek).
+ 115. Fix handling of local host names in /etc/X<n>.hosts (bugzilla #156,
+ Alan Coopersmith).
+ 114. Add to XLookupString an automatic search of the layout which keysym can
+ be converted to a control-code when Control modifier is set (Ivan Pascal).
+ 113. Fix xkbcomp crash with some combinations of layouts in a multi-layout
+ keyboard map (Ivan Pascal).
+ 112. Keyboard maps cleanups, including:
+ - fix incorrect aliases in a keycodes file.
+ - remove unneeded type declarations.
+ - remove ThirdLevel modifier key descriptions in maps and replace them
+ with references to a common one in 'level3' file.
+ - some cosmetic changes.
+ (Ivan Pascal).
+ 111. Fix some function definition conflicts from Xlib cleanup when X_LOCALE
+ or NeedWidePrototypes is set (Torrey T. Lyons).
+ 110. Resync the BSD drm modules with the DRI trunk (Eric Anholt).
+ 109. Resync the Linux drm modules with the DRI trunk. Includes:
+ - Add 2nd arg for DRM_FREE (Keith Whitwell).
+ - Use file pointers instead of pids for resource and lock tracking
+ (Keith Whitwell).
+ - Add 'SG' map type identifier string ((pci scatter/gather) to /proc vm
+ info (Leif Delgass).
+ - Use list_entry() to get container struct from struct list_head
+ pointers. Build fix for RedHat 9 kernel (5 args to
+ remap_page_range()) (Leif Delgass).
+ 108. Fix a server crash with shadowfb and render when refreshing outside the
+ visible screen (Sven Luther).
+ 107. Fix a potential infinite loop during server generation when in
+ Xinerama (Rik Faith).
+ 106. Fix DRM module build on 2.5.41 and later kernels (tqueue -> workqueue)
+ (David Dawes).
+ 105. Fix lockup when using Xv in the trident driver (Alan Hourihane).
+ 104. Add support for TV chipsets VT1621 and CH7005 to the trident driver
+ (VIA, Alan Hourihane).
+ 103. Add VIA CLE266 driver (Bugzilla #154, VIA/S3)
+ 102. Remove non-functioning glxStub, and remove external GlxStaticServerLib
+ support (David Dawes).
+ 101. Change the WORLDOPTS default to empty. This means that 'make World'
+ will now stop on the first error. To get the old behaviour, run
+ 'make WORLDOPTS=-k World' (David Dawes).
+ 100. Add preliminary version of generic rootless code based on XDarwin's
+ rootless mode (Torrey T. Lyons, John Harper).
+ 99. Remove PEX and XIE source code (Matthieu Herrb).
+ 98. The XKB version of XRefreshKeyboardMapping() had an UnlockDisplay()
+ call without a preceding LockDisplay() call (Yoel Perl).
+ 97. Xlib cleanups and fixes, including:
+ - Fixed up any old style function defintions that raised warnings.
+ - Fixed functions with no parameter or return value.
+ - Moved any external prototype in a c-files to h-files.
+ - Set unreferenced and unmentioned functions to static.
+ - Completed any forward declartion with its calling parameters.
+ - Established function typedefs where might be helpful.
+ - Fixed bogus XIM callback function to XID type, fixed XPointer* -
+ XPointer mismatch on some callback.
+ - Added explicit FIXME XXX statement on locations for the work around
+ macro XCMS_CONVERSION_HARDWARE where the compiler was unsatisfied
+ about a known problem with the currently inconsistent src_to_CIEXYZ
+ table types.
+ - Split _XcmsSetGetColor and *Colors handling routine in order
+ to avoid any type conflicts there, fixed a memory leak for
+ error case in that area. Used stack based Buffer for single-color
+ version (should be simpler and faster).
+ - Fixed _XAsyncReply where a "register variable pend" was passed
+ and returned with the & operator. This location is further
+ suspect of variable size problems on anything else but 32 bit
+ platforms, with the new code it might more likely raise a type
+ mismatch warning for those specific location.
+ (#A.1729, Alexander Stohr).
+ 96. Fix the <KPDL> mapping for the hr XKB map, and add an hr_US map (#A.1726,
+ Vlatko Kosturjak).
+ 95. Fix vmware driver crash when running two X servers concurrently (#5688,
+ Nolan Leake).
+ 94. Rework the Linux drm kernel module build to leverage off the standard
+ kernel build system. This is based on suggestions and examples from
+ David Woodhouse. This approach has the advantage that the build
+ requirements of a wider range of standard kernels are now supported
+ transparently, but the disadvantage of some extra complexity to handle
+ building against clean vendor-distributed kernel source trees.
+ This has been tested with some recent Red Hat and SuSE distributions
+ (David Dawes).
+ 93. Update Italian keyboard map (Bugzilla #109, Sebastiano Vigna).
+ 92. Add keys missed in multi-layout keyboard maps: LSGT key in Belgian map
+ and 'old','phonetic' variants in Armenian map (Ivan Pascal).
+ 91. More reliable workaround for handling the I830Sync() function being
+ called while VT switched away (David Dawes).
+ 90. Fix references to DRI functions in non-DRI i810_driver.c build
+ (David Dawes).
+ 89. Import expat 1.95.4 (Matthieu Herrb).
+
+XFree86 4.3.99.2 (10 April 2003)
+ 88. Fix file descriptor leaks in xman (Ted Unangst, OpenBSD PR#3186).
+ 87. Fix bug in mode validation that occurs when the XF86Config doesn't
specify any mode or virtual resolution information (Marc La France).
- 974. Another int10 fix. This time for adapters found at PCI:0:0:0. This
+ 86. Resetting 'bound' flag for an agp entry after undbind succeeded in
+ drm_agpsupport.h (Egbert Eich).
+ 85. Ignoring hw_lock for drm device if lock was set by a different instance
+ (ie Xserver) to prevent second server to spin in driver release function
+ (currently only relevant for i8xx drm drivers) (David Dawes).
+ 84. Adding extra delay before doing a slowBcopy in ia64 to prevent a MC
+ when saving/restoring VGA fonts (Egbert Eich).
+ 83. Turn off needToSync in LeaveVT() in i830 driver to prevent server
+ crashes because xaa tries to sync blitter while switched away
+ (Egbert Eich).
+ 82. Added the O_SYNC flag when opening /dev/mem to work around a kernel bug
+ which causes conflits between WC settings in MTRR registers and cacheable
+ attribute in page table (Egbert Eich).
+ 81. Reduced retry count for mouse configuration to 4. This should speed
+ up server start for people who use a mouse repeater like gpm
+ (Egbert Eich).
+ 80. Fixed xf86cfg to duplicate font names before they get freed when
+ unloading the module (Egbert Eich).
+ 79. Added missing functions to xf86cfg (Egbert Eich).
+ 78. Added missing ROP_NEEDS_SOURCE to Savage driver;
+ now all 2D accel functions should use this flag (Egbert Eich).
+ 77. Reduced flicker with video playback in Savage driver (Tim Roberts).
+ 76. Load vgahw submodule in RENDITION driver before using it
+ (Egbert Eich).
+ 75. Magically speed up video playback on Neomagic (Egbert Eich).
+ 74. Added drmAgpUnbind()/drmAgpBind() functionality on Leave/Enter for i810
+ cards to allow a second Xserver to be started if the first one has
+ DRI enabled (Egbert Eich).
+ 73. Set NeedRingBufferLow for i855/i865 to avoid lockups on vt switches
+ (Egbert Eich).
+ 72. Check for vtSema before accessing registers in I830BIOSSaveScreen()
+ (Egbert Eich).
+ 71. Some sanity fixes for atiprobe to work better with xf86cfg: Handle
+ situation gracefully if the PCI config pointer doesn't exist
+ (Egbert Eich).
+ 70. Changed behavior of fontfile: don't drop the entire directory if some
+ fonts cannot be rendered (Egbert Eich).
+ 69. Fixed B&H bdf fonts: AVERAGE_WIDTH is not a string but an int (Mike Fabian).
+ 68. Fixed type in radeon driver which caused display to go into
+ powersaving mode when Xcursor is disabled (Bugz: 90, Michel Dänzer).
+ 67. Fixed typo in XKB-Config.sgml (Bugz: 53, Hiroyuki Bessho).
+ 66. Fix SiliconMotion driver for mode switching and SEGV problem when
+ initializing Xv functionality (Bugzilla #50, Alan Hourihane).
+ 65. Add Radeon DRI suspend/resume support (Charl Botha, #A.1431).
+ 64. Rage 128 Xv fix for high resolution displays (Rik Faith).
+ 63. PPC updates for Radeon (Michel Dänzer, Hui Yu@ATI).
+ 62. Radeon patch from ATI (Hui Yu@ATI).
+ - IGP320/330/340 support (2D only)
+ - RV280 (9200/M9+) support
+ - Fix for some M9 laptop panels
+ - Improved version of monitor detection code previously submitted
+ - Fixed bug for two or more radeon cards
+ - Man page updates
+ - Workaround for double scan modes problem at high resolutions
+ - Overlay scaling problem when RMX is used
+ 61. Fix xprop to get all windows (not only the first) in a property holding
+ a window list printed (#A.1676, Kim Woelders).
+ 60. Fix for spontaneous repeated keyboard events during sync grab (#A.1713,
+ Michal Maruska).
+ 59. Fixed DPMS problem on C&T 69000 due to incorrect LCD flag
+ (Bugzilla #101, Egbert Eich).
+ 58. Added xkb symbols layout for BTC 5090 internet keyboard
+ (Bugzilla #57, Jack Angel).
+ 57. Fix the Xinstall.sh script so that it can handle being run from a
+ directory with white space in its path name (#A.1690, Eric Branlund).
+ 56. Allow AGPGART support to be enabled for OpenBSD (#A.1684, Brian Feldman).
+ 55. Make the mouse driver check the SendDragEvents option (based on #A.1682,
+ Juuso Åberg).
+ 54. Fix a double allocation in _XTextPropertyToTextList() (#A.1681,
+ Lubos Lunak).
+ 53. Fix a typo that causes the 'yu' keymap to emit a lower case 'L' in
+ both shift states (#A.1675, Nikola Smolenski).
+ 52. Allow the remote shell command for xon to be specified from the
+ command line. This allows ssh to be used (for example) (#A.1657,
+ Mike Urban).
+ 51. Fix segfaults that can happen when using composition of RENDER and
+ non-RENDER fonts (#A.1656, Wu Jian Feng).
+ 50. Add convenient ways to enter "double quote" and "cedilla" with the
+ en_US.UTF-8 compose rules (Alexandre Oliva).
+ 49. Improve support for Wacom Cintiq boards (#A.1547, Sebastian Rittau).
+ 48. Add support for Kensington's "ValuMouse" to the mouse driver (#A.1494,
+ Roy Wood).
+ 47. Workaround for a crash that happens if a scalable font has a bitmap
+ entry in fonts.dir (#5687, Juliusz Chroboczek).
+ 46. Single/dual rasterizer quiescence patch for the glint/gamma DRI driver
+ (#5685, Sven Luther).
+ 45. Fix a FreeBSD/alpha build problem (#5679, Fred Clift).
+ 44. Fix a bug in the GLU/project.3gl man page (#5676, Thomas Klausner).
+ 43. Luit fixes:
+ - Fix a buffer overflow.
+ - Allow for holes in the pty space, and use the union of the pty
+ names in 4.4BSD and recent FreeBSD.
+ - Allow luit to be set-uid on all BSD releases, and introduce an
+ additional security fix on POSIX saved-id systems.
+ (#5672, 5674, ITO Tsuyoshi, Juliusz Chroboczek).
+ 42. Fix memory leaks in ProcXF86VidModeModModeLine and
+ ProcXF86VidModeValidateModeLine, and unintialized fields of the mode
+ structure in ProcXF86VidModeAddModeLine, VidModeCreateMode, and
+ VidModeAddModeline (#5671, Miguel Freitas).
+ 41. Fix SEGV in fbdev's mode validation (Alexandr Andreev).
+ 40. Add two more variations of Thai XKB maps (#5658,
+ Theppitak Karoonboonyanan, Visanu Euarchukiati,
+ Supphachoke Santiwichaya).
+ 39. Fix a twm crash when the window menu is used and no windows are open
+ (#5667, Matthias Scheler).
+ 38. Restore the sign of UNDERLINE_POSITION in the FreeType backend (#5665,
+ Roman Kagan).
+ 37. Check the return value of fclose() in xauth to prevent losing the
+ existing contents of an Xauthority file when there is insufficient
+ space to write the new one (#5663, Owen Taylor).
+ 36. Fix case in xmag which would cause a BadMatch during a X_GetImage for
+ single child of root class InputOnly. Also do some null pointer
+ protection (#5657, Kevin Brosius).
+ 35. Allow an arbitary message to be sent to the DDX by pressing a key
+ which has the appropriate action definition (#5519, Joe Moss).
+ 34. Add a new request to the XF86Misc extension that allows a client
+ to send an arbitrary message to the DDX, which in turn can send the
+ message to the driver. The driver may also send a string back.
+ An example of this is implemented for the radeon driver (#5518,
+ Joe Moss).
+ 33. Remove duplicate XShmGetEventBase() declaration (#5656,
+ Branden Robinson).
+ 32. Fix drag lock when using a mouse button greater than 4
+ (Bugzilla #51, Paul Elliott)
+ 31. Fix lockup on server shutdown/restart with the radeon driver
+ (Bugzilla #94, Michel Dänzer).
+ 30. Add missing symbols to reference list that show up when DRI is not
+ loaded in r128 driver (Bugzilla #83, Leif Delgass).
+ 29. Add missing symbols to reference list that show up when DRI is not
+ loaded in mga driver (Bugzilla #84, Leif Delgass).
+ 28. Various build and warning fixes (#A.1703, Peter Breitenlohner).
+ 27. Avoid overlapping strcpy() in imake.c (Dan Nelson).
+ 26. Updates for building on OS/2 (#5650, Frank Giessler).
+
+XFree86 4.3.99.1 (23 March 2003)
+ 25. Xterm patch #176 (Thomas Dickey).
+ 24. Another int10 fix. This time for adapters found at PCI:0:0:0. This
fix is particularly important for ZX1-based systems (Marc La France).
- 973. int10 fix for all ix86 non-Linux systems (Marc La France).
- 972. Fix compatibility problem between modules generated without the recent
+ 23. int10 fix for all ix86 non-Linux systems (Marc La France).
+ 22. Add preliminary support for generating HTML and PDF versions of most
+ spec documents (David Dawes).
+ 21. Use lower-case extensions uniformly for text and PostScript documents
+ (based on #4876, Branden Robinson).
+ 20. Disable cuase of SEGV's in rendition driver (Marc La France).
+ 18. Limit 440EX & 440LX based systems to 32 PCI buses (Marc La France).
+ 18. Fix typo that caused incorrect initialization of xkb memory
+ (John Heasley).
+ 17. Fix bug in trident driver that caused old Cyber 9382/9385 chipsets
+ to display half a jittered screen (Alan Hourihane).
+ 16. Add shadowfb support to XDarwin IOKit mode (Torrey T. Lyons).
+ 15. Change most of os-support/ to respect VIDMEM_READONLY (Marc La France).
+ 14. Fix compatibility problem between modules generated without the recent
setjmp/longjmp work and a server generated using glibc <= 2.2.*
(Marc La France).
- 971. setjmp/longjmp related fixes for Linux/libc5 systems (Marc La France).
- 970. Make setjmp/longjmp emulation save/restore blocked signal masks on all
+ 13. setjmp/longjmp related fixes for Linux/libc5 systems (Marc La France).
+ 12. Fix possible overflow in _XlcLocaleDirName. (Matthieu Herrb).
+ 11. Various NetBSD fixes for non-i386 (#5662, #5666 Aymeric Vincent,
+ Matthew Green, Chris Gilbert, Thomas Klausner).
+ 10. Enable native thread support on NetBSD 1.6M and later (#5597, #5660,
+ Matthias Scheler).
+ 9. Make setjmp/longjmp emulation save/restore blocked signal masks on all
libc5 & glibc systems (Marc La France).
- 969. Fix setjmp/longjmp emulation for glibc 2.2.[01] systems and remove
+ 8. Fix for non-PC keyboard bug introduced by changes to make SysRq
+ generate the same keycode as PrtScrn (Ivan Pascal).
+ 7. Workaround for problems linking C programs against libGLU on FreeBSD 3.x
+ (David Dawes).
+ 6. Make setjmp/longjmp emulation save/restore blocked signal masks on all
+ 5. Fix setjmp/longjmp emulation for glibc 2.2.[01] systems and remove
HasGlibc21Sigsetjmp override (Marc La France).
- 968. setjmp/longjmp-related compilation fixes for libc5 systems
+ 4. setjmp/longjmp-related compilation fixes for libc5 systems
(Marc La France).
- 967. Fix possible overflow in _XlcLocaleDirName. (Matthieu Herrb).
- 966. Fix XDarwin build broken by #960 (Shantonu Sen).
- 965. Fix StaticColor colormap on Darwin/x86 6.x (Rob Braun).
+ 3. Fix minor glitch in the generation of Makefiles for libraries that don't
+ need threads support (Marc La France).
+ 2. Fix XDarwin build broken by #960 (Shantonu Sen).
+ 1. Fix StaticColor colormap on Darwin/x86 6.x (Rob Braun).
XFree86 4.3.0 (27 February 2003)
964. Add an imake option to allow the glibc21-style setjmp() behaviour
@@ -91,7 +1741,7 @@ XFree86 4.3.0 (27 February 2003)
ARGB cursors by always using the ARGB mode (#A.1639, Michel Dänzer and
Fredrik Höglund).
944. Fix rootless XDarwin crash when trying to GetImage with a rectangle
- bigger then the associated top level window (Apple).
+ bigger then the associated top level window (John Harper).
943. Add support for multi-head on ZX1-based Itanium2 systems (Marc La France
with documentation and assistance from Hewlett-Packard).
942. Correctly initialize the RE_LINE_PATTERN register in the radeon
@@ -443,14 +2093,14 @@ XFree86 4.2.99.901 (4 February 2003)
797. Fix for memory fences on PowerPC (Marc La France).
796. Work-around for Radeon int10 problems (Marc La France).
795. Fix XDarwin crash in rootless mode with 16-bit color by ensuring that
- window pixmap pointers are 32-bit aligned (Apple, Torrey T. Lyons).
+ window pixmap pointers are 32-bit aligned (John Harper, Torrey T. Lyons).
794. Update the i810 2D driver and i830 3D drivers to recognise and handle
the Intel 852GM/855GM integrated graphics chipsets (David Dawes,
Keith Whitwell).
793. Force extension-generated mode switches always occur (Marc La France).
792. Fix OS/2 library build problem (Frank Giessler).
791. Fix bug that at times prevented recognition of resources decoded on PCI
- root busses (Marc La France).
+ root buses (Marc La France).
790. Fix XDarwin's spurious transparent regions in rootless windows
(Torrey T. Lyons).
789. Fix bug in recognition of certain ix86 Host-to-PCI bridges
@@ -483,7 +2133,7 @@ XFree86 4.2.99.901 (4 February 2003)
(#A.1539, Juergen Keil).
773. Fix artifacts left by XDarwin when reshaping a shaped window (reported
by Adrian Umpleby).
- 772. Fix XDarwin rootless crash when resizing a window (Apple).
+ 772. Fix XDarwin rootless crash when resizing a window (John Harper).
771. Fix vbe module to not assume BIOS call results are zero-extended
(Paulo Cesar Pereira de Andrade).
770. Fix improper initialisation of pciConfigRec's. Reported by Marcel
@@ -495,7 +2145,7 @@ XFree86 4.2.99.901 (4 February 2003)
(reported by Alexis Vartanian).
XFree86 4.2.99.4 (20 January 2003)
- 766. Fix XDarwin's rootless mode with 16-bit color (Apple).
+ 766. Fix XDarwin's rootless mode with 16-bit color (John Harper).
765. Allow UTF8 conversion to work for Japanese locales (#A.1527,
Etsushi Kato).
764. Add a method for working around a problem that can show up when
@@ -16580,7 +18230,7 @@ XFree86 3.0a (28 April 1994)
XFree86 3.0 (26 April 1994)
-$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.2588.2.13 2003/05/10 01:12:56 dawes Exp $
+$XFree86: xc/programs/Xserver/hw/xfree86/CHANGELOG,v 3.2982 2003/11/21 06:01:42 dawes Exp $
diff --git a/hw/xfree86/doc/devel/README.DRIcomp b/hw/xfree86/doc/devel/README.DRIcomp
index 1e9773ccc..0f1bd1b69 100644
--- a/hw/xfree86/doc/devel/README.DRIcomp
+++ b/hw/xfree86/doc/devel/README.DRIcomp
@@ -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
-
-or alternatively, edit Makefile to include this change.
+ make -f Makefile.linux LINUXDIR=/usr/src/linux-2.4.x
-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 $
diff --git a/hw/xfree86/doc/sgml/DESIGN.sgml b/hw/xfree86/doc/sgml/DESIGN.sgml
index 322ab00e0..365acaf1a 100644
--- a/hw/xfree86/doc/sgml/DESIGN.sgml
+++ b/hw/xfree86/doc/sgml/DESIGN.sgml
@@ -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 {
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index b08379099..409ada437 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -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)) {
diff --git a/hw/xfree86/dri/sarea.h b/hw/xfree86/dri/sarea.h
index 99c04b9e9..fcb4b59bd 100644
--- a/hw/xfree86/dri/sarea.h
+++ b/hw/xfree86/dri/sarea.h
@@ -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;
diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c
index 7920b217d..3df0cca59 100644
--- a/hw/xfree86/dri/xf86dri.c
+++ b/hw/xfree86/dri/xf86dri.c
@@ -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);
diff --git a/hw/xfree86/dummylib/dummylib.h b/hw/xfree86/dummylib/dummylib.h
index 4b685e272..d8a0d285a 100644
--- a/hw/xfree86/dummylib/dummylib.h
+++ b/hw/xfree86/dummylib/dummylib.h
@@ -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 */
diff --git a/hw/xfree86/dummylib/xf86drvmsg.c b/hw/xfree86/dummylib/xf86drvmsg.c
index ffcefd6bf..5780d9c13 100644
--- a/hw/xfree86/dummylib/xf86drvmsg.c
+++ b/hw/xfree86/dummylib/xf86drvmsg.c
@@ -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);
}
diff --git a/hw/xfree86/dummylib/xf86drvmsgverb.c b/hw/xfree86/dummylib/xf86drvmsgverb.c
index f59c42abf..b7c0ddb53 100644
--- a/hw/xfree86/dummylib/xf86drvmsgverb.c
+++ b/hw/xfree86/dummylib/xf86drvmsgverb.c
@@ -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);
}
diff --git a/hw/xfree86/dummylib/xf86errorf.c b/hw/xfree86/dummylib/xf86errorf.c
index 072f639ca..122f46d43 100644
--- a/hw/xfree86/dummylib/xf86errorf.c
+++ b/hw/xfree86/dummylib/xf86errorf.c
@@ -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);
}
diff --git a/hw/xfree86/dummylib/xf86errorfverb.c b/hw/xfree86/dummylib/xf86errorfverb.c
index 61bff15a5..61c3e02a2 100644
--- a/hw/xfree86/dummylib/xf86errorfverb.c
+++ b/hw/xfree86/dummylib/xf86errorfverb.c
@@ -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);
}
diff --git a/hw/xfree86/dummylib/xf86msg.c b/hw/xfree86/dummylib/xf86msg.c
index bc8c76626..2d36bea97 100644
--- a/hw/xfree86/dummylib/xf86msg.c
+++ b/hw/xfree86/dummylib/xf86msg.c
@@ -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);
}
diff --git a/hw/xfree86/dummylib/xf86msgverb.c b/hw/xfree86/dummylib/xf86msgverb.c
index b9e343fd9..f460b6b9f 100644
--- a/hw/xfree86/dummylib/xf86msgverb.c
+++ b/hw/xfree86/dummylib/xf86msgverb.c
@@ -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);
}
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index a90fff34c..752cdb044 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -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))
diff --git a/hw/xfree86/fbdevhw/fbdevhw.h b/hw/xfree86/fbdevhw/fbdevhw.h
index 78a5b5882..cfc47f905 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.h
+++ b/hw/xfree86/fbdevhw/fbdevhw.h
@@ -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);
diff --git a/hw/xfree86/fbdevhw/fbdevhwstub.c b/hw/xfree86/fbdevhw/fbdevhwstub.c
index 02086ef8f..b262be90f 100644
--- a/hw/xfree86/fbdevhw/fbdevhwstub.c
+++ b/hw/xfree86/fbdevhw/fbdevhwstub.c
@@ -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;
diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c
index 494f9303b..a7f5adf1a 100644
--- a/hw/xfree86/i2c/xf86i2c.c
+++ b/hw/xfree86/i2c/xf86i2c.c
@@ -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;
+}
diff --git a/hw/xfree86/i2c/xf86i2c.h b/hw/xfree86/i2c/xf86i2c.h
index 42b68a179..e7423155a 100644
--- a/hw/xfree86/i2c/xf86i2c.h
+++ b/hw/xfree86/i2c/xf86i2c.h
@@ -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 */
diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c
index d481f000d..845c8a177 100644
--- a/hw/xfree86/int10/generic.c
+++ b/hw/xfree86/int10/generic.c
@@ -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;
diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c
index 2d6c0eb24..7528fea0e 100644
--- a/hw/xfree86/int10/helper_exec.c
+++ b/hw/xfree86/int10/helper_exec.c
@@ -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;
diff --git a/hw/xfree86/int10/xf86int10.c b/hw/xfree86/int10/xf86int10.c
index d6c5d1f43..a74bbeacd 100644
--- a/hw/xfree86/int10/xf86int10.c
+++ b/hw/xfree86/int10/xf86int10.c
@@ -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
diff --git a/hw/xfree86/loader/aout.h b/hw/xfree86/loader/aout.h
index 2e58f2cab..cd7807531 100644
--- a/hw/xfree86/loader/aout.h
+++ b/hw/xfree86/loader/aout.h
@@ -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_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 */
+#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 */
+
+ 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
diff --git a/hw/xfree86/loader/aoutloader.c b/hw/xfree86/loader/aoutloader.c
index 98e657dca..f77b3d73c 100644
--- a/hw/xfree86/loader/aoutloader.c
+++ b/hw/xfree86/loader/aoutloader.c
@@ -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;
-
- 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";
- }
+ 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";
+ }
return NULL;
}
-
diff --git a/hw/xfree86/loader/aoutloader.h b/hw/xfree86/loader/aoutloader.h
index 2714b140f..b0e156319 100644
--- a/hw/xfree86/loader/aoutloader.h
+++ b/hw/xfree86/loader/aoutloader.h
@@ -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
diff --git a/hw/xfree86/loader/ar.h b/hw/xfree86/loader/ar.h
index 4dbc97901..956b810a0 100644
--- a/hw/xfree86/loader/ar.h
+++ b/hw/xfree86/loader/ar.h
@@ -1,5 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/ar.h,v 1.3 1998/07/25 16:56:12 dawes Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/ar.h,v 1.4 2003/10/15 16:29:02 dawes Exp $ */
#ifndef _AR_H
#define _AR_H
@@ -10,13 +9,13 @@
#if !(defined(__powerpc__) && defined(Lynx))
struct ar_hdr {
- char ar_name[16],
- ar_date[12],
- ar_uid[6],
- ar_gid[6],
- ar_mode[8],
- ar_size[10],
- ar_fmag[2];
+ char ar_name[16];
+ char ar_date[12];
+ char ar_uid[6];
+ char ar_gid[6];
+ char ar_mode[8];
+ char ar_size[10];
+ char ar_fmag[2];
};
#else
@@ -25,35 +24,31 @@ struct ar_hdr {
#define SAIAMAG 8
#define AIAFMAG "`\n"
-struct fl_hdr /* archive fixed length header - printable ascii */
-{
- char fl_magic[SAIAMAG]; /* Archive file magic string */
- char fl_memoff[12]; /* Offset to member table */
- char fl_gstoff[12]; /* Offset to global symbol table */
- char fl_fstmoff[12]; /* Offset to first archive member */
- char fl_lstmoff[12]; /* Offset to last archive member */
- char fl_freeoff[12]; /* Offset to first mem on free list */
+struct fl_hdr { /* archive fixed length header - printable ascii */
+ char fl_magic[SAIAMAG]; /* Archive file magic string */
+ char fl_memoff[12]; /* Offset to member table */
+ char fl_gstoff[12]; /* Offset to global symbol table */
+ char fl_fstmoff[12]; /* Offset to first archive member */
+ char fl_lstmoff[12]; /* Offset to last archive member */
+ char fl_freeoff[12]; /* Offset to first mem on free list */
};
#define FL_HDR struct fl_hdr
#define FL_HSZ sizeof(FL_HDR)
-
-struct ar_hdr /* archive file member header - printable ascii */
-{
- char ar_size[12]; /* file member size - decimal */
- char ar_nxtmem[12]; /* pointer to next member - decimal */
- char ar_prvmem[12]; /* pointer to previous member - decimal */
- char ar_date[12]; /* file member date - decimal */
- char ar_uid[12]; /* file member user id - decimal */
- char ar_gid[12]; /* file member group id - decimal */
- char ar_mode[12]; /* file member mode - octal */
- char ar_namlen[4]; /* file member name length - decimal */
- union
- {
- char an_name[2]; /* variable length member name */
- char an_fmag[2]; /* AIAFMAG - string to end header */
- } _ar_name; /* and variable length name */
+struct ar_hdr { /* archive file member header - printable ascii */
+ char ar_size[12]; /* file member size - decimal */
+ char ar_nxtmem[12]; /* pointer to next member - decimal */
+ char ar_prvmem[12]; /* pointer to previous member - decimal */
+ char ar_date[12]; /* file member date - decimal */
+ char ar_uid[12]; /* file member user id - decimal */
+ char ar_gid[12]; /* file member group id - decimal */
+ char ar_mode[12]; /* file member mode - octal */
+ char ar_namlen[4]; /* file member name length - decimal */
+ union {
+ char an_name[2]; /* variable length member name */
+ char an_fmag[2]; /* AIAFMAG - string to end header */
+ } _ar_name; /* and variable length name */
};
#define ar_name _ar_name.an_name
@@ -74,4 +69,3 @@ struct ar_hdr /* archive file member header - printable ascii */
#endif /* !__powerpc__ && Lynx */
#endif /* _AR_H */
-
diff --git a/hw/xfree86/loader/coff.h b/hw/xfree86/loader/coff.h
index cebf5e179..52553278e 100644
--- a/hw/xfree86/loader/coff.h
+++ b/hw/xfree86/loader/coff.h
@@ -1,5 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coff.h,v 1.5 1998/07/25 16:56:12 dawes Exp $ */
-
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coff.h,v 1.6 2003/10/15 16:29:02 dawes Exp $ */
/* This file was implemented from the information in the book
Understanding and Using COFF
@@ -20,7 +19,7 @@
#ifndef _COFF_H
#define _COFF_H
-#define E_SYMNMLEN 8 /* Number of characters in a symbol name */
+#define E_SYMNMLEN 8 /* Number of characters in a symbol name */
/*
* Intel 386/486
*/
@@ -29,15 +28,14 @@
* FILE HEADER
*/
-typedef struct COFF_filehdr
-{
- unsigned short f_magic; /* magic number */
- unsigned short f_nscns; /* number of sections */
- long f_timdat; /* time & date stamp */
- long f_symptr; /* file pointer to symtab */
- long f_nsyms; /* number of symtab entries */
- unsigned short f_opthdr; /* sizeof(optional hdr) */
- unsigned short f_flags; /* flags */
+typedef struct COFF_filehdr {
+ unsigned short f_magic; /* magic number */
+ unsigned short f_nscns; /* number of sections */
+ long f_timdat; /* time & date stamp */
+ long f_symptr; /* file pointer to symtab */
+ long f_nsyms; /* number of symtab entries */
+ unsigned short f_opthdr; /* sizeof(optional hdr) */
+ unsigned short f_flags; /* flags */
} FILHDR;
#define FILHSZ sizeof(FILHDR)
@@ -46,18 +44,17 @@ typedef struct COFF_filehdr
* SECTION HEADER
*/
-typedef struct COFF_scnhdr
-{
- char s_name[8]; /* section name */
- long s_paddr; /* physical address */
- long s_vaddr; /* virtual address */
- long s_size; /* section size */
- long s_scnptr; /* raw data for section */
- long s_relptr; /* relocation */
- long s_lnnoptr; /* line numbers */
- unsigned short s_nreloc; /* number of relocation entries */
- unsigned short s_nlnno; /* number of line number entries*/
- long s_flags; /* flags */
+typedef struct COFF_scnhdr {
+ char s_name[8]; /* section name */
+ long s_paddr; /* physical address */
+ long s_vaddr; /* virtual address */
+ long s_size; /* section size */
+ long s_scnptr; /* raw data for section */
+ long s_relptr; /* relocation */
+ long s_lnnoptr; /* line numbers */
+ unsigned short s_nreloc; /* number of relocation entries */
+ unsigned short s_nlnno; /* number of line number entries */
+ long s_flags; /* flags */
} SCNHDR;
#define COFF_SCNHDR struct COFF_scnhdr
@@ -68,41 +65,36 @@ typedef struct COFF_scnhdr
* the optional COFF header as used by Linux COFF
*/
-typedef struct
-{
- char magic[2]; /* type of file */
- char vstamp[2]; /* version stamp */
- char tsize[4]; /* text size in bytes */
- char dsize[4]; /* initialized data */
- char bsize[4]; /* uninitialized data */
- char entry[4]; /* entry point */
- char text_start[4]; /* base of text */
- char data_start[4]; /* base of data */
+typedef struct {
+ char magic[2]; /* type of file */
+ char vstamp[2]; /* version stamp */
+ char tsize[4]; /* text size in bytes */
+ char dsize[4]; /* initialized data */
+ char bsize[4]; /* uninitialized data */
+ char entry[4]; /* entry point */
+ char text_start[4]; /* base of text */
+ char data_start[4]; /* base of data */
} AOUTHDR;
-
/*
* SYMBOLS
*/
-typedef struct COFF_syment
-{
- union
- {
- char _n_name[E_SYMNMLEN]; /* Symbol name (first 8 chars) */
- struct
- {
- long _n_zeroes; /* Leading zeros */
- long _n_offset; /* Offset for a header section */
+typedef struct COFF_syment {
+ union {
+ char _n_name[E_SYMNMLEN]; /* Symbol name (first 8 chars) */
+ struct {
+ long _n_zeroes; /* Leading zeros */
+ long _n_offset; /* Offset for a header section */
} _n_n;
- char *_n_nptr[2]; /* allows for overlaying */
- } _n;
-
- long n_value; /* address of the segment */
- short n_scnum; /* Section number */
- unsigned short n_type; /* Type of section */
- char n_sclass; /* Loader class */
- char n_numaux; /* Number of aux entries following */
+ char *_n_nptr[2]; /* allows for overlaying */
+ } _n;
+
+ long n_value; /* address of the segment */
+ short n_scnum; /* Section number */
+ unsigned short n_type; /* Type of section */
+ char n_sclass; /* Loader class */
+ char n_numaux; /* Number of aux entries following */
} SYMENT;
#define n_name _n._n_name
@@ -110,8 +102,8 @@ typedef struct COFF_syment
#define n_zeroes _n._n_n._n_zeroes
#define n_offset _n._n_n._n_offset
-#define COFF_E_SYMNMLEN 8 /* characters in a short symbol name */
-#define COFF_E_FILNMLEN 14 /* characters in a file name */
+#define COFF_E_SYMNMLEN 8 /* characters in a short symbol name */
+#define COFF_E_FILNMLEN 14 /* characters in a file name */
#define COFF_E_DIMNUM 4 /* array dimensions in aux entry */
#define SYMNMLEN COFF_E_SYMNMLEN
#define SYMESZ 18 /* not really sizeof(SYMENT) due to padding */
@@ -131,62 +123,59 @@ typedef struct COFF_syment
* AUX Entries
*/
typedef struct COFF_auxent {
- long x_scnlen;
- long x_parmhash;
- unsigned short x_snhash;
- unsigned char x_smtyp;
- unsigned char x_smclas;
- long x_stab;
- unsigned short x_snstab;
+ long x_scnlen;
+ long x_parmhash;
+ unsigned short x_snhash;
+ unsigned char x_smtyp;
+ unsigned char x_smclas;
+ long x_stab;
+ unsigned short x_snstab;
} AUXENT;
/* Auxillary Symbol type values */
-#define XTY_ER 0 /* Enternal Reference */
-#define XTY_SD 1 /* csect section definition */
-#define XTY_LD 2 /* Label definition */
-#define XTY_CM 3 /* common csect definition */
+#define XTY_ER 0 /* Enternal Reference */
+#define XTY_SD 1 /* csect section definition */
+#define XTY_LD 2 /* Label definition */
+#define XTY_CM 3 /* common csect definition */
/* Auxillary Symbol storage mapping class values */
-#define XMC_PR 0 /* Program code */
-#define XMC_RO 1 /* Read-only constant */
-#define XMC_DB 2 /* Debug dictionary */
-#define XMC_TC 3 /* TOC entry */
-#define XMC_UA 4 /* Unclassified */
-#define XMC_RW 5 /* Read/write data */
-#define XMC_GL 6 /* Global linkage */
-#define XMC_XO 7 /* Extended operation */
-#define XMC_SV 8 /* Supervisor call descriptor */
-#define XMC_BS 9 /* BSS class */
-#define XMC_DS 10 /* Function descriptor csect */
-#define XMC_UC 11 /* Unnamed FORTRAN comon */
-#define XMC_TI 12 /* Reserved */
-#define XMC_TB 13 /* Reserved */
-#define XMC_TC0 15 /* TOC anchor */
-#define XMC_TD 16 /* Scalar data entry in TOC */
+#define XMC_PR 0 /* Program code */
+#define XMC_RO 1 /* Read-only constant */
+#define XMC_DB 2 /* Debug dictionary */
+#define XMC_TC 3 /* TOC entry */
+#define XMC_UA 4 /* Unclassified */
+#define XMC_RW 5 /* Read/write data */
+#define XMC_GL 6 /* Global linkage */
+#define XMC_XO 7 /* Extended operation */
+#define XMC_SV 8 /* Supervisor call descriptor */
+#define XMC_BS 9 /* BSS class */
+#define XMC_DS 10 /* Function descriptor csect */
+#define XMC_UC 11 /* Unnamed FORTRAN comon */
+#define XMC_TI 12 /* Reserved */
+#define XMC_TB 13 /* Reserved */
+#define XMC_TC0 15 /* TOC anchor */
+#define XMC_TD 16 /* Scalar data entry in TOC */
/*
* RELOCATION DIRECTIVES
*/
-typedef struct COFF_reloc
-{
- long r_vaddr; /* Virtual address of item */
- long r_symndx; /* Symbol index in the symtab */
+typedef struct COFF_reloc {
+ long r_vaddr; /* Virtual address of item */
+ long r_symndx; /* Symbol index in the symtab */
#if defined(__powerpc__)
- union
- {
- unsigned short _r_type; /* old style coff relocation type */
- struct
- {
- char _r_rsize; /* sign and reloc bit len */
- char _r_rtype; /* toc relocation type */
+ union {
+ unsigned short _r_type; /* old style coff relocation type */
+ struct {
+ char _r_rsize; /* sign and reloc bit len */
+ char _r_rtype; /* toc relocation type */
} _r_r;
- } _r;
-#define r_otype _r._r_type /* old style reloc - original name */
+ } _r;
+#define r_otype _r._r_type /* old style reloc - original name */
#define r_rsize _r._r_r._r_rsize /* extract sign and bit len */
#define r_type _r._r_r._r_rtype /* extract toc relocation type */
#else
- unsigned short r_type; /* Relocation type */
+ unsigned short r_type; /* Relocation type */
#endif
} RELOC;
@@ -222,7 +211,7 @@ typedef struct COFF_reloc
#define R_REL 0x02 /* A(sym-*) Relative to self */
#define R_TOC 0x03 /* A(sym-TOC) Relative to TOC */
#define R_TRL 0x12 /* A(sym-TOC) TOC Relative indirect load. */
- /* modifiable instruction */
+ /* modifiable instruction */
#define R_TRLA 0x13 /* A(sym-TOC) TOC Rel load address. modifiable inst */
#define R_GL 0x05 /* A(external TOC of sym) Global Linkage */
#define R_TCL 0x06 /* A(local TOC of sym) Local object TOC address */
diff --git a/hw/xfree86/loader/coffloader.c b/hw/xfree86/loader/coffloader.c
index 7a1ef28ad..b2fbfcf14 100644
--- a/hw/xfree86/loader/coffloader.c
+++ b/hw/xfree86/loader/coffloader.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.c,v 1.18 2002/09/16 18:06:10 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/loader/coffloader.c,v 1.21 2003/10/15 17:40:15 dawes Exp $ */
/*
*
@@ -48,63 +48,66 @@
#include "coffloader.h"
#include "compiler.h"
-/*
-#ifndef LDTEST
+
+#ifndef LOADERDEBUG
+#define LOADERDEBUG 0
+#endif
+
+#if LOADERDEBUG
#define COFFDEBUG ErrorF
#endif
-*/
/*
* This structure contains all of the information about a module
* that has been loaded.
*/
-typedef struct {
- int handle;
- long module; /* Id of the module used to find inter module calls */
- int fd;
- loader_funcs *funcs;
- FILHDR *header; /* file header */
- AOUTHDR *optheader; /* optional file header */
- unsigned short numsh;
- SCNHDR *sections; /* Start address of the section table */
- int secsize; /* size of the section table */
- unsigned char **saddr;/* Start addresss of the sections table */
- unsigned char **reladdr;/* Start addresss of the relocation table */
- unsigned char *strtab; /* Start address of the string table */
- int strsize; /* size of the string table */
- unsigned char *text; /* Start address of the .text section */
- int txtndx; /* index of the .text section */
- long txtaddr; /* offset of the .text section */
- int txtsize; /* size of the .text section */
- int txtrelsize; /* size of the .rel.text section */
- unsigned char *data; /* Start address of the .data section */
- int datndx; /* index of the .data section */
- long dataddr; /* offset of the .data section */
- int datsize; /* size of the .data section */
- int datrelsize; /* size of the .rel.data section */
- unsigned char *bss; /* Start address of the .bss section */
- int bssndx; /* index of the .bss section */
- long bssaddr; /* offset of the .bss section */
- int bsssize; /* size of the .bss section */
- SYMENT *symtab; /* Start address of the .symtab section */
- int symndx; /* index of the .symtab section */
- int symsize; /* size of the .symtab section */
- unsigned char *common; /* Start address of the .common section */
- int comsize; /* size of the .common section */
- long toc; /* Offset of the TOC csect */
- unsigned char *tocaddr; /* Address of the TOC csect */
- } COFFModuleRec, *COFFModulePtr;
+typedef struct {
+ int handle;
+ long module; /* Id of the module used to find inter module calls */
+ int fd;
+ loader_funcs *funcs;
+ FILHDR *header; /* file header */
+ AOUTHDR *optheader; /* optional file header */
+ unsigned short numsh;
+ SCNHDR *sections; /* Start address of the section table */
+ int secsize; /* size of the section table */
+ unsigned char **saddr; /* Start addresss of the sections table */
+ unsigned char **reladdr; /* Start addresss of the relocation table */
+ unsigned char *strtab; /* Start address of the string table */
+ int strsize; /* size of the string table */
+ unsigned char *text; /* Start address of the .text section */
+ int txtndx; /* index of the .text section */
+ long txtaddr; /* offset of the .text section */
+ int txtsize; /* size of the .text section */
+ int txtrelsize; /* size of the .rel.text section */
+ unsigned char *data; /* Start address of the .data section */
+ int datndx; /* index of the .data section */
+ long dataddr; /* offset of the .data section */
+ int datsize; /* size of the .data section */
+ int datrelsize; /* size of the .rel.data section */
+ unsigned char *bss; /* Start address of the .bss section */
+ int bssndx; /* index of the .bss section */
+ long bssaddr; /* offset of the .bss section */
+ int bsssize; /* size of the .bss section */
+ SYMENT *symtab; /* Start address of the .symtab section */
+ int symndx; /* index of the .symtab section */
+ int symsize; /* size of the .symtab section */
+ unsigned char *common; /* Start address of the .common section */
+ int comsize; /* size of the .common section */
+ long toc; /* Offset of the TOC csect */
+ unsigned char *tocaddr; /* Address of the TOC csect */
+} COFFModuleRec, *COFFModulePtr;
/*
* If any relocation is unable to be satisfied, then put it on a list
* to try later after more modules have been loaded.
*/
typedef struct _coff_reloc {
- COFFModulePtr file;
- RELOC *rel;
- int secndx;
- struct _coff_reloc *next;
+ COFFModulePtr file;
+ RELOC *rel;
+ int secndx;
+ struct _coff_reloc *next;
} COFFRelocRec;
/*
@@ -116,10 +119,10 @@ typedef struct _coff_reloc {
*/
typedef struct _coff_COMMON {
- SYMENT *sym;
- int index;
- struct _coff_COMMON *next;
- } COFFCommonRec;
+ SYMENT *sym;
+ int index;
+ struct _coff_COMMON *next;
+} COFFCommonRec;
static COFFCommonPtr listCOMMON = NULL;
@@ -140,36 +143,30 @@ static COFFRelocPtr COFFCollectRelocations(COFFModulePtr);
* Utility Functions
*/
-
static int
-COFFhashCleanOut(voidptr, item)
-void *voidptr;
-itemPtr item ;
+COFFhashCleanOut(void *voidptr, itemPtr item)
{
- COFFModulePtr module = (COFFModulePtr) voidptr;
- return ( module->handle == item->handle ) ;
-}
+ COFFModulePtr module = (COFFModulePtr) voidptr;
+ return (module->handle == item->handle);
+}
/*
* Manage listResolv
*/
static COFFRelocPtr
-COFFDelayRelocation(cofffile,secndx,rel)
-COFFModulePtr cofffile;
-int secndx;
-RELOC *rel;
+COFFDelayRelocation(COFFModulePtr cofffile, int secndx, RELOC *rel)
{
COFFRelocPtr reloc;
if ((reloc = xf86loadermalloc(sizeof(COFFRelocRec))) == NULL) {
- ErrorF( "COFFDelayRelocation() Unable to allocate memory!!!!\n" );
+ ErrorF("COFFDelayRelocation() Unable to allocate memory!!!!\n");
return 0;
}
- reloc->file=cofffile;
- reloc->secndx=secndx;
- reloc->rel=rel;
+ reloc->file = cofffile;
+ reloc->secndx = secndx;
+ reloc->rel = rel;
reloc->next = 0;
return reloc;
@@ -180,83 +177,80 @@ RELOC *rel;
*/
static COFFCommonPtr
-COFFAddCOMMON(sym,index)
-SYMENT *sym;
-int index;
+COFFAddCOMMON(SYMENT *sym, int index)
{
COFFCommonPtr common;
if ((common = xf86loadermalloc(sizeof(COFFCommonRec))) == NULL) {
- ErrorF( "COFFAddCOMMON() Unable to allocate memory!!!!\n" );
+ ErrorF("COFFAddCOMMON() Unable to allocate memory!!!!\n");
return 0;
}
- common->sym=sym;
- common->index=index;
- common->next=0;
+ common->sym = sym;
+ common->index = index;
+ common->next = 0;
return common;
}
static LOOKUP *
-COFFCreateCOMMON(cofffile)
-COFFModulePtr cofffile;
+COFFCreateCOMMON(COFFModulePtr cofffile)
{
- int numsyms=0,size=0,l=0;
- int offset=0;
- LOOKUP *lookup;
+ int numsyms = 0, size = 0, l = 0;
+ int offset = 0;
+ LOOKUP *lookup;
COFFCommonPtr common;
if (listCOMMON == NULL)
return NULL;
- common=listCOMMON;
+ common = listCOMMON;
for (common = listCOMMON; common; common = common->next) {
/* Ensure long word alignment */
- if( common->sym->n_value != 2
- && common->sym->n_value != 1) /* But not for short and char ;-)(mr)*/
- if( common->sym->n_value%4 != 0 )
- common->sym->n_value+= 4-(common->sym->n_value%4);
+ if (common->sym->n_value != 2 && common->sym->n_value != 1) /* But not for short and char ;-)(mr) */
+ if (common->sym->n_value % 4 != 0)
+ common->sym->n_value += 4 - (common->sym->n_value % 4);
/* accumulate the sizes */
- size+=common->sym->n_value;
+ size += common->sym->n_value;
numsyms++;
}
#ifdef COFFDEBUG
COFFDEBUG("COFFCreateCOMMON() %d entries (%d bytes) of COMMON data\n",
- numsyms, size );
+ numsyms, size);
#endif
- if ((lookup = xf86loadermalloc((numsyms+1)*sizeof(LOOKUP))) == NULL) {
- ErrorF( "COFFCreateCOMMON() Unable to allocate memory!!!!\n" );
- return NULL;
+ if ((lookup = xf86loadermalloc((numsyms + 1) * sizeof(LOOKUP))) == NULL) {
+ ErrorF("COFFCreateCOMMON() Unable to allocate memory!!!!\n");
+ return NULL;
}
- cofffile->comsize=size;
- if ((cofffile->common = xf86loadercalloc(1,size)) == NULL) {
- ErrorF( "COFFCreateCOMMON() Unable to allocate memory!!!!\n" );
- return NULL;
+ cofffile->comsize = size;
+ if ((cofffile->common = xf86loadercalloc(1, size)) == NULL) {
+ ErrorF("COFFCreateCOMMON() Unable to allocate memory!!!!\n");
+ return NULL;
}
/* Traverse the common list and create a lookup table with all the
* common symbols. Destroy the common list in the process.
* See also ResolveSymbols.
*/
- while(listCOMMON) {
- common=listCOMMON;
- lookup[l].symName=COFFGetSymbolName(cofffile,common->index);
- lookup[l].offset=(funcptr)(cofffile->common+offset);
+ while (listCOMMON) {
+ common = listCOMMON;
+ lookup[l].symName = COFFGetSymbolName(cofffile, common->index);
+ lookup[l].offset = (funcptr) (cofffile->common + offset);
#ifdef COFFDEBUG
- COFFDEBUG("Adding %x %s\n", lookup[l].offset, lookup[l].symName );
+ COFFDEBUG("Adding %p %s\n", (void *)lookup[l].offset,
+ lookup[l].symName);
#endif
- listCOMMON=common->next;
- offset+=common->sym->n_value;
- xf86loaderfree(common);
- l++;
+ listCOMMON = common->next;
+ offset += common->sym->n_value;
+ xf86loaderfree(common);
+ l++;
}
/* listCOMMON == NULL */
- lookup[l].symName=NULL; /* Terminate the list */
+ lookup[l].symName = NULL; /* Terminate the list */
return lookup;
}
@@ -268,68 +262,62 @@ COFFModulePtr cofffile;
* Get symbol name
*/
static char *
-COFFGetSymbolName(cofffile, index)
-COFFModulePtr cofffile;
-int index;
+COFFGetSymbolName(COFFModulePtr cofffile, int index)
{
- char *name;
- SYMENT *sym;
+ char *name;
+ SYMENT *sym;
- sym=(SYMENT *)(((unsigned char *)cofffile->symtab)+(index*SYMESZ));
+ sym = (SYMENT *) (((unsigned char *)cofffile->symtab) + (index * SYMESZ));
#ifdef COFFDEBUG
- COFFDEBUG("COFFGetSymbolName(%x,%x) %x",cofffile, index, sym->n_zeroes );
+ COFFDEBUG("COFFGetSymbolName(%p,%x) %lx", (void *)cofffile, index,
+ sym->n_zeroes);
#endif
name = xf86loadermalloc(sym->n_zeroes ? SYMNMLEN + 1
- : strlen((const char *)&cofffile->strtab[(int)sym->n_offset-4]) + 1);
+ : strlen((const char *)&cofffile->
+ strtab[(int)sym->n_offset - 4]) + 1);
if (!name)
FatalError("COFFGetSymbolName: Out of memory\n");
- if( sym->n_zeroes )
- {
- strncpy(name,sym->n_name,SYMNMLEN);
- name[SYMNMLEN]='\000';
- }
- else {
- strcpy(name, (const char *)&cofffile->strtab[(int)sym->n_offset-4]);
- }
+ if (sym->n_zeroes) {
+ strncpy(name, sym->n_name, SYMNMLEN);
+ name[SYMNMLEN] = '\000';
+ } else {
+ strcpy(name, (const char *)&cofffile->strtab[(int)sym->n_offset - 4]);
+ }
#ifdef COFFDEBUG
- COFFDEBUG(" %s\n", name );
+ COFFDEBUG(" %s\n", name);
#endif
return name;
}
static SYMENT *
-COFFGetSymbol(file, index)
-COFFModulePtr file;
-int index;
+COFFGetSymbol(COFFModulePtr file, int index)
{
- return (SYMENT *)(((unsigned char *)file->symtab)+(index*SYMESZ));
+ return (SYMENT *) (((unsigned char *)file->symtab) + (index * SYMESZ));
}
static unsigned char *
-COFFGetSymbolValue(cofffile, index)
-COFFModulePtr cofffile;
-int index;
+COFFGetSymbolValue(COFFModulePtr cofffile, int index)
{
- unsigned char *symval=0; /* value of the indicated symbol */
+ unsigned char *symval = 0; /* value of the indicated symbol */
itemPtr symbol; /* name/value of symbol */
- char *symname;
+ char *symname;
- symname=COFFGetSymbolName(cofffile, index);
+ symname = COFFGetSymbolName(cofffile, index);
#ifdef COFFDEBUG
- COFFDEBUG("COFFGetSymbolValue() for %s=", symname );
+ COFFDEBUG("COFFGetSymbolValue() for %s=", symname);
#endif
symbol = LoaderHashFind(symname);
- if( symbol )
- symval=(unsigned char *)symbol->address;
+ if (symbol)
+ symval = (unsigned char *)symbol->address;
#ifdef COFFDEBUG
- COFFDEBUG("%x\n", symval );
+ COFFDEBUG("%p\n", symval);
#endif
xf86loaderfree(symname);
@@ -343,22 +331,20 @@ int index;
* same module as the calling function.
*/
static unsigned char *
-COFFGetSymbolGlinkValue(cofffile, index)
-COFFModulePtr cofffile;
-int index;
+COFFGetSymbolGlinkValue(COFFModulePtr cofffile, int index)
{
- unsigned char *symval=0; /* value of the indicated symbol */
+ unsigned char *symval = 0; /* value of the indicated symbol */
itemPtr symbol; /* name/value of symbol */
- char *name;
+ char *name;
- name=COFFGetSymbolName(cofffile, index);
+ name = COFFGetSymbolName(cofffile, index);
#ifdef COFFDEBUG
- COFFDEBUG("COFFGetSymbolGlinkValue() for %s=", name );
+ COFFDEBUG("COFFGetSymbolGlinkValue() for %s=", name);
#endif
- symbol = LoaderHashFind(name+1); /* Eat the '.' so we get the
- Function descriptor instead */
+ symbol = LoaderHashFind(name + 1); /* Eat the '.' so we get the
+ * Function descriptor instead */
/* Here we are building up a glink function that will change the TOC
* pointer before calling a function that resides in a different module.
@@ -373,26 +359,27 @@ int index;
7 00000018 4e800420 bctr # branch to it
*/
- if( symbol ) {
- symval=(unsigned char *)&symbol->code.glink;
+ if (symbol) {
+ symval = (unsigned char *)&symbol->code.glink;
#ifdef COFFDEBUG
- COFFDEBUG("%x\n", symval );
- COFFDEBUG("glink_%s=%x\n", name,symval );
-#endif
- symbol->code.glink[ 0]=0x3d80; /* lis r12 */
- symbol->code.glink[ 1]=((unsigned long)symbol->address&0xffff0000)>>16;
- symbol->code.glink[ 2]=0x618c; /* ori r12 */
- symbol->code.glink[ 3]=((unsigned long)symbol->address&0x0000ffff);
- symbol->code.glink[ 4]=0x9041; /* st r2,20(r1) */
- symbol->code.glink[ 5]=0x0014;
- symbol->code.glink[ 6]=0x804c; /* l r2,0(r12) */
- symbol->code.glink[ 7]=0x0000;
- symbol->code.glink[ 8]=0x7c49; /* mtctr r2 */
- symbol->code.glink[ 9]=0x03a6;
- symbol->code.glink[10]=0x804c; /* l r2,4(r12) */
- symbol->code.glink[11]=0x0004;
- symbol->code.glink[12]=0x4e80; /* bctr */
- symbol->code.glink[13]=0x0420;
+ COFFDEBUG("%x\n", symval);
+ COFFDEBUG("glink_%s=%x\n", name, symval);
+#endif
+ symbol->code.glink[0] = 0x3d80; /* lis r12 */
+ symbol->code.glink[1] =
+ ((unsigned long)symbol->address & 0xffff0000) >> 16;
+ symbol->code.glink[2] = 0x618c; /* ori r12 */
+ symbol->code.glink[3] = ((unsigned long)symbol->address & 0x0000ffff);
+ symbol->code.glink[4] = 0x9041; /* st r2,20(r1) */
+ symbol->code.glink[5] = 0x0014;
+ symbol->code.glink[6] = 0x804c; /* l r2,0(r12) */
+ symbol->code.glink[7] = 0x0000;
+ symbol->code.glink[8] = 0x7c49; /* mtctr r2 */
+ symbol->code.glink[9] = 0x03a6;
+ symbol->code.glink[10] = 0x804c; /* l r2,4(r12) */
+ symbol->code.glink[11] = 0x0004;
+ symbol->code.glink[12] = 0x4e80; /* bctr */
+ symbol->code.glink[13] = 0x0420;
ppc_flush_icache(&symbol->code.glink[0]);
ppc_flush_icache(&symbol->code.glink[12]);
}
@@ -406,17 +393,15 @@ int index;
* Fix all of the relocation for the given section.
*/
static COFFRelocPtr
-COFF_RelocateEntry(cofffile, secndx, rel)
-COFFModulePtr cofffile;
-int secndx; /* index of the target section */
-RELOC *rel;
+COFF_RelocateEntry(COFFModulePtr cofffile, int secndx, RELOC *rel)
{
- SYMENT *symbol; /* value of the indicated symbol */
+ SYMENT *symbol; /* value of the indicated symbol */
unsigned long *dest32; /* address of the place being modified */
+
#if defined(__powerpc__)
unsigned short *dest16; /* address of the place being modified */
- itemPtr symitem; /* symbol structure from has table */
- char *name;
+ itemPtr symitem; /* symbol structure from has table */
+ char *name;
#endif
unsigned char *symval; /* value of the indicated symbol */
@@ -431,386 +416,401 @@ RELOC *rel;
*/
#ifdef COFFDEBUG
- COFFDEBUG("%x %d %o ",
- rel->r_vaddr,rel->r_symndx,rel->r_type );
+ COFFDEBUG("%lx %ld %o ", (unsigned long)rel->r_vaddr,
+ rel->r_symndx, rel->r_type);
#if defined(__powerpc__)
COFFDEBUG("[%x %x %x] ",
- RELOC_RSIGN(*rel), RELOC_RFIXUP(*rel), RELOC_RLEN(*rel));
+ RELOC_RSIGN(*rel), RELOC_RFIXUP(*rel), RELOC_RLEN(*rel));
#endif
#endif
- symbol=COFFGetSymbol(cofffile,rel->r_symndx);
+ symbol = COFFGetSymbol(cofffile, rel->r_symndx);
#ifdef COFFDEBUG
- COFFDEBUG("%d %x %d-%d\n", symbol->n_sclass, symbol->n_value, symbol->n_scnum, secndx );
+ COFFDEBUG("%d %lx %d-%d\n", symbol->n_sclass, symbol->n_value,
+ symbol->n_scnum, secndx);
#endif
/*
* Check to see if the relocation offset is part of the .text segment.
* If not, we must change the offset to be relative to the .data section
* which is NOT contiguous.
- */
- switch(secndx+1) { /* change the bias */
+ */
+ switch (secndx + 1) { /* change the bias */
case N_TEXT:
- if( (long)rel->r_vaddr < cofffile->txtaddr ||
- (long)rel->r_vaddr > (long)(cofffile->txtaddr+cofffile->txtsize) ) {
- FatalError("Relocation against N_TEXT not in .text section\n");
+ if ((long)rel->r_vaddr < cofffile->txtaddr ||
+ (long)rel->r_vaddr >
+ (long)(cofffile->txtaddr + cofffile->txtsize)) {
+ FatalError("Relocation against N_TEXT not in .text section\n");
}
- dest32=(unsigned long *)((long)(cofffile->saddr[secndx])+
- ((unsigned char *)rel->r_vaddr-cofffile->txtaddr));
+ dest32 = (unsigned long *)((long)(cofffile->saddr[secndx]) +
+ ((unsigned char *)rel->r_vaddr -
+ cofffile->txtaddr));
break;
case N_DATA:
- if( (long)rel->r_vaddr < cofffile->dataddr ||
- (long)rel->r_vaddr > (long)(cofffile->dataddr+cofffile->datsize) ) {
- FatalError("Relocation against N_DATA not in .data section\n");
+ if ((long)rel->r_vaddr < cofffile->dataddr ||
+ (long)rel->r_vaddr >
+ (long)(cofffile->dataddr + cofffile->datsize)) {
+ FatalError("Relocation against N_DATA not in .data section\n");
}
- dest32=(unsigned long *)((long)(cofffile->saddr[secndx])+
- ((unsigned char *)rel->r_vaddr-cofffile->dataddr));
+ dest32 = (unsigned long *)((long)(cofffile->saddr[secndx]) +
+ ((unsigned char *)rel->r_vaddr -
+ cofffile->dataddr));
break;
case N_BSS:
- if( (long)rel->r_vaddr < cofffile->bssaddr ||
- (long)rel->r_vaddr > (long)(cofffile->bssaddr+cofffile->bsssize) ) {
- FatalError("Relocation against N_TEXT not in .bss section\n");
+ if ((long)rel->r_vaddr < cofffile->bssaddr ||
+ (long)rel->r_vaddr >
+ (long)(cofffile->bssaddr + cofffile->bsssize)) {
+ FatalError("Relocation against N_TEXT not in .bss section\n");
}
- dest32=(unsigned long *)((long)(cofffile->saddr[secndx])+
- ((unsigned char *)rel->r_vaddr-cofffile->bssaddr));
+ dest32 = (unsigned long *)((long)(cofffile->saddr[secndx]) +
+ ((unsigned char *)rel->r_vaddr -
+ cofffile->bssaddr));
break;
default:
- FatalError("Relocation against unknown section %d\n", secndx );
+ FatalError("Relocation against unknown section %d\n", secndx);
}
- if( symbol->n_sclass == 0 )
- {
- symval=(unsigned char *)(symbol->n_value+(*dest32)-symbol->n_type);
+ if (symbol->n_sclass == 0) {
+ symval = (unsigned char *)(symbol->n_value + (*dest32) -
+ symbol->n_type);
#ifdef COFFDEBUG
- COFFDEBUG( "symbol->n_sclass==0\n" );
- COFFDEBUG( "dest32=%x\t", dest32 );
- COFFDEBUG( "symval=%x\t", symval );
- COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+ COFFDEBUG("symbol->n_sclass==0\n");
+ COFFDEBUG("dest32=%p\t", (void *)dest32);
+ COFFDEBUG("symval=%p\t", symval);
+ COFFDEBUG("*dest32=%8.8lx\t", *dest32);
#endif
- *dest32=(unsigned long)symval;
- return 0;
- }
+ *dest32 = (unsigned long)symval;
+ return 0;
+ }
- switch( rel->r_type )
- {
+ switch (rel->r_type) {
#if defined(i386)
- case R_DIR32:
- symval=COFFGetSymbolValue(cofffile, rel->r_symndx);
- if( symval ) {
+ case R_DIR32:
+ symval = COFFGetSymbolValue(cofffile, rel->r_symndx);
+ if (symval) {
#ifdef COFFDEBUG
- char *namestr;
- COFFDEBUG( "R_DIR32 %s\n",
- namestr=COFFGetSymbolName(cofffile,rel->r_symndx) );
- xf86loaderfree(namestr);
- COFFDEBUG( "txtsize=%x\t", cofffile->txtsize );
- COFFDEBUG( "dest32=%x\t", dest32 );
- COFFDEBUG( "symval=%x\t", symval );
- COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
-#endif
- *dest32=(unsigned long)(symval+(*dest32)-symbol->n_value);
- } else {
- switch( symbol->n_scnum ) {
- case N_UNDEF:
+ char *namestr;
+
+ COFFDEBUG("R_DIR32 %s\n",
+ namestr = COFFGetSymbolName(cofffile, rel->r_symndx));
+ xf86loaderfree(namestr);
+ COFFDEBUG("txtsize=%x\t", cofffile->txtsize);
+ COFFDEBUG("dest32=%p\t", (void *)dest32);
+ COFFDEBUG("symval=%p\t", symval);
+ COFFDEBUG("*dest32=%8.8lx\t", *dest32);
+#endif
+ *dest32 = (unsigned long)(symval + (*dest32) - symbol->n_value);
+ } else {
+ switch (symbol->n_scnum) {
+ case N_UNDEF:
#ifdef COFFDEBUG
- COFFDEBUG( "R_DIR32 N_UNDEF\n" );
+ COFFDEBUG("R_DIR32 N_UNDEF\n");
#endif
- return COFFDelayRelocation(cofffile,secndx,rel);
- case N_ABS:
+ return COFFDelayRelocation(cofffile, secndx, rel);
+ case N_ABS:
#ifdef COFFDEBUG
- COFFDEBUG( "R_DIR32 N_ABS\n" );
+ COFFDEBUG("R_DIR32 N_ABS\n");
#endif
- return 0;
- case N_DEBUG:
+ return 0;
+ case N_DEBUG:
#ifdef COFFDEBUG
- COFFDEBUG( "R_DIR32 N_DEBUG\n" );
+ COFFDEBUG("R_DIR32 N_DEBUG\n");
#endif
- return 0;
- case N_COMMENT:
+ return 0;
+ case N_COMMENT:
#ifdef COFFDEBUG
- COFFDEBUG( "R_DIR32 N_COMMENT\n" );
+ COFFDEBUG("R_DIR32 N_COMMENT\n");
#endif
- return 0;
- case N_TEXT:
+ return 0;
+ case N_TEXT:
#ifdef COFFDEBUG
- COFFDEBUG( "R_DIR32 N_TEXT\n" );
- COFFDEBUG( "dest32=%x\t", dest32 );
- COFFDEBUG( "symval=%x\t", symval );
- COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
-#endif
- *dest32=(unsigned long)((*dest32)+
- (unsigned long)(cofffile->saddr[N_TEXT-1]));
- break;
- case N_DATA:
+ COFFDEBUG("R_DIR32 N_TEXT\n");
+ COFFDEBUG("dest32=%p\t", (void *)dest32);
+ COFFDEBUG("symval=%p\t", symval);
+ COFFDEBUG("*dest32=%8.8lx\t", *dest32);
+#endif
+ *dest32 = (unsigned long)((*dest32) +
+ (unsigned long)(cofffile->
+ saddr[N_TEXT - 1]));
+ break;
+ case N_DATA:
#ifdef COFFDEBUG
- COFFDEBUG( "R_DIR32 N_DATA\n" );
- COFFDEBUG( "txtsize=%x\t", cofffile->txtsize );
- COFFDEBUG( "dest32=%x\t", dest32 );
- COFFDEBUG( "symval=%x\t", symval );
- COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
-#endif
- *dest32=(unsigned long)((*dest32)+
- ((unsigned long)(cofffile->saddr[N_DATA-1]))-
- cofffile->dataddr);
- break;
- case N_BSS:
+ COFFDEBUG("R_DIR32 N_DATA\n");
+ COFFDEBUG("txtsize=%x\t", cofffile->txtsize);
+ COFFDEBUG("dest32=%p\t", (void *)dest32);
+ COFFDEBUG("symval=%p\t", symval);
+ COFFDEBUG("*dest32=%8.8lx\t", *dest32);
+#endif
+ *dest32 = (unsigned long)((*dest32) +
+ ((unsigned long)(cofffile->
+ saddr[N_DATA -
+ 1])) -
+ cofffile->dataddr);
+ break;
+ case N_BSS:
#ifdef COFFDEBUG
- COFFDEBUG( "R_DIR32 N_BSS\n" );
- COFFDEBUG( "dest32=%x\t", dest32 );
- COFFDEBUG( "symval=%x\t", symval );
- COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
-#endif
- *dest32=(unsigned long)((*dest32)+
- (unsigned long)(cofffile->saddr[N_BSS-1])-
- (cofffile->bssaddr));
- break;
- default:
- ErrorF("R_DIR32 with unexpected section %d\n",
- symbol->n_scnum );
- }
-
+ COFFDEBUG("R_DIR32 N_BSS\n");
+ COFFDEBUG("dest32=%p\t", (void *)dest32);
+ COFFDEBUG("symval=%p\t", symval);
+ COFFDEBUG("*dest32=%8.8lx\t", *dest32);
+#endif
+ *dest32 = (unsigned long)((*dest32) +
+ (unsigned long)(cofffile->
+ saddr[N_BSS - 1]) -
+ (cofffile->bssaddr));
+ break;
+ default:
+ ErrorF("R_DIR32 with unexpected section %d\n",
+ symbol->n_scnum);
}
+
+ }
#ifdef COFFDEBUG
- COFFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ COFFDEBUG("*dest32=%8.8lx\n", *dest32);
#endif
+ break;
+ case R_PCRLONG:
+ if (symbol->n_scnum == N_TEXT)
break;
- case R_PCRLONG:
- if( symbol->n_scnum == N_TEXT )
- break;
- symval=COFFGetSymbolValue(cofffile, rel->r_symndx);
+ symval = COFFGetSymbolValue(cofffile, rel->r_symndx);
#ifdef COFFDEBUG
- COFFDEBUG( "R_PCRLONG ");
- COFFDEBUG( "dest32=%x\t", dest32 );
- COFFDEBUG( "symval=%x\t", symval );
- COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+ COFFDEBUG("R_PCRLONG ");
+ COFFDEBUG("dest32=%p\t", (void *)dest32);
+ COFFDEBUG("symval=%p\t", symval);
+ COFFDEBUG("*dest32=%8.8lx\t", *dest32);
#endif
- if( symval == 0 ) {
+ if (symval == 0) {
#ifdef COFFDEBUG
- char *name;
- COFFDEBUG( "***Unable to resolve symbol %s\n",
- name=COFFGetSymbolName(cofffile,rel->r_symndx) );
- xf86loaderfree(name);
+ char *name;
+
+ COFFDEBUG("***Unable to resolve symbol %s\n",
+ name = COFFGetSymbolName(cofffile, rel->r_symndx));
+ xf86loaderfree(name);
#endif
- return COFFDelayRelocation(cofffile,secndx,rel);
- }
- *dest32=(unsigned long)(symval-((long)dest32+sizeof(long)));
+ return COFFDelayRelocation(cofffile, secndx, rel);
+ }
+ *dest32 = (unsigned long)(symval - ((long)dest32 + sizeof(long)));
#ifdef COFFDEBUG
- COFFDEBUG( "*dest32=%8.8x\n", *dest32 );
+ COFFDEBUG("*dest32=%8.8lx\n", *dest32);
#endif
- break;
- case R_ABS:
- /*
- * Nothing to really do here.
- * Usually, a dummy relocation for .file
- */
- break;
+ break;
+ case R_ABS:
+ /*
+ * Nothing to really do here.
+ * Usually, a dummy relocation for .file
+ */
+ break;
#endif /* i386 */
#if defined(__powerpc__)
- case R_POS:
- /*
- * Positive Relocation
- */
- if( RELOC_RLEN(*rel) != 0x1f )
- FatalError("R_POS with size != 32 bits" );
- symval=COFFGetSymbolValue(cofffile, rel->r_symndx);
- if( symval ) {
+ case R_POS:
+ /*
+ * Positive Relocation
+ */
+ if (RELOC_RLEN(*rel) != 0x1f)
+ FatalError("R_POS with size != 32 bits");
+ symval = COFFGetSymbolValue(cofffile, rel->r_symndx);
+ if (symval) {
#ifdef COFFDEBUG
- COFFDEBUG( "R_POS ");
- COFFDEBUG( "dest32=%x\t", dest32 );
- COFFDEBUG( "symval=%x\t", symval );
- COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
+ COFFDEBUG("R_POS ");
+ COFFDEBUG("dest32=%x\t", dest32);
+ COFFDEBUG("symval=%x\t", symval);
+ COFFDEBUG("*dest32=%8.8x\t", *dest32);
#endif
- *dest32=(unsigned long)(symval+(*dest32)-symbol->n_value);
- ppc_flush_icache(dest32);
- } else {
- switch( symbol->n_scnum ) {
- case N_UNDEF:
+ *dest32 = (unsigned long)(symval + (*dest32) - symbol->n_value);
+ ppc_flush_icache(dest32);
+ } else {
+ switch (symbol->n_scnum) {
+ case N_UNDEF:
#ifdef COFFDEBUG
- COFFDEBUG( "R_POS N_UNDEF\n" );
+ COFFDEBUG("R_POS N_UNDEF\n");
#endif
- return COFFDelayRelocation(cofffile,secndx,rel);
- case N_ABS:
+ return COFFDelayRelocation(cofffile, secndx, rel);
+ case N_ABS:
#ifdef COFFDEBUG
- COFFDEBUG( "R_POS N_ABS\n" );
+ COFFDEBUG("R_POS N_ABS\n");
#endif
- return 0;
- case N_DEBUG:
+ return 0;
+ case N_DEBUG:
#ifdef COFFDEBUG
- COFFDEBUG( "R_POS N_DEBUG\n" );
+ COFFDEBUG("R_POS N_DEBUG\n");
#endif
- return 0;
- case N_COMMENT:
+ return 0;
+ case N_COMMENT:
#ifdef COFFDEBUG
- COFFDEBUG( "R_POS N_COMMENT\n" );
+ COFFDEBUG("R_POS N_COMMENT\n");
#endif
- return 0;
- case N_TEXT:
+ return 0;
+ case N_TEXT:
#ifdef COFFDEBUG
- COFFDEBUG( "R_POS N_TEXT\n" );
- COFFDEBUG( "dest32=%x\t", dest32 );
- COFFDEBUG( "symval=%x\t", symval );
- COFFDEBUG( "*dest32=%8.8x\t", *dest32 );
-#endif
- *dest32=(unsigned long)((*dest32)+
- ((unsigned long)(cofffile->saddr[N_TEXT-1]))-
- cofffile->txtaddr);
- ppc_flush_icache(dest32);
- break;
- case N_DATA:
+ COFFDEBUG("R_POS N_TEXT\n");
+ COFFDEBUG("dest32=%x\t", dest32);
+ COFFDEBUG("symval=%x\t", symval);
+ COFFDEBUG("*dest32=%8.8x\t", *dest32);
+#endif
+ *dest32 = (unsigned long)((*dest32) +
+ ((unsigned long)(cofffile->
+ saddr[N_TEXT -
+ 1])) -<