summaryrefslogtreecommitdiff
path: root/hw
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
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')
-rw-r--r--hw/darwin/bundle/Dutch.lproj/Localizable.stringsbin1420 -> 1426 bytes
-rw-r--r--hw/darwin/bundle/English.lproj/Localizable.strings8
-rw-r--r--hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib8
-rw-r--r--hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nibbin20327 -> 20640 bytes
-rw-r--r--hw/darwin/bundle/French.lproj/Localizable.stringsbin1486 -> 1492 bytes
-rw-r--r--hw/darwin/bundle/German.lproj/Localizable.stringsbin1452 -> 1458 bytes
-rw-r--r--hw/darwin/bundle/Japanese.lproj/Localizable.stringsbin1146 -> 1152 bytes
-rw-r--r--hw/darwin/bundle/Portuguese.lproj/Localizable.stringsbin1498 -> 1504 bytes
-rw-r--r--hw/darwin/bundle/Spanish.lproj/Localizable.stringsbin1474 -> 1480 bytes
-rw-r--r--hw/darwin/bundle/Swedish.lproj/Localizable.stringsbin1458 -> 1464 bytes
-rw-r--r--hw/darwin/bundle/ko.lproj/Localizable.stringsbin1326 -> 1332 bytes
-rw-r--r--hw/darwin/darwin.c174
-rw-r--r--hw/darwin/darwin.h78
-rw-r--r--hw/darwin/darwinClut8.h2
-rw-r--r--hw/darwin/darwinEvents.c15
-rw-r--r--hw/darwin/darwinKeyboard.c239
-rw-r--r--hw/darwin/quartz/Preferences.h49
-rw-r--r--hw/darwin/quartz/Preferences.m80
-rw-r--r--hw/darwin/quartz/XDarwin.pbproj/project.pbxproj802
-rw-r--r--hw/darwin/quartz/XDarwinStartup.c5
-rw-r--r--hw/darwin/quartz/XServer.h35
-rw-r--r--hw/darwin/quartz/XServer.m537
-rw-r--r--hw/darwin/quartz/pseudoramiX.c4
-rw-r--r--hw/darwin/quartz/pseudoramiX.h3
-rw-r--r--hw/darwin/quartz/quartz.c159
-rw-r--r--hw/darwin/quartz/quartz.h91
-rw-r--r--hw/darwin/quartz/quartzAudio.c6
-rw-r--r--hw/darwin/quartz/quartzCocoa.m11
-rw-r--r--hw/darwin/quartz/quartzCommon.h18
-rw-r--r--hw/darwin/quartz/quartzStartup.c94
-rw-r--r--hw/darwin/utils/dumpkeymap.c3
-rw-r--r--hw/vfb/InitInput.c38
-rw-r--r--hw/vfb/InitOutput.c152
-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
-rw-r--r--hw/xnest/Args.c8
-rw-r--r--hw/xnest/Args.h2
-rw-r--r--hw/xnest/Color.c72
-rw-r--r--hw/xnest/Color.h26
-rw-r--r--hw/xnest/Cursor.c42
-rw-r--r--hw/xnest/Display.c11
-rw-r--r--hw/xnest/Display.h6
-rw-r--r--hw/xnest/Events.c31
-rw-r--r--hw/xnest/Events.h6
-rw-r--r--hw/xnest/Font.c14
-rw-r--r--hw/xnest/GC.c47
-rw-r--r--hw/xnest/GCOps.c253
-rw-r--r--hw/xnest/GCOps.h73
-rw-r--r--hw/xnest/GetTime.c4
-rw-r--r--hw/xnest/Handlers.c13
-rw-r--r--hw/xnest/Handlers.h6
-rw-r--r--hw/xnest/Init.c27
-rw-r--r--hw/xnest/Keyboard.c41
-rw-r--r--hw/xnest/Keyboard.h7
-rw-r--r--hw/xnest/Pixmap.c19
-rw-r--r--hw/xnest/Pointer.c16
-rw-r--r--hw/xnest/Pointer.h5
-rw-r--r--hw/xnest/Screen.c111
-rw-r--r--hw/xnest/Screen.h7
-rw-r--r--hw/xnest/TestExt.c23
-rw-r--r--hw/xnest/Visual.c15
-rw-r--r--hw/xnest/Visual.h7
-rw-r--r--hw/xnest/Window.c84
-rw-r--r--hw/xnest/XNCursor.h18
-rw-r--r--hw/xnest/XNFont.h5
-rw-r--r--hw/xnest/XNGC.h19
-rw-r--r--hw/xnest/XNPixmap.h9
-rw-r--r--hw/xnest/XNWindow.h32
-rw-r--r--hw/xnest/Xnest.man.pre4
-rw-r--r--hw/xnest/os2Stub.c9
-rw-r--r--hw/xwin/InitInput.c31
-rw-r--r--hw/xwin/InitOutput.c137
-rw-r--r--hw/xwin/XWin.man4
-rw-r--r--hw/xwin/XWin.rc31
-rw-r--r--hw/xwin/win.h124
-rw-r--r--hw/xwin/winblock.c8
-rw-r--r--hw/xwin/winclipboard.h4
-rw-r--r--hw/xwin/winclipboardinit.c2
-rw-r--r--hw/xwin/winclipboardtextconv.c2
-rw-r--r--hw/xwin/winclipboardthread.c55
-rw-r--r--hw/xwin/winclipboardunicode.c2
-rw-r--r--hw/xwin/winclipboardwndproc.c2
-rw-r--r--hw/xwin/winclipboardxevents.c83
-rw-r--r--hw/xwin/winconfig.c101
-rw-r--r--hw/xwin/wincreatewnd.c41
-rw-r--r--hw/xwin/wincursor.c17
-rw-r--r--hw/xwin/winengine.c9
-rw-r--r--hw/xwin/winerror.c12
-rw-r--r--hw/xwin/winfillsp.c1070
-rw-r--r--hw/xwin/winfont.c6
-rw-r--r--hw/xwin/wingc.c273
-rw-r--r--hw/xwin/wingetsp.c126
-rw-r--r--hw/xwin/winkeybd.c24
-rw-r--r--hw/xwin/winmsg.c33
-rw-r--r--hw/xwin/winmsg.h27
-rw-r--r--hw/xwin/winmultiwindowwindow.c1272
-rw-r--r--hw/xwin/winmultiwindowwm.c458
-rw-r--r--hw/xwin/winnativegdi.c30
-rw-r--r--hw/xwin/winpfbdd.c20
-rw-r--r--hw/xwin/winpixmap.c8
-rw-r--r--hw/xwin/winpolyline.c16
-rw-r--r--hw/xwin/winscrinit.c14
-rw-r--r--hw/xwin/winsetsp.c363
-rw-r--r--hw/xwin/winshaddd.c15
-rw-r--r--hw/xwin/winshadddnl.c38
-rw-r--r--hw/xwin/winshadgdi.c26
-rw-r--r--hw/xwin/winwakeup.c10
-rw-r--r--hw/xwin/winwindow.c118
-rw-r--r--hw/xwin/winwindow.h59
-rw-r--r--hw/xwin/winwndproc.c253
389 files changed, 22311 insertions, 12806 deletions
diff --git a/hw/darwin/bundle/Dutch.lproj/Localizable.strings b/hw/darwin/bundle/Dutch.lproj/Localizable.strings
index 22d7683eb..6abd91072 100644
--- a/hw/darwin/bundle/Dutch.lproj/Localizable.strings
+++ b/hw/darwin/bundle/Dutch.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/English.lproj/Localizable.strings b/hw/darwin/bundle/English.lproj/Localizable.strings
index 6025a2469..241d1585b 100644
--- a/hw/darwin/bundle/English.lproj/Localizable.strings
+++ b/hw/darwin/bundle/English.lproj/Localizable.strings
@@ -1,5 +1,5 @@
/* English localized versions of strings used by the Mac OS X front end. */
-/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings,v 1.3 2002/01/30 06:50:46 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/bundle/English.lproj/Localizable.strings,v 1.4 2003/11/04 22:48:14 torrey Exp $ */
/* Title of alert panel */
"Quit X server?" = "Quit X server?";
@@ -14,10 +14,10 @@
"Cancel" = "Cancel";
/* Default keymapping file */
-"USA.keymapping" = "USA.keymapping"
+"USA.keymapping" = "USA.keymapping";
/* Default switch string */
-"Cmd-Opt-a" = "Cmd-Opt-a"
+"Cmd-Opt-a" = "Cmd-Opt-a";
/* Button title when changing switch key */
-"Press key" = "Press key"
+"Press key" = "Press key";
diff --git a/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib b/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
index ba1e3a206..77f345a4e 100644
--- a/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
+++ b/hw/darwin/bundle/English.lproj/MainMenu.nib/classes.nib
@@ -41,14 +41,20 @@
},
{
ACTIONS = {
+ bringAllToFront = id;
closeHelpAndShow = id;
+ itemSelected = id;
+ nextWindow = id;
+ previousWindow = id;
showAction = id;
+ showSwitchPanel = id;
startFullScreen = id;
startRootless = id;
};
CLASS = XServer;
LANGUAGE = ObjC;
OUTLETS = {
+ dockMenu = NSMenu;
helpWindow = NSWindow;
modeWindow = NSWindow;
startFullScreenButton = NSButton;
@@ -56,6 +62,8 @@
startupHelpButton = NSButton;
startupModeButton = NSButton;
switchWindow = NSPanel;
+ windowMenu = NSMenu;
+ windowSeparator = NSMenuItem;
};
SUPERCLASS = NSObject;
}
diff --git a/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib b/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
index 7aedf01c2..5aa102278 100644
--- a/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
+++ b/hw/darwin/bundle/English.lproj/MainMenu.nib/objects.nib
Binary files differ
diff --git a/hw/darwin/bundle/French.lproj/Localizable.strings b/hw/darwin/bundle/French.lproj/Localizable.strings
index 591f73cae..21c4a99c1 100644
--- a/hw/darwin/bundle/French.lproj/Localizable.strings
+++ b/hw/darwin/bundle/French.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/German.lproj/Localizable.strings b/hw/darwin/bundle/German.lproj/Localizable.strings
index 365cc291a..5db6306ec 100644
--- a/hw/darwin/bundle/German.lproj/Localizable.strings
+++ b/hw/darwin/bundle/German.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Japanese.lproj/Localizable.strings b/hw/darwin/bundle/Japanese.lproj/Localizable.strings
index 091138dd5..c5c26d61a 100644
--- a/hw/darwin/bundle/Japanese.lproj/Localizable.strings
+++ b/hw/darwin/bundle/Japanese.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Portuguese.lproj/Localizable.strings b/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
index b3edbb41d..c79b282f6 100644
--- a/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
+++ b/hw/darwin/bundle/Portuguese.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Spanish.lproj/Localizable.strings b/hw/darwin/bundle/Spanish.lproj/Localizable.strings
index 06eb0e5fb..5bf813f1f 100644
--- a/hw/darwin/bundle/Spanish.lproj/Localizable.strings
+++ b/hw/darwin/bundle/Spanish.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/Swedish.lproj/Localizable.strings b/hw/darwin/bundle/Swedish.lproj/Localizable.strings
index 7ade67d55..9709e5469 100644
--- a/hw/darwin/bundle/Swedish.lproj/Localizable.strings
+++ b/hw/darwin/bundle/Swedish.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/bundle/ko.lproj/Localizable.strings b/hw/darwin/bundle/ko.lproj/Localizable.strings
index 2e7137b05..fb8c77e0d 100644
--- a/hw/darwin/bundle/ko.lproj/Localizable.strings
+++ b/hw/darwin/bundle/ko.lproj/Localizable.strings
Binary files differ
diff --git a/hw/darwin/darwin.c b/hw/darwin/darwin.c
index ff5ae1b33..a7a0d839c 100644
--- a/hw/darwin/darwin.c
+++ b/hw/darwin/darwin.c
@@ -1,11 +1,11 @@
/**************************************************************
*
* Shared code for the Darwin X Server
- * running with Quartz or the IOKit
+ * running with Quartz or IOKit display mode
*
**************************************************************/
/*
- * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
+ * Copyright (c) 2001-2003 Torrey T. Lyons. 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"),
@@ -29,7 +29,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.50 2003/02/26 09:21:33 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.55 2003/11/15 00:07:09 torrey Exp $ */
#include "X.h"
#include "Xproto.h"
@@ -52,6 +52,7 @@
#include <sys/syslimits.h>
#include <stdio.h>
#include <fcntl.h>
+#include <unistd.h>
#define NO_CFPLUGIN
#include <IOKit/IOKitLib.h>
@@ -60,8 +61,6 @@
#include "darwin.h"
#include "darwinClut8.h"
-#include "quartz/quartz.h"
-#include "xfIOKit.h"
/*
* X server shared global variables
@@ -69,9 +68,9 @@
int darwinScreensFound = 0;
int darwinScreenIndex = 0;
io_connect_t darwinParamConnect = 0;
-int darwinEventFD = -1;
-Bool quartz = FALSE;
-int quartzMouseAccelChange = 1;
+int darwinEventReadFD = -1;
+int darwinEventWriteFD = -1;
+int darwinMouseAccelChange = 1;
int darwinFakeButtons = 0;
// location of X11's (0,0) point in global screen coordinates
@@ -113,7 +112,7 @@ const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]);
#define PRE_RELEASE XF86_VERSION_SNAP
#endif
-static void
+void
DarwinPrintBanner()
{
#if PRE_RELEASE
@@ -193,11 +192,7 @@ static Bool DarwinAddScreen(
SCREEN_PRIV(pScreen) = dfb;
// setup hardware/mode specific details
- if (quartz) {
- ret = QuartzAddScreen(foundIndex, pScreen);
- } else {
- ret = XFIOKitAddScreen(foundIndex, pScreen);
- }
+ ret = DarwinModeAddScreen(foundIndex, pScreen);
foundIndex++;
if (! ret)
return FALSE;
@@ -276,14 +271,8 @@ static Bool DarwinAddScreen(
pScreen->SaveScreen = DarwinSaveScreen;
// finish mode dependent screen setup including cursor support
- if (quartz) {
- if (! QuartzSetupScreen(index, pScreen)) {
- return FALSE;
- }
- } else {
- if (! XFIOKitSetupScreen(index, pScreen)) {
- return FALSE;
- }
+ if (!DarwinModeSetupScreen(index, pScreen)) {
+ return FALSE;
}
// create and install the default colormap and
@@ -337,7 +326,7 @@ static void DarwinChangePointerControl(
kern_return_t kr;
double acceleration;
- if (!quartzMouseAccelChange)
+ if (!darwinMouseAccelChange)
return;
acceleration = ctrl->num / ctrl->den;
@@ -378,13 +367,13 @@ static int DarwinMouseProc(
case DEVICE_ON:
pPointer->public.on = TRUE;
- AddEnabledDevice( darwinEventFD );
+ AddEnabledDevice( darwinEventReadFD );
return Success;
case DEVICE_CLOSE:
case DEVICE_OFF:
pPointer->public.on = FALSE;
- RemoveEnabledDevice( darwinEventFD );
+ RemoveEnabledDevice( darwinEventReadFD );
return Success;
}
@@ -404,11 +393,11 @@ static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff )
break;
case DEVICE_ON:
pDev->public.on = TRUE;
- AddEnabledDevice( darwinEventFD );
+ AddEnabledDevice( darwinEventReadFD );
break;
case DEVICE_OFF:
pDev->public.on = FALSE;
- RemoveEnabledDevice( darwinEventFD );
+ RemoveEnabledDevice( darwinEventReadFD );
break;
case DEVICE_CLOSE:
break;
@@ -529,12 +518,61 @@ void InitInput( int argc, char **argv )
darwinKeyboard = AddInputDevice(DarwinKeybdProc, TRUE);
RegisterKeyboardDevice( darwinKeyboard );
- DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer );
+ if (serverGeneration == 1) {
+ DarwinEQInit( (DevicePtr)darwinKeyboard, (DevicePtr)darwinPointer );
+ }
- if (quartz) {
- QuartzInitInput(argc, argv);
- } else {
- XFIOKitInitInput(argc, argv);
+ DarwinModeInitInput(argc, argv);
+}
+
+
+/*
+ * DarwinAdjustScreenOrigins
+ * Shift all screens so the X11 (0, 0) coordinate is at the top
+ * left of the global screen coordinates.
+ *
+ * Screens can be arranged so the top left isn't on any screen, so
+ * instead use the top left of the leftmost screen as (0,0). This
+ * may mean some screen space is in -y, but it's better that (0,0)
+ * be onscreen, or else default xterms disappear. It's better that
+ * -y be used than -x, because when popup menus are forced
+ * "onscreen" by dumb window managers like twm, they'll shift the
+ * menus down instead of left, which still looks funny but is an
+ * easier target to hit.
+ */
+void
+DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo)
+{
+ int i, left, top;
+
+ left = dixScreenOrigins[0].x;
+ top = dixScreenOrigins[0].y;
+
+ /* Find leftmost screen. If there's a tie, take the topmost of the two. */
+ for (i = 1; i < pScreenInfo->numScreens; i++) {
+ if (dixScreenOrigins[i].x < left ||
+ (dixScreenOrigins[i].x == left &&
+ dixScreenOrigins[i].y < top))
+ {
+ left = dixScreenOrigins[i].x;
+ top = dixScreenOrigins[i].y;
+ }
+ }
+
+ darwinMainScreenX = left;
+ darwinMainScreenY = top;
+
+ /* Shift all screens so that there is a screen whose top left
+ is at X11 (0,0) and at global screen coordinate
+ (darwinMainScreenX, darwinMainScreenY). */
+
+ if (darwinMainScreenX != 0 || darwinMainScreenY != 0) {
+ for (i = 0; i < pScreenInfo->numScreens; i++) {
+ dixScreenOrigins[i].x -= darwinMainScreenX;
+ dixScreenOrigins[i].y -= darwinMainScreenY;
+ ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n",
+ i, dixScreenOrigins[i].x, dixScreenOrigins[i].y);
+ }
}
}
@@ -554,7 +592,7 @@ void InitInput( int argc, char **argv )
*/
void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
{
- int i, left, top;
+ int i;
static unsigned long generation = 0;
pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
@@ -574,55 +612,14 @@ void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv )
}
// Discover screens and do mode specific initialization
- if (quartz) {
- QuartzInitOutput(argc, argv);
- } else {
- XFIOKitInitOutput(argc, argv);
- }
+ DarwinModeInitOutput(argc, argv);
// Add screens
for (i = 0; i < darwinScreensFound; i++) {
AddScreen( DarwinAddScreen, argc, argv );
}
- // Shift all screens so the X11 (0, 0) coordinate is at the top left
- // of the global screen coordinates.
- // Screens can be arranged so the top left isn't on any screen,
- // so instead use the top left of the leftmost screen as (0,0).
- // This may mean some screen space is in -y, but it's better
- // that (0,0) be onscreen, or else default xterms disappear.
- // It's better that -y be used than -x, because when popup
- // menus are forced "onscreen" by dumb window managers like twm,
- // they'll shift the menus down instead of left, which still looks
- // funny but is an easier target to hit.
- left = dixScreenOrigins[0].x;
- top = dixScreenOrigins[0].y;
-
- // Find leftmost screen. If there's a tie, take the topmost of the two.
- for (i = 1; i < pScreenInfo->numScreens; i++) {
- if (dixScreenOrigins[i].x < left ||
- (dixScreenOrigins[i].x == left &&
- dixScreenOrigins[i].y < top))
- {
- left = dixScreenOrigins[i].x;
- top = dixScreenOrigins[i].y;
- }
- }
-
- darwinMainScreenX = left;
- darwinMainScreenY = top;
-
- // Shift all screens so that there is a screen whose top left
- // is at X11 (0,0) and at global screen coordinate
- // (darwinMainScreenX, darwinMainScreenY).
- if (darwinMainScreenX != 0 || darwinMainScreenY != 0) {
- for (i = 0; i < pScreenInfo->numScreens; i++) {
- dixScreenOrigins[i].x -= darwinMainScreenX;
- dixScreenOrigins[i].y -= darwinMainScreenY;
- ErrorF("Screen %d placed at X11 coordinate (%d,%d).\n",
- i, dixScreenOrigins[i].x, dixScreenOrigins[i].y);
- }
- }
+ DarwinAdjustScreenOrigins(pScreenInfo);
}
@@ -648,13 +645,16 @@ void OsVendorInit(void)
// Find the full path to the keymapping file.
if ( darwinKeymapFile ) {
char *tempStr = DarwinFindLibraryFile(darwinKeymapFile, "Keyboards");
- if ( !tempStr )
- FatalError("Could not find keymapping file %s.\n",
- darwinKeymapFile);
+ if ( !tempStr ) {
+ ErrorF("Could not find keymapping file %s.\n", darwinKeymapFile);
+ } else {
+ ErrorF("Using keymapping provided in %s.\n", tempStr);
+ }
darwinKeymapFile = tempStr;
- ErrorF("Using keymapping provided in %s.\n", darwinKeymapFile);
- } else {
- ErrorF("Reading keymapping from the kernel.\n");
+ }
+
+ if ( !darwinKeymapFile ) {
+ ErrorF("Reading keymap from the system.\n");
}
}
@@ -667,12 +667,10 @@ void OsVendorInit(void)
*/
int ddxProcessArgument( int argc, char *argv[], int i )
{
-#ifdef DARWIN_WITH_QUARTZ
int numDone;
- if ((numDone = QuartzProcessArgument( argc, argv, i )))
+ if ((numDone = DarwinModeProcessArgument( argc, argv, i )))
return numDone;
-#endif
if ( !strcmp( argv[i], "-fakebuttons" ) ) {
darwinFakeButtons = TRUE;
@@ -833,11 +831,7 @@ void ddxGiveUp( void )
{
ErrorF( "Quitting XDarwin...\n" );
- if (quartz) {
- QuartzGiveUp();
- } else {
- XFIOKitGiveUp();
- }
+ DarwinModeGiveUp();
}
diff --git a/hw/darwin/darwin.h b/hw/darwin/darwin.h
index 62698d74a..79fa00ffc 100644
--- a/hw/darwin/darwin.h
+++ b/hw/darwin/darwin.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
+ * Copyright (c) 2001-2003 Torrey T. Lyons. 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"),
@@ -23,16 +23,15 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.15 2002/12/10 00:00:38 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.20 2003/11/15 00:07:09 torrey Exp $ */
#ifndef _DARWIN_H
#define _DARWIN_H
#include <IOKit/IOTypes.h>
#include "inputstr.h"
-#include "screenint.h"
+#include "scrnintstr.h"
#include "extensions/XKB.h"
-#include "quartz/quartzShared.h"
typedef struct {
void *framebuffer;
@@ -48,6 +47,9 @@ typedef struct {
} DarwinFramebufferRec, *DarwinFramebufferPtr;
+// From darwin.c
+void DarwinPrintBanner();
+void DarwinAdjustScreenOrigins(ScreenInfo *pScreenInfo);
void xf86SetRootClip (ScreenPtr pScreen, BOOL enable);
// From darwinEvents.c
@@ -64,6 +66,17 @@ int DarwinModifierNXKeyToNXMask(int key);
int DarwinModifierNXMaskToNXKey(int mask);
int DarwinModifierStringToNXKey(const char *string);
+// Mode specific functions
+Bool DarwinModeAddScreen(int index, ScreenPtr pScreen);
+Bool DarwinModeSetupScreen(int index, ScreenPtr pScreen);
+void DarwinModeInitOutput(int argc,char **argv);
+void DarwinModeInitInput(int argc, char **argv);
+int DarwinModeProcessArgument(int argc, char *argv[], int i);
+void DarwinModeProcessEvent(xEvent *xe);
+void DarwinModeGiveUp(void);
+void DarwinModeBell(int volume, DeviceIntPtr pDevice, pointer ctrl, int class);
+
+
#undef assert
#define assert(x) { if ((x) == 0) \
FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); }
@@ -76,31 +89,60 @@ int DarwinModifierStringToNXKey(const char *string);
#define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0...
+
/*
* Global variables from darwin.c
*/
extern int darwinScreenIndex; // index into pScreen.devPrivates
extern int darwinScreensFound;
extern io_connect_t darwinParamConnect;
-extern int darwinEventFD;
-extern Bool quartz;
+extern int darwinEventReadFD;
+extern int darwinEventWriteFD;
+
+// User preferences
+extern int darwinMouseAccelChange;
+extern int darwinFakeButtons;
+extern int darwinFakeMouse2Mask;
+extern int darwinFakeMouse3Mask;
+extern char *darwinKeymapFile;
+extern unsigned int darwinDesiredWidth, darwinDesiredHeight;
+extern int darwinDesiredDepth;
+extern int darwinDesiredRefresh;
+
+// location of X11's (0,0) point in global screen coordinates
+extern int darwinMainScreenX;
+extern int darwinMainScreenY;
+
/*
* Special ddx events understood by the X server
*/
enum {
- kXDarwinUpdateModifiers // update all modifier keys
- = LASTEvent+1, // (from X.h list of event names)
- kXDarwinUpdateButtons, // update state of mouse buttons 2 and up
- kXDarwinScrollWheel, // scroll wheel event
- kXDarwinShow, // vt switch to X server;
- // recapture screen and restore X drawing
- kXDarwinHide, // vt switch away from X server;
- // release screen and clip X drawing
- kXDarwinSetRootClip, // enable or disable drawing to the X screen
- kXDarwinQuit, // kill the X server and release the display
- kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer
- kXDarwinWritePasteboard // copy X cut buffer onto Mac OS X pasteboard
+ kXDarwinUpdateModifiers // update all modifier keys
+ = LASTEvent+1, // (from X.h list of event names)
+ kXDarwinUpdateButtons, // update state of mouse buttons 2 and up
+ kXDarwinScrollWheel, // scroll wheel event
+
+ /*
+ * Quartz-specific events -- not used in IOKit mode
+ */
+ kXDarwinActivate, // restore X drawing and cursor
+ kXDarwinDeactivate, // clip X drawing and switch to Aqua cursor
+ kXDarwinSetRootClip, // enable or disable drawing to the X screen
+ kXDarwinQuit, // kill the X server and release the display
+ kXDarwinReadPasteboard, // copy Mac OS X pasteboard into X cut buffer
+ kXDarwinWritePasteboard, // copy X cut buffer onto Mac OS X pasteboard
+ /*
+ * AppleWM events
+ */
+ kXDarwinControllerNotify, // send an AppleWMControllerNotify event
+ kXDarwinPasteboardNotify, // notify the WM to copy or paste
+ /*
+ * Xplugin notification events
+ */
+ kXDarwinDisplayChanged, // display configuration has changed
+ kXDarwinWindowState, // window visibility state has changed
+ kXDarwinWindowMoved // window has moved on screen
};
#endif /* _DARWIN_H */
diff --git a/hw/darwin/darwinClut8.h b/hw/darwin/darwinClut8.h
index 06e7b71c5..68a7ad16f 100644
--- a/hw/darwin/darwinClut8.h
+++ b/hw/darwin/darwinClut8.h
@@ -1,7 +1,7 @@
/*
* Darwin default 8-bit Colormap for StaticColor
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwinClut8.h,v 1.1.8.1 2003/03/04 01:31:43 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwinClut8.h,v 1.2 2003/03/04 01:37:59 torrey Exp $ */
#ifndef _DARWIN_CLUT8_
#define _DARWIN_CLUT8_
diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c
index 72d7eff05..ba1ec8fc2 100644
--- a/hw/darwin/darwinEvents.c
+++ b/hw/darwin/darwinEvents.c
@@ -28,6 +28,7 @@ Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwinEvents.c,v 1.5 2003/11/03 05:36:30 tsi Exp $ */
#define NEED_EVENTS
#include "X.h"
@@ -42,7 +43,6 @@ in this Software without prior written authorization from The Open Group.
#include "mipointer.h"
#include "darwin.h"
-#include "quartz/quartz.h"
#include <sys/types.h>
#include <sys/uio.h>
@@ -181,6 +181,7 @@ DarwinEQEnqueue(
const xEvent *e)
{
HWEventQueueType oldtail, newtail;
+ char byte = 0;
oldtail = darwinEventQueue.tail;
@@ -209,6 +210,9 @@ DarwinEQEnqueue(
// Update the tail after the event is prepared
darwinEventQueue.tail = newtail;
+
+ // Signal there is an event ready to handle
+ write(darwinEventWriteFD, &byte, 1);
}
@@ -253,7 +257,7 @@ void ProcessInputEvents(void)
// Empty the signaling pipe
x = sizeof(xe);
while (x == sizeof(xe)) {
- x = read(darwinEventFD, &xe, sizeof(xe));
+ x = read(darwinEventReadFD, &xe, sizeof(xe));
}
while (darwinEventQueue.head != darwinEventQueue.tail)
@@ -425,11 +429,8 @@ void ProcessInputEvents(void)
}
default:
- if (quartz) {
- QuartzProcessEvent(&xe);
- } else {
- ErrorF("Unknown X event caught: %d\n", xe.u.u.type);
- }
+ // Check for mode specific event
+ DarwinModeProcessEvent(&xe);
}
}
}
diff --git a/hw/darwin/darwinKeyboard.c b/hw/darwin/darwinKeyboard.c
index 4113bacba..57bf5fa3d 100644
--- a/hw/darwin/darwinKeyboard.c
+++ b/hw/darwin/darwinKeyboard.c
@@ -2,7 +2,8 @@
//
// Keyboard support for the Darwin X Server
//
-// Copyright (c) 2001-2002 Torrey T. Lyons. All Rights Reserved.
+// Copyright (c) 2001-2003 Torrey T. Lyons. All Rights Reserved.
+// Copyright (c) 2003 Apple Computer, Inc. All Rights Reserved.
//
// The code to parse the Darwin keymap is derived from dumpkeymap.c
// by Eric Sunshine, which includes the following copyright:
@@ -36,7 +37,7 @@
//
//=============================================================================
-/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.c,v 1.17 2002/12/10 00:00:38 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.c,v 1.19 2003/11/01 08:13:08 torrey Exp $ */
/*
===========================================================================
@@ -59,26 +60,18 @@
// in determining how the X server is interpreting the Darwin keymap.
#undef DUMP_DARWIN_KEYMAP
+/* Define this to use Alt for Mode_switch. */
+#define ALT_IS_MODE_SWITCH 1
+
#include <drivers/event_status_driver.h>
#include <IOKit/hidsystem/ev_keymap.h>
#include <stdio.h>
#include <stdlib.h>
+#include <errno.h>
#include <sys/stat.h>
#include <architecture/byte_order.h> // For the NXSwap*
#include "darwin.h"
-#include "xfIOKit.h"
-#include "quartz/quartzAudio.h"
-#include "quartz/quartzShared.h"
-
-#define XK_TECHNICAL // needed to get XK_Escape
-#define XK_PUBLISHING
-#include "keysym.h"
-
-// Each key can generate 4 glyphs. They are, in order:
-// unshifted, shifted, modeswitch unshifted, modeswitch shifted
-#define GLYPHS_PER_KEY 4
-#define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better
-#define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1
+#include "darwinKeyboard.h"
#define AltMask Mod1Mask
#define MetaMask Mod2Mask
@@ -224,11 +217,9 @@ static void DarwinChangeKeyboardControl( DeviceIntPtr device, KeybdCtrl *ctrl )
// keyclick, bell volume / pitch, autorepead, LED's
}
-static CARD8 modMap[MAP_LENGTH];
-static KeySym map[MAP_LENGTH * GLYPHS_PER_KEY];
-static unsigned char modifierKeycodes[NX_NUMMODIFIERS][2];
-static FILE *fref = NULL;
-static char *inBuffer = NULL;
+static darwinKeyboardInfo keyInfo;
+static FILE *fref = NULL;
+static char *inBuffer = NULL;
//-----------------------------------------------------------------------------
// Data Stream Object
@@ -449,34 +440,18 @@ Bool DarwinReadKeymapFile(
/*
- * DarwinKeyboardInit
- * Get the Darwin keyboard map and compute an equivalent
- * X keyboard map and modifier map. Set the new keyboard
- * device structure.
+ * DarwinParseNXKeyMapping
*/
-void DarwinKeyboardInit(
- DeviceIntPtr pDev )
+Bool DarwinParseNXKeyMapping(
+ darwinKeyboardInfo *info)
{
KeySym *k;
int i;
short numMods, numKeys, numPadKeys = 0;
- KeySymsRec keySyms;
+ Bool haveKeymap = FALSE;
NXKeyMapping keyMap;
DataStream *keyMapStream;
unsigned char const *numPadStart = 0;
- BellProcPtr bellProc;
- Bool haveKeymap = FALSE;
-
- memset( modMap, NoSymbol, sizeof( modMap ) );
- memset( map, 0, sizeof( map ) );
- for (i = 0; i < NX_NUMMODIFIERS; i++) {
- modifierKeycodes[i][0] = modifierKeycodes[i][1] = 0;
- }
-
- // Open a shared connection to the HID System.
- // Note that the Event Status Driver is really just a wrapper
- // for a kIOHIDParamConnectType connection.
- assert( darwinParamConnect = NXOpenEventStatus() );
if (darwinKeymapFile) {
haveKeymap = DarwinReadKeymapFile(&keyMap);
@@ -494,7 +469,7 @@ void DarwinKeyboardInit(
keyMap.size = NXKeyMappingLength( darwinParamConnect );
keyMap.mapping = (char*) xalloc( keyMap.size );
if (!NXGetKeyMapping( darwinParamConnect, &keyMap )) {
- FatalError("Could not get kernel keymapping! Load keymapping from file instead.\n");
+ return FALSE;
}
}
@@ -507,9 +482,7 @@ void DarwinKeyboardInit(
ErrorF("Current 16-bit keymapping may not be interpreted correctly.\n");
}
- // Compute the modifier map and
- // insert X modifier KeySyms into keyboard map.
- // Store modifier keycodes in modifierKeycodes.
+ // Insert X modifier KeySyms into the keyboard map.
numMods = get_number(keyMapStream);
while (numMods-- > 0) {
int left = 1; // first keycode is left
@@ -526,40 +499,33 @@ void DarwinKeyboardInit(
while (numKeyCodes-- > 0) {
const short keyCode = get_number(keyMapStream);
if (charCode != NX_MODIFIERKEY_NUMERICPAD) {
- modifierKeycodes[charCode][1-left] = keyCode;
switch (charCode) {
case NX_MODIFIERKEY_ALPHALOCK:
- modMap[keyCode + MIN_KEYCODE] = LockMask;
- map[keyCode * GLYPHS_PER_KEY] = XK_Caps_Lock;
+ info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Caps_Lock;
break;
case NX_MODIFIERKEY_SHIFT:
- modMap[keyCode + MIN_KEYCODE] = ShiftMask;
- map[keyCode * GLYPHS_PER_KEY] =
+ info->keyMap[keyCode * GLYPHS_PER_KEY] =
(left ? XK_Shift_L : XK_Shift_R);
break;
case NX_MODIFIERKEY_CONTROL:
- modMap[keyCode + MIN_KEYCODE] = ControlMask;
- map[keyCode * GLYPHS_PER_KEY] =
+ info->keyMap[keyCode * GLYPHS_PER_KEY] =
(left ? XK_Control_L : XK_Control_R);
break;
case NX_MODIFIERKEY_ALTERNATE:
- modMap[keyCode + MIN_KEYCODE] = AltMask;
- map[keyCode * GLYPHS_PER_KEY] =
+ info->keyMap[keyCode * GLYPHS_PER_KEY] =
(left ? XK_Mode_switch : XK_Alt_R);
break;
case NX_MODIFIERKEY_COMMAND:
- modMap[keyCode + MIN_KEYCODE] = MetaMask;
- map[keyCode * GLYPHS_PER_KEY] =
+ info->keyMap[keyCode * GLYPHS_PER_KEY] =
(left ? XK_Meta_L : XK_Meta_R);
break;
case NX_MODIFIERKEY_SECONDARYFN:
- modMap[keyCode + MIN_KEYCODE] = FunctionMask;
- map[keyCode * GLYPHS_PER_KEY] =
+ info->keyMap[keyCode * GLYPHS_PER_KEY] =
(left ? XK_Control_L : XK_Control_R);
break;
case NX_MODIFIERKEY_HELP:
// Help is not an X11 modifier; treat as normal key
- map[keyCode * GLYPHS_PER_KEY] = XK_Help;
+ info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Help;
break;
}
}
@@ -567,12 +533,12 @@ void DarwinKeyboardInit(
}
}
- // Convert the Darwin keyboard map to an X keyboard map.
+ // Convert the Darwin keyboard mapping to an X keyboard map.
// A key can have a different character code for each combination of
// modifiers. We currently ignore all modifier combinations except
// those with Shift, AlphaLock, and Alt.
numKeys = get_number(keyMapStream);
- for (i = 0, k = map; i < numKeys; i++, k += GLYPHS_PER_KEY) {
+ for (i = 0, k = info->keyMap; i < numKeys; i++, k += GLYPHS_PER_KEY) {
short const charGenMask = get_number(keyMapStream);
if (charGenMask != 0xFF) { // is key bound?
short numKeyCodes = 1 << bits_set(charGenMask);
@@ -656,7 +622,7 @@ void DarwinKeyboardInit(
keyMapStream->data = numPadStart;
while(numPadKeys-- > 0) {
const short keyCode = get_number(keyMapStream);
- k = &map[keyCode * GLYPHS_PER_KEY];
+ k = &info->keyMap[keyCode * GLYPHS_PER_KEY];
for (i = 0; i < NUM_KEYPAD; i++) {
if (*k == normal_to_keypad[i].normalSym) {
k[0] = normal_to_keypad[i].keypadSym;
@@ -671,7 +637,9 @@ void DarwinKeyboardInit(
#ifdef DUMP_DARWIN_KEYMAP
ErrorF("Darwin -> X converted keyboard map\n");
- for (i = 0, k = map; i < NX_NUMKEYCODES; i++, k += GLYPHS_PER_KEY) {
+ for (i = 0, k = info->keyMap; i < NX_NUMKEYCODES;
+ i++, k += GLYPHS_PER_KEY)
+ {
int j;
ErrorF("0x%02x:", i);
for (j = 0; j < GLYPHS_PER_KEY; j++) {
@@ -685,18 +653,145 @@ void DarwinKeyboardInit(
}
#endif
- keySyms.map = map;
+ return TRUE;
+}
+
+
+/*
+ * DarwinBuildModifierMaps
+ * Use the keyMap field of keyboard info structure to populate
+ * the modMap and modifierKeycodes fields.
+ */
+static void
+DarwinBuildModifierMaps(
+ darwinKeyboardInfo *info)
+{
+ int i;
+ KeySym *k;
+ int darwinSwapAltMeta = 0;
+
+ memset(info->modMap, NoSymbol, sizeof(info->modMap));
+ memset(info->modifierKeycodes, 0, sizeof(info->modifierKeycodes));
+
+ for (i = 0; i < NUM_KEYCODES; i++)
+ {
+ k = info->keyMap + i * GLYPHS_PER_KEY;
+
+ switch (k[0]) {
+ case XK_Shift_L:
+ info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][0] = i;
+ info->modMap[MIN_KEYCODE + i] = ShiftMask;
+ break;
+
+ case XK_Shift_R:
+ info->modifierKeycodes[NX_MODIFIERKEY_SHIFT][1] = i;
+ info->modMap[MIN_KEYCODE + i] = ShiftMask;
+ break;
+
+ case XK_Control_L:
+ info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][0] = i;
+ info->modMap[MIN_KEYCODE + i] = ControlMask;
+ break;
+
+ case XK_Control_R:
+ info->modifierKeycodes[NX_MODIFIERKEY_CONTROL][1] = i;
+ info->modMap[MIN_KEYCODE + i] = ControlMask;
+ break;
+
+ case XK_Caps_Lock:
+ info->modifierKeycodes[NX_MODIFIERKEY_ALPHALOCK][0] = i;
+ info->modMap[MIN_KEYCODE + i] = LockMask;
+ break;
+
+ case XK_Alt_L:
+ info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i;
+ info->modMap[MIN_KEYCODE + i] = Mod1Mask;
+ break;
+
+ case XK_Alt_R:
+ info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][1] = i;
+ info->modMap[MIN_KEYCODE + i] = Mod1Mask;
+ break;
+
+ case XK_Mode_switch:
+ info->modMap[MIN_KEYCODE + i] = Mod1Mask;
+ break;
+
+ case XK_Meta_L:
+ info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][0] = i;
+ info->modMap[MIN_KEYCODE + i] = Mod2Mask;
+ break;
+
+ case XK_Meta_R:
+ info->modifierKeycodes[NX_MODIFIERKEY_COMMAND][1] = i;
+ info->modMap[MIN_KEYCODE + i] = Mod2Mask;
+ break;
+
+ case XK_Num_Lock:
+ info->modMap[MIN_KEYCODE + i] = Mod3Mask;
+ break;
+ }
+
+ if (darwinSwapAltMeta)
+ {
+ switch (k[0])
+ {
+ case XK_Alt_L:
+ k[0] = XK_Meta_L;
+ break;
+ case XK_Alt_R:
+ k[0] = XK_Meta_R;
+ break;
+ case XK_Meta_L:
+ k[0] = XK_Alt_L;
+ break;
+ case XK_Meta_R:
+ k[0] = XK_Alt_R;
+ break;
+ }
+ }
+
+#if ALT_IS_MODE_SWITCH
+ if (k[0] == XK_Alt_L || k[0] == XK_Alt_R)
+ k[0] = XK_Mode_switch;
+#endif
+ }
+}
+
+
+/*
+ * DarwinKeyboardInit
+ * Get the Darwin keyboard map and compute an equivalent
+ * X keyboard map and modifier map. Set the new keyboard
+ * device structure.
+ */
+void DarwinKeyboardInit(
+ DeviceIntPtr pDev )
+{
+ KeySymsRec keySyms;
+
+ memset( keyInfo.keyMap, 0, sizeof( keyInfo.keyMap ) );
+
+ // Open a shared connection to the HID System.
+ // Note that the Event Status Driver is really just a wrapper
+ // for a kIOHIDParamConnectType connection.
+ assert( darwinParamConnect = NXOpenEventStatus() );
+
+ if (!DarwinParseNXKeyMapping(&keyInfo)) {
+ if (!DarwinModeReadSystemKeymap(&keyInfo)) {
+ FatalError("Could not build a valid keymap.");
+ }
+ }
+
+ DarwinBuildModifierMaps(&keyInfo);
+
+ keySyms.map = keyInfo.keyMap;
keySyms.mapWidth = GLYPHS_PER_KEY;
keySyms.minKeyCode = MIN_KEYCODE;
keySyms.maxKeyCode = MAX_KEYCODE;
- if (quartz)
- bellProc = QuartzBell;
- else
- bellProc = XFIOKitBell;
-
- assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms, modMap,
- bellProc,
+ assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms,
+ keyInfo.modMap, DarwinModeBell,
DarwinChangeKeyboardControl ));
}
@@ -718,7 +813,7 @@ void DarwinKeyboardInit(
*/
int DarwinModifierNXKeyToNXKeycode(int key, int side)
{
- return modifierKeycodes[key][side];
+ return keyInfo.modifierKeycodes[key][side];
}
/*
@@ -734,7 +829,7 @@ int DarwinModifierNXKeycodeToNXKey(unsigned char keycode, int *outSide)
// search modifierKeycodes for this keycode+side
for (key = 0; key < NX_NUMMODIFIERS; key++) {
for (side = 0; side <= 1; side++) {
- if (modifierKeycodes[key][side] == keycode) break;
+ if (keyInfo.modifierKeycodes[key][side] == keycode) break;
}
}
if (key == NX_NUMMODIFIERS) return -1;
diff --git a/hw/darwin/quartz/Preferences.h b/hw/darwin/quartz/Preferences.h
index 2c0d6756b..22a2f1441 100644
--- a/hw/darwin/quartz/Preferences.h
+++ b/hw/darwin/quartz/Preferences.h
@@ -1,4 +1,31 @@
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.h,v 1.2 2003/01/15 02:34:05 torrey Exp $ */
+/*
+ * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(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(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.h,v 1.3 2003/09/16 00:36:12 torrey Exp $ */
#import <Cocoa/Cocoa.h>
@@ -35,14 +62,14 @@
- (IBAction)saveChanges:(id)sender;
- (IBAction)setKey:(id)sender;
-- (BOOL)sendEvent:(NSEvent*)anEvent;
+- (BOOL)sendEvent:(NSEvent *)anEvent;
- (void)awakeFromNib;
- (void)windowWillClose:(NSNotification *)aNotification;
+ (void)setUseKeymapFile:(BOOL)newUseKeymapFile;
-+ (void)setKeymapFile:(NSString*)newFile;
-+ (void)setSwitchString:(NSString*)newString;
++ (void)setKeymapFile:(NSString *)newFile;
++ (void)setSwitchString:(NSString *)newString;
+ (void)setKeyCode:(int)newKeyCode;
+ (void)setModifiers:(int)newModifiers;
+ (void)setDisplay:(int)newDisplay;
@@ -59,15 +86,16 @@
+ (void)setSystemBeep:(BOOL)newSystemBeep;
+ (void)setXinerama:(BOOL)newXinerama;
+ (void)setAddToPath:(BOOL)newAddToPath;
-+ (void)setAddToPathString:(NSString*)newAddToPathString;
++ (void)setAddToPathString:(NSString *)newAddToPathString;
+ (void)setUseDefaultShell:(BOOL)newUseDefaultShell;
-+ (void)setShellString:(NSString*)newShellString;
++ (void)setShellString:(NSString *)newShellString;
+ (void)setDepth:(int)newDepth;
++ (void)setDisplayModeBundles:(NSArray *)newBundles;
+ (void)saveToDisk;
+ (BOOL)useKeymapFile;
-+ (NSString*)keymapFile;
-+ (NSString*)switchString;
++ (NSString *)keymapFile;
++ (NSString *)switchString;
+ (unsigned int)keyCode;
+ (unsigned int)modifiers;
+ (int)display;
@@ -84,10 +112,11 @@
+ (BOOL)systemBeep;
+ (BOOL)xinerama;
+ (BOOL)addToPath;
-+ (NSString*)addToPathString;
++ (NSString *)addToPathString;
+ (BOOL)useDefaultShell;
-+ (NSString*)shellString;
++ (NSString *)shellString;
+ (int)depth;
++ (NSArray *)displayModeBundles;
@end
diff --git a/hw/darwin/quartz/Preferences.m b/hw/darwin/quartz/Preferences.m
index 4f8dacbf0..4120b6360 100644
--- a/hw/darwin/quartz/Preferences.m
+++ b/hw/darwin/quartz/Preferences.m
@@ -3,10 +3,43 @@
//
// This class keeps track of the user preferences.
//
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.2 2003/01/15 02:34:06 torrey Exp $ */
+/*
+ * Copyright (c) 2002-2003 Torrey T. Lyons. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(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(s) of the above copyright
+ * holders shall not be used in advertising or otherwise to promote the
+ * sale, use or other dealings in this Software without prior written
+ * authorization.
+ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/Preferences.m,v 1.4 2003/09/16 00:36:12 torrey Exp $ */
-#import "Preferences.h"
#import "quartzCommon.h"
+
+#define BOOL xBOOL
+#include "darwin.h"
+#undef BOOL
+
+#import "Preferences.h"
+
#include <IOKit/hidsystem/IOLLEvent.h> // for modifier masks
// Macros to build the path name
@@ -36,8 +69,8 @@
@"YES", @"ShowStartupHelp",
[NSNumber numberWithInt:0], @"SwitchKeyCode",
[NSNumber numberWithInt:(NSCommandKeyMask | NSAlternateKeyMask)],
- @"SwitchModifiers", @"NO", @"UseSystemBeep",
- @"YES", @"DockSwitch",
+ @"SwitchModifiers", @"NO", @"UseSystemBeep",
+ @"YES", @"DockSwitch",
@"NO", @"AllowMouseAccelChange",
[NSNumber numberWithInt:qdCursor_Not8Bit], @"UseQDCursor",
@"YES", @"Xinerama",
@@ -45,7 +78,13 @@
[NSString stringWithCString:XSTRPATH(XBINDIR)], @"AddToPathString",
@"YES", @"UseDefaultShell",
@"/bin/tcsh", @"Shell",
- [NSNumber numberWithInt:depth_Current], @"Depth", nil];
+ [NSNumber numberWithInt:depth_Current], @"Depth",
+#ifdef BUILD_XPR
+ [NSArray arrayWithObjects:@"xpr.bundle", @"cr.bundle", nil],
+#else
+ [NSArray arrayWithObjects:@"cr.bundle", nil],
+#endif
+ @"DisplayModeBundles", nil];
[super initialize];
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
@@ -207,7 +246,7 @@
[switchString setString:@""];
}
-- (BOOL)sendEvent:(NSEvent*)anEvent
+- (BOOL)sendEvent:(NSEvent *)anEvent
{
if(isGettingKeyCode) {
if([anEvent type]==NSKeyDown) // wait for keyup
@@ -240,7 +279,7 @@
return NO;
}
-+ (void)setKeymapFile:(NSString*)newFile
++ (void)setKeymapFile:(NSString *)newFile
{
[[NSUserDefaults standardUserDefaults] setObject:newFile
forKey:@"KeymappingFile"];
@@ -252,7 +291,7 @@
forKey:@"UseKeymappingFile"];
}
-+ (void)setSwitchString:(NSString*)newString
++ (void)setSwitchString:(NSString *)newString
{
[[NSUserDefaults standardUserDefaults] setObject:newString
forKey:@"SwitchString"];
@@ -311,7 +350,7 @@
[[NSUserDefaults standardUserDefaults] setBool:newMouseAccelChange
forKey:@"AllowMouseAccelChange"];
// Update the setting used by the X server thread
- quartzMouseAccelChange = newMouseAccelChange;
+ darwinMouseAccelChange = newMouseAccelChange;
}
+ (void)setUseQDCursor:(int)newUseQDCursor
@@ -364,7 +403,7 @@
forKey:@"AddToPath"];
}
-+ (void)setAddToPathString:(NSString*)newAddToPathString
++ (void)setAddToPathString:(NSString *)newAddToPathString
{
[[NSUserDefaults standardUserDefaults] setObject:newAddToPathString
forKey:@"AddToPathString"];
@@ -376,7 +415,7 @@
forKey:@"UseDefaultShell"];
}
-+ (void)setShellString:(NSString*)newShellString
++ (void)setShellString:(NSString *)newShellString
{
[[NSUserDefaults standardUserDefaults] setObject:newShellString
forKey:@"Shell"];
@@ -388,6 +427,12 @@
forKey:@"Depth"];
}
++ (void)setDisplayModeBundles:(NSArray *)newBundles
+{
+ [[NSUserDefaults standardUserDefaults] setObject:newBundles
+ forKey:@"DisplayModeBundles"];
+}
+
+ (void)saveToDisk
{
[[NSUserDefaults standardUserDefaults] synchronize];
@@ -399,13 +444,13 @@
boolForKey:@"UseKeymappingFile"];
}
-+ (NSString*)keymapFile
++ (NSString *)keymapFile
{
return [[NSUserDefaults standardUserDefaults]
stringForKey:@"KeymappingFile"];
}
-+ (NSString*)switchString
++ (NSString *)switchString
{
return [[NSUserDefaults standardUserDefaults]
stringForKey:@"SwitchString"];
@@ -502,7 +547,7 @@
return [[NSUserDefaults standardUserDefaults] boolForKey:@"AddToPath"];
}
-+ (NSString*)addToPathString
++ (NSString *)addToPathString
{
return [[NSUserDefaults standardUserDefaults]
stringForKey:@"AddToPathString"];
@@ -514,7 +559,7 @@
boolForKey:@"UseDefaultShell"];
}
-+ (NSString*)shellString
++ (NSString *)shellString
{
return [[NSUserDefaults standardUserDefaults]
stringForKey:@"Shell"];
@@ -526,5 +571,10 @@
integerForKey:@"Depth"];
}
++ (NSArray *)displayModeBundles
+{
+ return [[NSUserDefaults standardUserDefaults]
+ objectForKey:@"DisplayModeBundles"];
+}
@end
diff --git a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
index 574ce5f18..3afc9177b 100644
--- a/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
+++ b/hw/darwin/quartz/XDarwin.pbproj/project.pbxproj
@@ -23,48 +23,6 @@
path = XApplication.h;
refType = 4;
};
- 014C68ED00ED6A9D7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = XView.h;
- refType = 4;
- };
- 014C68EE00ED6A9D7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = XView.m;
- refType = 4;
- };
- 014C68F200ED7AD67F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = fakeBoxRec.h;
- refType = 4;
- };
- 014C68F300EE5AB97F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessCommon.c;
- refType = 4;
- };
- 014C68F400EE5AB97F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessCommon.h;
- refType = 4;
- };
- 014C68F700EE678F7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessWindow.c;
- refType = 4;
- };
- 014C68F800EE678F7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessWindow.h;
- refType = 4;
- };
015698ED003DF345CE6F79C2 = {
isa = PBXFileReference;
path = XDarwin.icns;
@@ -99,18 +57,6 @@
path = /System/Library/Frameworks/IOKit.framework;
refType = 0;
};
- 017D6F4400E861FB7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessGC.c;
- refType = 4;
- };
- 017D6F4500E861FB7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessScreen.c;
- refType = 4;
- };
018F40F2003E1902CE6F79C2 = {
children = (
018F40F3003E1916CE6F79C2,
@@ -118,6 +64,7 @@
3E74E03600863F047F000001,
F5A94EF10314BAC70100011B,
018F40F6003E1974CE6F79C2,
+ 6E5F5F0005537A1A008FEAD7,
);
isa = PBXGroup;
name = "X Server";
@@ -261,22 +208,6 @@
//042
//043
//044
-//060
-//061
-//062
-//063
-//064
- 06EB6C3B004099E7CE6F79C2 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = quartzShared.h;
- refType = 4;
- };
-//060
-//061
-//062
-//063
-//064
//080
//081
//082
@@ -290,8 +221,6 @@
0127909800074B1A0A000002,
01279092000747AA0A000002,
1C4A3109004D8F24CE6F79C2,
- 014C68EE00ED6A9D7F000001,
- 014C68ED00ED6A9D7F000001,
);
isa = PBXGroup;
name = Classes;
@@ -356,6 +285,8 @@
dependencies = (
6EF065C903D4F0CA006877C2,
6EF065C703D4EE19006877C2,
+ 6E11A986048BDFFB006877C2,
+ 6E7904110500F33B00EEC080,
);
isa = PBXApplicationTarget;
name = XDarwin;
@@ -368,10 +299,42 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>x11app</string>
+ </array>
+ <key>CFBundleTypeName</key>
+ <string>X11 Application</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>****</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ </dict>
+ <dict>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>tool</string>
+ <string>*</string>
+ </array>
+ <key>CFBundleTypeName</key>
+ <string>UNIX Application</string>
+ <key>CFBundleTypeOSTypes</key>
+ <array>
+ <string>****</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Viewer</string>
+ </dict>
+ </array>
<key>CFBundleExecutable</key>
<string>XDarwin</string>
<key>CFBundleGetInfoString</key>
- <string>XDarwin 1.2.0, ©2001-2003 XFree86 Project, Inc.</string>
+ <string>XDarwin 1.3b4, ©2001-2003 XFree86 Project, Inc.</string>
<key>CFBundleIconFile</key>
<string>XDarwin.icns</string>
<key>CFBundleIdentifier</key>
@@ -383,7 +346,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>XDarwin 1.2.0</string>
+ <string>XDarwin 1.3b4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
@@ -548,7 +511,7 @@
};
};
1220774600712D75416877C2 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = Japanese;
path = Japanese.lproj/Localizable.strings;
@@ -579,7 +542,7 @@
);
isa = PBXGroup;
name = IOKit;
- path = ..;
+ path = ../iokit;
refType = 4;
};
//170
@@ -597,6 +560,8 @@
0A79E19E004499A1CE6F79C2,
6EF7C58703D3BC6D00000104,
6EF065C603D4EE19006877C2,
+ 6E11A985048BDFEE006877C2,
+ 6E7904100500F05600EEC080,
);
isa = PBXGroup;
name = Products;
@@ -770,7 +735,9 @@
targets = (
0A79E19F004499A1CE6F79C2,
6EF7C58603D3BC6D00000104,
+ 6E11A984048BDFEE006877C2,
6EF065C503D4EE19006877C2,
+ 6E79040F0500F05600EEC080,
);
};
29B97314FDCFA39411CA2CEA = {
@@ -780,7 +747,10 @@
170DFB0000729C86416877C2,
43B962CE00617089416877C2,
F5614B3D025112D901000114,
+ 6EC4A64C042A9597006877C2,
32FEE13C00E07C3E7F000001,
+ 6EE1214104968658006877C2,
+ 6EC4A66D042A97FC006877C2,
29B97315FDCFA39411CA2CEA,
29B97317FDCFA39411CA2CEA,
29B97323FDCFA39411CA2CEA,
@@ -875,66 +845,14 @@
//324
32FEE13C00E07C3E7F000001 = {
children = (
- F56CBD0D02EB84A801129B8A,
- F56CBD0E02EB84A801129B8A,
- F56CBD0F02EBDCFC01129B8A,
- 014C68F200ED7AD67F000001,
F5269C2D01D5BC3501000001,
F5269C2E01D5BC3501000001,
- 32FEE13E00E07CBE7F000001,
- 32FEE13F00E07CBE7F000001,
- 32FEE14000E07CBE7F000001,
- 32FEE14100E07CBE7F000001,
- 32FEE14200E07CBE7F000001,
- 014C68F300EE5AB97F000001,
- 014C68F400EE5AB97F000001,
- 017D6F4400E861FB7F000001,
- 017D6F4500E861FB7F000001,
- 014C68F700EE678F7F000001,
- 014C68F800EE678F7F000001,
- 32FEE14900E07D317F000001,
);
isa = PBXGroup;
- name = Rootless;
+ name = "Old Cocoa Imp";
path = "";
refType = 4;
};
- 32FEE13E00E07CBE7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootless.h;
- refType = 4;
- };
- 32FEE13F00E07CBE7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessAqua.h;
- refType = 4;
- };
- 32FEE14000E07CBE7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessAquaGlue.c;
- refType = 4;
- };
- 32FEE14100E07CBE7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessAquaImp.h;
- refType = 4;
- };
- 32FEE14200E07CBE7F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessAquaImp.m;
- refType = 4;
- };
- 32FEE14900E07D317F000001 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = rootlessValTree.c;
- refType = 4;
- };
//320
//321
//322
@@ -979,17 +897,19 @@
//434
43B962CE00617089416877C2 = {
children = (
+ 6EE9B21604E859C200CA7FEA,
+ 6E97A0F505079F9100B8294C,
+ 6E5F5F030553815A008FEAD7,
+ 6E5F5F040553815A008FEAD7,
018F40F8003E1979CE6F79C2,
018F40FA003E197ECE6F79C2,
237A34C10076E37E7F000001,
237A34C40076F4F07F000001,
- 3576829A0077B8F17F000001,
- 0338412F0083BFE57F000001,
- 43B962D000617089416877C2,
- 43B962D100617089416877C2,
43B962CF00617089416877C2,
F5582948015DAD3B01000001,
- 06EB6C3B004099E7CE6F79C2,
+ 6E5F5F0105537A5F008FEAD7,
+ 43B962D000617089416877C2,
+ 43B962D100617089416877C2,
02A1FEA8006D38F0416877C2,
);
isa = PBXGroup;
@@ -1051,6 +971,536 @@
//6E2
//6E3
//6E4
+ 6E11A97F048BDFEE006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E11A980048BDFEE006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E11A981048BDFEE006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E11A982048BDFEE006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E11A983048BDFEE006877C2 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E11A984048BDFEE006877C2 = {
+ buildPhases = (
+ 6E11A97F048BDFEE006877C2,
+ 6E11A980048BDFEE006877C2,
+ 6E11A981048BDFEE006877C2,
+ 6E11A982048BDFEE006877C2,
+ 6E11A983048BDFEE006877C2,
+ );
+ buildSettings = {
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = glxCGL;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = bundle;
+ };
+ dependencies = (
+ );
+ isa = PBXBundleTarget;
+ name = glxCGL;
+ productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
+ productName = glxCGL;
+ productReference = 6E11A985048BDFEE006877C2;
+ productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>glxCGL</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>GLX bundle using Apple's OpenGL</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>0.1</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.1</string>
+</dict>
+</plist>
+";
+ };
+ 6E11A985048BDFEE006877C2 = {
+ isa = PBXBundleReference;
+ path = glxCGL.bundle;
+ refType = 3;
+ };
+ 6E11A986048BDFFB006877C2 = {
+ isa = PBXTargetDependency;
+ target = 6E11A984048BDFEE006877C2;
+ };
+ 6E5F5F0005537A1A008FEAD7 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = darwinKeyboard.h;
+ refType = 4;
+ };
+ 6E5F5F0105537A5F008FEAD7 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = quartzKeyboard.c;
+ refType = 4;
+ };
+ 6E5F5F030553815A008FEAD7 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = keysym2ucs.c;
+ refType = 4;
+ };
+ 6E5F5F040553815A008FEAD7 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = keysym2ucs.h;
+ refType = 4;
+ };
+ 6E6656EC048832CF006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = "x-hook.c";
+ refType = 4;
+ };
+ 6E6656ED048832CF006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = "x-hook.h";
+ refType = 4;
+ };
+ 6E6656F0048832EC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = dri.c;
+ refType = 4;
+ };
+ 6E6656F1048832EC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = dri.h;
+ refType = 4;
+ };
+ 6E6656F2048832EC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = dristruct.h;
+ refType = 4;
+ };
+ 6E6656F3048832F9006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = appledri.c;
+ refType = 4;
+ };
+ 6E79040104FD5ED900EEC080 = {
+ children = (
+ 6E79040204FD5EDA00EEC080,
+ 6E79040304FD5EDA00EEC080,
+ 6E79040404FD5EDA00EEC080,
+ );
+ isa = PBXGroup;
+ name = "Safe Alpha";
+ path = safeAlpha;
+ refType = 4;
+ };
+ 6E79040204FD5EDA00EEC080 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = safeAlpha.h;
+ refType = 4;
+ };
+ 6E79040304FD5EDA00EEC080 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = safeAlphaPicture.c;
+ refType = 4;
+ };
+ 6E79040404FD5EDA00EEC080 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = safeAlphaWindow.c;
+ refType = 4;
+ };
+ 6E79040A0500F05600EEC080 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E79040B0500F05600EEC080 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E79040C0500F05600EEC080 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E79040D0500F05600EEC080 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E79040E0500F05600EEC080 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 6E79040F0500F05600EEC080 = {
+ buildPhases = (
+ 6E79040A0500F05600EEC080,
+ 6E79040B0500F05600EEC080,
+ 6E79040C0500F05600EEC080,
+ 6E79040D0500F05600EEC080,
+ 6E79040E0500F05600EEC080,
+ );
+ buildSettings = {
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = xpr;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = bundle;
+ };
+ dependencies = (
+ );
+ isa = PBXBundleTarget;
+ name = xpr;
+ productInstallPath = "$(USER_LIBRARY_DIR)/Bundles";
+ productName = xpr;
+ productReference = 6E7904100500F05600EEC080;
+ productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>xpr</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Xplugin rootless implementation</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>0.1</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.1</string>
+</dict>
+</plist>
+";
+ };
+ 6E7904100500F05600EEC080 = {
+ isa = PBXBundleReference;
+ path = xpr.bundle;
+ refType = 3;
+ };
+ 6E7904110500F33B00EEC080 = {
+ isa = PBXTargetDependency;
+ target = 6E79040F0500F05600EEC080;
+ };
+ 6E97A0F2050798B100B8294C = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = xprAppleWM.c;
+ refType = 4;
+ };
+ 6E97A0F305079B6500B8294C = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = crAppleWM.m;
+ refType = 4;
+ };
+ 6E97A0F505079F9100B8294C = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = applewmExt.h;
+ refType = 4;
+ };
+ 6EA0B3AF0544A9CC006877C2 = {
+ children = (
+ 6EA0B3B00544A9CC006877C2,
+ 6EA0B3B10544A9CC006877C2,
+ 6EA0B3B20544A9CC006877C2,
+ 6EA0B3B30544A9CC006877C2,
+ 6EA0B3B40544A9CC006877C2,
+ 6EA0B3B50544A9CC006877C2,
+ 6EA0B3B60544A9CC006877C2,
+ 6EA0B3B70544A9CC006877C2,
+ );
+ isa = PBXGroup;
+ name = Acceleration;
+ path = accel;
+ refType = 4;
+ };
+ 6EA0B3B00544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlAccel.h;
+ refType = 4;
+ };
+ 6EA0B3B10544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlBlt.c;
+ refType = 4;
+ };
+ 6EA0B3B20544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlCopy.c;
+ refType = 4;
+ };
+ 6EA0B3B30544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlFill.c;
+ refType = 4;
+ };
+ 6EA0B3B40544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlFillRect.c;
+ refType = 4;
+ };
+ 6EA0B3B50544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlFillSpans.c;
+ refType = 4;
+ };
+ 6EA0B3B60544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlGlyph.c;
+ refType = 4;
+ };
+ 6EA0B3B70544A9CC006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rlSolid.c;
+ refType = 4;
+ };
+ 6EA8EEC80445E25C006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessConfig.h;
+ refType = 4;
+ };
+ 6EC4A64C042A9597006877C2 = {
+ children = (
+ 6EC4A65D042A9654006877C2,
+ 6EC4A65E042A9654006877C2,
+ 6EC4A65F042A9654006877C2,
+ 6EA8EEC80445E25C006877C2,
+ 6EC4A661042A9654006877C2,
+ 6EC4A662042A9654006877C2,
+ 6EC4A660042A9654006877C2,
+ 6EC4A663042A9654006877C2,
+ 6EC4A664042A9654006877C2,
+ 6EA0B3AF0544A9CC006877C2,
+ 6E79040104FD5ED900EEC080,
+ );
+ isa = PBXGroup;
+ name = Rootless;
+ path = ../../../miext/rootless;
+ refType = 2;
+ };
+ 6EC4A65D042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootless.h;
+ refType = 4;
+ };
+ 6EC4A65E042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessCommon.c;
+ refType = 4;
+ };
+ 6EC4A65F042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessCommon.h;
+ refType = 4;
+ };
+ 6EC4A660042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessWindow.h;
+ refType = 4;
+ };
+ 6EC4A661042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessScreen.c;
+ refType = 4;
+ };
+ 6EC4A662042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessWindow.c;
+ refType = 4;
+ };
+ 6EC4A663042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessGC.c;
+ refType = 4;
+ };
+ 6EC4A664042A9654006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = rootlessValTree.c;
+ refType = 4;
+ };
+ 6EC4A66D042A97FC006877C2 = {
+ children = (
+ 6EF471A004478DE0006877C2,
+ 6E6656F3048832F9006877C2,
+ 6E6656F0048832EC006877C2,
+ 6E6656F1048832EC006877C2,
+ 6E6656F2048832EC006877C2,
+ 6ECF218404589E4D006877C2,
+ 6E97A0F2050798B100B8294C,
+ 6ECF218604589F40006877C2,
+ 6EF4719E04478B08006877C2,
+ 6EDDB2DF04508B2C006877C2,
+ 6EF471A204479263006877C2,
+ 6EF471A404479263006877C2,
+ 6E6656EC048832CF006877C2,
+ 6E6656ED048832CF006877C2,
+ 6EF471A504479263006877C2,
+ 6EF471A304479263006877C2,
+ );
+ isa = PBXGroup;
+ path = xpr;
+ refType = 4;
+ };
+ 6ECF218404589E4D006877C2 = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = xpr.h;
+ refType = 4;
+ };
+ 6ECF218604589F40006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = xprCursor.c;
+ refType = 4;
+ };
+ 6EDDB2DF04508B2C006877C2 = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = xprScreen.c;
+ refType = 4;
+ };
+ 6EE1214104968658006877C2 = {
+ children = (
+ 6EE1214304968692006877C2,
+ 6EE1214404968692006877C2,
+ 6EE1214204968692006877C2,
+ 6E97A0F305079B6500B8294C,
+ 6EE1214504968692006877C2,
+ 6EE1214604968692006877C2,
+ );
+ isa = PBXGroup;
+ path = cr;
+ refType = 4;
+ };
+ 6EE1214204968692006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = cr.h;
+ refType = 4;
+ };
+ 6EE1214304968692006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XView.m;
+ refType = 4;
+ };
+ 6EE1214404968692006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = XView.h;
+ refType = 4;
+ };
+ 6EE1214504968692006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = crFrame.m;
+ refType = 4;
+ };
+ 6EE1214604968692006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = crScreen.m;
+ refType = 4;
+ };
+ 6EE9B21604E859C200CA7FEA = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = applewm.c;
+ refType = 4;
+ };
6EF065C003D4EE19006877C2 = {
buildActionMask = 2147483647;
files = (
@@ -1153,6 +1603,42 @@
isa = PBXTargetDependency;
target = 6EF7C58603D3BC6D00000104;
};
+ 6EF4719E04478B08006877C2 = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = xprFrame.c;
+ refType = 4;
+ };
+ 6EF471A004478DE0006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = Xplugin.h;
+ refType = 4;
+ };
+ 6EF471A204479263006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = "x-hash.c";
+ refType = 4;
+ };
+ 6EF471A304479263006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = "x-list.h";
+ refType = 4;
+ };
+ 6EF471A404479263006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = "x-hash.h";
+ refType = 4;
+ };
+ 6EF471A504479263006877C2 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = "x-list.c";
+ refType = 4;
+ };
6EF7C58103D3BC6D00000104 = {
buildActionMask = 2147483647;
files = (
@@ -1209,7 +1695,7 @@
);
isa = PBXBundleTarget;
name = glxAGL;
- productName = glxAqua;
+ productName = glxAGL;
productReference = 6EF7C58703D3BC6D00000104;
productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
@@ -1228,7 +1714,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>GLX bundle with AGL</string>
+ <string>GLX bundle using AGL framework</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
@@ -1277,7 +1763,7 @@
refType = 4;
};
F51BF62D02026E1C01000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = Portuguese;
path = Portuguese.lproj/Localizable.strings;
@@ -1336,7 +1822,7 @@
refType = 4;
};
F533213C0193CBC901000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = German;
path = German.lproj/Localizable.strings;
@@ -1395,7 +1881,7 @@
refType = 4;
};
F533214501A4B42501000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = Dutch;
path = Dutch.lproj/Localizable.strings;
@@ -1450,38 +1936,14 @@
path = fullscreen.c;
refType = 4;
};
- F5614B3C0251124C01000114 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = fullscreen.h;
- refType = 4;
- };
F5614B3D025112D901000114 = {
children = (
F5614B3B0251124C01000114,
- F5614B3C0251124C01000114,
+ 3576829A0077B8F17F000001,
+ 0338412F0083BFE57F000001,
);
isa = PBXGroup;
- name = "Full Screen";
- path = "";
- refType = 4;
- };
- F56CBD0D02EB84A801129B8A = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = aqua.h;
- refType = 4;
- };
- F56CBD0E02EB84A801129B8A = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = aquaPicture.c;
- refType = 4;
- };
- F56CBD0F02EBDCFC01129B8A = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = aquaWindow.c;
+ path = fullscreen;
refType = 4;
};
F587E16001924C1D01000001 = {
@@ -1505,7 +1967,7 @@
refType = 4;
};
F587E16301924C5E01000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = Swedish;
path = Swedish.lproj/Localizable.strings;
@@ -1552,7 +2014,7 @@
refType = 4;
};
F58D65DE018F79A001000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = French;
path = French.lproj/Localizable.strings;
@@ -1604,7 +2066,7 @@
refType = 4;
};
F5ACD25FC5B5E9AA01000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = Spanish;
path = Spanish.lproj/Localizable.strings;
@@ -1651,7 +2113,7 @@
refType = 4;
};
F5ACD266C5BE03C501000001 = {
- fileEncoding = 30;
+ fileEncoding = 10;
isa = PBXFileReference;
name = ko;
path = ko.lproj/Localizable.strings;
diff --git a/hw/darwin/quartz/XDarwinStartup.c b/hw/darwin/quartz/XDarwinStartup.c
index 53343aa1e..7b2c89f38 100644
--- a/hw/darwin/quartz/XDarwinStartup.c
+++ b/hw/darwin/quartz/XDarwinStartup.c
@@ -38,16 +38,15 @@
* dealings in this Software without prior written authorization from
* Torrey T. Lyons.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c,v 1.1 2002/03/28 02:21:18 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XDarwinStartup.c,v 1.2 2003/05/14 05:15:56 torrey Exp $ */
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
+#include <errno.h>
#include <sys/syslimits.h>
#include <ApplicationServices/ApplicationServices.h>
-extern int errno;
-
// Macros to build the path name
#ifndef XBINDIR
#define XBINDIR /usr/X11R6/bin
diff --git a/hw/darwin/quartz/XServer.h b/hw/darwin/quartz/XServer.h
index 3eadd650e..58c7ff748 100644
--- a/hw/darwin/quartz/XServer.h
+++ b/hw/darwin/quartz/XServer.h
@@ -29,7 +29,7 @@
* sale, use or other dealings in this Software without prior written
* authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.8 2003/01/23 00:34:26 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.h,v 1.15 2003/11/14 20:27:58 torrey Exp $ */
#define BOOL xBOOL
#include "Xproto.h"
@@ -41,15 +41,14 @@
// server state
int serverState;
NSRecursiveLock *serverLock;
+ NSMutableArray *pendingClients;
BOOL serverVisible;
BOOL rootlessMenuBarVisible;
BOOL queueShowServer;
+ BOOL quitWithoutQuery;
UInt32 mouseState;
- Class windowClass;
-
- // server event queue
BOOL sendServerEvents;
- int eventWriteFD;
+ BOOL x11Active;
// Aqua interface
IBOutlet NSWindow *modeWindow;
@@ -59,6 +58,12 @@
IBOutlet NSWindow *helpWindow;
IBOutlet NSButton *startupHelpButton;
IBOutlet NSPanel *switchWindow;
+
+ // Menu elements setable by Apple-WM extension
+ IBOutlet NSMenu *windowMenu;
+ IBOutlet NSMenuItem *windowSeparator;
+ IBOutlet NSMenu *dockMenu;
+ int checkedWindowItem;
}
- (id)init;
@@ -68,9 +73,11 @@
+ (void)append:(NSString *)value toEnv:(NSString *)name;
+- (BOOL)loadDisplayBundle;
- (void)startX;
- (void)finishStartX;
- (BOOL)startXClients;
+- (void)runClient:(NSString *)filename;
- (void)run;
- (void)toggle;
- (void)showServer:(BOOL)show;
@@ -82,19 +89,36 @@
- (void)sendXEvent:(xEvent *)xe;
- (void)sendShowHide:(BOOL)show;
- (void)clientProcessDone:(int)clientStatus;
+- (void)activateX11:(BOOL)state;
+- (void)windowBecameKey:(NSWindow *)window;
+- (void)setX11WindowList:(NSArray *)list;
+- (void)setX11WindowCheck:(NSNumber *)nn;
// Aqua interface actions
- (IBAction)startFullScreen:(id)sender;
- (IBAction)startRootless:(id)sender;
- (IBAction)closeHelpAndShow:(id)sender;
+- (IBAction)showSwitchPanel:(id)sender;
- (IBAction)showAction:(id)sender;
+- (IBAction)itemSelected:(id)sender;
+- (IBAction)nextWindow:(id)sender;
+- (IBAction)previousWindow:(id)sender;
+- (IBAction)performClose:(id)sender;
+- (IBAction)performMiniaturize:(id)sender;
+- (IBAction)performZoom:(id)sender;
+- (IBAction)bringAllToFront:(id)sender;
+- (IBAction)copy:(id)sender;
// NSApplication delegate
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
+- (void)applicationWillTerminate:(NSNotification *)aNotification;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification;
+- (void)applicationDidHide:(NSNotification *)aNotification;
+- (void)applicationDidUnhide:(NSNotification *)aNotification;
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag;
- (void)applicationWillResignActive:(NSNotification *)aNotification;
- (void)applicationWillBecomeActive:(NSNotification *)aNotification;
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;
// NSPort delegate
- (void)handlePortMessage:(NSPortMessage *)portMessage;
@@ -109,4 +133,3 @@ enum {
server_Quitting,
server_Done
};
-
diff --git a/hw/darwin/quartz/XServer.m b/hw/darwin/quartz/XServer.m
index c57defd53..1be22f82c 100644
--- a/hw/darwin/quartz/XServer.m
+++ b/hw/darwin/quartz/XServer.m
@@ -34,7 +34,7 @@
* sale, use or other dealings in this Software without prior written
* authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.8 2003/01/23 00:34:26 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/XServer.m,v 1.17 2003/11/14 20:27:58 torrey Exp $ */
#include "quartzCommon.h"
@@ -42,7 +42,12 @@
#include "X.h"
#include "Xproto.h"
#include "os.h"
+#include "opaque.h"
#include "darwin.h"
+#include "quartz.h"
+#define _APPLEWM_SERVER_
+#include "applewm.h"
+#include "applewmExt.h"
#undef BOOL
#import "XServer.h"
@@ -64,14 +69,6 @@
#import <IOKit/pwr_mgt/IOPMLib.h>
#import <IOKit/IOMessage.h>
-#define ENQUEUE(xe) \
-{ \
- char byte = 0; \
- DarwinEQEnqueue(xe); \
- /* signal there is an event ready to handle */ \
- write(eventWriteFD, &byte, 1); \
-}
-
// Types of shells
enum {
shell_Unknown,
@@ -90,7 +87,7 @@ static shellList_t const shellList[] = {
{ "sh", shell_Bourne }, // standard Bourne shell
{ "zsh", shell_Bourne }, // Z shell
{ "bash", shell_Bourne }, // GNU Bourne again shell
- { NULL, shell_Unknown }
+ { NULL, shell_Unknown }
};
extern int argcGlobal;
@@ -99,7 +96,6 @@ extern char **envpGlobal;
extern int main(int argc, char *argv[], char *envp[]);
extern void HideMenuBar(void);
extern void ShowMenuBar(void);
-extern void QuartzReallySetCursor();
static void childDone(int sig);
static void powerDidChange(void *x, io_service_t y, natural_t messageType,
void *messageArgument);
@@ -122,15 +118,15 @@ static io_connect_t root_port;
serverState = server_NotStarted;
serverLock = [[NSRecursiveLock alloc] init];
+ pendingClients = nil;
clientPID = 0;
sendServerEvents = NO;
+ x11Active = YES;
serverVisible = NO;
rootlessMenuBarVisible = YES;
queueShowServer = YES;
quartzServerQuitting = NO;
mouseState = 0;
- eventWriteFD = quartzEventWriteFD;
- windowClass = [NSWindow class];
// set up a port to safely send messages to main thread from server thread
signalPort = [[NSPort port] retain];
@@ -145,6 +141,11 @@ static io_connect_t root_port;
[[NSRunLoop currentRunLoop] addPort:signalPort
forMode:NSModalPanelRunLoopMode];
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(windowBecameKey:)
+ name:NSWindowDidBecomeKeyNotification
+ object:nil];
+
return self;
}
@@ -164,7 +165,7 @@ static io_connect_t root_port;
[self showServer:NO];
sendServerEvents = NO;
- if (clientPID != 0 || !quartzStartClients) {
+ if (!quitWithoutQuery && (clientPID != 0 || !quartzStartClients)) {
int but;
but = NSRunAlertPanel(NSLocalizedString(@"Quit X server?",@""),
@@ -270,11 +271,18 @@ static io_connect_t root_port;
break;
case NSLeftMouseDown:
[self getMousePosition:&xe fromEvent:anEvent];
- if (quartzRootless &&
- ! ([anEvent window] &&
- [[anEvent window] isKindOfClass:windowClass])) {
- // Click in non X window - ignore
- return NO;
+ if (quartzRootless) {
+ // Check that event is in X11 window
+ if (!quartzProcs->IsX11Window([anEvent window],
+ [anEvent windowNumber]))
+ {
+ if (x11Active)
+ [self activateX11:NO];
+ return NO;
+ } else {
+ if (!x11Active)
+ [self activateX11:YES];
+ }
}
mouse1Pressed = YES;
xe.u.u.type = ButtonPress;
@@ -310,6 +318,8 @@ static io_connect_t root_port;
break;
case NSKeyDown:
case NSKeyUp:
+ if (!x11Active)
+ return NO;
// If the mouse is not on the valid X display area,
// we don't send the X server key events.
if (![self getMousePosition:&xe fromEvent:nil])
@@ -321,6 +331,8 @@ static io_connect_t root_port;
xe.u.u.detail = [anEvent keyCode];
break;
case NSFlagsChanged:
+ if (!x11Active)
+ return NO;
[self getMousePosition:&xe fromEvent:nil];
xe.u.u.type = kXDarwinUpdateModifiers;
xe.u.clientMessage.u.l.longs0 = flags;
@@ -335,14 +347,13 @@ static io_connect_t root_port;
[self sendXEvent:&xe];
- // Rootless: Send first NSLeftMouseDown to windows and views so window
- // ordering can be suppressed.
+ // Rootless: Send first NSLeftMouseDown to Cocoa windows and views so
+ // window ordering can be suppressed.
// Don't pass further events - they (incorrectly?) bring the window
// forward no matter what.
if (quartzRootless &&
(type == NSLeftMouseDown || type == NSLeftMouseUp) &&
- [anEvent clickCount] == 1 &&
- [[anEvent window] isKindOfClass:windowClass])
+ [anEvent clickCount] == 1 && [anEvent window])
{
return NO;
}
@@ -429,6 +440,27 @@ static io_connect_t root_port;
}
}
+
+// Load the appropriate display mode bundle
+- (BOOL)loadDisplayBundle
+{
+ if (quartzRootless) {
+ NSEnumerator *enumerator = [[Preferences displayModeBundles]
+ objectEnumerator];
+ NSString *bundleName;
+
+ while ((bundleName = [enumerator nextObject])) {
+ if (QuartzLoadDisplayBundle([bundleName cString]))
+ return YES;
+ }
+
+ return NO;
+ } else {
+ return QuartzLoadDisplayBundle("fullscreen.bundle");
+ }
+}
+
+
// Start the X server thread and the client process
- (void)startX
{
@@ -455,6 +487,9 @@ static io_connect_t root_port;
else
NSLog(@"No version");
+ if (![self loadDisplayBundle])
+ [NSApp terminate:nil];
+
// Start the X server thread
serverState = server_Starting;
[NSThread detachNewThreadSelector:@selector(run) toTarget:self
@@ -517,6 +552,19 @@ static io_connect_t root_port;
if (quartzServerQuitting) {
[self quitServer];
[NSApp replyToApplicationShouldTerminate:YES];
+ return;
+ }
+
+ if (pendingClients) {
+ NSEnumerator *enumerator = [pendingClients objectEnumerator];
+ NSString *filename;
+
+ while ((filename = [enumerator nextObject])) {
+ [self runClient:filename];
+ }
+
+ [pendingClients release];
+ pendingClients = nil;
}
}
@@ -666,6 +714,87 @@ static io_connect_t root_port;
return YES;
}
+// Start the specified client in its own task
+// FIXME: This should be unified with startXClients
+- (void)runClient:(NSString *)filename
+{
+ const char *command = [filename UTF8String];
+ const char *shell;
+ const char *argv[5];
+ int child1, child2 = 0;
+ int status;
+
+ shell = getenv("SHELL");
+ if (shell == NULL)
+ shell = "/bin/bash";
+
+ /* At least [ba]sh, [t]csh and zsh all work with this syntax. We
+ need to use an interactive shell to force it to load the user's
+ environment. */
+
+ argv[0] = shell;
+ argv[1] = "-i";
+ argv[2] = "-c";
+ argv[3] = command;
+ argv[4] = NULL;
+
+ /* Do the fork-twice trick to avoid having to reap zombies */
+
+ child1 = fork();
+
+ switch (child1) {
+ case -1: /* error */
+ break;
+
+ case 0: /* child1 */
+ child2 = fork();
+
+ switch (child2) {
+ int max_files, i;
+ char buf[1024], *tem;
+
+ case -1: /* error */
+ _exit(1);
+
+ case 0: /* child2 */
+ /* close all open files except for standard streams */
+ max_files = sysconf(_SC_OPEN_MAX);
+ for (i = 3; i < max_files; i++)
+ close(i);
+
+ /* ensure stdin is on /dev/null */
+ close(0);
+ open("/dev/null", O_RDONLY);
+
+ /* cd $HOME */
+ tem = getenv("HOME");
+ if (tem != NULL)
+ chdir(tem);
+
+ /* Setup environment */
+ snprintf(buf, sizeof(buf), ":%s", display);
+ setenv("DISPLAY", buf, TRUE);
+ tem = getenv("PATH");
+ if (tem != NULL && tem[0] != NULL)
+ snprintf(buf, sizeof(buf), "%s:/usr/X11R6/bin", tem);
+ else
+ snprintf(buf, sizeof(buf), "/bin:/usr/bin:/usr/X11R6/bin");
+ setenv("PATH", buf, TRUE);
+
+ execvp(argv[0], (char **const) argv);
+
+ _exit(2);
+
+ default: /* parent (child1) */
+ _exit(0);
+ }
+ break;
+
+ default: /* parent */
+ waitpid(child1, &status, 0);
+ }
+}
+
// Run the X server thread
- (void)run
{
@@ -712,6 +841,12 @@ static io_connect_t root_port;
[NSApp activateIgnoringOtherApps:YES];
}
+// Show the Aqua-X11 switch panel useful for fullscreen mode
+- (IBAction)showSwitchPanel:(id)sender
+{
+ [switchWindow orderFront:nil];
+}
+
// Show the X server when sent message from GUI
- (IBAction)showAction:(id)sender
{
@@ -787,11 +922,10 @@ static io_connect_t root_port;
if (show) {
if (!quartzRootless) {
- QuartzFSCapture();
+ quartzProcs->CaptureScreens();
HideMenuBar();
}
- xe.u.u.type = kXDarwinShow;
- [self sendXEvent:&xe];
+ [self activateX11:YES];
// the mouse location will have moved; track it
xe.u.u.type = MotionNotify;
@@ -802,14 +936,19 @@ static io_connect_t root_port;
xe.u.clientMessage.u.l.longs0 = [[NSApp currentEvent] modifierFlags];
[self sendXEvent:&xe];
- // put the pasteboard into the X cut buffer
- [self readPasteboard];
+ // If there is no AppleWM-aware cut and paste manager, do what we can.
+ if ((AppleWMSelectedEvents() & AppleWMPasteboardNotifyMask) == 0) {
+ // put the pasteboard into the X cut buffer
+ [self readPasteboard];
+ }
} else {
- // put the X cut buffer on the pasteboard
- [self writePasteboard];
+ // If there is no AppleWM-aware cut and paste manager, do what we can.
+ if ((AppleWMSelectedEvents() & AppleWMPasteboardNotifyMask) == 0) {
+ // put the X cut buffer on the pasteboard
+ [self writePasteboard];
+ }
- xe.u.u.type = kXDarwinHide;
- [self sendXEvent:&xe];
+ [self activateX11:NO];
}
serverVisible = show;
@@ -877,7 +1016,7 @@ static io_connect_t root_port;
}
#endif
- ENQUEUE(xe);
+ DarwinEQEnqueue(xe);
}
// Handle messages from the X server thread
@@ -885,12 +1024,12 @@ static io_connect_t root_port;
{
unsigned msg = [portMessage msgid];
- switch(msg) {
+ switch (msg) {
case kQuartzServerHidden:
// Make sure the X server wasn't queued to be shown again while
// the hide was pending.
if (!quartzRootless && !serverVisible) {
- QuartzFSRelease();
+ quartzProcs->ReleaseScreens();
ShowMenuBar();
}
break;
@@ -908,13 +1047,43 @@ static io_connect_t root_port;
break;
case kQuartzCursorUpdate:
- QuartzReallySetCursor();
+ if (quartzProcs->CursorUpdate)
+ quartzProcs->CursorUpdate();
break;
case kQuartzPostEvent:
{
const xEvent *xe = [[[portMessage components] lastObject] bytes];
- ENQUEUE(xe);
+ DarwinEQEnqueue(xe);
+ break;
+ }
+
+ case kQuartzSetWindowMenu:
+ {
+ NSArray *list;
+ [[[portMessage components] lastObject] getBytes:&list];
+ [self setX11WindowList:list];
+ [list release];
+ break;
+ }
+
+ case kQuartzSetWindowMenuCheck:
+ {
+ int n;
+ [[[portMessage components] lastObject] getBytes:&n];
+ [self setX11WindowCheck:[NSNumber numberWithInt:n]];
+ break;
+ }
+
+ case kQuartzSetFrontProcess:
+ [NSApp activateIgnoringOtherApps:YES];
+ break;
+
+ case kQuartzSetCanQuit:
+ {
+ int n;
+ [[[portMessage components] lastObject] getBytes:&n];
+ quitWithoutQuery = (BOOL) n;
break;
}
@@ -939,6 +1108,234 @@ static io_connect_t root_port;
}
}
+// User selected an X11 window from a menu
+- (IBAction)itemSelected:(id)sender
+{
+ xEvent xe;
+
+ [NSApp activateIgnoringOtherApps:YES];
+
+ // Notify the client of the change through the X server thread
+ xe.u.u.type = kXDarwinControllerNotify;
+ xe.u.clientMessage.u.l.longs0 = AppleWMWindowMenuItem;
+ xe.u.clientMessage.u.l.longs1 = [sender tag];
+ [self sendXEvent:&xe];
+}
+
+// User selected Next from window menu
+- (IBAction)nextWindow:(id)sender
+{
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMNextWindow);
+}
+
+// User selected Previous from window menu
+- (IBAction)previousWindow:(id)sender
+{
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMPreviousWindow);
+}
+
+/*
+ * The XPR implementation handles close, minimize, and zoom actions for X11
+ * windows here, while CR handles these in the NSWindow class.
+ */
+
+// Handle Close from window menu for X11 window in XPR implementation
+- (IBAction)performClose:(id)sender
+{
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMCloseWindow);
+}
+
+// Handle Minimize from window menu for X11 window in XPR implementation
+- (IBAction)performMiniaturize:(id)sender
+{
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMMinimizeWindow);
+}
+
+// Handle Zoom from window menu for X11 window in XPR implementation
+- (IBAction)performZoom:(id)sender
+{
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMZoomWindow);
+}
+
+// Handle "Bring All to Front" from window menu
+- (IBAction)bringAllToFront:(id)sender
+{
+ if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) {
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMBringAllToFront);
+ } else {
+ [NSApp arrangeInFront:nil];
+ }
+}
+
+// This ends up at the end of the responder chain.
+- (IBAction)copy:(id)sender
+{
+ QuartzMessageServerThread(kXDarwinPasteboardNotify, 1,
+ AppleWMCopyToPasteboard);
+}
+
+// Set whether or not X11 is active and should receive all key events
+- (void)activateX11:(BOOL)state
+{
+ if (state) {
+ QuartzMessageServerThread(kXDarwinActivate, 0);
+ }
+ else {
+ QuartzMessageServerThread(kXDarwinDeactivate, 0);
+ }
+
+ x11Active = state;
+}
+
+// Some NSWindow became the key window
+- (void)windowBecameKey:(NSWindow *)window
+{
+ if (quartzProcs->IsX11Window(window, [window windowNumber])) {
+ if (!x11Active)
+ [self activateX11:YES];
+ } else {
+ if (x11Active)
+ [self activateX11:NO];
+ }
+}
+
+// Set the Apple-WM specifiable part of the window menu
+- (void)setX11WindowList:(NSArray *)list
+{
+ NSMenuItem *item;
+ int first, count, i;
+ xEvent xe;
+
+ /* Work backwards so we don't mess up the indices */
+ first = [windowMenu indexOfItem:windowSeparator] + 1;
+ if (first > 0) {
+ count = [windowMenu numberOfItems];
+ for (i = count - 1; i >= first; i--)
+ [windowMenu removeItemAtIndex:i];
+ } else {
+ windowSeparator = (NSMenuItem *)[windowMenu addItemWithTitle:@""
+ action:nil
+ keyEquivalent:@""];
+ }
+
+ count = [dockMenu numberOfItems];
+ for (i = 0; i < count; i++)
+ [dockMenu removeItemAtIndex:0];
+
+ count = [list count];
+
+ for (i = 0; i < count; i++)
+ {
+ NSString *name, *shortcut;
+
+ name = [[list objectAtIndex:i] objectAtIndex:0];
+ shortcut = [[list objectAtIndex:i] objectAtIndex:1];
+
+ item = (NSMenuItem *)[windowMenu addItemWithTitle:name
+ action:@selector(itemSelected:)
+ keyEquivalent:shortcut];
+ [item setTarget:self];
+ [item setTag:i];
+ [item setEnabled:YES];
+
+ item = (NSMenuItem *)[dockMenu insertItemWithTitle:name
+ action:@selector(itemSelected:)
+ keyEquivalent:shortcut atIndex:i];
+ [item setTarget:self];
+ [item setTag:i];
+ [item setEnabled:YES];
+ }
+
+ if (checkedWindowItem >= 0 && checkedWindowItem < count)
+ {
+ item = (NSMenuItem *)[windowMenu itemAtIndex:first + checkedWindowItem];
+ [item setState:NSOnState];
+ item = (NSMenuItem *)[dockMenu itemAtIndex:checkedWindowItem];
+ [item setState:NSOnState];
+ }
+
+ // Notify the client of the change through the X server thread
+ xe.u.u.type = kXDarwinControllerNotify;
+ xe.u.clientMessage.u.l.longs0 = AppleWMWindowMenuNotify;
+ [self sendXEvent:&xe];
+}
+
+// Set the checked item on the Apple-WM specifiable window menu
+- (void)setX11WindowCheck:(NSNumber *)nn
+{
+ NSMenuItem *item;
+ int first, count;
+ int n = [nn intValue];
+
+ first = [windowMenu indexOfItem:windowSeparator] + 1;
+ count = [windowMenu numberOfItems] - first;
+
+ if (checkedWindowItem >= 0 && checkedWindowItem < count)
+ {
+ item = (NSMenuItem *)[windowMenu itemAtIndex:first + checkedWindowItem];
+ [item setState:NSOffState];
+ item = (NSMenuItem *)[dockMenu itemAtIndex:checkedWindowItem];
+ [item setState:NSOffState];
+ }
+ if (n >= 0 && n < count)
+ {
+ item = (NSMenuItem *)[windowMenu itemAtIndex:first + n];
+ [item setState:NSOnState];
+ item = (NSMenuItem *)[dockMenu itemAtIndex:n];
+ [item setState:NSOnState];
+ }
+ checkedWindowItem = n;
+}
+
+// Return whether or not a menu item should be enabled
+- (BOOL)validateMenuItem:(NSMenuItem *)item
+{
+ NSMenu *menu = [item menu];
+
+ if (menu == windowMenu && [item tag] == 30) {
+ // Mode switch panel is for fullscreen only
+ return !quartzRootless;
+ }
+ else if ((menu == windowMenu && [item tag] != 40) || menu == dockMenu) {
+ // The special window and dock menu items should not be active unless
+ // there is an AppleWM-aware window manager running.
+ return (AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0;
+ }
+ else {
+ return TRUE;
+ }
+}
+
+/*
+ * Application Delegate Methods
+ */
+
+- (void)applicationDidHide:(NSNotification *)aNotification
+{
+ if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) {
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMHideAll);
+ } else {
+ // FIXME: We need to hide Xplugin windows here
+ }
+}
+
+- (void)applicationDidUnhide:(NSNotification *)aNotification
+{
+ if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) != 0) {
+ QuartzMessageServerThread(kXDarwinControllerNotify, 1,
+ AppleWMShowAll);
+ } else {
+ [NSApp arrangeInFront:nil];
+ }
+}
+
// Called when the user clicks the application icon,
// but not when Cmd-Tab is used.
// Rootless: Don't switch until applicationWillBecomeActive.
@@ -958,8 +1355,38 @@ static io_connect_t root_port;
- (void)applicationWillBecomeActive:(NSNotification *)aNotification
{
- if (quartzRootless)
+ if (quartzRootless) {
[self showServer:YES];
+
+ // If there is no AppleWM-aware window manager, we can't allow
+ // interleaving of Aqua and X11 windows.
+ if ((AppleWMSelectedEvents() & AppleWMControllerNotifyMask) == 0) {
+ [NSApp arrangeInFront:nil];
+ }
+ }
+}
+
+// Called when the user opens a document type that we claim (ie. an X11 executable).
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ if (serverState == server_Running) {
+ [self runClient:filename];
+ return YES;
+ }
+ else if (serverState == server_NotStarted || serverState == server_Starting) {
+ if ([filename UTF8String][0] != ':') { // Ignore display names
+ if (!pendingClients) {
+ pendingClients = [[NSMutableArray alloc] initWithCapacity:1];
+ }
+ [pendingClients addObject:filename];
+ return YES; // Assume it will launch successfully
+ }
+ return NO;
+ }
+
+ // If the server is quitting or done,
+ // its too late to launch new clients this time.
+ return NO;
}
@end
@@ -970,7 +1397,7 @@ static io_connect_t root_port;
// NSPort is not thread safe.
void QuartzMessageMainThread(unsigned msg, void *data, unsigned length)
{
- if (msg == kQuartzPostEvent) {
+ if (length > 0) {
NSData *eventData = [NSData dataWithBytes:data length:length];
NSArray *eventArray = [NSArray arrayWithObject:eventData];
NSPortMessage *newMessage =
@@ -986,6 +1413,36 @@ void QuartzMessageMainThread(unsigned msg, void *data, unsigned length)
}
}
+void
+QuartzSetWindowMenu(int nitems, const char **items,
+ const char *shortcuts)
+{
+ NSMutableArray *array;
+ int i;
+
+ array = [[NSMutableArray alloc] initWithCapacity:nitems];
+
+ for (i = 0; i < nitems; i++) {
+ NSMutableArray *subarray = [NSMutableArray arrayWithCapacity:2];
+ NSString *string = [NSString stringWithUTF8String:items[i]];
+
+ [subarray addObject:string];
+
+ if (shortcuts[i] != 0) {
+ NSString *number = [NSString stringWithFormat:@"%d",
+ shortcuts[i]];
+ [subarray addObject:number];
+ } else
+ [subarray addObject:@""];
+
+ [array addObject:subarray];
+ }
+
+ /* Send the array of strings over to the main thread. */
+ /* Will be released in main thread. */
+ QuartzMessageMainThread(kQuartzSetWindowMenu, &array, sizeof(NSArray *));
+}
+
// Handle SIGCHLD signals
static void childDone(int sig)
{
@@ -1025,5 +1482,5 @@ static void powerDidChange(
}
break;
}
-
+
}
diff --git a/hw/darwin/quartz/pseudoramiX.c b/hw/darwin/quartz/pseudoramiX.c
index e55aabd6f..2dd7c3ae5 100644
--- a/hw/darwin/quartz/pseudoramiX.c
+++ b/hw/darwin/quartz/pseudoramiX.c
@@ -32,7 +32,7 @@ shall not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from Digital
Equipment Corporation.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c,v 1.2 2002/10/16 21:13:33 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.c,v 1.3 2003/04/30 23:15:39 torrey Exp $ */
#include "pseudoramiX.h"
@@ -111,7 +111,7 @@ void PseudoramiXExtensionInit(int argc, char *argv[])
if (noPseudoramiXExtension) return;
- if (pseudoramiXNumScreens == 1 || aquaNumScreens == 1) {
+ if (pseudoramiXNumScreens == 1) {
// Only one screen - disable Xinerama extension.
noPseudoramiXExtension = TRUE;
return;
diff --git a/hw/darwin/quartz/pseudoramiX.h b/hw/darwin/quartz/pseudoramiX.h
index d0d596686..23738cfb3 100644
--- a/hw/darwin/quartz/pseudoramiX.h
+++ b/hw/darwin/quartz/pseudoramiX.h
@@ -1,10 +1,9 @@
/*
* Minimal implementation of PanoramiX/Xinerama
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h,v 1.1 2002/03/28 02:21:18 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/pseudoramiX.h,v 1.2 2003/04/30 23:15:39 torrey Exp $ */
extern int noPseudoramiXExtension;
-extern int aquaNumScreens;
void PseudoramiXAddScreen(int x, int y, int w, int h);
void PseudoramiXExtensionInit(int argc, char *argv[]);
diff --git a/hw/darwin/quartz/quartz.c b/hw/darwin/quartz/quartz.c
index 592a0e4a0..4643886f3 100644
--- a/hw/darwin/quartz/quartz.c
+++ b/hw/darwin/quartz/quartz.c
@@ -29,16 +29,16 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.7 2003/01/23 00:34:26 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.c,v 1.13 2003/11/12 20:21:51 torrey Exp $ */
#include "quartzCommon.h"
#include "quartz.h"
#include "darwin.h"
#include "quartzAudio.h"
-#include "quartzCursor.h"
-#include "fullscreen.h"
-#include "rootlessAqua.h"
#include "pseudoramiX.h"
+#define _APPLEWM_SERVER_
+#include "applewm.h"
+#include "applewmExt.h"
// X headers
#include "scrnintstr.h"
@@ -61,8 +61,8 @@ int quartzServerQuitting = FALSE;
int quartzScreenIndex = 0;
int aquaMenuBarHeight = 0;
int noPseudoramiXExtension = TRUE;
-int aquaNumScreens = 0;
-
+QuartzModeProcsPtr quartzProcs = NULL;
+const char *quartzOpenGLBundle = NULL;
/*
===========================================================================
@@ -73,10 +73,10 @@ int aquaNumScreens = 0;
*/
/*
- * QuartzAddScreen
+ * DarwinModeAddScreen
* Do mode dependent initialization of each screen for Quartz.
*/
-Bool QuartzAddScreen(
+Bool DarwinModeAddScreen(
int index,
ScreenPtr pScreen)
{
@@ -84,34 +84,25 @@ Bool QuartzAddScreen(
QuartzScreenPtr displayInfo = xcalloc(sizeof(QuartzScreenRec), 1);
QUARTZ_PRIV(pScreen) = displayInfo;
- // do full screen or rootless specific initialization
- if (quartzRootless) {
- return AquaAddScreen(index, pScreen);
- } else {
- return QuartzFSAddScreen(index, pScreen);
- }
+ // do Quartz mode specific initialization
+ return quartzProcs->AddScreen(index, pScreen);
}
/*
- * QuartzSetupScreen
+ * DarwinModeSetupScreen
* Finalize mode specific setup of each screen.
*/
-Bool QuartzSetupScreen(
+Bool DarwinModeSetupScreen(
int index,
ScreenPtr pScreen)
{
- // do full screen or rootless specific setup
- if (quartzRootless) {
- if (! AquaSetupScreen(index, pScreen))
- return FALSE;
- } else {
- if (! QuartzFSSetupScreen(index, pScreen))
- return FALSE;
- }
+ // do Quartz mode specific setup
+ if (! quartzProcs->SetupScreen(index, pScreen))
+ return FALSE;
// setup cursor support
- if (! QuartzInitCursor(pScreen))
+ if (! quartzProcs->InitCursor(pScreen))
return FALSE;
return TRUE;
@@ -119,10 +110,10 @@ Bool QuartzSetupScreen(
/*
- * QuartzInitOutput
+ * DarwinModeInitOutput
* Quartz display initialization.
*/
-void QuartzInitOutput(
+void DarwinModeInitOutput(
int argc,
char **argv )
{
@@ -145,13 +136,8 @@ void QuartzInitOutput(
FatalError("Could not register block and wakeup handlers.");
}
- if (quartzRootless) {
- ErrorF("Display mode: Rootless Quartz\n");
- AquaDisplayInit();
- } else {
- ErrorF("Display mode: Full screen Quartz\n");
- QuartzFSDisplayInit();
- }
+ // Do display mode specific initialization
+ quartzProcs->DisplayInit();
// Init PseudoramiX implementation of Xinerama.
// This should be in InitExtensions, but that causes link errors
@@ -163,21 +149,28 @@ void QuartzInitOutput(
/*
- * QuartzInitInput
+ * DarwinModeInitInput
* Inform the main thread the X server is ready to handle events.
*/
-void QuartzInitInput(
+void DarwinModeInitInput(
int argc,
char **argv )
{
- QuartzMessageMainThread(kQuartzServerStarted, NULL, 0);
+ if (serverGeneration == 1) {
+ QuartzMessageMainThread(kQuartzServerStarted, NULL, 0);
+ }
+
+ // Do final display mode specific initialization before handling events
+ if (quartzProcs->InitInput)
+ quartzProcs->InitInput(argc, argv);
}
/*
* QuartzShow
* Show the X server on screen. Does nothing if already shown.
- * Restore the X clip regions and the X server cursor state.
+ * Calls mode specific screen resume to restore the X clip regions
+ * (if needed) and the X server cursor state.
*/
static void QuartzShow(
int x, // cursor location
@@ -189,9 +182,7 @@ static void QuartzShow(
quartzServerVisible = TRUE;
for (i = 0; i < screenInfo.numScreens; i++) {
if (screenInfo.screens[i]) {
- QuartzResumeXCursor(screenInfo.screens[i], x, y);
- if (!quartzRootless)
- xf86SetRootClip(screenInfo.screens[i], TRUE);
+ quartzProcs->ResumeScreen(screenInfo.screens[i], x, y);
}
}
}
@@ -201,8 +192,8 @@ static void QuartzShow(
/*
* QuartzHide
* Remove the X server display from the screen. Does nothing if already
- * hidden. Set X clip regions to prevent drawing, and restore the Aqua
- * cursor.
+ * hidden. Calls mode specific screen suspend to set X clip regions to
+ * prevent drawing (if needed) and restore the Aqua cursor.
*/
static void QuartzHide(void)
{
@@ -211,9 +202,7 @@ static void QuartzHide(void)
if (quartzServerVisible) {
for (i = 0; i < screenInfo.numScreens; i++) {
if (screenInfo.screens[i]) {
- QuartzSuspendXCursor(screenInfo.screens[i]);
- if (!quartzRootless)
- xf86SetRootClip(screenInfo.screens[i], FALSE);
+ quartzProcs->SuspendScreen(screenInfo.screens[i]);
}
}
}
@@ -243,20 +232,58 @@ static void QuartzSetRootClip(
/*
- * QuartzProcessEvent
+ * QuartzMessageServerThread
+ * Send the X server thread a message by placing it on the event queue.
+ */
+void
+QuartzMessageServerThread(
+ int type,
+ int argc, ...)
+{
+ xEvent xe;
+ INT32 *argv;
+ int i, max_args;
+ va_list args;
+
+ memset(&xe, 0, sizeof(xe));
+ xe.u.u.type = type;
+ xe.u.clientMessage.u.l.type = type;
+
+ argv = &xe.u.clientMessage.u.l.longs0;
+ max_args = 4;
+
+ if (argc > 0 && argc <= max_args) {
+ va_start (args, argc);
+ for (i = 0; i < argc; i++)
+ argv[i] = (int) va_arg (args, int);
+ va_end (args);
+ }
+
+ DarwinEQEnqueue(&xe);
+}
+
+
+/*
+ * DarwinModeProcessEvent
* Process Quartz specific events.
*/
-void QuartzProcessEvent(
+void DarwinModeProcessEvent(
xEvent *xe)
{
switch (xe->u.u.type) {
- case kXDarwinShow:
+ case kXDarwinActivate:
QuartzShow(xe->u.keyButtonPointer.rootX,
xe->u.keyButtonPointer.rootY);
+ AppleWMSendEvent(AppleWMActivationNotify,
+ AppleWMActivationNotifyMask,
+ AppleWMIsActive, 0);
break;
- case kXDarwinHide:
+ case kXDarwinDeactivate:
+ AppleWMSendEvent(AppleWMActivationNotify,
+ AppleWMActivationNotifyMask,
+ AppleWMIsInactive, 0);
QuartzHide();
break;
@@ -276,18 +303,42 @@ void QuartzProcessEvent(
QuartzWritePasteboard();
break;
+ /*
+ * AppleWM events
+ */
+ case kXDarwinControllerNotify:
+ AppleWMSendEvent(AppleWMControllerNotify,
+ AppleWMControllerNotifyMask,
+ xe->u.clientMessage.u.l.longs0,
+ xe->u.clientMessage.u.l.longs1);
+ break;
+
+ case kXDarwinPasteboardNotify:
+ AppleWMSendEvent(AppleWMPasteboardNotify,
+ AppleWMPasteboardNotifyMask,
+ xe->u.clientMessage.u.l.longs0,
+ xe->u.clientMessage.u.l.longs1);
+ break;
+
+ case kXDarwinDisplayChanged:
+ case kXDarwinWindowState:
+ case kXDarwinWindowMoved:
+ // FIXME: Not implemented yet
+ break;
+
default:
- ErrorF("Unknown application defined event.\n");
+ ErrorF("Unknown application defined event type %d.\n",
+ xe->u.u.type);
}
}
/*
- * QuartzGiveUp
+ * DarwinModeGiveUp
* Cleanup before X server shutdown
* Release the screen and restore the Aqua cursor.
*/
-void QuartzGiveUp(void)
+void DarwinModeGiveUp(void)
{
#if 0
// Trying to switch cursors when quitting causes deadlock
@@ -301,5 +352,5 @@ void QuartzGiveUp(void)
#endif
if (!quartzRootless)
- QuartzFSRelease();
+ quartzProcs->ReleaseScreens();
}
diff --git a/hw/darwin/quartz/quartz.h b/hw/darwin/quartz/quartz.h
index cd4f732f3..849e10cef 100644
--- a/hw/darwin/quartz/quartz.h
+++ b/hw/darwin/quartz/quartz.h
@@ -1,11 +1,11 @@
/*
* quartz.h
*
- * External interface of the Quartz modes seen by the generic, mode
+ * External interface of the Quartz display modes seen by the generic, mode
* independent parts of the Darwin X server.
*/
/*
- * Copyright (c) 2001-2002 Greg Parker and Torrey T. Lyons.
+ * Copyright (c) 2001-2003 Greg Parker and Torrey T. Lyons.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -30,21 +30,88 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.4 2002/11/20 23:51:58 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartz.h,v 1.7 2003/11/12 20:21:51 torrey Exp $ */
#ifndef _QUARTZ_H
#define _QUARTZ_H
-#include "screenint.h"
-#include "Xproto.h"
#include "quartzPasteboard.h"
-int QuartzProcessArgument(int argc, char *argv[], int i);
-void QuartzInitOutput(int argc, char **argv);
-void QuartzInitInput(int argc, char **argv);
-Bool QuartzAddScreen(int index, ScreenPtr pScreen);
-Bool QuartzSetupScreen(int index, ScreenPtr pScreen);
-void QuartzGiveUp(void);
-void QuartzProcessEvent(xEvent *xe);
+#include "screenint.h"
+#include "window.h"
+
+/*------------------------------------------
+ Quartz display mode function types
+ ------------------------------------------*/
+
+/*
+ * Display mode initialization
+ */
+typedef void (*DisplayInitProc)(void);
+typedef Bool (*AddScreenProc)(int index, ScreenPtr pScreen);
+typedef Bool (*SetupScreenProc)(int index, ScreenPtr pScreen);
+typedef void (*InitInputProc)(int argc, char **argv);
+
+/*
+ * Cursor functions
+ */
+typedef Bool (*InitCursorProc)(ScreenPtr pScreen);
+typedef void (*CursorUpdateProc)(void);
+
+/*
+ * Suspend and resume X11 activity
+ */
+typedef void (*SuspendScreenProc)(ScreenPtr pScreen);
+typedef void (*ResumeScreenProc)(ScreenPtr pScreen, int x, int y);
+typedef void (*CaptureScreensProc)(void);
+typedef void (*ReleaseScreensProc)(void);
+
+/*
+ * Rootless helper functions
+ */
+typedef Bool (*IsX11WindowProc)(void *nsWindow, int windowNumber);
+
+/*
+ * Rootless functions for optional export to GLX layer
+ */
+typedef void * (*FrameForWindowProc)(WindowPtr pWin, Bool create);
+typedef WindowPtr (*TopLevelParentProc)(WindowPtr pWindow);
+typedef Bool (*CreateSurfaceProc)
+ (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
+ unsigned int client_id, unsigned int *surface_id,
+ unsigned int key[2], void (*notify) (void *arg, void *data),
+ void *notify_data);
+typedef Bool (*DestroySurfaceProc)
+ (ScreenPtr pScreen, Drawable id, DrawablePtr pDrawable,
+ void (*notify) (void *arg, void *data), void *notify_data);
+
+/*
+ * Quartz display mode function list
+ */
+typedef struct _QuartzModeProcs {
+ DisplayInitProc DisplayInit;
+ AddScreenProc AddScreen;
+ SetupScreenProc SetupScreen;
+ InitInputProc InitInput;
+
+ InitCursorProc InitCursor;
+ CursorUpdateProc CursorUpdate; // Not used if NULL
+
+ SuspendScreenProc SuspendScreen;
+ ResumeScreenProc ResumeScreen;
+ CaptureScreensProc CaptureScreens; // Only called in fullscreen
+ ReleaseScreensProc ReleaseScreens; // Only called in fullscreen
+
+ IsX11WindowProc IsX11Window;
+
+ FrameForWindowProc FrameForWindow;
+ TopLevelParentProc TopLevelParent;
+ CreateSurfaceProc CreateSurface;
+ DestroySurfaceProc DestroySurface;
+} QuartzModeProcsRec, *QuartzModeProcsPtr;
+
+extern QuartzModeProcsPtr quartzProcs;
+
+Bool QuartzLoadDisplayBundle(const char *dpyBundleName);
#endif
diff --git a/hw/darwin/quartz/quartzAudio.c b/hw/darwin/quartz/quartzAudio.c
index 2dfb313b7..a3e6af127 100644
--- a/hw/darwin/quartz/quartzAudio.c
+++ b/hw/darwin/quartz/quartzAudio.c
@@ -35,7 +35,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c,v 1.1 2002/03/28 02:21:18 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c,v 1.2 2003/05/14 05:27:56 torrey Exp $ */
#include "quartzCommon.h"
#include "quartzAudio.h"
@@ -242,10 +242,10 @@ static void QuartzCoreAudioBell(
/*
- * QuartzBell
+ * DarwinModeBell
* Ring the bell
*/
-void QuartzBell(
+void DarwinModeBell(
int volume, // volume in percent of max
DeviceIntPtr pDevice,
pointer ctrl,
diff --git a/hw/darwin/quartz/quartzCocoa.m b/hw/darwin/quartz/quartzCocoa.m
index d6d9bbe32..bba71c041 100644
--- a/hw/darwin/quartz/quartzCocoa.m
+++ b/hw/darwin/quartz/quartzCocoa.m
@@ -33,12 +33,17 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.3 2003/01/19 06:52:54 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCocoa.m,v 1.4 2003/05/14 05:27:56 torrey Exp $ */
+
+#include "quartzCommon.h"
+
+#define BOOL xBOOL
+#include "darwin.h"
+#undef BOOL
#include <Cocoa/Cocoa.h>
#import "Preferences.h"
-#include "quartzCommon.h"
#include "pseudoramiX.h"
extern void FatalError(const char *, ...);
@@ -57,7 +62,7 @@ void QuartzReadPreferences(void)
darwinFakeButtons = [Preferences fakeButtons];
darwinFakeMouse2Mask = [Preferences button2Mask];
darwinFakeMouse3Mask = [Preferences button3Mask];
- quartzMouseAccelChange = [Preferences mouseAccelChange];
+ darwinMouseAccelChange = [Preferences mouseAccelChange];
quartzUseSysBeep = [Preferences systemBeep];
// quartzRootless has already been set
diff --git a/hw/darwin/quartz/quartzCommon.h b/hw/darwin/quartz/quartzCommon.h
index 6c375bd04..e3ae4b850 100644
--- a/hw/darwin/quartz/quartzCommon.h
+++ b/hw/darwin/quartz/quartzCommon.h
@@ -31,7 +31,7 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h,v 1.8 2003/01/23 00:34:26 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h,v 1.14 2003/11/12 20:21:51 torrey Exp $ */
#ifndef _QUARTZCOMMON_H
#define _QUARTZCOMMON_H
@@ -48,8 +48,6 @@
#undef WindowPtr
#undef Picture
-#include "quartzShared.h"
-
// Quartz specific per screen storage structure
typedef struct {
// List of CoreGraphics displays that this X11 screen covers.
@@ -78,11 +76,17 @@ extern int quartzServerQuitting;
extern int quartzScreenIndex;
extern int aquaMenuBarHeight;
+// Name of GLX bundle for native OpenGL
+extern const char *quartzOpenGLBundle;
+
void QuartzReadPreferences(void);
void QuartzMessageMainThread(unsigned msg, void *data, unsigned length);
+void QuartzMessageServerThread(int type, int argc, ...);
+void QuartzSetWindowMenu(int nitems, const char **items,
+ const char *shortcuts);
void QuartzFSCapture(void);
void QuartzFSRelease(void);
-int QuartzFSUseQDCursor(int depth);
+int QuartzFSUseQDCursor(int depth);
void QuartzBlockHandler(void *blockData, void *pTimeout, void *pReadmask);
void QuartzWakeupHandler(void *blockData, int result, void *pReadmask);
@@ -92,7 +96,11 @@ enum {
kQuartzServerStarted,
kQuartzServerDied,
kQuartzCursorUpdate,
- kQuartzPostEvent
+ kQuartzPostEvent,
+ kQuartzSetWindowMenu,
+ kQuartzSetWindowMenuCheck,
+ kQuartzSetFrontProcess,
+ kQuartzSetCanQuit
};
#endif /* _QUARTZCOMMON_H */
diff --git a/hw/darwin/quartz/quartzStartup.c b/hw/darwin/quartz/quartzStartup.c
index dfa7b8166..bb7c7d214 100644
--- a/hw/darwin/quartz/quartzStartup.c
+++ b/hw/darwin/quartz/quartzStartup.c
@@ -28,13 +28,14 @@
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
-/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzStartup.c,v 1.3 2003/01/19 06:35:13 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/darwin/quartz/quartzStartup.c,v 1.9 2003/11/15 00:07:09 torrey Exp $ */
#include <fcntl.h>
#include <unistd.h>
#include <CoreFoundation/CoreFoundation.h>
#include "quartzCommon.h"
#include "darwin.h"
+#include "quartz.h"
#include "opaque.h"
#include "micmap.h"
@@ -50,6 +51,8 @@ static GlxExtensionInitPtr GlxExtensionInit = NULL;
typedef void (*GlxWrapInitVisualsPtr)(miInitVisualsProcPtr *);
static GlxWrapInitVisualsPtr GlxWrapInitVisuals = NULL;
+typedef Bool (*QuartzModeBundleInitPtr)(void);
+
/*
* DarwinHandleGUI
@@ -76,19 +79,25 @@ void DarwinHandleGUI(
// Make a pipe to pass events
assert( pipe(fd) == 0 );
- darwinEventFD = fd[0];
- quartzEventWriteFD = fd[1];
- fcntl(darwinEventFD, F_SETFL, O_NONBLOCK);
+ darwinEventReadFD = fd[0];
+ darwinEventWriteFD = fd[1];
+ fcntl(darwinEventReadFD, F_SETFL, O_NONBLOCK);
// Store command line arguments to pass back to main()
argcGlobal = argc;
argvGlobal = argv;
envpGlobal = envp;
- // Determine if we need to start X clients
- // and what display mode to use
quartzStartClients = 1;
for (i = 1; i < argc; i++) {
+ // Display version info without starting Mac OS X UI if requested
+ if (!strcmp( argv[i], "-showconfig" ) || !strcmp( argv[i], "-version" )) {
+ DarwinPrintBanner();
+ exit(0);
+ }
+
+ // Determine if we need to start X clients
+ // and what display mode to use
if (!strcmp(argv[i], "-nostartx")) {
quartzStartClients = 0;
} else if (!strcmp( argv[i], "-fullscreen")) {
@@ -98,13 +107,70 @@ void DarwinHandleGUI(
}
}
- quartz = TRUE;
main_exit = NSApplicationMain(argc, argv);
exit(main_exit);
}
/*
+ * QuartzLoadDisplayBundle
+ * Try to load the appropriate bundle containing the back end display code.
+ */
+Bool QuartzLoadDisplayBundle(
+ const char *dpyBundleName)
+{
+ CFBundleRef mainBundle;
+ CFStringRef bundleName;
+ CFURLRef bundleURL;
+ CFBundleRef dpyBundle;
+ QuartzModeBundleInitPtr bundleInit;
+
+ // Get the main bundle for the application
+ mainBundle = CFBundleGetMainBundle();
+
+ // Make CFString from bundle name
+ bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault,
+ dpyBundleName,
+ kCFStringEncodingASCII,
+ kCFAllocatorNull);
+
+ // Look for the appropriate bundle in the main bundle
+ bundleURL = CFBundleCopyResourceURL(mainBundle, bundleName,
+ NULL, NULL);
+ if (!bundleURL) {
+ ErrorF("Could not find display mode bundle %s.\n", dpyBundleName);
+ return FALSE;
+ }
+
+ // Make a bundle instance using the URLRef
+ dpyBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL);
+
+ if (!CFBundleLoadExecutable(dpyBundle)) {
+ ErrorF("Could not load display mode bundle %s.\n", dpyBundleName);
+ return FALSE;
+ }
+
+ // Lookup the bundle initialization function
+ bundleInit = (void *)
+ CFBundleGetFunctionPointerForName(dpyBundle,
+ CFSTR("QuartzModeBundleInit"));
+ if (!bundleInit) {
+ ErrorF("Could not initialize display mode bundle %s.\n",
+ dpyBundleName);
+ return FALSE;
+ }
+ if (!bundleInit())
+ return FALSE;
+
+ // Release the CF objects
+ CFRelease(bundleName);
+ CFRelease(bundleURL);
+
+ return TRUE;
+}
+
+
+/*
* LoadGlxBundle
* The Quartz mode X server needs to dynamically load the appropriate
* bundle before initializing GLX.
@@ -122,10 +188,14 @@ static void LoadGlxBundle(void)
// Choose the bundle to load
ErrorF("Loading GLX bundle ");
if (quartzUseAGL) {
- bundleName = CFSTR("glxAGL.bundle");
- ErrorF("glxAGL.bundle (using Apple's OpenGL)\n");
+ bundleName = CFStringCreateWithCStringNoCopy(kCFAllocatorDefault,
+ quartzOpenGLBundle,
+ kCFStringEncodingASCII,
+ kCFAllocatorNull);
+ ErrorF("%s (using Apple's OpenGL)\n", quartzOpenGLBundle);
} else {
bundleName = CFSTR("glxMesa.bundle");
+ CFRetain(bundleName); // so we can release later
ErrorF("glxMesa.bundle (using Mesa)\n");
}
@@ -155,7 +225,7 @@ static void LoadGlxBundle(void)
}
// Release the CF objects
- CFRelease(mainBundle);
+ CFRelease(bundleName);
CFRelease(bundleURL);
}
@@ -186,7 +256,7 @@ void DarwinGlxWrapInitVisuals(
}
-int QuartzProcessArgument( int argc, char *argv[], int i )
+int DarwinModeProcessArgument( int argc, char *argv[], int i )
{
// fullscreen: CoreGraphics full-screen mode
// rootless: Cocoa rootless mode
@@ -208,7 +278,7 @@ int QuartzProcessArgument( int argc, char *argv[], int i )
QUARTZ_SAFETY_DELAY );
#endif
return 1;
- }
+ }
if ( !strcmp( argv[i], "-quartz" ) ) {
ErrorF( "Running in parallel with Mac OS X Quartz window server.\n" );
diff --git a/hw/darwin/utils/dumpkeymap.c b/hw/darwin/utils/dumpkeymap.c
index c1b6ea15b..a264cbc10 100644
--- a/hw/darwin/utils/dumpkeymap.c
+++ b/hw/darwin/utils/dumpkeymap.c
@@ -1,4 +1,4 @@
-// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c,v 1.3 2000/12/05 21:18:34 dawes Exp $
+// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c,v 1.4 2003/04/13 14:52:51 herrb Exp $
//=============================================================================
//
// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com>
@@ -141,6 +141,7 @@
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/stat.h>
#if !defined(DUMPKEYMAP_FILE_ONLY)
#include <drivers/event_status_driver.h>
diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c
index 71d879fa7..345526d19 100644
--- a/hw/vfb/InitInput.c
+++ b/hw/vfb/InitInput.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.9 2001/12/14 19:59:45 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/vfb/InitInput.c,v 3.10 2003/11/16 03:16:59 dawes Exp $ */
#include "X11/X.h"
#define NEED_EVENTS
@@ -41,9 +41,7 @@ from The Open Group.
#include "keysym.h"
Bool
-LegalModifier(key, pDev)
- unsigned int key;
- DevicePtr pDev;
+LegalModifier(unsigned int key, DevicePtr pDev)
{
return TRUE;
}
@@ -63,9 +61,7 @@ KeySym map[MAP_LENGTH * LK201_GLYPHS_PER_KEY];
* easy to lift.
*/
static Bool
-GetLK201Mappings(pKeySyms, pModMap)
- KeySymsPtr pKeySyms;
- CARD8 *pModMap;
+GetLK201Mappings(KeySymsPtr pKeySyms, CARD8 *pModMap)
{
#define INDEX(in) ((in - VFB_MIN_KEY) * LK201_GLYPHS_PER_KEY)
int i;
@@ -257,9 +253,7 @@ GetLK201Mappings(pKeySyms, pModMap)
}
static int
-vfbKeybdProc(pDevice, onoff)
- DeviceIntPtr pDevice;
- int onoff;
+vfbKeybdProc(DeviceIntPtr pDevice, int onoff)
{
KeySymsRec keySyms;
CARD8 modMap[MAP_LENGTH];
@@ -285,9 +279,7 @@ vfbKeybdProc(pDevice, onoff)
}
static int
-vfbMouseProc(pDevice, onoff)
- DeviceIntPtr pDevice;
- int onoff;
+vfbMouseProc(DeviceIntPtr pDevice, int onoff)
{
BYTE map[4];
DevicePtr pDev = (DevicePtr)pDevice;
@@ -317,9 +309,7 @@ vfbMouseProc(pDevice, onoff)
}
void
-InitInput(argc, argv)
- int argc;
- char *argv[];
+InitInput(int argc, char *argv[])
{
DeviceIntPtr p, k;
p = AddInputDevice(vfbMouseProc, TRUE);
@@ -332,26 +322,18 @@ InitInput(argc, argv)
#ifdef XTESTEXT1
void
-XTestGenerateEvent(dev_type, keycode, keystate, mousex, mousey)
- int dev_type;
- int keycode;
- int keystate;
- int mousex;
- int mousey;
+XTestGenerateEvent(int dev_type, int keycode, int keystate, int mousex,
+ int mousey)
{
}
void
-XTestGetPointerPos(fmousex, fmousey)
- short *fmousex, *fmousey;
+XTestGetPointerPos(short *fmousex, short *fmousey)
{
}
void
-XTestJumpPointer(jx, jy, dev_type)
- int jx;
- int jy;
- int dev_type;
+XTestJumpPointer(int jx, int jy, int dev_type)
{
}
#endif
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index 378728c0c..25f426232 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/hw/vfb/InitOutput.c,v 3.22 2003/01/15 02:34:07 torrey Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/vfb/InitOutput.c,v 3.26 2003/11/16 03:16:59 dawes Exp $ */
#if defined(WIN32)
#include <X11/Xwinsock.h>
@@ -66,8 +66,6 @@ from The Open Group.
#include "miline.h"
#include "mfb.h"
-extern char *display;
-
#define VFB_DEFAULT_WIDTH 1280
#define VFB_DEFAULT_HEIGHT 1024
#define VFB_DEFAULT_DEPTH 8
@@ -80,6 +78,7 @@ typedef struct
{
int scrnum;
int width;
+ int paddedBytesWidth;
int paddedWidth;
int height;
int depth;
@@ -92,6 +91,7 @@ typedef struct
Pixel blackPixel;
Pixel whitePixel;
unsigned int lineBias;
+ CloseScreenProcPtr closeScreen;
#ifdef HAS_MMAP
int mmap_fd;
@@ -125,7 +125,7 @@ static Bool Render = TRUE;
static void
-vfbInitializePixmapDepths()
+vfbInitializePixmapDepths(void)
{
int i;
vfbPixmapDepths[1] = TRUE; /* always need bitmaps */
@@ -134,7 +134,7 @@ vfbInitializePixmapDepths()
}
static void
-vfbInitializeDefaultScreens()
+vfbInitializeDefaultScreens(void)
{
int i;
@@ -153,8 +153,7 @@ vfbInitializeDefaultScreens()
}
static int
-vfbBitsPerPixel(depth)
- int depth;
+vfbBitsPerPixel(int depth)
{
if (depth == 1) return 1;
else if (depth <= 8) return 8;
@@ -275,10 +274,7 @@ ddxUseMsg()
}
int
-ddxProcessArgument (argc, argv, i)
- int argc;
- char *argv[];
- int i;
+ddxProcessArgument(int argc, char *argv[], int i)
{
static Bool firstTime = TRUE;
@@ -438,8 +434,7 @@ GetTimeInMillis()
static Bool
-vfbMultiDepthCreateGC(pGC)
- GCPtr pGC;
+vfbMultiDepthCreateGC(GCPtr pGC)
{
switch (vfbBitsPerPixel(pGC->depth))
{
@@ -452,13 +447,13 @@ vfbMultiDepthCreateGC(pGC)
}
static void
-vfbMultiDepthGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart)
- DrawablePtr pDrawable; /* drawable from which to get bits */
- int wMax; /* largest value of all *pwidths */
- register DDXPointPtr ppt; /* points to start copying from */
- int *pwidth; /* list of number of bits to copy */
- int nspans; /* number of scanlines to copy */
- char *pdstStart; /* where to put the bits */
+vfbMultiDepthGetSpans(
+ DrawablePtr pDrawable, /* drawable from which to get bits */
+ int wMax, /* largest value of all *pwidths */
+ register DDXPointPtr ppt, /* points to start copying from */
+ int *pwidth, /* list of number of bits to copy */
+ int nspans, /* number of scanlines to copy */
+ char *pdstStart) /* where to put the bits */
{
switch (pDrawable->bitsPerPixel) {
case 1:
@@ -474,12 +469,9 @@ vfbMultiDepthGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart)
}
static void
-vfbMultiDepthGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine)
- DrawablePtr pDrawable;
- int sx, sy, w, h;
- unsigned int format;
- unsigned long planeMask;
- char *pdstLine;
+vfbMultiDepthGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
+ unsigned int format, unsigned long planeMask,
+ char *pdstLine)
{
switch (pDrawable->bitsPerPixel)
{
@@ -497,9 +489,7 @@ vfbMultiDepthGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine)
static ColormapPtr InstalledMaps[MAXSCREENS];
static int
-vfbListInstalledColormaps(pScreen, pmaps)
- ScreenPtr pScreen;
- Colormap *pmaps;
+vfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
{
/* By the time we are processing requests, we can guarantee that there
* is always a colormap installed */
@@ -509,8 +499,7 @@ vfbListInstalledColormaps(pScreen, pmaps)
static void
-vfbInstallColormap(pmap)
- ColormapPtr pmap;
+vfbInstallColormap(ColormapPtr pmap)
{
int index = pmap->pScreen->myNum;
ColormapPtr oldpmap = InstalledMaps[index];
@@ -568,8 +557,7 @@ vfbInstallColormap(pmap)
}
static void
-vfbUninstallColormap(pmap)
- ColormapPtr pmap;
+vfbUninstallColormap(ColormapPtr pmap)
{
ColormapPtr curpmap = InstalledMaps[pmap->pScreen->myNum];
@@ -585,10 +573,7 @@ vfbUninstallColormap(pmap)
}
static void
-vfbStoreColors(pmap, ndef, pdefs)
- ColormapPtr pmap;
- int ndef;
- xColorItem *pdefs;
+vfbStoreColors(ColormapPtr pmap, int ndef, xColorItem *pdefs)
{
XWDColor *pXWDCmap;
int i;
@@ -623,9 +608,7 @@ vfbStoreColors(pmap, ndef, pdefs)
}
static Bool
-vfbSaveScreen(pScreen, on)
- ScreenPtr pScreen;
- int on;
+vfbSaveScreen(ScreenPtr pScreen, int on)
{
return TRUE;
}
@@ -634,10 +617,7 @@ vfbSaveScreen(pScreen, on)
/* this flushes any changes to the screens out to the mmapped file */
static void
-vfbBlockHandler(blockData, pTimeout, pReadmask)
- pointer blockData;
- OSTimePtr pTimeout;
- pointer pReadmask;
+vfbBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask)
{
int i;
@@ -660,17 +640,13 @@ vfbBlockHandler(blockData, pTimeout, pReadmask)
static void
-vfbWakeupHandler(blockData, result, pReadmask)
- pointer blockData;
- int result;
- pointer pReadmask;
+vfbWakeupHandler(pointer blockData, int result, pointer pReadmask)
{
}
static void
-vfbAllocateMmappedFramebuffer(pvfb)
- vfbScreenInfoPtr pvfb;
+vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb)
{
#define DUMMY_BUFFER_SIZE 65536
char dummyBuffer[DUMMY_BUFFER_SIZE];
@@ -726,8 +702,7 @@ vfbAllocateMmappedFramebuffer(pvfb)
#ifdef HAS_SHM
static void
-vfbAllocateSharedMemoryFramebuffer(pvfb)
- vfbScreenInfoPtr pvfb;
+vfbAllocateSharedMemoryFramebuffer(vfbScreenInfoPtr pvfb)
{
/* create the shared memory segment */
@@ -755,16 +730,11 @@ vfbAllocateSharedMemoryFramebuffer(pvfb)
#endif /* HAS_SHM */
static char *
-vfbAllocateFramebufferMemory(pvfb)
- vfbScreenInfoPtr pvfb;
+vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb)
{
if (pvfb->pfbMemory) return pvfb->pfbMemory; /* already done */
- if (pvfb->bitsPerPixel == 1)
- pvfb->sizeInBytes = (pvfb->paddedWidth * pvfb->height);
- else
- pvfb->sizeInBytes = pvfb->paddedWidth * pvfb->height *
- (pvfb->bitsPerPixel/8);
+ pvfb->sizeInBytes = pvfb->paddedBytesWidth * pvfb->height;
/* Calculate how many entries in colormap. This is rather bogus, because
* the visuals haven't even been set up yet, but we need to know because we
@@ -822,8 +792,7 @@ vfbAllocateFramebufferMemory(pvfb)
static void
-vfbWriteXWDFileHeader(pScreen)
- ScreenPtr pScreen;
+vfbWriteXWDFileHeader(ScreenPtr pScreen)
{
vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
XWDFileHeader *pXWDHeader = pvfb->pXWDHeader;
@@ -852,7 +821,7 @@ vfbWriteXWDFileHeader(pScreen)
pXWDHeader->bitmap_pad = BITMAP_SCANLINE_PAD_PROTO;
#endif
pXWDHeader->bits_per_pixel = pvfb->bitsPerPixel;
- pXWDHeader->bytes_per_line = pvfb->paddedWidth;
+ pXWDHeader->bytes_per_line = pvfb->paddedBytesWidth;
pXWDHeader->ncolors = pvfb->ncolors;
/* visual related fields are written when colormap is installed */
@@ -891,17 +860,13 @@ vfbWriteXWDFileHeader(pScreen)
static Bool
-vfbCursorOffScreen (ppScreen, x, y)
- ScreenPtr *ppScreen;
- int *x, *y;
+vfbCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y)
{
return FALSE;
}
static void
-vfbCrossScreen (pScreen, entering)
- ScreenPtr pScreen;
- Bool entering;
+vfbCrossScreen (ScreenPtr pScreen, Bool entering)
{
}
@@ -913,19 +878,37 @@ static miPointerScreenFuncRec vfbPointerCursorFuncs =
};
static Bool
-vfbScreenInit(index, pScreen, argc, argv)
- int index;
- ScreenPtr pScreen;
- int argc;
- char ** argv;
+vfbCloseScreen(int index, ScreenPtr pScreen)
+{
+ vfbScreenInfoPtr pvfb = &vfbScreens[index];
+ int i;
+
+ pScreen->CloseScreen = pvfb->closeScreen;
+
+ /*
+ * XXX probably lots of stuff to clean. For now,
+ * clear InstalledMaps[] so that server reset works correctly.
+ */
+ for (i = 0; i < MAXSCREENS; i++)
+ InstalledMaps[i] = NULL;
+
+ return pScreen->CloseScreen(index, pScreen);
+}
+
+static Bool
+vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
{
vfbScreenInfoPtr pvfb = &vfbScreens[index];
int dpix = 100, dpiy = 100;
int ret;
char *pbits;
- pvfb->paddedWidth = PixmapBytePad(pvfb->width, pvfb->depth);
+ pvfb->paddedBytesWidth = PixmapBytePad(pvfb->width, pvfb->depth);
pvfb->bitsPerPixel = vfbBitsPerPixel(pvfb->depth);
+ if (pvfb->bitsPerPixel >= 8 )
+ pvfb->paddedWidth = pvfb->paddedBytesWidth / (pvfb->bitsPerPixel / 8);
+ else
+ pvfb->paddedWidth = pvfb->paddedBytesWidth * 8;
pbits = vfbAllocateFramebufferMemory(pvfb);
if (!pbits) return FALSE;
@@ -935,7 +918,7 @@ vfbScreenInit(index, pScreen, argc, argv)
{
case 1:
ret = mfbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
- dpix, dpiy, pvfb->paddedWidth * 8);
+ dpix, dpiy, pvfb->paddedWidth);
break;
case 8:
case 16:
@@ -988,16 +971,16 @@ vfbScreenInit(index, pScreen, argc, argv)
miSetZeroLineBias(pScreen, pvfb->lineBias);
+ pvfb->closeScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = vfbCloseScreen;
+
return ret;
} /* end vfbScreenInit */
void
-InitOutput(screenInfo, argc, argv)
- ScreenInfo *screenInfo;
- int argc;
- char **argv;
+InitOutput(ScreenInfo *screenInfo, int argc, char **argv)
{
int i;
int NumFormats = 0;
@@ -1010,9 +993,16 @@ InitOutput(screenInfo, argc, argv)
vfbPixmapDepths[vfbScreens[i].depth] = TRUE;
}
- /* for RENDER we need 32bpp */
- if (Render)
+ /* RENDER needs a good set of pixmaps. */
+ if (Render) {
+ vfbPixmapDepths[1] = TRUE;
+ vfbPixmapDepths[4] = TRUE;
+ vfbPixmapDepths[8] = TRUE;
+ vfbPixmapDepths[15] = TRUE;
+ vfbPixmapDepths[16] = TRUE;
+ vfbPixmapDepths[24] = TRUE;
vfbPixmapDepths[32] = TRUE;
+ }
for (i = 1; i <= 32; i++)
{
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 allow